1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{7665:function(t){"use strict";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 n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw TypeError(i+" is ambiguous");e[o]=n}var s=t.length,a=t.charAt(0),u=Math.log(s)/Math.log(256),l=Math.log(256)/Math.log(s);function c(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===a;)n++,r++;for(var o=(t.length-r)*u+1>>>0,l=new Uint8Array(o);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var h=0,d=o-1;(0!==c||h<i)&&-1!==d;d--,h++)c+=s*l[d]>>>0,l[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");i=h,r++}for(var f=o-i;f!==o&&0===l[f];)f++;for(var p=new Uint8Array(n+(o-f)),g=n;f!==o;)p[g++]=l[f++];return p}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var u=(o-i)*l+1>>>0,c=new Uint8Array(u);i!==o;){for(var h=e[i],d=0,f=u-1;(0!==h||d<n)&&-1!==f;f--,d++)h+=256*c[f]>>>0,c[f]=h%s>>>0,h=h/s>>>0;if(0!==h)throw Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===c[p];)p++;for(var g=a.repeat(r);p<u;++p)g+=t.charAt(c[p]);return g},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw Error("Non-base"+s+" character")}}}},5019:function(t,e,r){let n=r(7665);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},9386: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(8764);function i(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return i(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}class s{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 a(t,e){return e.property?t+"["+e.property+"]":t}class u extends s{isCount(){throw Error("ExternalLayout is abstract")}}class l extends u{constructor(t,e=0,r){if(!(t instanceof s))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 c||this.layout instanceof h}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)}}class c extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}function d(t){let e=Math.floor(t/4294967296);return{hi32:e,lo32:t-4294967296*e}}
1function f(t,e){return 4294967296*t+e}class p extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return f(r.readUInt32LE(e+4),n)}encode(t,e,r=0){let n=d(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class g extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return f(r.readInt32LE(e+4),n)}encode(t,e,r=0){let n=d(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class m extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof u&&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 u||!(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 u&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(t,e+r),++i}return r}decode(t,e=0){let r=[],n=0,i=this.count;for(i instanceof u&&(i=i.decode(t,e));n<i;)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,i=t.reduce((t,i)=>t+n.encode(i,e,r+t),0);return this.count instanceof u&&this.count.encode(t.length,e,r),i}}class y extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!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 i=n.getSpan(t,e);return e+=i,r+i},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){i(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,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=t[n.property];void 0!==i&&(o=n.encode(i,e,r),0>s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-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)}}}class b{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}class w extends b{constructor(t,e){if(!(t instanceof u&&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)}}class v extends s{constructor(t,e,r){let n;if(t instanceof c||t instanceof h)n=new w(new l(t));else if(t instanceof u&&t.isCount())n=new w(t);else if(t instanceof b)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 s))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 i=-1;e&&0<=(i=e.span)&&(t instanceof c||t instanceof h)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof c||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=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,i=n.decode(t,e),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(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let n=this.getSourceVariant(t);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(t[n.property],e,r),o+i.encode(t[i.property],e,r+o)}return n.encode(t,e,r)}addVariant(t,e,r){let n=new k(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return t instanceof Uint8Array?r=this.discriminator.decode(t,e):r=t,this.registry[r]}}class k extends s{constructor(t,e,r,n){if(!(t instanceof v))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 s))throw TypeError("layout must be a Layout");
1if(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 i=t.span;0>t.span&&0<=(i=r?r.span:0)&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span),super(i,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 i=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),i+=this.layout.getSpan(e,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function S(t){return 0>t&&(t+=4294967296),t}class x extends s{constructor(t,e,r){if(!(t instanceof c||t instanceof h))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=S(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 E(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new _(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}}class E{constructor(t,e,r){if(!(t instanceof x))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");let n=8*t.span,i=t.fields.reduce((t,e)=>t+e.bits,0);if(e+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=n-i-e),this.wordMask=S(this.valueMask<<this.start),this.property=r}decode(t,e){return S(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==S(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=S(t<<this.start);this.container._packedSetValue(S(e&~this.wordMask)|r)}}class _ extends E{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)}}class A extends s{constructor(t,e){if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof u||(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)),o(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof u&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw RangeError("encoding overruns Uint8Array");let i=o(t);return o(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,e,r),n}}e.cv=(t,e,r)=>new l(t,e,r),e.u8=t=>new c(1,t),e.KB=t=>new c(2,t),e.Jq=t=>new c(4,t),e._O=t=>new p(t),e.gM=t=>new g(t),e.n_=(t,e,r)=>new y(t,e,r),e.A9=(t,e,r)=>new m(t,e,r),e.Ik=(t,e)=>new A(t,e)},4177:function(t,e,r){"use strict";r.r(e),r.d(e,{Account:function(){return rp},AddressLookupTableAccount:function(){return nh},AddressLookupTableInstruction:function(){return iX},AddressLookupTableProgram:function(){return i0},Authorized:function(){return oe},BLOCKHASH_CACHE_TIMEOUT_MS:function(){return ny},BPF_LOADER_DEPRECATED_PROGRAM_ID:function(){return rg},BPF_LOADER_PROGRAM_ID:function(){return ni},BpfLoader:function(){return no},COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:function(){return i2},ComputeBudgetInstruction:function(){return i1},ComputeBudgetProgram:function(){return i6},Connection:function(){return iY},Ed25519Program:function(){return i3},Enum:function(){return ru},EpochSchedule:function(){return nu},FeeCalculatorLayout:function(){return r8},Keypair:function(){return iG},LAMPORTS_PER_SOL:function(){return ox},LOOKUP_TABLE_INSTRUCTION_LAYOUTS:function(){return iQ},Loader:function(){return nn},Lockup:function(){return or},MAX_SEED_LENGTH:function(){return rc},Message:function(){return rL},MessageAccountKeys:function(){return rS},MessageV0:function(){return rT},NONCE_ACCOUNT_LENGTH:function(){return r4},NonceAccount:function(){return r5},PACKET_DATA_SIZE:function(){return rm},PUBLIC_KEY_LENGTH:function(){return rh},PublicKey:function(){return rf},SIGNATURE_LENGTH_IN_BYTES:function(){return rb},SOLANA_SCHEMA:function(){return rl},STAKE_CONFIG_ID:function(){return ot},STAKE_INSTRUCTION_LAYOUTS:function(){return oi},SYSTEM_INSTRUCTION_LAYOUTS:function(){return nt},SYSVAR_CLOCK_PUBKEY:function(){return rW},SYSVAR_EPOCH_SCHEDULE_PUBKEY:function(){return rK},SYSVAR_INSTRUCTIONS_PUBKEY:function(){return rq},SYSVAR_RECENT_BLOCKHASHES_PUBKEY:function(){return rF},SYSVAR_RENT_PUBKEY:function(){return rV},SYSVAR_REWARDS_PUBKEY:function(){return rH},SYSVAR_SLOT_HASHES_PUBKEY:function(){return rJ},SYSVAR_SLOT_HISTORY_PUBKEY:function(){return rZ},SYSVAR_STAKE_HISTORY_PUBKEY:function(){return rY},Secp256k1Program:function(){return i9},SendTransactionError:function(){return rG},SolanaJSONRPCError:function(){return rX},SolanaJSONRPCErrorCode:function(){return rQ},StakeAuthorizationLayout:function(){return oo}
1,StakeInstruction:function(){return on},StakeProgram:function(){return os},Struct:function(){return ra},SystemInstruction:function(){return r9},SystemProgram:function(){return ne},Transaction:function(){return rz},TransactionExpiredBlockheightExceededError:function(){return rw},TransactionExpiredNonceInvalidError:function(){return rk},TransactionExpiredTimeoutError:function(){return rv},TransactionInstruction:function(){return rU},TransactionMessage:function(){return r$},TransactionStatus:function(){return rN},VALIDATOR_INFO_KEY:function(){return od},VERSION_PREFIX_MASK:function(){return ry},VOTE_PROGRAM_ID:function(){return og},ValidatorInfo:function(){return op},VersionedMessage:function(){return rC},VersionedTransaction:function(){return rD},VoteAccount:function(){return oy},VoteAuthorizationLayout:function(){return oc},VoteInit:function(){return oa},VoteInstruction:function(){return ou},VoteProgram:function(){return oh},clusterApiUrl:function(){return ok},sendAndConfirmRawTransaction:function(){return oS},sendAndConfirmTransaction:function(){return r0}});var n,i,o,s,a,u={};r.r(u),r.d(u,{Fy:function(){return H},uw:function(){return R},gk:function(){return B},Dd:function(){return J},dQ:function(){return Z},ci:function(){return L},bytesToNumberBE:function(){return z},ty:function(){return $},eV:function(){return q},n$:function(){return Q},ql:function(){return K},hexToBytes:function(){return U},Z2:function(){return V},_t:function(){return P},H9:function(){return te},tL:function(){return D},S5:function(){return W},uz:function(){return T},FF:function(){return tt}});var l=r(8764),c=r(4359);let h=BigInt(4294967296-1),d=BigInt(32);function f(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){let{h:o,l:s}=function(t,e=!1){return e?{h:Number(t&h),l:Number(t>>d&h)}:{h:0|Number(t>>d&h),l:0|Number(t&h)}}(t[i],e);[r[i],n[i]]=[o,s]}return[r,n]}let p=(t,e,r)=>t<<r|e>>>32-r,g=(t,e,r)=>e<<r|t>>>32-r,m=(t,e,r)=>e<<r-32|t>>>64-r,y=(t,e,r)=>t<<r-32|e>>>64-r;var b={split:f,shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>>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,add:function(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/4294967296|0)|0,l:0|i}},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,i)=>e+r+n+i+(t/4294967296|0)|0,add5H:(t,e,r,n,i,o)=>e+r+n+i+o+(t/4294967296|0)|0,add5L:(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},w=r(6409);let[v,k]=b.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
15771202a","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))),S=new Uint32Array(80),x=new Uint32Array(80);class E extends c.VR{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:i,Cl:o,Dh:s,Dl:a,Eh:u,El:l,Fh:c,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[t,e,r,n,i,o,s,a,u,l,c,h,d,f,p,g]}set(t,e,r,n,i,o,s,a,u,l,c,h,d,f,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|u,this.El=0|l,this.Fh=0|c,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(t,e){for(let r=0;r<16;r++,e+=4)S[r]=t.getUint32(e),x[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|S[t-15],r=0|x[t-15],n=b.rotrSH(e,r,1)^b.rotrSH(e,r,8)^b.shrSH(e,r,7),i=b.rotrSL(e,r,1)^b.rotrSL(e,r,8)^b.shrSL(e,r,7),o=0|S[t-2],s=0|x[t-2],a=b.rotrSH(o,s,19)^b.rotrBH(o,s,61)^b.shrSH(o,s,6),u=b.rotrSL(o,s,19)^b.rotrBL(o,s,61)^b.shrSL(o,s,6),l=b.add4L(i,u,x[t-7],x[t-16]),c=b.add4H(l,n,a,S[t-7],S[t-16]);S[t]=0|c,x[t]=0|l}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:c,El:h,Fh:d,Fl:f,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let t=0;t<80;t++){let e=b.rotrSH(c,h,14)^b.rotrSH(c,h,18)^b.rotrBH(c,h,41),w=b.rotrSL(c,h,14)^b.rotrSL(c,h,18)^b.rotrBL(c,h,41),E=c&d^~c&p,_=h&f^~h&g,A=b.add5L(y,w,_,k[t],x[t]),I=b.add5H(A,m,e,E,v[t],S[t]),O=0|A,P=b.rotrSH(r,n,28)^b.rotrBH(r,n,34)^b.rotrBH(r,n,39),B=b.rotrSL(r,n,28)^b.rotrBL(r,n,34)^b.rotrBL(r,n,39),R=r&i^r&s^i&s,M=n&o^n&a^o&a;m=0|p,y=0|g,p=0|d,g=0|f,d=0|c,f=0|h,({h:c,l:h}=b.add(0|u,0|l,0|I,0|O)),u=0|s,l=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let L=b.add3L(O,B,M);r=b.add3H(L,I,P,R),n=0|L}({h:r,l:n}=b.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=b.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=b.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:u,l:l}=b.add(0|this.Dh,0|this.Dl,0|u,0|l)),({h:c,l:h}=b.add(0|this.Eh,0|this.El,0|c,0|h)),({h:d,l:f}=b.add(0|this.Fh,0|this.Fl,0|d,0|f)),({h:p,l:g}=b.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:m,l:y}=b.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(r,n,i,o,s,a,u,l,c,h,d,f,p,g,m,y)}roundClean(){S.fill(0),x.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 _=(0,w.hE)(()=>new E),A=BigInt(0),I=BigInt(1),O=BigInt(2);function P(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function B(t){if(!P(t))throw Error("Uint8Array expected")}function R(t,e){if("boolean"!=typeof e)throw Error(t+" boolean expected, got "+e)}let M=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function L(t){B(t);let e="";for(let r=0;r<t.length;r++)e+=M[t[r]];return e}function T(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function C(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?A:BigInt("0x"+t)}let N={_0:48,_9:57,A:65,F:70,a:97,f:102};function j(t){return t>=N._0&&t<=N._9?t-N._0:t>=N.A&&t<=N.F?t-(N.A-10):t>=N.a&&t<=N.f?t-(N.a-10):void 0}function U(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("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=j(t.charCodeAt(i)),o=j(t.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[i]+t[i+1])+'" at index '+i);n[e]=16*r+o}return n}function z(t){return C(L(t))}function $(t){return B(t),C(L(Uint8Array.from(t).reverse()))}function D(t,e){return U(t.toString(16).padStart(2*e,"0"))}function W(t,e){return D(t,e).reverse()}function K(t,e,r){let n;if("string"==typeof e)try{n=U(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(P(e))n=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(t+" of length "+r+" expected, got "+i);return n}function q(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];B(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}let F=t=>"bigint"==typeof t&&A<=t;function V(t,e,r){return F(t)&&F(e)&&F(r)&&e<=t&&t<r}function H(t,e,r,n){if(!V(e,r,n))throw Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function J(t){let e;for(e=0;t>A;t>>=I,e+=1);return e}let Z=t=>(O<<BigInt(t-1))-I,Y=t=>new Uint8Array(t),G=t=>Uint8Array.from(t);function Q(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=Y(t),i=Y(t),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...t)=>r(i,n,...t),u=(t=Y())=>{i=a(G([0]),t),n=a(),0!==t.length&&(i=a(G([1]),t),n=a())},l=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=a()).slice();r.push(e),t+=n.length}return q(...r)};return(t,e)=>{let r;for(s(),u(t);!(r=e(l()));)u();return s(),r}}let X={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||P(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 tt(t,e,r={}){let n=(e,r,n)=>{let i=X[r];if("function"!=typeof i)throw Error("invalid validator function");let o=t[e];if((!n||void 0!==o)&&!i(o,t))throw Error("param "+String(e)+" is invali
1d. Expected "+r+", got "+o)};for(let[t,r]of Object.entries(e))n(t,r,!1);for(let[t,e]of Object.entries(r))n(t,e,!0);return t}function te(t){let e=new WeakMap;return(r,...n)=>{let i=e.get(r);if(void 0!==i)return i;let o=t(r,...n);return e.set(r,o),o}}let tr=BigInt(0),tn=BigInt(1),ti=BigInt(2),to=BigInt(3),ts=BigInt(4),ta=BigInt(5),tu=BigInt(8);function tl(t,e){let r=t%e;return r>=tr?r:e+r}function tc(t,e,r){let n=t;for(;e-- >tr;)n*=n,n%=r;return n}function th(t,e){if(t===tr)throw Error("invert: expected non-zero number");if(e<=tr)throw Error("invert: expected positive modulus, got "+e);let r=tl(t,e),n=e,i=tr,o=tn,s=tn,a=tr;for(;r!==tr;){let t=n/r,e=n%r,u=i-s*t,l=o-a*t;n=r,r=e,i=s,o=a,s=u,a=l}if(n!==tn)throw Error("invert: does not exist");return tl(i,e)}let td=(t,e)=>(tl(t,e)&tn)===tn,tf=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tp(t,e){let r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function tg(t,e,r=!1,n={}){let i;if(t<=tr)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:s}=tp(t,e);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:s,MASK:Z(o),ZERO:tr,ONE:tn,create:e=>tl(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return tr<=e&&e<t},is0:t=>t===tr,isOdd:t=>(t&tn)===tn,neg:e=>tl(-e,t),eql:(t,e)=>t===e,sqr:e=>tl(e*e,t),add:(e,r)=>tl(e+r,t),sub:(e,r)=>tl(e-r,t),mul:(e,r)=>tl(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<tr)throw Error("invalid exponent, negatives unsupported");if(r===tr)return t.ONE;if(r===tn)return e;let n=t.ONE,i=e;for(;r>tr;)r&tn&&(n=t.mul(n,i)),i=t.sqr(i),r>>=tn;return n})(a,t,e),div:(e,r)=>tl(e*th(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>th(e,t),sqrt:n.sqrt||(e=>(i||(i=function(t){if(t%ts===to){let e=(t+tn)/ts;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%tu===ta){let e=(t-ta)/tu;return function(t,r){let n=t.mul(r,ti),i=t.pow(n,e),o=t.mul(r,i),s=t.mul(t.mul(o,ti),i),a=t.mul(o,t.sub(s,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 i=(t-tn)/ti;for(e=t-tn,r=0;e%ti===tr;e/=ti,r++);for(n=ti;n<t&&function(t,e,r){if(e<tr)throw Error("invalid exponent, negatives unsupported");if(r<=tr)throw Error("invalid modulus");if(r===tn)return tr;let n=tn;for(;e>tr;)e&tn&&(n=n*t%r),t=t*t%r,e>>=tn;return n}(n,i,t)!==t-tn;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let e=(t+tn)/ts;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 o=(e+tn)/ti;return function(t,s){if(t.pow(s,i)===t.neg(t.ONE))throw Error("Cannot find square root");let a=r,u=t.pow(t.mul(t.ONE,n),e),l=t.pow(s,o),c=t.pow(s,e);for(;!t.eql(c,t.ONE);){if(t.eql(c,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(c);e<a&&!t.eql(r,t.ONE);e++)r=t.sqr(r);let r=t.pow(u,tn<<BigInt(a-e-1));u=t.sqr(r),l=t.mul(l,r),c=t.mul(c,u),a=e}return l}}(t)}(t)),i(a,e))),invertBatch:t=>(function(t,e){let r=Array(e.length),n=e.reduce((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n)),t.ONE),i=t.inv(n);return e.reduceRight((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n)),i),r})(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?W(t,s):D(t,s),fromBytes:t=>{if(t.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);return r?$(t):z(t)}});return Object.freeze(a)}function tm(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function ty(t){let e=tm(t);return e+Math.ceil(e/2)}let tb=BigInt(0),tw=BigInt(1);function tv(t,e){let r=e.negate();return t?r:e}function tk(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function tS(t,e){return tk(t,e),{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}let tx=new WeakMap,tE=new WeakMap;function t_(t){return tE.get(t)||1}function tA(t,e){return{constTimeNegate:tv,hasPrecomputes:t=>1!==t_(t),unsafeLadder(e,r,n=t.ZERO){let i=e;for(;r>tb;)r&tw&&(n=n.add(i)),i=i.double(),r>>=tw;return n},precomputeWindow(t,r){let{windows:n,windowSize:i}=tS(r,e),o=[],s=t,a=s;for(let t=0;t<n;t++){a=s,o.push(a);for(let t=1;t<i;t++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let{windows:o,windowSize:s}=tS(r,e),a=t.ZERO,u=t.BASE,l=BigInt(2**r-1),c=2**r,h=BigInt(r);for(let t=0;t<o;t++){let e=t*s,r=Number(i&l);i>>=h,r>s&&(r-=c,i+=tw);let o=e+Math.abs(r)-1,d=t%2!=0,f=r<0;0===r?u=u.add(tv(d,n[e])):a=a.add(tv(f,n[o]))}return{p:a,f:u}},wNAFUnsafe(r,n,i,o=t.ZERO){let{windows:s,windowSize:a}=tS(r,e),u=BigInt(2**r-1),l=2**r,c=BigInt(r);for(let t=0;t<s;t++){let e=t*a;if(i===tb)break;let r=Number(i&u);if(i>>=c,r>a&&(r-=l,i+=tw),0===r)continue;let s=n[e+Math.abs(r)-1];r<0&&(s=s.negate()),o=o.add(s)}return o},getPrecomputes(t,e,r){let n=tx.get(e);
1return n||(n=this.precomputeWindow(e,t),1!==t&&tx.set(e,r(n))),n},wNAFCached(t,e,r){let n=t_(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)},wNAFCachedUnsafe(t,e,r,n){let i=t_(t);return 1===i?this.unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)},setWindowSize(t,r){tk(r,e),tE.set(t,r),tx.delete(t)}}}function tI(t,e,r,n){if(!function(t,e){if(!Array.isArray(t))throw Error("array expected");t.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)})}(r,t),!function(t,e){if(!Array.isArray(t))throw Error("array of scalars expected");t.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)})}(n,e),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=t.ZERO,o=J(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<<s)-1,u=Array(a+1).fill(i),l=Math.floor((e.BITS-1)/s)*s,c=i;for(let t=l;t>=0;t-=s){u.fill(i);for(let e=0;e<n.length;e++){let i=Number(n[e]>>BigInt(t)&BigInt(a));u[i]=u[i].add(r[e])}let e=i;for(let t=u.length-1,r=i;t>0;t--)r=r.add(u[t]),e=e.add(r);if(c=c.add(e),0!==t)for(let t=0;t<s;t++)c=c.double()}return c}function tO(t){return tt(t.Fp,tf.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),tt(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...tp(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}let tP=BigInt(0),tB=BigInt(1),tR=BigInt(2),tM=BigInt(8),tL={zip215:!0},tT=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),tC=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),tN=BigInt(0),tj=BigInt(1),tU=BigInt(2);BigInt(3);let tz=BigInt(5),t$=BigInt(8);function tD(t,e){let r=tl(e*e*e,tT),n=function(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=t*t%tT*t%tT,s=tc(o,tU,tT)*o%tT,a=tc(s,tj,tT)*t%tT,u=tc(a,tz,tT)*a%tT,l=tc(u,e,tT)*u%tT,c=tc(l,r,tT)*l%tT,h=tc(c,n,tT)*c%tT,d=tc(h,i,tT)*h%tT,f=tc(d,i,tT)*h%tT,p=tc(f,e,tT)*u%tT;return{pow_p_5_8:tc(p,tU,tT)*t%tT,b2:o}}(t*tl(r*r*e,tT)).pow_p_5_8,i=tl(t*r*n,tT),o=tl(e*i*i,tT),s=i,a=tl(i*tC,tT),u=o===t,l=o===tl(-t,tT),c=o===tl(-t*tC,tT);return u&&(i=s),(l||c)&&(i=a),td(i,tT)&&(i=tl(-i,tT)),{isValid:u||l,value:i}}let tW=tg(tT,void 0,!0),tK=function(t){let e=function(t){let e=tO(t);return tt(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:i,hash:o,randomBytes:s,nByteLength:a,h:u}=e,l=tR<<BigInt(8*a)-tB,c=r.create,h=tg(e.n,e.nBitLength),d=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:r.sqrt(t*r.inv(e))}}catch(t){return{isValid:!1,value:tP}}}),f=e.adjustScalarBytes||(t=>t),p=e.domain||((t,e,r)=>{if(R("phflag",r),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function g(t,e){H("coordinate "+t,e,tP,l)}function m(t){if(!(t instanceof w))throw Error("ExtendedPoint expected")}let y=te((t,e)=>{let{ex:n,ey:i,ez:o}=t,s=t.is0();null==e&&(e=s?tM:r.inv(o));let a=c(n*e),u=c(i*e),l=c(o*e);if(s)return{x:tP,y:tB};if(l!==tB)throw Error("invZ was invalid");return{x:a,y:u}}),b=te(t=>{let{a:r,d:n}=e;if(t.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=t,u=c(i*i),l=c(o*o),h=c(s*s),d=c(h*h),f=c(u*r);if(c(h*c(f+l))!==c(d+c(n*c(u*l))))throw Error("bad point: equation left != right (1)");if(c(i*o)!==c(s*a))throw Error("bad point: equation left != right (2)");return!0});class w{constructor(t,e,r,n){this.ex=t,this.ey=e,this.ez=r,this.et=n,g("x",t),g("y",e),g("z",r),g("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof w)throw Error("extended point not allowed");let{x:e,y:r}=t||{};return g("x",e),g("y",r),new w(e,r,tB,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(w.fromAffine)}static msm(t,e){return tI(w,h,t,e)}_setWindowSize(t){S.setWindowSize(this,t)}assertValidity(){b(this)}equals(t){m(t);let{ex:e,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=t,a=c(e*s),u=c(i*n),l=c(r*s),h=c(o*n);return a===u&&l===h}is0(){return this.equals(w.ZERO)}negate(){return new w(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){let{a:t}=e,{ex:r,ey:n,ez:i}=this,o=c(r*r),s=c(n*n),a=c(tR*c(i*i)),u=c(t*o),l=r+n,h=c(c(l*l)-o-s),d=u+s,f=d-a,p=u-s,g=c(h*f),m=c(d*p),y=c(h*p);return new w(g,m,c(f*d),y)}add(t){m(t);let{a:r,d:n}=e,{ex:i,ey:o,ez:s,et:a}=this,{ex:u,ey:l,ez:h,et:d}=t;if(r===BigInt(-1)){let t=c((o-i)*(l+u)),e=c((o+i)*(l-u)),r=c(e-t);if(r===tP)return this.double();let n=c(s*tR*d),f=c(a*tR*h),p=f+n,g=e+t,m=f-n,y=c(p*r),b=c(g*m),v=c(p*m);return new w(y,b,c(r*g),v)}let f=c(i*u),p=c(o*l),g=c(a*n*d),y=c(s*h),b=c((i+o)*(u+l)-f-p),v=y-g,k=y+g,S=c(p-r*f),x=c(b*v),E=c(k*S),_=c(b*S);return new w(x,E,c(v*k),_)}subtract(t){return this.add(t.negate())}wNAF(t){return S.wNAFCached(this,t,w.normalizeZ)}multiply(t){H("scalar",t,tB,n);let{p:e,f:r}=this.wNAF(t);return w.normalizeZ([e,r])[0]}multiplyUnsafe(t,e=w.ZERO){return(H("scalar",t,tP,n),t===tP)?k:this.is0()||t===tB?this:S.wNAFCachedUnsafe(this,t,w.normalizeZ,e)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return S.unsafeLadder(this,n).is0()}toAffine(t){return y(this,t)}clearCofactor(){let{h:t}=e;return t===tB?this:this.multiplyUnsafe(t)}static fromHex(t,n=!1){let{d:i,a:o}=e,s=r.BYTES;t=K("pointHex",t,s),R("zip215",n);let a=t.slice(),u=t[s-1];a[s-1]=-129&u;let h=$(a);H("pointHex.y",h,tP,n?l:r.ORDER);let f=c(h*h),{isValid:p,value:g}=d(c(f-tB),c(i*f-o));
1if(!p)throw Error("Point.fromHex: invalid y coordinate");let m=(g&tB)===tB,y=(128&u)!=0;if(!n&&g===tP&&y)throw Error("Point.fromHex: x=0 and x_0=1");return y!==m&&(g=c(-g)),w.fromAffine({x:g,y:h})}static fromPrivateKey(t){return x(t).point}toRawBytes(){let{x:t,y:e}=this.toAffine(),n=W(e,r.BYTES);return n[n.length-1]|=t&tB?128:0,n}toHex(){return L(this.toRawBytes())}}w.BASE=new w(e.Gx,e.Gy,tB,c(e.Gx*e.Gy)),w.ZERO=new w(tP,tB,tB,tP);let{BASE:v,ZERO:k}=w,S=tA(w,8*a);function x(t){let e=r.BYTES;t=K("private key",t,e);let i=K("hashed private key",o(t),2*e),s=f(i.slice(0,e)),a=i.slice(e,2*e),u=tl($(s),n),l=v.multiply(u),c=l.toRawBytes();return{head:s,prefix:a,scalar:u,point:l,pointBytes:c}}function E(t=new Uint8Array,...e){return tl($(o(p(q(...e),K("context",t),!!i))),n)}return v._setWindowSize(8),{CURVE:e,getPublicKey:function(t){return x(t).pointBytes},sign:function(t,e,o={}){t=K("message",t),i&&(t=i(t));let{prefix:s,scalar:a,pointBytes:u}=x(e),l=E(o.context,s,t),c=v.multiply(l).toRawBytes(),h=tl(l+E(o.context,c,u,t)*a,n);return H("signature.s",h,tP,n),K("result",q(c,W(h,r.BYTES)),2*r.BYTES)},verify:function(t,e,n,o=tL){let s,a,u;let{context:l,zip215:c}=o,h=r.BYTES;t=K("signature",t,2*h),e=K("message",e),n=K("publicKey",n,h),void 0!==c&&R("zip215",c),i&&(e=i(e));let d=$(t.slice(h,2*h));try{s=w.fromHex(n,c),a=w.fromHex(t.slice(0,h),c),u=v.multiplyUnsafe(d)}catch(t){return!1}if(!c&&s.isSmallOrder())return!1;let f=E(l,a.toRawBytes(),s.toRawBytes(),e);return a.add(s.multiplyUnsafe(f)).subtract(u).clearCofactor().equals(w.ZERO)},ExtendedPoint:w,utils:{getExtendedPublicKey:x,randomPrivateKey:()=>s(r.BYTES),precompute:(t=8,e=w.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}}({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:tW,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:t$,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:_,randomBytes:w.O6,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:tD});function tq(t){if(!(t instanceof tJ))throw Error("RistrettoPoint expected")}let tF=t=>tD(tj,t),tV=t=>tK.CURVE.Fp.create(null&bytesToNumberLE(t));function tH(t){let{d:e}=tK.CURVE,r=tK.CURVE.Fp.ORDER,n=tK.CURVE.Fp.create,i=n(null*t*t),o=n((i+tj)*null),s=BigInt(-1),a=n((s-e*i)*n(i+e)),{isValid:u,value:l}=tD(o,a),c=n(l*t);isNegativeLE(c,r)||(c=n(-c)),u||(l=c),u||(s=i);let h=n(s*(i-tj)*null-a),d=l*l,f=n((l+l)*a),p=n(null*h),g=n(tj-d),m=n(tj+d);return new tK.ExtendedPoint(n(f*m),n(g*p),n(p*m),n(f*g))}class tJ{constructor(t){this.ep=t}static fromAffine(t){return new tJ(tK.ExtendedPoint.fromAffine(t))}static hashToCurve(t){let e=tH(tV((t=ensureBytes("ristrettoHash",t,64)).slice(0,32))),r=tH(tV(t.slice(32,64)));return new tJ(e.add(r))}static fromHex(t){t=ensureBytes("ristrettoHex",t,32);let{a:e,d:r}=tK.CURVE,n=tK.CURVE.Fp.ORDER,i=tK.CURVE.Fp.create,o="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",s=tV(t);if(!equalBytes(numberToBytesLE(s,32),t)||isNegativeLE(s,n))throw Error(o);let a=i(s*s),u=i(tj+e*a),l=i(tj-e*a),c=i(u*u),h=i(l*l),d=i(e*r*c-h),{isValid:f,value:p}=tF(i(d*h)),g=i(p*l),m=i(p*g*d),y=i((s+s)*g);isNegativeLE(y,n)&&(y=i(-y));let b=i(u*m),w=i(y*b);if(!f||isNegativeLE(w,n)||b===tN)throw Error(o);return new tJ(new tK.ExtendedPoint(y,b,tj,w))}static msm(t,e){return pippenger(tJ,Field(tK.CURVE.n,tK.CURVE.nBitLength),t,e)}toRawBytes(){let t,{ex:e,ey:r,ez:n,et:i}=this.ep,o=tK.CURVE.Fp.ORDER,s=tK.CURVE.Fp.create,a=s(s(n+r)*s(n-r)),u=s(e*r),l=s(u*u),{value:c}=tF(s(a*l)),h=s(c*a),d=s(c*u),f=s(h*d*i);if(isNegativeLE(i*f,o)){let n=s(null*r),i=s(null*e);e=n,r=i,t=s(null*h)}else t=d;isNegativeLE(e*f,o)&&(r=s(-r));let p=s((n-r)*t);return isNegativeLE(p,o)&&(p=s(-p)),numberToBytesLE(p,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(t){tq(t);let{ex:e,ey:r}=this.ep,{ex:n,ey:i}=t.ep,o=tK.CURVE.Fp.create,s=o(e*i)===o(r*n),a=o(r*i)===o(e*n);return s||a}add(t){return tq(t),new tJ(this.ep.add(t.ep))}subtract(t){return tq(t),new tJ(this.ep.subtract(t.ep))}multiply(t){return new tJ(this.ep.multiply(t))}multiplyUnsafe(t){return new tJ(this.ep.multiplyUnsafe(t))}double(){return new tJ(this.ep.double())}negate(){return new tJ(this.ep.negate())}}var tZ=r(3550),tY=r.n(tZ),tG=r(7191),tQ=r.n(tG),tX=r(7748),t0=r(5532),t1=r(9386);function t2([t,e]){return`${t}=${function t(e){return Array.isArray(e)?"%5B"+e.map(t).join("%2C%20")+"%5D":"bigint"==typeof e?`${e}n`:encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?{...e}:e))}(e)}`}
vendor: 7,214 bytes, line 1
1var t6=class extends Error{cause=this.cause;context;constructor(...[t,e]){let r,n;if(e){let{cause:t,...i}=e;t&&(n={cause:t}),Object.keys(i).length>0&&(r=i)}super(function(t,e={}){{let r=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(r+=` '${btoa(Object.entries(e).map(t2).join("&"))}'`),`${r}\``}}(t,r),n),this.context={__code:t,...r},this.name="SolanaError"}};function t8(t){return"fixedSize"in t&&"number"==typeof t.fixedSize}var t3=((n=t3||{})[n.Little=0]="Little",n[n.Big=1]="Big",n);function t4(t){return t?.endian!==1}var t5=(t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,e,r)=>t.setBigUint64(0,BigInt(e),r),size:8}).size,write(t,r,n){e.range&&function(t,e,r,n){if(n<e||n>r)throw new t6(8078011,{codecDescription:t,max:r,min:e,value:n})}(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,t4(e.config)),r.set(new Uint8Array(i),n),n+e.size}},encode:t=>{let e=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(t));return r.write(t,e,0),e}})},t7=(t={})=>{var e,r;return Object.freeze({...r={fixedSize:(e={config:t,get:(t,e)=>t.getBigUint64(0,e),name:"u64",size:8}).size,read(t,r=0){!function(t,e,r=0){if(e.length-r<=0)throw new t6(8078e3,{codecDescription:t})}(e.name,t,r),function(t,e,r,n=0){let i=r.length-n;if(i<e)throw new t6(8078001,{bytesLength:i,codecDescription:t,expected:e})}(e.name,e.size,t,r);let n=new DataView(function(t,e,r){let n=t.byteOffset+(e??0),i=r??t.byteLength;return t.buffer.slice(n,n+i)}(t,r,e.size));return[e.get(n,t4(e.config)),r+e.size]}},decode:(t,e=0)=>r.read(t,e)[0]})},t9=(t={})=>(function(t,e){if(t8(t)!==t8(e))throw new t6(8078004);if(t8(t)&&t8(e)&&t.fixedSize!==e.fixedSize)throw new t6(8078005,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!t8(t)&&!t8(e)&&t.maxSize!==e.maxSize)throw new t6(8078006,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}})(t5(t),t7(t));class et extends TypeError{constructor(t,e){let r;let{message:n,explanation:i,...o}=t,{path:s}=t,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=[t,...e()])}}function ee(t){return"object"==typeof t&&null!=t}function er(t){return ee(t)&&!Array.isArray(t)}function en(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*ei(t,e,r,n){var i;for(let o of(ee(i=t)&&"function"==typeof i[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:i,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${en(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:u}}(o,e,r,n);t&&(yield t)}}function*eo(t,e,r={}){let{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i,mask:s};o&&(t=e.coercer(t,a));let u="valid";for(let n of e.validator(t,a))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[l,c,h]of e.entries(t,a))for(let e of eo(c,h,{path:void 0===l?n:[...n,l],branch:void 0===l?i:[...i,c],coerce:o,mask:s,message:r.message}))e[0]?(u=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):o&&(c=e[1],void 0===l?t=c:t instanceof Map?t.set(l,c):t instanceof Set?t.add(c):ee(t)&&(void 0!==c||l in t)&&(t[l]=c));if("not_valid"!==u)for(let n of e.refiner(t,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,t])}class es{constructor(t){let{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,n?this.validator=(t,e)=>ei(n(t,e),e,this,t):this.validator=()=>[],i?this.refiner=(t,e)=>ei(i(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){return ea(t,this,e)}create(t,e){return eu(t,this,e)}is(t){return!el(t,this)[0]}mask(t,e){return function(t,e,r){let n=el(t,e,{coerce:!0,mask:!0,message:r});if(!n[0])return n[1];throw n[0]}(t,this,e)}validate(t,e={}){return el(t,this,e)}}function ea(t,e,r){let n=el(t,e,{message:r});if(n[0])throw n[0]}function eu(t,e,r){let n=el(t,e,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function el(t,e,r={}){let n=eo(t,e,r),i=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(n);return i[0]?[new et(i[0],function*(){for(let t of n)t[0]&&(yield t[0])}),void 0]:[void 0,i[1]]}function ec(t,e){return new es({type:t,schema:null,validator:e})}function eh(t){return new es({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: ${en(t)}`})}function ed(){return ec("boolean",t=>"boolean"==typeof t)}function ef(t){return ec("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${en(e)}`)}function ep(t){let e=en(t),r=typeof t;return new es({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${en(r)}`})}function eg(t){return new es({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function em(){return ec("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${en(t)}`)}function ey(t){return new es({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function eb(t,e){return new es({type:"record",schema:null,*entries(r){if(ee(r))for(let n in r){let i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>er(t)||`Expected an object, but received: ${en(t)}`,coercer:t=>er(t)?{...t}:t})}function ew(){return ec("string",t=>"string"==typeof t||`Expected a string, but received: ${en(t)}`)}function ev(t){let e=ec("never",()=>!1);return new es({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${en(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function ek(t){let e=Object.keys(t);return new es({type:"type",schema:t,*entries(r){if(ee(r))for(let n of e)yield[n,r[n],t[n]]},validator:t=>er(t)||`Expected an object, but received: ${en(t)}`,coercer:t=>er(t)?{...t}:t})}function eS(t){let e=t.map(t=>t.type).join(" | ");return new es({type:"union",schema:null,coercer(e,r){for(let n of t){let[t,i]=n.validate(e,{coerce:!0,mask:r.mask});if(!t)return i}return e},validator(r,n){let i=[];for(let e of t){let[...t]=eo(r,e,n),[o]=t;if(!o[0])return[];for(let[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${en(r)}`,...i]}})}function ex(){return ec("unknown",()=>!0)}function eE(t,e,r){return new es({...t,coercer:(n,i)=>el(n,e)[0]?t.coercer(n,i):t.coercer(r(n,i),i)})}var e_=r(1198),eA=r.n(e_),eI=r(4790),eO=class extends eI{socket;constructor(t,e,r){super(),this.socket=new window.WebSocket(t,r),this.socket.onopen=()=>
1this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}},eP=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},eB=class extends eI{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...s}={},a,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=a||(()=>++this.rpc_id),u?this.dataPack=u:this.dataPack=new eP,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise((i,o)=>
vendor: 2,474 bytes, line 1
1{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),n,t=>{if(t)return o(t);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,n)=>{if(!this.ready)return n(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return n(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=l.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:n})=>{this.ready&&setTimeout(()=>
1this.emit("close",r,n),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval)))})}},eR=r(3527);let eM=[],eL=[],eT=[],eC=BigInt(0),eN=BigInt(1),ej=BigInt(2),eU=BigInt(7),ez=BigInt(256),e$=BigInt(113);for(let t=0,e=eN,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],eM.push(2*(5*n+r)),eL.push((t+1)*(t+2)/2%64);let i=eC;for(let t=0;t<7;t++)(e=(e<<eN^(e>>eU)*e$)%ez)&ej&&(i^=eN<<(eN<<BigInt(t))-eN);eT.push(i)}let[eD,eW]=f(eT,!0),eK=(t,e,r)=>r>32?m(t,e,r):p(t,e,r),eq=(t,e,r)=>r>32?y(t,e,r):g(t,e,r);class eF extends w.kb{constructor(t,e,r,n=!1,i=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,eR.k8)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,w.Jq)(this.state)}keccak(){w.iA||(0,w.l1)(this.state32),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,i=(e+2)%10,o=r[i],s=r[i+1],a=eK(o,s,1)^r[n],u=eq(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],i=t[3];for(let r=0;r<24;r++){let n=eL[r],o=eK(e,i,n),s=eq(e,i,n),a=eM[r];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}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]^=eD[n],t[1]^=eW[n]}r.fill(0)}(this.state32,this.rounds),w.iA||(0,w.l1)(this.state32),this.posOut=0,this.pos=0}update(t){(0,eR.$h)(this);let{blockLen:e,state:r}=this,n=(t=(0,w.O0)(t)).length;for(let i=0;i<n;){let o=Math.min(e-this.pos,n-i);for(let e=0;e<o;e++)r[this.pos++]^=t[i++];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,eR.$h)(this,!1),(0,eR.gk)(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,eR.k8)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,eR.eB)(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:i,enableXOF:o}=this;return t||(t=new eF(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}let eV=(0,w.hE)(()=>new eF(136,1,32));class eH extends w.kb{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,eR.z3)(t);let r=(0,w.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,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return(0,eR.$h)(this),this.iHash.update(t),this}digestInto(t){(0,eR.$h)(this),(0,eR.gk)(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:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let eJ=(t,e,r)=>new eH(t,e).update(r).digest();function eZ(t){void 0!==t.lowS&&R("lowS",t.lowS),void 0!==t.prehash&&R("prehash",t.prehash)}eJ.create=(t,e)=>new eH(t,e);let{bytesToNumberBE:eY,hexToBytes:eG}=u;
vendor: 4,432 bytes, line 1
1class eQ extends Error{constructor(t=""){super(t)}}let eX={Err:eQ,_tlv:{encode:(t,e)=>{let{Err:r}=eX;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let n=e.length/2,i=T(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?T(i.length/2|128):"";return T(t)+o+i+e},decode(t,e){let{Err:r}=eX,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let i=e[n++],o=0;if(128&i){let t=127&i;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(n,n+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=e.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+o)}}},_int:{encode(t){let{Err:e}=eX;if(t<e0)throw new e("integer: negative integers are not allowed");let r=T(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=eX;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return eY(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=eX,i="string"==typeof t?eG(t):t;B(i);let{v:o,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:u}=n.decode(2,o),{v:l,l:c}=n.decode(2,u);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=eX,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s));return e.encode(48,n+i)}},e0=BigInt(0),e1=BigInt(1),e2=(BigInt(2),BigInt(3));BigInt(4);let e6=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),e8=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),e3=BigInt(1),e4=BigInt(2),e5=(t,e)=>(t+e/e4)/e,e7=tg(e6,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),u=t*t*t%e6,l=u*u*t%e6,c=tc(l,e,e6)*l%e6,h=tc(c,e,e6)*l%e6,d=tc(h,e4,e6)*u%e6,f=tc(d,n,e6)*d%e6,p=tc(f,i,e6)*f%e6,g=tc(p,s,e6)*p%e6,m=tc(g,a,e6)*g%e6,y=tc(m,s,e6)*p%e6,b=tc(y,e,e6)*l%e6,w=tc(b,o,e6)*f%e6,v=tc(w,r,e6)*u%e6,k=tc(v,e4,e6);if(!e7.eql(e7.sqr(k),t))throw Error("Cannot find square root");return k}}),e9=function(t,e){let r=e=>(function(t){let e=function(t){let e=tO(t);return tt(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,i=r.BYTES+1,o=2*r.BYTES+1;function s(t){return tl(t,n)}let{ProjectivePoint:a,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:c}=function(t){let e=function(t){let e=tO(t);tt(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:i}=e;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid 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("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:r}=e,n=tg(e.n,e.nBitLength),i=e.toBytes||((t,e,n)=>{let i=e.toAffine();return q(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),o=e.fromBytes||(t=>{let e=t.subarray(1);return{x:r.fromBytes(e.subarray(0,r.BYTES)),y:r.fromBytes(e.subarray(r.BYTES,2*r.BYTES))}});function s(t){let{a:n,b:i}=e,o=r.sqr(t),s=r.mul(o,t);return r.add(r.add(s,r.mul(t,n)),i)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw Error("bad generator point: equation left != right");function a(t){let r;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:s}=e;if(n&&"bigint"!=typeof t){if(P(t)&&(t=L(t)),"string"!=typeof t||!n.includes(t.length))throw Error("invalid private key");t=t.padStart(2*i,"0")}try{r="bigint"==typeof t?t:z(K("private key",t,i))}catch(e){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof t)}
vendor: 4,237 bytes, line 1
1return o&&(r=tl(r,s)),H("private key",r,e1,s),r}function u(t){if(!(t instanceof h))throw Error("ProjectivePoint expected")}let l=te((t,e)=>{let{px:n,py:i,pz:o}=t;if(r.eql(o,r.ONE))return{x:n,y:i};let s=t.is0();null==e&&(e=s?r.ONE:r.inv(o));let a=r.mul(n,e),u=r.mul(i,e),l=r.mul(o,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:a,y:u}}),c=te(t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.py))return;throw Error("bad point: ZERO")}let{x:n,y:i}=t.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error("bad point: x or y not FE");let o=r.sqr(i),a=s(n);if(!r.eql(o,a))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class h{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");Object.freeze(this)}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 h)throw Error("projective point not allowed");let i=t=>r.eql(t,r.ZERO);return i(e)&&i(n)?h.ZERO:new h(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(h.fromAffine)}static fromHex(t){let e=h.fromAffine(o(K("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(a(t))}static msm(t,e){return tI(h,n,t,e)}_setWindowSize(t){f.setWindowSize(this,t)}assertValidity(){c(this)}hasEvenY(){let{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){u(t);let{px:e,py:n,pz:i}=this,{px:o,py:s,pz:a}=t,l=r.eql(r.mul(e,a),r.mul(o,i)),c=r.eql(r.mul(n,a),r.mul(s,i));return l&&c}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){let{a:t,b:n}=e,i=r.mul(n,e2),{px:o,py:s,pz:a}=this,u=r.ZERO,l=r.ZERO,c=r.ZERO,d=r.mul(o,o),f=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),c=r.mul(o,a),c=r.add(c,c),u=r.mul(t,c),l=r.mul(i,p),l=r.add(u,l),u=r.sub(f,l),l=r.add(f,l),l=r.mul(u,l),u=r.mul(g,u),c=r.mul(i,c),p=r.mul(t,p),g=r.sub(d,p),g=r.mul(t,g),g=r.add(g,c),c=r.add(d,d),d=r.add(c,d),d=r.add(d,p),d=r.mul(d,g),l=r.add(l,d),p=r.mul(s,a),p=r.add(p,p),d=r.mul(p,g),u=r.sub(u,d),c=r.mul(p,f),c=r.add(c,c),new h(u,l,c=r.add(c,c))}add(t){u(t);let{px:n,py:i,pz:o}=this,{px:s,py:a,pz:l}=t,c=r.ZERO,d=r.ZERO,f=r.ZERO,p=e.a,g=r.mul(e.b,e2),m=r.mul(n,s),y=r.mul(i,a),b=r.mul(o,l),w=r.add(n,i),v=r.add(s,a);w=r.mul(w,v),v=r.add(m,y),w=r.sub(w,v),v=r.add(n,o);let k=r.add(s,l);return v=r.mul(v,k),k=r.add(m,b),v=r.sub(v,k),k=r.add(i,o),c=r.add(a,l),k=r.mul(k,c),c=r.add(y,b),k=r.sub(k,c),f=r.mul(p,v),c=r.mul(g,b),f=r.add(c,f),c=r.sub(y,f),f=r.add(y,f),d=r.mul(c,f),y=r.add(m,m),y=r.add(y,m),b=r.mul(p,b),v=r.mul(g,v),y=r.add(y,b),b=r.sub(m,b),b=r.mul(p,b),v=r.add(v,b),m=r.mul(y,v),d=r.add(d,m),m=r.mul(k,v),c=r.mul(w,c),c=r.sub(c,m),m=r.mul(w,y),f=r.mul(k,f),new h(c,d,f=r.add(f,m))}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return f.wNAFCached(this,t,h.normalizeZ)}multiplyUnsafe(t){let{endo:n,n:i}=e;H("scalar",t,e0,i);let o=h.ZERO;if(t===e0)return o;if(this.is0()||t===e1)return this;if(!n||f.hasPrecomputes(this))return f.wNAFCachedUnsafe(this,t,h.normalizeZ);let{k1neg:s,k1:a,k2neg:u,k2:l}=n.splitScalar(t),c=o,d=o,p=this;for(;a>e0||l>e0;)a&e1&&(c=c.add(p)),l&e1&&(d=d.add(p)),p=p.double(),a>>=e1,l>>=e1;return s&&(c=c.negate()),u&&(d=d.negate()),d=new h(r.mul(d.px,n.beta),d.py,d.pz),c.add(d)}multiply(t){let n,i;let{endo:o,n:s}=e;if(H("scalar",t,e1,s),o){let{k1neg:e,k1:s,k2neg:a,k2:u}=o.splitScalar(t),{p:l,f:c}=this.wNAF(s),{p:d,f:p}=this.wNAF(u);l=f.constTimeNegate(e,l),d=f.constTimeNegate(a,d),d=new h(r.mul(d.px,o.beta),d.py,d.pz),n=l.add(d),i=c.add(p)}else{let{p:e,f:r}=this.wNAF(t);n=e,i=r}return h.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(t,e,r){let n=h.BASE,i=(t,e)=>e!==e0&&e!==e1&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){return l(this,t)}isTorsionFree(){let{h:t,isTorsionFree:r}=e;if(t===e1)return!0;
1if(r)return r(h,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:t,clearCofactor:r}=e;return t===e1?this:r?r(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return R("isCompressed",t),this.assertValidity(),i(h,this,t)}toHex(t=!0){return R("isCompressed",t),L(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);let d=e.nBitLength,f=tA(h,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:a,weierstrassEquation:s,isWithinCurveOrder:function(t){return V(t,e1,e.n)}}}({...e,toBytes(t,e,n){let i=e.toAffine(),o=r.toBytes(i.x),s=q;return(R("isCompressed",n),n)?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(t){let e=t.length,n=t[0],s=t.subarray(1);if(e===i&&(2===n||3===n)){let t;let e=z(s);if(!V(e,e1,r.ORDER))throw Error("Point is not on curve");let i=l(e);try{t=r.sqrt(i)}catch(t){throw Error("Point is not on curve"+(t instanceof Error?": "+t.message:""))}return(1&n)==1!=((t&e1)===e1)&&(t=r.neg(t)),{x:e,y:t}}if(e===o&&4===n)return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+i+", or uncompressed "+o+", got "+e)}}),h=t=>L(D(t,e.nByteLength)),d=(t,e,r)=>z(t.slice(e,r));class f{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){let r=e.nByteLength;return new f(d(t=K("compactSignature",t,2*r),0,r),d(t,r,2*r))}static fromDER(t){let{r:e,s:r}=eX.toSig(K("DER",t));return new f(e,r)}assertValidity(){H("r",this.r,e1,n),H("s",this.s,e1,n)}addRecoveryBit(t){return new f(this.r,this.s,t)}recoverPublicKey(t){let{r:i,s:o,recovery:u}=this,l=m(K("msgHash",t));if(null==u||![0,1,2,3].includes(u))throw Error("recovery id invalid");let c=2===u||3===u?i+e.n:i;if(c>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let d=(1&u)==0?"02":"03",f=a.fromHex(d+h(c)),p=th(c,n),g=s(-l*p),y=s(o*p),b=a.BASE.multiplyAndAddUnsafe(f,g,y);if(!b)throw Error("point at infinify");return b.assertValidity(),b}hasHighS(){return this.s>n>>e1}normalizeS(){return this.hasHighS()?new f(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return U(this.toDERHex())}toDERHex(){return eX.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return U(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}function p(t){let e=P(t),r="string"==typeof t,n=(e||r)&&t.length;return e?n===i||n===o:r?n===2*i||n===2*o:t instanceof a}let g=e.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let r=z(t),n=8*t.length-e.nBitLength;return n>0?r>>BigInt(n):r},m=e.bits2int_modN||function(t){return s(g(t))},y=Z(e.nBitLength);function b(t){return H("num < 2^"+e.nBitLength,t,e0,y),D(t,e.nByteLength)}let w={lowS:e.lowS,prehash:!1},v={lowS:e.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return a.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(p(t))throw Error("first arg must be private key");if(!p(e))throw Error("second arg must be public key");return a.fromHex(e).multiply(u(t)).toRawBytes(r)},sign:function(t,i,o=w){let{seed:l,k2sig:h}=function(t,i,o=w){if(["recovered","canonical"].some(t=>t in o))throw Error("sign() legacy options not supported");let{hash:l,randomBytes:h}=e,{lowS:d,prehash:p,extraEntropy:y}=o;null==d&&(d=!0),t=K("msgHash",t),eZ(o),p&&(t=K("prehashed msgHash",l(t)));let v=m(t),k=u(i),S=[b(k),b(v)];if(null!=y&&!1!==y){let t=!0===y?h(r.BYTES):y;S.push(K("extraEntropy",t))}return{seed:q(...S),k2sig:function(t){let e=g(t);if(!c(e))return;let r=th(e,n),i=a.BASE.multiply(e).toAffine(),o=s(i.x);if(o===e0)return;let u=s(r*s(v+o*k));if(u===e0)return;let l=(i.x===o?0:2)|Number(i.y&e1),h=u;if(d&&u>n>>e1)h=u>n>>e1?s(-u):u,l^=1;return new f(o,h,l)}}}(t,i,o);return Q(e.hash.outputLen,e.nByteLength,e.hmac)(l,h)},verify:function(t,r,i,o=v){let u,l;r=K("msgHash",r),i=K("publicKey",i);let{lowS:c,prehash:h,format:d}=o;if(eZ(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw Error("format must be compact or der");
1let p="string"==typeof t||P(t),g=!p&&!d&&"object"==typeof t&&null!==t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!p&&!g)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(g&&(l=new f(t.r,t.s)),p){try{"compact"!==d&&(l=f.fromDER(t))}catch(t){if(!(t instanceof eX.Err))throw t}l||"der"===d||(l=f.fromCompact(t))}u=a.fromHex(i)}catch(t){return!1}if(!l||c&&l.hasHighS())return!1;h&&(r=e.hash(r));let{r:y,s:b}=l,w=m(r),k=th(b,n),S=s(w*k),x=s(y*k),E=a.BASE.multiplyAndAddUnsafe(u,S,x)?.toAffine();return!!E&&s(E.x)===y},ProjectivePoint:a,Signature:f,utils:{isValidPrivateKey(t){try{return u(t),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let t=ty(e.n);return function(t,e,r=!1){let n=t.length,i=tm(e),o=ty(e);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=tl(r?$(t):z(t),e-tn)+tn;return r?W(s,i):D(s,i)}(e.randomBytes(t),e.n)},precompute:(t=8,e=a.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...t,hash:e,hmac:(t,...r)=>eJ(e,t,(0,w.eV)(...r)),randomBytes:w.O6});return{...r(e),create:r}}({a:BigInt(0),b:BigInt(7),Fp:e7,n:e8,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-e3*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=e5(e*t,e8),s=e5(-r*t,e8),a=tl(t-o*e-s*n,e8),u=tl(-o*r-s*e,e8),l=a>i,c=u>i;if(l&&(a=e8-a),c&&(u=e8-u),a>i||u>i)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:a,k2neg:c,k2:u}}}},tX.JQ),rt=(BigInt(0),e9.ProjectivePoint,tK.utils.randomPrivateKey),re=()=>{let t=tK.utils.randomPrivateKey(),e=rr(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),{publicKey:e,secretKey:r}},rr=tK.getPublicKey;function rn(t){try{return tK.ExtendedPoint.fromHex(t),!0}catch{return!1}}let ri=(t,e)=>tK.sign(t,e.slice(0,32)),ro=tK.verify,rs=t=>l.Buffer.isBuffer(t)?t:t instanceof Uint8Array?l.Buffer.from(t.buffer,t.byteOffset,t.byteLength):l.Buffer.from(t);class ra{constructor(t){Object.assign(this,t)}encode(){return l.Buffer.from((0,t0.serialize)(rl,this))}static decode(t){return(0,t0.deserialize)(rl,this,t)}static decodeUnchecked(t){return(0,t0.deserializeUnchecked)(rl,this,t)}}class ru extends ra{constructor(t){if(super(t),this.enum="",1!==Object.keys(t).length)throw Error("Enum can only take single value");Object.keys(t).map(t=>{this.enum=t})}}let rl=new Map,rc=32,rh=32,rd=1;class rf extends ra{constructor(t){if(super({}),this._bn=void 0,void 0!==t._bn)this._bn=t._bn;else{if("string"==typeof t){let e=tQ().decode(t);if(e.length!=rh)throw Error("Invalid public key input");this._bn=new(tY())(e)}else this._bn=new(tY())(t);if(this._bn.byteLength()>rh)throw Error("Invalid public key input")}}static unique(){let t=new rf(rd);return rd+=1,new rf(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return tQ().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){let t=this._bn.toArrayLike(l.Buffer);if(t.length===rh)return t;let e=l.Buffer.alloc(32);return t.copy(e,32-t.length),e}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,e,r){let n=l.Buffer.concat([t.toBuffer(),l.Buffer.from(e),r.toBuffer()]);return new rf((0,tX.JQ)(n))}static createProgramAddressSync(t,e){let r=l.Buffer.alloc(0);t.forEach(function(t){if(t.length>rc)throw TypeError("Max seed length exceeded");r=l.Buffer.concat([r,rs(t)])}),r=l.Buffer.concat([r,e.toBuffer(),l.Buffer.from("ProgramDerivedAddress")]);let n=(0,tX.JQ)(r);if(rn(n))throw Error("Invalid seeds, address must fall off the curve");return new rf(n)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let r,n=255;for(;0!=n;){try{let i=t.concat(l.Buffer.from([n]));r=this.createProgramAddressSync(i,e)}catch(t){if(t instanceof TypeError)throw t;n--;continue}return[r,n]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return rn(new rf(t).toBytes())}}rf.default=new rf("11111111111111111111111111111111"),rl.set(rf,{kind:"struct",fields:[["_bn","u256"]]});class rp{constructor(t){if(this._publicKey=void 0,this._secretKey=void 0,t){let e=rs(t);if(64!==t.length)throw Error("bad secret key size");this._publicKey=e.slice(32,64),this._secretKey=e.slice(0,32)}else this._secretKey=rs(rt()),this._publicKey=rs(rr(this._secretKey))}get publicKey(){return new rf(this._publicKey)}get secretKey(){return l.Buffer.concat([this._secretKey,this._publicKey],64)}}let rg=new rf("BPFLoader1111111111111111111111111111111111"),rm=1232,ry=127,rb=64;
1class rw extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(rw.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class rv extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(rv.prototype,"name",{value:"TransactionExpiredTimeoutError"});class rk extends Error{constructor(t){super(`Signature ${t} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=t}}Object.defineProperty(rk.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class rS{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){let t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(let e of this.keySegments()){if(t<e.length)return e[t];t-=e.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw Error("Account index overflow encountered during compilation");let e=new Map;this.keySegments().flat().forEach((t,r)=>{e.set(t.toBase58(),r)});let r=t=>
vendor: 18,610 bytes, line 1
1{let r=e.get(t.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return t.map(t=>({programIdIndex:r(t.programId),accountKeyIndexes:t.keys.map(t=>r(t.pubkey)),data:t.data}))}}let rx=(t="publicKey")=>t1.Ik(32,t),rE=(t="signature")=>t1.Ik(64,t),r_=(t="string")=>{let e=t1.n_([t1.Jq("length"),t1.Jq("lengthPadding"),t1.Ik(t1.cv(t1.Jq(),-8),"chars")],t),r=e.decode.bind(e),n=e.encode.bind(e);return e.decode=(t,e)=>r(t,e).chars.toString(),e.encode=(t,e,r)=>n({chars:l.Buffer.from(t,"utf8")},e,r),e.alloc=t=>t1.Jq().span+t1.Jq().span+l.Buffer.from(t,"utf8").length,e};function rA(t){let e=0,r=0;for(;;){let n=t.shift();if(e|=(127&n)<<7*r,r+=1,(128&n)==0)break}return e}function rI(t,e){let r=e;for(;;){let e=127&r;if(0==(r>>=7)){t.push(e);break}e|=128,t.push(e)}}function rO(t,e){if(!t)throw Error(e||"Assertion failed")}class rP{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){let r=new Map,n=t=>{let e=t.toBase58(),n=r.get(e);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(e,n)),n},i=n(e);for(let e of(i.isSigner=!0,i.isWritable=!0,t))for(let t of(n(e.programId).isInvoked=!0,e.keys)){let e=n(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}return new rP(e,r)}getMessageComponents(){let t=[...this.keyMetaMap.entries()];rO(t.length<=256,"Max static account keys length exceeded");let e=t.filter(([,t])=>t.isSigner&&t.isWritable),r=t.filter(([,t])=>t.isSigner&&!t.isWritable),n=t.filter(([,t])=>!t.isSigner&&t.isWritable),i=t.filter(([,t])=>!t.isSigner&&!t.isWritable),o={numRequiredSignatures:e.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{rO(e.length>0,"Expected at least one writable signer key");let[t]=e[0];rO(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map(([t])=>new rf(t)),...r.map(([t])=>new rf(t)),...n.map(([t])=>new rf(t)),...i.map(([t])=>new rf(t))]]}extractTableLookup(t){let[e,r]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&t.isWritable),[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,t=>!t.isSigner&&!t.isInvoked&&!t.isWritable);if(0!==e.length||0!==n.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(t,e){let r=[],n=[];for(let[i,o]of this.keyMetaMap.entries())if(e(o)){let e=new rf(i),o=t.findIndex(t=>t.equals(e));o>=0&&(rO(o<256,"Max lookup table index exceeded"),r.push(o),n.push(e),this.keyMetaMap.delete(i))}return[r,n]}}let rB="Reached end of buffer unexpectedly";function rR(t){if(0===t.length)throw Error(rB);return t.shift()}function rM(t,...e){let[r]=e;if(2===e.length?r+(e[1]??0)>t.length:r>=t.length)throw Error(rB);return t.splice(...e)}class rL{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(t=>new rf(t)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:tQ().decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new rS(this.staticAccountKeys)}static compile(t){let[e,r]=rP.compile(t.instructions,t.payerKey).getMessageComponents(),n=new rS(r).compileInstructions(t.instructions).map(t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:tQ().encode(t.data)}));return new rL({header:e,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:n})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures;if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts;return t-e<r}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((t,e)=>!this.isProgramId(e))}serialize(){let t=this.accountKeys.length,e=[];rI(e,t);let r=this.instructions.map(t=>{let{accounts:e,programIdIndex:r}=t,n=Array.from(tQ().decode(t.data)),i=[];rI(i,e.length);let o=[];return rI(o,n.length),{programIdIndex:r,keyIndicesCount:l.Buffer.from(i),keyIndices:e,dataLength:l.Buffer.from(o),data:n}}),n=[];rI(n,r.length);let i=l.Buffer.alloc(rm);l.Buffer.from(n).copy(i);let o=n.length;r.forEach(t=>{let e=t1.n_([t1.u8("programIdIndex"),t1.Ik(t.keyIndicesCount.length,"keyIndicesCount"),t1.A9(t1.u8("keyIndex"),t.keyIndices.length,"keyIndices"),t1.Ik(t.dataLength.length,"dataLength"),t1.A9(t1.u8("userdatum"),t.data.length,"data")]).encode(t,i,o);o+=e}),i=i.slice(0,o);let s=t1.n_([t1.Ik(1,"numRequiredSignatures"),t1.Ik(1,"numReadonlySignedAccounts"),t1.Ik(1,"numReadonlyUnsignedAccounts"),t1.Ik(e.length,"keyCount"),t1.A9(rx("key"),t,"keys"),rx("recentBlockhash")]),a={numRequiredSignatures:l.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:l.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:l.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:l.Buffer.from(e),keys:this.accountKeys.map(t=>rs(t.toBytes())),recentBlockhash:tQ().decode(this.recentBlockhash)},u=l.Buffer.alloc(2048),c=s.encode(a,u);return i.copy(u,c),u.slice(0,c+i.length)}static from(t){let e=[...t],r=rR(e);if(r!==(r&ry))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=rR(e),i=rR(e),o=rA(e),s=[];for(let t=0;t<o;t++){let t=rM(e,0,rh);s.push(new rf(l.Buffer.from(t)))}let a=rM(e,0,rh),u=rA(e),c=[];for(let t=0;t<u;t++){let t=rR(e),r=rA(e),n=rM(e,0,r),i=rA(e),o=rM(e,0,i),s=tQ().encode(l.Buffer.from(o));c.push({programIdIndex:t,accounts:n,data:s})}return new rL({header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:tQ().encode(l.Buffer.from(a)),accountKeys:s,instructions:c})}}class rT{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(let e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new rS(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){let e=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(t>=r)return t-r<this.addressTableLookups.reduce((t,e)=>t+e.writableIndexes.length,0);if(!(t>=this.header.numRequiredSignatures))return t<e-this.header.numReadonlySignedAccounts;{let n=r-e-this.header.numReadonlyUnsignedAccounts;return t-e<n}}resolveAddressTableLookups(t){let e={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=t.find(t=>t.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let t of r.writableIndexes)if(t<n.state.addresses.length)e.writable.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`);for(let t of r.readonlyIndexes)if(t<n.state.addresses.length)e.readonly.push(n.state.addresses[t]);else throw Error(`Failed to find address for index ${t} in address lookup table ${r.accountKey.toBase58()}`)}return e}static compile(t){let e=rP.compile(t.instructions,t.payerKey),r=[],n={writable:[],readonly:[]};for(let i of t.addressLookupTableAccounts||[]){let t=e.extractTableLookup(i);if(void 0!==t){let[e,{writable:i,readonly:o}]=t;r.push(e),n.writable.push(...i),n.readonly.push(...o)}}let[i,o]=e.getMessageComponents(),s=new rS(o,n).compileInstructions(t.instructions);return new rT({header:i,staticAccountKeys:o,recentBlockhash:t.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let t=[];rI(t,this.staticAccountKeys.length);let e=this.serializeInstructions(),r=[];rI(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];rI(i,this.addressTableLookups.length);let o=t1.n_([t1.u8("prefix"),t1.n_([t1.u8("numRequiredSignatures"),t1.u8("numReadonlySignedAccounts"),t1.u8("numReadonlyUnsignedAccounts")],"header"),t1.Ik(t.length,"staticAccountKeysLength"),t1.A9(rx(),this.staticAccountKeys.length,"staticAccountKeys"),rx("recentBlockhash"),t1.Ik(r.length,"instructionsLength"),t1.Ik(e.length,"serializedInstructions"),t1.Ik(i.length,"addressTableLookupsLength"),t1.Ik(n.length,"serializedAddressTableLookups")]),s=new Uint8Array(rm),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(t=>t.toBytes()),recentBlockhash:tQ().decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,a)}serializeInstructions(){let t=0,e=new Uint8Array(rm);for(let r of this.compiledInstructions){let n=[];rI(n,r.accountKeyIndexes.length);let i=[];rI(i,r.data.length);let o=t1.n_([t1.u8("programIdIndex"),t1.Ik(n.length,"encodedAccountKeyIndexesLength"),t1.A9(t1.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),t1.Ik(i.length,"encodedDataLength"),t1.Ik(r.data.length,"data")]);t+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0,e=new Uint8Array(rm);for(let r of this.addressTableLookups){let n=[];rI(n,r.writableIndexes.length);let i=[];rI(i,r.readonlyIndexes.length);let o=t1.n_([rx("accountKey"),t1.Ik(n.length,"encodedWritableIndexesLength"),t1.A9(t1.u8(),r.writableIndexes.length,"writableIndexes"),t1.Ik(i.length,"encodedReadonlyIndexesLength"),t1.A9(t1.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);t+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t],r=rR(e),n=r&ry;rO(r!==n,"Expected versioned message but received legacy message"),rO(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:rR(e),numReadonlySignedAccounts:rR(e),numReadonlyUnsignedAccounts:rR(e)},o=[],s=rA(e);for(let t=0;t<s;t++)o.push(new rf(rM(e,0,rh)));let a=tQ().encode(rM(e,0,rh)),u=rA(e),l=[];for(let t=0;t<u;t++){let t=rR(e),r=rA(e),n=rM(e,0,r),i=rA(e),o=new Uint8Array(rM(e,0,i));l.push({programIdIndex:t,accountKeyIndexes:n,data:o})}let c=rA(e),h=[];for(let t=0;t<c;t++){let t=new rf(rM(e,0,rh)),r=rA(e),n=rM(e,0,r),i=rA(e),o=rM(e,0,i);h.push({accountKey:t,writableIndexes:n,readonlyIndexes:o})}return new rT({header:i,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:h})}}let rC={deserializeMessageVersion(t){let e=t[0],r=e&ry;return r===e?"legacy":r},deserialize:t=>{let e=rC.deserializeMessageVersion(t);if("legacy"===e)return rL.from(t);if(0===e)return rT.deserialize(t);throw Error(`Transaction message version ${e} deserialization is not supported`)}},rN=((i={})[i.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",i[i.PROCESSED=1]="PROCESSED",i[i.TIMED_OUT=2]="TIMED_OUT",i[i.NONCE_INVALID=3]="NONCE_INVALID",i),rj=l.Buffer.alloc(rb).fill(0);class rU{constructor(t){this.keys=void 0,this.programId=void 0,this.data=l.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:e,isWritable:r})=>({pubkey:t.toJSON(),isSigner:e,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class rz{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!t)return;if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){let{minContextSlot:e,nonceInfo:r}=t;this.minNonceContextSlot=e,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){let{blockhash:e,lastValidBlockHeight:r}=t;this.recentBlockhash=e,this.lastValidBlockHeight=r}else{let{recentBlockhash:e,nonceInfo:r}=t;r&&(this.nonceInfo=r),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(0===t.length)throw Error("No instructions");return t.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new rU(t))}),this}compileMessage(){let t,e,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let t=0;t<e.length;t++)if(void 0===e[t].programId)throw Error(`Transaction instruction index ${t} has undefined program id`);let n=[],i=[];e.forEach(t=>{t.keys.forEach(t=>{i.push({...t})});let e=t.programId.toString();n.includes(e)||n.push(e)}),n.forEach(t=>{i.push({pubkey:new rf(t),isSigner:!1,isWritable:!1})});let o=[];i.forEach(t=>{let e=t.pubkey.toString(),r=o.findIndex(t=>t.pubkey.toString()===e);r>-1?(o[r].isWritable=o[r].isWritable||t.isWritable,o[r].isSigner=o[r].isSigner||t.isSigner):o.push(t)}),o.sort(function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=o.findIndex(t=>t.pubkey.equals(r));if(s>-1){let[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let t of this.signatures){let e=o.findIndex(e=>e.pubkey.equals(t.publicKey));if(e>-1)o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${t.publicKey.toString()}`)}let a=0,u=0,l=0,c=[],h=[];o.forEach(({pubkey:t,isSigner:e,isWritable:r})=>{e?(c.push(t.toString()),a+=1,r||(u+=1)):(h.push(t.toString()),r||(l+=1))});let d=c.concat(h),f=e.map(t=>{let{data:e,programId:r}=t;return{programIdIndex:d.indexOf(r.toString()),accounts:t.keys.map(t=>d.indexOf(t.pubkey.toString())),data:tQ().encode(e)}});return f.forEach(t=>{rO(t.programIdIndex>=0),t.accounts.forEach(t=>rO(t>=0))}),new rL({header:{numRequiredSignatures:a,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:l},accountKeys:d,recentBlockhash:t,instructions:f})}_compile(){let t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===e.length&&this.signatures.every((t,r)=>e[r].equals(t.publicKey))||(this.signatures=e.map(t=>({signature:null,publicKey:t}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw Error("No signers");let e=new Set;this.signatures=t.filter(t=>{let r=t.toString();return!e.has(r)&&(e.add(r),!0)}).map(t=>({signature:null,publicKey:t}))}sign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}this.signatures=r.map(t=>({signature:null,publicKey:t.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...t){if(0===t.length)throw Error("No signers");let e=new Set,r=[];for(let n of t){let t=n.publicKey.toString();e.has(t)||(e.add(t),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(t,...e){let r=t.serialize();e.forEach(t=>{let e=ri(r,t.secretKey);this._addSignature(t.publicKey,rs(e))})}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){rO(64===e.length);let r=this.signatures.findIndex(e=>t.equals(e.publicKey));if(r<0)throw Error(`unknown signer: ${t.toString()}`);this.signatures[r].signature=l.Buffer.from(e)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,e){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?e&&(r.missing||=[]).push(i):ro(n,t,i.toBytes())||(r.invali
1d||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(t){let{requireAllSignatures:e,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),n=this.serializeMessage();if(r){let t=this._getMessageSignednessErrors(n,e);if(t){let e="Signature verification failed.";throw t.invalid&&(e+=` 2Invalid signature for public key${1===t.invalid.length?"":"(s)"} [\`${t.invalid.map(t=>t.toBase58()).join("`, `")}\`].`),t.missing&&(e+=` 3Missing signature for public key${1===t.missing.length?"":"(s)"} [\`${t.missing.map(t=>t.toBase58()).join("`, `")}\`].`),Error(e)}}return this._serialize(n)}_serialize(t){let{signatures:e}=this,r=[];rI(r,e.length);let n=r.length+64*e.length+t.length,i=l.Buffer.alloc(n);return rO(e.length<256),l.Buffer.from(r).copy(i,0),e.forEach(({signature:t},e)=>{null!==t&&(rO(64===t.length,"signature has invalid length"),l.Buffer.from(t).copy(i,r.length+64*e))}),t.copy(i,r.length+64*e.length),rO(i.length<=rm,`Transaction too large: ${i.length} > ${rm}`),i}get keys(){return rO(1===this.instructions.length),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return rO(1===this.instructions.length),this.instructions[0].programId}get data(){return rO(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t],r=rA(e),n=[];for(let t=0;t<r;t++){let t=rM(e,0,rb);n.push(tQ().encode(l.Buffer.from(t)))}return rz.populate(rL.from(e),n)}static populate(t,e=[]){let r=new rz;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),e.forEach((e,n)=>{let i={signature:e==tQ().encode(rj)?null:tQ().decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)}),t.instructions.forEach(e=>{let n=e.accounts.map(e=>{let n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some(t=>t.publicKey.toString()===n.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new rU({keys:n,programId:t.accountKeys[e.programIdIndex],data:tQ().decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}}class r${constructor(t){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}static decompile(t,e){let{header:r,compiledInstructions:n,recentBlockhash:i}=t,{numRequiredSignatures:o,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:a}=r,u=o-s;rO(u>0,"Message header is invalid");let l=t.staticAccountKeys.length-o-a;rO(l>=0,"Message header is invalid");let c=t.getAccountKeys(e),h=c.get(0);if(void 0===h)throw Error("Failed to decompile message because no account keys were found");let d=[];for(let t of n){let e=[];for(let n of t.accountKeyIndexes){let t;let i=c.get(n);if(void 0===i)throw Error(`Failed to find key for account key index ${n}`);t=n<o?n<u:n<c.staticAccountKeys.length?n-o<l:n-c.staticAccountKeys.length<c.accountKeysFromLookups.writable.length,e.push({pubkey:i,isSigner:n<r.numRequiredSignatures,isWritable:t})}let n=c.get(t.programIdIndex);if(void 0===n)throw Error(`Failed to find program id for program id index ${t.programIdIndex}`);d.push(new rU({programId:n,data:rs(t.data),keys:e}))}return new r$({payerKey:h,instructions:d,recentBlockhash:i})}compileToLegacyMessage(){return rL.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return rT.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class rD{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)rO(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{let e=[];for(let r=0;r<t.header.numRequiredSignatures;r++)e.push(new Uint8Array(rb));this.signatures=e}this.message=t}serialize(){let t=this.message.serialize(),e=[];rI(e,this.signatures.length);let r=t1.n_([t1.Ik(e.length,"encodedSignaturesLength"),t1.A9(rE(),this.signatures.length,"signatures"),t1.Ik(t.length,"serializedMessage")]),n=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},n);return n.slice(0,i)}static deserialize(t){let e=[...t],r=[],n=rA(e);for(let t=0;t<n;t++)r.push(new Uint8Array(rM(e,0,rb)));return new rD(rC.deserialize(new Uint8Array(e)),r)}sign(t){let e=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of t){let t=r.findIndex(t=>t.equals(n.publicKey));rO(t>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[t]=ri(e,n.secretKey)}}addSignature(t,e){rO(64===e.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(e=>e.equals(t));rO(r>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=e}}let rW=new rf("SysvarC1ock11111111111111111111111111111111"),rK=new rf("SysvarEpochSchedu1e111111111111111111111111"),rq=new rf("Sysvar1nstructions1111111111111111111111111"),rF=new rf("SysvarRecentB1ockHashes11111111111111111111"),rV=new rf("SysvarRent111111111111111111111111111111111"),rH=new rf("SysvarRewards111111111111111111111111111111"),rJ=new rf("SysvarS1otHashes111111111111111111111111111"),rZ=new rf("SysvarS1otHistory11111111111111111111111111"),rY=new rf("SysvarStakeHistory1111111111111111111111111");
3class rG extends Error{constructor({action:t,signature:e,transactionMessage:r,logs:n}){let i;let o=n?`Logs: 4${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(t){case"send":i=`Transaction ${e} resulted in an error. 5${r}. `+o+s;break;case"simulate":i=`Simulation failed. 6Message: ${r}. 7`+o+s;break;default:i=`Unknown action '${t}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=e,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let t=this.transactionLogs;if(null==t||"object"!=typeof t||!("then"in t))return t}async getLogs(t){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((e,r)=>{t.getTransaction(this.signature).then(t=>{if(t&&t.meta&&t.meta.logMessages){let r=t.meta.logMessages;this.transactionLogs=r,e(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}let rQ={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class rX extends Error{constructor({code:t,message:e,data:r},n){super(null!=n?`${n}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=r,this.name="SolanaJSONRPCError"}}async function r0(t,e,r,n){let i;let o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},s=await t.sendTransaction(e,r,o);if(null!=e.recentBlockhash&&null!=e.lastValidBlockHeight)i=(await t.confirmTransaction({abortSignal:n?.abortSignal,signature:s,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=e.minNonceContextSlot&&null!=e.nonceInfo){let{nonceInstruction:r}=e.nonceInfo,o=r.keys[0].pubkey;i=(await t.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:e.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:e.nonceInfo.nonce,signature:s},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await t.confirmTransaction(s,n&&n.commitment)).value;if(i.err){if(null!=s)throw new rG({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(i)})`)}return s}function r1(t){return new Promise(e=>setTimeout(e,t))}function r2(t,e){let r=t.layout.span>=0?t.layout.span:function t(e,r){let n=e=>{if(e.span>=0)return e.span;if("function"==typeof e.alloc)return e.alloc(r[e.property]);if("count"in e&&"elementLayout"in e){let t=r[e.property];if(Array.isArray(t))return t.length*n(e.elementLayout)}else if("fields"in e)return t({layout:e},r[e.property]);return 0},i=0;return e.layout.fields.forEach(t=>{i+=n(t)}),i}(t,e),n=l.Buffer.alloc(r),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,n),n}function r6(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.instruction!==t.index)throw Error(`invalid instruction; instruction index mismatch ${r.instruction} != ${t.index}`);return r}let r8=t1._O("lamportsPerSignature"),r3=t1.n_([t1.Jq("version"),t1.Jq("state"),rx("authorizedPubkey"),rx("nonce"),t1.n_([r8],"feeCalculator")]),r4=r3.span;class r5{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){let e=r3.decode(rs(t),0);return new r5({authorizedPubkey:new rf(e.authorizedPubkey),nonce:new rf(e.nonce).toString(),feeCalculator:e.feeCalculator})}}function r7(t){let e=(0,t1.Ik)(8,t),r=e.decode.bind(e),n=e.encode.bind(e),i=t9();return e.decode=(t,e)=>{let n=r(t,e);return i.decode(n)},e.encode=(t,e,r)=>n(i.encode(t),e,r),e}class r9{constructor(){}static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=t1.Jq("instruction").decode(t.data);for(let[t,n]of Object.entries(nt))if(n.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a SystemInstruction");return e}static decodeCreateAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{lamports:e,space:r,programId:n}=r6(nt.Create,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,lamports:e,space:r,programId:new rf(n)}}static decodeTransfer(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{lamports:e}=r6(nt.Transfer,t.data);return{fromPubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,lamports:e}}static decodeTransferWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e,seed:r,programId:n}=r6(nt.TransferWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,basePubkey:t.keys[1].pubkey,toPubkey:t.keys[2].pubkey,lamports:e,seed:r,programId:new rf(n)}}static decodeAllocate(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{space:e}=r6(nt.Allocate,t.data);return{accountPubkey:t.keys[0].pubkey,space:e}}static decodeAllocateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{base:e,seed:r,space:n,programId:i}=r6(nt.AllocateWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new rf(e),seed:r,space:n,programId:new rf(i)}}static decodeAssign(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{programId:e}=r6(nt.Assign,t.data);return{accountPubkey:t.keys[0].pubkey,programId:new rf(e)}}static decodeAssignWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);let{base:e,seed:r,programId:n}=r6(nt.AssignWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new rf(e),seed:r,programId:new rf(n)}}static decodeCreateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{base:e,seed:r,lamports:n,space:i,programId:o}=r6(nt.CreateWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,basePubkey:new rf(e),seed:r,lamports:n,space:i,programId:new rf(o
7)}}static decodeNonceInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{authorized:e}=r6(nt.InitializeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:new rf(e)}}static decodeNonceAdvance(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),r6(nt.AdvanceNonceAccount,t.data),{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static decodeNonceWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);let{lamports:e}=r6(nt.WithdrawNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e}}static decodeNonceAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{authorized:e}=r6(nt.AuthorizeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[1].pubkey,newAuthorizedPubkey:new rf(e)}}static checkProgramId(t){if(!t.equals(ne.programId))throw Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}let nt=Object.freeze({Create:{index:0,layout:t1.n_([t1.Jq("instruction"),t1.gM("lamports"),t1.gM("space"),rx("programId")])},Assign:{index:1,layout:t1.n_([t1.Jq("instruction"),rx("programId")])},Transfer:{index:2,layout:t1.n_([t1.Jq("instruction"),r7("lamports")])},CreateWithSeed:{index:3,layout:t1.n_([t1.Jq("instruction"),rx("base"),r_("seed"),t1.gM("lamports"),t1.gM("space"),rx("programId")])},AdvanceNonceAccount:{index:4,layout:t1.n_([t1.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:t1.n_([t1.Jq("instruction"),t1.gM("lamports")])},InitializeNonceAccount:{index:6,layout:t1.n_([t1.Jq("instruction"),rx("authorized")])},AuthorizeNonceAccount:{index:7,layout:t1.n_([t1.Jq("instruction"),rx("authorized")])},Allocate:{index:8,layout:t1.n_([t1.Jq("instruction"),t1.gM("space")])},AllocateWithSeed:{index:9,layout:t1.n_([t1.Jq("instruction"),rx("base"),r_("seed"),t1.gM("space"),rx("programId")])},AssignWithSeed:{index:10,layout:t1.n_([t1.Jq("instruction"),rx("base"),r_("seed"),rx("programId")])},TransferWithSeed:{index:11,layout:t1.n_([t1.Jq("instruction"),r7("lamports"),r_("seed"),rx("programId")])},UpgradeNonceAccount:{index:12,layout:t1.n_([t1.Jq("instruction")])}});class ne{constructor(){}static createAccount(t){let e=r2(nt.Create,{lamports:t.lamports,space:t.space,programId:rs(t.programId.toBuffer())});return new rU({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,r;return"basePubkey"in t?(e=r2(nt.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:rs(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]):(e=r2(nt.Transfer,{lamports:BigInt(t.lamports)}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]),new rU({keys:r,programId:this.programId,data:e})}static assign(t){let e,r;return"basePubkey"in t?(e=r2(nt.AssignWithSeed,{base:rs(t.basePubkey.toBuffer()),seed:t.seed,programId:rs(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=r2(nt.Assign,{programId:rs(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new rU({keys:r,programId:this.programId,data:e})}static createAccountWithSeed(t){let e=r2(nt.CreateWithSeed,{base:rs(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:rs(t.programId.toBuffer())}),r=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||r.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new rU({keys:r,programId:this.programId,data:e})}static createNonceAccount(t){let e=new rz;"basePubkey"in t&&"seed"in t?e.add(ne.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:r4,programId:this.programId})):e.add(ne.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:r4,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(r)),e}static nonceInitialize(t){let e=r2(nt.InitializeNonceAccount,{authorized:rs(t.authorizedPubkey.toBuffer())});
vendor: 14,120 bytes, line 7
7return new rU({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:rF,isSigner:!1,isWritable:!1},{pubkey:rV,isSigner:!1,isWritable:!1}],programId:this.programId,data:e})}static nonceAdvance(t){let e=r2(nt.AdvanceNonceAccount);return new rU({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:rF,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceWithdraw(t){let e=r2(nt.WithdrawNonceAccount,{lamports:t.lamports});return new rU({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:rF,isSigner:!1,isWritable:!1},{pubkey:rV,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){let e=r2(nt.AuthorizeNonceAccount,{authorized:rs(t.newAuthorizedPubkey.toBuffer())});return new rU({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,r;return"basePubkey"in t?(e=r2(nt.AllocateWithSeed,{base:rs(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:rs(t.programId.toBuffer())}),r=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]):(e=r2(nt.Allocate,{space:t.space}),r=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]),new rU({keys:r,programId:this.programId,data:e})}}ne.programId=new rf("11111111111111111111111111111111");let nr=rm-300;class nn{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/nn.chunkSize)+1+1)}static async load(t,e,r,n,i){{let o=await t.getMinimumBalanceForRentExemption(i.length),s=await t.getAccountInfo(r.publicKey,"confirmed"),a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new rz).add(ne.allocate({accountPubkey:r.publicKey,space:i.length})),s.owner.equals(n)||(a=a||new rz).add(ne.assign({accountPubkey:r.publicKey,programId:n})),s.lamports<o&&(a=a||new rz).add(ne.transfer({fromPubkey:e.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports}))}else a=new rz().add(ne.createAccount({fromPubkey:e.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await r0(t,a,[e,r],{commitment:"confirmed"})}let o=t1.n_([t1.Jq("instruction"),t1.Jq("offset"),t1.Jq("bytesLength"),t1.Jq("bytesLengthPadding"),t1.A9(t1.u8("byte"),t1.cv(t1.Jq(),-8),"bytes")]),s=nn.chunkSize,a=0,u=i,c=[];for(;u.length>0;){let i=u.slice(0,s),h=l.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},h);let d=new rz().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:h});c.push(r0(t,d,[e,r],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")&&await r1(250),a+=s,u=u.slice(s)}await Promise.all(c);{let i=t1.n_([t1.Jq("instruction")]),o=l.Buffer.alloc(i.span);i.encode({instruction:1},o);let s=new rz().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:rV,isSigner:!1,isWritable:!1}],programId:n,data:o}),a="processed",u=await t.sendTransaction(s,[e,r],{preflightCommitment:a}),{context:c,value:h}=await t.confirmTransaction({signature:u,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},a);if(h.err)throw Error(`Transaction ${u} failed (${JSON.stringify(h)})`);for(;;){try{if(await t.getSlot({commitment:a})>c.slot)break}catch{}await new Promise(t=>setTimeout(t,Math.round(200)))}}return!0}}nn.chunkSize=nr;let ni=new rf("BPFLoader2111111111111111111111111111111111");class no{static getMinNumSignatures(t){return nn.getMinNumSignatures(t)}static load(t,e,r,n,i){return nn.load(t,e,r,i,n)}}var ns=(o=function(){if(a)return s;a=1;var t=Object.prototype.toString,e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};return s=function(r){var n=function r(n,i){var o,s,a,u,l,c,h;if(!0===n)return"true";if(!1===n)return"false";switch(typeof n){case"object":if(null===n)return null;if(n.toJSON&&"function"==typeof n.toJSON)return r(n.toJSON(),i);if("[object Array]"===(h=t.call(n))){for(o=0,a="[",s=n.length-1;o<s;o++)a+=r(n[o],!0)+",";return s>-1&&(a+=r(n[o],!0)),a+"]"}if("[object Object]"!==h)return JSON.stringify(n);for(s=(u=e(n).sort()).length,a="",o=0;o<s;)void 0!==(c=r(n[l=u[o]],!1))&&(a&&(a+=","),a+=JSON.stringify(l)+":"+c),o++;return"{"+a+"}";case"function":case"undefined":return i?null:void 0;case"string":return JSON.stringify(n);default:return isFinite(n)?n:null}}(r,!1);if(void 0!==n)return""+n}}())&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;function na(t){let e=0;for(;t>1;)t/=2,e++;return e}class nu{constructor(t,e,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){var e;let r=na(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,(e|=e>>32)+1))-na(32)-1,n=this.getSlotsInEpoch(r);return[r,t-(n-32)]}{let e=t-this.firstNormalSlot,r=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+r,e%this.slotsPerEpoch]}}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?(Math.pow(2,t)-1)*32:(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+na(32)):this.slotsPerEpoch}}var nl=globalThis.fetch;class nc extends eB{constructor(t,e,r){super(t=>{let r=new eO(t,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...e});return"socket"in r?this.underlyingSocket=r.socket:this.underlyingSocket=r,r},t,e,r),this.underlyingSocket=void 0}call(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.call(...t):Promise.reject(Error("Tried to call a JSON-RPC method `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}notify(...t){let e=this.underlyingSocket?.readyState;return 1===e?super.notify(...t):Promise.reject(Error("Tried to send a JSON-RPC notification `"+t[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+e+")"))}}class nh{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){let t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){let e=function(t,e){let r;try{r=t.layout.decode(e)}catch(t){throw Error("invalid instruction; "+t)}if(r.typeIndex!==t.index)throw Error(`invalid account data; account type mismatch ${r.typeIndex} != ${t.index}`);return r}(nd,t),r=t.length-56;rO(r>=0,"lookup table is invalid"),rO(r%32==0,"lookup table is invalid");let{addresses:n}=t1.n_([t1.A9(rx(),r/32,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new rf(e.authority[0]):void 0,addresses:n.map(t=>new rf(t))}}}let nd={index:1,layout:t1.n_([t1.Jq("typeIndex"),r7("deactivationSlot"),t1._O("lastExtendedSlot"),t1.u8("lastExtendedStartIndex"),t1.u8(),t1.A9(rx(),t1.cv(t1.u8(),-1),"authority")])},nf=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,np=eE(ef(rf),ew(),t=>new rf(t)),ng=ev([ew(),ep("base64")]),nm=eE(ef(l.Buffer),ng,t=>l.Buffer.from(t[0],"base64")),ny=3e4;function nb(t){let e,r;if("string"==typeof t)e=t;else if(t){let{commitment:n,...i}=t;e=n,r=i}return{commitment:e,config:r}}function nw(t){return t.map(t=>"memcmp"in t?{...t,memcmp:{...t.memcmp,encoding:t.memcmp.encoding??"base58"}}:t)}function nv(t){return eS([ek({jsonrpc:ep("2.0"),id:ew(),result:t}),ek({jsonrpc:ep("2.0"),id:ew(),error:ek({code:ex(),message:ew(),data:ey(ec("any",()=>!0))})})])}let nk=nv(ex());function nS(t){return eE(nv(t),nk,e=>"error"in e?e:{...e,result:eu(e.result,t)})}function nx(t){return nS(ek({context:ek({slot:em()}),value:t}))}function nE(t){return ek({context:ek({slot:em()}),value:t})}function n_(t,e){return 0===t?new rT({header:e.header,staticAccountKeys:e.accountKeys.map(t=>new rf(t)),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:tQ().decode(t.data)})),addressTableLookups:e.addressTableLookups}):new rL(e)}let nA=ek({foundation:em(),foundationTerm:em(),initial:em(),taper:em(),terminal:em()}),nI=nS(eh(eg(ek({epoch:em(),effectiveSlot:em(),amount:em(),postBalance:em(),commission:ey(eg(em()))})))),nO=eh(ek({slot:em(),prioritizationFee:em()})),nP=ek({total:em(),validator:em(),foundation:em(),epoch:em()}),nB=ek({epoch:em(),slotIndex:em(),slotsInEpoch:em(),absoluteSlot:em(),blockHeight:ey(em()),transactionCount:ey(em())}),nR=ek({slotsPerEpoch:em(),leaderScheduleSlotOffset:em(),warmup:ed(),firstNormalEpoch:em(),firstNormalSlot:em()}),nM=eb(ew(),eh(em())),nL=eg(eS([ek({}),ew()])),nT=ek({err:nL}),nC=ep("receivedSignature"),nN=ek({"solana-core":ew(),"feature-set":ey(em())}),nj=ek({program:ew(),programId:np,parsed:ex()}),nU=ek({programId:np,accounts:eh(np),data:ew()}),nz=nx(ek({err:eg(eS([ek({}),ew()])),logs:eg(eh(ew())),accounts:ey(eg(eh(eg(ek({executable:ed(),owner:ew(),lamports:em(),data:eh(ew()),rentEpoch:ey(em())}))))),unitsConsumed:ey(em()),returnData:ey(eg(ek({programId:ew(),data:ev([ew(),ep("base64")])}))),innerInstructions:ey(eg(eh(ek({index:em(),instructions:eh(eS([nj,nU]))}))))})),n$=nx(ek({byIdentity:eb(ew(),eh(em())),range:ek({firstSlot:em(),lastSlot:em()})})),nD=nS(nA),nW=nS(nP),nK=nS(nO),nq=nS(nB),nF=nS(nR),nV=nS(nM),nH=nS(em()),nJ=nx(ek({total:em(),circulating:em(),nonCirculating:em(),nonCirculatingAccounts:eh(np)})),nZ=ek({amount:ew(),uiAmount:eg(em()),decimals:em(),uiAmountString:ey(ew())}),nY=nx(eh(ek({address:np,amount:ew(),uiAmount:eg(em()),decimals:em(),uiAmountString:ey(ew())}))),nG=nx(eh(ek({pubkey:np,account:ek({executable:ed(),owner:np,lamports:em(),data:nm,rentEpoch:em()})}))),nQ=ek({program:ew(),parsed:ex(),space:em()}),nX=nx(eh(ek({pubkey:np,account:ek({executable:ed(),owner:np,lamports:em(),data:nQ,rentEpoch:em()})}))),n0=nx(eh(ek({lamports:em(),address:np}))),n1=ek({executable:ed(),owner:np,lamports:em(),data:nm,rentEpoch:em()}),n2=ek({pubkey:np,account:n1}),n6=eE(eS([ef(l.Buffer),nQ]),eS([ng,nQ]),t=>Array.isArray(t)?eu(t,nm):t),n8=ek({executable:ed(),owner:np,lamports:em(),data:n6,rentEpoch:em()}),n3=ek({pubkey:np,account:n8}),n4=ek({state:eS([ep("active"),ep("inactive"),ep("activating"),ep("deactivating")]),active:em(),inactive:em()}),n5=nS(eh(ek({signature:ew(),slot:em(),err:nL,memo:eg(ew()),blockTime:ey(eg(em()))}))),n7=nS(eh(ek({signature:ew(),slot:em(),err:nL,memo:eg(ew()),blockTime:ey(eg(em()))}))),n9=ek({subscription:em(),result:nE(n1)}),it=ek({pubkey:np,account:n1}),ie=ek({subscription:em(),result:nE(it)}),ir=ek({parent:em(),slot:em(),root:em()}),ii=ek({subscription:em(),result:ir}),io=eS([ek({type:eS([ep("firstShredReceived"),ep("completed"),ep("optimisticConfirmation"),ep("root")]),slot:em(),timestamp:em()}),ek({type:ep("createdBank"),parent:em(),slot:em(),timestamp:em()}),ek({type:ep("frozen"),slot:em(),timestamp:em(),stats:ek({numTransactionEntries:em(),numSuccessfulTransactions:em(),numFailedTransactions:em(),maxTransactionsPerEntry:em()})}),ek({type:ep("dead"),slot:em(),timestamp:em(),err:ew()})]),is=ek({subscription:em(),result:io}),ia=ek({subscription:em(),result:nE(eS([nT,nC]))}),iu=ek({subscription:em(),result:em()}),il=ek({pubkey:ew(),gossip:eg(ew()),tpu:eg(ew()),rpc:eg(ew()),version:eg(ew())}),ic=ek({votePubkey:ew(),nodePubkey:ew(),activatedStake:em(),epochVoteAccount:ed(),epochCredits:eh(ev([em(),em(),em()])),commission:em(),lastVote:em(),rootSlot:eg(em())}),ih=nS(ek({current:eh(ic),delinquent:eh(ic)})),id=eS([ep("processed"),ep("confirmed"),ep("finalized")]),ip=ek({slot:em(),confirmations:eg(em()),err:nL,confirmationStatus:ey(id)}),ig=nx(eh(eg(ip))),im=nS(em()),iy=ek({accountKey:np,writableIndexes:eh(em()),readonlyIndexes:eh(em())}),ib=ek({signatures:eh(ew()),message:ek({accountKeys:eh(ew()),header:ek({numRequiredSignatures:em(),numReadonlySignedAccounts:em(),numReadonlyUnsignedAccounts:em()}),instructions:eh(ek({accounts:eh(em()),data:ew(),programIdIndex:em()})),recentBlockhash:ew(),addressTableLookups:ey(eh(iy))})}),iw=ek({pubkey:np,signer:ed(),writable:ed(),source:ey(eS([ep("transaction"),ep("lookupTable")]))}),iv=ek({accountKeys:eh(iw),signatures:eh(ew())}),ik=ek({parsed:ex(),program:ew(),programId:np}),iS=ek({accounts:eh(np),data:ew(),programId:np}),ix=eE(eS([iS,ik]),eS([ek({parsed:ex(),program:ew(),programId:ew()}),ek({accounts:eh(ew()),data:ew(),programId:ew()})]),t=>"accounts"in t?eu(t,iS):eu(t,ik)),iE=ek({signatures:eh(ew()),message:ek({accountKeys:eh(iw),instructions:eh(ix),recentBlockhash:ew(),addressTableLookups:ey(eg(eh(iy)))})}),i_=ek({accountIndex:em(),mint:ew(),owner:ey(ew()),programId:ey(ew()),uiTokenAmount:nZ}),iA=ek({writable:eh(np),readonly:eh(np)}),iI=ek({err:nL,fee:em(),innerInstructions:ey(eg(eh(ek({index:em(),instructions:eh(ek({accounts:eh(em()),data:ew(),programIdIndex:em()}))})))),preBalances:eh(em()),postBalances:eh(em()),logMessages:ey(eg(eh(ew()))),preTokenBalances:ey(eg(eh(i_))),postTokenBalances:ey(eg(eh(i_))),loadedAddresses:ey(iA),computeUnitsConsumed:ey(em()),costUnits:ey(em())}),iO=ek({err:nL,fee:em(),innerInstructions:ey(eg(eh(ek({index:em(),instructions:eh(ix)})))),preBalances:eh(em()),postBalances:eh(em()),logMessages:ey(eg(eh(ew()))),preTokenBalances:ey(eg(eh(i_))),postTokenBalances:ey(eg(eh(i_))),loadedAddresses:ey(iA),computeUnitsConsumed:ey(em()),costUnits:ey(em())}),iP=eS([ep(0),ep("legacy")]),iB=ek({pubkey:ew(),lamports:em(),postBalance:eg(em()),rewardType:eg(ew()),commission:ey(eg(em()))}),iR=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),transactions:eh(ek({transaction:ib,meta:eg(iI),version:ey(iP)})),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}
7))),iM=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}))),iL=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),transactions:eh(ek({transaction:iv,meta:eg(iI),version:ey(iP)})),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}))),iT=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),transactions:eh(ek({transaction:iE,meta:eg(iO),version:ey(iP)})),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}))),iC=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),transactions:eh(ek({transaction:iv,meta:eg(iO),version:ey(iP)})),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}))),iN=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),rewards:ey(eh(iB)),blockTime:eg(em()),blockHeight:eg(em())}))),ij=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),transactions:eh(ek({transaction:ib,meta:eg(iI)})),rewards:ey(eh(iB)),blockTime:eg(em())}))),iU=nS(eg(ek({blockhash:ew(),previousBlockhash:ew(),parentSlot:em(),signatures:eh(ew()),blockTime:eg(em())}))),iz=nS(eg(ek({slot:em(),meta:eg(iI),blockTime:ey(eg(em())),transaction:ib,version:ey(iP)}))),i$=nS(eg(ek({slot:em(),transaction:iE,meta:eg(iO),blockTime:ey(eg(em())),version:ey(iP)}))),iD=nx(ek({blockhash:ew(),lastValidBlockHeight:em()})),iW=nx(ed()),iK=nS(eh(ek({slot:em(),numTransactions:em(),numSlots:em(),samplePeriodSecs:em()}))),iq=nx(eg(ek({feeCalculator:ek({lamportsPerSignature:em()})}))),iF=nS(ew()),iV=nS(ew()),iH=ek({err:nL,logs:eh(ew()),signature:ew()}),iJ=ek({result:nE(iH),subscription:em()}),iZ={"solana-client":"js/1.0.0-maintenance"};class iY{constructor(t,e){var r,n;let i,o,s,a,u,l;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{let t={};return async e=>{let{commitment:r,config:n}=nb(e),i=this._buildArgs([],r,void 0,n),o=ns(i);return t[o]=t[o]??(async()=>{try{let t=await this._rpcRequest("getBlockHeight",i),e=eu(t,nS(em()));if("error"in e)throw new rX(e.error,"failed to get block height information");return e.result}finally{delete t[o]}})(),await t[o]}})(),e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,i=e.wsEndpoint,o=e.httpHeaders,s=e.fetch,a=e.fetchMiddleware,u=e.disableRetryOnRateLimit,l=e.httpAgent),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=i||function(t){let e=t.match(nf);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);let[r,n,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10),u=null==a?"":`:${a+1}`;return`${s}//${n}${u}${o}`}(t),this._rpcClient=function(t,e,r,n,i,o){let s,a;let u=r||nl;return null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(a=async(t,e)=>{let r=await new Promise((r,i)=>{try{n(t,e,(t,e)=>r([t,e]))}catch(t){i(t)}});return await u(...r)}),new(eA())(async(r,n)=>{let o={method:"POST",body:r,agent:s,headers:Object.assign({"Content-Type":"application/json"},e||{},iZ)};try{let e,r=5,s=500;for(;e=a?await a(t,o):await u(t,o),429===e.status&&!0!==i&&(r-=1,0!==r);)console.error(`Server responded with ${e.status} ${e.statusText}. Retrying after ${s}ms delay...`),await r1(s),s*=2;let l=await e.text();e.ok?n(null,l):n(Error(`${e.status} ${e.statusText}: ${l}`))}catch(t){t instanceof Error&&n(t)}},{})}(t,o,s,a,u,l),this._rpcRequest=(r=this._rpcClient,(t,e)=>new Promise((n,i)=>{r.request(t,e,(t,e)=>{if(t){i(t);return}n(e)})})),this._rpcBatchRequest=(n=this._rpcClient,t=>new Promise((e,r)=>{0===t.length&&e([]);let i=t.map(t=>n.request(t.methodName,t.args));n.request(i,(t,n)=>{if(t){r(t);return}e(n)})})),this._rpcWebSocket=new nc(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgs([t.toBase58()],r,void 0,n),o=eu(await this._rpcRequest("getBalance",i),nx(em()));if("error"in o)throw new rX(o.error,`failed to get balance for ${t.toBase58()}`);return o.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then(t=>
vendor: 6,242 bytes, line 7
7t.value).catch(e=>{throw Error("failed to get balance of account "+t.toBase58()+": "+e)})}async getBlockTime(t){let e=eu(await this._rpcRequest("getBlockTime",[t]),nS(eg(em())));if("error"in e)throw new rX(e.error,`failed to get block time for slot ${t}`);return e.result}async getMinimumLedgerSlot(){let t=eu(await this._rpcRequest("minimumLedgerSlot",[]),nS(em()));if("error"in t)throw new rX(t.error,"failed to get minimum ledger slot");return t.result}async getFirstAvailableBlock(){let t=eu(await this._rpcRequest("getFirstAvailableBlock",[]),nH);if("error"in t)throw new rX(t.error,"failed to get first available block");return t.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};let r=eu(await this._rpcRequest("getSupply",[e]),nJ);if("error"in r)throw new rX(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){let r=this._buildArgs([t.toBase58()],e),n=eu(await this._rpcRequest("getTokenSupply",r),nx(nZ));if("error"in n)throw new rX(n.error,"failed to get token supply");return n.result}async getTokenAccountBalance(t,e){let r=this._buildArgs([t.toBase58()],e),n=eu(await this._rpcRequest("getTokenAccountBalance",r),nx(nZ));if("error"in n)throw new rX(n.error,"failed to get token account balance");return n.result}async getTokenAccountsByOwner(t,e,r){let{commitment:n,config:i}=nb(r),o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});let s=this._buildArgs(o,n,"base64",i),a=eu(await this._rpcRequest("getTokenAccountsByOwner",s),nG);if("error"in a)throw new rX(a.error,`failed to get token accounts owned by account ${t.toBase58()}`);return a.result}async getParsedTokenAccountsByOwner(t,e,r){let n=[t.toBase58()];"mint"in e?n.push({mint:e.mint.toBase58()}):n.push({programId:e.programId.toBase58()});let i=this._buildArgs(n,r,"jsonParsed"),o=eu(await this._rpcRequest("getTokenAccountsByOwner",i),nX);if("error"in o)throw new rX(o.error,`failed to get token accounts owned by account ${t.toBase58()}`);return o.result}async getLargestAccounts(t){let e={...t,commitment:t&&t.commitment||this.commitment},r=e.filter||e.commitment?[e]:[],n=eu(await this._rpcRequest("getLargestAccounts",r),n0);if("error"in n)throw new rX(n.error,"failed to get largest accounts");return n.result}async getTokenLargestAccounts(t,e){let r=this._buildArgs([t.toBase58()],e),n=eu(await this._rpcRequest("getTokenLargestAccounts",r),nY);if("error"in n)throw new rX(n.error,"failed to get token largest accounts");return n.result}async getAccountInfoAndContext(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgs([t.toBase58()],r,"base64",n),o=eu(await this._rpcRequest("getAccountInfo",i),nx(eg(n1)));if("error"in o)throw new rX(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getParsedAccountInfo(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=eu(await this._rpcRequest("getAccountInfo",i),nx(eg(n8)));if("error"in o)throw new rX(o.error,`failed to get info about account ${t.toBase58()}`);return o.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(e){throw Error("failed to get info about account "+t.toBase58()+": "+e)}}async getMultipleParsedAccounts(t,e){let{commitment:r,config:n}=nb(e),i=t.map(t=>t.toBase58()),o=this._buildArgs([i],r,"jsonParsed",n),s=eu(await this._rpcRequest("getMultipleAccounts",o),nx(eh(eg(n8))));if("error"in s)throw new rX(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfoAndContext(t,e){let{commitment:r,config:n}=nb(e),i=t.map(t=>t.toBase58()),o=this._buildArgs([i],r,"base64",n),s=eu(await this._rpcRequest("getMultipleAccounts",o),nx(eh(eg(n1))));if("error"in s)throw new rX(s.error,`failed to get info for accounts ${i}`);return s.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,r){let{commitment:n,config:i}=nb(e),o=this._buildArgs([t.toBase58()],n,void 0,{...i,epoch:null!=r?r:i?.epoch}),s=eu(await this._rpcRequest("getStakeActivation",o),nS(n4));if("error"in s)throw new rX(s.error,`failed to get Stake Activation ${t.toBase58()}`);return s.result}async getProgramAccounts(t,e){let{commitment:r,config:n}=nb(e),{encoding:i,...o}=n||{},s=this._buildArgs([t.toBase58()],r,i||"base64",{...o,...o.filters?{filters:nw(o.filters)}:null}),a=await this._rpcRequest("getProgramAccounts",s),u=eh(n2),l=!0===o.withContext?eu(a,nx(u)):eu(a,nS(u));if("error"in l)throw new rX(l.error,`failed to get accounts owned by program ${t.toBase58()}`);return l.result}async getParsedProgramAccounts(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgs([t.toBase58()],r,"jsonParsed",n),o=eu(await this._rpcRequest("getProgramAccounts",i),nS(eh(n3)));if("error"in o)throw new rX(o.error,`failed to get accounts owned by program ${t.toBase58()}`);return o.result}async confirmTransaction(t,e){let r,n;if("string"==typeof t)r=t;else{if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=tQ().decode(r)}catch(t){throw Error("signature must be base58 encoded: "+r)}return(rO(64===n.length,"signature has invalid length"),"string"==typeof t)?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:e||this.commitment,signature:r}):"lastValidBlockHeight"in t?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e||this.commitment,strategy:t}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:e||this.commitment,strategy:t})}getCancellationPromise(t){return new Promise((e,r)=>{null!=t&&(t.aborted?r(t.reason):t.addEventListener("abort",()=>{r(t.reason)}))})}getTransactionConfirmationPromise({commitment:t,signature:e}){let r,n;let i=!1;return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=r&&(this.removeSignatureListener(r),r=void 0)},confirmationPromise:new Promise((o,s)=>{try{r=this.onSignature(e,(t,e)=>{r=void 0,o({__type:rN.PROCESSED,response:{context:e,value:t}})},t);let a=new Promise(t=>{null==r?t():n=this._onSubscriptionStateChange(r,e=>{"subscribed"===e&&t()})});(async()=>{if(await a,i)return;
7let r=await this.getSignatureStatus(e);if(i||null==r)return;let{context:n,value:u}=r;if(null!=u){if(u?.err)s(u.err);else{switch(t){case"confirmed":case"single":case"singleGossip":if("processed"===u.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===u.confirmationStatus||"confirmed"===u.confirmationStatus)return}i=!0,o({__type:rN.PROCESSED,response:{context:n,value:u}})}}})()}catch(t){s(t)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t,strategy:{abortSignal:e,lastValidBlockHeight:r,signature:n}}){let i,o=!1,s=new Promise(e=>{let n=async()=>{try{return await this.getBlockHeight(t)}catch(t){return -1}};(async()=>{let t=await n();if(!o){for(;t<=r;)if(await r1(1e3),o||(t=await n(),o))return;e({__type:rN.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:a,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:n}),l=this.getCancellationPromise(e);try{let t=await Promise.race([l,u,s]);if(t.__type===rN.PROCESSED)i=t.response;else throw new rw(n)}finally{o=!0,a()}return i}async confirmTransactionUsingDurableNonceStrategy({commitment:t,strategy:{abortSignal:e,minContextSlot:r,nonceAccountPubkey:n,nonceValue:i,signature:o}}){let s,a=!1,u=new Promise(e=>{let o=i,s=null,u=async()=>{try{let{context:e,value:i}=await this.getNonceAndContext(n,{commitment:t,minContextSlot:r});return s=e.slot,i?.nonce}catch(t){return o}};(async()=>{if(o=await u(),!a)for(;;){if(i!==o){e({__type:rN.NONCE_INVALID,slotInWhichNonceDidAdvance:s});return}if(await r1(2e3),a||(o=await u(),a))return}})()}),{abortConfirmation:l,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),h=this.getCancellationPromise(e);try{let e=await Promise.race([h,c,u]);if(e.__type===rN.PROCESSED)s=e.response;else{let n;for(;;
vendor: 25,910 bytes, line 7
7){let t=await this.getSignatureStatus(o);if(null==t)break;if(t.context.slot<(e.slotInWhichNonceDidAdvance??r)){await r1(400);continue}n=t;break}if(n?.value){let e=t||"finalized",{confirmationStatus:r}=n.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new rk(o);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new rk(o);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new rk(o)}s={context:n.context,value:{err:n.value.err}}}else throw new rk(o)}}finally{a=!0,l()}return s}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:t,signature:e}){let r,n;let i=new Promise(e=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(t){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}r=setTimeout(()=>e({__type:rN.TIMED_OUT,timeoutMs:n}),n)}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:t,signature:e});try{let t=await Promise.race([s,i]);if(t.__type===rN.PROCESSED)n=t.response;else throw new rv(e,t.timeoutMs/1e3)}finally{clearTimeout(r),o()}return n}async getClusterNodes(){let t=eu(await this._rpcRequest("getClusterNodes",[]),nS(eh(il)));if("error"in t)throw new rX(t.error,"failed to get cluster nodes");return t.result}async getVoteAccounts(t){let e=this._buildArgs([],t),r=eu(await this._rpcRequest("getVoteAccounts",e),ih);if("error"in r)throw new rX(r.error,"failed to get vote accounts");return r.result}async getSlot(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,void 0,r),i=eu(await this._rpcRequest("getSlot",n),nS(em()));if("error"in i)throw new rX(i.error,"failed to get slot");return i.result}async getSlotLeader(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,void 0,r),i=eu(await this._rpcRequest("getSlotLeader",n),nS(ew()));if("error"in i)throw new rX(i.error,"failed to get slot leader");return i.result}async getSlotLeaders(t,e){let r=eu(await this._rpcRequest("getSlotLeaders",[t,e]),nS(eh(np)));if("error"in r)throw new rX(r.error,"failed to get slot leaders");return r.result}async getSignatureStatus(t,e){let{context:r,value:n}=await this.getSignatureStatuses([t],e);return rO(1===n.length),{context:r,value:n[0]}}async getSignatureStatuses(t,e){let r=[t];e&&r.push(e);let n=eu(await this._rpcRequest("getSignatureStatuses",r),ig);if("error"in n)throw new rX(n.error,"failed to get signature status");return n.result}async getTransactionCount(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,void 0,r),i=eu(await this._rpcRequest("getTransactionCount",n),nS(em()));if("error"in i)throw new rX(i.error,"failed to get transaction count");return i.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){let e=this._buildArgs([],t),r=eu(await this._rpcRequest("getInflationGovernor",e),nD);if("error"in r)throw new rX(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,r){let{commitment:n,config:i}=nb(r),o=this._buildArgs([t.map(t=>t.toBase58())],n,void 0,{...i,epoch:null!=e?e:i?.epoch}),s=eu(await this._rpcRequest("getInflationReward",o),nI);if("error"in s)throw new rX(s.error,"failed to get inflation reward");return s.result}async getInflationRate(){let t=eu(await this._rpcRequest("getInflationRate",[]),nW);if("error"in t)throw new rX(t.error,"failed to get inflation rate");return t.result}async getEpochInfo(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,void 0,r),i=eu(await this._rpcRequest("getEpochInfo",n),nq);if("error"in i)throw new rX(i.error,"failed to get epoch info");return i.result}async getEpochSchedule(){let t=eu(await this._rpcRequest("getEpochSchedule",[]),nF);if("error"in t)throw new rX(t.error,"failed to get epoch schedule");let e=t.result;return new nu(e.slotsPerEpoch,e.leaderScheduleSlotOffset,e.warmup,e.firstNormalEpoch,e.firstNormalSlot)}async getLeaderSchedule(){let t=eu(await this._rpcRequest("getLeaderSchedule",[]),nV);if("error"in t)throw new rX(t.error,"failed to get leader schedule");return t.result}async getMinimumBalanceForRentExemption(t,e){let r=this._buildArgs([t],e),n=eu(await this._rpcRequest("getMinimumBalanceForRentExemption",r),im);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(t){let{context:e,value:{blockhash:r}}=await this.getLatestBlockhashAndContext(t);return{context:e,value:{blockhash:r,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON:()=>({})}}}}async getRecentPerformanceSamples(t){let e=eu(await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),iK);if("error"in e)throw new rX(e.error,"failed to get recent performance samples");return e.result}async getFeeCalculatorForBlockhash(t,e){let r=this._buildArgs([t],e),n=eu(await this._rpcRequest("getFeeCalculatorForBlockhash",r),iq);if("error"in n)throw new rX(n.error,"failed to get fee calculator");let{context:i,value:o}=n.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(t,e){let r=rs(t.serialize()).toString("base64"),n=this._buildArgs([r],e),i=eu(await this._rpcRequest("getFeeForMessage",n),nx(eg(em())));if("error"in i)throw new rX(i.error,"failed to get fee for message");if(null===i.result)throw Error("invalid blockhash");return i.result}async getRecentPrioritizationFees(t){let e=t?.lockedWritableAccounts?.map(t=>t.toBase58()),r=e?.length?[e]:[],n=eu(await this._rpcRequest("getRecentPrioritizationFees",r),nK);if("error"in n)throw new rX(n.error,"failed to get recent prioritization fees");return n.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(t){throw Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,void 0,r),i=eu(await this._rpcRequest("getLatestBlockhash",n),iD);if("error"in i)throw new rX(i.error,"failed to get latest blockhash");return i.result}async isBlockhashValid(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgs([t],r,void 0,n),o=eu(await this._rpcRequest("isBlockhashValid",i),iW);if("error"in o)throw new rX(o.error,"failed to determine if the blockhash `"+t+"`is valid");return o.result}async getVersion(){let t=eu(await this._rpcRequest("getVersion",[]),nS(nN));if("error"in t)throw new rX(t.error,"failed to get version");return t.result}async getGenesisHash(){let t=eu(await this._rpcRequest("getGenesisHash",[]),nS(ew()));if("error"in t)throw new rX(t.error,"failed to get genesis hash");return t.result}async getBlock(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=eu(o,iL);if("error"in t)throw t.error;return t.result}case"none":{let t=eu(o,iM);if("error"in t)throw t.error;return t.result}default:{let t=eu(o,iR);if("error"in t)throw t.error;let{result:e}=t;return e?{...e,transactions:e.transactions.map(({transaction:t,meta:e,version:r})=>({meta:e,transaction:{...t,message:n_(r,t.message)},version:r}))}:null}}}catch(t){throw new rX(t,"failed to get confirmed block")}}async getParsedBlock(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=await this._rpcRequest("getBlock",i);try{switch(n?.transactionDetails){case"accounts":{let t=eu(o,iC);if("error"in t)throw t.error;return t.result}case"none":{let t=eu(o,iN);if("error"in t)throw t.error;return t.result}default:{let t=eu(o,iT);if("error"in t)throw t.error;return t.result}}}catch(t){throw new rX(t,"failed to get block")}}async getBlockProduction(t){let e,r;if("string"==typeof t)r=t;else if(t){let{commitment:n,...i}=t;r=n,e=i}let n=this._buildArgs([],r,"base64",e),i=eu(await this._rpcRequest("getBlockProduction",n),n$);if("error"in i)throw new rX(i.error,"failed to get block production information");return i.result}async getTransaction(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgsAtLeastConfirmed([t],r,void 0,n),o=eu(await this._rpcRequest("getTransaction",i),iz);if("error"in o)throw new rX(o.error,"failed to get transaction");let s=o.result;return s?{...s,transaction:{...s.transaction,message:n_(s.version,s.transaction.message)}}:s}async getParsedTransaction(t,e){let{commitment:r,config:n}=nb(e),i=this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n),o=eu(await this._rpcRequest("getTransaction",i),i$);if("error"in o)throw new rX(o.error,"failed to get transaction");return o.result}async getParsedTransactions(t,e){let{commitment:r,config:n}=nb(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,"jsonParsed",n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=eu(t,i$);if("error"in e)throw new rX(e.error,"failed to get transactions");return e.result})}async getTransactions(t,e){let{commitment:r,config:n}=nb(e),i=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],r,void 0,n)}));return(await this._rpcBatchRequest(i)).map(t=>{let e=eu(t,iz);if("error"in e)throw new rX(e.error,"failed to get transactions");let r=e.result;return r?{...r,transaction:{...r.transaction,message:n_(r.version,r.transaction.message)}}:r})}async getConfirmedBlock(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=eu(await this._rpcRequest("getBlock",r),ij);if("error"in n)throw new rX(n.error,"failed to get confirmed block");let i=n.result;if(!i)throw Error("Confirmed block "+t+" not found");let o={...i,transactions:i.transactions.map(({transaction:t,meta:e})=>{let r=new rL(t.message);return{meta:e,transaction:{...t,message:r}}})};return{...o,transactions:o.transactions.map(({transaction:t,meta:e})=>({meta:e,transaction:rz.populate(t.message,t.signatures)}))}}async getBlocks(t,e,r){let n=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],r),i=eu(await this._rpcRequest("getBlocks",n),nS(eh(em())));if("error"in i)throw new rX(i.error,"failed to get blocks");return i.result}async getBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=eu(await this._rpcRequest("getBlock",r),iU);if("error"in n)throw new rX(n.error,"failed to get block");let i=n.result;if(!i)throw Error("Block "+t+" not found");return i}async getConfirmedBlockSignatures(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),n=eu(await this._rpcRequest("getBlock",r),iU);if("error"in n)throw new rX(n.error,"failed to get confirmed block");let i=n.result;if(!i)throw Error("Confirmed block "+t+" not found");return i}async getConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e),n=eu(await this._rpcRequest("getTransaction",r),iz);if("error"in n)throw new rX(n.error,"failed to get transaction");let i=n.result;if(!i)return i;let o=new rL(i.transaction.message),s=i.transaction.signatures;return{...i,transaction:rz.populate(o,s)}}async getParsedConfirmedTransaction(t,e){let r=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),n=eu(await this._rpcRequest("getTransaction",r),i$);if("error"in n)throw new rX(n.error,"failed to get confirmed transaction");return n.result}async getParsedConfirmedTransactions(t,e){let r=t.map(t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")}));return(await this._rpcBatchRequest(r)).map(t=>{let e=eu(t,i$);if("error"in e)throw new rX(e.error,"failed to get confirmed transactions");return e.result})}async getConfirmedSignaturesForAddress(t,e,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--e<=0)&&!(e<i);)try{let t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(n.until=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}let o=await this.getSlot("finalized");for(;!("before"in n)&&!(++r>o);)try{let t=await this.getConfirmedBlockSignatures(r);t.signatures.length>0&&(n.before=t.signatures[t.signatures.length-1].toString())}catch(t){if(t instanceof Error&&t.message.includes("skipped"))continue;throw t}return(await this.getConfirmedSignaturesForAddress2(t,n)).map(t=>t.signature)}async getConfirmedSignaturesForAddress2(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=eu(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),n5);if("error"in i)throw new rX(i.error,"failed to get confirmed signatures for address");return i.result}async getSignaturesForAddress(t,e,r){let n=this._buildArgsAtLeastConfirmed([t.toBase58()],r,void 0,e),i=eu(await this._rpcRequest("getSignaturesForAddress",n),n7);if("error"in i)throw new rX(i.error,"failed to get signatures for address");return i.result}async getAddressLookupTable(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=new nh({key:t,state:nh.deserialize(n.data)})),{context:r,value:i}}async getNonceAndContext(t,e){let{context:r,value:n}=await this.getAccountInfoAndContext(t,e),i=null;return null!==n&&(i=r5.fromAccountData(n.data)),{context:r,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then(t=>t.value).catch(e=>{throw Error("failed to get nonce for account "+t.toBase58()+": "+e)})}async requestAirdrop(t,e){let r=eu(await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),iF);if("error"in r)throw new rX(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await r1(100);let t=Date.now()-this._blockhashInfo.lastFetch;if(null!==this._blockhashInfo.latestBlockhash&&!(t>=ny))return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let t=Date.now(),e=this._blockhashInfo.latestBlockhash,r=e?e.blockhash:null;for(let t=0;t<50;t++){let t=await this.getLatestBlockhash("finalized");if(r!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await r1(200)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){let{commitment:e,config:r}=nb(t),n=this._buildArgs([],e,"base64",r),i=eu(await this._rpcRequest("getStakeMinimumDelegation",n),nx(em()));if("error"in i)throw new rX(i.error,"failed to get stake minimum delegation");return i.result}async simulateTransaction(t,e,r){let n;if("message"in t){let n=t.serialize(),i=l.Buffer.from(n).toString("base64");if(Array.isArray(e)||void 0!==r)throw Error("Invalid arguments");let o=e||{};o.encoding="base64","commitment"in o||(o.commitment=this.commitment),e&&"object"==typeof e&&"innerInstructions"in e&&(o.innerInstructions=e.innerInstructions);let s=eu(await this._rpcRequest("simulateTransaction",[i,o]),nz);if("error"in s)throw Error("failed to simulate transaction: "+s.error.message);return s.result}if(t instanceof rz?((n=new rz).feePayer=t.feePayer,n.instructions=t.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures):(n=rz.populate(t))._message=n._json=void 0,void 0!==e&&!Array.isArray(e))throw Error("Invalid arguments");if(n.nonceInfo&&e)n.sign(...e);else{let t=this._disableBlockhashCaching;for(;;){let r=await this._blockhashWithExpiryBlockHeight(t);if(n.lastValidBlockHeight=r.lastValidBlockHeight,n.recentBlockhash=r.blockhash,!e)break;if(n.sign(...e),!n.signature)throw Error("!signature");let i=n.signature.toString("base64");if(this._blockhashInfo.simulatedSignatures.includes(i)||this._blockhashInfo.transactionSignatures.includes(i))t=!0;else{this._blockhashInfo.simulatedSignatures.push(i);break}}}let i=n._compile(),o=i.serialize(),s=n._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};if(r){let t=(Array.isArray(r)?r:i.nonProgramIds()).map(t=>t.toBase58());a.accounts={encoding:"base64",addresses:t}}e&&(a.sigVerify=!0),e&&"object"==typeof e&&"innerInstructions"in e&&(a.innerInstructions=e.innerInstructions);let u=eu(await this._rpcRequest("simulateTransaction",[s,a]),nz);if("error"in u){let t;if("data"in u.error&&(t=u.error.data.logs)&&Array.isArray(t)){let e="\n ",r=e+t.join(e);console.error(u.error.message,r)}throw new rG({action:"simulate",signature:"",transactionMessage:u.error.message,logs:t})}return u.result}async sendTransaction(t,e,r){if("version"in t){if(e&&Array.isArray(e))throw Error("Invalid arguments");let r=t.serialize();return await this.sendRawTransaction(r,e)}if(void 0===e||!Array.isArray(e))throw Error("Invalid arguments");if(t.nonceInfo)t.sign(...e);else{let r=this._disableBlockhashCaching;for(;;){let n=await this._blockhashWithExpiryBlockHeight(r);if(t.lastValidBlockHeight=n.lastValidBlockHeight,t.recentBlockhash=n.blockhash,t.sign(...e),!t.signature)throw Error("!signature");let i=t.signature.toString("base64");if(this._blockhashInfo.transactionSignatures.includes(i))r=!0;else{this._blockhashInfo.transactionSignatures.push(i);break}}}let n=t.serialize();return await this.sendRawTransaction(n,r)}async sendRawTransaction(t,e){let r=rs(t).toString("base64");return await this.sendEncodedTransaction(r,e)}async sendEncodedTransaction(t,e){let r={encoding:"base64"},n=e&&e.skipPreflight,i=!0===n?"processed":e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(r.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(r.minContextSlot=e.minContextSlot),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);let o=eu(await this._rpcRequest("sendTransaction",[t,r]),iV);if("error"in o){let t;throw"data"in o.error&&(t=o.error.data.logs),new rG({action:n?"send":"simulate",signature:"",transactionMessage:o.error.message,logs:t})}return o.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval(()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()},5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3===t){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([t,e])=>{this._setSubscription(t,{...e,state:"pending"})})}_setSubscription(t,e){let r=this._subscriptionsByHash[t]?.state;if(this._subscriptionsByHash[t]=e,r!==e.state){let r=this._subscriptionStateChangeCallbacksByHash[t];r&&r.forEach(t=>{try{t(e.state)}catch{}})}}_onSubscriptionStateChange(t,e){let r=this._subscriptionHashByClientSubscriptionId[t];if(null==r)return()=>{};let n=this._subscriptionStateChangeCallbacksByHash[r]||=new Set;return n.add(e),()=>{n.delete(e),0===n.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length){this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout(()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}},500));return}if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}let t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async t=>{let r=this._subscriptionsByHash[t];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size){delete this._subscriptionsByHash[t],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],await this._updateSubscriptions();return}await (async()=>{let{args:n,method:i}=r;try{this._setSubscription(t,{...r,state:"subscribing"});let e=await this._rpcWebSocket.call(i,n);this._setSubscription(t,{...r,serverSubscriptionId:e,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[e]=r.callbacks,await this._updateSubscriptions()}catch(o){if(console.error(`Received ${o instanceof Error?"":"JSON-RPC "}error calling \`${i}\``,{args:n,error:o}),!e())return;this._setSubscription(t,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await (async()=>{let{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(t,{...r,state:"unsubscribing"}),this._setSubscription(t,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[n])}catch(n){if(n instanceof Error&&console.error(`${i} error:`,n.message),!e())return;this._setSubscription(t,{...r,state:"subscribed"}),await this._updateSubscriptions();return}}this._setSubscription(t,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}}))}_handleServerNotification(t,e){let r=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==r&&r.forEach(t=>{try{t(...e)}catch(t){console.error(t)}})}_wsOnAccountNotification(t){let{result:e,subscription:r}=eu(t,n9);this._handleServerNotification(r,[e.value,e.context])}_makeSubscription(t,e){let r=this._nextClientSubscriptionId++,n=ns([t.method,e]),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];let e=this._subscriptionsByHash[n];rO(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(t,e,r){let{commitment:n,config:i}=nb(r),o=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",i);return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},o)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){let{result:e,subscription:r}=eu(t,ie);this._handleServerNotification(r,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,r,n){let{commitment:i,config:o}=nb(r),s=this._buildArgs([t.toBase58()],i||this._commitment||"finalized","base64",o||(n?{filters:nw(n)}:void 0));return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},s)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,r){let n=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],r||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){let{result:e,subscription:r}=eu(t,iJ);this._handleServerNotification(r,[e.value,e.context])}_wsOnSlotNotification(t){let{result:e,subscription:r}=eu(t,ii);this._handleServerNotification(r,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){let{result:e,subscription:r}=eu(t,is);this._handleServerNotification(r,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){let r=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,r,n){let i=e||this._commitment;if(i||r||n){let e={};r&&(e.encoding=r),i&&(e.commitment=i),n&&(e=Object.assign(e,n)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,r,n){let i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,r,n)}_wsOnSignatureNotification(t){let{result:e,subscription:r}=eu(t,ia);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,r){let n=this._buildArgs([t],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,r)=>{if("status"===t.type){e(t.result,r);try{this.removeSignatureListener(i)}catch(t){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}
7onSignatureWithOptions(t,e,r){let{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([t],n,void 0,i),s=this._makeSubscription({callback:(t,r)=>{e(t,r);try{this.removeSignatureListener(s)}catch(t){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){let{result:e,subscription:r}=eu(t,iu);this._handleServerNotification(r,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}class iG{constructor(t){this._keypair=void 0,this._keypair=t??re()}static generate(){return new iG(re())}static fromSecretKey(t,e){if(64!==t.byteLength)throw Error("bad secret key size");let r=t.slice(32,64);if(!e||!e.skipValidation){let e=rr(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error("provided secretKey is invalid")}return new iG({publicKey:r,secretKey:t})}static fromSeed(t){let e=rr(t),r=new Uint8Array(64);return r.set(t),r.set(e,32),new iG({publicKey:e,secretKey:r})}get publicKey(){return new rf(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}let iQ=Object.freeze({CreateLookupTable:{index:0,layout:t1.n_([t1.Jq("instruction"),r7("recentSlot"),t1.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:t1.n_([t1.Jq("instruction")])},ExtendLookupTable:{index:2,layout:t1.n_([t1.Jq("instruction"),r7(),t1.A9(rx(),t1.cv(t1.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:t1.n_([t1.Jq("instruction")])},CloseLookupTable:{index:4,layout:t1.n_([t1.Jq("instruction")])}});class iX{constructor(){}static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=t1.Jq("instruction").decode(t.data);for(let[t,n]of Object.entries(iQ))if(n.index==r){e=t;break}if(!e)throw Error("Invalid Instruction. Should be a LookupTable Instruction");return e}static decodeCreateLookupTable(t){this.checkProgramId(t.programId),this.checkKeysLength(t.keys,4);let{recentSlot:e}=r6(iQ.CreateLookupTable,t.data);return{authority:t.keys[1].pubkey,payer:t.keys[2].pubkey,recentSlot:Number(e)}}static decodeExtendLookupTable(t){if(this.checkProgramId(t.programId),t.keys.length<2)throw Error(`invalid instruction; found ${t.keys.length} keys, expected at least 2`);let{addresses:e}=r6(iQ.ExtendLookupTable,t.data);return{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,payer:t.keys.length>2?t.keys[2].pubkey:void 0,addresses:e.map(t=>new rf(t))}}static decodeCloseLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,3),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,recipient:t.keys[2].pubkey}}static decodeFreezeLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static decodeDeactivateLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(i0.programId))throw Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}class i0{constructor(){}static createLookupTable(t){let[e,r]=rf.findProgramAddressSync([t.authority.toBuffer(),t5().encode(t.recentSlot)],this.programId),n=r2(iQ.CreateLookupTable,{recentSlot:BigInt(t.recentSlot),bumpSeed:r}),i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:ne.programId,isSigner:!1,isWritable:!1}];return[new rU({programId:this.programId,keys:i,data:n}),e]}static freezeLookupTable(t){let e=r2(iQ.FreezeLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new rU({programId:this.programId,keys:r,data:e})}static extendLookupTable(t){let e=r2(iQ.ExtendLookupTable,{addresses:t.addresses.map(t=>t.toBytes())}),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&r.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:ne.programId,isSigner:!1,isWritable:!1}),new rU({programId:this.programId,keys:r,data:e})}static deactivateLookupTable(t){let e=r2(iQ.DeactivateLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new rU({programId:this.programId,keys:r,data:e})}static closeLookupTable(t){let e=r2(iQ.CloseLookupTable),r=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new rU({programId:this.programId,keys:r,data:e})}}i0.programId=new rf("AddressLookupTab1e1111111111111111111111111");class i1{constructor(){}static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=t1.u8("instruction").decode(t.data);for(let[t,n]of Object.entries(i2))if(n.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a ComputeBudgetInstruction");return e}static decodeRequestUnits(t){this.checkProgramId(t.programId);let{units:e,additionalFee:r}=r6(i2.RequestUnits,t.data);return{units:e,additionalFee:r}}static decodeRequestHeapFrame(t){this.checkProgramId(t.programId);let{bytes:e}=r6(i2.RequestHeapFrame,t.data);return{bytes:e}}static decodeSetComputeUnitLimit(t){this.checkProgramId(t.programId);let{units:e}=r6(i2.SetComputeUnitLimit,t.data);return{units:e}}static decodeSetComputeUnitPrice(t){this.checkProgramId(t.programId);let{microLamports:e}=r6(i2.SetComputeUnitPrice,t.data);return{microLamports:e}}static checkProgramId(t){if(!t.equals(i6.programId))throw Error("invalid instruction; programId is not ComputeBudgetProgram")}}let i2=Object.freeze({RequestUnits:{index:0,layout:t1.n_([t1.u8("instruction"),t1.Jq("units"),t1.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:t1.n_([t1.u8("instruction"),t1.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:t1.n_([t1.u8("instruction"),t1.Jq("units")])},SetComputeUnitPrice:{index:3,layout:t1.n_([t1.u8("instruction"),r7("microLamports")])}});class i6{constructor(){}static requestUnits(t){let e=r2(i2.RequestUnits,t);
7return new rU({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){let e=r2(i2.RequestHeapFrame,t);return new rU({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){let e=r2(i2.SetComputeUnitLimit,t);return new rU({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){let e=r2(i2.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new rU({keys:[],programId:this.programId,data:e})}}i6.programId=new rf("ComputeBudget111111111111111111111111111111");let i8=t1.n_([t1.u8("numSignatures"),t1.u8("padding"),t1.KB("signatureOffset"),t1.KB("signatureInstructionIndex"),t1.KB("publicKeyOffset"),t1.KB("publicKeyInstructionIndex"),t1.KB("messageDataOffset"),t1.KB("messageDataSize"),t1.KB("messageInstructionIndex")]);class i3{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,instructionIndex:i}=t;rO(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),rO(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);let o=i8.span,s=o+e.length,a=s+n.length,u=l.Buffer.alloc(a+r.length),c=null==i?65535:i;return i8.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:c,publicKeyOffset:o,publicKeyInstructionIndex:c,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:c},u),u.fill(e,o),u.fill(n,s),u.fill(r,a),new rU({keys:[],programId:i3.programId,data:u})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;rO(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{let t=iG.fromSecretKey(e),i=t.publicKey.toBytes(),o=ri(r,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}i3.programId=new rf("Ed25519SigVerify111111111111111111111111111");let i4=(t,e)=>{let r=e9.sign(t,e);return[r.toCompactRawBytes(),r.recovery]};e9.utils.isValidPrivateKey;let i5=e9.getPublicKey,i7=t1.n_([t1.u8("numSignatures"),t1.KB("signatureOffset"),t1.u8("signatureInstructionIndex"),t1.KB("ethAddressOffset"),t1.u8("ethAddressInstructionIndex"),t1.KB("messageDataOffset"),t1.KB("messageDataSize"),t1.u8("messageInstructionIndex"),t1.Ik(20,"ethAddress"),t1.Ik(64,"signature"),t1.u8("recoveryId")]);class i9{constructor(){}static publicKeyToEthAddress(t){rO(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return l.Buffer.from(eV(rs(t))).slice(-20)}catch(t){throw Error(`Error constructing Ethereum address: ${t}`)}}static createInstructionWithPublicKey(t){let{publicKey:e,message:r,signature:n,recoveryId:i,instructionIndex:o}=t;return i9.createInstructionWithEthAddress({ethAddress:i9.publicKeyToEthAddress(e),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){let e;let{ethAddress:r,message:n,signature:i,recoveryId:o,instructionIndex:s=0}=t;rO(20===(e="string"==typeof r?r.startsWith("0x")?l.Buffer.from(r.substr(2),"hex"):l.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${e.length} bytes`);let a=12+e.length,u=a+i.length+1,c=l.Buffer.alloc(i7.span+n.length);return i7.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:s,signature:rs(i),ethAddress:rs(e),recoveryId:o},c),c.fill(rs(n),i7.span),new rU({keys:[],programId:i9.programId,data:c})}static createInstructionWithPrivateKey(t){let{privateKey:e,message:r,instructionIndex:n}=t;rO(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{let t=rs(e),i=i5(t,!1).slice(1),o=l.Buffer.from(eV(rs(r))),[s,a]=i4(o,t);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:a,instructionIndex:n})}catch(t){throw Error(`Error creating instruction; ${t}`)}}}i9.programId=new rf("KeccakSecp256k11111111111111111111111111111");let ot=new rf("StakeConfig11111111111111111111111111111111");class oe{constructor(t,e){this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=e}}class or{constructor(t,e,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=r}}or.default=new or(0,0,rf.default);class on{constructor(){}static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=t1.Jq("instruction").decode(t.data);for(let[t,n]of Object.entries(oi))if(n.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect;
7 not a StakeInstruction");return e}static decodeInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{authorized:e,lockup:r}=r6(oi.Initialize,t.data);return{stakePubkey:t.keys[0].pubkey,authorized:new oe(new rf(e.staker),new rf(e.withdrawer)),lockup:new or(r.unixTimestamp,r.epoch,new rf(r.custodian))}}static decodeDelegate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,6),r6(oi.Delegate,t.data),{stakePubkey:t.keys[0].pubkey,votePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[5].pubkey}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{newAuthorized:e,stakeAuthorizationType:r}=r6(oi.Authorize,t.data),n={stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new rf(e),stakeAuthorizationType:{index:r}};return t.keys.length>3&&(n.custodianPubkey=t.keys[3].pubkey),n}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);let{newAuthorized:e,stakeAuthorizationType:r,authoritySeed:n,authorityOwner:i}=r6(oi.AuthorizeWithSeed,t.data),o={stakePubkey:t.keys[0].pubkey,authorityBase:t.keys[1].pubkey,authoritySeed:n,authorityOwner:new rf(i),newAuthorizedPubkey:new rf(e),stakeAuthorizationType:{index:r}};return t.keys.length>3&&(o.custodianPubkey=t.keys[3].pubkey),o}static decodeSplit(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e}=r6(oi.Split,t.data);return{stakePubkey:t.keys[0].pubkey,splitStakePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[2].pubkey,lamports:e}}static decodeMerge(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),r6(oi.Merge,t.data),{stakePubkey:t.keys[0].pubkey,sourceStakePubKey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);let{lamports:e}=r6(oi.Withdraw,t.data),r={stakePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e};return t.keys.length>5&&(r.custodianPubkey=t.keys[5].pubkey),r}static decodeDeactivate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),r6(oi.Deactivate,t.data),{stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static checkProgramId(t){if(!t.equals(os.programId))throw Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}let oi=Object.freeze({Initialize:{index:0,layout:t1.n_([t1.Jq("instruction"),((t="authorized")=>t1.n_([rx("staker"),rx("withdrawer")],t))(),((t="lockup")=>t1.n_([t1.gM("unixTimestamp"),t1.gM("epoch"),rx("custodian")],t))()])},Authorize:{index:1,layout:t1.n_([t1.Jq("instruction"),rx("newAuthorized"),t1.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:t1.n_([t1.Jq("instruction")])},Split:{index:3,layout:t1.n_([t1.Jq("instruction"),t1.gM("lamports")])},Withdraw:{index:4,layout:t1.n_([t1.Jq("instruction"),t1.gM("lamports")])},Deactivate:{index:5,layout:t1.n_([t1.Jq("instruction")])},Merge:{index:7,layout:t1.n_([t1.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:t1.n_([t1.Jq("instruction"),rx("newAuthorized"),t1.Jq("stakeAuthorizationType"),r_("authoritySeed"),rx("authorityOwner")])}}),oo=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class os{constructor(){}static initialize(t){let{stakePubkey:e,authorized:r,lockup:n}=t,i=n||or.default,o=r2(oi.Initialize,{authorized:{staker:rs(r.staker.toBuffer()),withdrawer:rs(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:rs(i.custodian.toBuffer())}});return new rU({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:rV,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(t){let e=new rz;e.add(ne.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(t){let e=new rz;e.add(ne.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=t;return e.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(t){let{stakePubkey:e,authorizedPubkey:r,votePubkey:n}=t,i=r2(oi.Delegate);return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:rY,isSigner:!1,isWritable:!1},{pubkey:ot,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){let{stakePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=t,s=r2(oi.Authorize,{newAuthorized:rs(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new rz().add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){let{stakePubkey:e,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,u=r2(oi.AuthorizeWithSeed,{newAuthorized:rs(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:rs(i.toBuffer())}),l=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:rW,isSigner:!1,isWritable:!1}];return a&&l.push({pubkey:a,isSigner:!0,isWritable:!1}),new rz().add({keys:l,programId:this.programId,data:u})}static splitInstruction(t){let{stakePubkey:e,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=t,o=r2(oi.Split,{lamports:i});
7return new rU({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t,e){let r=new rz;return r.add(ne.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:e,space:this.space,programId:this.programId})),r.add(this.splitInstruction(t))}static splitWithSeed(t,e){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:o,seed:s,lamports:a}=t,u=new rz;return u.add(ne.allocate({accountPubkey:i,basePubkey:o,seed:s,space:this.space,programId:this.programId})),e&&e>0&&u.add(ne.transfer({fromPubkey:t.authorizedPubkey,toPubkey:i,lamports:e})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:a}))}static merge(t){let{stakePubkey:e,sourceStakePubKey:r,authorizedPubkey:n}=t,i=r2(oi.Merge);return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:rY,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){let{stakePubkey:e,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=t,s=r2(oi.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:rY,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!0,isWritable:!1}),new rz().add({keys:a,programId:this.programId,data:s})}static deactivate(t){let{stakePubkey:e,authorizedPubkey:r}=t,n=r2(oi.Deactivate);return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}os.programId=new rf("Stake11111111111111111111111111111111111111"),os.space=200;class oa{constructor(t,e,r,n){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=e,this.authorizedWithdrawer=r,this.commission=n}}class ou{constructor(){}static decodeInstructionType(t){let e;this.checkProgramId(t.programId);let r=t1.Jq("instruction").decode(t.data);for(let[t,n]of Object.entries(ol))if(n.index==r){e=t;break}if(!e)throw Error("Instruction type incorrect; not a VoteInstruction");return e}static decodeInitializeAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,4);let{voteInit:e}=r6(ol.InitializeAccount,t.data);return{votePubkey:t.keys[0].pubkey,nodePubkey:t.keys[3].pubkey,voteInit:new oa(new rf(e.nodePubkey),new rf(e.authorizedVoter),new rf(e.authorizedWithdrawer),e.commission)}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{newAuthorized:e,voteAuthorizationType:r}=r6(ol.Authorize,t.data);return{votePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new rf(e),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:e,currentAuthorityDerivedKeySeed:r,newAuthorized:n,voteAuthorizationType:i}}=r6(ol.AuthorizeWithSeed,t.data);return{currentAuthorityDerivedKeyBasePubkey:t.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new rf(e),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new rf(n),voteAuthorizationType:{index:i},votePubkey:t.keys[0].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);let{lamports:e}=r6(ol.Withdraw,t.data);return{votePubkey:t.keys[0].pubkey,authorizedWithdrawerPubkey:t.keys[2].pubkey,lamports:e,toPubkey:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(oh.programId))throw Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(t,e){if(t.length<e)throw Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}let ol=Object.freeze({InitializeAccount:{index:0,layout:t1.n_([t1.Jq("instruction"),((t="voteInit")=>t1.n_([rx("nodePubkey"),rx("authorizedVoter"),rx("authorizedWithdrawer"),t1.u8("commission")],t))()])},Authorize:{index:1,layout:t1.n_([t1.Jq("instruction"),rx("newAuthorized"),t1.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:t1.n_([t1.Jq("instruction"),t1.gM("lamports")])},UpdateValidatorIdentity:{index:4,layout:t1.n_([t1.Jq("instruction")])},AuthorizeWithSeed:{index:10,layout:t1.n_([t1.Jq("instruction"),((t="voteAuthorizeWithSeedArgs")=>t1.n_([t1.Jq("voteAuthorizationType"),rx("currentAuthorityDerivedKeyOwnerPubkey"),r_("currentAuthorityDerivedKeySeed"),rx("newAuthorized")],t))()])}}),oc=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class oh{constructor(){}static initializeAccount(t){let{votePubkey:e,nodePubkey:r,voteInit:n}=t,i=r2(ol.InitializeAccount,{voteInit:{nodePubkey:rs(n.nodePubkey.toBuffer()),authorizedVoter:rs(n.authorizedVoter.toBuffer()),authorizedWithdrawer:rs(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});
7return new rU({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:rV,isSigner:!1,isWritable:!1},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(t){let e=new rz;return e.add(ne.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){let{votePubkey:e,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=t,o=r2(ol.Authorize,{newAuthorized:rs(n.toBuffer()),voteAuthorizationType:i.index});return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorizeWithSeed(t){let{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=t,a=r2(ol.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:rs(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:rs(i.toBuffer()),voteAuthorizationType:o.index}});return new rz().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:rW,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=t,o=r2(ol.Withdraw,{lamports:n});return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static safeWithdraw(t,e,r){if(t.lamports>e-r)throw Error("Withdraw will leave vote account with insufficient funds.");return oh.withdraw(t)}static updateValidatorIdentity(t){let{votePubkey:e,authorizedWithdrawerPubkey:r,nodePubkey:n}=t,i=r2(ol.UpdateValidatorIdentity);return new rz().add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}oh.programId=new rf("Vote111111111111111111111111111111111111111"),oh.space=3762;let od=new rf("Va1idator1nfo111111111111111111111111111111"),of=ek({name:ew(),website:ey(ew()),details:ey(ew()),iconUrl:ey(ew()),keybaseUsername:ey(ew())});class op{constructor(t,e){this.key=void 0,this.info=void 0,this.key=t,this.info=e}static fromConfigData(t){let e=[...t];if(2!==rA(e))return null;let r=[];for(let t=0;t<2;t++){let t=new rf(rM(e,0,rh)),n=1===rR(e);r.push({publicKey:t,isSigner:n})}if(r[0].publicKey.equals(od)&&r[1].isSigner){let t=JSON.parse(r_().decode(l.Buffer.from(e)));return ea(t,of),new op(r[1].publicKey,t)}return null}}let og=new rf("Vote111111111111111111111111111111111111111"),om=t1.n_([rx("nodePubkey"),rx("authorizedWithdrawer"),t1.u8("commission"),t1._O(),t1.A9(t1.n_([t1._O("slot"),t1.Jq("confirmationCount")]),t1.cv(t1.Jq(),-8),"votes"),t1.u8("rootSlotValid"),t1._O("rootSlot"),t1._O(),t1.A9(t1.n_([t1._O("epoch"),rx("authorizedVoter")]),t1.cv(t1.Jq(),-8),"authorizedVoters"),t1.n_([t1.A9(t1.n_([rx("authorizedPubkey"),t1._O("epochOfLastAuthorizedSwitch"),t1._O("targetEpoch")]),32,"buf"),t1._O("idx"),t1.u8("isEmpty")],"priorVoters"),t1._O(),t1.A9(t1.n_([t1._O("epoch"),t1._O("credits"),t1._O("prevCredits")]),t1.cv(t1.Jq(),-8),"epochCredits"),t1.n_([t1._O("slot"),t1._O("timestamp")],"lastTimestamp")]);class oy{constructor(t){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}static fromAccountData(t){let e=om.decode(rs(t),4),r=e.rootSlot;return e.rootSlotValid||(r=null),new oy({nodePubkey:new rf(e.nodePubkey),authorizedWithdrawer:new rf(e.authorizedWithdrawer),commission:e.commission,votes:e.votes,rootSlot:r,authorizedVoters:e.authorizedVoters.map(ob),priorVoters:function({buf:t,idx:e,isEmpty:r}){return r?[]:[...t.slice(e+1).map(ow),...t.slice(0,e).map(ow)]}(e.priorVoters),epochCredits:e.epochCredits,lastTimestamp:e.lastTimestamp})}}function ob({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new rf(t)}}function ow({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:r}){return{authorizedPubkey:new rf(t),epochOfLastAuthorizedSwitch:e,targetEpoch:r}}let ov={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function ok(t,e){let r=!1===e?"http":"https";if(!t)return ov[r].devnet;let n=ov[r][t];if(!n)throw Error(`Unknown ${r} cluster: ${t}`);return n}async function oS(t,e,r,n){let i,o;r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")?(i=r,o=n):r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(i=r,o=n):o=r;let s=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},a=await t.sendRawTransaction(e,s),u=o&&o.commitment,l=i?t.confirmTransaction(i,u):t.confirmTransaction(a,u),c=(await l).value;if(c.err){if(null!=a)throw new rG({action:s?.skipPreflight?"send":"simulate",signature:a,transactionMessage:`Status: (${JSON.stringify(c)})`});throw Error(`Raw transaction ${a} failed (${JSON.stringify(c)})`)}return a}let ox=1e9},8162:function(t,e,r){"use strict";var n=r(9509).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 i=0;i<t.length;
7i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),l=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function h(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*l+1>>>0,c=new Uint8Array(s);r<t.length;){var h=e[t.charCodeAt(r)];if(255===h)return;for(var d=0,f=s-1;(0!==h||d<o)&&-1!==f;f--,d++)h+=a*c[f]>>>0,c[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===c[p];)p++;var g=n.allocUnsafe(i+(s-p));g.fill(0,0,i);for(var m=i;p!==s;)g[m++]=c[p++];return g}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,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var l=(s-o)*c+1>>>0,h=new Uint8Array(l);o!==s;){for(var d=e[o],f=0,p=l-1;(0!==d||f<i)&&-1!==p;p--,f++)d+=256*h[p]>>>0,h[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");i=f,o++}for(var g=l-i;g!==l&&0===h[g];)g++;for(var m=u.repeat(r);g<l;++g)m+=t.charAt(h[g]);return m},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},9742:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],l=new i((s+a)*3/4-a),c=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[c++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(t,e,n){for(var i,o=[],s=e;s<n;s+=3)o.push(r[(i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===i&&o.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{h="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var l=t.charCodeAt(u)-48;o*=i,s=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===r)for(s=t.length-1,i=0;s>=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<<a&67108863,this.words[i+1]=o>>>
vendor: 7,526 bytes, line 7
726-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s<t.length;s+=3)o=t[s]|t[s+1]<<8|t[s+2]<<16,this.words[i]|=o<<a&67108863,this.words[i+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var o=0,s=0;if("be"===r)for(i=t.length-1;i>=e;i-=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i<t.length;i+=2)n=a(t,e,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,l=0,c=r;c<a;c+=n)l=u(t,c,c+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==s){var h=1;for(l=u(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},o.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){l(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(t){o.prototype.inspect=c}else o.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h,d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l<n;l++){for(var c=u>>>26,h=67108863&u,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var p=l-f|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&s}r.words[l]=0|h,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=((a<<i|o)&16777215).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],c=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(c).toString(t);r=(h=h.idivn(c)).isZero()?g+r:d[l-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},h&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(h,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n((this.negative|t.negative)==0),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n((this.negative|t.negative)==0),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n((this.negative|t.negative)==0),this.iuxor(t)}
vendor: 8,696 bytes, line 7
7,o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(n=(0|e.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&n;for(;0!==o&&s<e.length;s++)o=(n=(0|e.words[s])+o)>>26,this.words[s]=67108863&n;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,l=0,c=0|s[0],h=8191&c,d=c>>>13,f=0|s[1],p=8191&f,g=f>>>13,m=0|s[2],y=8191&m,b=m>>>13,w=0|s[3],v=8191&w,k=w>>>13,S=0|s[4],x=8191&S,E=S>>>13,_=0|s[5],A=8191&_,I=_>>>13,O=0|s[6],P=8191&O,B=O>>>13,R=0|s[7],M=8191&R,L=R>>>13,T=0|s[8],C=8191&T,N=T>>>13,j=0|s[9],U=8191&j,z=j>>>13,$=0|a[0],D=8191&$,W=$>>>13,K=0|a[1],q=8191&K,F=K>>>13,V=0|a[2],H=8191&V,J=V>>>13,Z=0|a[3],Y=8191&Z,G=Z>>>13,Q=0|a[4],X=8191&Q,tt=Q>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,tc=0|a[8],th=8191&tc,td=tc>>>13,tf=0|a[9],tp=8191&tf,tg=tf>>>13;r.negative=t.negative^e.negative,r.length=19;var tm=(l+(n=Math.imul(h,D))|0)+((8191&(i=(i=Math.imul(h,W))+Math.imul(d,D)|0))<<13)|0;l=((o=Math.imul(d,W))+(i>>>13)|0)+(tm>>>26)|0,tm&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,W))+Math.imul(g,D)|0,o=Math.imul(g,W);var ty=(l+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,F)|0)+Math.imul(d,q)|0))<<13)|0;l=((o=o+Math.imul(d,F)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,W))+Math.imul(b,D)|0,o=Math.imul(b,W),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,F)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,F)|0;var tb=(l+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(v,D),i=(i=Math.imul(v,W))+Math.imul(k,D)|0,o=Math.imul(k,W),n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,F)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,F)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,J)|0;var tw=(l+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,Y)|0))<<13)|0;l=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(x,D),i=(i=Math.imul(x,W))+Math.imul(E,D)|0,o=Math.imul(E,W),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,F)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,F)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,G)|0;var tv=(l+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;l=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,W))+Math.imul(I,D)|0,o=Math.imul(I,W),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,F)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,F)|0,n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var tk=(l+(n=n+Math.imul(h,tr)|0)|0)+((8191&(i=(i=i+Math.imul(h,tn)|0)+Math.imul(d,tr)|0))<<13)|0;l=((o=o+Math.imul(d,tn)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(P,D),i=(i=Math.imul(P,W))+Math.imul(B,D)|0,o=Math.imul(B,W),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,F)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,F)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(g,tr)|0,o=o+Math.imul(g,tn)|0;var tS=(l+(n=n+Math.imul(h,to)|0)|0)+((8191&(i=(i=i+Math.imul(h,ts)|0)+Math.imul(d,to)|0))<<13)|0;l=((o=o+Math.imul(d,ts)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(M,D),i=(i=Math.imul(M,W))+Math.imul(L,D)|0,o=Math.imul(L,W),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,F)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,F)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(b,tr)|0,o=o+Math.imul(b,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(g,to)|0,o=o+Math.imul(g,ts)|0;var tx=(l+(n=n+Math.imul(h,tu)|0)|0)+((8191&(i=(i=i+Math.imul(h,tl)|0)+Math.imul(d,tu)|0))<<13)|0;l=((o=o+Math.imul(d,tl)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(C,D),i=(i=Math.imul(C,W))+Math.imul(N,D)|0,o=Math.imul(N,W),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,F)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,F)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(v,tr)|0,i=(i=i+Math.imul(v,tn)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(b,to)|0,o=o+Math.imul(b,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(g,tu)|0,o=o+Math.imul(g,tl)|0;var tE=(l+(n=n+Math.imul(h,th)|0)|0)+((8191&(i=(i=i+Math.imul(h,td)|0)+Math.imul(d,th)|0))<<13)|0;l=((o=o+Math.imul(d,td)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(U,D),i=(i=Math.imul(U,W))+Math.imul(z,D)|0,o=Math.imul(z,W),n=n+Math.imul(C,q)|0,i=(i=i+Math.imul(C,F)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,F)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(x,tr)|0,i=(i=i+Math.imul(x,tn)|0)+Math.imul(E,tr)|0,o=o+Math.imul(E,tn)|0,n=n+Math.imul(v,to)|0,i=(i=i+Math.imul(v,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(b,tu)|0,o=o+Math.imul(b,tl)|0,n=n+Math.imul(p,th)|0,i=(i=i+Math.imul(p,td)|0)+Math.imul(g,th)|0,o=o+Math.imul(g,td)|0;var t_=(l+(n=n+Math.imul(h,tp)|0)|0)+((8191&(i=(i=i+Math.imul(h,tg)|0)+Math.imul(d,tp)|0))<<13)|0;l=((o=o+Math.imul(d,tg)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,F))+Math.imul(z,q)|0,o=Math.imul(z,F),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(A,tr)|0,i=(i=i+Math.imul(A,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn
vendor: 4,403 bytes, line 7
7)|0,n=n+Math.imul(x,to)|0,i=(i=i+Math.imul(x,ts)|0)+Math.imul(E,to)|0,o=o+Math.imul(E,ts)|0,n=n+Math.imul(v,tu)|0,i=(i=i+Math.imul(v,tl)|0)+Math.imul(k,tu)|0,o=o+Math.imul(k,tl)|0,n=n+Math.imul(y,th)|0,i=(i=i+Math.imul(y,td)|0)+Math.imul(b,th)|0,o=o+Math.imul(b,td)|0;var tA=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tg)|0)+Math.imul(g,tp)|0))<<13)|0;l=((o=o+Math.imul(g,tg)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,J))+Math.imul(z,H)|0,o=Math.imul(z,J),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,tr)|0,i=(i=i+Math.imul(P,tn)|0)+Math.imul(B,tr)|0,o=o+Math.imul(B,tn)|0,n=n+Math.imul(A,to)|0,i=(i=i+Math.imul(A,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(x,tu)|0,i=(i=i+Math.imul(x,tl)|0)+Math.imul(E,tu)|0,o=o+Math.imul(E,tl)|0,n=n+Math.imul(v,th)|0,i=(i=i+Math.imul(v,td)|0)+Math.imul(k,th)|0,o=o+Math.imul(k,td)|0;var tI=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tg)|0)+Math.imul(b,tp)|0))<<13)|0;l=((o=o+Math.imul(b,tg)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,G))+Math.imul(z,Y)|0,o=Math.imul(z,G),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(M,tr)|0,i=(i=i+Math.imul(M,tn)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,tn)|0,n=n+Math.imul(P,to)|0,i=(i=i+Math.imul(P,ts)|0)+Math.imul(B,to)|0,o=o+Math.imul(B,ts)|0,n=n+Math.imul(A,tu)|0,i=(i=i+Math.imul(A,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(x,th)|0,i=(i=i+Math.imul(x,td)|0)+Math.imul(E,th)|0,o=o+Math.imul(E,td)|0;var tO=(l+(n=n+Math.imul(v,tp)|0)|0)+((8191&(i=(i=i+Math.imul(v,tg)|0)+Math.imul(k,tp)|0))<<13)|0;l=((o=o+Math.imul(k,tg)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,tt))+Math.imul(z,X)|0,o=Math.imul(z,tt),n=n+Math.imul(C,tr)|0,i=(i=i+Math.imul(C,tn)|0)+Math.imul(N,tr)|0,o=o+Math.imul(N,tn)|0,n=n+Math.imul(M,to)|0,i=(i=i+Math.imul(M,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,n=n+Math.imul(P,tu)|0,i=(i=i+Math.imul(P,tl)|0)+Math.imul(B,tu)|0,o=o+Math.imul(B,tl)|0,n=n+Math.imul(A,th)|0,i=(i=i+Math.imul(A,td)|0)+Math.imul(I,th)|0,o=o+Math.imul(I,td)|0;var tP=(l+(n=n+Math.imul(x,tp)|0)|0)+((8191&(i=(i=i+Math.imul(x,tg)|0)+Math.imul(E,tp)|0))<<13)|0;l=((o=o+Math.imul(E,tg)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(U,tr),i=(i=Math.imul(U,tn))+Math.imul(z,tr)|0,o=Math.imul(z,tn),n=n+Math.imul(C,to)|0,i=(i=i+Math.imul(C,ts)|0)+Math.imul(N,to)|0,o=o+Math.imul(N,ts)|0,n=n+Math.imul(M,tu)|0,i=(i=i+Math.imul(M,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,n=n+Math.imul(P,th)|0,i=(i=i+Math.imul(P,td)|0)+Math.imul(B,th)|0,o=o+Math.imul(B,td)|0;var tB=(l+(n=n+Math.imul(A,tp)|0)|0)+((8191&(i=(i=i+Math.imul(A,tg)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tg)|0)+(i>>>13)|0)+(tB>>>26)|0,tB&=67108863,n=Math.imul(U,to),i=(i=Math.imul(U,ts))+Math.imul(z,to)|0,o=Math.imul(z,ts),n=n+Math.imul(C,tu)|0,i=(i=i+Math.imul(C,tl)|0)+Math.imul(N,tu)|0,o=o+Math.imul(N,tl)|0,n=n+Math.imul(M,th)|0,i=(i=i+Math.imul(M,td)|0)+Math.imul(L,th)|0,o=o+Math.imul(L,td)|0;var tR=(l+(n=n+Math.imul(P,tp)|0)|0)+((8191&(i=(i=i+Math.imul(P,tg)|0)+Math.imul(B,tp)|0))<<13)|0;l=((o=o+Math.imul(B,tg)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(U,tu),i=(i=Math.imul(U,tl))+Math.imul(z,tu)|0,o=Math.imul(z,tl),n=n+Math.imul(C,th)|0,i=(i=i+Math.imul(C,td)|0)+Math.imul(N,th)|0,o=o+Math.imul(N,td)|0;var tM=(l+(n=n+Math.imul(M,tp)|0)|0)+((8191&(i=(i=i+Math.imul(M,tg)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tg)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(U,th),i=(i=Math.imul(U,td))+Math.imul(z,th)|0,o=Math.imul(z,td);var tL=(l+(n=n+Math.imul(C,tp)|0)|0)+((8191&(i=(i=i+Math.imul(C,tg)|0)+Math.imul(N,tp)|0))<<13)|0;l=((o=o+Math.imul(N,tg)|0)+(i>>>13)|0)+(tL>>>26)|0,tL&=67108863;var tT=(l+(n=Math.imul(U,tp))|0)+((8191&(i=(i=Math.imul(U,tg))+Math.imul(z,tp)|0))<<13)|0;return l=((o=Math.imul(z,tg))+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,u[0]=tm,u[1]=ty,u[2]=tb,u[3]=tw,u[4]=tv,u[5]=tk,u[6]=tS,u[7]=tx,u[8]=tE,u[9]=t_,u[10]=tA,u[11]=tI,u[12]=tO,u[13]=tP,u[14]=tB,u[15]=tR,u[16]=tM,u[17]=tL,u[18]=tT,0!==l&&(u[19]=l,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;
vendor: 25,303 bytes, line 7
7for(var a=67108863&n,u=Math.min(o,e.length-1),l=Math.max(0,o-t.length+1);l<=u;l++){var c=o-l,h=(0|t.words[c])*(0|e.words[l]),d=67108863&h;s=s+(h/67108864|0)|0,a=67108863&(d=d+a|0),i+=(s=s+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e){this.x=t,this.y=e}Math.imul||(m=g),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):n<63?g(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),l=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=u,d=l,f=0;f<s;f++){var p=r[c+f],g=n[c+f],m=r[c+f+s],y=n[c+f+s],b=h*m-d*y;y=h*y+d*m,m=b,r[c+f]=p+m,n[c+f]=g+y,r[c+f+s]=p-m,n[c+f+s]=g-y,f!==a&&(b=u*h-l*d,d=u*d+l*h,h=b)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n((-8192&o)==0)},b.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=Array(n),a=Array(n),u=Array(n),l=Array(n),c=Array(n),h=Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,l,n),this.transform(s,o,a,u,n,i),this.transform(l,o,c,h,n,i);for(var f=0;f<n;f++){var p=a[f]*c[f]-u[f]*h[f];u[f]=a[f]*h[f]+u[f]*c[f],a[f]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var i,o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o;if(i-=s,i=Math.max(0,i),r){for(var u=0;u<s;u++)r.words[u]=this.words[u];r.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var c=0|this.words[u];this.words[u]=l<<26-o|c>>>o,l=c&a}return r&&0!==l&&(r.words[r.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<<e)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<<e),this._strip())},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return(n("number"==typeof t),n(t<67108864),t<0)?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;o-=67108863&u,a=(o>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==e){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l<r.length;l++)r.words[l]=0}var c=i.clone()._ishlnsubmul(s,1,u);0===c.negative&&(i=c,r&&(r.words[u]=1));for(var h=u-1;h>=0;h--){var d=(0|i.words[s.length+h])*67108864+(0|i.words[s.length+h-1]);for(d=Math.min(d/a|0,67108863),i._ishlnsubmul(s,d,h);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(s,1,h),i.isZero()||(i.negative^=1);r&&(r.words[h]=d)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(t,e,r){var i,s,a;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;(e.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,c=1;(r.words[0]&c)==0&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;(i.words[0]&d)==0&&h<26;++h,d<<=1);if(h>0)for(i.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];a+=o,o=a>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return -1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return -1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new _(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(k,v),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var i=t.words[9];for(n=10,e.words[e.length++]=4194303&i;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,v),i(x,v),i(E,v),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=(0|t.words[r])*19+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(w[t])return w[t];if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new x;else if("p25519"===t)e=new E;else throw Error("Unknown prime "+t);return w[t]=e,e},_.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(a);){for(var g=f,m=0;0!==g.cmp(a);m++)g=g.redSqr();n(m<p);var y=this.pow(h,new o(1).iushln(p-m-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=m}return d},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var l=e.words[n],c=u-1;c>=0;c--){var h=l>>c&1;if(i!==r[0]&&(i=this.sqr(i)),0===h&&0===s){a=0;continue}s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,_),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5532:function(t,e,r){"use strict";var n=r(8764).Buffer,i=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]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=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)&&i(e,t,r);return o(e,t),e},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.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=u(r(3550)),c=u(r(7191)),h=a(r(1379)),d=new("function"!=typeof TextDecoder?h.TextDecoder:TextDecoder)("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))};class f 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=f;class p{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 g(t,e,r){let n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new f("Reached the end of buffer when deserializing");throw t}}}e.BinaryWriter=p;class m{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 f(`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 d.decode(e)}catch(t){throw new f(`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 y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,r,n,i){try{if("string"==typeof n)i[`write${y(n)}`](r);
7else if(n instanceof Array){if("number"==typeof n[0]){if(r.length!==n[0])throw new f(`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 f(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)b(t,null,r[e],n[0],i)}else i.writeArray(r,r=>{b(t,e,r,n[0],i)})}else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),b(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,o)=>{b(t,e,o,n.key,i),b(t,e,r,n.value,i)});break;default:throw new f(`FieldType ${n} unrecognized`)}else w(t,r,i)}catch(t){throw t instanceof f&&t.addToFieldPath(e),t}}function w(t,e,r){if("function"==typeof e.borshSerialize){e.borshSerialize(r);return}let n=t.get(e.constructor);if(!n)throw new f(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{b(t,n,e[n],i,r)});else if("enum"===n.kind){let i=e[n.field];for(let o=0;o<n.values.length;++o){let[s,a]=n.values[o];if(s===i){r.writeU8(o),b(t,s,e[s],a,r);break}}}else throw new f(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function v(t,e,r,n){try{if("string"==typeof r)return n[`read${y(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"!=typeof r[1])return n.readArray(()=>v(t,e,r[0],n));{let e=[];for(let i=0;i<r[1];i++)e.push(v(t,null,r[0],n));return e}}if("option"===r.kind){if(n.readU8())return v(t,e,r.type,n);return}if("map"===r.kind){let i=new Map,o=n.readU32();for(let s=0;s<o;s++){let o=v(t,e,r.key,n),s=v(t,e,r.value,n);i.set(o,s)}return i}return k(t,r,n)}catch(t){throw t instanceof f&&t.addToFieldPath(e),t}}function k(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let n=t.get(e);if(!n)throw new f(`Class ${e.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,o]of t.get(e).fields)n[i]=v(t,i,o,r);return new e(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new f(`Enum index: ${i} is out of range`);let[o,s]=n.values[i],a=v(t,o,s,r);return new e({[o]:a})}throw new f(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}s([g],m.prototype,"readU8",null),s([g],m.prototype,"readU16",null),s([g],m.prototype,"readU32",null),s([g],m.prototype,"readU64",null),s([g],m.prototype,"readU128",null),s([g],m.prototype,"readU256",null),s([g],m.prototype,"readU512",null),s([g],m.prototype,"readString",null),s([g],m.prototype,"readFixedArray",null),s([g],m.prototype,"readArray",null),e.BinaryReader=m,e.serialize=function(t,e,r=p){let n=new r;return w(t,e,n),n.toArray()},e.deserialize=function(t,e,r,n=m){let i=new n(r),o=k(t,e,i);if(i.offset<r.length)throw new f(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},e.deserializeUnchecked=function(t,e,r,n=m){return k(t,e,new n(r))}},7191:function(t,e,r){var n=r(8162);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8764:function(t,e,r){"use strict";let n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(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 c(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!a.isEncoding(e))throw TypeError("Unknown encoding: "+e);let r=0|p(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(j(t,Uint8Array)){let e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(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(j(t,ArrayBuffer)||t&&j(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(j(t,SharedArrayBuffer)||t&&j(t.buffer,SharedArrayBuffer)))return d(t,e,r);
vendor: 15,296 bytes, line 7
7if("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 a.from(n,e,r);let i=function(t){var e;if(a.isBuffer(t)){let e=0|f(t.length),r=s(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?s(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.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 l(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 c(t){return l(t),s(t<0?0:0|f(t))}function h(t){let e=t.length<0?0:0|f(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(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),a.prototype),n}function f(t){if(t>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||j(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 i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return T(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(t).length;default:if(i)return n?-1:T(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let i=!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 i="";for(let n=e;n<r;++n)i+=U[t[n]];return i}(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}(this,e,r);case"base64":var o,s;return o=e,s=r,0===o&&s===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}(this,e,r);default:if(i)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){var o;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(o=r=+r)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return -1;r=t.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,u=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;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(t,o)===l(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(t,o+n)!==l(e,n)){r=!1;break}if(r)return o}return -1}function w(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let e=t[i],o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:(192&(r=t[i+1]))==128&&(u=(31&e)<<6|63&r)>127&&(o=u);break;case 3:r=t[i+1],n=t[i+2],(192&r)==128&&(192&n)==128&&(u=(15&e)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}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 v(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 k(t,e,r,n,i,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function S(t,e,r,n,i){B(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function x(t,e,r,n,i){B(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function E(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function _(t,e,r,n,o){return e=+e,r>>>=0,o||E(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,o){return e=+e,r>>>=0,o||E(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=2147483647,a.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}}(),a.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return c(t)},a.allocUnsafeSlow=function(t){return c(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),j(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.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 i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.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}},a.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 a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;let n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){let e=t[r];if(j(e,Uint8Array))i+e.length>n.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else if(a.isBuffer(e))e.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=e.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.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)m(this,e,e+1);return this},a.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)m(this,e,e+3),m(this,e+1,e+2);return this},a.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)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?w(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.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+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(j(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.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===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;let o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<u;++t)if(l[t]!==c[t]){o=l[t],s=c[t];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){var i,o,s,a,u,l,c,h;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 d=this.length-e;if((void 0===r||r>d)&&(r=d),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let f=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let i;r=Number(r)||0;let o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=e.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(e.substr(2*i,2),16);if(n!=n)break;t[r+i]=n}return i}(this,t,e,r);case"utf8":case"utf-8":return i=e,o=r,N(T(t,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return s=e,a=r,N(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return u=e,l=r,N(C(t),this,u,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,h=r,N(function(t,e){let r,n;let i=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,this.length-c),this,c,h);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.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,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||v(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||v(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&M(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+16777216*this[++t],i=this[++t]+256*this[++t]+65536*this[++t]+16777216*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&M(t,this.length-8);let n=16777216*e+65536*this[++t]+256*this[++t]+this[++t],i=16777216*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||v(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||v(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||v(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&M(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+16777216*this[++t])}),a.prototype.readBigInt64BE=z(function(t){R(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&M(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(16777216*this[++t]+65536*this[++t]+256*this[++t]+r)}
vendor: 4,852 bytes, line 7
7),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||v(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,t,e,r,n,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,t,e,r,n,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(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},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(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},a.prototype.writeBigUInt64LE=z(function(t,e=0){return S(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=z(function(t,e=0){return x(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(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},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(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},a.prototype.writeBigInt64LE=z(function(t,e=0){return S(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=z(function(t,e=0){return x(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(t,e,r){return _(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return _(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.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 i=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),i},a.prototype.fill=function(t,e,r,n){let i;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&&!a.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(i=e;i<r;++i)this[i]=t;else{let o=a.isBuffer(t)?t:a.from(t,n),s=o.length;
7if(0===s)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};let I={};function O(t,e,r){I[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 P(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 B(t,e,r,n,i,o){if(t>r||t<e){let n;let i="bigint"==typeof e?"n":"";throw n=o>3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new I.ERR_OUT_OF_RANGE("value",n,t)}R(i,"offset"),(void 0===n[i]||void 0===n[i+o])&&M(i,n.length-(o+1))}function R(t,e){if("number"!=typeof t)throw new I.ERR_INVALID_ARG_TYPE(e,"number",t)}function M(t,e,r){if(Math.floor(t)!==t)throw R(t,r),new I.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new I.ERR_BUFFER_OUT_OF_BOUNDS;throw new I.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}O("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),O("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),O("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=P(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=P(i)),i+="n"),n+=` It must be ${e}. Received ${i}`},RangeError);let L=/[^+/0-9A-Za-z-_]/g;function T(t,e){let r;e=e||1/0;let n=t.length,i=null,o=[];for(let s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function C(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function j(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}let U=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function z(t){return"undefined"==typeof BigInt?$:t}function $(){throw Error("BigInt not supported")}},5987:function(t){"use strict";var e={single_source_shortest_paths:function(t,r,n){var i,o,s,a,u,l,c,h={},d={};d[r]=0;var f=e.PriorityQueue.make();for(f.push(r,0);!f.empty();)for(s in o=(i=f.pop()).value,a=i.cost,u=t[o]||{})u.hasOwnProperty(s)&&(l=a+u[s],c=d[s],(void 0===d[s]||c>l)&&(d[s]=l,f.push(s,l),h[s]=o));if(void 0!==n&&void 0===d[n])throw Error(["Could not find a path from ",r," to ",n,"."].join(""));return h},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,r,n){var i=e.single_source_shortest_paths(t,r,n);return e.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(t){var r,n=e.PriorityQueue,i={};for(r in t=t||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){this.queue.push({value:t,cost:e}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},6729:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}
7function o(t,e,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.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 i=0,o=n.length,s=Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,l,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){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,i),!0;case 5:return c.fn.call(c.context,e,n,i,o),!0;case 6:return c.fn.call(c.context,e,n,i,o,s),!0}for(l=1,u=Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){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,i);break;default:if(!u)for(d=1,u=Array(h-1);d<h;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,l=[],c=a.length;u<c;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&l.push(a[u]);l.length?this._events[o]=1===l.length?l[0]:l:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},8679:function(t,e,r){"use strict";var n=r(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(t){return n.isMemo(t)?s:a[t.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(p){var i=f(r);i&&i!==p&&t(e,i,n)}var s=c(r);h&&(s=s.concat(h(r)));for(var a=u(e),g=u(r),m=0;m<s.length;++m){var y=s[m];if(!o[y]&&!(n&&n[y])&&!(g&&g[y])&&!(a&&a[y])){var b=d(r,y);try{l(e,y,b)}catch(t){}}}}return e}},6073:function(t){"use strict";let e=t=>"string"==typeof t,r=()=>{let t,e;let r=new Promise((r,n)=>{t=r,e=n});return r.resolve=t,r.reject=e,r},n=t=>null==t?"":""+t,i=(t,e,r)=>{t.forEach(t=>{e[t]&&(r[t]=e[t])})},o=/###/g,s=t=>t&&t.indexOf("###")>-1?t.replace(o,"."):t,a=t=>!t||e(t),u=(t,r,n)=>{let i=e(r)?r.split("."):r,o=0;for(;o<i.length-1;){if(a(t))return{};let e=s(i[o]);!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++o}return a(t)?{}:{obj:t,k:s(i[o])}},l=(t,e,r)=>{let{obj:n,k:i}=u(t,e,Object);if(void 0!==n||1===e.length){n[i]=r;return}let o=e[e.length-1],s=e.slice(0,e.length-1),a=u(t,s,Object);for(;void 0===a.obj&&s.length;)o=`${s[s.length-1]}.${o}`,(a=u(t,s=s.slice(0,s.length-1),Object))&&a.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=r},c=(t,e,r,n)=>{let{obj:i,k:o}=u(t,e,Object);i[o]=i[o]||[],i[o].push(r)},h=(t,e)=>{let{obj:r,k:n}=u(t,e);if(r)return r[n]},d=(t,e,r)=>{let n=h(t,r);return void 0!==n?n:h(e,r)},f=(t,r,n)=>{for(let i in r)"__proto__"!==i&&"constructor"!==i&&(i in t?e(t[i])||t[i]instanceof String||e(r[i])||r[i]instanceof String?n&&(t[i]=r[i]):f(t[i],r[i],n):t[i]=r[i]);return t},p=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};let m=t=>e(t)?t.replace(/[&<>
7"'\/]/g,t=>g[t]):t;class y{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let e=this.regExpMap.get(t);if(void 0!==e)return e;let r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}let b=[" ",",","?","!",";"],w=new y(20),v=(t,e,r)=>{e=e||"",r=r||"";let n=b.filter(t=>0>e.indexOf(t)&&0>r.indexOf(t));if(0===n.length)return!0;let i=w.getRegExp(`(${n.map(t=>"?"===t?"\\?":t).join("|")})`),o=!i.test(t);if(!o){let e=t.indexOf(r);e>0&&!i.test(t.substring(0,e))&&(o=!0)}return o},k=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];let n=e.split(r),i=t;for(let t=0;t<n.length;){let e;if(!i||"object"!=typeof i)return;let o="";for(let s=t;s<n.length;++s)if(s!==t&&(o+=r),o+=n[s],void 0!==(e=i[o])){if(["string","number","boolean"].indexOf(typeof e)>-1&&s<n.length-1)continue;t+=s-t+1;break}i=e}return i},S=t=>t&&t.replace("_","-"),x={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class E{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||x,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(e(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new E(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new E(this.logger,t)}}var _=new E;class A{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach(t=>{this.observers[t]||(this.observers[t]=new Map);let r=this.observers[t].get(e)||0;this.observers[t].set(e,r+1)}),this}off(t,e){if(this.observers[t]){if(!e){delete this.observers[t];return}this.observers[t].delete(e)}}emit(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(t=>{let[e,n]=t;for(let t=0;t<n;t++)e(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(e=>{let[n,i]=e;for(let e=0;e<i;e++)n.apply(n,[t,...r])})}}class I extends A{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}removeNamespaces(t){let e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,r,n){let i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;t.indexOf(".")>-1?i=t.split("."):(i=[t,r],n&&(Array.isArray(n)?i.push(...n):e(n)&&s?i.push(...n.split(s)):i.push(n)));let u=h(this.data,i);return(!u&&!r&&!n&&t.indexOf(".")>-1&&(t=i[0],r=i[1],n=i.slice(2).join(".")),!u&&a&&e(n))?k(this.data&&this.data[t]&&this.data[t][r],n,s):u}addResource(t,e,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=[t,e];r&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."),n=e,e=s[1]),this.addNamespaces(e),l(this.data,s,n),i.silent||this.emit
7("added",t,e,r,n)}addResources(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let i in n)(e(n[i])||Array.isArray(n[i]))&&this.addResource(t,r,i,n[i],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,e,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},s=[t,e];t.indexOf(".")>-1&&(s=t.split("."),n=r,r=e,e=s[1]),this.addNamespaces(e);let a=h(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?f(a,r,i):a={...a,...r},l(this.data,s,a),o.silent||this.emit("added",t,e,r)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return(e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){let e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find(t=>e[t]&&Object.keys(e[t]).length>0)}toJSON(){return this.data}}var O={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(t=>{this.processors[t]&&(e=this.processors[t].process(e,r,n,i))}),e}};let P={};class B extends A{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),i(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
7i18nFormat","utils"],t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=_.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;let r=this.resolve(t,e);return r&&void 0!==r.res}extractFromKey(t,r){let n=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=r.ns||this.options.defaultNS||[],s=n&&t.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!v(t,n,i);if(s&&!a){let r=t.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:t,namespaces:e(o)?[o]:o};let s=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),t=s.join(i)}return{key:t,namespaces:e(o)?[o]:o}}translate(t,r,n){if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);let i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],r),u=a[a.length-1],l=r.lng||this.language,c=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){let t=r.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${t}${s}`,usedKey:s,exactUsedKey:s,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:`${u}${t}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:l,usedNS:u,usedParams:this.getUsedParamsDetails(r)}:s}let h=this.resolve(t,r),d=h&&h.res,f=h&&h.usedKey||s,p=h&&h.exactUsedKey||s,g=Object.prototype.toString.apply(d),m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=!e(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(y&&d&&b&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(g)&&!(e(m)&&Array.isArray(d))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(h.res=t,h.usedParams=this.getUsedParamsDetails(r),h):t}if(o){let t=Array.isArray(d),e=t?[]:{},n=t?p:f;for(let t in d)if(Object.prototype.hasOwnProperty.call(d,t)){let i=`${n}${o}${t}`;e[t]=this.translate(i,{...r,joinArrays:!1,ns:a}),e[t]===i&&(e[t]=d[t])}d=e}}else if(y&&e(m)&&Array.isArray(d))(d=d.join(m))&&(d=this.extendTranslation(d,t,r,n));else{let i=!1,a=!1,c=void 0!==r.count&&!e(r.count),f=B.hasDefaultValue(r),p=c?this.pluralResolver.getSuffix(l,r.count,r):"",g=r.ordinal&&c?this.pluralResolver.getSuffix(l,r.count,{ordinal:!1}):"",m=c&&!r.ordinal&&0===r.count&&this.pluralResolver.shouldUseIntlApi(),y=m&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${p}`]||r[`defaultValue${g}`]||r.defaultValue;!this.isValidLookup(d)&&f&&(i=!0,d=y),this.isValidLookup(d)||(a=!0,d=s);let b=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:d,w=f&&y!==d&&this.options.updateMissing;if(a||i||w){if(this.logger.log(w?"updateKey":"missingKey",l,u,s,w?y:d),o){let t=this.resolve(s,{...r,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[],e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let r=0;r<e.length;r++)t.push(e[r]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(r.lng||this.language):t.push(r.lng||this.language);let n=(t,e,n)=>{let i=f&&n!==d?n:b;this.options.missingKeyHandler?this.options.missingKeyHandler(t,u,e,i,w,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,u,e,i,w,r),this.emit
7("missingKey",t,u,e,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?t.forEach(t=>{let e=this.pluralResolver.getSuffixes(t,r);m&&r[`defaultValue${this.options.pluralSeparator}zero`]&&0>e.indexOf(`${this.options.pluralSeparator}zero`)&&e.push(`${this.options.pluralSeparator}zero`),e.forEach(e=>{n([t],s+e,r[`defaultValue${e}`]||y)})}):n(t,s,y))}d=this.extendTranslation(d,t,r,h,n),a&&d===s&&this.options.appendNamespaceToMissingKey&&(d=`${u}:${s}`),(a||i)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${s}`:s,i?d:void 0):this.options.parseMissingKeyHandler(d))}return i?(h.res=d,h.usedParams=this.getUsedParamsDetails(r),h):d}extendTranslation(t,r,n,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){let a;n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let u=e(t)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(u){let e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let l=n.replace&&!e(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,n.lng||this.language||i.usedLng,n),u){let e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return o&&o[0]===e[0]&&!n.context?(s.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${r[0]}`),null):s.translate(...e,r)},n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,u=e(a)?[a]:a;return null!=t&&u&&u.length&&!1!==n.applyPostProcessor&&(t=O.handle(u,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let r,n,i,o,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(t)&&(t=[t]),t.forEach(t=>{if(this.isValidLookup(r))return;let u=this.extractFromKey(t,a),l=u.key;n=l;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let h=void 0!==a.count&&!e(a.count),d=h&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==a.context&&(e(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);
7c.forEach(t=>{this.isValidLookup(r)||(s=t,!P[`${p[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(P[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(e=>{let n;if(this.isValidLookup(r))return;o=e;let s=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,e,t,a);else{let t;h&&(t=this.pluralResolver.getSuffix(e,a.count,a));let r=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(s.push(l+t),a.ordinal&&0===t.indexOf(n)&&s.push(l+t.replace(n,this.options.pluralSeparator)),d&&s.push(l+r)),f){let e=`${l}${this.options.contextSeparator}${a.context}`;s.push(e),h&&(s.push(e+t),a.ordinal&&0===t.indexOf(n)&&s.push(e+t.replace(n,this.options.pluralSeparator)),d&&s.push(e+r))}}for(;n=s.pop();)this.isValidLookup(r)||(i=n,r=this.getResource(e,t,n,a))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}getResource(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,r,n):this.resourceStore.getResource(t,e,r,n)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.replace&&!e(t.replace),n=r?t.replace:t;if(r&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!r)for(let t of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[t];return n}static hasDefaultValue(t){let e="defaultValue";for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e===r.substring(0,e.length)&&void 0!==t[r])return!0;return!1}}let R=t=>t.charAt(0).toUpperCase()+t.slice(1);class M{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=_.create("languageUtils")}getScriptPartFromCode(t){if(!(t=S(t))||0>t.indexOf("-"))return null;let e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase())?null:this.formatLanguageCode(e.join("-"))}getLanguagePartFromCode(t){if(!(t=S(t))||0>t.indexOf("-"))return t;let e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(e(t)&&t.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let e=Intl.getCanonicalLocales(t)[0];if(e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e)return e}catch(t){}let e=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map(t=>t.toLowerCase()):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=R(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=R(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=R(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){let e;return t?(t.forEach(t=>{if(e)return;let r=this.formatLanguageCode(t);(!this.options.supportedLngs||this.isSupportedCode(r))&&(e=r)}),!e&&this.options.supportedLngs&&t.forEach(t=>{if(e)return;let r=this.getLanguagePartFromCode(t);if(this.isSupportedCode(r))return e=r;e=this.options.supportedLngs.find(t=>{if(t===r||!(0>t.indexOf("-")&&0>r.indexOf("-"))&&(t.indexOf("-")>0&&0>r.indexOf("-")&&t.substring(0,t.indexOf("-"))===r||0===t.indexOf(r)&&r.length>1))return t})}),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}getFallbackCodes(t,r){if(!t)return[];if("function"==typeof t&&(t=t(r)),e(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];
7return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){let n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=t=>{t&&(this.isSupportedCode(t)?i.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return e(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):e(t)&&o(this.formatLanguageCode(t)),n.forEach(t=>{0>i.indexOf(t)&&o(this.formatLanguageCode(t))}),i}}let L=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],T={1:t=>Number(t>1),2:t=>Number(1!=t),3:t=>0,4:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),5:t=>Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5),6:t=>Number(1==t?0:t>=2&&t<=4?1:2),7:t=>Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),8:t=>Number(1==t?0:2==t?1:8!=t&&11!=t?2:3),9:t=>Number(t>=2),10:t=>Number(1==t?0:2==t?1:t<7?2:t<11?3:4),11:t=>Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3),12:t=>Number(t%10!=1||t%100==11),13:t=>Number(0!==t),14:t=>Number(1==t?0:2==t?1:3==t?2:3),15:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2),16:t=>Number(t%10==1&&t%100!=11?0:0!==t?1:2),17:t=>Number(1==t||t%10==1&&t%100!=11?0:1),18:t=>Number(0==t?0:1==t?1:2),19:t=>Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3),20:t=>Number(1==t?0:0==t||t%100>0&&t%100<20?1:2),21:t=>Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0),22:t=>Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)},C=["v1","v2","v3"],N=["v4"],j={zero:0,one:1,two:2,few:3,many:4,other:5},U=()=>{let t={};return L.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:T[e.fc]}})}),t};class z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=_.create("pluralResolver"),(!this.options.compatibilityJSON||N.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=U(),this.pluralRulesCache={}}addRule(t,e){this.rules[t]=e}clearCache(){this.pluralRulesCache={}}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){let r;let n=S("dev"===t?"en":t),i=e.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if(!t.match(/-|_/))return;let n=this.languageUtils.getLanguagePartFromCode(t);r=this.getRule(n,e)}return this.pluralRulesCache[o]=r,r}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,e);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};
7return this.getSuffixes(t,r).map(t=>`${e}${t}`)}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,e);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((t,e)=>j[t]-j[e]).map(t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`):r.numbers.map(r=>this.getSuffix(t,r,e)):[]}getSuffix(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(t,r);return n?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(e)}`:this.getSuffixRetroCompatible(n,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){let r=t.noAbs?t.plurals(e):t.plurals(Math.abs(e)),n=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===n?n="plural":1===n&&(n=""));let i=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}
7shouldUseIntlApi(){return!C.includes(this.options.compatibilityJSON)}}let $=function(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],s=d(t,r,n);return!s&&o&&e(n)&&void 0===(s=k(t,n,i))&&(s=k(r,n,i)),s},D=t=>t.replace(/\$/g,"$$$$");class W{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=_.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});let{escape:e,escapeValue:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:s,suffixEscaped:a,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:h,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:g,nestingOptionsSeparator:y,maxReplaces:b,alwaysFormat:w}=t.interpolation;this.escape=void 0!==e?e:m,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?p(i):o||"{{",this.suffix=s?p(s):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=h?p(h):d||p("$t("),this.nestingSuffix=f?p(f):g||p(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||1e3,this.alwaysFormat=void 0!==w&&w,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let t=(t,e)=>t&&t.source===e?(t.lastIndex=0,t):RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,r,i,o){let s,a,u;let l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=t=>{if(0>t.indexOf(this.formatSeparator)){let e=$(r,l,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(e,void 0,i,{...o,...r,interpolationkey:t}):e}let e=t.split(this.formatSeparator),n=e.shift().trim(),s=e.join(this.formatSeparator).trim();return this.format($(r,l,n,this.options.keySeparator,this.options.ignoreJSONStructure),s,i,{...o,...r,interpolationkey:n})};this.resetRegExp();let h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,d=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>D(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?D(this.escape(t)):D(t)}].forEach(r=>{for(u=0;s=r.regex.exec(t);){let i=s[1].trim();if(void 0===(a=c(i))){if("function"==typeof h){let r=h(t,s,o);a=e(r)?r:""}else if(o&&Object.prototype.hasOwnProperty.call(o,i))a="";else if(d){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${i} for interpolating ${t}`),a=""}else e(a)||this.useRawValueToEscape||(a=n(a));let l=r.safeValue(a);if(t=t.replace(s[0],l),d?(r.regex.lastIndex+=a.length,r.regex.lastIndex-=s[0].length):r.regex.lastIndex=0,++u>=this.maxReplaces)break}}),t}nest(t,r){let i,o,s,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=(t,e)=>{let r=this.nestingOptionsSeparator;if(0>t.indexOf(r))return t;let n=t.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;t=n[0];let o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),e&&(s={...e,...s})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${r}${i}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,t};for(;i=this.nestingRegexp.exec(t);){let l=[];(s=(s={...a}).replace&&!e(s.replace)?s.replace:s).applyPostProcessor=!1,delete s.defaultValue;let c=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){let t=i[1].split(this.formatSeparator).map(t=>t.trim());i[1]=t.shift(),l=t,c=!0}if((o=r(u.call(this,i[1].trim(),s),s))&&i[0]===t&&!e(o))return o;e(o)||(o=n(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}
7`),o=""),c&&(o=l.reduce((t,e)=>this.format(t,e,a.lng,{...a,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}let K=t=>{let e=t.toLowerCase().trim(),r={};if(t.indexOf("(")>-1){let n=t.split("(");e=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);"currency"===e&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===e&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(t=>{if(t){let[e,...n]=t.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=e.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:e,formatOptions:r}},q=t=>{let e={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let s=n+JSON.stringify(o),a=e[s];return a||(a=t(S(n),i),e[s]=a),a(r)}};class F{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=_.create("formatter"),this.options=t,this.formats={number:q((t,e)=>{let r=new Intl.NumberFormat(t,{...e});return t=>r.format(t)}),currency:q((t,e)=>{let r=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>r.format(t)}),datetime:q((t,e)=>{let r=new Intl.DateTimeFormat(t,{...e});return t=>r.format(t)}),relativetime:q((t,e)=>{let r=new Intl.RelativeTimeFormat(t,{...e});return t=>r.format(t,e.range||"day")}),list:q((t,e)=>{let r=new Intl.ListFormat(t,{...e});return t=>r.format(t)})},this.init(t)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=e.interpolation.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=q(e)}format(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(t=>t.indexOf(")")>-1)){let t=i.findIndex(t=>t.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,t)].join(this.formatSeparator)}return i.reduce((t,e)=>{let{formatName:i,formatOptions:o}=K(e);if(this.formats[i]){let e=t;try{let s=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},a=s.locale||s.lng||n.locale||n.lng||r;e=this.formats[i](t,a,{...o,...n,...s})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${i}`),t},t)}}let V=(t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)};class H extends A{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=_.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,n.backend,n)}queueLoad(t,e,r,n){let i={},o={},s={},a={};return t.forEach(t=>{let n=!0;e.forEach(e=>{let s=`${t}|${e}`;!r.reload&&this.store.hasResourceBundle(t,e)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===o[s]&&(o[s]=!0):(this.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===a[e]&&(a[e]=!0)))}),n||(s[t]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(t,e,r){let n=t.split("|"),i=n[0],o=n[1];e&&this.emit("failedLoading",i,o,e),!e&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&r&&(this.state[t]=0);let s={};this.queue.forEach(r=>{c(r.loaded,[i],o),V(r,t),e&&r.errors.push(e),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(t=>{s[t]||(s[t]={});let e=r.loaded[t];e.length&&e.forEach(e=>{void 0===s[t][e]&&(s[t][e]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}
7),this.emit("loaded",s),this.queue=this.queue.filter(t=>!t.done)}read(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:e,fcName:r,tried:n,wait:i,callback:o});return}this.readingCalls++;let s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){let t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}if(s&&a&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,t,e,r,n+1,2*i,o)},i);return}o(s,a)},a=this.backend[r].bind(this.backend);if(2===a.length){try{let r=a(t,e);r&&"function"==typeof r.then?r.then(t=>s(null,t)).catch(s):s(null,r)}catch(t){s(t)}return}return a(t,e,s)}prepareLoading(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();e(t)&&(t=this.languageUtils.toResolveHierarchy(t)),e(r)&&(r=[r]);let o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(t=>{this.loadOne(t)})}load(t,e,r){this.prepareLoading(t,e,{},r)}reload(t,e,r){this.prepareLoading(t,e,{reload:!0},r)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${e}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${e}loaded namespace ${i} for language ${n}`,o),this.loaded(t,r,o)})}saveMissing(t,e,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)){this.logger.warn(`did not save key "${r}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=r&&""!==r){if(this.backend&&this.backend.create){let a={...o,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let i;(i=5===u.length?u(t,e,r,n,a):u(t,e,r,n))&&"function"==typeof i.then?i.then(t=>s(null,t)).catch(s):s(null,i)}catch(t){s(t)}else u(t,e,r,n,s,a)}t&&t[0]&&this.store.addResource(t[0],e,r,n)}}}let J=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let r={};if("object"==typeof t[1]&&(r=t[1]),e(t[1])&&(r.defaultValue=t[1]),e(t[2])&&(r.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){let e=t[3]||t[2];Object.keys(e).forEach(t=>{r[t]=e[t]})}return r},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Z=t=>(e(t.ns)&&(t.ns=[t.ns]),e(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),e(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Y=()=>{},G=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(e=>{"function"==typeof t[e]&&(t[e]=t[e].bind(t))})};class Q extends A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Z(t),this.services={},this.logger=_,this.modules={external:[]},G(this),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(){var t=this;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof n&&(i=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&(e(n.ns)?n.defaultNS=n.ns:0>n.ns.indexOf("translation")&&(n.defaultNS=n.ns[0]));let o=J();this.options={...o,...this.options,...Z(n)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator);let s=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let e;this.modules.logger?_.init(s(this.modules.logger),this.options):_.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=F);let r=new M(this.options);this.store=new I(this.options.resources,this.options);let n=this.services;n.logger=_,n.resourceStore=this.store,n.languageUtils=r,n.pluralResolver=new z(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),e&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(n.formatter=s(e),n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new W(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new H(s(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.emit(e,...n)}),this.modules.languageDetector&&(n.languageDetector=s(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=s(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new B(this.services,this.options),this.translator.on("*",function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.emit(e,...n)}),this.modules.external.forEach(t=>{t.init&&t.init(this)})}if(this.format=this.options.interpolation.format,i||(i=Y),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e
7=>{this[e]=function(){return t.store[e](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=function(){return t.store[e](...arguments),t}});let a=r(),u=()=>{let t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(e),i(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),a}loadResources(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y,n=r,i=e(t)?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();let t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach(e=>{"cimode"!==e&&0>t.indexOf(e)&&t.push(e)})};i?e(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>e(t)),this.options.preload&&this.options.preload.forEach(t=>e(t)),this.services.backendConnector.load(t,this.options.ns,t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(t)})}else n(null)}reloadResources(t,e,n){let i=r();return"function"==typeof t&&(n=t,t=void 0),"function"==typeof e&&(n=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),n||(n=Y),this.services.backendConnector.reload(t,e,t=>{i.resolve(),n(t)}),i}use(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&O.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){let e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,n){var i=this;this.isLanguageChangingTo=t;let o=r();this.emit("languageChanging",t);let s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},a=(t,e)=>{e?(s(e),this.translator.changeLanguage(e),this.isLanguageChangingTo=void 0,this.emit("languageChanged",e),this.logger.log("languageChanged",e)):this.isLanguageChangingTo=void 0,o.resolve(function(){return i.t(...arguments)}),n&&n(t,function(){return i.t(...arguments)})},u=r=>{t||r||!this.services.languageDetector||(r=[]);let n=e(r)?r:this.services.languageUtils.getBestMatchFromCodes(r);n&&(this.language||s(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,t=>{a(t,n)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t):u(this.services.languageDetector.detect()),o}getFixedT(t,r,n){var i=this;let o=function(t,e){let r,s;if("object"!=typeof e){for(var a=arguments.length,u=Array(a>2?a-2:0),l=2;l<a;l++)u[l-2]=arguments[l];r=i.options.overloadTranslationOptionHandler([t,e].concat(u))}else r={...e};r.lng=r.lng||o.lng,r.lngs=r.lngs||o.lngs,r.ns=r.ns||o.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||o.keyPrefix);let c=i.options.keySeparator||".";return s=r.keyPrefix&&Array.isArray(t)?t.map(t=>`${r.keyPrefix}${c}${t}`):r.keyPrefix?`${r.keyPrefix}${c}${t}`:t,i.t(s,r)};return e(t)?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
7if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let r=e.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(t,e)=>{let r=this.services.backendConnector.state[`${t}|${e}`];return -1===r||0===r||2===r};if(e.precheck){let t=e.precheck(this,o);if(void 0!==t)return t}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!n||o(i,t)))}loadNamespaces(t,n){let i=r();return this.options.ns?(e(t)&&(t=[t]),t.forEach(t=>{0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}),this.loadResources(t=>{i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){let i=r();e(t)&&(t=[t]);let o=this.options.preload||[],s=t.filter(t=>0>o.indexOf(t)&&this.services.languageUtils.isSupportedCode(t));return s.length?(this.options.preload=o.concat(s),this.loadResources(t=>{i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}dir(t){return(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf((this.services&&this.services.languageUtils||new M(J())).getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}static createInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new Q(t,e)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y,r=t.forkResourceStore;r&&delete t.forkResourceStore;let n={...this.options,...t,isClone:!0},i=new Q(n);return(void 0!==t.debug||void 0!==t.prefix)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(t=>{i[t]=this[t]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new I(this.store.data,n),i.services.resourceStore=i.store),i.translator=new B(i.services,n),i.translator.on("*",function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];i.emit(t,...r)}),i.init(n,e),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let X=Q.createInstance();X.createInstance=Q.createInstance,t.exports=X},645:function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?i-1:0,d=r?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,d=23===i?5960464477539062e-23:0,f=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=d/u:e+=d*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;t[r+f]=255&s,f+=p,s/=256,l-=8);t[r+f-p]|=128*g}},1198:function(t,e,r){"use strict";let n=r(4880).v4,i=r(7741),o=function(t,e){if(!(this instanceof o))return new o(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=o,o.prototype.request=function(t,e,r,n){let o;let s=this,a=null,u=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let l=!u&&t&&"object"==typeof t&&"function"==typeof e;if(u||l)n=e,a=t;else{"function"==typeof r&&(n=r,r=void 0);let o="function"==typeof n;try{a=i(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return n(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){return n(t)}return this.callServer(o,function(t,e){s._parseResponse(t,e,n)}),a},o.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 t=function(t){return void 0!==t.error};return r(null,n.filter(t),n.filter(function(e){return!t(e)}))}}r(null,n)}},7741:function(t,e,r){"use strict";let n=r(4880).v4;t.exports=function(t,e,r,i){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}if(void 0===r){let t="function"==typeof i.generator?i.generator:function(){return n()};s.id=t(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},1234:function(t,e){"use strict";
7Object.defineProperty(e,"__esModule",{value:!0}),function(t,e){for(var r in e)Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}(e,{ACTION_FAST_REFRESH:function(){return h},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return c},ACTION_REFRESH:function(){return s},ACTION_RESTORE:function(){return u},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return l},PrefetchCacheEntryStatus:function(){return o},PrefetchKind:function(){return i},isThenable:function(){return f}});var r,n,i,o,s="refresh",a="navigate",u="restore",l="server-patch",c="prefetch",h="fast-refresh",d="server-action";function f(t){return t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}(r=i||(i={})).AUTO="auto",r.FULL="full",r.TEMPORARY="temporary",(n=o||(o={})).fresh="fresh",n.reusable="reusable",n.expired="expired",n.stale="stale",("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},6004:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDomainLocale",{enumerable:!0,get:function(){return i}});var n=r(8740);function i(t,e,i,o){var s=r(3797).normalizeLocalePath,a=r(3399).detectDomainLocale,u=e||s(t,i).detectedLocale,l=a(o,void 0,u);if(l){var c="http"+(l.http?"":"s")+"://",h=u===l.defaultLocale?"":"/"+u;return""+c+l.domain+(0,n.normalizePathTrailingSlash)(""+h+t)}return!1}("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},1568:function(t,e,r){"use strict";var n=r(968),i=r(3171),o=r(7069),s=r(4687),a=r(7752),u=["href","as","children","prefetch","passHref","replace","shallow","scroll","locale","onClick","onMouseEnter","onTouchStart","legacyBehavior"];function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return O}});var h=r(8754),d=r(5893),f=h._(r(7294)),p=r(7806),g=r(893),m=r(6213),y=r(8900),b=r(4551),w=r(1351),v=r(4462),k=r(9637),S=r(6004),x=r(5076),E=r(1234),_=new Set;function A(t,e,r,n,i,o){if(o||(0,g.isLocalURL)(e)){if(!n.bypassPrefetchedCheck){var u,l=e+"%"+r+"%"+(void 0!==n.locale?n.locale:"locale"in t?t.locale:void 0);if(_.has(l))return;_.add(l)}(u=a(s.mark(function a(){return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!o){s.next=4;break}return s.abrupt("return",t.prefetch(e,i));case 4:return s.abrupt("return",t.prefetch(e,r,n));case 5:case"end":return s.stop()}},a)})),function(){return u.apply(this,arguments)})().catch(function(t){})}}function I(t){return"string"==typeof t?t:(0,m.formatUrl)(t)}var O=f.default.forwardRef(function(t,e){var r,n,s=t.href,a=t.as,l=t.children,h=t.prefetch,m=void 0===h?null:h,_=t.passHref,O=t.replace,P=t.shallow,B=t.scroll,R=t.locale,M=t.onClick,L=t.onMouseEnter,T=t.onTouchStart,C=t.legacyBehavior,N=void 0!==C&&C,j=o(t,u);r=l,N&&("string"==typeof r||"number"==typeof r)&&(r=(0,d.jsx)("a",{children:r}));var U=f.default.useContext(w.RouterContext),z=f.default.useContext(v.AppRouterContext),$=null!=U?U:z,D=!U,W=!1!==m,K=null===m?E.PrefetchKind.AUTO:E.PrefetchKind.FULL,q=f.default.useMemo(function(){if(!U){var t=I(s);return{href:t,as:a?I(a):t}}var e=i((0,p.resolveHref)(U,s,!0),2),r=e[0],n=e[1];return{href:r,as:a?(0,p.resolveHref)(U,a):n||r}},[U,s,a]),F=q.href,V=q.as,H=f.default.useRef(F),J=f.default.useRef(V);N&&(n=f.default.Children.only(r));var Z=N?n&&"object"==typeof n&&n.ref:e,Y=i((0,k.useIntersection)({rootMargin:"200px"}),3),G=Y[0],Q=Y[1],X=Y[2],tt=f.default.useCallback(function(t){(J.current!==V||H.current!==F)&&(X(),J.current=V,H.current=F),G(t),Z&&("function"==typeof Z?Z(t):"object"==typeof Z&&(Z.current=t))},[V,Z,F,X,G]);f.default.useEffect(function(){$&&Q&&W&&A($,F,V,{locale:R},{kind:K},D)},[V,F,Q,R,W,null==U?void 0:U.locale,$,D,K]);var te={ref:tt,onClick:function(t){N||"function"!=typeof M||M(t),N&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),$&&!t.defaultPrevented&&function(t,e,r,n,i,o,s,a,u){if(!("A"===t.currentTarget.nodeName.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which||!u&&!(0,g.isLocalURL)(r)))){t.preventDefault();var l,c=function(){var t=null==s||s;"beforePopState"in e?e[i?"replace":"push"](r,n,{shallow:o,locale:a,scroll:t}):e[i?"replace":"push"](n||r,{scroll:t})};u?f.default.startTransition(c):c()}}(t,$,F,V,O,P,B,R,D)},onMouseEnter:function(t){N||"function"!=typeof L||L(t),N&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(t),$&&(W||!D)&&A($,F,V,{locale:R,priority:!0,bypassPrefetchedCheck:!0},{kind:K},D)},onTouchStart:function(t){N||"function"!=typeof T||T(t),N&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(t),$&&(W||!D)&&A($,F,V,{locale:R,priority:!0,bypassPrefetchedCheck:!0},{kind:K},D)}};if((0,y.isAbsoluteUrl)(V))te.href=V;else if(!N||_||"a"===n.type&&!("href"in n.props)){var tr=void 0!==R?R:null==U?void 0:U.locale,tn=(null==U?void 0:U.isLocaleDomain)&&(0,S.getDomainLocale)(V,tr,null==U?void 0:U.locales,null==U?void 0:U.domainLocales);te.href=tn||(0,x.addBasePath)((0,b.addLocale)(V,tr,null==U?void 0:U.defaultLocale))}return N?f.default.cloneElement(n,te):(0,d.jsx)("a",c(c(c({},j),te),{},{children:r}))});("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esMo
7dule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},3797:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});var n=function(t,e){return r(9305).normalizeLocalePath(t,e)};("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},9637:function(t,e,r){"use strict";var n=r(3171);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIntersection",{enumerable:!0,get:function(){return l}});var i=r(7294),o=r(3507),s="function"==typeof IntersectionObserver,a=new Map,u=[];function l(t){var e=t.rootRef,r=t.rootMargin,l=t.disabled||!s,c=n((0,i.useState)(!1),2),h=c[0],d=c[1],f=(0,i.useRef)(null),p=(0,i.useCallback)(function(t){f.current=t},[]);return(0,i.useEffect)(function(){if(s){if(!l&&!h){var t,n,i,c,p,g=f.current;if(g&&g.tagName)return t=function(t){return t&&d(t)},i=(n=function(t){var e,r={root:t.root||null,margin:t.rootMargin||""},n=u.find(function(t){return t.root===r.root&&t.margin===r.margin});if(n&&(e=a.get(n)))return e;var i=new Map;return e={id:r,observer:new IntersectionObserver(function(t){t.forEach(function(t){var e=i.get(t.target),r=t.isIntersecting||t.intersectionRatio>0;e&&r&&e(r)})},t),elements:i},u.push(r),a.set(r,e),e}({root:null==e?void 0:e.current,rootMargin:r})).id,c=n.observer,(p=n.elements).set(g,t),c.observe(g),function(){if(p.delete(g),c.unobserve(g),0===p.size){c.disconnect(),a.delete(i);var t=u.findIndex(function(t){return t.root===i.root&&t.margin===i.margin});t>-1&&u.splice(t,1)}}}}else if(!h){var m=(0,o.requestIdleCallback)(function(){return d(!0)});return function(){return(0,o.cancelIdleCallback)(m)}}},[l,r,e,h,f.current]),[p,h,(0,i.useCallback)(function(){d(!1)},[])]}("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},8767:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AmpStateContext",{enumerable:!0,get:function(){return n}});var n=r(8754)._(r(7294)).default.createContext({})},1057:function(t,e){"use strict";function r(t){var e=void 0===t?{}:t,r=e.ampFirst,n=e.hybrid,i=e.hasQuery;return void 0!==r&&r||void 0!==n&&n&&void 0!==i&&i}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isInAmpMode",{enumerable:!0,get:function(){return r}})},7837:function(t,e,r){"use strict";var n=r(968);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}Object.defineProperty(e,"__esModule",{value:!0}),function(t,e){for(var r in e)Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}(e,{default:function(){return c},noSSR:function(){return l}});var s=r(8754);r(5893),r(7294);var a=s._(r(2849));function u(t){return{default:(null==t?void 0:t.default)||t}}function l(t,e){return delete e.webpack,delete e.modules,t(e)}function c(t,e){var r=a.default,n={loading:function(t){return t.error,t.isLoading,t.pastDelay,null}};t instanceof Promise?n.loader=function(){return t}:"function"==typeof t?n.loader=t:"object"==typeof t&&(n=o(o({},n),t));var i=(n=o(o({},n),e)).loader;return(n.loadableGenerated&&(n=o(o({},n),n.loadableGenerated),delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r(o(o({},n),{},{loader:function(){return null!=i?i().then(u):Promise.resolve(u(function(){return null}))}})):(delete n.webpack,delete n.modules,l(r,n))}("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esMo
7dule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},4394:function(t,e,r){"use strict";var n=r(968);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}Object.defineProperty(e,"__esModule",{value:!0}),function(t,e){for(var r in e)Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}(e,{default:function(){return y},defaultHead:function(){return f}});var o=r(8754),s=r(1757),a=r(5893),u=s._(r(7294)),l=o._(r(5562)),c=r(8767),h=r(4376),d=r(1057);function f(t){void 0===t&&(t=!1);var e=[(0,a.jsx)("meta",{charSet:"utf-8"})];return t||e.push((0,a.jsx)("meta",{name:"viewport",content:"width=device-width"})),e}function p(t,e){return"string"==typeof e||"number"==typeof e?t:e.type===u.default.Fragment?t.concat(u.default.Children.toArray(e.props.children).reduce(function(t,e){return"string"==typeof e||"number"==typeof e?t:t.concat(e)},[])):t.concat(e)}r(3678);var g=["name","httpEquiv","charSet","itemProp"];function m(t,e){var r,o,s,a,l=e.inAmpMode;return t.reduce(p,[]).reverse().concat(f(l).reverse()).filter((r=new Set,o=new Set,s=new Set,a={},function(t){var e=!0,n=!1;if(t.key&&"number"!=typeof t.key&&t.key.indexOf("$")>0){n=!0;var i=t.key.slice(t.key.indexOf("$")+1);r.has(i)?e=!1:r.add(i)}switch(t.type){case"title":case"base":o.has(t.type)?e=!1:o.add(t.type);break;case"meta":for(var u=0,l=g.length;u<l;u++){var c=g[u];if(t.props.hasOwnProperty(c)){if("charSet"===c)s.has(c)?e=!1:s.add(c);else{var h=t.props[c],d=a[c]||new Set;("name"!==c||!n)&&d.has(h)?e=!1:(d.add(h),a[c]=d)}}}}return e})).reverse().map(function(t,e){var r=t.key||e;if(!l&&"link"===t.type&&t.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(function(e){return t.props.href.startsWith(e)})){var o=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t.props||{});return o["data-href"]=o.href,o.href=void 0,o["data-optimized-fonts"]=!0,u.default.cloneElement(t,o)}return u.default.cloneElement(t,{key:r})})}var y=function(t){var e=t.children,r=(0,u.useContext)(c.AmpStateContext),n=(0,u.useContext)(h.HeadManagerContext);return(0,a.jsx)(l.default,{reduceComponentsToState:m,headManager:n,inAmpMode:(0,d.isInAmpMode)(r),children:e})};("function"==typeof e.default||"object"==typeof e.default&&null!==e.default)&&void 0===e.default.__esModule&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)},9376:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"LoadableContext",{enumerable:!0,get:function(){return n}});var n=r(8754)._(r(7294)).default.createContext(null)},2849:function(t,e,r){"use strict";var n=r(968),i=r(3322),o=r(6089);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return b}});var l=r(8754)._(r(7294)),c=r(9376),h=[],d=[],f=!1;function p(t){var e=t(),r={loading:!0,loaded:null,error:null};return r.promise=e.then(function(t){return r.loading=!1,r.loaded=t,t}).catch(function(t){throw r.loading=!1,r.error=t,t}),r}var g=function(){function t(e,r){i(this,t),this._loadFn=e,this._opts=r,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}return o(t,[{key:"promise",value:function(){return this._res.promise}},{key:"retry",value:function(){var t=this;this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};var e=this._res,r=this._opts;e.loading&&("number"==typeof r.delay&&(0===r.delay?this._state.pastDelay=!0:this._delay=setTimeout(function(){t._update({pastDelay:!0})},r.delay)),"number"==typeof r.timeout&&(this._timeout=setTimeout(function(){t._update({timedOut:!0})},r.timeout))),this._res.promise.then(function(){t._update({}),t._clearTimeouts()}).catch(function(e){t._update({}),t._clearTimeouts()}),this._update({})}},{key:"_update",value:function(t){this._state=a(a({},this._state),{},{error:this._res.error,loaded:this._res.loaded,loading:this._res.loading},t),this._callbacks.forEach(function(t){return t()})}},{key:"_clearTimeouts",value:function(){clearTimeout(this._delay),clearTimeout(this._timeout)}},{key:"getCurrentValue",value:function(){return this._state}},{key:"subscribe",value:function(t){var e=this;return this._callbacks.add(t),function(){e._callbacks.delete(t)}}}]),t}();function m(t){return function(t,e){var r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},e),n=null;function i(){if(!n){var e=new g(t,r);n={getCurrentValue:e.getCurrentValue.bind(e),subscribe:e.subscribe.bind(e),retry:e.retry.bind(e),promise:e.promise.bind(e)}}return n.promise()}if(!f){var o=r.webpack?r.webpack():r.modules;o&&d.push(function(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return u(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(t,void 0)}}(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t}
7,f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}(o);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(t.includes(n))return i()}}catch(t){r.e(t)}finally{r.f()}})}function s(t,e){i(),(o=l.default.useContext(c.LoadableContext))&&Array.isArray(r.modules)&&r.modules.forEach(function(t){o(t)});var o,s=l.default.useSyncExternalStore(n.subscribe,n.getCurrentValue,n.getCurrentValue);return l.default.useImperativeHandle(e,function(){return{retry:n.retry}},[]),l.default.useMemo(function(){var e;return s.loading||s.error?l.default.createElement(r.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:n.retry}):s.loaded?l.default.createElement((e=s.loaded)&&e.default?e.default:e,t):null},[t,s])}return s.preload=function(){return i()},s.displayName="LoadableComponent",l.default.forwardRef(s)}(p,t)}function y(t,e){for(var r=[];t.length;){var n=t.pop();r.push(n(e))}return Promise.all(r).then(function(){if(t.length)return y(t,e)})}m.preloadAll=function(){return new Promise(function(t,e){y(h).then(t,e)})},m.preloadReady=function(t){return void 0===t&&(t=[]),new Promise(function(e){var r=function(){return f=!0,e()};y(d,t).then(r,r)})},window.__NEXT_PRELOADREADY=m.preloadReady;var b=m},5562:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var n=r(7294),i=n.useLayoutEffect,o=n.useEffect;function s(t){var e=t.headManager,r=t.reduceComponentsToState;function s(){if(e&&e.mountedInstances){var i=n.Children.toArray(Array.from(e.mountedInstances).filter(Boolean));e.updateHead(r(i,t))}}return i(function(){var r;return null==e||null==(r=e.mountedInstances)||r.add(t.children),function(){var r;null==e||null==(r=e.mountedInstances)||r.delete(t.children)}}),i(function(){return e&&(e._pendingUpdate=s),function(){e&&(e._pendingUpdate=s)}}),o(function(){return e&&e._pendingUpdate&&(e._pendingUpdate(),e._pendingUpdate=null),function(){e&&e._pendingUpdate&&(e._pendingUpdate(),e._pendingUpdate=null)}}),null}},3678:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"warnOnce",{enumerable:!0,get:function(){return r}});var r=function(t){}},1199:function(t,e,r){"use strict";r.d(e,{T:function(){return a}});var n=r(1664),i=r.n(n),o=r(7294),s=r(5893),a=function(t){var e=t.size,r=t.fontSize,n=void 0===r?"text-5xl":r,a=t.className,u=(0,o.useState)(!1),l=u[0],c=u[1];return(0,s.jsxs)(i(),{href:"https://www.dropsome.xyz",className:"flex items-baseline space-x-1 ".concat(void 0===a?"":a),children:[l?(0,s.jsx)("span",{className:"".concat(n," font-bold text-transparent bg-clip-text bg-gradient-to-br from-triton to-vortex"),children:"D"}):(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsx)("img",{src:"/logo.svg",alt:"Dropsome Logo",className:"object-contain",style:{width:void 0===e?40:e,height:"auto"},onError:function(){return c(!0)}})}),(0,s.jsx)("span",{className:"".concat(n," font-bold text-transparent bg-clip-text bg-gradient-to-br from-triton via-vortex to-nova"),children:"ropsome"})]})}},8588:function(t,e,r){"use strict";let n,i,o,s,a;r.r(e),r.d(e,{default:function(){return eF}});var u,l,c,h,d,f,p,g,m,y,b,w,v,k,S,x,E,_,A,I,O,P=r(9499),B=r(9008),R=r.n(B),M=r(29),L=r(4687),T=r.n(L),C=r(4177),N=r(7294),j=r(4718);let U=({children:t,endpoint:e,config:r={commitment:"confirmed"}})=>{let n=(0,N.useMemo)(()=>new C.Connection(e,r),[e,r]);return N.createElement(j.h.Provider,{value:{connection:n}},t)};var z=r(9607),$=r(5615);function D(t){return"version"in t}class W extends z.mI{async sendTransaction(t,e,r={}){let n=!0;try{if(D(t)){if(!this.supportedTransactionVersions)throw new $.IW("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(t.version))throw new $.IW(`Sending transaction version ${t.version} isn't supported by this wallet`);try{let n=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(n,r)}catch(t){if(t instanceof $.PY)throw n=!1,t;throw new $.IW(t?.message,t)}}else try{let{signers:n,...i}=r;
7t=await this.prepareTransaction(t,e,i),n?.length&&t.partialSign(...n);let o=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(o,i)}catch(t){if(t instanceof $.PY)throw n=!1,t;throw new $.IW(t?.message,t)}}catch(t){throw n&&this.emit("error",t),t}}async signAllTransactions(t){for(let e of t)if(D(e)){if(!this.supportedTransactionVersions)throw new $.PY("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new $.PY(`Signing transaction version ${e.version} isn't supported by this wallet`)}let e=[];for(let r of t)e.push(await this.signTransaction(r));return e}}class K extends W{}class q extends K{}let F=`(?:\\nURI: (?<uri>[^\\n]+))?(?:\\nVersion: (?<version>[^\\n]+))?(?:\\nChain ID: (?<chainId>[^\\n]+))?(?:\\nNonce: (?<nonce>[^\\n]+))?(?:\\nIssued At: (?<issuedAt>[^\\n]+))?(?:\\nExpiration Time: (?<expirationTime>[^\\n]+))?(?:\\nNot Before: (?<notBefore>[^\\n]+))?(?:\\nRequest ID: (?<requestId>[^\\n]+))?(?:\\nResources:(?<resources>(?:\\n- [^\\n]+)*))?`;RegExp(`^(?<domain>[^\\n]+?) wants you to sign in with your Solana account:\\n(?<address>[^\\n]+)(?:\\n|$)(?:\\n(?<statement>[\\S\\s]*?)(?:\\n|$))??${F}\\n*$`);let V={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND",ERROR_INVALID_PROTOCOL_VERSION:"ERROR_INVALID_PROTOCOL_VERSION"};
7class H extends Error{constructor(...t){let[e,r,n]=t;super(r),this.code=e,this.data=n,this.name="SolanaMobileWalletAdapterError"}}class J extends Error{constructor(...t){let[e,r,n,i]=t;super(n),this.code=r,this.data=i,this.jsonRpcMessageId=e,this.name="SolanaMobileWalletAdapterProtocolError"}}function Z(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})}function Y(t,e){return Z(this,void 0,void 0,function*(){let r=yield crypto.subtle.exportKey("raw",t),n=yield crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},e,r),i=new Uint8Array(r.byteLength+n.byteLength);return i.set(new Uint8Array(r),0),i.set(new Uint8Array(n),r.byteLength),i})}let G="solana:cloneAuthorization";function Q(t,e){return Z(this,void 0,void 0,function*(){let r=t.slice(0,4),i=t.slice(4,16),o=t.slice(16),s=yield crypto.subtle.decrypt(X(r,i),e,o);return(void 0===n&&(n=new TextDecoder("utf-8")),n).decode(s)})}function X(t,e){return{additionalData:t,iv:e,name:"AES-GCM",tagLength:128}}function tt(){return Z(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])})}function te(t){if(t<49152||t>65535)throw new H(V.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${t} given.`,{port:t});return t}function tr(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}let tn={Firefox:0,Other:1},ti=null,to=[150,150,200,500,500,750,750,1e3];function ts(t){return new DataView(t).getUint32(0,!1)}var ta=r(5019);function tu(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 i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)0>e.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function tl(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})}function tc(t){return window.btoa(String.fromCharCode.call(null,...t))}function th(t){return new Uint8Array(window.atob(t).split("").map(t=>t.charCodeAt(0)))}function td(t){return tc("version"in t?t.serialize():t.serialize({requireAllSignatures:!1,verifySignatures:!1}))}function tf(t){let e=t[0]*C.SIGNATURE_LENGTH_IN_BYTES+1;return"legacy"===C.VersionedMessage.deserializeMessageVersion(t.slice(e,t.length))?C.Transaction.from(t):C.VersionedTransaction.deserialize(t)}r(2592);let tp="function"==typeof r(8764).Buffer;"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;let tg=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),tm=(s={},tg.forEach((t,e)=>s[t]=e),s),ty=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,tb=String.fromCharCode.bind(String);function tw(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})}function tv(t){return new Uint8Array(window.atob(t).split("").map(t=>t.charCodeAt(0)))}"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),"function"==typeof btoa||tp||(t=>{let e,r,n,i,o="",s=t.length%3;for(let s=0;s<t.length;){if((r=t.charCodeAt(s++))>255||(n=t.charCodeAt(s++))>255||(i=t.charCodeAt(s++))>255)throw TypeError("invalid character found");o+=tg[(e=r<<16|n<<8|i)>>18&63]+tg[e>>12&63]+tg[e>>6&63]+tg[63&e]}return s?o.slice(0,s-3)+"===".substring(s):o}),"function"==typeof atob||tp||(t=>{if(t=t.replace(/\s+/g,""),!ty.test(t))throw TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let e,r="",n,i;for(let o=0;o<t.length;)e=tm[t.charAt(o++)]<<18|tm[t.charAt(o++)]<<12|(n=tm[t.charAt(o++)])<<6|(i=tm[t.charAt(o++)]),r+=64===n?tb(e>>16&255):64===i?tb(e>>16&255,e>>8&255):tb(e>>16&255,e>>8&255,255&e);return r});let tk="Mobile Wallet Adapter";function tS(t){return"version"in t}class tx extends q{constructor(t){var e;super(),this.supportedTransactionVersions=new Set(["legacy",0]),this.name=tk,this.url="https://solanamobile.com/wallets",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI4IiB3aWR0aD0iMjgiIHZpZXdCb3g9Ii0zIDAgMjggMjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iI0RDQjhGRiI+PHBhdGggZD0iTTE3LjQgMTcuNEgxNXYyLjRoMi40di0yLjRabTEuMi05LjZoLTIuNHYyLjRoMi40VjcuOFoiLz48cGF0aCBkPSJNMjEuNiAzVjBoLTIuNHYzaC0zLjZWMGgtMi40djNoLTIuNHY2LjZINC41YTIuMSAyLjEgMCAxIDEgMC00LjJoMi43VjNINC41QTQuNSA0LjUgMCAwIDAgMCA3LjVWMjRoMjEuNnYtNi42aC0yLjR2NC4ySDIuNFYxMS41Yy41LjMgMS4yLjQgMS44LjVoNy41QTYuNiA2LjYgMCAwIDAgMjQgOVYzaC0yLjRabTAgNS43YTQuMiA0LjIgMCAxIDEtOC40IDBWNS40aDguNHYzLjNaIi8+PC9nPjwvc3ZnPg==",this._connecting=!1,this._connectionGeneration=0,this._readyState="undefined"!=typeof window&&window.isSecureContext&&"undefined"!=typeof document&&/android/i.test(navigator.userAgent)?z.i1.Loadable:z.i1.Unsupported,this._authorizationResultCache=t.authorizationResultCache,this._addressSelector=t.addressSelector,this._appIdentity=t.appIdentity,this._chain=null!==(e=t.chain)&&void 0!==e?e:function(t){switch(t){case"mainnet-beta":return"solana:mainnet";case"testnet":return"solana:testnet";
7case"devnet":return"solana:devnet"}}(t.cluster),this._hostAuthority=t.remoteHostAuthority,this._onWalletNotFound=t.onWalletNotFound,this._readyState!==z.i1.Unsupported&&this._authorizationResultCache.get().then(t=>{t&&this.declareWalletAsInstalled()})}get publicKey(){if(null==this._publicKey&&null!=this._selectedAddress)try{this._publicKey=function(t){let e=tv(t);return new C.PublicKey(e)}(this._selectedAddress)}catch(t){throw new $.Nx(t instanceof Error&&(null==t?void 0:t.message)||"Unknown error",t)}return this._publicKey?this._publicKey:null}get connected(){return!!this._authorizationResult}get connecting(){return this._connecting}get readyState(){return this._readyState}declareWalletAsInstalled(){this._readyState!==z.i1.Installed&&this.emit("readyStateChange",this._readyState=z.i1.Installed)}runWithGuard(t){return tw(this,void 0,void 0,function*(){try{return yield t()}catch(t){throw this.emit("error",t),t}})}autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return tw(this,void 0,void 0,function*(){return yield this.autoConnect()})}autoConnect(){return tw(this,void 0,void 0,function*(){if(!this.connecting&&!this.connected)return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){if(this._readyState!==z.i1.Installed&&this._readyState!==z.i1.Loadable)throw new $.OZ;this._connecting=!0;try{let t=yield this._authorizationResultCache.get();t&&this.handleAuthorizationResult(t)}catch(t){throw new $.$w(t instanceof Error&&t.message||"Unknown error",t)}finally{this._connecting=!1}}))})}connect(){return tw(this,void 0,void 0,function*(){if(!this.connecting&&!this.connected)return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){if(this._readyState!==z.i1.Installed&&this._readyState!==z.i1.Loadable)throw new $.OZ;this._connecting=!0;try{yield this.performAuthorization()}catch(t){throw new $.$w(t instanceof Error&&t.message||"Unknown error",t)}finally{this._connecting=!1}}))})}performAuthorization(t){return tw(this,void 0,void 0,function*(){try{let e=yield this._authorizationResultCache.get();if(e)return this.handleAuthorizationResult(e),e;return yield this.transact(e=>tw(this,void 0,void 0,function*(){let r=yield e.authorize({chain:this._chain,identity:this._appIdentity,sign_in_payload:t});return Promise.all([this._authorizationResultCache.set(r),this.handleAuthorizationResult(r)]),r}))}catch(t){throw new $.$w(t instanceof Error&&t.message||"Unknown error",t)}})}handleAuthorizationResult(t){var e;return tw(this,void 0,void 0,function*(){let r=null==this._authorizationResult||(null===(e=this._authorizationResult)||void 0===e?void 0:e.accounts.length)!==t.accounts.length||this._authorizationResult.accounts.some((e,r)=>e.address!==t.accounts[r].address);if(this._authorizationResult=t,this.declareWalletAsInstalled(),r){let e=yield this._addressSelector.select(t.accounts.map(({address:t})=>t));e!==this._selectedAddress&&(this._selectedAddress=e,delete this._publicKey,this.emit("connect",this.publicKey))}})}performReauthorization(t,e){return tw(this,void 0,void 0,function*(){try{let r=yield t.authorize({auth_token:e,identity:this._appIdentity});Promise.all([this._authorizationResultCache.set(r),this.handleAuthorizationResult(r)])}catch(t){throw this.disconnect(),new $.at(t instanceof Error&&(null==t?void 0:t.message)||"Unknown error",t)}})}disconnect(){return tw(this,void 0,void 0,function*(){this._authorizationResultCache.clear(),this._connecting=!1,this._connectionGeneration++,delete this._authorizationResult,delete this._publicKey,delete this._selectedAddress,this.emit("disconnect")})}transact(t){var e;return tw(this,void 0,void 0,function*(){let r=null===(e=this._authorizationResult)||void 0===e?void 0:e.wallet_uri_base,n=this._hostAuthority?{remoteHostAuthority:this._hostAuthority}:void 0,i=this._connectionGeneration;try{return yield function(t,e){return tl(this,void 0,void 0,function*(){return yield function(t,e){return Z(this,void 0,void 0,function*(){let r;!function(){if("undefined"==typeof window||!0!==window.isSecureContext)throw new H(V.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}();let n=yield function(){return Z(this,void 0,void 0,function*(){return yield crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])})}(),i=yield function(t,e){return Z(this,void 0,void 0,function*(){let r=te(49152+Math.floor(16384*Math.random())),n=yield function(t,e,r,n=["v1"]){return Z(this,void 0,void 0,function*(){let i=te(e),o=function(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let t=0;t<n;t++)e+=String.fromCharCode(r[t]);return window.btoa(e)}((yield crypto.subtle.exportKey("raw",t))),s=function(t,e){let r=null;if(e){try{r=new URL(e)}catch(t){}if((null==r?void 0:r.protocol)!=="https:")throw new H(V.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}return r||(r=new URL("solana-wallet:/")),new URL(t.startsWith("/")?t:[...tr(r.pathname),...tr(t)].join("/"),r)}("v1/associate/local",r);return s.searchParams.set("association",o.replace(/[/+=]/g,t=>({"/":"_","+":"-","=":"."})[t])),s.searchParams.set("port",`${i}
7`),n.forEach(t=>{s.searchParams.set("v",t)}),s})}(t,r,e);return yield function(t){return Z(this,void 0,void 0,function*(){if("https:"===t.protocol)window.location.assign(t);else try{switch(-1!==navigator.userAgent.indexOf("Firefox/")?tn.Firefox:tn.Other){case tn.Firefox:null==ti&&((ti=document.createElement("iframe")).style.display="none",document.body.appendChild(ti)),ti.contentWindow.location.href=t.toString();break;case tn.Other:{let e=new Promise((t,e)=>{function r(){clearTimeout(i),window.removeEventListener("blur",n)}function n(){r(),t()}window.addEventListener("blur",n);let i=setTimeout(()=>{r(),e()},2e3)});window.location.assign(t),yield e}}}catch(t){throw new H(V.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}})}(n),r})}(n.publicKey,null==e?void 0:e.baseUri),o=`ws://localhost:${i}/solana-wallet`,s=(()=>{let t=[...to];return()=>t.length>1?t.shift():t[0]})(),a=1,u=0,l={__type:"disconnected"};return new Promise((e,i)=>{let c,h,d;let f={},p=()=>Z(this,void 0,void 0,function*(){if("connecting"!==l.__type){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${l.__type}\`.`);return}c.removeEventListener("open",p);let{associationKeypair:t}=l,e=yield tt();c.send((yield Y(e.publicKey,t.privateKey))),l={__type:"hello_req_sent",associationPublicKey:t.publicKey,ecdhPrivateKey:e.privateKey}}),g=t=>{t.wasClean?l={__type:"disconnected"}:i(new H(V.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${t.code}: ${t.reason}).`,{closeEvent:t})),h()},m=t=>Z(this,void 0,void 0,function*(){h(),Date.now()-r>=3e4?i(new H(V.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${o}.`)):(yield new Promise(t=>{let e=s();d=window.setTimeout(t,e)}),b())}),y=r=>Z(this,void 0,void 0,function*(){let o=yield r.data.arrayBuffer();switch(l.__type){case"connecting":if(0!==o.byteLength)throw Error("Encountered unexpected message while connecting");let s=yield tt();c.send((yield Y(s.publicKey,n.privateKey))),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:s.privateKey};break;case"connected":try{let t=o.slice(0,4),e=ts(t);if(e!==u+1)throw Error("Encrypted message has invalid sequence number");u=e;let r=yield function(t,e){return Z(this,void 0,void 0,function*(){let r=JSON.parse((yield Q(t,e)));if(Object.hasOwnProperty.call(r,"error"))throw new J(r.id,r.error.code,r.error.message);return r})}(o,l.sharedSecret),n=f[r.id];delete f[r.id],n.resolve(r.result)}catch(t){if(t instanceof J){let e=f[t.jsonRpcMessageId];delete f[t.jsonRpcMessageId],e.reject(t)}else throw t}break;case"hello_req_sent":{var d,p;if(0===o.byteLength){let t=yield tt();c.send((yield Y(t.publicKey,n.privateKey))),l={__type:"hello_req_sent",associationPublicKey:n.publicKey,ecdhPrivateKey:t.privateKey};break}let r=yield function(t,e,r){return Z(this,void 0,void 0,function*(){let[n,i]=yield Promise.all([crypto.subtle.exportKey("raw",e),crypto.subtle.importKey("raw",t.slice(0,65),{name:"ECDH",namedCurve:"P-256"},!1,[])]),o=yield crypto.subtle.deriveBits({name:"ECDH",public:i},r,256),s=yield crypto.subtle.importKey("raw",o,"HKDF",!1,["deriveKey"]);return yield crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(n),info:new Uint8Array},s,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])})}(o,l.associationPublicKey,l.ecdhPrivateKey),s=o.slice(65),g=0!==s.byteLength?yield Z(this,void 0,void 0,function*(){let t=ts(s.slice(0,4));if(t!==u+1)throw Error("Encrypted message has invalid sequence number");return u=t,function(t,e){return Z(this,void 0,void 0,function*(){let r=JSON.parse((yield Q(t,e))),n="legacy";if(Object.hasOwnProperty.call(r,"v"))switch(r.v){case 1:case"1":case"v1":n="v1";break;case"legacy":n="legacy";break;default:throw new H(V.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${r.v}`)}return{protocol_version:n}})}(s,r)}):{protocol_version:"legacy"};l={__type:"connected",sharedSecret:r,sessionProperties:g};let m=(d=g.protocol_version,p=(t,e)=>Z(this,void 0,void 0,function*(){let n=a++;return c.send((yield function(t,e){return Z(this,void 0,void 0,function*(){let r=JSON.stringify(t);return function(t,e,r){return Z(this,void 0,void 0,function*(){let n=function(t){if(t>=4294967296)throw Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");let e=new ArrayBuffer(4);return new DataView(e).setUint32(0,t,!1),new Uint8Array(e)}(e),i=new Uint8Array(12);crypto.getRandomValues(i);let o=yield crypto.subtle.encrypt(X(n,i),r,new TextEncoder().encode(t)),s=new Uint8Array(n.byteLength+i.byteLength+o.byteLength);return s.set(new Uint8Array(n),0),s.set(new Uint8Array(i),n.byteLength),s.set(new Uint8Array(o),n.byteLength+i.byteLength),s})}(r,t.id,e)})}({id:n,jsonrpc:"2.0",method:t,params:null!=e?e:{}},r))),new Promise((e,r)=>{f[n]={resolve(n){switch(t){case"authorize":case"reauthorize":{let{wallet_uri_base:t}=n;if(null!=t)try{!function(t){let e;try{e=new URL(t)}catch(t){throw new H(V.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if("https:"!==e.protocol)throw new H(V.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}(t)}catch(t){r(t);return}}}e(n)},reject:r}})}),new Proxy({},{get:(t,e)=>(null==t[e]&&(t[e]=function(t){return Z(this,void 0,void 0,function*(){let{method:r,params:n}=function(t,e,r){let n=e,i=t.toString().replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`).toLowerCase();switch(t){case"authorize":{let{chain:t}=n;
7if("legacy"===r){switch(t){case"solana:testnet":t="testnet";break;case"solana:devnet":t="devnet";break;case"solana:mainnet":t="mainnet-beta";break;default:t=n.cluster}n.cluster=t}else{switch(t){case"testnet":case"devnet":t=`solana:${t}`;break;case"mainnet-beta":t="solana:mainnet"}n.chain=t}}case"reauthorize":{let{auth_token:t,identity:e}=n;t&&("legacy"===r?(i="reauthorize",n={auth_token:t,identity:e}):i="authorize")}}return{method:i,params:n}}(e,t,d),i=yield p(r,n);return"authorize"===r&&n.sign_in_payload&&!i.sign_in_result&&(i.sign_in_result=yield function(t,e,r){var n;return Z(this,void 0,void 0,function*(){var i,o;let s=null!==(n=t.domain)&&void 0!==n?n:window.location.host,a=e.accounts[0].address,u=(i=Object.assign(Object.assign({},t),{domain:s,address:a}),o=function(t){let e=`${t.domain} wants you to sign in with your Solana account: 8`;e+=`${t.address}`,t.statement&&(e+=` 9 10${t.statement}`);let r=[];if(t.uri&&r.push(`URI: ${t.uri}`),t.version&&r.push(`Version: ${t.version}`),t.chainId&&r.push(`Chain ID: ${t.chainId}`),t.nonce&&r.push(`Nonce: ${t.nonce}`),t.issuedAt&&r.push(`Issued At: ${t.issuedAt}`),t.expirationTime&&r.push(`Expiration Time: ${t.expirationTime}`),t.notBefore&&r.push(`Not Before: ${t.notBefore}`),t.requestId&&r.push(`Request ID: ${t.requestId}`),t.resources)for(let e of(r.push("Resources:"),t.resources))r.push(`- ${e}`);return r.length&&(e+=` 11 12${r.join("\n")}`),e}(i),window.btoa(o)),l=yield r("sign_messages",{addresses:[a],payloads:[u]});return{address:a,signed_message:u,signature:l.signed_payloads[0].slice(u.length)}})}(n.sign_in_payload,i,p)),function(t,e,r){if("getCapabilities"===t)switch(r){case"legacy":{let t=["solana:signTransactions"];return!0===e.supports_clone_authorization&&t.push(G),Object.assign(Object.assign({},e),{features:t})}case"v1":return Object.assign(Object.assign({},e),{supports_sign_and_send_transactions:!0,supports_clone_authorization:e.features.includes(G)})}return e}(e,i,d)})}),t[e]),defineProperty:()=>!1,deleteProperty:()=>!1}));try{e((yield t(m)))}catch(t){i(t)}finally{h(),c.close()}}}}),b=()=>{h&&h(),l={__type:"connecting",associationKeypair:n},void 0===r&&(r=Date.now()),(c=new WebSocket(o,["com.solana.mobilewalletadapter.v1"])).addEventListener("open",p),c.addEventListener("close",g),c.addEventListener("error",m),c.addEventListener("message",y),h=()=>{window.clearTimeout(d),c.removeEventListener("open",p),c.removeEventListener("close",g),c.removeEventListener("error",m),c.removeEventListener("message",y)}};b()})})}(e=>t(new Proxy({},{get(t,r){if(null==t[r])switch(r){case"signAndSendTransactions":t[r]=function(t){var{minContextSlot:r,commitment:n,skipPreflight:i,maxRetries:o,waitForCommitmentToSendNextTransaction:s,transactions:a}=t,u=tu(t,["minContextSlot","commitment","skipPreflight","maxRetries","waitForCommitmentToSendNextTransaction","transactions"]);return tl(this,void 0,void 0,function*(){let t=a.map(td),l={min_context_slot:r,commitment:n,skip_preflight:i,max_retries:o,wait_for_commitment_to_send_next_transaction:s},{signatures:c}=yield e.signAndSendTransactions(Object.assign(Object.assign(Object.assign({},u),Object.values(l).some(t=>null!=t)?{options:l}:null),{payloads:t}));return c.map(th).map(ta.encode)})};break;case"signMessages":t[r]=function(t){var{payloads:r}=t,n=tu(t,["payloads"]);return tl(this,void 0,void 0,function*(){let t=r.map(tc),{signed_payloads:i}=yield e.signMessages(Object.assign(Object.assign({},n),{payloads:t}));return i.map(th)})};break;case"signTransactions":t[r]=function(t){var{transactions:r}=t,n=tu(t,["transactions"]);return tl(this,void 0,void 0,function*(){let t=r.map(td),{signed_payloads:i}=yield e.signTransactions(Object.assign(Object.assign({},n),{payloads:t}));return i.map(th).map(tf)})};break;default:t[r]=e[r]}return t[r]},defineProperty:()=>!1,deleteProperty:()=>!1})),e)})}(t,Object.assign(Object.assign({},r?{baseUri:r}:void 0),n))}catch(t){throw this._connectionGeneration!==i&&(yield new Promise(()=>{})),t instanceof Error&&"SolanaMobileWalletAdapterError"===t.name&&"ERROR_WALLET_NOT_FOUND"===t.code&&(yield this._onWalletNotFound(this)),t}})}assertIsAuthorized(){if(!this._authorizationResult||!this._selectedAddress)throw new $.oS;return{authToken:this._authorizationResult.auth_token,selectedAddress:this._selectedAddress}}performSignTransactions(t){return tw(this,void 0,void 0,function*(){let{authToken:e}=this.assertIsAuthorized();try{return yield this.transact(r=>tw(this,void 0,void 0,function*(){return yield this.performReauthorization(r,e),yield r.signTransactions({transactions:t})}))}catch(t){throw new $.PY(null==t?void 0:t.message,t)}})}sendTransaction(t,e,r){return tw(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){let{authToken:n}=this.assertIsAuthorized(),i=null==r?void 0:r.minContextSlot;try{return yield this.transact(o=>tw(this,void 0,void 0,function*(){function s(){let t,n;switch(e.commitment){case"confirmed":case"finalized":case"processed":t=e.commitment;break;default:t="finalized"}switch(null==r?void 0:r.preflightCommitment){case"confirmed":case"finalized":case"processed":n=r.preflightCommitment;break;case void 0:n=t;break;default:n="finalized"}let i="finalized"===n?2:"confirmed"===n?1:0,o="finalized"===t?2:"confirmed"===t?1:0;return i<o?n:t}let[a,u,l]=yield Promise.all([o.getCapabilities(),this.performReauthorization(o,n),tS(t)?null:tw(this,void 0,void 0,function*(){var r;if(t.feePayer||(t.feePayer=null!==(r=this.publicKey)&&void 0!==r?r:void 0),null==t.recentBlockhash){let{blockhash:r}=yield e.getLatestBlockhash({commitment:s()});t.recentBlockhash=r}})]);if(a.supports_sign_and_send_transactions)return(yield o.signAndSendTransactions({minContextSlot:i,transactions:[t]}))[0];{let[n]=yield o.signTransactions({transactions:[t]});if(tS(n))return yield e.sendTransaction(n);
12{let t=n.serialize();return yield e.sendRawTransaction(t,Object.assign(Object.assign({},r),{preflightCommitment:s()}))}}}))}catch(t){throw new $.IW(null==t?void 0:t.message,t)}}))})}signTransaction(t){return tw(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){let[e]=yield this.performSignTransactions([t]);return e}))})}signAllTransactions(t){return tw(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){return yield this.performSignTransactions(t)}))})}signMessage(t){return tw(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){let{authToken:e,selectedAddress:r}=this.assertIsAuthorized();try{return yield this.transact(n=>tw(this,void 0,void 0,function*(){yield this.performReauthorization(n,e);let[i]=yield n.signMessages({addresses:[r],payloads:[t]});return i.slice(-64)}))}catch(t){throw new $.fk(null==t?void 0:t.message,t)}}))})}signIn(t){return tw(this,void 0,void 0,function*(){return yield this.runWithGuard(()=>tw(this,void 0,void 0,function*(){var e,r;if(this._readyState!==z.i1.Installed&&this._readyState!==z.i1.Loadable)throw new $.OZ;this._connecting=!0;try{let n=yield this.performAuthorization(Object.assign(Object.assign({},t),{domain:null!==(e=null==t?void 0:t.domain)&&void 0!==e?e:window.location.host}));if(!n.sign_in_result)throw Error("Sign in failed, no sign in result returned by wallet");let i=n.sign_in_result.address;return{account:Object.assign(Object.assign({},null!==(r=n.accounts.find(t=>t.address==i))&&void 0!==r?r:{address:i}),{publicKey:tv(i)}),signedMessage:tv(n.sign_in_result.signed_message),signature:tv(n.sign_in_result.signature)}}catch(t){throw new $.$w(t instanceof Error&&t.message||"Unknown error",t)}finally{this._connecting=!1}}))})}}let tE="SolanaMobileWalletAdapterDefaultAuthorizationCache";function t_(t){return tw(this,void 0,void 0,function*(){"undefined"!=typeof window&&window.location.assign(t.url)})}let tA="solana:signAndSendTransaction",tI="solana:signTransaction",tO="standard:connect",tP="standard:events",tB=function(t){return tO in t.features&&tP in t.features&&(tA in t.features||tI in t.features)},tR="solana:signMessage",tM="solana:signIn",tL="solana:mainnet";function tT(t){switch(t){case"processed":case"confirmed":case"finalized":case void 0:return t;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}let tC="standard:disconnect";new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap;var tN=r(7191),tj=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},tU=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class tz extends z.mI{get name(){return tj(this,m,"f").name}get url(){return"https://github.com/solana-labs/wallet-standard"}get icon(){return tj(this,m,"f").icon}get readyState(){return tj(this,y,"f")}get publicKey(){return tj(this,h,"f")}get connecting(){return tj(this,d,"f")}get supportedTransactionVersions(){return tj(this,g,"f")}get wallet(){return tj(this,m,"f")}get standard(){return!0}constructor({wallet:t}){super(),l.add(this),c.set(this,void 0),h.set(this,void 0),d.set(this,void 0),f.set(this,void 0),p.set(this,void 0),g.set(this,void 0),m.set(this,void 0),y.set(this,"undefined"==typeof window||"undefined"==typeof document?z.i1.Unsupported:z.i1.Installed),S.set(this,t=>{if("accounts"in t){let t=tj(this,m,"f").accounts[0];tj(this,c,"f")&&!tj(this,f,"f")&&t!==tj(this,c,"f")&&(t?tj(this,l,"m",w).call(this,t):(this.emit
vendor: 13,142 bytes, line 12
12("error",new $.at),tj(this,l,"m",v).call(this)))}"features"in t&&tj(this,l,"m",k).call(this)}),tU(this,m,t,"f"),tU(this,c,null,"f"),tU(this,h,null,"f"),tU(this,d,!1,"f"),tU(this,f,!1,"f"),tU(this,p,tj(this,m,"f").features[tP].on("change",tj(this,S,"f")),"f"),tj(this,l,"m",k).call(this)}destroy(){tU(this,c,null,"f"),tU(this,h,null,"f"),tU(this,d,!1,"f"),tU(this,f,!1,"f");let t=tj(this,p,"f");t&&(tU(this,p,null,"f"),t())}async autoConnect(){return tj(this,l,"m",b).call(this,{silent:!0})}async connect(){return tj(this,l,"m",b).call(this)}async disconnect(){if(tC in tj(this,m,"f").features)try{tU(this,f,!0,"f"),await tj(this,m,"f").features[tC].disconnect()}catch(t){this.emit("error",new $.UG(t?.message,t))}finally{tU(this,f,!1,"f")}tj(this,l,"m",v).call(this)}async sendTransaction(t,e,r={}){try{var n;let i;let o=tj(this,c,"f");if(!o)throw new $.oS;if(tA in tj(this,m,"f").features){if(o.features.includes(tA))i=tA;else if(tI in tj(this,m,"f").features&&o.features.includes(tI))i=tI;else throw new $.cO}else if(tI in tj(this,m,"f").features){if(!o.features.includes(tI))throw new $.cO;i=tI}else throw new $.p6;let s=(n=e.rpcEndpoint).includes("https://api.mainnet-beta.solana.com")?tL:/\bdevnet\b/i.test(n)?"solana:devnet":/\btestnet\b/i.test(n)?"solana:testnet":/\blocalhost\b/i.test(n)||/\b127\.0\.0\.1\b/.test(n)?"solana:localnet":tL;if(!o.chains.includes(s))throw new $.IW;try{let n;let{signers:a,...u}=r;if(D(t)?(a?.length&&t.sign(a),n=t.serialize()):(t=await this.prepareTransaction(t,e,u),a?.length&&t.partialSign(...a),n=new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))),i===tA){let[t]=await tj(this,m,"f").features[tA].signAndSendTransaction({account:o,chain:s,transaction:n,options:{preflightCommitment:tT(u.preflightCommitment||e.commitment),skipPreflight:u.skipPreflight,maxRetries:u.maxRetries,minContextSlot:u.minContextSlot}});return tN.encode(t.signature)}{let[t]=await tj(this,m,"f").features[tI].signTransaction({account:o,chain:s,transaction:n,options:{preflightCommitment:tT(u.preflightCommitment||e.commitment),minContextSlot:u.minContextSlot}});return await e.sendRawTransaction(t.signedTransaction,{...u,preflightCommitment:tT(u.preflightCommitment||e.commitment)})}}catch(t){if(t instanceof $.lj)throw t;throw new $.IW(t?.message,t)}}catch(t){throw this.emit("error",t),t}}}c=new WeakMap,h=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=new WeakMap,y=new WeakMap,S=new WeakMap,l=new WeakSet,b=async function(t){try{if(this.connected||this.connecting)return;if(tj(this,y,"f")!==z.i1.Installed)throw new $.OZ;if(tU(this,d,!0,"f"),!tj(this,m,"f").accounts.length)try{await tj(this,m,"f").features[tO].connect(t)}catch(t){throw new $.$w(t?.message,t)}let e=tj(this,m,"f").accounts[0];if(!e)throw new $.cO;tj(this,l,"m",w).call(this,e)}catch(t){throw this.emit("error",t),t}finally{tU(this,d,!1,"f")}},w=function(t){let e;try{e=new C.PublicKey(t.address)}catch(t){throw new $.Nx(t?.message,t)}tU(this,c,t,"f"),tU(this,h,e,"f"),tj(this,l,"m",k).call(this),this.emit("connect",e)},v=function(){tU(this,c,null,"f"),tU(this,h,null,"f"),tj(this,l,"m",k).call(this),this.emit("disconnect")},k=function(){let t=tA in tj(this,m,"f").features?tj(this,m,"f").features[tA].supportedTransactionVersions:tj(this,m,"f").features[tI].supportedTransactionVersions;tU(this,g,!function(t,e){if(t===e)return!0;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}(t,["legacy"])?new Set(t):null,"f"),tI in tj(this,m,"f").features&&tj(this,c,"f")?.features.includes(tI)?(this.signTransaction=tj(this,l,"m",x),this.signAllTransactions=tj(this,l,"m",E)):(delete this.signTransaction,delete this.signAllTransactions),tR in tj(this,m,"f").features&&tj(this,c,"f")?.features.includes(tR)?this.signMessage=tj(this,l,"m",_):delete this.signMessage,tM in tj(this,m,"f").features?this.signIn=tj(this,l,"m",A):delete this.signIn},x=async function(t){try{let e=tj(this,c,"f");if(!e)throw new $.oS;if(!(tI in tj(this,m,"f").features))throw new $.p6;if(!e.features.includes(tI))throw new $.cO;try{let r=(await tj(this,m,"f").features[tI].signTransaction({account:e,transaction:D(t)?t.serialize():new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))[0].signedTransaction;return D(t)?C.VersionedTransaction.deserialize(r):C.Transaction.from(r)}catch(t){if(t instanceof $.lj)throw t;throw new $.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}},E=async function(t){try{let e=tj(this,c,"f");if(!e)throw new $.oS;if(!(tI in tj(this,m,"f").features))throw new $.p6;if(!e.features.includes(tI))throw new $.cO;try{let r=await tj(this,m,"f").features[tI].signTransaction(...t.map(t=>({account:e,transaction:D(t)?t.serialize():new Uint8Array(t.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return t.map((t,e)=>{let n=r[e].signedTransaction;return D(t)?C.VersionedTransaction.deserialize(n):C.Transaction.from(n)})}catch(t){throw new $.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}},_=async function(t){try{let e=tj(this,c,"f");if(!e)throw new $.oS;if(!(tR in tj(this,m,"f").features))throw new $.p6;if(!e.features.includes(tR))throw new $.cO;try{return(await tj(this,m,"f").features[tR].signMessage({account:e,message:t}))[0].signature}catch(t){throw new $.fk(t?.message,t)}}catch(t){throw this.emit("error",t),t}},A=async function(t={}){try{let e;if(!(tM in tj(this,m,"f").features))throw new $.p6;try{[e]=await tj(this,m,"f").features[tM].signIn(t)}catch(t){throw new $.bD(t?.message,t)}if(!e)throw new $.bD;return tj(this,l,"m",w).call(this,e.account),e}catch(t){throw this.emit("error",t),t}};var t$=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},tD=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};let tW=new Set,tK={};function tq(...t){return(t=t.filter(t=>!tW.has(t))).length?(t.forEach(t=>{i=void 0,tW.add(t)}),tK.register?.forEach(e=>tH(()=>e(...t))),function(){t.forEach(t=>{i=void 0,tW.delete(t)}),tK.unregister?.forEach(e=>tH(()=>e(...t)))}):()=>{}}function tF(){return i||(i=[...tW]),i}function tV(t,e){return tK[t]?.push(e)||(tK[t]=[e]),function(){tK[t]=tK[t]?.filter(t=>e!==t)}}function tH(t){try{t()}catch(t){console.error(t)}}class tJ extends Event{get detail(){return t$(this,I,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),I.set(this,void 0),tD(this,I,t,"f")}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}}function tZ(t){let e=(0,N.useRef)(void 0);return void 0===e.current&&(e.current={value:t()}),e.current.value}function tY(t){return t.filter(tB).map(t=>new tz({wallet:t}))}function tG(t,e){let r=(0,N.useState)(()=>{try{let e=localStorage.getItem(t);if(e)return JSON.parse(e)}catch(t){"undefined"!=typeof window&&console.error(t)}return e}),n=r[0],i=(0,N.useRef)(!0);return(0,N.useEffect)(()=>{if(i.current){i.current=!1;return}try{null===n?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(n))}catch(t){"undefined"!=typeof window&&console.error(t)}},[n,t]),r}I=new WeakMap,(u=O||(O={}))[u.DESKTOP_WEB=0]="DESKTOP_WEB",u[u.MOBILE_WEB=1]="MOBILE_WEB";class tQ extends $.lj{constructor(){super(...arguments),this.name="WalletNotSelectedError"}}var tX=r(4306);function t0({children:t,wallets:e,adapter:r,isUnloadingRef:n,onAutoConnectRequest:i,onConnectError:o,onError:s,onSelectWallet:a}){let u=(0,N.useRef)(!1),[l,c]=(0,N.useState)(!1),h=(0,N.useRef)(!1),[d,f]=(0,N.useState)(!1),[p,g]=(0,N.useState)(()=>r?.publicKey??null),[m,y]=(0,N.useState)(()=>r?.connected??!1),b=(0,N.useRef)(s);(0,N.useEffect)(()=>(b.current=s,()=>{b.current=void 0}),[s]);let w=(0,N.useRef)((t,e)=>(!n.current&&(b.current?b.current(t,e):(console.error(t,e),t instanceof $.OZ&&"undefined"!=typeof window&&e&&window.open(e.url,"_blank"))),t)),[v,k]=(0,N.useState)(()=>e.map(t=>({adapter:t,readyState:t.readyState})).filter(({readyState:t})=>t!==z.i1.Unsupported));(0,N.useEffect)(()=>{function t(t){k(e=>{let r=e.findIndex(({adapter:t})=>t===this);if(-1===r)return e;let{adapter:n}=e[r];return[...e.slice(0,r),{adapter:n,readyState:t},...e.slice(r+1)].filter(({readyState:t})=>t!==z.i1.Unsupported)})}return k(t=>e.map((e,r)=>{let n=t[r];return n&&n.adapter===e&&n.readyState===e.readyState?n:{adapter:e,readyState:e.readyState}}).filter(({readyState:t})=>t!==z.i1.Unsupported)),e.forEach(e=>e.on("readyStateChange",t,e)),()=>{e.forEach(e=>e.off("readyStateChange",t,e))}},[r,e]);let S=(0,N.useMemo)(()=>v.find(t=>t.adapter===r)??null,[r,v]);(0,N.useEffect)(()=>{if(!r)return;let t=t=>{g(t),u.current=!1,c(!1),y(!0),h.current=!1,f(!1)},e=()=>{n.current||(g(null),u.current=!1,c(!1),y(!1),h.current=!1,f(!1))},i=t=>{w.current(t,r)};return r.on("connect",t),r.on("disconnect",e),r.on("error",i),()=>{r.off("connect",t),r.off("disconnect",e),r.off("error",i),e()}},[r,n]);let x=(0,N.useRef)(!1);(0,N.useEffect)(()=>()=>{x.current=!1},[r]),(0,N.useEffect)(()=>{x.current||u.current||m||!i||S?.readyState!==z.i1.Installed&&S?.readyState!==z.i1.Loadable||(u.current=!0,c(!0),x.current=!0,async function(){try{await i()}catch{o()}finally{c(!1),u.current=!1}}())},[m,i,o,S]);let E=(0,N.useCallback)(async(t,e,n)=>{if(!r)throw w.current(new tQ);if(!m)throw w.current(new $.oS,r);return await r.sendTransaction(t,e,n)},[r,m]),_=(0,N.useMemo)(()=>r&&"signTransaction"in r?async t=>{if(!m)throw w.current(new $.oS,r);return await r.signTransaction(t)}:void 0,[r,m]),A=(0,N.useMemo)(()=>r&&"signAllTransactions"in r?async t=>{if(!m)throw w.current(new $.oS,r);return await r.signAllTransactions(t)}:void 0,[r,m]),I=(0,N.useMemo)(()=>r&&"signMessage"in r?async t=>{if(!m)throw w.current(new $.oS,r);return await r.signMessage(t)}:void 0,[r,m]),O=(0,N.useMemo)(()=>r&&"signIn"in r?async t=>await r.signIn(t):void 0,[r]),P=(0,N.useCallback)(async()=>{if(u.current||h.current||S?.adapter.connected)return;if(!S)throw w.current(new tQ);let{adapter:t,readyState:e}=S;if(!(e===z.i1.Installed||e===z.i1.Loadable))throw w.current(new $.OZ,t);u.current=!0,c(!0);try{await t.connect()}catch(t){throw o(),t}finally{c(!1),u.current=!1}},[o,S]),B=(0,N.useCallback)(async()=>{if(!h.current&&r){h.current=!0,f(!0);try{await r.disconnect()}finally{f(!1),h.current=!1}}},[r]);return N.createElement(tX.z.Provider,{value:{autoConnect:!!i,wallets:v,wallet:S,publicKey:p,connected:m,connecting:l,disconnecting:d,select:a,connect:P,disconnect:B,sendTransaction:E,signTransaction:_,signAllTransactions:A,signMessage:I,signIn:O}},t)}function t1(t){return function({adapters:t,userAgentString:e}){return t.some(t=>t.name!==tk&&t.readyState===z.i1.Installed)?O.DESKTOP_WEB:e&&/android/i.test(e)&&!/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(e)?O.MOBILE_WEB:O.DESKTOP_WEB}({adapters:t,userAgentString:(void 0===o&&(o=globalThis.navigator?.userAgent??null),o)})===O.MOBILE_WEB}function t2({children:t,wallets:e,autoConnect:r,localStorageKey:n="walletName",onError:i}){let{connection:o}=(0,j.R)(),s=function(t){let e=tZ(()=>new Set),{get:r,on:n}=tZ(()=>(function(){if(a||(a=function(){if(a||(a=Object.freeze({register:tq,get:tF,on:tV}),"undefined"==typeof window))return a;let t=Object.freeze({register:tq});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(t){console.error("wallet-standard:register-wallet event listener could not be added\n",t)}try{window.dispatchEvent(new tJ(t))}catch(t){console.error("wallet-standard:app-ready event could not be dispatched\n",t)}return a}(),"undefined"==typeof window))return a;let t=window.navigator.wallets||[];if(!Array.isArray(t))return console.error("window.navigator.wallets is not an array"),a;let{register:e}=a,r=(...t)=>t.forEach(t=>tH(()=>t({register:e})));try{Object.defineProperty(window.navigator,"wallets",{value:Object.freeze({push:r})})}catch(t){return console.error("window.navigator.wallets could not be set"),a}return r(...t),a})()),[i,o]=(0,N.useState)(()=>tY(r()));(0,N.useEffect)(()=>{let t=[n("register",(...t)=>o(e=>[...e,...tY(t)])),n("unregister",(...t)=>o(e=>e.filter(e=>t.some(t=>t===e.wallet))))];return()=>t.forEach(t=>t())},[n]);let s=function(t){let e=(0,N.useRef)(void 0);return(0,N.useEffect)(()=>{e.current=t}),e.current}(i);return(0,N.useEffect)(()=>{if(!s)return;let t=new Set(i);new Set(s.filter(e=>!t.has(e))).forEach(t=>t.destroy())},[s,i]),(0,N.useEffect)(()=>()=>i.forEach(t=>t.destroy()),[]),(0,N.useMemo)(()=>[...i,...t.filter(({name:t})=>!i.some(e=>
12e.name===t)||(e.has(t)||(e.add(t),console.warn(`${t} was registered as a Standard Wallet. The Wallet Adapter for ${t} can be removed from your app.`)),!1))],[i,t,e])}(e),u=(0,N.useMemo)(()=>{var t;if(!t1(s))return null;let e=s.find(t=>t.name===tk);return e||new tx({addressSelector:{select(t){return tw(this,void 0,void 0,function*(){return t[0]})}},appIdentity:{uri:function(){let t=globalThis.location;if(t)return`${t.protocol}//${t.host}`}()},authorizationResultCache:function(){let t;try{t=window.localStorage}catch(t){}return{clear(){return tw(this,void 0,void 0,function*(){if(t)try{t.removeItem(tE)}catch(t){}})},get(){return tw(this,void 0,void 0,function*(){if(t)try{return JSON.parse(t.getItem(tE))||void 0}catch(t){}})},set(e){return tw(this,void 0,void 0,function*(){if(t)try{t.setItem(tE,JSON.stringify(e))}catch(t){}})}}}(),cluster:(t=o?.rpcEndpoint)?/devnet/i.test(t)?"devnet":/testnet/i.test(t)?"testnet":"mainnet-beta":"mainnet-beta",onWalletNotFound:t_})},[s,o?.rpcEndpoint]),l=(0,N.useMemo)(()=>null==u||-1!==s.indexOf(u)?s:[u,...s],[s,u]),[c,h]=tG(n,t1(s)?tk:null),d=(0,N.useMemo)(()=>l.find(t=>t.name===c)??null,[l,c]),f=(0,N.useCallback)(t=>{c!==t&&(d&&d.name!==tk&&d.disconnect(),h(t))},[d,h,c]);(0,N.useEffect)(()=>{if(d)return d.on("disconnect",t),()=>{d.off("disconnect",t)};function t(){!m.current&&(c===tk&&t1(s)||h(null))}},[d,s,h,c]);let p=(0,N.useRef)(!1),g=(0,N.useMemo)(()=>{if(r&&d)return async()=>{(!0===r||await r(d))&&(p.current?await d.connect():await d.autoConnect())}},[r,d]),m=(0,N.useRef)(!1);(0,N.useEffect)(()=>{if(c===tk&&t1(s)){m.current=!1;return}function t(){m.current=!0}return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[s,c]);let y=(0,N.useCallback)(()=>{d&&d.name!==tk&&f(null)},[d,f]),b=(0,N.useCallback)(t=>{p.current=!0,f(t)},[f]);return N.createElement(t0,{wallets:l,adapter:d,isUnloadingRef:m,onAutoConnectRequest:g,onConnectError:y,onError:i,onSelectWallet:b},t)}var t6=r(6835),t8=r(5893),t3=(0,N.createContext)({});function t4(){return(0,N.useContext)(t3)}var t5=function(t){var e=t.children,r=tG("autoConnect",!0),n=(0,t6.Z)(r,2),i=n[0],o=n[1];return(0,t8.jsx)(t3.Provider,{value:{autoConnect:i,setAutoConnect:o},children:e})},t7=r(1979),t9=(0,N.createContext)({});function et(){return(0,N.useContext)(t9)}var ee=function(t){var e=t.children,r=tG("network","mainnet-beta"),n=(0,t6.Z)(r,2),i=n[0],o=n[1],s=tG("customRpcUrl","http://localhost:8899"),a=(0,t6.Z)(s,2),u=a[0],l=a[1];return(0,t8.jsx)(t9.Provider,{value:{networkConfiguration:i,setNetworkConfiguration:o,customRpcUrl:u,setCustomRpcUrl:l},children:e})},er=r(5152),en=r.n(er),ei="http://localhost:8899";function eo(t){try{var e=new URL(t.trim());return("http:"===e.protocol||"https:"===e.protocol)&&!!e.hostname}catch(t){return!1}}function es(t){var e=t.trim();return eo(e)?e:ei}var ea=en()((0,M.Z)(T().mark(function t(){return T().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.e(920).then(r.bind(r,9920));case 2:return t.abrupt("return",t.sent.WalletModalProvider);case 3:case"end":return t.stop()}},t)})),{ssr:!1,loadableGenerated:{webpack:function(){return[null]}}}),eu=function(t){var e=t.children,r=t4().autoConnect,n=et(),i=n.networkConfiguration,o=n.customRpcUrl,s=(0,N.useMemo)(function(){if("custom"===i){var t=es(o||ei),e=new URL(t),r="https:"===e.protocol?"wss:":"ws:",n="8899"===e.port?"8900":e.port,s=e.hostname;return{endpoint:t,wsEndpoint:"".concat(r,"//").concat(s).concat(n?":".concat(n):"").concat(e.pathname).concat(e.search)}}var a="https://www.dropsome.xyz",u="".concat(a.replace(/^https:\/\//,"wss://").replace(/^http:\/\//,"ws://"),"/api/rpc-ws/mainnet");return{endpoint:"".concat(a,"/api/rpc/mainnet"),wsEndpoint:u}},[i,o]),a=s.endpoint,u=s.wsEndpoint,l=(0,N.useCallback)(function(t){(0,t7.h)({type:"error",message:t.message?"".concat(t.name,": ").concat(t.message):t.name}),console.error(t)},[]);return(0,t8.jsx)(U,{endpoint:a,config:{wsEndpoint:u},children:(0,t8.jsx)(t2,{wallets:[],onError:l,autoConnect:r,children:(0,t8.jsx)(ea,{children:e})})})},el=function(t){var e=t.children;return(0,t8.jsx)(t8.Fragment,{children:(0,t8.jsx)(ee,{children:(0,t8.jsx)(t5,{children:(0,t8.jsx)(eu,{children:e})})})})},ec=r(7421),eh=function(){var t=et(),e=t.networkConfiguration,r=t.setNetworkConfiguration,n=t.customRpcUrl,i=t.setCustomRpcUrl,o=(0,ec.useTranslation)("common").t,s=(0,N.useState)(!1),a=s[0],u=s[1],l=(0,N.useState)(n),c=l[0],h=l[1];(0,N.useEffect)(function(){h(n)},[n]),(0,N.useEffect)(function(){if("custom"===e&&c!==n){var t=window.setTimeout(function(){h(eo(c)?c.trim():ei),i(es(c))},2e3);return function(){return window.clearTimeout(t)}}},[c,n,e,i]);var d=function(t){r(t),u("custom"===t)};return(0,t8.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t8.jsxs)("label",{className:"cursor-pointer label",children:[(0,t8.jsx)("a",{children:o("network.label")}
12),(0,t8.jsxs)("select",{value:e,onChange:function(t){return d(t.target.value)},className:"select select-sm bg-base-100 text-base-content w-38 border-none focus:border-vortex focus:ring-0 focus:outline-none",children:[(0,t8.jsx)("option",{value:"mainnet-beta",children:"mainnet"}),(0,t8.jsx)("option",{value:"custom",children:o("network.custom")})]})]}),("custom"===e||a)&&(0,t8.jsxs)("label",{className:"label",children:[(0,t8.jsx)("span",{className:"label-text",children:o("network.customRpcUrl")}),(0,t8.jsx)("input",{type:"text",placeholder:"http://localhost:8899",value:c,onChange:function(t){return h(t.target.value)},className:"input input-bordered w-full max-w-xs"})]})]})},ed=en()(function(){return Promise.resolve(eh)},{ssr:!1}),ef=r(1163),ep=[{code:"en",nativeName:"English"},{code:"be",nativeName:"ÐелаÑÑÑкаÑ"},{code:"de",nativeName:"Deutsch"},{code:"es",nativeName:"Espa\xf1ol"},{code:"fr",nativeName:"Fran\xe7ais"},{code:"pl",nativeName:"Polski"},{code:"ja",nativeName:"æ¥æ¬èª"},{code:"ko",nativeName:"íêµì´"},{code:"vi",nativeName:"Tiếng Viá»t"},{code:"id",nativeName:"Bahasa Indonesia"},{code:"zh",nativeName:"ç®ä½ä¸æ"},{code:"pt",nativeName:"Portugu\xeas"},{code:"ru",nativeName:"Ð ÑÑÑкий"},{code:"uk",nativeName:"УкÑаÑнÑÑка"}],eg=function(t){var e,r=t.compact,n=(0,ec.useTranslation)("common").t,i=(0,ef.useRouter)(),o=function(t){i.push(i.asPath,i.asPath,{locale:t.target.value})},s=null!==(e=i.locale)&&void 0!==e?e:i.defaultLocale;return void 0!==r&&r?(0,t8.jsxs)("label",{className:"cursor-pointer label",children:[(0,t8.jsx)("a",{children:n("language.label")}),(0,t8.jsx)("select",{className:"select select-sm bg-base-100 text-base-content w-38 border-none focus:border-vortex focus:ring-0 focus:outline-none",value:s,onChange:o,children:ep.map(function(t){var e=t.code,r=t.nativeName;return(0,t8.jsx)("option",{value:e,children:r},e)})})]}):(0,t8.jsx)("select",{className:"select select-bordered select-sm w-full max-w-xs bg-black text-white",value:s,onChange:o,children:ep.map(function(t){var e=t.code,r=t.nativeName;return(0,t8.jsx)("option",{value:e,children:r},e)})})},em=r(1664),ey=r.n(em),eb=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.join(" ")},ew={heading:"text-3xl font-medium","sub-heading":"text-2xl font-medium","nav-heading":"text-lg font-medium sm:text-xl",nav:"font-medium",paragraph:"text-lg","sub-paragraph":"text-base font-medium text-inherit",input:"text-sm uppercase tracking-wide",label:"text-xs uppercase tracking-wide"},ev=function(t){var e,r=t.variant,n=t.className,i=t.href,o=t.children;return(0,t8.jsx)("p",{className:eb(null!=n?n:"",null!==(e=ew[r])&&void 0!==e?e:""),children:i?(0,t8.jsx)(ey(),{href:i,className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:o}):o})},ek=function(t){var e=t.label,r=t.href,n=t.as,i=t.scroll,o=t.disabled,s=t.navigationStarts,a=void 0===s?function(){}:s,u=(0,ef.useRouter)(),l=r===u.asPath||n&&n===u.asPath,c=(0,N.useRef)(null);return(0,N.useEffect)(function(){c.current&&(c.current.className=eb("h-0.5 w-1/4 transition-all duration-300 ease-out",l?"!w-full bg-vortex":"group-hover:w-1/2 group-hover:bg-triton"))},[l]),(0,t8.jsxs)(ey(),{href:r,as:n,scroll:i,passHref:!0,className:eb("group flex h-full flex-col items-center justify-between",o?"pointer-events-none cursor-not-allowed opacity-50":""),onClick:function(){return a()},children:[(0,t8.jsx)("div",{className:"flex flex-row items-center gap-3",children:(0,t8.jsxs)(ev,{variant:"nav-heading",children:[" ",e," "]})}),(0,t8.jsx)("div",{ref:c})]})},eS=(0,N.createContext)(null),ex=function(){var t=(0,N.useContext)(eS);if(!t)throw Error("useDrawer must be used within a DrawerProvider");return[t.isOpen,t.setIsOpen]},eE=function(t){var e=t.children,r=(0,N.useState)(!1),n=r[0],i=r[1];return console.log(n),(0,t8.jsx)(eS.Provider,{value:{isOpen:n,setIsOpen:i},children:e})},e_=r(1199),eA=en()((0,M.Z)(T().mark(function t(){return T().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.e(920).then(r.bind(r,9920));case 2:return t.abrupt("return",t.sent.WalletMultiButton);case 3:case"end":return t.stop()}},t)})),{ssr:!1,loadableGenerated:{webpack:function(){return[null]}}}),eI=function(){var t=(0,ec.useTranslation)("common"),e=t.t;t.i18n;
12var r=t4(),n=r.autoConnect,i=r.setAutoConnect,o=ex(),s=(0,t6.Z)(o,2),a=s[0],u=s[1];return(0,t8.jsx)("div",{className:"sticky top-0 z-50 w-full font-orbitron",children:(0,t8.jsxs)("div",{className:"navbar flex h-20 flex-row shadow-lg bg-black text-neutral-content border-b border-zinc-600 bg-opacity-66",children:[(0,t8.jsxs)("div",{className:"navbar-start align-items-center",children:[(0,t8.jsx)("div",{className:"hidden sm:inline w-22 h-22 md:p-2",children:(0,t8.jsx)(e_.T,{size:40,fontSize:"text-5xl"})}),(0,t8.jsx)("div",{className:"relative flex md:hidden",children:(0,t8.jsx)(eA,{className:"font-orbitron"})})]}),(0,t8.jsxs)("div",{className:"navbar-end !items-stretch",children:[(0,t8.jsxs)("div",{className:"hidden md:inline-flex items-center h-min justify-items gap-6",children:[(0,t8.jsx)(ek,{label:e("nav.drop"),href:"/",navigationStarts:function(){return u(!1)}}),(0,t8.jsx)(ek,{label:e("nav.refund"),href:"/refund",navigationStarts:function(){return u(!1)}}),(0,t8.jsx)(eA,{className:"font-orbitron"})]}),(0,t8.jsx)("label",{htmlFor:"my-drawer",className:"flex btn-gh h-12 p-3 items-center justify-between md:hidden",children:(0,t8.jsxs)("div",{className:"HAMBURGER-ICON relative ".concat(a?"":"space-y-2.5"),children:[(0,t8.jsx)("div",{className:"h-0.5 w-8 bg-nova ".concat(a?" relative top-[2px] animate-pulse rotate-45":"")}),(0,t8.jsx)("div",{className:"h-0.5 w-8 bg-nova ".concat(a?"hidden":"")}),(0,t8.jsx)("div",{className:"h-0.5 w-8 bg-nova ".concat(a?"animate-pulse -rotate-45":"")})]})}),(0,t8.jsx)("div",{className:"w-[2px] shrink-0 bg-zinc-600 mx-2"}),(0,t8.jsxs)("div",{className:"dropdown dropdown-end",children:[(0,t8.jsx)("div",{tabIndex:0,className:"btn btn-square btn-ghost text-right",children:(0,t8.jsxs)("svg",{className:"w-7 h-7 stroke-vortex",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t8.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,t8.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,t8.jsxs)("ul",{tabIndex:0,className:"p-2 shadow menu dropdown-content bg-base-100 rounded-box w-80",children:[(0,t8.jsx)("li",{children:(0,t8.jsx)("div",{className:"form-control bg-opacity-100",children:(0,t8.jsx)(eg,{compact:!0})})}),(0,t8.jsx)("li",{children:(0,t8.jsxs)("div",{className:"form-control bg-opacity-100",children:[(0,t8.jsxs)("label",{className:"cursor-pointer label",children:[(0,t8.jsx)("a",{children:e("settings.autoconnect")}),(0,t8.jsx)("input",{type:"checkbox",checked:n,onChange:function(t){return i(t.target.checked)},className:"toggle"})]}),(0,t8.jsx)(ed,{})]})})]})]})]})]})})},eO=function(t){var e=t.children,r=(0,ec.useTranslation)("common").t,n=ex(),i=(0,t6.Z)(n,2),o=i[0],s=i[1];return(0,t8.jsxs)("div",{className:"flex-1 drawer min-h-0",children:[(0,t8.jsx)("input",{id:"my-drawer",checked:o,type:"checkbox",onChange:function(t){return s(t.target.checked)},className:"drawer-toggle"}),(0,t8.jsx)("div",{className:"drawer-content flex flex-col min-h-0",children:(0,t8.jsx)("div",{className:"flex-1 overflow-y-auto",children:e})}),(0,t8.jsxs)("aside",{className:"drawer-side font-orbitron",children:[(0,t8.jsx)("label",{htmlFor:"my-drawer",className:"drawer-overlay gap-6"}),(0,t8.jsxs)("ul",{className:"p-4 overflow-y-auto menu w-80 bg-base-100 gap-10 sm:flex items-center",children:[(0,t8.jsx)("li",{children:(0,t8.jsx)(ev,{variant:"heading",className:"font-extrabold tracking-tighter text-center text-nova mt-10",children:r("drawer.menu")})}),(0,t8.jsx)("li",{children:(0,t8.jsx)(ek,{label:r("nav.drop"),href:"/",navigationStarts:function(){return s(!1)}})}),(0,t8.jsx)("li",{children:(0,t8.jsx)(ek,{label:r("nav.refund"),href:"/refund",navigationStarts:function(){return s(!1)}})})]})]})]})},eP=function(t){var e=t.href,r=t.label,n=t.children;return(0,t8.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r,className:"flex h-9 w-9 m-1 items-center justify-center rounded-full border-white text-secondary transition duration-150 ease-in-out hover:text-white focus:outline-none focus:ring-0",children:n})},eB=function(){return(0,t8.jsx)("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"x-twitter",className:"h-4 w-4",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:(0,t8.jsx)("path",{fill:"currentColor",d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"})})},eR=function(){return(0,t8.jsx)("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"github",className:"h-4 w-4",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",children:(0,t8.jsx)("path",{fill:"currentColor",d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"})})},eM=function(){return(0,t8.jsx)("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fab","data-icon":"linkedin",className:"h-4 w-4",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:(0,t8.jsx)("path",{fill:"currentColor",d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"})})},eL=function(){var t=[{href:"https://x.com/dropsome_xyz",label:"X / Twitter",icon:(0,t8.jsx)(eB,{})},{href:"https://github.com/dropsome-xyz",label:"GitHub",icon:(0,t8.jsx)(eR,{})},{href:"https://www.linkedin.com/company/dropsome",label:"LinkedIn",icon:(0,t8.jsx)(eM,{})}];return(0,t8.jsx)("div",{className:"flex",children:t.map(function(t){var e=t.href,r=t.label,n=t.
12icon;return(0,t8.jsx)(eP,{href:e,label:r,children:n},r)})})},eT=function(){var t=(0,ec.useTranslation)("common").t;return(0,t8.jsx)("div",{className:"flex w-full font-orbitron",children:(0,t8.jsx)("footer",{className:"mt-auto border-t-2 border-[#141414] bg-black hover:text-white w-full",children:(0,t8.jsx)("div",{className:"container mx-auto py-8 px-4",children:(0,t8.jsxs)("div",{className:"flex flex-col md:flex-row justify-center md:space-x-16 items-center",children:[(0,t8.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t8.jsx)("div",{className:"mb-2",children:(0,t8.jsx)(e_.T,{size:22,fontSize:"text-3xl"})}),(0,t8.jsx)(eL,{}),(0,t8.jsx)("div",{className:"mt-2 text-center font-normal tracking-tight text-secondary",children:"\xa9 2025 Dropsome"})]}),(0,t8.jsx)("div",{className:"flex flex-col items-center mt-4 md:mt-0 md:self-start md:pt-1",children:(0,t8.jsxs)("div",{className:"flex flex-col space-y-5 items-center",children:[(0,t8.jsx)("a",{href:"https://docs.dropsome.xyz",className:"text-secondary hover:text-white transition duration-150 ease-in-out",children:t("footer.documentation")}),(0,t8.jsx)("a",{href:"https://docs.dropsome.xyz/legal/privacy-policy",className:"text-secondary hover:text-white transition duration-150 ease-in-out",children:t("footer.privacyPolicy")}),(0,t8.jsx)("a",{href:"https://docs.dropsome.xyz/legal/terms-of-service",className:"text-secondary hover:text-white transition duration-150 ease-in-out",children:t("footer.termsOfService")})]})})]})})})})},eC=r(7812);let eN=N.forwardRef(function(t,e){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),N.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}),ej=N.forwardRef(function(t,e){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),N.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}),eU=N.forwardRef(function(t,e){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),N.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}),ez=N.forwardRef(function(t,e){return N.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:e},t),N.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))});var e$=r(4243),eD=function(t){var e=t.type,r=t.message,n=t.description,i=t.txid,o=t.onHide,s=(0,ec.useTranslation)("common").t;(0,j.R)().connection;var a=et().networkConfiguration;return(0,N.useEffect)(function(){var t=setTimeout(function(){o()},8e3);return function(){clearInterval(t)}},[o]),(0,t8.jsx)("div",{className:"max-w-sm w-full bg-bkg-1 shadow-lg rounded-md mt-2 pointer-events-auto ring-1 ring-black ring-opacity-5 p-2 overflow-hidden",children:(0,t8.jsx)("div",{className:"p-4 rounded-md bg-gradient-to-r from-nova from-10% via-purple-600 via-30% to-triton to-90%",children:(0,t8.jsxs)("div",{className:"flex items-center",children:[(0,t8.jsxs)("div",{className:"flex-shrink-0",children:["success"===e?(0,t8.jsx)(eN,{className:"h-8 w-8 mr-1 text-green"}):null,"info"===e&&(0,t8.jsx)(ej,{className:"h-8 w-8 mr-1 text-red"}),"error"===e&&(0,t8.jsx)(eU,{className:"h-8 w-8 mr-1"})]}),(0,t8.jsxs)("div",{className:"ml-2 w-0 flex-1",children:[(0,t8.jsx)("div",{className:"font-bold text-fgd-1",children:r}),n?(0,t8.jsx)("p",{className:"mt-0.5 text-sm text-fgd-2",children:n}):null,i?(0,t8.jsx)("div",{className:"flex flex-row",children:(0,t8.jsxs)("a",{href:"https://explorer.solana.com/tx/"+i+"?cluster=".concat(a),target:"_blank",rel:"noreferrer",className:"flex flex-row link link-accent text-emerald-200",children:[(0,t8.jsx)("svg",{className:"flex-shrink-0 h-4 ml-2 mt-0.5 text-primary-light w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t8.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),(0,t8.jsxs)("div",{className:"flex mx-4",children:[i.slice(0,8),"...",i.slice(i.length-8)]})]})}):null]}),(0,t8.jsx)("div",{className:"ml-4 flex-shrink-0 self-start flex",children:(0,t8.jsxs)("button",{onClick:function(){return o()},className:"bg-bkg-2 default-transition rounded-md inline-flex text-fgd-3 hover:text-fgd-4 focus:outline-none",children:[(0,t8.jsx)("span",{className:"sr-only",children:s("notification.close")}),(0,t8.jsx)(ez,{className:"h-5 w-5"})]})})]})})})},eW=function(){var t=(0,e$.Z)(function(t){return t}),e=t.notifications,r=t.set,n=(0,eC.Z)(e).reverse();return(0,t8.jsx)("div",{className:"z-20 fixed inset-0 flex items-end px-4 py-6 pointer-events-none sm:p-6",children:(0,t8.jsx)("div",{className:"flex flex-col w-full",children:n.map(function(t,i){return(0,t8.jsx)(eD,{type:t.type,message:t.message,description:t.description,txid:t.txid,onHide:function(){r(function(t){var r=n.length-1-i;t.notifications=[].concat((0,eC.Z)(e.slice(0,r)),(0,eC.Z)(e.slice(r+1)))})}},"".concat(t.message).concat(i))})})})},eK=r(1042);function eq(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}
12r(6714),r(876);var eF=(0,eK.appWithTranslation)(function(t){var e=t.Component,r=t.pageProps,n="https://www.dropsome.xyz".replace(/\/+$/,""),i="".concat(n,"/opengraph-image.jpg"),o="".concat(n,"/logo.svg");return(0,t8.jsxs)(t8.Fragment,{children:[(0,t8.jsxs)(R(),{children:[(0,t8.jsx)("title",{children:"Dropsome"}),(0,t8.jsx)("link",{rel:"canonical",href:n}),(0,t8.jsx)("meta",{property:"og:type",content:"website"}),(0,t8.jsx)("meta",{property:"og:site_name",content:"Dropsome"}),(0,t8.jsx)("meta",{property:"og:locale",content:"en_US"}),(0,t8.jsx)("meta",{property:"og:logo",content:o}),(0,t8.jsx)("meta",{property:"og:title",content:"Dropsome â Kickstart someone's crypto journey"}),(0,t8.jsx)("meta",{property:"og:description",content:"Create a SOL drop for a friend without a wallet yet. Share a secure claim link and onboard them to Solana in seconds."}),(0,t8.jsx)("meta",{property:"og:image",content:i}),(0,t8.jsx)("meta",{property:"og:image:alt",content:"Dropsome â Kickstart someone's crypto journey"}),(0,t8.jsx)("meta",{property:"og:image:width",content:"900"}),(0,t8.jsx)("meta",{property:"og:image:height",content:"450"}),(0,t8.jsx)("meta",{property:"og:image:type",content:"image/jpeg"}),(0,t8.jsx)("meta",{property:"og:url",content:n}),(0,t8.jsx)("meta",{property:"article:published_time",content:"2025-11-01T17:39:45Z"}),(0,t8.jsx)("meta",{name:"author",content:"Dropsome"}),(0,t8.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,t8.jsx)("meta",{name:"twitter:title",content:"Dropsome â Kickstart someone's crypto journey"}),(0,t8.jsx)("meta",{name:"twitter:description",content:"Create a SOL drop for a friend without a wallet yet. Share a secure claim link and onboard them to Solana in seconds."}),(0,t8.jsx)("meta",{name:"twitter:image",content:i}),(0,t8.jsx)("meta",{name:"twitter:image:alt",content:"Dropsome â Kickstart someone's crypto journey"})]}),(0,t8.jsx)(el,{children:(0,t8.jsx)(eE,{children:(0,t8.jsxs)("div",{className:"flex flex-col h-screen overflow-hidden",children:[(0,t8.jsx)(eW,{}),(0,t8.jsx)(eI,{}),(0,t8.jsx)(eO,{children:(0,t8.jsxs)("div",{className:"min-h-full flex flex-col",children:[(0,t8.jsx)("div",{className:"flex-1",children:(0,t8.jsx)(e,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?eq(Object(r),!0).forEach(function(e){(0,P.Z)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eq(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},r))}),(0,t8.jsx)(eT,{})]})})]})})})]})})},4243:function(t,e,r){"use strict";r.d(e,{Z:function(){return Q}});var n=r(7294);let i="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?n.useEffect:n.useLayoutEffect;function o(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(t){return"'"+t+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function s(t){return!!t&&!!t[K]}function a(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===q}(t)||Array.isArray(t)||!!t[W]||!!(null===(e=t.constructor)||void 0===e?void 0:e[W])||d(t)||f(t))}function u(t,e,r){void 0===r&&(r=!1),0===l(t)?(r?Object.keys:F)(t).forEach(function(n){r&&"symbol"==typeof n||e(n,t[n],t)}):t.forEach(function(r,n){return e(n,r,t)})}function l(t){var e=t[K];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:d(t)?2:f(t)?3:0}function c(t,e){return 2===l(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function h(t,e,r){var n=l(t);2===n?t.set(e,r):3===n?t.add(r):t[e]=r}function d(t){return U&&t instanceof Map}function f(t){return z&&t instanceof Set}function p(t){return t.o||t.t}function g(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=V(t);delete e[K];for(var r=F(e),n=0;n<r.length;n++){var i=r[n],o=e[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function m(t,e){return void 0===e&&(e=!1),b(t)||s(t)||!a(t)||(l(t)>1&&(t.set=t.add=t.clear=t.delete=y),Object.freeze(t),e&&u(t,function(t,e){return m(e,!0)},!0)),t}function y(){o(2)}function b(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function w(t){var e=H[t];return e||o(18,t),e}function v(t,e){e&&(w("Patches"),t.u=[],t.s=[],t.v=e)}function k(t){S(t),t.p.forEach(E),t.p=null}function S(t){t===N&&(N=t.l)}function x(t){return N={p:[],l:N,h:t,m:!0,_:0}}function E(t){var e=t[K];0===e.i||1===e.i?e.j():e.g=!0}function _(t,e){e._=e.p.length;var r=e.p[0],n=void 0!==t&&t!==r;
12return e.h.O||w("ES5").S(e,t,n),n?(r[K].P&&(k(e),o(4)),a(t)&&(t=A(e,t),e.l||O(e,t)),e.u&&w("Patches").M(r[K].t,t,e.u,e.s)):t=A(e,r,[]),k(e),e.u&&e.v(e.u,e.s),t!==D?t:void 0}function A(t,e,r){if(b(e))return e;var n=e[K];if(!n)return u(e,function(i,o){return I(t,n,e,i,o,r)},!0),e;if(n.A!==t)return e;if(!n.P)return O(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=g(n.k):n.o,o=i,s=!1;3===n.i&&(o=new Set(i),i.clear(),s=!0),u(o,function(e,o){return I(t,n,i,e,o,r,s)}),O(t,i,!1),r&&t.u&&w("Patches").N(n,r,t.u,t.s)}return n.o}function I(t,e,r,n,i,o,u){if(s(i)){var l=A(t,i,o&&e&&3!==e.i&&!c(e.R,n)?o.concat(n):void 0);if(h(r,n,l),!s(l))return;t.m=!1}else u&&r.add(i);if(a(i)&&!b(i)){if(!t.h.D&&t._<1)return;A(t,i),e&&e.A.l||O(t,i)}}function O(t,e,r){void 0===r&&(r=!1),!t.l&&t.h.D&&t.m&&m(e,r)}function P(t,e){var r=t[K];return(r?p(r):t)[e]}function B(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function R(t){t.P||(t.P=!0,t.l&&R(t.l))}function M(t){t.o||(t.o=g(t.t))}function L(t,e,r){var n,i,o,s,a,u,l,c=d(e)?w("MapSet").F(e,r):f(e)?w("MapSet").T(e,r):t.O?(o=i={i:(n=Array.isArray(e))?1:0,A:r?r.A:N,P:!1,I:!1,R:{},l:r,t:e,k:null,o:null,j:null,C:!1},s=J,n&&(o=[i],s=Z),u=(a=Proxy.revocable(o,s)).revoke,l=a.proxy,i.k=l,i.j=u,l):w("ES5").J(e,r);return(r?r.A:N).p.push(c),c}function T(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return g(t)}var C,N,j="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),U="undefined"!=typeof Map,z="undefined"!=typeof Set,$="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,D=j?Symbol.for("immer-nothing"):((C={})["immer-nothing"]=!0,C),W=j?Symbol.for("immer-draftable"):"__$immer_draftable",K=j?Symbol.for("immer-state"):"__$immer_state",q=""+Object.prototype.constructor,F="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,V=Object.getOwnPropertyDescriptors||function(t){var e={};return F(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},H={},J={get:function(t,e){if(e===K)return t;var r,n,i=p(t);if(!c(i,e))return(n=B(i,e))?"value"in n?n.value:null===(r=n.get)||void 0===r?void 0:r.call(t.k):void 0;var o=i[e];return t.I||!a(o)?o:o===P(t.t,e)?(M(t),t.o[e]=L(t.A.h,o,t)):o},has:function(t,e){return e in p(t)},ownKeys:function(t){return Reflect.ownKeys(p(t))},set:function(t,e,r){var n=B(p(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,r),!0;if(!t.P){var i=P(p(t),e),o=null==i?void 0:i[K];if(o&&o.t===r)return t.o[e]=r,t.R[e]=!1,!0;if((r===i?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==r||c(t.t,e)))return!0;M(t),R(t)}return t.o[e]===r&&(void 0!==r||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==P(t.t,e)||e in t.t?(t.R[e]=!1,M(t),R(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=p(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:r[e]}:n},defineProperty:function(){o(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){o(12)}},Z={};u(J,function(t,e){Z[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Z.deleteProperty=function(t,e){return Z.set.call(this,t,e,void 0)},Z.set=function(t,e,r){return J.set.call(this,t[0],e,r,t[0])};var Y=new(function(){function t(t){var e=this;this.O=$,this.D=!0,this.produce=function(t,r,n){if("function"==typeof t&&"function"!=typeof r){var i,s=r;return r=t,function(t){var n=this;void 0===t&&(t=s);for(var i=arguments.length,o=Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return e.produce(t,function(t){var e;return(e=r).call.apply(e,[n,t].concat(o))})}}if("function"!=typeof r&&o(6),void 0!==n&&"function"!=typeof n&&o(7),a(t)){var u=x(e),l=L(e,t,void 0),c=!0;try{i=r(l),c=!1}finally{c?k(u):S(u)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then(function(t){return v(u,n),_(t,u)},function(t){throw k(u),t}):(v(u,n),_(i,u))}if(!t||"object"!=typeof t){if(void 0===(i=r(t))&&(i=t),i===D&&(i=void 0),e.D&&m(i,!0),n){var h=[],d=[];w("Patches").M(t,i,h,d),n(h,d)}return i}o(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,function(e){return t.apply(void 0,[e].concat(i))})};var n,i,o=e.produce(t,r,function(t,e){n=t,i=e});return"undefined"!=typeof Promise&&o instanceof Promise?o.then(function(t){return[t,n,i]}):[o,n,i]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}
12var e=t.prototype;return e.createDraft=function(t){a(t)||o(8),s(t)&&(s(e=t)||o(22,e),t=function t(e){if(!a(e))return e;var r,n=e[K],i=l(e);if(n){if(!n.P&&(n.i<4||!w("ES5").K(n)))return n.t;n.I=!0,r=T(e,i),n.I=!1}else r=T(e,i);return u(r,function(e,i){var o;n&&(2===l(o=n.t)?o.get(e):o[e])===i||h(r,e,t(i))}),3===i?new Set(r):r}(e));var e,r=x(this),n=L(this,t,void 0);return n[K].C=!0,S(r),n},e.finishDraft=function(t,e){var r=(t&&t[K]).A;return v(r,e),_(void 0,r)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!$&&o(20),this.O=t},e.applyPatches=function(t,e){for(r=e.length-1;r>=0;r--){var r,n=e[r];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}r>-1&&(e=e.slice(r+1));var i=w("Patches").$;return s(t)?i(t,e):this.produce(t,function(t){return i(t,e)})},t}()),G=Y.produce;Y.produceWithPatches.bind(Y),Y.setAutoFreeze.bind(Y),Y.setUseProxies.bind(Y),Y.applyPatches.bind(Y),Y.createDraft.bind(Y),Y.finishDraft.bind(Y);var Q=function(t){let e="function"==typeof t?function(t){let e;let r=new Set,n=(t,n)=>{let i="function"==typeof t?t(e):t;if(i!==e){let t=e;e=n?i:Object.assign({},e,i),r.forEach(r=>r(e,t))}},i=()=>e,o=(t,n=i,o=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let s=n(e);function a(){let r=n(e);if(!o(s,r)){let e=s;t(s=r,e)}}return r.add(a),()=>r.delete(a)},s={setState:n,getState:i,subscribe:(t,e,n)=>e||n?o(t,e,n):(r.add(t),()=>r.delete(t)),destroy:()=>r.clear()};return e=t(n,i,s),s}(t):t,r=(t=e.getState,r=Object.is)=>{let o;let[,s]=(0,n.useReducer)(t=>t+1,0),a=e.getState(),u=(0,n.useRef)(a),l=(0,n.useRef)(t),c=(0,n.useRef)(r),h=(0,n.useRef)(!1),d=(0,n.useRef)();void 0===d.current&&(d.current=t(a));let f=!1;(u.current!==a||l.current!==t||c.current!==r||h.current)&&(o=t(a),f=!r(d.current,o)),i(()=>{f&&(d.current=o),u.current=a,l.current=t,c.current=r,h.current=!1});let p=(0,n.useRef)(a);i(()=>{let t=()=>{try{let t=e.getState(),r=l.current(t);c.current(d.current,r)||(u.current=t,d.current=r,s())}catch(t){h.current=!0,s()}},r=e.subscribe(t);return e.getState()!==p.current&&t(),r},[]);let g=f?o:d.current;return(0,n.useDebugValue)(g),g};return Object.assign(r,e),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");let t=[r,e];return{next(){let e=t.length<=0;return{value:t.shift(),done:e}}}},r}(function(t,e){return{notifications:[],set:function(e){return t(G(e))}}})},1979:function(t,e,r){"use strict";r.d(e,{h:function(){return a}});var n=r(9499),i=r(7812),o=r(4243);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){var e=o.Z.getState(),r=e.notifications;(0,e.set)(function(e){e.notifications=[].concat((0,i.Z)(r),[function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){(0,n.Z)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({type:"success"},t)])})}},6840:function(t,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(8588)}])},6714:function(){},876:function(){},5152:function(t,e,r){t.exports=r(7837)},9008:function(t,e,r){t.exports=r(4394)},1664:function(t,e,r){t.exports=r(1568)},1163:function(t,e,r){t.exports=r(1171)},2592:function(t,e,r){let n=r(7138),i=r(5115),o=r(6907),s=r(3776);function a(t,e,r,o,s){let a=[].slice.call(arguments,1),u=a.length,l="function"==typeof a[u-1];if(!l&&!n())throw Error("Callback required as last argument");if(l){if(u<2)throw Error("Too few arguments provided");2===u?(s=r,r=e,e=o=void 0):3===u&&(e.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=e,e=void 0))}else{if(u<1)throw Error("Too few arguments provided");return 1===u?(r=e,e=o=void 0):2!==u||e.getContext||(o=r,r=e,e=void 0),new Promise(function(n,s){try{let s=i.create(r,o);n(t(s,e,o))}catch(t){s(t)}})}try{let n=i.create(r,o);s(null,t(n,e,o))}catch(t){s(t)}}e.create=i.create,e.toCanvas=a.bind(null,o.render),e.toDataURL=a.bind(null,o.renderToDataURL),e.toString=a.bind(null,function(t,e,r){return s.render(t,r)})},7138:function(t){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},1845:function(t,e,r){let n=r(242).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];let e=Math.floor(t/7)+2,r=n(t),i=145===r?26:2*Math.ceil((r-13)/(2*e-2)),o=[r-7];for(let t=1;t<e-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},e.getPositions=function(t){let r=[],n=e.getRowColCoords(t),i=n.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)(0!==t||0!==e)&&(0!==t||e!==i-1)&&(t!==i-1||0!==e)&&r.push([n[t],n[e]]);return r}},8260:function(t,e,r){let n=r(6910),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(t){this.mode=n.ALPHANUMERIC,this.data=t}o.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;
12e+2<=this.data.length;e+=2){let r=45*i.indexOf(this.data[e]);r+=i.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},t.exports=o},7245:function(t){function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){return(this.buffer[Math.floor(t/8)]>>>7-t%8&1)==1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},3280:function(t){function e(t){if(!t||t<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,r,n){let i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},3424:function(t,e,r){let n=r(6910);function i(t){this.mode=n.BYTE,"string"==typeof t?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}i.getBitsLength=function(t){return 8*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},t.exports=i},6245:function(t,e,r){let n=r(4908),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case n.L:return i[(t-1)*4+0];case n.M:return i[(t-1)*4+1];case n.Q:return i[(t-1)*4+2];case n.H:return i[(t-1)*4+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return o[(t-1)*4+0];case n.M:return o[(t-1)*4+1];case n.Q:return o[(t-1)*4+2];case n.H:return o[(t-1)*4+3];default:return}}},4908:function(t,e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw Error("Unknown EC Level: "+t)}}(t)}catch(t){return r}}},6526:function(t,e,r){let n=r(242).getSymbolSize;e.getPositions=function(t){let e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},1642:function(t,e,r){let n=r(242),i=n.getBCHDigit(1335);e.getEncodedBits=function(t,e){let r=t.bit<<3|e,o=r<<10;for(;n.getBCHDigit(o)-i>=0;)o^=1335<<n.getBCHDigit(o)-i;return(r<<10|o)^21522}},9729:function(t,e){let r=new Uint8Array(512),n=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)r[e]=t,n[t]=e,256&(t<<=1)&&(t^=285);for(let t=255;t<512;t++)r[t]=r[t-255]}(),e.log=function(t){if(t<1)throw Error("log("+t+")");return n[t]},e.exp=function(t){return r[t]},e.mul=function(t,e){return 0===t||0===e?0:r[n[t]+n[e]]}},5442:function(t,e,r){let n=r(6910),i=r(242);function o(t){this.mode=n.KANJI,this.data=t}o.getBitsLength=function(t){return 13*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=i.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),t.put(r,13)}},t.exports=o},7126:function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){let e=t.size,n=0,i=0,o=0,s=null,a=null;for(let u=0;u<e;u++){i=o=0,s=a=null;for(let l=0;l<e;l++){let e=t.get(u,l);e===s?i++:(i>=5&&(n+=r.N1+(i-5)),s=e,i=1),(e=t.get(l,u))===a?o++:(o>=5&&(n+=r.N1+(o-5)),a=e,o=1)}i>=5&&(n+=r.N1+(i-5)),o>=5&&(n+=r.N1+(o-5))}return n},e.getPenaltyN2=function(t){let e=t.size,n=0;for(let r=0;r<e-1;r++)for(let i=0;i<e-1;i++){let e=t.get(r,i)+t.get(r,i+1)+t.get(r+1,i)+t.get(r+1,i+1);(4===e||0===e)&&n++}return n*r.N2},e.getPenaltyN3=function(t){let e=t.size,n=0,i=0,o=0;for(let r=0;r<e;r++){i=o=0;for(let s=0;s<e;s++)i=i<<1&2047|t.get(r,s),s>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|t.get(s,r),s>=10&&(1488===o||93===o)&&n++}return n*r.N3},e.getPenaltyN4=function(t){let e=0,n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*r.N4},e.applyMask=function(t,r){let n=r.size;
vendor: 14,290 bytes, line 12
12for(let i=0;i<n;i++)for(let o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,function(t,r,n){switch(t){case e.Patterns.PATTERN000:return(r+n)%2==0;case e.Patterns.PATTERN001:return r%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(r+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return r*n%2+r*n%3==0;case e.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case e.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw Error("bad maskPattern:"+t)}}(t,o,i))},e.getBestMask=function(t,r){let n=Object.keys(e.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){r(s),e.applyMask(s,t);let n=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),n<o&&(o=n,i=s)}return i}},6910:function(t,e,r){let n=r(3114),i=r(7007);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw Error("Invalid mode: "+t);if(!n.isValid(e))throw Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw Error("Unknown mode: "+t)}}(t)}catch(t){return r}}},1085:function(t,e,r){let n=r(6910);function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e,r;for(e=0;e+3<=this.data.length;e+=3)r=parseInt(this.data.substr(e,3),10),t.put(r,10);let n=this.data.length-e;n>0&&(r=parseInt(this.data.substr(e),10),t.put(r,3*n+1))},t.exports=i},6143:function(t,e,r){let n=r(9729);e.mul=function(t,e){let r=new Uint8Array(t.length+e.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<e.length;o++)r[i+o]^=n.mul(t[i],e[o]);return r},e.mod=function(t,e){let r=new Uint8Array(t);for(;r.length-e.length>=0;){let t=r[0];for(let i=0;i<e.length;i++)r[i]^=n.mul(e[i],t);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(t){let r=new Uint8Array([1]);for(let i=0;i<t;i++)r=e.mul(r,new Uint8Array([1,n.exp(i)]));return r}},5115:function(t,e,r){let n=r(242),i=r(4908),o=r(7245),s=r(3280),a=r(1845),u=r(6526),l=r(7126),c=r(6245),h=r(2882),d=r(3103),f=r(1642),p=r(6910),g=r(6130);function m(t,e,r){let n,i;let o=t.size,s=f.getEncodedBits(e,r);for(n=0;n<15;n++)i=(s>>n&1)==1,n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}e.create=function(t,e){let r,f;if(void 0===t||""===t)throw Error("No input text");let y=i.M;return void 0!==e&&(y=i.from(e.errorCorrectionLevel,i.M),r=d.from(e.version),f=l.from(e.maskPattern),e.toSJISFunc&&n.setToSJISFunction(e.toSJISFunc)),function(t,e,r,i){let f;if(Array.isArray(t))f=g.fromArray(t);else if("string"==typeof t){let n=e;if(!n){let e=g.rawSplit(t);n=d.getBestVersionForData(e,r)}f=g.fromString(t,n||40)}else throw Error("Invalid data");let y=d.getBestVersionForData(f,r);if(!y)throw Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<y)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else e=y;let b=function(t,e,r){let i=new o;r.forEach(function(e){i.put(e.mode.bit,4),i.put(e.getLength(),p.getCharCountIndicator(e.mode,t)),e.write(i)});let s=(n.getSymbolTotalCodewords(t)-c.getTotalCodewordsCount(t,e))*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let t=0;t<a;t++)i.put(t%2?17:236,8);return function(t,e,r){let i,o;let s=n.getSymbolTotalCodewords(e),a=s-c.getTotalCodewordsCount(e,r),u=c.getBlocksCount(e,r),l=s%u,d=u-l,f=Math.floor(s/u),p=Math.floor(a/u),g=p+1,m=f-p,y=new h(m),b=0,w=Array(u),v=Array(u),k=0,S=new Uint8Array(t.buffer);for(let t=0;t<u;t++){let e=t<d?p:g;w[t]=S.slice(b,b+e),v[t]=y.encode(w[t]),b+=e,k=Math.max(k,e)}let x=new Uint8Array(s),E=0;for(i=0;i<k;i++)for(o=0;o<u;o++)i<w[o].length&&(x[E++]=w[o][i]);for(i=0;i<m;i++)for(o=0;o<u;o++)x[E++]=v[o][i];return x}(i,t,e)}(e,r,f),w=new s(n.getSymbolSize(e));return function(t,e){let r=t.size,n=u.getPositions(e);for(let e=0;e<n.length;e++){let i=n[e][0],o=n[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1)&&!(r<=i+e))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+n||(e>=0&&e<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===e||6===e)||e>=2&&e<=4&&n>=2&&n<=4?t.set(i+e,o+n,!0,!0):t.set(i+e,o+n,!1,!0))}}(w,e),function(t){let e=t.size;for(let r=8;r<e-8;r++){let e=r%2==0;t.set(r,6,e,!0),t.set(6,r,e,!0)}}(w),function(t,e){let r=a.getPositions(e);for(let e=0;e<r.length;e++){let n=r[e][0],i=r[e][1];for(let e=-2;e<=2;e++)for(let r=-2;r<=2;r++)-2===e||2===e||-2===r||2===r||0===e&&0===r?t.set(n+e,i+r,!0,!0):t.set(n+e,i+r,!1,!0)}}(w,e),m(w,r,0),e>=7&&function(t,e){let r,n,i;let o=t.size,s=d.getEncodedBits(e);for(let e=0;e<18;e++)r=Math.floor(e/3),n=e%3+o-8-3,i=(s>>e&1)==1,t.set(r,n,i,!0),t.set(n,r,i,!0)}(w,e),function(t,e){let r=t.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!t.isReserved(i,a-r)){let n=!1;s<e.length&&(n=(e[s]>>>o&1)==1),t.set(i,a-r,n),-1==--o&&(s++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(w,b),isNaN(i)&&(i=l.getBestMask(w,m.bind(null,w,r))),l.applyMask(i,w),m(w,r,i),{modules:w,version:e,errorCorrectionLevel:r,maskPattern:i,segments:f}}(t,r,y,f)}},2882:function(t,e,r){let n=r(6143);function i(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(t){this.degree=t,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(t){if(!this.genPoly)throw Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let r=n.mod(e,this.genPoly),i=this.degree-r.length;if(i>0){let t=new Uint8Array(this.degree);return t.set(r,i),t}return r},t.exports=i},7007:function(t,e){let r="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=RegExp(n,"g"),e.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=RegExp(i,"g"),e.NUMERIC=RegExp(r,"g"),e.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let o=RegExp("^"+n+"$"),s=RegExp("^"+r+"$"),a=RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return s.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},6130:function(t,e,r){let n=r(6910),i=r(1085),o=r(8260),s=r(3424),a=r(5442),u=r(7007),l=r(242),c=r(5987);function h(t){return unescape(encodeURIComponent(t)).length}function d(t,e,r){let n;let i=[];for(;null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function f(t){let e,r;let i=d(u.NUMERIC,n.NUMERIC,t),o=d(u.ALPHANUMERIC,n.ALPHANUMERIC,t);return l.isKanjiModeEnabled()?(e=d(u.BYTE,n.BYTE,t),r=d(u.KANJI,n.KANJI,t)):(e=d(u.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function p(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return a.getBitsLength(t);case n.BYTE:return s.getBitsLength(t)}}function g(t,e){let r;let u=n.getBestModeForData(t);if((r=n.from(e,u))!==n.BYTE&&r.bit<u.bit)throw Error('"'+t+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(u));switch(r!==n.KANJI||l.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(t);case n.ALPHANUMERIC:return new o(t);case n.KANJI:return new a(t);case n.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t},[])},e.fromString=function(t,r){let i=function(t,e){let r={},i={start:{}},o=["start"];for(let s=0;s<t.length;s++){let a=t[s],u=[];for(let t=0;t<a.length;t++){let l=a[t],c=""+s+t;u.push(c),r[c]={node:l,lastCount:0},i[c]={};for(let t=0;t<o.length;t++){let s=o[t];r[s]&&r[s].node.mode===l.mode?(i[s][c]=p(r[s].lastCount+l.length,l.mode)-p(r[s].lastCount,l.mode),r[s].lastCount+=l.length):(r[s]&&(r[s].lastCount=l.length),i[s][c]=p(l.length,l.mode)+4+n.getCharCountIndicator(l.mode,e))}}o=u}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:r}}(function(t){let e=[];for(let r=0;r<t.length;r++){let i=t[r];switch(i.mode){case n.NUMERIC:e.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:e.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:e.push([i,{data:i.data,mode:n.BYTE,length:h(i.data)}]);break;case n.BYTE:e.push([{data:i.data,mode:n.BYTE,length:h(i.data)}])}}return e}(f(t,l.isKanjiModeEnabled())),r),o=c.find_path(i.map,"start","end"),s=[];for(let t=1;t<o.length-1;t++)s.push(i.table[o[t]].node);return e.fromArray(s.reduce(function(t,e){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},e.rawSplit=function(t){return e.fromArray(f(t,l.isKanjiModeEnabled()))}},242:function(t,e){let r;let n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw Error('"version" cannot be null or undefined');if(t<1||t>40)throw Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return n[t]},e.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw Error('"toSJISFunc" is not a valid function.');r=t},e.isKanjiModeEnabled=function(){return void 0!==r},e.toSJIS=function(t){return r(t)}},3114:function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},3103:function(t,e,r){let n=r(242),i=r(6245),o=r(4908),s=r(6910),a=r(3114),u=n.getBCHDigit(7973);function l(t,e){return s.getCharCountIndicator(t,e)+4}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,r){if(!a.isValid(t))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let o=(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e))*8;if(r===s.MIXED)return o;let u=o-l(r,t);switch(r){case s.NUMERIC:return Math.floor(u/10*3);case s.ALPHANUMERIC:return Math.floor(u/11*2);case s.KANJI:return Math.floor(u/13);case s.BYTE:default:return Math.floor(u/8)}},e.getBestVersionForData=function(t,r){let n;let i=o.from(r,o.M);if(Array.isArray(t)){if(t.length>1)return function(t,r){for(let n=1;n<=40;n++)if(function(t,e){let r=0;return t.forEach(function(t){let n=l(t.mode,e);r+=n+t.getBitsLength()}),r}(t,n)<=e.getCapacity(n,r,s.MIXED))return n}(t,i);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,r,n){for(let i=1;i<=40;i++)if(r<=e.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw Error("Invalid QR Code version");let e=t<<12;for(;n.getBCHDigit(e)-u>=0;)e^=7973<<n.getBCHDigit(e)-u;return t<<12|e}},6907:function(t,e,r){let n=r(9653);e.render=function(t,e,r){var i;let o=r,s=e;void 0!==o||e&&e.getContext||(o=e,e=void 0),e||(s=function(){try{return document.createElement("canvas")}catch(t){throw Error("You need to specify a canvas element")}}()),o=n.getOptions(o);let a=n.getImageWidth(t.modules.size,o),u=s.getContext("2d"),l=u.createImageData(a,a);return n.qrToImageData(l.data,t,o),i=s,u.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px",u.putImageData(l,0,0),s},e.renderToDataURL=function(t,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});let o=e.render(t,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},3776:function(t,e,r){let n=r(9653);function i(t,e){let r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(t,e,r){let n=t+e;return void 0!==r&&(n+=" "+r),n}e.render=function(t,e,r){let s=n.getOptions(e),a=t.modules.size,u=t.modules.data,l=a+2*s.margin,c=s.color.light.a?"<path "+i(s.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",h="<path "+i(s.color.dark,"stroke")+' d="'+function(t,e,r){let n="",i=0,s=!1,a=0;for(let u=0;u<t.length;u++){let l=Math.floor(u%e),c=Math.floor(u/e);l||s||(s=!0),t[u]?(a++,u>0&&l>0&&t[u-1]||(n+=s?o("M",l+r,.5+c+r):o("m",i,0),i=0,s=!1),l+1<e&&t[u+1]||(n+=o("h",a),a=0)):i++}return n}(u,a,s.margin)+'"/>',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+('viewBox="0 0 '+l)+" "+l+'" shape-rendering="crispEdges">'+c+h+"</svg>\n";return"function"==typeof r&&r(null,d),d}},9653:function(t,e){function r(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw Error("Invalid hex color: "+t);(3===e.length||4===e.length)&&(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;
12return{width:n,scale:n?4:i,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,r){let n=e.getScale(t,r);return Math.floor((t+2*r.margin)*n)},e.qrToImageData=function(t,r,n){let i=r.modules.size,o=r.modules.data,s=e.getScale(i,n),a=Math.floor((i+2*n.margin)*s),u=n.margin*s,l=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let r=0;r<a;r++){let c=(e*a+r)*4,h=n.color.light;e>=u&&r>=u&&e<a-u&&r<a-u&&(h=l[o[Math.floor((e-u)/s)*i+Math.floor((r-u)/s)]?1:0]),t[c++]=h.r,t[c++]=h.g,t[c++]=h.b,t[c]=h.a}}},9921:function(t,e){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,v=r?Symbol.for("react.scope"):60119;function k(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case n:switch(t=t.type){case c:case h:case o:case a:case s:case f:return t;default:switch(t=t&&t.$$typeof){case l:case d:case m:case g:case u:return t;default:return e}}case i:return e}}}function S(t){return k(t)===h}e.AsyncMode=c,e.ConcurrentMode=h,e.ContextConsumer=l,e.ContextProvider=u,e.Element=n,e.ForwardRef=d,e.Fragment=o,e.Lazy=m,e.Memo=g,e.Portal=i,e.Profiler=a,e.StrictMode=s,e.Suspense=f,e.isAsyncMode=function(t){return S(t)||k(t)===c},e.isConcurrentMode=S,e.isContextConsumer=function(t){return k(t)===l},e.isContextProvider=function(t){return k(t)===u},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===n},e.isForwardRef=function(t){return k(t)===d},e.isFragment=function(t){return k(t)===o},e.isLazy=function(t){return k(t)===m},e.isMemo=function(t){return k(t)===g},e.isPortal=function(t){return k(t)===i},e.isProfiler=function(t){return k(t)===a},e.isStrictMode=function(t){return k(t)===s},e.isSuspense=function(t){return k(t)===f},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===h||t===a||t===s||t===f||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===g||t.$$typeof===u||t.$$typeof===l||t.$$typeof===d||t.$$typeof===b||t.$$typeof===w||t.$$typeof===v||t.$$typeof===y)},e.typeOf=k},9864:function(t,e,r){"use strict";t.exports=r(9921)},4790:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.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 i=0,o=n.length,s=Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,l,c=this._events[a],h=arguments.length;
vendor: 6,916 bytes, line 12
12if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){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,i),!0;case 5:return c.fn.call(c.context,e,n,i,o),!0;case 6:return c.fn.call(c.context,e,n,i,o,s),!0}for(l=1,u=Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){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,i);break;default:if(!u)for(d=1,u=Array(h-1);d<h;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,l=[],c=a.length;u<c;u++)(a[u].fn!==e||i&&!a[u].once||n&&a[u].context!==n)&&l.push(a[u]);l.length?this._events[o]=1===l.length?l[0]:l:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},9509:function(t,e,r){var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw TypeError("Argument must be a number");return n.SlowBuffer(t)}},1379:function(t,e){"use strict";function r(t,e,r){return e<=t&&t<=r}function n(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function i(t){this.tokens=[].slice.call(t)}function o(t,e){if(t)throw TypeError("Decoder error");return e||65533}i.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 s="utf-8";function a(t,e){if(!(this instanceof a))return new a(t,e);if((t=void 0!==t?String(t).toLowerCase():s)!==s)throw Error("Encoding not supported. Only utf-8 is supported");e=n(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 u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():s)!==s)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function l(t){var e=t.fatal,n=0,i=0,s=0,a=128,u=191;this.handler=function(t,l){if(-1===l&&0!==s)return s=0,o(e);if(-1===l)return -1;if(0===s){if(r(l,0,127))return l;if(r(l,194,223))s=1,n=l-192;else if(r(l,224,239))224===l&&(a=160),237===l&&(u=159),s=2,n=l-224;else{if(!r(l,240,244))return o(e);240===l&&(a=144),244===l&&(u=143),s=3,n=l-240}return n<<=6*s,null}if(!r(l,a,u))return n=s=i=0,a=128,u=191,t.prepend(l),o(e);if(a=128,u=191,i+=1,n+=l-128<<6*(s-i),i!==s)return null;var c=n;return n=s=i=0,c}}function c(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(r(e,0,127))return e;r(e,128,2047)?(n=1,i=192):r(e,2048,65535)?(n=2,i=224):r(e,65536,1114111)&&(n=3,i=240);for(var n,i,o=[(e>>6*n)+i];n>0;){var s=e>>6*(n-1);o.push(128|63&s),n-=1}return o}}a.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=n(e),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,o,s=new i(r),a=[];!s.endOfStream()&&-1!==(o=this._decoder.handler(s,s.read()));)null!==o&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));if(!this._streaming){do{if(-1===(o=this._decoder.handler(s,s.read())))break;if(null===o)continue;Array.isArray(o)?a.push.apply(a,o):a.push(o)}while(!s.endOfStream());this._decoder=null}return!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.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}(a)}},u.prototype={encode:function(t,e){t=t?String(t):"",e=n(e),this._streaming||(this._encoder=new c(this._options)),this._streaming=!!e.stream;for(var r,o=[],s=new i(function(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.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=t.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}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?o.push.apply(o,r):o.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?o.push.apply(o,r):o.push(r);this._encoder=null}return new Uint8Array(o)}},e.TextEncoder=u,e.TextDecoder=a},4880:function(t,e,r){"use strict";r.d(e,{v4:function(){return l}});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 u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase();if(!("string"==typeof r&&o.test(r)))throw TypeError("Stringified UUID is invali
12d");return r},l=function(t,e,r){var o=(t=t||{}).random||(t.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,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=o[s];return e}return u(o)}},1739:function(t){t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},6601:function(){},6643:function(t,e){var r=Object.create,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,u=function(t,e,r,s){if(e&&"object"==typeof e||"function"==typeof e)for(var u,l=o(e),c=0,h=l.length;c<h;c++)u=l[c],a.call(t,u)||u===r||n(t,u,{get:(function(t){return e[t]}).bind(null,u),enumerable:!(s=i(e,u))||s.enumerable});return t};e.__toESM=function(t,e,i){return i=null!=t?r(s(t)):{},u(!e&&t&&t.__esModule?i:n(i,"default",{value:t,enumerable:!0}),t)}},8635:function(t,e,r){var n=r(968);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var s=r(6643),a=r(4404),u=r(4014),l=r(5767),c=r(7294);c=s.__toESM(c);var h=r(8679);h=s.__toESM(h);var d=r(7421),f=null,p=function(t,e){if(e&&t.isInitialized)for(var r=0,n=Object.keys(e);r<n.length;r++)for(var i=n[r],o=0,s=Object.keys(e[i]);o<s.length;o++){var a,u=s[o];null!=t&&null!==(a=t.store)&&void 0!==a&&a.data&&t.store.data[i]&&t.store.data[i][u]||t.addResourceBundle(i,u,e[i][u],!0,!0)}};Object.defineProperty(e,"Trans",{enumerable:!0,get:function(){return d.Trans}}),e.appWithTranslation=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,h.default)(function(r){var n,i,s=(r.pageProps||{})._nextI18Next,h=null!==(n=null==s?void 0:s.initialLocale)&&void 0!==n?n:null==r||null===(i=r.router)||void 0===i?void 0:i.locale,g=null==s?void 0:s.ns,m=(0,c.useRef)(null),y=(0,c.useRef)(!1),b=(0,c.useMemo)(function(){if(!s&&!e)return null;var t,r,n=null!=e?e:null==s?void 0:s.userConfig;if(!n)throw Error("appWithTranslation was called without a next-i18next config");if(!(null!=n&&n.i18n))throw Error("appWithTranslation was called without config.i18n");if(!(null!=n&&null!==(t=n.i18n)&&void 0!==t&&t.defaultLocale))throw Error("config.i18n does not include a defaultLocale property");var i=(s||{}).initialI18nStore,a=null!==(r=null==e?void 0:e.resources)&&void 0!==r?r:i;h||(h=n.i18n.defaultLocale);var c=m.current;return c?(p(c,a),c.options.saveMissing&&h&&c.language!==h&&(c.options.saveMissing=!1,y.current=!0)):(p(c=l(o(o(o({},u.createConfig(o(o({},n),{},{lng:h}))),{},{lng:h},g&&{ns:g}),{},{resources:a})).i18n,a),f=c,m.current=c),c},[s,h,g]);return a.useIsomorphicLayoutEffect(function(){b&&h&&b.changeLanguage(h).finally(function(){y.current&&(y.current=!1,b.options.saveMissing=!0)})},[b,h]),null!==b?c.default.createElement(d.I18nextProvider,{i18n:b},c.default.createElement(t,r)):c.default.createElement(t,o({key:h},r))},t)},Object.defineProperty(e,"globalI18n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"useTranslation",{enumerable:!0,get:function(){return d.useTranslation}}),Object.defineProperty(e,"withTranslation",{enumerable:!0,get:function(){return d.withTranslation}})},4014:function(t,e,r){var n=r(8416),i=r(3171),o=r(968),s=r(7069),a=["i18n"],u=["i18n"];function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};
12e%2?l(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var h=r(7666),d=r(4404),f=["backend","detection"];e.createConfig=function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1],"string"!=typeof(null==t?void 0:t.lng))throw Error("config.lng was not passed into createConfig");var e,r,o,l=t.i18n,p=s(t,a),g=h.defaultConfig,m=g.i18n,y=c(c(c(c({},s(g,u)),p),m),l),b=y.defaultNS,w=y.lng,v=y.localeExtension,k=y.localePath,S=y.nonExplicitSupportedLngs,x=y.locales.filter(function(t){return"default"!==t});if("cimode"===w)return y;if(void 0===y.fallbackLng&&(y.fallbackLng=y.defaultLocale,"default"===y.fallbackLng)){var E=i(x,1);y.fallbackLng=E[0]}var _=null==t||null===(e=t.interpolation)||void 0===e?void 0:e.prefix,A=null==t||null===(r=t.interpolation)||void 0===r?void 0:r.suffix,I=null!=_?_:"{{",O=null!=A?A:"}}";"string"!=typeof(null==t?void 0:t.localeStructure)&&(_||A)&&(y.localeStructure="".concat(I,"lng").concat(O,"/").concat(I,"ns").concat(O));var P=y.fallbackLng,B=y.localeStructure;if(S){var R=function(t,e){var r=i(e.split("-"),1)[0];return t[e]=[r],t};if("string"==typeof P)y.fallbackLng=y.locales.filter(function(t){return t.includes("-")}).reduce(R,{default:[P]});else if(Array.isArray(P))y.fallbackLng=y.locales.filter(function(t){return t.includes("-")}).reduce(R,{default:P});else if("object"==typeof P)y.fallbackLng=Object.entries(y.fallbackLng).reduce(function(t,e){var r=i(e,2),o=r[0],s=r[1];return t[o]=o.includes("-")?d.unique([o.split("-")[0]].concat(n(s))):s,t},P);else if("function"==typeof P)throw Error("If nonExplicitSupportedLngs is true, no functions are allowed for fallbackLng")}return(null==t||null===(o=t.use)||void 0===o?void 0:o.filter(Boolean).some(function(t){return"backend"===t.type}))||("string"==typeof k?y.backend={addPath:"".concat(k,"/").concat(B,".missing.").concat(v),loadPath:"".concat(k,"/").concat(B,".").concat(v)}:"function"!=typeof k||(y.backend={addPath:function(t,e){return k(t,e,!0)},loadPath:function(t,e){return k(t,e,!1)}})),"string"==typeof y.ns||Array.isArray(y.ns)||(y.ns=[b]),f.forEach(function(e){t[e]&&(y[e]=c(c({},y[e]),t[e]))}),y}},7666:function(t,e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e.defaultConfig={defaultNS:"common",errorStackTraceLimit:0,i18n:{defaultLocale:"en",locales:["en"]},get initImmediate(){return!0},get initAsync(){return!0},interpolation:{escapeValue:!1},load:"currentOnly",localeExtension:"json",localePath:"./public/locales",localeStructure:"{{lng}}/{{ns}}",react:{useSuspense:!1},reloadOnPrerender:!1,serializeConfig:!0,use:[]}},5767:function(t,e,r){var n=r(6643),i=r(6073);i=n.__toESM(i),t.exports=function(t){void 0===t.ns&&(t.ns=[]);var e,r,n=i.default.createInstance(t);return n.isInitialized?e=Promise.resolve(i.default.t):(null==t||null===(r=t.use)||void 0===r||r.filter(Boolean).forEach(function(t){return n.use(t)}),"function"==typeof t.onPreInitI18next&&t.onPreInitI18next(n),e=n.init(t)),{i18n:n,initPromise:e}}},1042:function(t,e,r){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),r(6643);var n=r(8635),i=r(7421);Object.defineProperty(e,"I18nContext",{enumerable:!0,get:function(){return i.I18nContext}}),Object.defineProperty(e,"Trans",{enumerable:!0,get:function(){return i.Trans}}),Object.defineProperty(e,"Translation",{enumerable:!0,get:function(){return i.Translation}}),e.appWithTranslation=n.appWithTranslation,Object.defineProperty(e,"i18n",{enumerable:!0,get:function(){return n.globalI18n}}),Object.defineProperty(e,"useTranslation",{enumerable:!0,get:function(){return i.useTranslation}}),Object.defineProperty(e,"withTranslation",{enumerable:!0,get:function(){return i.withTranslation}})},4404:function(t,e,r){var n=r(8416);Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),r(6643);var i=r(7294).useLayoutEffect;e.getFallbackForLng=function t(e,r){if("string"==typeof r)return[r];if(Array.isArray(r))return r;if("object"==typeof r){var i=r[e],o=r.default;return[].concat(n(null!=i?i:[]),n(null!=o?o:[]))}return"function"==typeof r?t(e,r(e)):[]},e.unique=function(t){return Array.from(new Set(t))},e.useIsomorphicLayoutEffect=i},3527:function(t,e,r){"use strict";function n(t){if(!Number.isSafeInteger(t)||t<0)throw Error("positive integer expected, got "+t)}function i(t,...e){if(!(t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name))throw Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw Error("Uint8Array expected of length "+e+", got length="+t.length)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(t.outputLen),n(t.blockLen)}function s(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 a(t,e){i(t);let r=e.outputLen;if(t.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}r.d(e,{$h:function(){return s},eB:function(){return a},gk:function(){return i},k8:function(){return n},z3:function(){return o}})},4359:function(t,e,r){"use strict";r.d(e,{VR:function(){return a},bc:function(){return o},l3:function(){return s}});var n=r(3527),i=r(6409);function o(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}class a extends i.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,i.GL)(this.buffer)}update(t){(0,n.$h)(this);let{view:e,buffer:r,blockLen:o}=this,s=(t=(0,i.O0)(t)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let e=(0,i.GL)(t);for(;o<=s-n;n+=o)this.process(e,n);continue}r.set(t.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,n.$h)(this),(0,n.eB)(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let t=a;t<o;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,l=n?0:4;t.setUint32(e+u,s,n),t.setUint32(e+l,a,n)}(r,o-8,BigInt(8*this.length),s),this.process(r,0);let u=(0,i.GL)(t),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,h=this.get();if(c>h.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)u.setUint32(4*t,h[t],s)}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:i,destroyed:o,pos:s}=this;return t.length=n,t.pos=s,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}},7748:function(t,e,r){"use strict";r.d(e,{JQ:function(){return l}});var n=r(4359),i=r(6409);let o=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,2756
12734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class u extends n.VR{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)a[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=a[t-15],r=a[t-2],n=(0,i.np)(e,7)^(0,i.np)(e,18)^e>>>3,o=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;a[t]=o+a[t-7]+n+a[t-16]|0}let{A:r,B:s,C:u,D:l,E:c,F:h,G:d,H:f}=this;for(let t=0;t<64;t++){let e=f+((0,i.np)(c,6)^(0,i.np)(c,11)^(0,i.np)(c,25))+(0,n.bc)(c,h,d)+o[t]+a[t]|0,p=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+(0,n.l3)(r,s,u)|0;f=d,d=h,h=c,c=l+e|0,l=u,u=s,s=r,r=e+p|0}r=r+this.A|0,s=s+this.B|0,u=u+this.C|0,l=l+this.D|0,c=c+this.E|0,h=h+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,s,u,l,c,h,d,f)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let l=(0,i.hE)(()=>new u)},6409:function(t,e,r){"use strict";r.d(e,{kb:function(){return p},l1:function(){return l},ci:function(){return h},eV:function(){return f},GL:function(){return s},iA:function(){return u},O6:function(){return m},np:function(){return a},O0:function(){return d},Jq:function(){return o},hE:function(){return g}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;var i=r(3527);function o(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function s(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function a(t,e){return t<<32-e|t>>>e}let u=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function l(t){for(let r=0;r<t.length;r++){var e;t[r]=(e=t[r])<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}}let c=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function h(t){(0,i.gk)(t);let e="";for(let r=0;r<t.length;r++)e+=c[t[r]];return e}function d(t){return"string"==typeof t&&(t=function(t){if("string"!=typeof t)throw Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}(t)),(0,i.gk)(t),t}function f(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];(0,i.gk)(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}class p{clone(){return this._cloneInto()}}function g(t){let e=e=>t().update(d(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function m(t=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(t));if(n&&"function"==typeof n.randomBytes)return n.randomBytes(t);throw Error("crypto.getRandomValues must be defined")}},9607:function(t,e,r){"use strict";r.d(e,{i1:function(){return i},mI:function(){return a}});var n,i,o=r(6729),s=r(5615);(n=i||(i={})).Installed="Installed",n.NotDetected="NotDetected",n.Loadable="Loadable",n.Unsupported="Unsupported";class a extends o{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(t,e,r={}){let n=this.publicKey;if(!n)throw new s.oS;return t.feePayer=t.feePayer||n,t.recentBlockhash=t.recentBlockhash||(await e.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,t}}},5615:function(t,e,r){"use strict";r.d(e,{$w:function(){return s},IW:function(){return d},Nx:function(){return c},OZ:function(){return i},PY:function(){return f},UG:function(){return u},at:function(){return a},bD:function(){return g},cO:function(){return l},fk:function(){return p},lj:function(){return n},oS:function(){return h},p6:function(){return o}});class n extends Error{constructor(t,e){super(t),this.error=e}}class i extends n{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class o extends n{constructor(){super(...arguments),this.name="WalletConfigError"}}class s extends n{constructor(){super(...arguments),this.name="WalletConnectionError"}}class a extends n{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class u extends n{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class l extends n{constructor(){super(...arguments),this.name="WalletAccountError"}}class c extends n{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class h extends n{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class d extends n{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class f extends n{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class p extends n{constructor(){super(...arguments),this.name="WalletSignMessageError"}}class g extends n{constructor(){super(...arguments),this.name="WalletSignInError"}}},4718:function(t,e,r){"use strict";r.d(e,{R:function(){return o},h:function(){return i}});var n=r(7294);let i=(0,n.createContext)({});function o(){return(0,n.useContext)(i)}},4306:function(t,e,r){"use strict";r.d(e,{O:function(){return u},z:function(){return a}});var n=r(7294);let i=[],o={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(){s("call","select")}
12,connect:()=>Promise.reject(s("call","connect")),disconnect:()=>Promise.reject(s("call","disconnect")),sendTransaction:()=>Promise.reject(s("call","sendTransaction")),signTransaction:()=>Promise.reject(s("call","signTransaction")),signAllTransactions:()=>Promise.reject(s("call","signAllTransactions")),signMessage:()=>Promise.reject(s("call","signMessage")),signIn:()=>Promise.reject(s("call","signIn"))};function s(t,e){let r=Error(`You have tried to ${t} "${e}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`);return console.error(r),r}Object.defineProperty(o,"wallets",{get:()=>(s("read","wallets"),i)}),Object.defineProperty(o,"wallet",{get:()=>(s("read","wallet"),null)}),Object.defineProperty(o,"publicKey",{get:()=>(s("read","publicKey"),null)});let a=(0,n.createContext)(o);function u(){return(0,n.useContext)(a)}},2587:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}r.d(e,{Z:function(){return n}})},29:function(t,e,r){"use strict";function n(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){r(t);return}a.done?e(u):Promise.resolve(u).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise(function(i,o){var s=t.apply(e,r);function a(t){n(s,i,o,a,u,"next",t)}function u(t){n(s,i,o,a,u,"throw",t)}a(void 0)})}}r.d(e,{Z:function(){return i}})},9499:function(t,e,r){"use strict";r.d(e,{Z:function(){return i}});var n=r(5358);function i(t,e,r){return(e=(0,n.Z)(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},6835:function(t,e,r){"use strict";r.d(e,{Z:function(){return i}});var n=r(2937);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||(0,n.Z)(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},7812:function(t,e,r){"use strict";r.d(e,{Z:function(){return o}});var n=r(2587),i=r(2937);function o(t){return function(t){if(Array.isArray(t))return(0,n.Z)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,i.Z)(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},5358:function(t,e,r){"use strict";function n(t){return(n="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)}function i(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!==n(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n(e)?e:String(e)}r.d(e,{Z:function(){return i}})},2937:function(t,e,r){"use strict";r.d(e,{Z:function(){return i}});var n=r(2587);function i(t,e){if(t){if("string"==typeof t)return(0,n.Z)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return(0,n.Z)(t,e)}}},7421:function(t,e,r){"use strict";let n;r.r(e),r.d(e,{I18nContext:function(){return D},I18nextProvider:function(){return Q},Trans:function(){return F},TransWithoutContext:function(){return z},Translation:function(){return G},composeInitialProps:function(){return K},date:function(){return te},getDefaults:function(){return P},getI18n:function(){return R},getInitialProps:function(){return q},initReactI18next:function(){return $},number:function(){return tn},plural:function(){return to},select:function(){return ti},selectOrdinal:function(){return ts},setDefaults:function(){return O},setI18n:function(){return B},time:function(){return tr},useSSR:function(){return X},useTranslation:function(){return Z},withSSR:function(){return tt},withTranslation:function(){return Y}});var i=r(7294),o=r(1739),s=r.n(o),a=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function u(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(s()[r[1]]||"/"===t.charAt(t.length-2))&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:-1!==n?t.slice(4,n):""}}for(var i=new RegExp(a),o=null;null!==(o=i.exec(t));
12)if(o[0].trim()){if(o[1]){var u=o[1].trim(),l=[u,""];u.indexOf("=")>-1&&(l=u.split("=")),e.attrs[l[0]]=l[1],i.lastIndex--}else o[2]&&(e.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1))}return e}var l=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,c=/^\s*$/,h=Object.create(null),d={parse:function(t,e){e||(e={}),e.components||(e.components=h);var r,n=[],i=[],o=-1,s=!1;if(0!==t.indexOf("<")){var a=t.indexOf("<");n.push({type:"text",content:-1===a?t:t.substring(0,a)})}for(var d,f=[];d=l.exec(t);)f.push(d);return f.forEach(function(t,e){var r=t[0];if(r&&!r.startsWith("<!--")){for(var n=0,i=0,o=-1,s=null,a=0;a<r.length;a++){var u=r.charAt(a);s?u===s&&(s=null):'"'===u||"'"===u?s=u:"<"===u?2==++n&&(o=a):">"===u&&i++}var l=o>-1&&/[a-zA-Z0-9\-!/]/.test(r.charAt(o+1));if(n>i&&l){var c=r.substring(0,o),h=r.substring(c.length);f[e][0]=h,f[e].index+=c.length}}}),f.forEach(function(a,l){var h=a[0];if(h){var d=a.index;if(s){if(h!=="</"+r.name+">")return;s=!1}var p,g,m="/"!==h.charAt(1),y=h.startsWith("<!--"),b=d+h.length,w=t.charAt(b),v=f[l+1];if("<"===w&&v){var k=t.substring(b,v.index);p=k.split("<").length>k.split(">").length}if(y){var S=u(h);if(o<0)return n.push(S),n;(g=i[o]).children.push(S);var x=t.slice(b,v?v.index:void 0);return x.length>0&&g.children.push({type:"text",content:x}),n}if(m&&(o++,"tag"===(r=u(h)).type&&e.components[r.name]&&(r.type="component",s=!0),r.voidElement||s||!w||"<"===w||r.children.push({type:"text",content:t.slice(b,v?v.index:void 0)}),0===o&&n.push(r),(g=i[o-1])&&g.children.push(r),i[o]=r),(!m||r.voidElement)&&(o>-1&&(r.voidElement||r.name===h.slice(2,-1))&&(r=-1==--o?n:i[o]),!s&&("<"!==w||p)&&w)){g=-1===o?n:i[o].children;var E=v?v.index:-1,_=t.slice(b,-1===E?void 0:E);c.test(_)&&(_=" "),(E>-1&&o+g.length>=0||" "!==_)&&g.push({type:"text",content:_})}}}),n}};function f(){if(console&&console.warn){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];S(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}let p={};function g(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];S(e[0])&&p[e[0]]||(S(e[0])&&(p[e[0]]=new Date),f(...e))}let m=(t,e)=>()=>{if(t.isInitialized)e();else{let r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},y=(t,e,r)=>{t.loadNamespaces(e,m(t,r))},b=(t,e,r,n)=>{S(r)&&(r=[r]),r.forEach(e=>{0>t.options.ns.indexOf(e)&&t.options.ns.push(e)}),t.loadLanguages(e,m(t,n))},w=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.languages[0],i=!!e.options&&e.options.fallbackLng,o=e.languages[e.languages.length-1];if("cimode"===n.toLowerCase())return!0;let s=(t,r)=>{let n=e.services.backendConnector.state[`${t}|${r}`];return -1===n||2===n};return(!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1)||!e.services.backendConnector.backend||!e.isLanguageChangingTo||!!s(e.isLanguageChangingTo,t))&&!!(e.hasResourceBundle(n,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(n,t)&&(!i||s(o,t)))},v=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.languages&&e.languages.length?void 0!==e.options.ignoreJSONStructure?e.hasLoadedNamespace(t,{lng:r.lng,precheck:(e,n)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!n(e.isLanguageChangingTo,t))return!1}}):w(t,e,r):(g("i18n.languages were undefined or empty",e.languages),!0)},k=t=>t.displayName||t.name||(S(t)&&t.length>0?t:"Unknown"),S=t=>"string"==typeof t,x=t=>"object"==typeof t&&null!==t,E=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,_={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"â¦","…":"â¦","/":"/","/":"/"},A=t=>
12_[t],I={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:t=>t.replace(E,A)},O=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};I={...I,...t}},P=()=>I,B=t=>{n=t},R=()=>n,M=(t,e)=>{if(!t)return!1;let r=t.props?t.props.children:t.children;return e?r.length>0:!!r},L=t=>{if(!t)return[];let e=t.props?t.props.children:t.children;return t.props&&t.props.i18nIsDynamicList?C(e):e},T=t=>Array.isArray(t)&&t.every(i.isValidElement),C=t=>Array.isArray(t)?t:[t],N=(t,e)=>{let r={...e};return r.props=Object.assign(t.props,e.props),r},j=(t,e)=>{if(!t)return"";let r="",n=C(t),o=e.transSupportBasicHtmlNodes&&e.transKeepBasicHtmlNodesFor?e.transKeepBasicHtmlNodesFor:[];return n.forEach((t,n)=>{if(S(t))r+=`${t}`;else if((0,i.isValidElement)(t)){let{props:i,type:s}=t,a=Object.keys(i).length,u=o.indexOf(s)>-1,l=i.children;if(l||!u||a){if(!l&&(!u||a)||i.i18nIsDynamicList)r+=`<${n}></${n}>`;else if(u&&1===a&&S(l))r+=`<${s}>${l}</${s}>`;else{let t=j(l,e);r+=`<${n}>${t}</${n}>`}}else r+=`<${s}/>`}else if(null===t)f("Trans: the passed in value is invalid - seems you passed in a null child.");else if(x(t)){let{format:e,...n}=t,i=Object.keys(n);if(1===i.length){let t=e?`${i[0]}, ${e}`:i[0];r+=`{{${t}}}`}else f("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",t)}else f("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",t)}),r},U=(t,e,r,n,o,s)=>{if(""===e)return[];let a=n.transKeepBasicHtmlNodesFor||[],u=e&&new RegExp(a.map(t=>`<${t}`).join("|")).test(e);if(!t&&!u&&!s)return[e];let l={},c=t=>{C(t).forEach(t=>{S(t)||(M(t)?c(L(t)):x(t)&&!(0,i.isValidElement)(t)&&Object.assign(l,t))})};c(t);let h=d.parse(`<0>${e}</0>`),f={...l,...o},p=(t,e,r)=>{let n=L(t),i=m(n,e.children,r);return T(n)&&0===i.length||t.props&&t.props.i18nIsDynamicList?n:i},g=(t,e,r,n,o)=>{t.dummy?(t.children=e,r.push((0,i.cloneElement)(t,{key:n},o?void 0:e))):r.push(...i.Children.map([t],t=>{let r={...t.props};return delete r.i18nIsDynamicList,(0,i.createElement)(t.type,{...r,key:n,ref:t.ref},o?null:e)}))},m=(e,o,l)=>{let c=C(e);return C(o).reduce((e,o,h)=>{let d=o.children&&o.children[0]&&o.children[0].content&&r.services.interpolator.interpolate(o.children[0].content,f,r.language);if("tag"===o.type){let s=c[parseInt(o.name,10)];1!==l.length||s||(s=l[0][o.name]),s||(s={});let y=0!==Object.keys(o.attrs).length?N({props:o.attrs},s):s,b=(0,i.isValidElement)(y),w=b&&M(o,!0)&&!o.voidElement,v=u&&x(y)&&y.dummy&&!b,k=x(t)&&Object.hasOwnProperty.call(t,o.name);if(S(y)){let t=r.services.interpolator.interpolate(y,f,r.language);e.push(t)}else if(M(y)||w){let t=p(y,o,l);g(y,t,e,h)}else if(v)g(y,m(c,o.children,l),e,h);else if(Number.isNaN(parseFloat(o.name))){if(k){let t=p(y,o,l);g(y,t,e,h,o.voidElement)}else if(n.transSupportBasicHtmlNodes&&a.indexOf(o.name)>-1){if(o.voidElement)e.push((0,i.createElement)(o.name,{key:`${o.name}-${h}`}));else{let t=m(c,o.children,l);e.push((0,i.createElement)(o.name,{key:`${o.name}-${h}`},t))}}else if(o.voidElement)e.push(`<${o.name} />`);else{let t=m(c,o.children,l);e.push(`<${o.name}>${t}</${o.name}>`)}}else if(x(y)&&!b){let t=o.children[0]?d:null;t&&e.push(t)}else g(y,d,e,h,1!==o.children.length||!d)}else if("text"===o.type){let t=n.transWrapTextNodes,a=s?n.unescape(r.services.interpolator.interpolate(o.content,f,r.language)):r.services.interpolator.interpolate(o.content,f,r.language);t?e.push((0,i.createElement)(t,{key:`${o.name}-${h}`},a)):e.push(a)}return e},[])};return L(m([{dummy:!0,children:t||[]}],h,C(t||[]))[0])};function z(t){let{children:e,count:r,parent:n,i18nKey:o,context:s,tOptions:a={},values:u,defaults:l,components:c,ns:h,i18n:d,t:f,shouldUnescape:p,...m}=t,y=d||R();if(!y)return g("You will need to pass in an i18next instance by using i18nextReactModule"),e;let b=f||y.t.bind(y)||(t=>t),w={...P(),...y.options&&y.options.react},v=h||b.ns||y.options&&y.options.defaultNS;v=S(v)?[v]:v||["translation"];let k=j(e,w),x=l||k||w.transEmptyNodeValue||o,{hashTransKey:E}=w,_=o||(E?E(k||x):k||x);y.options&&y.options.interpolation&&y.options.interpolation.defaultVariables&&(u=u&&Object.keys(u).length>0?{...u,...y.options.interpolation.defaultVariables}:{...y.options.interpolation.defaultVariables});let A=u||void 0!==r||!e?a.interpolation:{interpolation:{...a.interpolation,prefix:"#$?",suffix:"?$#"}},I={...a,context:s||a.context,count:r,...u,...A,defaultValue:x,ns:v},O=_?b(_,I):x;
12c&&Object.keys(c).forEach(t=>{let e=c[t];"function"==typeof e.type||!e.props||!e.props.children||0>O.indexOf(`${t}/>`)&&0>O.indexOf(`${t} />`)||(c[t]=(0,i.createElement)(function(){return(0,i.createElement)(i.Fragment,null,e)}))});let B=U(c||e,O,y,w,I,p),M=void 0!==n?n:w.defaultTransParent;return M?(0,i.createElement)(M,m,B):B}let $={type:"3rdParty",init(t){O(t.options.react),B(t)}},D=(0,i.createContext)();class W{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces=()=>Object.keys(this.usedNamespaces)}let K=t=>async e=>{let r=t.getInitialProps?await t.getInitialProps(e):{},n=q();return{...r,...n}},q=()=>{let t=R(),e=t.reportNamespaces?t.reportNamespaces.getUsedNamespaces():[],r={},n={};return t.languages.forEach(r=>{n[r]={},e.forEach(e=>{n[r][e]=t.getResourceBundle(r,e)||{}})}),r.initialI18nStore=n,r.initialLanguage=t.language,r};function F(t){let{children:e,count:r,parent:n,i18nKey:o,context:s,tOptions:a={},values:u,defaults:l,components:c,ns:h,i18n:d,t:f,shouldUnescape:p,...g}=t,{i18n:m,defaultNS:y}=(0,i.useContext)(D)||{},b=d||m||R(),w=f||b&&b.t.bind(b);return z({children:e,count:r,parent:n,i18nKey:o,context:s,tOptions:a,values:u,defaults:l,components:c,ns:h||w&&w.ns||y||b&&b.options&&b.options.defaultNS,i18n:b,t:f,shouldUnescape:p,...g})}let V=(t,e)=>{let r=(0,i.useRef)();return(0,i.useEffect)(()=>{r.current=e?r.current:t},[t,e]),r.current},H=(t,e,r,n)=>t.getFixedT(e,r,n),J=(t,e,r,n)=>(0,i.useCallback)(H(t,e,r,n),[t,e,r,n]),Z=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{i18n:r}=e,{i18n:n,defaultNS:o}=(0,i.useContext)(D)||{},s=r||n||R();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new W),!s){g("You will need to pass in an i18next instance by using initReactI18next");let t=(t,e)=>S(e)?e:x(e)&&S(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t,e=[t,{},!1];return e.t=t,e.i18n={},e.ready=!1,e}s.options.react&&void 0!==s.options.react.wait&&g("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");let a={...P(),...s.options.react,...e},{useSuspense:u,keyPrefix:l}=a,c=t||o||s.options&&s.options.defaultNS;c=S(c)?[c]:c||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(c);let h=(s.isInitialized||s.initializedStoreOnce)&&c.every(t=>v(t,s,a)),d=J(s,e.lng||null,"fallback"===a.nsMode?c:c[0],l),f=()=>d,p=()=>H(s,e.lng||null,"fallback"===a.nsMode?c:c[0],l),[m,w]=(0,i.useState)(f),k=c.join();e.lng&&(k=`${e.lng}${k}`);let E=V(k),_=(0,i.useRef)(!0);(0,i.useEffect)(()=>{let{bindI18n:t,bindI18nStore:r}=a;_.current=!0,h||u||(e.lng?b(s,e.lng,c,()=>{_.current&&w(p)}):y(s,c,()=>{_.current&&w(p)})),h&&E&&E!==k&&_.current&&w(p);let n=()=>{_.current&&w(p)};return t&&s&&s.on(t,n),r&&s&&s.store.on(r,n),()=>{_.current=!1,t&&s&&t.split(" ").forEach(t=>s.off(t,n)),r&&s&&r.split(" ").forEach(t=>s.store.off(t,n))}},[s,k]),(0,i.useEffect)(()=>{_.current&&h&&w(f)},[s,l,h]);let A=[m,s,h];if(A.t=m,A.i18n=s,A.ready=h,h||!h&&!u)return A;throw new Promise(t=>{e.lng?b(s,e.lng,c,()=>t()):y(s,c,()=>t())})},Y=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function n(n){let{forwardedRef:o,...s}=n,[a,u,l]=Z(t,{...s,keyPrefix:e.keyPrefix}),c={...s,t:a,i18n:u,tReady:l};return e.withRef&&o?c.ref=o:!e.withRef&&o&&(c.forwardedRef=o),(0,i.createElement)(r,c)}return n.displayName=`withI18nextTranslation(${k(r)})`,n.WrappedComponent=r,e.withRef?(0,i.forwardRef)((t,e)=>(0,i.createElement)(n,Object.assign({},t,{forwardedRef:e}))):n}};function G(t){let{ns:e,children:r,...n}=t,[i,o,s]=Z(e,n);return r(i,{i18n:o,lng:o.language},s)}function Q(t){let{i18n:e,defaultNS:r,children:n}=t,o=(0,i.useMemo)(()=>({i18n:e,defaultNS:r}),[e,r]);return(0,i.createElement)(D.Provider,{value:o},n)}let X=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{i18n:n}=r,{i18n:o}=(0,i.useContext)(D)||{},s=n||o||R();s.options&&s.options.isClone||(t&&!s.initializedStoreOnce&&(s.services.resourceStore.data=t,s.options.ns=Object.values(t).reduce((t,e)=>
12(Object.keys(e).forEach(e=>{0>t.indexOf(e)&&t.push(e)}),t),s.options.ns),s.initializedStoreOnce=!0,s.isInitialized=!0),!e||s.initializedLanguageOnce||(s.changeLanguage(e),s.initializedLanguageOnce=!0))},tt=()=>function(t){function e(e){let{initialI18nStore:r,initialLanguage:n,...o}=e;return X(r,n),(0,i.createElement)(t,{...o})}return e.getInitialProps=K(t),e.displayName=`withI18nextSSR(${k(t)})`,e.WrappedComponent=t,e},te=()=>"",tr=()=>"",tn=()=>"",ti=()=>"",to=()=>"",ts=()=>""}},function(t){var e=function(e){return t(t.s=e)};t.O(0,[774,179],function(){return e(6840),e(1171)}),_N_E=t.O()}]);
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.