@xoxno/sdk-js 0.1.260 → 0.1.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/interactor.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see interactor.cjs.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={8095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormula=void 0,t.TypeFormula=class{constructor(e,t){this.name=e,this.typeParameters=t}toString(){if(this.typeParameters.length>0){const e=this.typeParameters.map((e=>e.toString())).join(", ");return`${this.name}<${e}>`}return this.name}}},9132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormulaParser=void 0;const r=n(8095);class i{parseExpression(e){e=e.trim();const t=this.tokenizeExpression(e).filter((e=>e!==i.COMMA)),n=[];for(const e of t)if(this.isPunctuation(e))if(this.isEndOfTypeParameters(e)){const e=this.acquireTypeWithParameters(n);n.push(e)}else{if(!this.isBeginningOfTypeParameters(e))throw new Error(`Unexpected token (punctuation): ${e}`);n.push(e)}else n.push(e);if(1!==n.length)throw new Error(`Unexpected stack length at end of parsing: ${n.length}`);if(i.PUNCTUATION.includes(n[0]))throw new Error("Unexpected root element.");const s=n[0];if(s instanceof r.TypeFormula)return s;if("string"==typeof s)return new r.TypeFormula(s,[]);throw new Error(`Unexpected item on stack: ${s}`)}tokenizeExpression(e){const t=[];let n="";for(const r of e)this.isPunctuation(r)?(n&&(t.push(n.trim()),n=""),t.push(r)):n+=r;return n&&t.push(n.trim()),t}acquireTypeWithParameters(e){const t=this.acquireTypeParameters(e),n=e.pop();return new r.TypeFormula(n,t.reverse())}acquireTypeParameters(e){const t=[];for(;;){const n=e.pop();if(void 0===n)throw new Error("Badly specified type parameters");if(this.isBeginningOfTypeParameters(n))break;if(n instanceof r.TypeFormula)t.push(n);else{if("string"!=typeof n)throw new Error(`Unexpected type parameter object in stack: ${n}`);t.push(new r.TypeFormula(n,[]))}}return t}isPunctuation(e){return i.PUNCTUATION.includes(e)}isEndOfTypeParameters(e){return e===i.END_TYPE_PARAMETERS}isBeginningOfTypeParameters(e){return e===i.BEGIN_TYPE_PARAMETERS}}t.TypeFormulaParser=i,i.BEGIN_TYPE_PARAMETERS="<",i.END_TYPE_PARAMETERS=">",i.COMMA=",",i.PUNCTUATION=[i.COMMA,i.BEGIN_TYPE_PARAMETERS,i.END_TYPE_PARAMETERS]},1703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;const r=n(236);t.Account=class{constructor(e){this.address=r.Address.empty(),this.nonce=0,this.balance="0",this.address=e}update(e){this.nonce=e.nonce,this.balance=e.balance}incrementNonce(){this.nonce=this.nonce.valueOf()+1}getNonceThenIncrement(){let e=this.nonce;return this.nonce=this.nonce.valueOf()+1,e}toJSON(){return{address:this.address.bech32(),nonce:this.nonce.valueOf(),balance:this.balance.toString()}}}},2969:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(620),t)},620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryRunnerAdapter=void 0;const r=n(236),i=n(3647);t.QueryRunnerAdapter=class{constructor(e){this.networkProvider=e.networkProvider}async runQuery(e){const t={address:r.Address.fromBech32(e.contract),caller:e.caller?r.Address.fromBech32(e.caller):void 0,func:e.function,value:e.value,getEncodedArguments:()=>e.arguments.map((e=>Buffer.from(e).toString("hex")))},n=await this.networkProvider.queryContract(t);return new i.SmartContractQueryResponse({function:e.function,returnCode:n.returnCode.toString(),returnMessage:n.returnMessage,returnDataParts:n.getReturnDataParts()})}}},236:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddressComputer=t.Address=void 0;const o=s(n(9674)),u=a(n(1594)),c=n(6424),l=n(7353),d=s(n(2581)),f=n(8390),h=n(5508),p="0".repeat(16);class g{constructor(e,t){if(!e)return this.publicKey=Buffer.from([]),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(ArrayBuffer.isView(e)){if(32!=e.length)throw new d.ErrAddressCannotCreate(e);return this.publicKey=Buffer.from(e),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp)}if(e instanceof g){if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");return this.publicKey=e.publicKey,void(this.hrp=e.hrp)}if("string"==typeof e){if(g.isValidHex(e))return this.publicKey=Buffer.from(e,"hex"),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");const{hrp:n,pubkey:r}=m({value:e,allowCustomHrp:!1});return this.publicKey=r,void(this.hrp=n)}throw new d.ErrAddressCannotCreate(e)}static newFromBech32(e){const{hrp:t,pubkey:n}=m({value:e,allowCustomHrp:!0});return new g(n,t)}static fromBech32(e){const{hrp:t,pubkey:n}=m({value:e,allowCustomHrp:!1});return new g(n,t)}static newFromHex(e,t){if(!g.isValidHex(e))throw new d.ErrAddressCannotCreate(e);return new g(Buffer.from(e,"hex"),t)}static fromHex(e,t){return g.newFromHex(e,t)}static fromAddress(e){return new g(e)}static fromBuffer(e,t){return new g(e,t)}static fromString(e,t){return new g(e,t)}static isValidHex(e){return 32==Buffer.from(e,"hex").length}static empty(){return new g("")}static isValid(e){const t=o.decodeUnsafe(e),n=t?.prefix,r=t?Buffer.from(o.fromWords(t.words)):void 0;return n===c.LibraryConfig.DefaultAddressHrp&&32===r?.length}hex(){return this.toHex()}toHex(){return this.isEmpty()?"":this.publicKey.toString("hex")}bech32(){return this.toBech32()}toBech32(){if(this.isEmpty())return"";let e=o.toWords(this.pubkey());return o.encode(this.hrp,e)}pubkey(){return this.getPublicKey()}getPublicKey(){return this.publicKey}getHrp(){return this.hrp}isEmpty(){return 0==this.publicKey.length}equals(e){return!!e&&this.publicKey.toString()==e.publicKey.toString()}toString(){return this.toBech32()}toJSON(){return{bech32:this.toBech32(),pubkey:this.toHex()}}static Zero(){return new g("0".repeat(64))}isContractAddress(){return this.isSmartContract()}isSmartContract(){return this.toHex().startsWith(p)}}function m(e){const t=e.value,n=e.allowCustomHrp;let r,i;try{const e=o.decode(t);r=e.prefix,i=Buffer.from(o.fromWords(e.words))}catch(e){throw new d.ErrAddressCannotCreate(t,e)}if(!n&&r!=c.LibraryConfig.DefaultAddressHrp)throw new d.ErrAddressBadHrp(c.LibraryConfig.DefaultAddressHrp,r);return{hrp:r,pubkey:i}}t.Address=g,t.AddressComputer=class{constructor(e){this.numberOfShardsWithoutMeta=e||l.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META}computeContractAddress(e,t){const n=Buffer.alloc(8,0),r=e.getPublicKey(),i=r.slice(30),s=Buffer.alloc(8),a=new u.default(t.toString()),o=f.bigIntToBuffer(a);s.write(o.reverse().toString("hex"),"hex");const c=Buffer.concat([r,s]),d=h("keccak256").update(c).digest(),p=Buffer.from(l.WasmVirtualMachine,"hex"),m=Buffer.concat([n,p,d.slice(10,30),i]);return new g(m)}getShardOfAddress(e){return this.getShardOfPubkey(e.getPublicKey(),this.numberOfShardsWithoutMeta)}getShardOfPubkey(e,t){const n=parseInt("11",2),r=parseInt("01",2),i=e[31];if(this.isPubkeyOfMetachain(e))return l.METACHAIN_ID;let s=i&n;return s>t-1&&(s=i&r),s}isPubkeyOfMetachain(e){const t=Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=Buffer.from(e).slice(0,t.length);return!!t.equals(n)||!!Buffer.alloc(32).equals(Buffer.from(e))}}},5519:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncTimer=void 0;const a=s(n(2581)),o=n(2581),u=n(6458);t.AsyncTimer=class{constructor(e){this.timeoutHandle=null,this.rejectionFunc=null,this.name=e,this.correlationTag=0}start(e){if(this.timeoutHandle)throw new a.ErrAsyncTimerAlreadyRunning;return this.correlationTag++,u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].start()`),new Promise(((t,n)=>{this.rejectionFunc=n,this.timeoutHandle=setTimeout((()=>{this.rejectionFunc=null,this.stop(),t()}),e)}))}abort(){u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].abort()`),this.rejectionFunc&&(this.rejectionFunc(new o.ErrAsyncTimerAborted),this.rejectionFunc=null),this.stop()}stop(){this.isStopped()||(u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].stop()`),this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null))}isStopped(){return!this.timeoutHandle}}},1220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Compatibility=void 0;const r=n(236);t.Compatibility=class{static guardAddressIsSetAndNonZero(e,t,n){e&&""!=e.bech32()?e.bech32()==r.Address.Zero().bech32()&&console.warn(`${t}: address should not be the 'zero' address (also known as the 'contracts deployment address'); ${n}. In the future, this will throw an exception instead of emitting a WARN.`):console.warn(`${t}: address should be set; ${n}. In the future, this will throw an exception instead of emitting a WARN.`)}}},6424:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibraryConfig=void 0;class n{}t.LibraryConfig=n,n.DefaultAddressHrp="erd"},7353:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ESDT_CONTRACT_ADDRESS=t.DELEGATION_MANAGER_SC_ADDRESS=t.CONTRACT_DEPLOY_ADDRESS=t.BECH32_ADDRESS_LENGTH=t.DEFAULT_HRP=t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER=t.UNKNOWN_SIGNER=t.SDK_JS_SIGNER=t.METACHAIN_ID=t.WasmVirtualMachine=t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=t.HEX_TRANSACTION_HASH_LENGTH=t.MESSAGE_PREFIX=t.DEFAULT_MESSAGE_VERSION=t.ESDT_CONTRACT_ADDRESS_HEX=t.DELEGATION_MANAGER_SC_ADDRESS_HEX=t.CONTRACT_DEPLOY_ADDRESS_HEX=t.VM_TYPE_WASM_VM=t.ARGUMENTS_SEPARATOR=t.ESDT_TRANSFER_VALUE=t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_GAS_LIMIT=t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=t.TRANSACTION_VERSION_DEFAULT=t.TRANSACTION_OPTIONS_TX_GUARDED=t.TRANSACTION_OPTIONS_TX_HASH_SIGN=t.TRANSACTION_OPTIONS_DEFAULT=t.TRANSACTION_MIN_GAS_PRICE=void 0,t.TRANSACTION_MIN_GAS_PRICE=1e9,t.TRANSACTION_OPTIONS_DEFAULT=0,t.TRANSACTION_OPTIONS_TX_HASH_SIGN=1,t.TRANSACTION_OPTIONS_TX_GUARDED=2,t.TRANSACTION_VERSION_DEFAULT=2,t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=2,t.ESDT_TRANSFER_GAS_LIMIT=5e5,t.ESDT_TRANSFER_FUNCTION_NAME="ESDTTransfer",t.ESDTNFT_TRANSFER_FUNCTION_NAME="ESDTNFTTransfer",t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME="MultiESDTNFTTransfer",t.ESDT_TRANSFER_VALUE="0",t.ARGUMENTS_SEPARATOR="@",t.VM_TYPE_WASM_VM=new Uint8Array([5,0]),t.CONTRACT_DEPLOY_ADDRESS_HEX="0000000000000000000000000000000000000000000000000000000000000000",t.DELEGATION_MANAGER_SC_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000004ffff",t.ESDT_CONTRACT_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000002ffff",t.DEFAULT_MESSAGE_VERSION=1,t.MESSAGE_PREFIX="Elrond Signed Message:\n",t.HEX_TRANSACTION_HASH_LENGTH=64,t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=3,t.WasmVirtualMachine="0500",t.METACHAIN_ID=4294967295,t.SDK_JS_SIGNER="sdk-js",t.UNKNOWN_SIGNER="unknown",t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER="EGLD-000000",t.DEFAULT_HRP="erd",t.BECH32_ADDRESS_LENGTH=62,t.CONTRACT_DEPLOY_ADDRESS="erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu",t.DELEGATION_MANAGER_SC_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqylllslmq6y6",t.ESDT_CONTRACT_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"},4408:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6659),t)},6659:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsConverter=void 0;const r=n(661),i=n(476),s=n(3217);t.TransactionsConverter=class{transactionToPlainObject(e){return{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data),chainID:e.chainID.valueOf(),version:e.version,options:0==e.options?void 0:e.options,guardian:e.guardian?e.guardian:void 0,signature:this.toHexOrUndefined(e.signature),guardianSignature:this.toHexOrUndefined(e.guardianSignature),relayer:e.relayer?e.relayer:void 0,innerTransactions:e.innerTransactions.length?e.innerTransactions.map((e=>this.transactionToPlainObject(e))):void 0}}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}plainObjectToTransaction(e){return new i.Transaction({nonce:BigInt(e.nonce),value:BigInt(e.value||""),receiver:e.receiver,receiverUsername:this.bufferFromBase64(e.receiverUsername).toString(),sender:e.sender,senderUsername:this.bufferFromBase64(e.senderUsername).toString(),guardian:e.guardian,gasPrice:BigInt(e.gasPrice),gasLimit:BigInt(e.gasLimit),data:this.bufferFromBase64(e.data),chainID:String(e.chainID),version:Number(e.version),options:Number(e.options),signature:this.bufferFromHex(e.signature),guardianSignature:this.bufferFromHex(e.guardianSignature),relayer:e.relayer,innerTransactions:e.innerTransactions?e.innerTransactions.map((e=>this.plainObjectToTransaction(e))):void 0})}bufferFromBase64(e){return Buffer.from(e||"","base64")}bufferFromHex(e){return Buffer.from(e||"","hex")}transactionOnNetworkToOutcome(e){const t=(new r.ResultsParser).parseUntypedOutcome(e),n=new s.SmartContractCallOutcome({function:e.function,returnCode:t.returnCode.toString(),returnMessage:t.returnMessage,returnDataParts:t.values}),i=e.contractResults.items.map((e=>this.smartContractResultOnNetworkToSmartContractResult(e))),a=new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))});return new s.TransactionOutcome({logs:a,smartContractResults:i,directSmartContractCallOutcome:n})}smartContractResultOnNetworkToSmartContractResult(e){return new s.SmartContractResult({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:Buffer.from(e.data),logs:new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))})})}eventOnNetworkToEvent(e){const t=e.dataPayload?.valueOf()||Buffer.from(e.data||""),n=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===n.length&&t.length&&n.push(Buffer.from(t)),new s.TransactionEvent({address:e.address.bech32(),identifier:e.identifier,topics:e.topics.map((e=>Buffer.from(e.hex(),"hex"))),dataItems:n})}}},2581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrSmartContractQuery=t.ErrParseTransactionOutcome=t.ErrInvalidInnerTransaction=t.ErrBadUsage=t.ErrInvalidTokenIdentifier=t.ErrIsCompletedFieldIsMissingOnTransaction=t.ErrGasLimitShouldBe0ForInnerTransaction=t.ErrInvalidRelayedV2BuilderArguments=t.ErrInvalidRelayedV1BuilderArguments=t.ErrNotImplemented=t.ErrContractInteraction=t.ErrCodec=t.ErrCannotParseTransactionOutcome=t.ErrCannotParseContractResults=t.ErrMissingFieldOnEnum=t.ErrMissingFieldOnStruct=t.ErrTypingSystem=t.ErrMock=t.ErrContractHasNoAddress=t.ErrContract=t.ErrExpectedTransactionEventsNotFound=t.ErrExpectedTransactionStatusNotReached=t.ErrTransactionWatcherTimeout=t.ErrAsyncTimerAborted=t.ErrAsyncTimerAlreadyRunning=t.ErrInvalidFunctionName=t.ErrSignatureCannotCreate=t.ErrTransactionOptionsInvalid=t.ErrTransactionVersionInvalid=t.ErrNonceInvalid=t.ErrNotEnoughGas=t.ErrAddressEmpty=t.ErrAddressBadHrp=t.ErrAddressCannotCreate=t.ErrUnexpectedCondition=t.ErrInvariantFailed=t.ErrBadType=t.ErrUnsupportedOperation=t.ErrInvalidArgument=t.Err=void 0;class n extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}summary(){let e=[];e.push({name:this.name,message:this.message});let t=this.inner;for(;t;)e.push({name:t.name,message:t.message}),t=t.inner;return e}}t.Err=n,t.ErrInvalidArgument=class extends n{constructor(e,t){super(`Invalid argument: ${e}`,t)}},t.ErrUnsupportedOperation=class extends n{constructor(e,t="not specified"){super(`Operation "${e}" not supported. Reason: ${t}`)}},t.ErrBadType=class extends n{constructor(e,t,n){super(`Bad type of "${e}": ${n}. Expected type: ${t}`)}},t.ErrInvariantFailed=class extends n{constructor(e){super(`Invariant failed: [${e}]`)}},t.ErrUnexpectedCondition=class extends n{constructor(e){super(`Unexpected condition: [${e}]`)}},t.ErrAddressCannotCreate=class extends n{constructor(e,t){super(`Cannot create address from: ${e}`,t)}},t.ErrAddressBadHrp=class extends n{constructor(e,t){super(`Wrong address HRP. Expected: ${e}, got ${t}`)}},t.ErrAddressEmpty=class extends n{constructor(){super("Address is empty")}},t.ErrNotEnoughGas=class extends n{constructor(e){super(`Not enough gas provided: ${e}`)}},t.ErrNonceInvalid=class extends n{constructor(e){super(`Invalid nonce: ${e}`)}},t.ErrTransactionVersionInvalid=class extends n{constructor(e){super(`Invalid transaction version: ${e}`)}},t.ErrTransactionOptionsInvalid=class extends n{constructor(e){super(`Invalid transaction options: ${e}`)}},t.ErrSignatureCannotCreate=class extends n{constructor(e,t){super(`Cannot create signature from: ${e}`,t)}},t.ErrInvalidFunctionName=class extends n{constructor(){super("Invalid function name")}},t.ErrAsyncTimerAlreadyRunning=class extends n{constructor(){super("Async timer already running")}},t.ErrAsyncTimerAborted=class extends n{constructor(){super("Async timer aborted")}},t.ErrTransactionWatcherTimeout=class extends n{constructor(){super("TransactionWatcher has timed out")}},t.ErrExpectedTransactionStatusNotReached=class extends n{constructor(){super("Expected transaction status not reached")}},t.ErrExpectedTransactionEventsNotFound=class extends n{constructor(){super("Expected transaction events not found")}};class r extends n{constructor(e){super(e)}}t.ErrContract=r,t.ErrContractHasNoAddress=class extends r{constructor(){super("\nThe smart contract has no address set. Make sure you provide the address in the constructor, or call setAddress() appropriately.\nIf you need to recompute the address of the contract, make use of SmartContract.computeAddress() (static method). \n")}},t.ErrMock=class extends n{constructor(e){super(e)}},t.ErrTypingSystem=class extends n{constructor(e){super(e)}},t.ErrMissingFieldOnStruct=class extends n{constructor(e,t){super(`field ${e} does not exist on struct ${t}`)}},t.ErrMissingFieldOnEnum=class extends n{constructor(e,t){super(`field ${e} does not exist on enum ${t}`)}},t.ErrCannotParseContractResults=class extends n{constructor(e){super(`cannot parse contract results: ${e}`)}},t.ErrCannotParseTransactionOutcome=class extends n{constructor(e,t){super(`cannot parse outcome of transaction ${e}: ${t}`)}},t.ErrCodec=class extends n{constructor(e){super(e)}},t.ErrContractInteraction=class extends n{constructor(e){super(e)}},t.ErrNotImplemented=class extends n{constructor(){super("Method not yet implemented")}},t.ErrInvalidRelayedV1BuilderArguments=class extends n{constructor(){super("invalid arguments for relayed v1 builder")}},t.ErrInvalidRelayedV2BuilderArguments=class extends n{constructor(){super("invalid arguments for relayed v2 builder")}},t.ErrGasLimitShouldBe0ForInnerTransaction=class extends n{constructor(){super("gas limit must be 0 for the inner transaction for relayed v2")}},t.ErrIsCompletedFieldIsMissingOnTransaction=class extends n{constructor(){super("The transaction watcher requires the `isCompleted` property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's `ProxyNetworkProvider.getTransaction()` and in that case you should also pass `withProcessStatus=true`.")}},t.ErrInvalidTokenIdentifier=class extends n{constructor(e){super(e)}},t.ErrBadUsage=class extends n{constructor(e){super(e)}},t.ErrInvalidInnerTransaction=class extends n{constructor(e){super(e)}},t.ErrParseTransactionOutcome=class extends n{constructor(e){super(e)}},t.ErrSmartContractQuery=class extends n{constructor(e,t){super(t),this.returnCode=e}}},523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GasEstimator=t.DefaultGasConfiguration=void 0,t.DefaultGasConfiguration={minGasLimit:5e4,gasPerDataByte:1500,gasCostESDTTransfer:2e5,gasCostESDTNFTTransfer:2e5,gasCostESDTNFTMultiTransfer:2e5};const n=8e5;t.GasEstimator=class{constructor(e){this.gasConfiguration=e||t.DefaultGasConfiguration}forEGLDTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasPerDataByte*e}forESDTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTTransfer+this.gasConfiguration.gasPerDataByte*e+1e5}forESDTNFTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTNFTTransfer+this.gasConfiguration.gasPerDataByte*e+n}forMultiESDTNFTTransfer(e,t){return this.gasConfiguration.minGasLimit+(this.gasConfiguration.gasCostESDTNFTMultiTransfer+n)*t+this.gasConfiguration.gasPerDataByte*e}}},1944:(e,t,n)=>{"use strict";n.g.Buffer||(n.g.Buffer=n(8287).Buffer)},9342:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;const a=s(n(2581));class o{constructor(e){if(e)if(e instanceof Buffer)this.hash=e;else{if("string"!=typeof e)throw new a.ErrBadType("hash","buffer | string",e);this.hash=Buffer.from(e,"hex")}else this.hash=Buffer.from([])}static empty(){return new o(Buffer.from([]))}isEmpty(){return 0==this.hash.length}toString(){return this.hex()}hex(){return this.hash.toString("hex")}valueOf(){return this.hash}}t.Hash=o},4820:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(1944),i(n(1703),t),i(n(2969),t),i(n(236),t),i(n(5519),t),i(n(6424),t),i(n(4408),t),i(n(2581),t),i(n(523),t),i(n(8979),t),i(n(8622),t),i(n(6458),t),i(n(1212),t),i(n(3500),t),i(n(7376),t),i(n(207),t),i(n(3508),t),i(n(5003),t),i(n(661),t),i(n(3856),t),i(n(5132),t),i(n(476),t),i(n(9825),t),i(n(3548),t),i(n(4650),t),i(n(3102),t),i(n(4476),t),i(n(1069),t)},8979:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6458:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.None=5]="None"}(n=t.LogLevel||(t.LogLevel={}));class r{static setLevel(e){r.logLevel=e}static trace(e,...t){r.logLevel>=n.Debug||console.debug(e,t)}static debug(e,...t){r.logLevel>=n.Debug||console.debug(e,t)}static info(e,...t){r.logLevel>=n.Info||console.log(e,t)}static warn(e,...t){r.logLevel>=n.Warn||console.warn(e,t)}static error(e,...t){r.logLevel>=n.Error||console.error(e,t)}}t.Logger=r,r.logLevel=n.Debug},1212:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageComputer=t.Message=void 0;const r=n(7353),i=n(236),s=n(5508);class a{constructor(e){this.data=e.data,this.signature=e.signature,this.address=e.address,this.version=e.version||r.DEFAULT_MESSAGE_VERSION,this.signer=e.signer||r.SDK_JS_SIGNER}}t.Message=a,t.MessageComputer=class{constructor(){}computeBytesForSigning(e){const t=Buffer.from(e.data.length.toString()),n=Buffer.concat([t,e.data]);let i=Buffer.concat([Buffer.from(r.MESSAGE_PREFIX),n]);return s("keccak256").update(i).digest()}computeBytesForVerifying(e){return this.computeBytesForSigning(e)}packMessage(e){return{message:Buffer.from(e.data).toString("hex"),signature:e.signature?Buffer.from(e.signature).toString("hex"):"",address:e.address?e.address.bech32():"",version:e.version,signer:e.signer}}unpackMessage(e){const t=this.trimHexPrefix(e.message),n=Buffer.from(t,"hex"),s=this.trimHexPrefix(e.signature||""),o=Buffer.from(s,"hex");let u;e.address&&(u=i.Address.fromBech32(e.address));const c=e.version||r.DEFAULT_MESSAGE_VERSION,l=e.signer||r.UNKNOWN_SIGNER;return new a({data:n,signature:o,address:u,version:c,signer:l})}trimHexPrefix(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e}}},3500:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOptions=t.TransactionVersion=void 0;const a=n(7353),o=s(n(2581));class u{constructor(e){if((e=Number(e))<1)throw new o.ErrTransactionVersionInvalid(e);this.value=e}static withDefaultVersion(){return new u(a.TRANSACTION_VERSION_DEFAULT)}static withTxOptions(){return new u(a.TRANSACTION_VERSION_DEFAULT)}valueOf(){return this.value}}t.TransactionVersion=u;class c{constructor(e){if((e=Number(e))<0)throw new o.ErrTransactionOptionsInvalid(e);this.value=e}static withDefaultOptions(){return new c(a.TRANSACTION_OPTIONS_DEFAULT)}static withOptions(e){let t=0;return e.hashSign&&(t|=a.TRANSACTION_OPTIONS_TX_HASH_SIGN),e.guarded&&(t|=a.TRANSACTION_OPTIONS_TX_GUARDED),new c(t)}isWithHashSign(){return(this.value&a.TRANSACTION_OPTIONS_TX_HASH_SIGN)==a.TRANSACTION_OPTIONS_TX_HASH_SIGN}isWithGuardian(){return(this.value&a.TRANSACTION_OPTIONS_TX_GUARDED)==a.TRANSACTION_OPTIONS_TX_GUARDED}setWithHashSign(){this.value|=a.TRANSACTION_OPTIONS_TX_HASH_SIGN}setWithGuardian(){this.value|=a.TRANSACTION_OPTIONS_TX_GUARDED}valueOf(){return this.value}}t.TransactionOptions=c},4330:function(e,t,n){"use strict";var r,i,s;i=[n(6946)],void 0===(s="function"==typeof(r=function(e){var t,n=e.Reader,r=e.Writer,i=e.util,s=e.roots.default||(e.roots.default={});return s.proto=((t={}).Transaction=function(){function t(e){if(this.InnerTransactions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.Nonce=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Value=i.newBuffer([]),t.prototype.RcvAddr=i.newBuffer([]),t.prototype.RcvUserName=i.newBuffer([]),t.prototype.SndAddr=i.newBuffer([]),t.prototype.SndUserName=i.newBuffer([]),t.prototype.GasPrice=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.GasLimit=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Data=i.newBuffer([]),t.prototype.ChainID=i.newBuffer([]),t.prototype.Version=0,t.prototype.Signature=i.newBuffer([]),t.prototype.Options=0,t.prototype.GuardianAddr=i.newBuffer([]),t.prototype.GuardianSignature=i.newBuffer([]),t.prototype.Relayer=i.newBuffer([]),t.prototype.InnerTransactions=i.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=r.create()),null!=e.Nonce&&Object.hasOwnProperty.call(e,"Nonce")&&t.uint32(8).uint64(e.Nonce),null!=e.Value&&Object.hasOwnProperty.call(e,"Value")&&t.uint32(18).bytes(e.Value),null!=e.RcvAddr&&Object.hasOwnProperty.call(e,"RcvAddr")&&t.uint32(26).bytes(e.RcvAddr),null!=e.RcvUserName&&Object.hasOwnProperty.call(e,"RcvUserName")&&t.uint32(34).bytes(e.RcvUserName),null!=e.SndAddr&&Object.hasOwnProperty.call(e,"SndAddr")&&t.uint32(42).bytes(e.SndAddr),null!=e.SndUserName&&Object.hasOwnProperty.call(e,"SndUserName")&&t.uint32(50).bytes(e.SndUserName),null!=e.GasPrice&&Object.hasOwnProperty.call(e,"GasPrice")&&t.uint32(56).uint64(e.GasPrice),null!=e.GasLimit&&Object.hasOwnProperty.call(e,"GasLimit")&&t.uint32(64).uint64(e.GasLimit),null!=e.Data&&Object.hasOwnProperty.call(e,"Data")&&t.uint32(74).bytes(e.Data),null!=e.ChainID&&Object.hasOwnProperty.call(e,"ChainID")&&t.uint32(82).bytes(e.ChainID),null!=e.Version&&Object.hasOwnProperty.call(e,"Version")&&t.uint32(88).uint32(e.Version),null!=e.Signature&&Object.hasOwnProperty.call(e,"Signature")&&t.uint32(98).bytes(e.Signature),null!=e.Options&&Object.hasOwnProperty.call(e,"Options")&&t.uint32(104).uint32(e.Options),null!=e.GuardianAddr&&Object.hasOwnProperty.call(e,"GuardianAddr")&&t.uint32(114).bytes(e.GuardianAddr),null!=e.GuardianSignature&&Object.hasOwnProperty.call(e,"GuardianSignature")&&t.uint32(122).bytes(e.GuardianSignature),null!=e.Relayer&&Object.hasOwnProperty.call(e,"Relayer")&&t.uint32(130).bytes(e.Relayer),null!=e.InnerTransactions&&e.InnerTransactions.length)for(var n=0;n<e.InnerTransactions.length;++n)s.proto.Transaction.encode(e.InnerTransactions[n],t.uint32(138).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof n||(e=n.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new s.proto.Transaction;e.pos<r;){var a=e.uint32();switch(a>>>3){case 1:i.Nonce=e.uint64();break;case 2:i.Value=e.bytes();break;case 3:i.RcvAddr=e.bytes();break;case 4:i.RcvUserName=e.bytes();break;case 5:i.SndAddr=e.bytes();break;case 6:i.SndUserName=e.bytes();break;case 7:i.GasPrice=e.uint64();break;case 8:i.GasLimit=e.uint64();break;case 9:i.Data=e.bytes();break;case 10:i.ChainID=e.bytes();break;case 11:i.Version=e.uint32();break;case 12:i.Signature=e.bytes();break;case 13:i.Options=e.uint32();break;case 14:i.GuardianAddr=e.bytes();break;case 15:i.GuardianSignature=e.bytes();break;case 16:i.Relayer=e.bytes();break;case 17:i.InnerTransactions&&i.InnerTransactions.length||(i.InnerTransactions=[]),i.InnerTransactions.push(s.proto.Transaction.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},t.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.Nonce&&e.hasOwnProperty("Nonce")&&!(i.isInteger(e.Nonce)||e.Nonce&&i.isInteger(e.Nonce.low)&&i.isInteger(e.Nonce.high)))return"Nonce: integer|Long expected";if(null!=e.Value&&e.hasOwnProperty("Value")&&!(e.Value&&"number"==typeof e.Value.length||i.isString(e.Value)))return"Value: buffer expected";if(null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&!(e.RcvAddr&&"number"==typeof e.RcvAddr.length||i.isString(e.RcvAddr)))return"RcvAddr: buffer expected";if(null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&!(e.RcvUserName&&"number"==typeof e.RcvUserName.length||i.isString(e.RcvUserName)))return"RcvUserName: buffer expected";if(null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&!(e.SndAddr&&"number"==typeof e.SndAddr.length||i.isString(e.SndAddr)))return"SndAddr: buffer expected";if(null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&!(e.SndUserName&&"number"==typeof e.SndUserName.length||i.isString(e.SndUserName)))return"SndUserName: buffer expected";if(null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&!(i.isInteger(e.GasPrice)||e.GasPrice&&i.isInteger(e.GasPrice.low)&&i.isInteger(e.GasPrice.high)))return"GasPrice: integer|Long expected";if(null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&!(i.isInteger(e.GasLimit)||e.GasLimit&&i.isInteger(e.GasLimit.low)&&i.isInteger(e.GasLimit.high)))return"GasLimit: integer|Long expected";if(null!=e.Data&&e.hasOwnProperty("Data")&&!(e.Data&&"number"==typeof e.Data.length||i.isString(e.Data)))return"Data: buffer expected";if(null!=e.ChainID&&e.hasOwnProperty("ChainID")&&!(e.ChainID&&"number"==typeof e.ChainID.length||i.isString(e.ChainID)))return"ChainID: buffer expected";if(null!=e.Version&&e.hasOwnProperty("Version")&&!i.isInteger(e.Version))return"Version: integer expected";if(null!=e.Signature&&e.hasOwnProperty("Signature")&&!(e.Signature&&"number"==typeof e.Signature.length||i.isString(e.Signature)))return"Signature: buffer expected";if(null!=e.Options&&e.hasOwnProperty("Options")&&!i.isInteger(e.Options))return"Options: integer expected";if(null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&!(e.GuardianAddr&&"number"==typeof e.GuardianAddr.length||i.isString(e.GuardianAddr)))return"GuardianAddr: buffer expected";if(null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&!(e.GuardianSignature&&"number"==typeof e.GuardianSignature.length||i.isString(e.GuardianSignature)))return"GuardianSignature: buffer expected";if(null!=e.Relayer&&e.hasOwnProperty("Relayer")&&!(e.Relayer&&"number"==typeof e.Relayer.length||i.isString(e.Relayer)))return"Relayer: buffer expected";if(null!=e.InnerTransactions&&e.hasOwnProperty("InnerTransactions")){if(!Array.isArray(e.InnerTransactions))return"InnerTransactions: array expected";for(var t=0;t<e.InnerTransactions.length;++t){var n=s.proto.Transaction.verify(e.InnerTransactions[t]);if(n)return"InnerTransactions."+n}}return null},t.fromObject=function(e){if(e instanceof s.proto.Transaction)return e;var t=new s.proto.Transaction;if(null!=e.Nonce&&(i.Long?(t.Nonce=i.Long.fromValue(e.Nonce)).unsigned=!0:"string"==typeof e.Nonce?t.Nonce=parseInt(e.Nonce,10):"number"==typeof e.Nonce?t.Nonce=e.Nonce:"object"==typeof e.Nonce&&(t.Nonce=new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0))),null!=e.Value&&("string"==typeof e.Value?i.base64.decode(e.Value,t.Value=i.newBuffer(i.base64.length(e.Value)),0):e.Value.length>=0&&(t.Value=e.Value)),null!=e.RcvAddr&&("string"==typeof e.RcvAddr?i.base64.decode(e.RcvAddr,t.RcvAddr=i.newBuffer(i.base64.length(e.RcvAddr)),0):e.RcvAddr.length>=0&&(t.RcvAddr=e.RcvAddr)),null!=e.RcvUserName&&("string"==typeof e.RcvUserName?i.base64.decode(e.RcvUserName,t.RcvUserName=i.newBuffer(i.base64.length(e.RcvUserName)),0):e.RcvUserName.length>=0&&(t.RcvUserName=e.RcvUserName)),null!=e.SndAddr&&("string"==typeof e.SndAddr?i.base64.decode(e.SndAddr,t.SndAddr=i.newBuffer(i.base64.length(e.SndAddr)),0):e.SndAddr.length>=0&&(t.SndAddr=e.SndAddr)),null!=e.SndUserName&&("string"==typeof e.SndUserName?i.base64.decode(e.SndUserName,t.SndUserName=i.newBuffer(i.base64.length(e.SndUserName)),0):e.SndUserName.length>=0&&(t.SndUserName=e.SndUserName)),null!=e.GasPrice&&(i.Long?(t.GasPrice=i.Long.fromValue(e.GasPrice)).unsigned=!0:"string"==typeof e.GasPrice?t.GasPrice=parseInt(e.GasPrice,10):"number"==typeof e.GasPrice?t.GasPrice=e.GasPrice:"object"==typeof e.GasPrice&&(t.GasPrice=new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0))),null!=e.GasLimit&&(i.Long?(t.GasLimit=i.Long.fromValue(e.GasLimit)).unsigned=!0:"string"==typeof e.GasLimit?t.GasLimit=parseInt(e.GasLimit,10):"number"==typeof e.GasLimit?t.GasLimit=e.GasLimit:"object"==typeof e.GasLimit&&(t.GasLimit=new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0))),null!=e.Data&&("string"==typeof e.Data?i.base64.decode(e.Data,t.Data=i.newBuffer(i.base64.length(e.Data)),0):e.Data.length>=0&&(t.Data=e.Data)),null!=e.ChainID&&("string"==typeof e.ChainID?i.base64.decode(e.ChainID,t.ChainID=i.newBuffer(i.base64.length(e.ChainID)),0):e.ChainID.length>=0&&(t.ChainID=e.ChainID)),null!=e.Version&&(t.Version=e.Version>>>0),null!=e.Signature&&("string"==typeof e.Signature?i.base64.decode(e.Signature,t.Signature=i.newBuffer(i.base64.length(e.Signature)),0):e.Signature.length>=0&&(t.Signature=e.Signature)),null!=e.Options&&(t.Options=e.Options>>>0),null!=e.GuardianAddr&&("string"==typeof e.GuardianAddr?i.base64.decode(e.GuardianAddr,t.GuardianAddr=i.newBuffer(i.base64.length(e.GuardianAddr)),0):e.GuardianAddr.length>=0&&(t.GuardianAddr=e.GuardianAddr)),null!=e.GuardianSignature&&("string"==typeof e.GuardianSignature?i.base64.decode(e.GuardianSignature,t.GuardianSignature=i.newBuffer(i.base64.length(e.GuardianSignature)),0):e.GuardianSignature.length>=0&&(t.GuardianSignature=e.GuardianSignature)),null!=e.Relayer&&("string"==typeof e.Relayer?i.base64.decode(e.Relayer,t.Relayer=i.newBuffer(i.base64.length(e.Relayer)),0):e.Relayer.length>=0&&(t.Relayer=e.Relayer)),e.InnerTransactions){if(!Array.isArray(e.InnerTransactions))throw TypeError(".proto.Transaction.InnerTransactions: array expected");t.InnerTransactions=[];for(var n=0;n<e.InnerTransactions.length;++n){if("object"!=typeof e.InnerTransactions[n])throw TypeError(".proto.Transaction.InnerTransactions: object expected");t.InnerTransactions[n]=s.proto.Transaction.fromObject(e.InnerTransactions[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.InnerTransactions=[]),t.defaults){if(i.Long){var r=new i.Long(0,0,!0);n.Nonce=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.Nonce=t.longs===String?"0":0;t.bytes===String?n.Value="":(n.Value=[],t.bytes!==Array&&(n.Value=i.newBuffer(n.Value))),t.bytes===String?n.RcvAddr="":(n.RcvAddr=[],t.bytes!==Array&&(n.RcvAddr=i.newBuffer(n.RcvAddr))),t.bytes===String?n.RcvUserName="":(n.RcvUserName=[],t.bytes!==Array&&(n.RcvUserName=i.newBuffer(n.RcvUserName))),t.bytes===String?n.SndAddr="":(n.SndAddr=[],t.bytes!==Array&&(n.SndAddr=i.newBuffer(n.SndAddr))),t.bytes===String?n.SndUserName="":(n.SndUserName=[],t.bytes!==Array&&(n.SndUserName=i.newBuffer(n.SndUserName))),i.Long?(r=new i.Long(0,0,!0),n.GasPrice=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.GasPrice=t.longs===String?"0":0,i.Long?(r=new i.Long(0,0,!0),n.GasLimit=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.GasLimit=t.longs===String?"0":0,t.bytes===String?n.Data="":(n.Data=[],t.bytes!==Array&&(n.Data=i.newBuffer(n.Data))),t.bytes===String?n.ChainID="":(n.ChainID=[],t.bytes!==Array&&(n.ChainID=i.newBuffer(n.ChainID))),n.Version=0,t.bytes===String?n.Signature="":(n.Signature=[],t.bytes!==Array&&(n.Signature=i.newBuffer(n.Signature))),n.Options=0,t.bytes===String?n.GuardianAddr="":(n.GuardianAddr=[],t.bytes!==Array&&(n.GuardianAddr=i.newBuffer(n.GuardianAddr))),t.bytes===String?n.GuardianSignature="":(n.GuardianSignature=[],t.bytes!==Array&&(n.GuardianSignature=i.newBuffer(n.GuardianSignature))),t.bytes===String?n.Relayer="":(n.Relayer=[],t.bytes!==Array&&(n.Relayer=i.newBuffer(n.Relayer)))}if(null!=e.Nonce&&e.hasOwnProperty("Nonce")&&("number"==typeof e.Nonce?n.Nonce=t.longs===String?String(e.Nonce):e.Nonce:n.Nonce=t.longs===String?i.Long.prototype.toString.call(e.Nonce):t.longs===Number?new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0):e.Nonce),null!=e.Value&&e.hasOwnProperty("Value")&&(n.Value=t.bytes===String?i.base64.encode(e.Value,0,e.Value.length):t.bytes===Array?Array.prototype.slice.call(e.Value):e.Value),null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&(n.RcvAddr=t.bytes===String?i.base64.encode(e.RcvAddr,0,e.RcvAddr.length):t.bytes===Array?Array.prototype.slice.call(e.RcvAddr):e.RcvAddr),null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&(n.RcvUserName=t.bytes===String?i.base64.encode(e.RcvUserName,0,e.RcvUserName.length):t.bytes===Array?Array.prototype.slice.call(e.RcvUserName):e.RcvUserName),null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&(n.SndAddr=t.bytes===String?i.base64.encode(e.SndAddr,0,e.SndAddr.length):t.bytes===Array?Array.prototype.slice.call(e.SndAddr):e.SndAddr),null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&(n.SndUserName=t.bytes===String?i.base64.encode(e.SndUserName,0,e.SndUserName.length):t.bytes===Array?Array.prototype.slice.call(e.SndUserName):e.SndUserName),null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&("number"==typeof e.GasPrice?n.GasPrice=t.longs===String?String(e.GasPrice):e.GasPrice:n.GasPrice=t.longs===String?i.Long.prototype.toString.call(e.GasPrice):t.longs===Number?new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0):e.GasPrice),null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&("number"==typeof e.GasLimit?n.GasLimit=t.longs===String?String(e.GasLimit):e.GasLimit:n.GasLimit=t.longs===String?i.Long.prototype.toString.call(e.GasLimit):t.longs===Number?new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0):e.GasLimit),null!=e.Data&&e.hasOwnProperty("Data")&&(n.Data=t.bytes===String?i.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.ChainID&&e.hasOwnProperty("ChainID")&&(n.ChainID=t.bytes===String?i.base64.encode(e.ChainID,0,e.ChainID.length):t.bytes===Array?Array.prototype.slice.call(e.ChainID):e.ChainID),null!=e.Version&&e.hasOwnProperty("Version")&&(n.Version=e.Version),null!=e.Signature&&e.hasOwnProperty("Signature")&&(n.Signature=t.bytes===String?i.base64.encode(e.Signature,0,e.Signature.length):t.bytes===Array?Array.prototype.slice.call(e.Signature):e.Signature),null!=e.Options&&e.hasOwnProperty("Options")&&(n.Options=e.Options),null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&(n.GuardianAddr=t.bytes===String?i.base64.encode(e.GuardianAddr,0,e.GuardianAddr.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianAddr):e.GuardianAddr),null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&(n.GuardianSignature=t.bytes===String?i.base64.encode(e.GuardianSignature,0,e.GuardianSignature.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianSignature):e.GuardianSignature),null!=e.Relayer&&e.hasOwnProperty("Relayer")&&(n.Relayer=t.bytes===String?i.base64.encode(e.Relayer,0,e.Relayer.length):t.bytes===Array?Array.prototype.slice.call(e.Relayer):e.Relayer),e.InnerTransactions&&e.InnerTransactions.length){n.InnerTransactions=[];for(var a=0;a<e.InnerTransactions.length;++a)n.InnerTransactions[a]=s.proto.Transaction.toObject(e.InnerTransactions[a],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Transaction"},t}(),t),s})?r.apply(t,i):r)||(e.exports=s)},9277:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3325),t)},3325:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoSerializer=void 0;const o=a(n(1594)),u=n(236),c=n(7353),l=s(n(2581)),d=n(7553);t.ProtoSerializer=class{serializeTransaction(e){const t=n(4330).proto,r=this.convertToProtoMessage(e),i=t.Transaction.encode(r).finish();return Buffer.from(i)}convertToProtoMessage(e){const t=n(4330).proto,r=new u.Address(e.receiver).getPublicKey(),i=new u.Address(e.sender).getPublicKey();let s=new t.Transaction({Nonce:Number(e.nonce)?Number(e.nonce):void 0,Value:this.serializeTransactionValue(e.value),RcvAddr:r,RcvUserName:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0,SndAddr:i,SndUserName:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,GasPrice:Number(e.gasPrice),GasLimit:Number(e.gasLimit),Data:0==e.data.length?null:e.data,ChainID:Buffer.from(e.chainID),Version:e.version,Signature:e.signature});return e.options!==c.TRANSACTION_OPTIONS_DEFAULT&&(s.Options=e.options),this.isGuardedTransaction(e)&&(s.GuardianAddr=new u.Address(e.guardian).getPublicKey(),s.GuardianSignature=e.guardianSignature),e.relayer&&(s.Relayer=new u.Address(e.relayer).getPublicKey()),s.InnerTransactions=e.innerTransactions.map((e=>this.convertToProtoMessage(e))),s}serializeTransactionValue(e){let t=new o.default(e.toString());if(t.isZero())return Buffer.from([0,0]);let n=d.bigIntToBuffer(t);return n=Buffer.concat([Buffer.from([0]),n]),n}isGuardedTransaction(e){const t=e.guardian.length>0,n=e.guardianSignature.length>0;return this.isWithGuardian(e)&&t&&n}isWithGuardian(e){return(e.options&c.TRANSACTION_OPTIONS_TX_GUARDED)==c.TRANSACTION_OPTIONS_TX_GUARDED}deserializeTransaction(e){throw new l.ErrUnsupportedOperation("deserializeTransaction")}}},6063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJavascriptPrototypesInHierarchy=void 0,t.getJavascriptPrototypesInHierarchy=function(e,t){let n=[],r=Object.getPrototypeOf(e);for(;r&&t(r);)n.push(r),r=Object.getPrototypeOf(r);return n}},7376:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionV1Builder=void 0;const r=n(236),i=n(2581),s=n(476),a=n(3548),o=n(1013);t.RelayedTransactionV1Builder=class{setInnerTransaction(e){return this.innerTransaction=e,this}setNetworkConfig(e){return this.netConfig=e,this}setRelayerAddress(e){return this.relayerAddress=e,this}setRelayerNonce(e){return this.relayerNonce=e,this}setRelayedTransactionVersion(e){return this.relayedTransactionVersion=e,this}setRelayedTransactionOptions(e){return this.relayedTransactionOptions=e,this}setRelayedTransactionGuardian(e){return this.relayedTransactionGuardian=e,this}build(){if(!(this.innerTransaction&&this.netConfig&&this.relayerAddress&&this.innerTransaction.getSignature()))throw new i.ErrInvalidRelayedV1BuilderArguments;const e=this.prepareInnerTransaction(),t=`relayedTx@${Buffer.from(e).toString("hex")}`,n=new a.TransactionPayload(t),r=this.netConfig.MinGasLimit+this.netConfig.GasPerDataByte*n.length()+this.innerTransaction.getGasLimit().valueOf();let o=new s.Transaction({nonce:this.relayerNonce,sender:this.relayerAddress,receiver:this.innerTransaction.getSender(),value:0,gasLimit:r,data:n,chainID:this.netConfig.ChainID,version:this.relayedTransactionVersion,options:this.relayedTransactionOptions,guardian:this.relayedTransactionGuardian});return this.relayerNonce&&o.setNonce(this.relayerNonce),o}prepareInnerTransaction(){if(!this.innerTransaction)return"";const e={nonce:this.innerTransaction.getNonce().valueOf(),sender:new r.Address(this.innerTransaction.getSender().bech32()).pubkey().toString("base64"),receiver:new r.Address(this.innerTransaction.getReceiver().bech32()).pubkey().toString("base64"),value:BigInt(this.innerTransaction.getValue().toString()),gasPrice:this.innerTransaction.getGasPrice().valueOf(),gasLimit:this.innerTransaction.getGasLimit().valueOf(),data:this.innerTransaction.getData().valueOf().toString("base64"),signature:this.innerTransaction.getSignature().toString("base64"),chainID:Buffer.from(this.innerTransaction.getChainID().valueOf()).toString("base64"),version:this.innerTransaction.getVersion().valueOf(),options:0==this.innerTransaction.getOptions().valueOf()?void 0:this.innerTransaction.getOptions().valueOf(),guardian:this.innerTransaction.getGuardian().bech32()?new r.Address(this.innerTransaction.getGuardian().bech32()).pubkey().toString("base64"):void 0,guardianSignature:this.innerTransaction.getGuardianSignature().toString("hex")?this.innerTransaction.getGuardianSignature().toString("base64"):void 0,sndUserName:this.innerTransaction.getSenderUsername()?Buffer.from(this.innerTransaction.getSenderUsername()).toString("base64"):void 0,rcvUserName:this.innerTransaction.getReceiverUsername()?Buffer.from(this.innerTransaction.getReceiverUsername()).toString("base64"):void 0};return o.stringify(e)}}},207:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionV2Builder=void 0;const r=n(2581),i=n(661),s=n(476),a=n(3548);t.RelayedTransactionV2Builder=class{setInnerTransaction(e){return this.innerTransaction=e,this}setInnerTransactionGasLimit(e){return this.innerTransactionGasLimit=e,this}setNetworkConfig(e){return this.netConfig=e,this}setRelayerAddress(e){return this.relayerAddress=e,this}setRelayerNonce(e){return this.relayerNonce=e,this}build(){if(!(this.innerTransaction&&this.innerTransactionGasLimit&&this.relayerAddress&&this.netConfig&&this.innerTransaction.getSignature()))throw new r.ErrInvalidRelayedV2BuilderArguments;if(0!=this.innerTransaction.getGasLimit())throw new r.ErrGasLimitShouldBe0ForInnerTransaction;const{argumentsString:e}=(new i.ArgSerializer).valuesToString([new i.AddressValue(this.innerTransaction.getReceiver()),new i.U64Value(this.innerTransaction.getNonce().valueOf()),new i.BytesValue(this.innerTransaction.getData().valueOf()),new i.BytesValue(this.innerTransaction.getSignature())]),t=`relayedTxV2@${e}`,n=new a.TransactionPayload(t);let o=new s.Transaction({sender:this.relayerAddress,receiver:this.innerTransaction.getSender(),value:0,gasLimit:this.innerTransactionGasLimit.valueOf()+this.netConfig.MinGasLimit+this.netConfig.GasPerDataByte*n.length(),data:n,chainID:this.netConfig.ChainID,version:this.innerTransaction.getVersion(),options:this.innerTransaction.getOptions()});return this.relayerNonce&&o.setNonce(this.relayerNonce),o}}},3508:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignableMessage=void 0;const r=n(236),i=n(9874),s=n(7353),a=n(5508);t.SignableMessage=class{constructor(e){this.message=Buffer.from([]),this.signature=Buffer.from([]),this.version=1,this.signer="ErdJS",this.address=r.Address.empty(),Object.assign(this,e)}serializeForSigning(){const e=Buffer.from(this.message.length.toString()),t=Buffer.concat([e,this.message]);let n=Buffer.concat([Buffer.from(s.MESSAGE_PREFIX),t]);return a("keccak256").update(n).digest()}serializeForSigningRaw(){return Buffer.concat([this.getMessageSize(),this.message])}getSignature(){return this.signature}applySignature(e){this.signature=i.interpretSignatureAsBuffer(e)}getMessageSize(){const e=Buffer.alloc(4);return e.writeUInt32BE(this.message.length,0),e}toJSON(){return{address:this.address.bech32(),message:"0x"+this.message.toString("hex"),signature:"0x"+this.signature.toString("hex"),version:this.version,signer:this.signer}}}},9874:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.interpretSignatureAsBuffer=t.Signature=void 0;const a=s(n(2581));class o{constructor(e){if(this.valueHex="",e)return"string"==typeof e?o.fromHex(e):e instanceof Buffer?o.fromBuffer(e):void 0}static empty(){return new o}static fromHex(e){if(e.startsWith("0x")&&(e=e.slice(2)),!o.isValidHex(e))throw new a.ErrSignatureCannotCreate(e);return o.fromValidHex(e)}static isValidHex(e){return 64==Buffer.from(e,"hex").length}static fromValidHex(e){let t=new o;return t.valueHex=e,t}static fromBuffer(e){if(64!=e.length)throw new a.ErrSignatureCannotCreate(e);return o.fromValidHex(e.toString("hex"))}hex(){return this.valueHex}}t.Signature=o,t.interpretSignatureAsBuffer=function(e){if(ArrayBuffer.isView(e))return Buffer.from(e);if(null!=e.hex)return Buffer.from(e.hex(),"hex");throw new Error(`Object cannot be interpreted as a signature: ${e}`)}},5003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractQueriesController=void 0;const r=n(2581),i=n(3647),s=n(661),a=n(2747);t.SmartContractQueriesController=class{constructor(e){this.abi=e.abi,this.queryRunner=e.queryRunner,this.legacyResultsParser=new s.ResultsParser}async query(e){const t=this.createQuery(e),n=await this.runQuery(t);return this.raiseForStatus(n),this.parseQueryResponse(n)}raiseForStatus(e){if("ok"!==e.returnCode)throw new r.ErrSmartContractQuery(e.returnCode,e.returnMessage)}createQuery(e){const t=this.encodeArguments(e.function,e.arguments);return new i.SmartContractQuery({contract:e.contract,caller:e.caller,function:e.function,arguments:t,value:e.value})}encodeArguments(e,t){const n=this.abi?.getEndpoint(e);if(n){const e=s.NativeSerializer.nativeToTypedValues(t,n);return(new s.ArgSerializer).valuesToBuffers(e)}if(this.areArgsOfTypedValue(t))return(new s.ArgSerializer).valuesToBuffers(t);if(this.areArgsBuffers(t))return t.map((e=>Buffer.from(e)));throw new r.Err("cannot encode arguments: when ABI is not available, they must be either typed values or buffers")}areArgsOfTypedValue(e){return e.every((e=>a.isTyped(e)))}areArgsBuffers(e){for(const t of e)if(!ArrayBuffer.isView(t))return!1;return!0}async runQuery(e){return await this.queryRunner.runQuery(e)}parseQueryResponse(e){if(!this.abi)return e.returnDataParts;const t={returnCode:e.returnCode,returnMessage:e.returnMessage,getReturnDataParts:()=>e.returnDataParts.map((e=>Buffer.from(e)))},n=e.function,r=this.abi.getEndpoint(n);return this.legacyResultsParser.parseQueryResponse(t,r).values.map((e=>e.valueOf()))}}},3647:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractQueryResponse=t.SmartContractQuery=void 0,t.SmartContractQuery=class{constructor(e){this.contract=e.contract,this.caller=e.caller,this.value=e.value,this.function=e.function,this.arguments=e.arguments}},t.SmartContractQueryResponse=class{constructor(e){this.function=e.function,this.returnCode=e.returnCode,this.returnMessage=e.returnMessage,this.returnDataParts=e.returnDataParts}}},1157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgSerializer=void 0;const r=n(7353),i=n(9272),s=n(2747),a=n(1055),o=n(7472),u=n(6054),c={codec:new i.BinaryCodec};t.ArgSerializer=class{constructor(e){e={...c,...e},this.codec=e.codec}stringToValues(e,t){let n=this.stringToBuffers(e);return this.buffersToValues(n,t)}stringToBuffers(e){return e.split(r.ARGUMENTS_SEPARATOR).map((e=>Buffer.from(e,"hex")))}buffersToValues(e,t){const n=this;let r=[],i=0,c=(e=e||[]).length;for(let e=0;e<t.length;e++){let n=l(t[e].type);r.push(n)}function l(t){if(t.hasExactClass(a.OptionalType.ClassName)){const e=l(t.getFirstTypeParameter());return new a.OptionalValue(t,e)}if(t.hasExactClass(u.VariadicType.ClassName))return function(e){const t=e,n=[];if(t.isCounted){const t=l(new s.U32Type).valueOf().toNumber();for(let r=0;r<t;r++)n.push(l(e.getFirstTypeParameter()))}else for(;!d();)n.push(l(e.getFirstTypeParameter()));return new u.VariadicValue(t,n)}(t);if(t.hasExactClass(o.CompositeType.ClassName)){const e=[];for(const n of t.getTypeParameters())e.push(l(n));return new o.CompositeValue(t,e)}const r=function(t){if(d())return null;let r=e[i++];return n.codec.decodeTopLevel(r,t)}(t);return r}function d(){return i>=c}return r}valuesToString(e){let t=this.valuesToStrings(e);return{argumentsString:t.join(r.ARGUMENTS_SEPARATOR),count:t.length}}valuesToStrings(e){return this.valuesToBuffers(e).map((e=>e.toString("hex")))}valuesToBuffers(e){const t=this,n=[];for(const t of e)r(t);function r(e){if(e.hasExactClass(a.OptionalValue.ClassName)){const t=e;return void(t.isSet()&&r(t.getTypedValue()))}if(e.hasExactClass(u.VariadicValue.ClassName))return void function(e){if(e.getType().isCounted){const r=new s.U32Value(e.getItems().length);n.push(t.codec.encodeTopLevel(r))}for(const t of e.getItems())r(t)}(e);if(e.hasExactClass(o.CompositeValue.ClassName)){const t=e;for(const e of t.getItems())r(e);return}const i=t.codec.encodeTopLevel(e);n.push(i)}return n}}},6147:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentErrorContext=void 0;const r=n(2581);t.ArgumentErrorContext=class{constructor(e,t,n){this.endpointName=e,this.argumentIndex=t,this.parameterDefinition=n}throwError(e){throw new r.ErrInvalidArgument(`Error when converting arguments for endpoint (endpoint name: ${this.endpointName}, argument index: ${this.argumentIndex}, name: ${this.parameterDefinition.name}, type: ${this.parameterDefinition.type})\nNested error: ${e}`)}convertError(e,t){this.throwError(`Can't convert argument (argument: ${e}, type ${typeof e}), wanted type: ${t})`)}unhandledType(e,t){this.throwError(`Unhandled type (function: ${e}, type: ${t})`)}guardSameLength(e,t){(e=e||[]).length!=t.length&&this.throwError(`Incorrect composite type length: have ${e.length}, expected ${t.length} (argument: ${e})`)}guardHasField(e,t){t in(e=e||{})||this.throwError(`Struct argument does not contain a field named "${t}" (argument: ${JSON.stringify(e)})`)}}},8976:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Code=void 0;const r=n(2206);class i{constructor(e){this.hex=e}static fromBuffer(e){return new i(e.toString("hex"))}static fromHex(e){return new i(e)}toString(){return this.hex}valueOf(){return Buffer.from(this.hex,"hex")}computeHash(){const e=r(32).update(this.valueOf()).digest();return Buffer.from(e)}}t.Code=i},5225:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadata=void 0;class n{constructor(e=!0,t=!1,n=!1,r=!1){this.upgradeable=e,this.readable=t,this.payable=n,this.payableBySc=r}static fromBytes(e){return n.fromBuffer(Buffer.from(e))}static fromBuffer(e){if(e.length<this.codeMetadataLength)throw new Error("Buffer is too short.");const t=e[0],r=e[1],i=!!(t&n.ByteZero.Upgradeable),s=!!(t&n.ByteZero.Readable),a=!!(r&n.ByteOne.Payable),o=!!(r&n.ByteOne.PayableBySc);return new n(i,s,a,o)}toggleUpgradeable(e){this.upgradeable=e}toggleReadable(e){this.readable=e}togglePayable(e){this.payable=e}togglePayableBySc(e){this.payableBySc=e}toBuffer(){let e=0,t=0;return this.upgradeable&&(e|=n.ByteZero.Upgradeable),this.readable&&(e|=n.ByteZero.Readable),this.payable&&(t|=n.ByteOne.Payable),this.payableBySc&&(t|=n.ByteOne.PayableBySc),Buffer.from([e,t])}toString(){return this.toBuffer().toString("hex")}toJSON(){return{upgradeable:this.upgradeable,readable:this.readable,payable:this.payable,payableBySc:this.payableBySc}}equals(e){return this.upgradeable==e.upgradeable&&this.readable==e.readable&&this.payable==e.payable&&this.payableBySc==e.payableBySc}}t.CodeMetadata=n,n.codeMetadataLength=2,n.ByteZero={Upgradeable:1,Reserved2:2,Readable:4},n.ByteOne={Reserved1:1,Payable:2,PayableBySc:4}},7648:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressBinaryCodec=void 0;const r=n(236),i=n(2747);t.AddressBinaryCodec=class{decodeNested(e){let t=e.slice(0,32),n=new r.Address(t);return[new i.AddressValue(n),32]}decodeTopLevel(e){let[t,n]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf().pubkey()}encodeTopLevel(e){return e.valueOf().pubkey()}}},2739:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVecBinaryCodec=void 0;const r=n(2747);t.ArrayVecBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=t.length,i=t.getFirstTypeParameter(),s=[],a=0;for(let t=0;t<n;t++){let[t,n]=this.binaryCodec.decodeNested(e,i);s.push(t),a+=n,e=e.slice(n)}return[new r.ArrayVec(t,s),a]}decodeTopLevel(e,t){let[n,r]=this.decodeNested(e,t);return n}encodeNested(e){let t=[];for(const n of e.getItems()){let e=this.binaryCodec.encodeNested(n);t.push(e)}return Buffer.concat(t)}encodeTopLevel(e){return this.encodeNested(e)}}},675:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryCodecConstraints=t.BinaryCodec=void 0;const a=s(n(2581)),o=n(2747),u=n(1069),c=n(9603),l=n(8673),d=n(82),f=n(3551),h=n(6855),p=n(8954),g=n(2739);t.BinaryCodec=class{constructor(e=null){this.constraints=e||new m,this.optionCodec=new c.OptionValueBinaryCodec(this),this.listCodec=new d.ListBinaryCodec(this),this.arrayCodec=new g.ArrayVecBinaryCodec(this),this.primitiveCodec=new l.PrimitiveBinaryCodec(this),this.structCodec=new f.StructBinaryCodec(this),this.tupleCodec=new p.TupleBinaryCodec(this),this.enumCodec=new h.EnumBinaryCodec(this)}decodeTopLevel(e,t){return this.constraints.checkBufferLength(e),o.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeTopLevel(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeTopLevel(e,t),onArray:()=>this.arrayCodec.decodeTopLevel(e,t),onPrimitive:()=>this.primitiveCodec.decodeTopLevel(e,t),onStruct:()=>this.structCodec.decodeTopLevel(e,t),onTuple:()=>this.tupleCodec.decodeTopLevel(e,t),onEnum:()=>this.enumCodec.decodeTopLevel(e,t)})}decodeNested(e,t){this.constraints.checkBufferLength(e);let[n,r]=o.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeNested(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeNested(e,t),onArray:()=>this.arrayCodec.decodeNested(e,t),onPrimitive:()=>this.primitiveCodec.decodeNested(e,t),onStruct:()=>this.structCodec.decodeNested(e,t),onTuple:()=>this.tupleCodec.decodeNested(e,t),onEnum:()=>this.enumCodec.decodeNested(e,t)});return[n,r]}encodeNested(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),o.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeNested(e),onOption:()=>this.optionCodec.encodeNested(e),onList:()=>this.listCodec.encodeNested(e),onArray:()=>this.arrayCodec.encodeNested(e),onStruct:()=>this.structCodec.encodeNested(e),onTuple:()=>this.tupleCodec.encodeNested(e),onEnum:()=>this.enumCodec.encodeNested(e)})}encodeTopLevel(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),o.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeTopLevel(e),onOption:()=>this.optionCodec.encodeTopLevel(e),onList:()=>this.listCodec.encodeTopLevel(e),onArray:()=>this.arrayCodec.encodeTopLevel(e),onStruct:()=>this.structCodec.encodeTopLevel(e),onTuple:()=>this.tupleCodec.encodeTopLevel(e),onEnum:()=>this.enumCodec.encodeTopLevel(e)})}};class m{constructor(e){this.maxBufferLength=e?.maxBufferLength||256e3,this.maxListLength=e?.maxListLength||128e3}checkBufferLength(e){if(e.length>this.maxBufferLength)throw new a.ErrCodec(`Buffer too large: ${e.length} > ${this.maxBufferLength}`)}checkListLength(e){if(e>this.maxListLength)throw new a.ErrCodec(`List too large: ${e} > ${this.maxListLength}`)}}t.BinaryCodecConstraints=m},3232:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBigNumber=t.decodeString=t.decodeBool=t.decodeUnsignedNumber=void 0;const i=r(n(1594)),s=n(2747),a=new(n(675).BinaryCodec);t.decodeUnsignedNumber=function(e){let t=a.decodeTopLevel(e,new s.BigUIntType);return Number(t.valueOf())},t.decodeBool=function(e){let t=a.decodeTopLevel(e,new s.BooleanType);return Boolean(t.valueOf())},t.decodeString=function(e){let t=a.decodeTopLevel(e,new s.BytesType);return String(t.valueOf())},t.decodeBigNumber=function(e){let t=a.decodeTopLevel(e,new s.BigUIntType);return new i.default(t.valueOf())}},7380:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanBinaryCodec=void 0;const a=s(n(2581)),o=n(2747);class u{decodeNested(e){let t=e.readUInt8(0);return[new o.BooleanValue(t==u.TRUE),1]}decodeTopLevel(e){if(e.length>1)throw new a.ErrInvalidArgument("buffer should be of size <= 1");let t=e[0];return new o.BooleanValue(t==u.TRUE)}encodeNested(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([u.FALSE])}encodeTopLevel(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([])}}t.BooleanBinaryCodec=u,u.TRUE=1,u.FALSE=0},8843:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesBinaryCodec=void 0;const r=n(1392),i=n(2461);t.BytesBinaryCodec=class{decodeNested(e){let t=e.readUInt32BE(0),n=e.slice(i.SizeOfU32,i.SizeOfU32+t);return[new r.BytesValue(n),i.SizeOfU32+t]}decodeTopLevel(e){return new r.BytesValue(e)}encodeNested(e){let t=Buffer.alloc(i.SizeOfU32);return t.writeUInt32BE(e.getLength()),Buffer.concat([t,e.valueOf()])}encodeTopLevel(e){return e.valueOf()}}},2461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizeOfU32=void 0,t.SizeOfU32=4},6855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumBinaryCodec=void 0;const r=n(2747),i=n(9995);t.EnumBinaryCodec=class{constructor(e){this.binaryCodec=e,this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[n]=this.decodeNested(e,t);return n}decodeNested(e,t){let[n,i]=this.readDiscriminant(e);e=e.slice(i);let s=t.getVariantByDiscriminant(n),a=s.getFieldsDefinitions(),[o,u]=this.fieldsCodec.decodeNested(e,a);return[new r.EnumValue(t,s,o),i+u]}readDiscriminant(e){let[t,n]=this.binaryCodec.decodeNested(e,new r.U8Type);return[t.valueOf(),n]}encodeNested(e){let t=new r.U8Value(e.discriminant),n=this.binaryCodec.encodeNested(t),i=e.getFields(),s=this.fieldsCodec.encodeNested(i);return Buffer.concat([n,s])}encodeTopLevel(e){let t=e.getFields(),n=t.length>0,i=this.fieldsCodec.encodeNested(t),s=new r.U8Value(e.discriminant),a=n?this.binaryCodec.encodeNested(s):this.binaryCodec.encodeTopLevel(s);return Buffer.concat([a,i])}}},9995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldsBinaryCodec=void 0;const r=n(2747);t.FieldsBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=[],i=0;for(const s of t){let[t,a]=this.binaryCodec.decodeNested(e,s.type);e=e.slice(a),i+=a;let o=new r.Field(t,s.name);n.push(o)}return[n,i]}encodeNested(e){let t=[];for(const n of e){let e=this.binaryCodec.encodeNested(n.value);t.push(e)}return Buffer.concat(t)}}},8831:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.H256BinaryCodec=void 0;const r=n(1038);t.H256BinaryCodec=class{decodeNested(e){let t=e.slice(0,32);return[new r.H256Value(t),32]}decodeTopLevel(e){let[t,n]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf()}encodeTopLevel(e){return e.valueOf()}}},9272:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(675),t),i(n(3232),t)},82:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListBinaryCodec=void 0;const r=n(2747),i=n(2461);t.ListBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=t.getFirstTypeParameter(),s=[],a=e.readUInt32BE(0);this.binaryCodec.constraints.checkListLength(a);let o=e,u=i.SizeOfU32;e=o.slice(u);for(let t=0;t<a;t++){let[t,r]=this.binaryCodec.decodeNested(e,n);s.push(t),u+=r,e=o.slice(u)}return[new r.List(t,s),u]}decodeTopLevel(e,t){let n=t.getFirstTypeParameter(),i=[],s=e,a=0;for(;e.length>0;){let[t,r]=this.binaryCodec.decodeNested(e,n);i.push(t),a+=r,e=s.slice(a),this.binaryCodec.constraints.checkListLength(i.length)}return new r.List(t,i)}encodeNested(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=Buffer.alloc(i.SizeOfU32);t.writeUInt32BE(e.getLength());let n=[];for(const t of e.getItems()){let e=this.binaryCodec.encodeNested(t);n.push(e)}return Buffer.concat([t,...n])}encodeTopLevel(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=[];for(const n of e.getItems()){let e=this.binaryCodec.encodeNested(n);t.push(e)}return Buffer.concat(t)}}},3157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NothingCodec=void 0;const r=n(2747);t.NothingCodec=class{decodeNested(){return[new r.NothingValue,0]}decodeTopLevel(){return new r.NothingValue}encodeNested(){return Buffer.from([])}encodeTopLevel(){return Buffer.from([])}}},62:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NumericalBinaryCodec=void 0;const i=r(n(1594)),s=n(2747),a=n(2461),o=n(7553);t.NumericalBinaryCodec=class{decodeNested(e,t){let n=0,r=t.sizeInBytes;r||(n=a.SizeOfU32,r=e.readUInt32BE(0));let i=e.slice(n,n+r);return[this.decodeTopLevel(i,t),r+n]}decodeTopLevel(e,t){let n=o.cloneBuffer(e);if(0==e.length)return new s.NumericalValue(t,new i.default(0));if(!t.withSign||o.isMsbZero(n)){let e=o.bufferToBigInt(n);return new s.NumericalValue(t,e)}o.flipBufferBitsInPlace(n);let r=o.bufferToBigInt(n).multipliedBy(new i.default(-1)).minus(new i.default(1));return new s.NumericalValue(t,r)}encodeNested(e){if(e.sizeInBytes)return this.encodeNestedFixedSize(e,e.sizeInBytes);let t=this.encodeTopLevel(e),n=Buffer.alloc(a.SizeOfU32);return n.writeUInt32BE(t.length),Buffer.concat([n,t])}encodeNestedFixedSize(e,t){if(e.value.isZero())return Buffer.alloc(t,0);if(!e.withSign){const n=o.bigIntToBuffer(e.value),r=Buffer.alloc(t-n.length,0);return Buffer.concat([r,n])}if(e.value.isPositive()){let n=o.bigIntToBuffer(e.value);o.isMsbOne(n)&&(n=o.prependByteToBuffer(n,0));const r=Buffer.alloc(t-n.length,0);return Buffer.concat([r,n])}let n=e.value.plus(new i.default(1)),r=o.bigIntToBuffer(n);o.flipBufferBitsInPlace(r),o.isMsbZero(r)&&(r=o.prependByteToBuffer(r,255));const s=Buffer.alloc(t-r.length,255);return Buffer.concat([s,r])}encodeTopLevel(e){let t=e.withSign;return e.value.isZero()?Buffer.alloc(0):t?this.encodePrimitive(e):o.bigIntToBuffer(e.value)}encodePrimitive(e){if(e.value.isPositive()){let t=o.bigIntToBuffer(e.value);return o.isMsbOne(t)&&(t=o.prependByteToBuffer(t,0)),t}let t=e.value.plus(new i.default(1)),n=o.bigIntToBuffer(t);return o.flipBufferBitsInPlace(n),o.isMsbZero(n)&&(n=o.prependByteToBuffer(n,255)),n}}},9603:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OptionValueBinaryCodec=void 0;const a=s(n(2581)),o=n(2747);t.OptionValueBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){if(0==e[0])return[o.OptionValue.newMissingTyped(t),1];if(1!=e[0])throw new a.ErrCodec("invalid buffer for optional value");let[n,r]=this.binaryCodec.decodeNested(e.slice(1),t);return[o.OptionValue.newProvided(n),r+1]}decodeTopLevel(e,t){if(0==e.length)return new o.OptionValue(t);if(1!=e[0])throw new a.ErrCodec("invalid buffer for optional value");let[n,r]=this.binaryCodec.decodeNested(e.slice(1),t);return new o.OptionValue(t,n)}encodeNested(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([0])}encodeTopLevel(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([])}}},8673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveBinaryCodec=void 0;const r=n(2747),i=n(7648),s=n(7380),a=n(62),o=n(8831),u=n(8843),c=n(6714),l=n(3157),d=n(1367);t.PrimitiveBinaryCodec=class{constructor(e){this.binaryCodec=e,this.booleanCodec=new s.BooleanBinaryCodec,this.numericalCodec=new a.NumericalBinaryCodec,this.addressCodec=new i.AddressBinaryCodec,this.h256Codec=new o.H256BinaryCodec,this.bytesCodec=new u.BytesBinaryCodec,this.stringCodec=new d.StringBinaryCodec,this.tokenIdentifierCodec=new c.TokenIdentifierCodec,this.nothingCodec=new l.NothingCodec}decodeNested(e,t){return r.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeNested(e),onNumerical:()=>this.numericalCodec.decodeNested(e,t),onAddress:()=>this.addressCodec.decodeNested(e),onBytes:()=>this.bytesCodec.decodeNested(e),onString:()=>this.stringCodec.decodeNested(e),onH256:()=>this.h256Codec.decodeNested(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeNested(e),onNothing:()=>this.nothingCodec.decodeNested()})}decodeTopLevel(e,t){return r.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeTopLevel(e),onNumerical:()=>this.numericalCodec.decodeTopLevel(e,t),onAddress:()=>this.addressCodec.decodeTopLevel(e),onBytes:()=>this.bytesCodec.decodeTopLevel(e),onString:()=>this.stringCodec.decodeTopLevel(e),onH256:()=>this.h256Codec.decodeTopLevel(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeTopLevel(e),onNothing:()=>this.nothingCodec.decodeTopLevel()})}encodeNested(e){return r.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeNested(e),onNumerical:()=>this.numericalCodec.encodeNested(e),onAddress:()=>this.addressCodec.encodeNested(e),onBytes:()=>this.bytesCodec.encodeNested(e),onString:()=>this.stringCodec.encodeNested(e),onH256:()=>this.h256Codec.encodeNested(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeNested(e),onNothing:()=>this.nothingCodec.encodeNested()})}encodeTopLevel(e){return r.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeTopLevel(e),onNumerical:()=>this.numericalCodec.encodeTopLevel(e),onAddress:()=>this.addressCodec.encodeTopLevel(e),onBytes:()=>this.bytesCodec.encodeTopLevel(e),onString:()=>this.stringCodec.encodeTopLevel(e),onH256:()=>this.h256Codec.encodeTopLevel(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeTopLevel(e),onNothing:()=>this.nothingCodec.encodeTopLevel()})}}},1367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringBinaryCodec=void 0;const r=n(2747),i=n(1392),s=n(8843);t.StringBinaryCodec=class{constructor(){this.bytesBinaryCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,n]=this.bytesBinaryCodec.decodeNested(e);return[new r.StringValue(t.valueOf().toString()),n]}decodeTopLevel(e){return new r.StringValue(e.toString())}encodeNested(e){let t=i.BytesValue.fromUTF8(e.valueOf());return this.bytesBinaryCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},3551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructBinaryCodec=void 0;const r=n(2747),i=n(9995);t.StructBinaryCodec=class{constructor(e){this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[n]=this.decodeNested(e,t);return n}decodeNested(e,t){let n=t.getFieldsDefinitions(),[i,s]=this.fieldsCodec.decodeNested(e,n);return[new r.Struct(t,i),s]}encodeNested(e){let t=e.getFields();return this.fieldsCodec.encodeNested(t)}encodeTopLevel(e){return this.encodeNested(e)}}},6714:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierCodec=void 0;const r=n(1392),i=n(3145),s=n(8843);t.TokenIdentifierCodec=class{constructor(){this.bytesCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,n]=this.bytesCodec.decodeNested(e);return[new i.TokenIdentifierValue(t.toString()),n]}decodeTopLevel(e){let t=this.bytesCodec.decodeTopLevel(e);return new i.TokenIdentifierValue(t.toString())}encodeNested(e){let t=r.BytesValue.fromUTF8(e.valueOf());return this.bytesCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},8954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBinaryCodec=void 0;const r=n(3551);t.TupleBinaryCodec=class{constructor(e){this.structCodec=new r.StructBinaryCodec(e)}decodeTopLevel(e,t){return this.structCodec.decodeTopLevel(e,t)}decodeNested(e,t){return this.structCodec.decodeNested(e,t)}encodeNested(e){return this.structCodec.encodeNested(e)}encodeTopLevel(e){return this.structCodec.encodeTopLevel(e)}}},7553:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.prependByteToBuffer=t.flipBufferBitsInPlace=t.getHexMagnitudeOfBigInt=t.bigIntToBuffer=t.bufferToBigInt=t.cloneBuffer=t.isMsbZero=t.isMsbOne=void 0;const i=r(n(1594)),s=n(9161);function a(e,t=0){return 1==e[t]>>7}function o(e){return(e=new i.default(e))?(e.isNegative()&&(e=e.multipliedBy(new i.default(-1))),s.numberToPaddedHex(e)):""}t.isMsbOne=a,t.isMsbZero=function(e,t=0){return!a(e,t)},t.cloneBuffer=function(e){let t=Buffer.alloc(e.length);return e.copy(t),t},t.bufferToBigInt=function(e){let t=e.toString("hex");return new i.default(`0x${t}`,16)},t.bigIntToBuffer=function(e){let t=o(e);return Buffer.from(t,"hex")},t.getHexMagnitudeOfBigInt=o,t.flipBufferBitsInPlace=function(e){for(let t=0;t<e.length;t++)e[t]=~e[t]},t.prependByteToBuffer=function(e,t){return Buffer.concat([Buffer.from([t]),e])}},3685:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFunction=void 0;const a=s(n(2581));class o{constructor(e){if(this.name=e,null==e)throw new a.ErrInvalidFunctionName}static none(){return new o("untitled")}toString(){return this.name}valueOf(){return this.name}}t.ContractFunction=o},661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1157),t),i(n(8976),t),i(n(9272),t),i(n(5225),t),i(n(3685),t),i(n(1945),t),i(n(1146),t),i(n(662),t),i(n(670),t),i(n(7453),t),i(n(2528),t),i(n(3462),t),i(n(1998),t),i(n(7331),t),i(n(2747),t)},1945:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interaction=void 0;const r=n(236),i=n(1220),s=n(7353),a=n(5132),o=n(3102),u=n(1146),c=n(7453);t.Interaction=class{constructor(e,t,n){this.nonce=0,this.value="0",this.gasLimit=0,this.gasPrice=void 0,this.chainID="",this.querent=r.Address.empty(),this.sender=r.Address.empty(),this.version=s.TRANSACTION_VERSION_DEFAULT,this.contract=e,this.function=t,this.args=n,this.tokenTransfers=[]}getContractAddress(){return this.contract.getAddress()}getFunction(){return this.function}getEndpoint(){return this.contract.getEndpoint(this.function)}getArguments(){return this.args}getValue(){return this.value}getTokenTransfers(){return this.tokenTransfers}getGasLimit(){return this.gasLimit}getExplicitReceiver(){return this.explicitReceiver}buildTransaction(){i.Compatibility.guardAddressIsSetAndNonZero(this.sender,"'sender' of interaction","use interaction.withSender()");const e=new o.TransactionsFactoryConfig({chainID:this.chainID.valueOf()}),t=new o.SmartContractTransactionsFactory({config:e}).createTransactionForExecute({sender:this.sender,contract:this.contract.getAddress(),function:this.function.valueOf(),gasLimit:BigInt(this.gasLimit.valueOf()),arguments:this.args,nativeTransferAmount:BigInt(this.value.toString()),tokenTransfers:this.tokenTransfers});return t.chainID=this.chainID.valueOf(),t.nonce=BigInt(this.nonce.valueOf()),t.version=this.version,this.gasPrice&&(t.gasPrice=BigInt(this.gasPrice.valueOf())),t}buildQuery(){return new c.Query({address:this.contract.getAddress(),func:this.function,args:this.args,value:this.value,caller:this.querent})}withValue(e){return this.value=e,this}withSingleESDTTransfer(e){return this.tokenTransfers=[e].map((e=>new a.TokenTransfer(e))),this}withSingleESDTNFTTransfer(e){return this.tokenTransfers=[e].map((e=>new a.TokenTransfer(e))),this}withMultiESDTNFTTransfer(e){return this.tokenTransfers=e.map((e=>new a.TokenTransfer(e))),this}withGasLimit(e){return this.gasLimit=e,this}withGasPrice(e){return this.gasPrice=e,this}withNonce(e){return this.nonce=e,this}useThenIncrementNonceOf(e){return this.withNonce(e.getNonceThenIncrement())}withChainID(e){return this.chainID=e,this}withSender(e){return this.sender=e,this}withVersion(e){return this.version=e,this}withQuerent(e){return this.querent=e,this}withExplicitReceiver(e){return this.explicitReceiver=e,this}check(){return(new u.InteractionChecker).checkInteraction(this,this.getEndpoint()),this}}},1146:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionChecker=void 0;const o=s(n(2581)),u=a(n(1594));t.InteractionChecker=class{checkInteraction(e,t){this.checkPayable(e,t),this.checkArguments(e,t)}checkPayable(e,t){let n=!new u.default(e.getValue().toString()).isZero(),r=t.modifiers.isPayableInEGLD();if(n&&!r)throw new o.ErrContractInteraction("cannot send EGLD value to non-payable")}checkArguments(e,t){let n=t.input,r=e.getArguments(),i=n.length,s=r.length;if(i!=s)throw new o.ErrContractInteraction(`bad arguments, expected: ${i}, got: ${s}`);for(let e=0;e<i;e++){let t=n[e].type,i=r[e].getType();if(!t.isAssignableFrom(i))throw new o.ErrContractInteraction(`type mismatch at index ${e}, expected: ${t}, got: ${i}`)}}}},662:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},670:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSerializer=void 0;const i=r(n(1594)),s=n(236),a=n(2581),o=n(9161),u=n(6147),c=n(2747);!function(e){function t(e){let t=[...e].reverse(),n=e.length,r=e.length,i=!1;t.length>0&&t[0].type.getCardinality().isComposite()&&(r=1/0,i=!0);for(let e of t){if(e.type.getCardinality().isSingular())break;n-=1}return{min:n,max:r,variadic:i}}function n(e,t,s){return e&&c.isTyped(e)?e:t instanceof c.OptionType?function(e,t,r){if(null==e)return c.OptionValue.newMissing();let i=n(e,t.getFirstTypeParameter(),r);return c.OptionValue.newProvided(i)}(e,t,s):t instanceof c.OptionalType?function(e,t,r){if(null==e)return new c.OptionalValue(t);let i=n(e,t.getFirstTypeParameter(),r);return new c.OptionalValue(t,i)}(e,t,s):t instanceof c.VariadicType?function(e,t,r){if(t.isCounted)throw new a.ErrInvalidArgument('Counted variadic arguments must be explicitly typed. E.g. use "VariadicValue.fromItemsCounted()" or "new VariadicValue()"');null==e&&(e=[]),void 0===e.map&&r.convertError(e,"Variadic");let i=e.map((function(e){return n(e,t.getFirstTypeParameter(),r)}));return new c.VariadicValue(t,i)}(e,t,s):t instanceof c.CompositeType?function(e,t,r){let i=[],s=t.getTypeParameters();r.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(n(e[t],s[t],r));return new c.CompositeValue(t,i)}(e,t,s):t instanceof c.TupleType?function(e,t,r){let i=[];const s=t.getFieldsDefinitions();r.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(n(e[t],s[t].type,r));return c.Tuple.fromItems(i)}(e,t,s):t instanceof c.StructType?function(e,t,r){let i=[];const s=t.getFieldsDefinitions();for(let t=0;t<s.length;t++){const a=s[t].name;r.guardHasField(e,a);const o=n(e[a],s[t].type,r);i.push(new c.Field(o,a))}return new c.Struct(t,i)}(e,t,s):t instanceof c.ListType?function(e,t,r){void 0===e.map&&r.convertError(e,"List");let i=e.map((function(e){return n(e,t.getFirstTypeParameter(),r)}));return new c.List(t,i)}(e,t,s):t instanceof c.PrimitiveType?function(e,t,n){if(t instanceof c.NumericalType)return function(e,t,n){switch(t.constructor){case c.U8Type:return new c.U8Value(e);case c.I8Type:return new c.I8Value(e);case c.U16Type:return new c.U16Value(e);case c.I16Type:return new c.I16Value(e);case c.U32Type:return new c.U32Value(e);case c.I32Type:return new c.I32Value(e);case c.U64Type:return new c.U64Value(e);case c.I64Type:return new c.I64Value(e);case c.BigUIntType:return new c.BigUIntValue(e);case c.BigIntType:return new c.BigIntValue(e);default:n.unhandledType("convertNumericalType",t)}}(new i.default(e),t,n);if(t instanceof c.BytesType)return function(e,t){const n=e.valueOf();return void 0===e&&t.convertError(e,"BytesValue"),e instanceof Buffer?new c.BytesValue(e):"string"==typeof e?c.BytesValue.fromUTF8(e):n instanceof Buffer?new c.BytesValue(n):"number"==typeof n?c.BytesValue.fromHex(o.numberToPaddedHex(n)):void t.convertError(e,"BytesValue")}(e,n);if(t instanceof c.AddressType)return new c.AddressValue(r(e,n));if(t instanceof c.BooleanType){const t="true"===e.toString().toLowerCase()||"1"===e.toString();return new c.BooleanValue(t)}if(t instanceof c.TokenIdentifierType)return new c.TokenIdentifierValue(function(e,t){return void 0===e&&t.convertError(e,"Buffer"),e instanceof Buffer?e.toString():"string"==typeof e?e:void t.convertError(e,"Buffer")}(e,n));n.throwError(`(function: toPrimitive) unsupported type ${t}`)}(e,t,s):t instanceof c.EnumType?function(e,t,r){if("number"==typeof e)return c.EnumValue.fromDiscriminant(t,e);if("string"==typeof e)return c.EnumValue.fromName(t,e);if("object"==typeof e){r.guardHasField(e,"name");const i=t.getVariantByName(e.name);r.guardHasField(e,"fields");const s=e.fields,a=[],o=i.getFieldsDefinitions();for(let e=0;e<o.length;e++){const t=o[e].name;r.guardHasField(s,t);const i=n(s[t],o[e].type,r);a.push(new c.Field(i,t))}return new c.EnumValue(t,i,a)}r.throwError("(function: toEnumValue) unsupported native type "+typeof e)}(e,t,s):void s.throwError(`convertToTypedValue: unhandled type ${t}`)}function r(e,t){if(e.bech32)return e;if(e.getAddress)return e.getAddress();switch(e.constructor){case Buffer:case String:return new s.Address(e);default:t.convertError(e,"Address")}}e.nativeToTypedValues=function(e,r){(function(e,n){const{min:r,max:i}=t(n.input);if(!(r<=e.length&&e.length<=i))throw new a.ErrInvalidArgument(`Wrong number of arguments for endpoint ${n.name}: expected between ${r} and ${i} arguments, have ${e.length}`)})(e=e||[],r),function(e){const t=e.input[e.input.length-1];return t?.type instanceof c.VariadicType&&!t.type.isCounted}(r)&&(e=function(e,t){const n=t.input.length-1,r=e[n];if(r?.belongsToTypesystem){if(!r.hasClassOrSuperclass(c.VariadicValue.ClassName))throw new a.ErrInvalidArgument(`Wrong argument type for endpoint ${t.name}: typed value provided; expected variadic type, have ${r.getClassName()}`)}else e[n]=e.slice(n);return e}(e,r));let i=r.input,s=[];for(let t=0;t<i.length;t++){let a=i[t],o=new u.ArgumentErrorContext(r.name,t,a),c=n(e[t],a.type,o);s.push(c)}return s},e.getArgumentsCardinality=t,e.convertNativeToAddress=r}(t.NativeSerializer||(t.NativeSerializer={}))},7453:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Query=void 0;const r=n(236),i=n(1157);t.Query=class{constructor(e){this.caller=e.caller||r.Address.empty(),this.address=e.address,this.func=e.func,this.args=e.args||[],this.value=e.value||0}getEncodedArguments(){return(new i.ArgSerializer).valuesToStrings(this.args)}}},2528:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResultsParser=void 0;const r=n(2866),i=n(236),s=n(2581),a=n(6458),o=n(1157),u=n(3462);var c,l;!function(e){e.OnTransactionCompleted="completedTxEvent",e.OnSignalError="signalError",e.OnWriteLog="writeLog"}(c||(c={})),function(e){e.TooMuchGas="@too much gas provided for processing"}(l||(l={}));const d={argsSerializer:new o.ArgSerializer};t.ResultsParser=class{constructor(e){e={...d,...e},this.argsSerializer=e.argsSerializer}parseQueryResponse(e,t){let n=e.getReturnDataParts(),r=this.argsSerializer.buffersToValues(n,t.output);return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:r,firstValue:r[0],secondValue:r[1],thirdValue:r[2],lastValue:r[r.length-1]}}parseUntypedQueryResponse(e){return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:e.getReturnDataParts()}}parseOutcome(e,t){const n=this.parseUntypedOutcome(e);return this.parseOutcomeFromUntypedBundle(n,t)}parseOutcomeFromUntypedBundle(e,t){const n=this.argsSerializer.buffersToValues(e.values,t.output);return{returnCode:e.returnCode,returnMessage:e.returnMessage,values:n,firstValue:n[0],secondValue:n[1],thirdValue:n[2],lastValue:n[n.length-1]}}parseUntypedOutcome(e){let t,n=this.parseTransactionMetadata(e);if(t=this.createBundleOnSimpleMoveBalance(e),t)return a.Logger.trace("parseUntypedOutcome(): on simple move balance"),t;if(t=this.createBundleOnInvalidTransaction(e),t)return a.Logger.trace("parseUntypedOutcome(): on invalid transaction"),t;if(t=this.createBundleOnEasilyFoundResultWithReturnData(e.contractResults),t)return a.Logger.trace("parseUntypedOutcome(): on easily found result with return data"),t;if(t=this.createBundleOnSignalError(e.logs),t)return a.Logger.trace("parseUntypedOutcome(): on signal error"),t;if(t=this.createBundleOnTooMuchGasWarning(e.logs),t)return a.Logger.trace("parseUntypedOutcome(): on 'too much gas' warning"),t;if(t=this.createBundleOnWriteLogWhereFirstTopicEqualsAddress(e.logs,e.sender),t)return a.Logger.trace("parseUntypedOutcome(): on writelog with topics[0] == tx.sender"),t;if(t=this.createBundleWithCustomHeuristics(e,n),t)return a.Logger.trace("parseUntypedOutcome(): with custom heuristics"),t;if(t=this.createBundleWithFallbackHeuristics(e,n),t)return a.Logger.trace("parseUntypedOutcome(): with fallback heuristics"),t;throw new s.ErrCannotParseContractResults(`transaction ${e.hash.toString()}`)}parseTransactionMetadata(e){return(new r.TransactionDecoder).getTransactionMetadata({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:e.data.toString("base64"),value:e.value.toString()})}createBundleOnSimpleMoveBalance(e){let t=0==e.contractResults.items.length,n=0==e.logs.events.length;return t&&n?{returnCode:u.ReturnCode.None,returnMessage:u.ReturnCode.None.toString(),values:[]}:null}createBundleOnInvalidTransaction(e){return e.status.isInvalid()&&e.receipt.data?{returnCode:u.ReturnCode.OutOfFunds,returnMessage:e.receipt.data,values:[]}:null}createBundleOnEasilyFoundResultWithReturnData(e){let t=e.items.find((e=>0!=e.nonce.valueOf()&&e.data.startsWith("@")));if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.returnMessage||n.toString();return{returnCode:n,returnMessage:i,values:r}}createBundleOnSignalError(e){let t=e.findSingleOrNoneEvent(c.OnSignalError);if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||n.toString();return{returnCode:n,returnMessage:s,values:r}}createBundleOnTooMuchGasWarning(e){let t=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.toString().startsWith(l.TooMuchGas)))));if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||n.toString();return{returnCode:n,returnMessage:s,values:r}}createBundleOnWriteLogWhereFirstTopicEqualsAddress(e,t){let n=new i.Address(t.bech32()).hex(),r=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.hex()==n))));if(!r)return null;let{returnCode:s,returnDataParts:a}=this.sliceDataFieldInParts(r.data),o=s.toString();return{returnCode:s,returnMessage:o,values:a}}createBundleWithCustomHeuristics(e,t){return null}createBundleWithFallbackHeuristics(e,t){let n=new i.Address(t.receiver);for(const t of e.contractResults.items){let r=t.logs.findSingleOrNoneEvent(c.OnWriteLog,(t=>{let r=t.address.bech32()==e.sender.bech32(),i=t.topics[0]?.hex()==n.hex();return r&&i}));if(r){let{returnCode:e,returnDataParts:t}=this.sliceDataFieldInParts(r.data),n=e.toString();return{returnCode:e,returnMessage:n,values:t}}}return null}sliceDataFieldInParts(e){let t=1;e.startsWith("ESDTTransfer")&&(t=3);let n=this.argsSerializer.stringToBuffers(e),r=n[t]||Buffer.from([]),i=n.slice(t+1);if(0==r.length)throw new s.ErrCannotParseContractResults("no return code");return{returnCode:u.ReturnCode.fromBuffer(r),returnDataParts:i}}parseEvent(e,t){const n=e.topics.map((e=>Buffer.from(e.valueOf()))).slice(1),r=e.dataPayload?.valueOf()||Buffer.from([]),i=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===i.length&&r.length&&i.push(Buffer.from(r)),this.doParseEvent({topics:n,dataItems:i,eventDefinition:t})}doParseEvent(e){const t={},n=e.eventDefinition.inputs.filter((e=>e.indexed)),r=this.argsSerializer.buffersToValues(e.topics,n);for(let e=0;e<n.length;e++)t[n[e].name]=r[e].valueOf();const i=e.eventDefinition.inputs.filter((e=>!e.indexed)),s=this.argsSerializer.buffersToValues(e.dataItems,i);for(let e=0;e<i.length;e++)t[i[e].name]=s[e].valueOf();return t}}},3462:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReturnCode=void 0;class n{constructor(e){this.text=e}static fromBuffer(e){let t=e.toString();return new n(t)}toString(){return this.text}valueOf(){return this.text}equals(e){return!!e&&this.text==e.text}isSuccess(){return this.equals(n.Ok)||this.equals(n.None)}}t.ReturnCode=n,n.None=new n(""),n.Ok=new n("ok"),n.FunctionNotFound=new n("function not found"),n.FunctionWrongSignature=new n("wrong signature for function"),n.ContractNotFound=new n("contract not found"),n.UserError=new n("user error"),n.OutOfGas=new n("out of gas"),n.AccountCollision=new n("account collision"),n.OutOfFunds=new n("out of funds"),n.CallStackOverFlow=new n("call stack overflow"),n.ContractInvalid=new n("contract invalid"),n.ExecutionFailed=new n("execution failed"),n.Unknown=new n("unknown")},1998:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContract=void 0;const r=n(236),i=n(1220),s=n(7353),a=n(2581),o=n(9712),u=n(3473),c=n(1069),l=n(5225),d=n(3685),f=n(1945),h=n(670),p=n(7453);t.SmartContract=class{constructor(e={}){this.address=r.Address.empty(),this.methodsExplicit={},this.methods={},this.address=e.address||r.Address.empty(),this.abi=e.abi,this.abi&&this.setupMethods()}setupMethods(){let e=this,t=this.getAbi();for(const n of t.getEndpoints()){let t=n.name;this.methodsExplicit[t]=function(n){let r=new d.ContractFunction(t);return new f.Interaction(e,r,n||[])},this.methods[t]=function(r){let i=new d.ContractFunction(t),s=h.NativeSerializer.nativeToTypedValues(r||[],n);return new f.Interaction(e,i,s||[])}}}setAddress(e){this.address=e}getAddress(){return this.address}getAbi(){return c.guardValueIsSet("abi",this.abi),this.abi}getEndpoint(e){return this.getAbi().getEndpoint(e)}deploy({deployer:e,code:t,codeMetadata:n,initArguments:r,value:a,gasLimit:c,gasPrice:l,chainID:d}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'deployer' of SmartContract.deploy()","pass the actual address to deploy()");const f=new u.TransactionsFactoryConfig({chainID:d.valueOf()}),h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}),p=Buffer.from(t.toString(),"hex"),g=this.getMetadataPropertiesAsObject(n),m=h.createTransactionForDeploy({sender:e,bytecode:p,gasLimit:BigInt(c.valueOf()),arguments:r,isUpgradeable:g.upgradeable,isReadable:g.readable,isPayable:g.payable,isPayableBySmartContract:g.payableBySc});return m.setChainID(d),m.setValue(a??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}getMetadataPropertiesAsObject(e){let t;return t=e?l.CodeMetadata.fromBytes(Buffer.from(e.toString(),"hex")):new l.CodeMetadata,t.toJSON()}upgrade({caller:e,code:t,codeMetadata:n,initArguments:r,value:a,gasLimit:c,gasPrice:l,chainID:d}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'caller' of SmartContract.upgrade()","pass the actual address to upgrade()"),this.ensureHasAddress();const f=new u.TransactionsFactoryConfig({chainID:d.valueOf()}),h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}),p=Uint8Array.from(Buffer.from(t.toString(),"hex")),g=this.getMetadataPropertiesAsObject(n),m=h.createTransactionForUpgrade({sender:e,contract:this.getAddress(),bytecode:p,gasLimit:BigInt(c.valueOf()),arguments:r,isUpgradeable:g.upgradeable,isReadable:g.readable,isPayable:g.payable,isPayableBySmartContract:g.payableBySc});return m.setChainID(d),m.setValue(a??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}call({func:e,args:t,value:n,gasLimit:r,receiver:a,gasPrice:c,chainID:l,caller:d}){i.Compatibility.guardAddressIsSetAndNonZero(d,"'caller' of SmartContract.call()","pass the actual address to call()"),this.ensureHasAddress();const f=new u.TransactionsFactoryConfig({chainID:l.valueOf()});t=t||[],n=n||0;const h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}).createTransactionForExecute({sender:d,contract:a||this.getAddress(),function:e.toString(),gasLimit:BigInt(r.valueOf()),arguments:t});return h.setChainID(l),h.setValue(n),h.setGasPrice(c??s.TRANSACTION_MIN_GAS_PRICE),h}createQuery({func:e,args:t,value:n,caller:r}){return this.ensureHasAddress(),new p.Query({address:this.getAddress(),func:e,args:t,value:n,caller:r})}ensureHasAddress(){if(!this.getAddress().bech32())throw new a.ErrContractHasNoAddress}static computeAddress(e,t){const n=r.Address.fromBech32(e.bech32());return(new r.AddressComputer).computeContractAddress(n,BigInt(t.valueOf()))}}},7331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractCallPayloadBuilder=t.ContractUpgradePayloadBuilder=t.ContractDeployPayloadBuilder=void 0;const r=n(7353),i=n(3548),s=n(1069),a=n(1157);function o(e,t){let{argumentsString:n,count:r}=(new a.ArgSerializer).valuesToString(t);return 0==r?e:`${e}@${n}`}t.ContractDeployPayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=this.code.toString(),t=this.codeMetadata.toString(),n=`${e}@${r.WasmVirtualMachine}@${t}`;return n=o(n,this.arguments),new i.TransactionPayload(n)}},t.ContractUpgradePayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=`upgradeContract@${this.code.toString()}@${this.codeMetadata.toString()}`;return e=o(e,this.arguments),new i.TransactionPayload(e)}},t.ContractCallPayloadBuilder=class{constructor(){this.contractFunction=null,this.arguments=[]}setFunction(e){return this.contractFunction=e,this}addArg(e){return this.arguments.push(e),this}setArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("calledFunction",this.contractFunction);let e=this.contractFunction.toString();return e=o(e,this.arguments),new i.TransactionPayload(e)}}},4966:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbiRegistry=void 0;const a=s(n(2581)),o=n(1069),u=n(5730),c=n(1414),l=n(4143),d=n(7586),f=n(7654);class h{constructor(e){this.endpoints=[],this.customTypes=[],this.events=[],this.name=e.name,this.constructorDefinition=e.constructorDefinition,this.upgradeConstructorDefinition=e.upgradeConstructorDefinition,this.endpoints=e.endpoints,this.customTypes=e.customTypes,this.events=e.events||[]}static create(e){const t=e.name||"?",n=e.constructor||{},r=e.upgradeConstructor||{},i=e.endpoints||[],s=e.types||{},o=e.events||[],f=u.EndpointDefinition.fromJSON({name:"constructor",...n}),p=u.EndpointDefinition.fromJSON({name:"upgradeConstructor",...r}),g=i.map((e=>u.EndpointDefinition.fromJSON(e))),m=[];for(const e in s){const t=s[e];if("struct"==t.type)m.push(d.StructType.fromJSON({name:e,fields:t.fields}));else{if("enum"!=t.type&&"explicit-enum"!=t.type)throw new a.ErrTypingSystem(`Cannot handle custom type: ${e}`);m.push(c.EnumType.fromJSON({name:e,variants:t.variants}))}}const y=o.map((e=>l.EventDefinition.fromJSON(e)));return new h({name:t,constructorDefinition:f,upgradeConstructorDefinition:p,endpoints:g,customTypes:m,events:y}).remapToKnownTypes()}getCustomType(e){const t=this.customTypes.find((t=>t.getName()==e));return o.guardValueIsSetWithMessage(`custom type [${e}] not found`,t),t}getStruct(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(d.StructType.ClassName)));return o.guardValueIsSetWithMessage(`struct [${e}] not found`,t),t}getStructs(e){return e.map((e=>this.getStruct(e)))}getEnum(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(c.EnumType.ClassName)));return o.guardValueIsSetWithMessage(`enum [${e}] not found`,t),t}getEnums(e){return e.map((e=>this.getEnum(e)))}getEndpoints(){return this.endpoints}getEndpoint(e){const t=this.endpoints.find((t=>t.name==e));return o.guardValueIsSetWithMessage(`endpoint [${e}] not found`,t),t}getEvent(e){const t=this.events.find((t=>t.identifier==e));return o.guardValueIsSetWithMessage(`event [${e}] not found`,t),t}remapToKnownTypes(){const e=new f.TypeMapper([]),t=[];for(const n of this.customTypes)this.mapCustomTypeDepthFirst(n,this.customTypes,e,t);if(this.customTypes.length!=t.length)throw new a.ErrTypingSystem("Did not re-map all custom types");const n=p(this.constructorDefinition,e),r=this.upgradeConstructorDefinition?p(this.upgradeConstructorDefinition,e):void 0,i=[];for(const t of this.endpoints)i.push(p(t,e));const s=this.events.map((t=>function(e,t){const n=e.inputs.map((e=>new l.EventTopicDefinition({name:e.name,type:t.mapType(e.type),indexed:e.indexed})));return new l.EventDefinition(e.identifier,n)}(t,e)));return new h({name:this.name,constructorDefinition:n,upgradeConstructorDefinition:r,endpoints:i,customTypes:t,events:s})}mapCustomTypeDepthFirst(e,t,n,r){if(r.findIndex((t=>t.getName()==e.getName()))>=0)return;for(const i of e.getNamesOfDependencies()){const e=t.find((e=>e.getName()==i));e&&this.mapCustomTypeDepthFirst(e,t,n,r)}const i=n.mapType(e);r.push(i)}}function p(e,t){const n=e.input.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type)))),r=e.output.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type))));return new u.EndpointDefinition(e.name,n,r,e.modifiers)}t.AbiRegistry=h},8551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressValue=t.AddressType=void 0;const r=n(236),i=n(5626);class s extends i.PrimitiveType{constructor(){super("Address")}getClassName(){return s.ClassName}}t.AddressType=s,s.ClassName="AddressType";class a extends i.PrimitiveValue{constructor(e){super(new s),this.value=new r.Address(e.bech32())}getClassName(){return a.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.AddressValue=a,a.ClassName="AddressValue"},1055:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalValue=t.OptionalType=void 0;const r=n(1069),i=n(5626);class s extends i.Type{constructor(e){super("Optional",[e],i.TypeCardinality.variable(1))}getClassName(){return s.ClassName}isAssignableFrom(e){if(!e.hasExactClass(s.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),n=e.getFirstTypeParameter().hasExactClass(i.NullType.ClassName);return t||n}}t.OptionalType=s,s.ClassName="OptionalType";class a extends i.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return a.ClassName}static newMissing(){let e=new s(new i.NullType);return new a(e)}isSet(){return!!this.value}getTypedValue(){return r.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionalValue=a,a.ClassName="OptionalValue"},3979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanValue=t.BooleanType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("bool")}getClassName(){return i.ClassName}}t.BooleanType=i,i.ClassName="BooleanType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value===e.value}isTrue(){return!0===this.value}isFalse(){return!this.isTrue()}valueOf(){return this.value}}t.BooleanValue=s,s.ClassName="BooleanValue"},1392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesValue=t.BytesType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("bytes")}getClassName(){return i.ClassName}}t.BytesType=i,i.ClassName="BytesType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){let t=Buffer.from(e,"utf-8");return new s(t)}static fromHex(e){let t=Buffer.from(e,"hex");return new s(t)}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value.equals(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.BytesValue=s,s.ClassName="BytesValue"},1847:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadataValue=t.CodeMetadataType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("CodeMetadata")}}t.CodeMetadataType=i;class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.CodeMetadataValue=s},902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionOfTypedValues=void 0,t.CollectionOfTypedValues=class{constructor(e){this.items=e}getLength(){return this.items.length}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getLength()!=e.getLength())return!1;for(let t=0;t<this.getLength();t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}},7472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeValue=t.CompositeType=void 0;const r=n(1069),i=n(5626);class s extends i.Type{constructor(...e){super("Composite",e,i.TypeCardinality.variable(e.length))}getClassName(){return s.ClassName}}t.CompositeType=s,s.ClassName="CompositeType";class a extends i.TypedValue{constructor(e,t){super(e),r.guardLength(t,e.getTypeParameters().length),this.items=t}getClassName(){return a.ClassName}static fromItems(...e){let t=e.map((e=>e.getType())),n=new s(...t);return new a(n,e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e?.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}t.CompositeValue=a,a.ClassName="CompositeValue"},5730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndpointParameterDefinition=t.EndpointModifiers=t.EndpointDefinition=void 0;const r=n(7966);class i{constructor(e,t,n,r){this.input=[],this.output=[],this.name=e,this.input=t||[],this.output=n||[],this.modifiers=r}isConstructor(){return"constructor"==this.name}static fromJSON(e){e.name=null==e.name?"?":e.name,e.onlyOwner=e.onlyOwner||!1,e.payableInTokens=e.payableInTokens||[],e.inputs=e.inputs||[],e.outputs=e.outputs||[];let t=e.inputs.map((e=>a.fromJSON(e))),n=e.outputs.map((e=>a.fromJSON(e))),r=new s(e.mutability,e.payableInTokens,e.onlyOwner);return new i(e.name,t,n,r)}}t.EndpointDefinition=i;class s{constructor(e,t,n){this.mutability=e||"",this.payableInTokens=t||[],this.onlyOwner=n||!1}isPayableInEGLD(){return this.isPayableInToken("EGLD")}isPayableInToken(e){return!!this.payableInTokens.includes(e)||!this.payableInTokens.includes(`!${e}`)&&!!this.payableInTokens.includes("*")}isPayable(){return 0!=this.payableInTokens.length}isReadonly(){return"readonly"==this.mutability}isOnlyOwner(){return this.onlyOwner}}t.EndpointModifiers=s;class a{constructor(e,t,n){this.name=e,this.description=t,this.type=n}static fromJSON(e){let t=(new r.TypeExpressionParser).parse(e.type);return new a(e.name||"?",e.description||"N / A",t)}}t.EndpointParameterDefinition=a},1414:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumValue=t.EnumVariantDefinition=t.EnumType=void 0;const r=n(2581),i=n(1069),s=n(5766),a=n(5626);class o extends a.CustomType{constructor(e,t){super(e),this.variants=[],this.variants=t}getClassName(){return o.ClassName}static fromJSON(e){const t=o.assignMissingDiscriminants(e.variants||[]).map((e=>u.fromJSON(e)));return new o(e.name,t)}static assignMissingDiscriminants(e){return e.every((e=>null==e.discriminant))?e.map(((e,t)=>({...e,discriminant:t}))):e}getVariantByDiscriminant(e){let t=this.variants.find((t=>t.discriminant==e));return i.guardValueIsSet(`variant by discriminant (${e})`,t),t}getVariantByName(e){let t=this.variants.find((t=>t.name==e));return i.guardValueIsSet(`variant by name (${e})`,t),t}getNamesOfDependencies(){const e=[];for(const t of this.variants)e.push(...t.getNamesOfDependencies());return[...new Set(e)]}}t.EnumType=o,o.ClassName="EnumType";class u{constructor(e,t,n=[]){this.fieldsDefinitions=[],i.guardTrue(t<256,"discriminant for simple enum should be less than 256"),this.name=e,this.discriminant=t,this.fieldsDefinitions=n}static fromJSON(e){let t=(e.fields||[]).map((e=>s.FieldDefinition.fromJSON(e)));return new u(e.name,e.discriminant,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return s.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.EnumVariantDefinition=u;class c extends a.TypedValue{constructor(e,t,n){super(e),this.fields=[],this.name=t.name,this.discriminant=t.discriminant,this.fields=n,this.fieldsByName=new Map(n.map((e=>[e.name,e])));let r=t.getFieldsDefinitions();s.Fields.checkTyping(this.fields,r)}getClassName(){return c.ClassName}static fromName(e,t){let n=e.getVariantByName(t);return new c(e,n,[])}static fromDiscriminant(e,t){let n=e.getVariantByDiscriminant(t);return new c(e,n,[])}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),n=e.getFields();const r=this.name==e.name,i=this.discriminant==e.discriminant,a=s.Fields.equals(t,n);return r&&i&&a}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new r.ErrMissingFieldOnEnum(e,this.getType().getName())}valueOf(){let e={name:this.name,fields:[]};return this.fields.forEach(((t,n)=>e.fields[n]=t.value.valueOf())),e}}t.EnumValue=c,c.ClassName="EnumValue"},4143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventTopicDefinition=t.EventDefinition=void 0;const r=n(7966);class i{constructor(e,t){this.inputs=[],this.identifier=e,this.inputs=t||[]}static fromJSON(e){e.identifier=null==e.identifier?"?":e.identifier,e.inputs=e.inputs||[];const t=e.inputs.map((e=>s.fromJSON(e)));return new i(e.identifier,t)}}t.EventDefinition=i;class s{constructor(e){this.name=e.name,this.type=e.type,this.indexed=e.indexed}static fromJSON(e){const t=(new r.TypeExpressionParser).parse(e.type);return new s({name:e.name||"?",type:t,indexed:e.indexed})}}t.EventTopicDefinition=s},8689:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListOfTokenIdentifiers=t.createListOfAddresses=void 0;const r=n(8551),i=n(926),s=n(3145);t.createListOfAddresses=function(e){let t=e.map((e=>new r.AddressValue(e)));return i.List.fromItems(t)},t.createListOfTokenIdentifiers=function(e){let t=e.map((e=>new s.TokenIdentifierValue(e)));return i.List.fromItems(t)}},5766:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Fields=t.Field=t.FieldDefinition=void 0;const a=s(n(2581)),o=n(7966);class u{constructor(e,t,n){this.name=e,this.description=t,this.type=n}static fromJSON(e){let t=(new o.TypeExpressionParser).parse(e.type);return new u(e.name,e.description,t)}}t.FieldDefinition=u,t.Field=class{constructor(e,t=""){this.value=e,this.name=t}checkTyping(e){const t=this.value.getType();if(!t.equals(e.type))throw new a.ErrTypingSystem(`check type of field "${e.name}; expected: ${e.type}, actual: ${t}"`);if(this.name!=e.name)throw new a.ErrTypingSystem(`check name of field "${e.name}"`)}equals(e){return this.name==e.name&&this.value.equals(e.value)}},t.Fields=class{static checkTyping(e,t){if(e.length!=t.length)throw new a.ErrTypingSystem("fields length vs. field definitions length");for(let n=0;n<e.length;n++){let r=e[n],i=t[n];r.checkTyping(i)}}static equals(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(!r.equals(i))return!1}return!0}static getNamesOfTypeDependencies(e){const t=[];for(const n of e)t.push(n.type.getName()),t.push(...n.type.getNamesOfDependencies());return[...new Set(t)]}}},926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.List=t.OptionValue=t.ListType=t.OptionType=void 0;const r=n(1069),i=n(902),s=n(5626);class a extends s.Type{constructor(e){super("Option",[e])}getClassName(){return a.ClassName}isAssignableFrom(e){if(!e.hasExactClass(a.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),n=e.getFirstTypeParameter().hasExactClass(s.NullType.ClassName);return t||n}}t.OptionType=a,a.ClassName="OptionType";class o extends s.Type{constructor(e){super("List",[e])}getClassName(){return o.ClassName}}t.ListType=o,o.ClassName="ListType";class u extends s.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return u.ClassName}static newMissing(){let e=new a(new s.NullType);return new u(e)}static newMissingTyped(e){return new u(new a(e))}static newProvided(e){let t=new a(e.getType());return new u(t,e)}isSet(){return!!this.value}getTypedValue(){return r.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionValue=u,u.ClassName="OptionValue";class c extends s.TypedValue{constructor(e,t){super(e),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return c.ClassName}static fromItems(e){if(0==e.length)return new c(new s.TypePlaceholder,[]);let t=e[0].getType(),n=new o(t);return new c(n,e)}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.List=c,c.ClassName="List"},177:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVec=t.ArrayVecType=void 0;const r=n(1069),i=n(902),s=n(5626);class a extends s.Type{constructor(e,t){super("Array",[t]),r.guardTrue(e>0,"array length > 0"),this.length=e}getClassName(){return a.ClassName}}t.ArrayVecType=a,a.ClassName="ArrayVecType";class o extends s.TypedValue{constructor(e,t){super(e),r.guardLength(t,e.length),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return o.ClassName}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.ArrayVec=o,o.ClassName="ArrayVec"},1038:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.H256Value=t.H256Type=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("H256")}getClassName(){return i.ClassName}}t.H256Type=i,i.ClassName="H256Type";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.H256Value=s,s.ClassName="H256Value"},2747:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4966),t),i(n(8551),t),i(n(1055),t),i(n(3979),t),i(n(1392),t),i(n(7472),t),i(n(5730),t),i(n(1414),t),i(n(8689),t),i(n(5766),t),i(n(926),t),i(n(177),t),i(n(1038),t),i(n(5648),t),i(n(1782),t),i(n(4473),t),i(n(6514),t),i(n(7586),t),i(n(3145),t),i(n(1025),t),i(n(7966),t),i(n(7654),t),i(n(5626),t),i(n(6054),t)},5648:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.onPrimitiveTypeSelect=t.onPrimitiveValueSelect=t.onTypedValueSelect=t.onTypeSelect=void 0;const a=s(n(2581)),o=n(8551),u=n(3979),c=n(1392),l=n(1414),d=n(926),f=n(1038),h=n(4473),p=n(1782),g=n(7586),m=n(3145),y=n(1025),A=n(5626),b=n(177),T=n(6514);t.onTypeSelect=function(e,t){if(e.hasExactClass(d.OptionType.ClassName))return t.onOption();if(e.hasExactClass(d.ListType.ClassName))return t.onList();if(e.hasExactClass(b.ArrayVecType.ClassName))return t.onArray();if(e.hasClassOrSuperclass(A.PrimitiveType.ClassName))return t.onPrimitive();if(e.hasExactClass(g.StructType.ClassName))return t.onStruct();if(e.hasExactClass(y.TupleType.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumType.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`type isn't known: ${e}`)},t.onTypedValueSelect=function(e,t){if(e.hasClassOrSuperclass(A.PrimitiveValue.ClassName))return t.onPrimitive();if(e.hasExactClass(d.OptionValue.ClassName))return t.onOption();if(e.hasExactClass(d.List.ClassName))return t.onList();if(e.hasExactClass(b.ArrayVec.ClassName))return t.onArray();if(e.hasExactClass(g.Struct.ClassName))return t.onStruct();if(e.hasExactClass(y.Tuple.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumValue.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`value isn't typed: ${e}`)},t.onPrimitiveValueSelect=function(e,t){if(e.hasExactClass(u.BooleanValue.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalValue.ClassName))return t.onNumerical();if(e.hasExactClass(o.AddressValue.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesValue.ClassName))return t.onBytes();if(e.hasExactClass(T.StringValue.ClassName))return t.onString();if(e.hasExactClass(f.H256Value.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierValue.ClassName))return t.onTypeIdentifier();if(e.hasExactClass(p.NothingValue.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`value isn't a primitive: ${e.getType()}`)},t.onPrimitiveTypeSelect=function(e,t){if(e.hasExactClass(u.BooleanType.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalType.ClassName))return t.onNumerical();if(e.hasExactClass(o.AddressType.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesType.ClassName))return t.onBytes();if(e.hasExactClass(T.StringType.ClassName))return t.onString();if(e.hasExactClass(f.H256Type.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierType.ClassName))return t.onTokenIndetifier();if(e.hasExactClass(p.NothingType.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`type isn't a known primitive: ${e}`)}},1782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NothingValue=t.NothingType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("nothing")}getClassName(){return i.ClassName}}t.NothingType=i,i.ClassName="NothingType";class s extends r.PrimitiveValue{constructor(){super(new i)}getClassName(){return s.ClassName}equals(e){return!1}valueOf(){return{}}}t.NothingValue=s,s.ClassName="NothingValue"},4473:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BigIntValue=t.BigUIntValue=t.I64Value=t.U64Value=t.I32Value=t.U32Value=t.I16Value=t.U16Value=t.I8Value=t.U8Value=t.NumericalValue=t.BigIntType=t.BigUIntType=t.I64Type=t.U64Type=t.I32Type=t.U32Type=t.I16Type=t.U16Type=t.I8Type=t.U8Type=t.NumericalType=void 0;const o=a(n(1594)),u=s(n(2581)),c=n(5626);class l extends c.PrimitiveType{constructor(e,t,n){super(e),this.sizeInBytes=t,this.withSign=n}getClassName(){return l.ClassName}hasFixedSize(){return!!this.sizeInBytes}hasArbitrarySize(){return!this.hasFixedSize()}}t.NumericalType=l,l.ClassName="NumericalType";class d extends l{constructor(){super("u8",1,!1)}getClassName(){return d.ClassName}}t.U8Type=d,d.ClassName="U8Type";class f extends l{constructor(){super("i8",1,!0)}getClassName(){return f.ClassName}}t.I8Type=f,f.ClassName="I8Type";class h extends l{constructor(){super("u16",2,!1)}getClassName(){return h.ClassName}}t.U16Type=h,h.ClassName="U16Type";class p extends l{constructor(){super("i16",2,!0)}getClassName(){return p.ClassName}}t.I16Type=p,p.ClassName="I16Type";class g extends l{constructor(){super("u32",4,!1)}getClassName(){return g.ClassName}}t.U32Type=g,g.ClassName="U32Type";class m extends l{constructor(){super("i32",4,!0)}getClassName(){return m.ClassName}}t.I32Type=m,m.ClassName="I32Type";class y extends l{constructor(){super("u64",8,!1)}getClassName(){return y.ClassName}}t.U64Type=y,y.ClassName="U64Type";class A extends l{constructor(){super("i64",8,!0)}getClassName(){return A.ClassName}}t.I64Type=A,A.ClassName="I64Type";class b extends l{constructor(){super("BigUint",0,!1)}getClassName(){return b.ClassName}}t.BigUIntType=b,b.ClassName="BigUIntType";class T extends l{constructor(){super("Bigint",0,!0)}getClassName(){return T.ClassName}}t.BigIntType=T,T.ClassName="BigIntType";class w extends c.PrimitiveValue{constructor(e,t){if(super(e),"bigint"==typeof t&&(t=t.toString()),this.value=new o.default(t),this.sizeInBytes=e.sizeInBytes,this.withSign=e.withSign,this.value.isNaN())throw new u.ErrInvalidArgument(`not a number: ${t}`);if(!this.withSign&&this.value.isNegative())throw new u.ErrInvalidArgument(`negative, but type is unsigned: ${t}`)}getClassName(){return w.ClassName}equals(e){return this.value.isEqualTo(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.NumericalValue=w,w.ClassName="NumericalValue";class v extends w{constructor(e){super(new d,e)}getClassName(){return v.ClassName}}t.U8Value=v,v.ClassName="U8Value";class I extends w{constructor(e){super(new f,e)}getClassName(){return I.ClassName}}t.I8Value=I,I.ClassName="I8Value";class S extends w{constructor(e){super(new h,e)}getClassName(){return S.ClassName}}t.U16Value=S,S.ClassName="U16Value";class E extends w{constructor(e){super(new p,e)}getClassName(){return E.ClassName}}t.I16Value=E,E.ClassName="I16Value";class C extends w{constructor(e){super(new g,e)}getClassName(){return C.ClassName}}t.U32Value=C,C.ClassName="U32Value";class _ extends w{constructor(e){super(new m,e)}getClassName(){return _.ClassName}}t.I32Value=_,_.ClassName="I32Value";class B extends w{constructor(e){super(new y,e)}getClassName(){return B.ClassName}}t.U64Value=B,B.ClassName="U64Value";class O extends w{constructor(e){super(new A,e)}getClassName(){return O.ClassName}}t.I64Value=O,O.ClassName="I64Value";class N extends w{constructor(e){super(new b,e)}getClassName(){return N.ClassName}}t.BigUIntValue=N,N.ClassName="BigUIntValue";class x extends w{constructor(e){super(new T,e)}getClassName(){return x.ClassName}}t.BigIntValue=x,x.ClassName="BigIntValue"},6514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringValue=t.StringType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("utf-8 string")}getClassName(){return i.ClassName}}t.StringType=i,i.ClassName="StringType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){return new s(e)}static fromHex(e){let t=Buffer.from(e,"hex").toString();return new s(t)}getLength(){return this.value.length}equals(e){return this.value===e.value}valueOf(){return this.value}}t.StringValue=s,s.ClassName="StringValue"},7586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Struct=t.StructType=void 0;const r=n(2581),i=n(5766),s=n(5626);class a extends s.CustomType{constructor(e,t){super(e),this.fieldsDefinitions=[],this.fieldsDefinitions=t}getClassName(){return a.ClassName}static fromJSON(e){let t=(e.fields||[]).map((e=>i.FieldDefinition.fromJSON(e)));return new a(e.name,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return i.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.StructType=a,a.ClassName="StructType";class o extends s.TypedValue{constructor(e,t){super(e),this.fields=t,this.fieldsByName=new Map(t.map((e=>[e.name,e]))),this.checkTyping()}getClassName(){return o.ClassName}checkTyping(){let e=this.getType().getFieldsDefinitions();i.Fields.checkTyping(this.fields,e)}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new r.ErrMissingFieldOnStruct(e,this.getType().getName())}valueOf(){let e={};for(const t of this.fields)e[t.name]=t.value.valueOf();return e}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),n=e.getFields();return i.Fields.equals(t,n)}}t.Struct=o,o.ClassName="Struct"},3145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierValue=t.TokenIdentifierType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("TokenIdentifier")}getClassName(){return i.ClassName}}t.TokenIdentifierType=i,i.ClassName="TokenIdentifierType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}static egld(){return new s("EGLD")}static esdtTokenIdentifier(e){return new s(e)}getClassName(){return s.ClassName}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value==e.value}valueOf(){return this.value}toString(){return this.value.toString()}}t.TokenIdentifierValue=s,s.ClassName="TokenIdentifierValue"},1025:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Tuple=t.TupleType=void 0;const a=s(n(2581)),o=n(5766),u=n(7586);class c extends u.StructType{constructor(...e){super(c.prepareName(e),c.prepareFieldDefinitions(e))}getClassName(){return c.ClassName}static prepareName(e){return`tuple<${e.map((e=>e.toString())).join(", ")}>`}static prepareFieldDefinitions(e){return e.map(((e,t)=>new o.FieldDefinition(l(t),"anonymous tuple field",e)))}}function l(e){return`field${e}`}t.TupleType=c,c.ClassName="TupleType";class d extends u.Struct{constructor(e,t){super(e,t)}getClassName(){return d.ClassName}static fromItems(e){if(e.length<1)throw new a.ErrTypingSystem("bad tuple items");let t=e.map((e=>e.getType())),n=new c(...t),r=e.map(((e,t)=>new o.Field(e,l(t))));return new d(n,r)}}t.Tuple=d,d.ClassName="Tuple"},7966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeExpressionParser=void 0;const r=n(9132),i=n(2581),s=n(5626);t.TypeExpressionParser=class{constructor(){this.backingTypeFormulaParser=new r.TypeFormulaParser}parse(e){try{return this.doParse(e)}catch(t){throw new i.ErrTypingSystem(`Failed to parse type expression: ${e}. Error: ${t}`)}}doParse(e){const t=this.backingTypeFormulaParser.parseExpression(e);return this.typeFormulaToType(t)}typeFormulaToType(e){const t=e.typeParameters.map((e=>this.typeFormulaToType(e)));return new s.Type(e.name,t)}}},7654:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeMapper=void 0;const a=s(n(2581)),o=n(8551),u=n(1055),c=n(3979),l=n(1392),d=n(1847),f=n(7472),h=n(1414),p=n(5766),g=n(926),m=n(177),y=n(1038),A=n(1782),b=n(4473),T=n(6514),w=n(7586),v=n(3145),I=n(1025),S=n(6054);t.TypeMapper=class{constructor(e=[]){this.openTypesFactories=new Map([["Option",(...e)=>new g.OptionType(e[0])],["List",(...e)=>new g.ListType(e[0])],["VarArgs",(...e)=>new S.VariadicType(e[0])],["MultiResultVec",(...e)=>new S.VariadicType(e[0])],["variadic",(...e)=>new S.VariadicType(e[0])],["counted-variadic",(...e)=>new S.VariadicType(e[0],!0)],["OptionalArg",(...e)=>new u.OptionalType(e[0])],["optional",(...e)=>new u.OptionalType(e[0])],["OptionalResult",(...e)=>new u.OptionalType(e[0])],["multi",(...e)=>new f.CompositeType(...e)],["MultiArg",(...e)=>new f.CompositeType(...e)],["MultiResult",(...e)=>new f.CompositeType(...e)],["multi",(...e)=>new f.CompositeType(...e)],["tuple",(...e)=>new I.TupleType(...e)],["tuple2",(...e)=>new I.TupleType(...e)],["tuple3",(...e)=>new I.TupleType(...e)],["tuple4",(...e)=>new I.TupleType(...e)],["tuple5",(...e)=>new I.TupleType(...e)],["tuple6",(...e)=>new I.TupleType(...e)],["tuple7",(...e)=>new I.TupleType(...e)],["tuple8",(...e)=>new I.TupleType(...e)],["array2",(...e)=>new m.ArrayVecType(2,e[0])],["array8",(...e)=>new m.ArrayVecType(8,e[0])],["array16",(...e)=>new m.ArrayVecType(16,e[0])],["array20",(...e)=>new m.ArrayVecType(20,e[0])],["array32",(...e)=>new m.ArrayVecType(32,e[0])],["array46",(...e)=>new m.ArrayVecType(46,e[0])],["array48",(...e)=>new m.ArrayVecType(48,e[0])],["array64",(...e)=>new m.ArrayVecType(64,e[0])],["array128",(...e)=>new m.ArrayVecType(128,e[0])],["array256",(...e)=>new m.ArrayVecType(256,e[0])]]),this.closedTypesMap=new Map([["u8",new b.U8Type],["u16",new b.U16Type],["u32",new b.U32Type],["u64",new b.U64Type],["U64",new b.U64Type],["BigUint",new b.BigUIntType],["i8",new b.I8Type],["i16",new b.I16Type],["i32",new b.I32Type],["i64",new b.I64Type],["Bigint",new b.BigIntType],["BigInt",new b.BigIntType],["bool",new c.BooleanType],["bytes",new l.BytesType],["Address",new o.AddressType],["H256",new y.H256Type],["utf-8 string",new T.StringType],["TokenIdentifier",new v.TokenIdentifierType],["EgldOrEsdtTokenIdentifier",new v.TokenIdentifierType],["CodeMetadata",new d.CodeMetadataType],["nothing",new A.NothingType],["AsyncCall",new A.NothingType]]),this.learnedTypesMap=new Map;for(const t of e)this.learnedTypesMap.set(t.getName(),t)}mapType(e){let t=this.mapTypeRecursively(e);if(t)return t.isGenericType()||this.learnType(t),t;throw new a.ErrTypingSystem(`Cannot map the type "${e.getName()}" to a known type`)}mapTypeRecursively(e){let t=e.isGenericType(),n=this.learnedTypesMap.get(e.getName());return n||(this.closedTypesMap.get(e.getName())||(e.hasExactClass(h.EnumType.ClassName)?this.mapEnumType(e):e.hasExactClass(w.StructType.ClassName)?this.mapStructType(e):t?this.mapGenericType(e):null))}learnType(e){this.learnedTypesMap.delete(e.getName()),this.learnedTypesMap.set(e.getName(),e)}mapStructType(e){let t=this.mappedFields(e.getFieldsDefinitions());return new w.StructType(e.getName(),t)}mapEnumType(e){let t=e.variants.map((e=>new h.EnumVariantDefinition(e.name,e.discriminant,this.mappedFields(e.getFieldsDefinitions()))));return new h.EnumType(e.getName(),t)}mappedFields(e){return e.map((e=>new p.FieldDefinition(e.name,e.description,this.mapType(e.type))))}mapGenericType(e){let t=e.getTypeParameters().map((e=>this.mapType(e))),n=this.openTypesFactories.get(e.getName());if(!n)throw new a.ErrTypingSystem(`Cannot map the generic type "${e.getName()}" to a known type`);return n(...t)}}},5626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullType=t.TypePlaceholder=t.isTyped=t.PrimitiveValue=t.TypedValue=t.CustomType=t.PrimitiveType=t.TypeCardinality=t.Type=void 0;const r=n(6063),i=n(1069);class s{constructor(e,t=[],n=a.fixed(1)){i.guardValueIsSet("name",e),this.name=e,this.typeParameters=t,this.cardinality=n}getName(){return this.name}getClassName(){return s.ClassName}getClassHierarchy(){return r.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getFullyQualifiedName(){let e=this.getTypeParameters().map((e=>e.getFullyQualifiedName())).join(", ");return this.isGenericType()?`multiversx:types:${this.getName()}<${e}>`:`multiversx:types:${this.getName()}`}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}getTypeParameters(){return this.typeParameters}isGenericType(){return this.typeParameters.length>0}getFirstTypeParameter(){return i.guardTrue(this.typeParameters.length>0,"type parameters length > 0"),this.typeParameters[0]}toString(){let e=this.getTypeParameters().map((e=>e.toString())).join(", "),t=e?`<${e}>`:"";return`${this.name}${t}`}equals(e){return s.equals(this,e)}static equals(e,t){return e.getFullyQualifiedName()==t.getFullyQualifiedName()}static equalsMany(e,t){return e.every(((e,n)=>e.equals(t[n])))}static isAssignableFromMany(e,t){return e.every(((e,n)=>e.isAssignableFrom(t[n])))}differs(e){return!this.equals(e)}valueOf(){return this.name}isAssignableFrom(e){if(!s.equalsMany(this.getTypeParameters(),e.getTypeParameters()))return!1;let t=this.getFullyQualifiedName();return!!s.getFullyQualifiedNamesInHierarchy(e).includes(t)||e.hasClassOrSuperclass(this.getClassName())}static getFullyQualifiedNamesInHierarchy(e){return r.getJavascriptPrototypesInHierarchy(e,(e=>e.belongsToTypesystem)).map((t=>t.getFullyQualifiedName.call(e)))}getNamesOfDependencies(){const e=[];for(const t of this.typeParameters)e.push(t.getName()),e.push(...t.getNamesOfDependencies());return[...new Set(e)]}toJSON(){return{name:this.name,typeParameters:this.typeParameters.map((e=>e.toJSON()))}}getCardinality(){return this.cardinality}belongsToTypesystem(){}}t.Type=s,s.ClassName="Type";class a{constructor(e,t){this.lowerBound=e,this.upperBound=t}static fixed(e){return new a(e,e)}static variable(e){return new a(0,e)}isSingular(){return 1==this.lowerBound&&1==this.upperBound}isSingularOrNone(){return 0==this.lowerBound&&1==this.upperBound}isComposite(){return 1!=this.upperBound}isFixed(){return this.lowerBound==this.upperBound}getLowerBound(){return this.lowerBound}getUpperBound(){return this.upperBound||a.MaxCardinality}}t.TypeCardinality=a,a.MaxCardinality=4096;class o extends s{constructor(e){super(e)}getClassName(){return o.ClassName}}t.PrimitiveType=o,o.ClassName="PrimitiveType";class u extends s{getClassName(){return u.ClassName}}t.CustomType=u,u.ClassName="CustomType";class c{constructor(e){this.type=e}getClassName(){return c.ClassName}getClassHierarchy(){return r.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getType(){return this.type}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}belongsToTypesystem(){}}t.TypedValue=c,c.ClassName="TypedValue";class l extends c{constructor(e){super(e)}getClassName(){return l.ClassName}}t.PrimitiveValue=l,l.ClassName="PrimitiveValue",t.isTyped=function(e){return void 0!==e.belongsToTypesystem};class d extends s{constructor(){super("...")}getClassName(){return d.ClassName}}t.TypePlaceholder=d,d.ClassName="TypePlaceholder";class f extends s{constructor(){super("?")}getClassName(){return f.ClassName}}t.NullType=f,f.ClassName="NullType"},6054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariadicValue=t.CountedVariadicType=t.VariadicType=void 0;const r=n(5626);class i extends r.Type{constructor(e,t=!1){super("Variadic",[e],r.TypeCardinality.variable()),this.isCounted=t}getClassName(){return i.ClassName}}t.VariadicType=i,i.ClassName="VariadicType";class s extends r.Type{constructor(e){super("Variadic",[e],r.TypeCardinality.variable())}getClassName(){return i.ClassName}}t.CountedVariadicType=s,s.ClassName="VariadicType";class a extends r.TypedValue{constructor(e,t){super(e),this.items=t}getClassName(){return a.ClassName}static fromItems(...e){return this.createFromItems(e,!1)}static fromItemsCounted(...e){return this.createFromItems(e,!0)}static createFromItems(e,t){if(0==e.length)return new a(new i(new r.TypePlaceholder,t),[]);const n=e[0].getType();return new a(new i(n,t),e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}t.VariadicValue=a,a.ClassName="VariadicValue"},8390:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToHex=t.addressToHex=t.bigIntToHex=t.utf8ToHex=t.bigIntToBuffer=t.bufferToBigInt=t.stringToBuffer=void 0;const o=a(n(1594)),u=s(n(7553)),c=s(n(9161));t.stringToBuffer=function(e){return Buffer.from(e)},t.bufferToBigInt=function(e){return 0==e.length?new o.default(0):u.bufferToBigInt(e)},t.bigIntToBuffer=function(e){return 0==e?Buffer.from([]):u.bigIntToBuffer(e)};var l=n(9161);Object.defineProperty(t,"utf8ToHex",{enumerable:!0,get:function(){return l.utf8ToHex}}),Object.defineProperty(t,"bigIntToHex",{enumerable:!0,get:function(){return l.bigIntToHex}}),Object.defineProperty(t,"addressToHex",{enumerable:!0,get:function(){return l.addressToHex}}),t.bufferToHex=function(e){const t=e.toString("hex");return c.zeroPadStringIfOddLength(t)}},3856:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(9229),t),i(n(7384),t),i(n(1772),t)},9229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsFactory=void 0;const r=n(7353),i=n(6458),s=n(3500),a=n(476),o=n(3548),u=n(8390);t.TokenOperationsFactory=class{constructor(e){this.config=e,this.trueAsHex=u.utf8ToHex("true"),this.falseAsHex=u.utf8ToHex("false")}issueFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issue",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.bigIntToHex(e.initialSupply),u.bigIntToHex(e.numDecimals),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}notifyAboutUnsettingBurnRoleGlobally(){i.Logger.info('\n==========\nIMPORTANT!\n==========\nYou are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally).\nOnce the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).')}issueSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issueSemiFungible",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}issueNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issueNonFungible",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}registerMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerMetaESDT",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.bigIntToHex(e.numDecimals),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}registerAndSetAllRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerAndSetAllRoles",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex(e.tokenType),u.bigIntToHex(e.numDecimals)];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}setBurnRoleGlobally(e){const t=["setBurnRoleGlobally",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:t})}unsetBurnRoleGlobally(e){const t=["unsetBurnRoleGlobally",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:t})}setSpecialRoleOnFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleLocalMint?[u.utf8ToHex("ESDTRoleLocalMint")]:[],...e.addRoleLocalBurn?[u.utf8ToHex("ESDTRoleLocalBurn")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}setSpecialRoleOnSemiFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleNFTCreate?[u.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[u.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTAddQuantity?[u.utf8ToHex("ESDTRoleNFTAddQuantity")]:[],...e.addRoleESDTTransferRole?[u.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}setSpecialRoleOnMetaESDT(e){return this.setSpecialRoleOnSemiFungible(e)}setSpecialRoleOnNonFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleNFTCreate?[u.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[u.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTUpdateAttributes?[u.utf8ToHex("ESDTRoleNFTUpdateAttributes")]:[],...e.addRoleNFTAddURI?[u.utf8ToHex("ESDTRoleNFTAddURI")]:[],...e.addRoleESDTTransferRole?[u.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}nftCreate(e){const t=["ESDTNFTCreate",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.initialQuantity),u.utf8ToHex(e.name),u.bigIntToHex(e.royalties),u.utf8ToHex(e.hash),u.bufferToHex(e.attributes),...e.uris.map(u.utf8ToHex)],n=(e.name+e.hash+e.attributes+e.uris.join("")).length*this.config.gasLimitStorePerByte.valueOf();return this.createTransaction({sender:e.creator,receiver:e.creator,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTCreate.valueOf()+n.valueOf(),dataParts:t})}pause(e){const t=["pause",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:t})}unpause(e){const t=["unPause",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:t})}freeze(e){const t=["freeze",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:t})}unfreeze(e){const t=["unFreeze",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:t})}wipe(e){const t=["wipe",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitWiping,dataParts:t})}localMint(e){const t=["ESDTLocalMint",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.supplyToMint)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalMint,dataParts:t})}localBurn(e){const t=["ESDTLocalBurn",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.supplyToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalBurn,dataParts:t})}updateAttributes(e){const t=["ESDTNFTUpdateAttributes",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bufferToHex(e.attributes)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTUpdateAttributes,dataParts:t})}addQuantity(e){const t=["ESDTNFTAddQuantity",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bigIntToHex(e.quantityToAdd)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTAddQuantity,dataParts:t})}burnQuantity(e){const t=["ESDTNFTBurn",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bigIntToHex(e.quantityToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTBurn,dataParts:t})}createTransaction({sender:e,receiver:t,nonce:n,value:i,gasPrice:o,gasLimitHint:u,executionGasLimit:c,dataParts:l}){const d=this.buildTransactionPayload(l),f=u||this.computeGasLimit(d,c),h=new s.TransactionVersion(r.TRANSACTION_VERSION_DEFAULT),p=new s.TransactionOptions(r.TRANSACTION_OPTIONS_DEFAULT);return new a.Transaction({chainID:this.config.chainID,sender:e,receiver:t,gasLimit:f,gasPrice:o,nonce:n||0,value:i||0,data:d,version:h,options:p})}buildTransactionPayload(e){const t=e.join(r.ARGUMENTS_SEPARATOR);return new o.TransactionPayload(t)}computeGasLimit(e,t){return this.config.minGasLimit.valueOf()+this.config.gasLimitPerByte.valueOf()*e.length()+t.valueOf()}}},7384:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsFactoryConfig=void 0;const r=n(236);t.TokenOperationsFactoryConfig=class{constructor(e){this.minGasPrice=1e9,this.minGasLimit=5e4,this.gasLimitPerByte=1500,this.gasLimitIssue=6e7,this.gasLimitToggleBurnRoleGlobally=6e7,this.gasLimitESDTLocalMint=3e5,this.gasLimitESDTLocalBurn=3e5,this.gasLimitSetSpecialRole=6e7,this.gasLimitPausing=6e7,this.gasLimitFreezing=6e7,this.gasLimitWiping=6e7,this.gasLimitESDTNFTCreate=3e6,this.gasLimitESDTNFTUpdateAttributes=1e6,this.gasLimitESDTNFTAddQuantity=1e6,this.gasLimitESDTNFTBurn=1e6,this.gasLimitStorePerByte=5e4,this.issueCost="50000000000000000",this.esdtContractAddress=r.Address.fromBech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"),this.chainID=e}}},1772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(8390);t.TokenOperationsOutcomeParser=class{parseIssueFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issue");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseIssueNonFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issueNonFungible");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseIssueSemiFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issueSemiFungible");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseRegisterMetaESDT(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"registerMetaESDT");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseRegisterAndSetAllRoles(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"registerAndSetAllRoles");return{tokenIdentifier:this.extractTokenIdentifier(t),roles:this.findSingleEventByIdentifier(e,"ESDTSetRole").topics.slice(3).map((e=>e.valueOf().toString()))}}parseSetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseUnsetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseSetSpecialRole(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTSetRole");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),roles:t.topics.slice(3).map((e=>e.valueOf().toString()))}}parseNFTCreate(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTCreate");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),initialQuantity:this.extractAmount(t)}}parseLocalMint(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTLocalMint");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),mintedSupply:this.extractAmount(t)}}parseLocalBurn(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTLocalBurn");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),burntSupply:this.extractAmount(t)}}parsePause(e){return this.ensureNoError(e),this.findSingleEventByIdentifier(e,"ESDTPause"),{}}parseUnpause(e){return this.ensureNoError(e),this.findSingleEventByIdentifier(e,"ESDTUnPause"),{}}parseFreeze(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTFreeze"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseUnfreeze(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTUnFreeze"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseWipe(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTWipe"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseUpdateAttributes(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTUpdateAttributes"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=t.topics[3]?.valueOf();return{tokenIdentifier:n,nonce:r,attributes:i}}parseAddQuantity(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTAddQuantity");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),addedQuantity:this.extractAmount(t)}}parseBurnQuantity(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTBurn");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),burntQuantity:this.extractAmount(t)}}ensureNoError(e){for(const t of e.logs.events)if("signalError"==t.identifier){const n=Buffer.from(t.data.substring(1),"hex").toString(),r=t.topics[1]?.valueOf().toString();throw new i.ErrCannotParseTransactionOutcome(e.hash,`encountered signalError: ${r} (${n})`)}}findSingleEventByIdentifier(e,t){const n=this.gatherAllEvents(e).filter((e=>e.identifier==t));if(0==n.length)throw new i.ErrCannotParseTransactionOutcome(e.hash,`cannot find event of type ${t}`);if(n.length>1)throw new i.ErrCannotParseTransactionOutcome(e.hash,`more than one event of type ${t}`);return n[0]}gatherAllEvents(e){const t=[];t.push(...e.logs.events);for(const n of e.contractResults.items)t.push(...n.logs.events);return t}extractTokenIdentifier(e){return e.topics[0]?.valueOf().toString()}extractNonce(e){return s.bufferToBigInt(e.topics[1]?.valueOf()).toFixed(0)}extractAmount(e){return s.bufferToBigInt(e.topics[2]?.valueOf()).toFixed(0)}extractAddress(e){return r.Address.fromBuffer(e.topics[3]?.valueOf()).toString()}}},5132:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenPayment=t.TokenComputer=t.TokenTransfer=t.Token=void 0;const i=r(n(1594)),s=n(2581),a=n(7353),o="EGLD";i.default.set({ROUNDING_MODE:1});class u{constructor(e){this.identifier=e.identifier,this.nonce=e.nonce||0n}}t.Token=u;class c{constructor(e){if(this.isLegacyTokenTransferOptions(e)){const t=new i.default(e.amountAsBigInteger);if(!t.isInteger()||t.isNegative())throw new s.ErrInvalidArgument(`bad amountAsBigInteger: ${e.amountAsBigInteger}`);this.tokenIdentifier=e.tokenIdentifier,this.nonce=e.nonce,this.amountAsBigInteger=t,this.numDecimals=e.numDecimals||0,this.token=new u({identifier:e.tokenIdentifier,nonce:BigInt(e.nonce)}),this.amount=BigInt(this.amountAsBigInteger.toFixed(0))}else this.token=e.token,this.amount=e.amount,this.tokenIdentifier=e.token.identifier,this.nonce=Number(e.token.nonce),this.amountAsBigInteger=new i.default(this.amount.toString()),this.numDecimals=0}static newFromEgldAmount(e){const t=new u({identifier:a.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER});return new c({token:t,amount:e})}isLegacyTokenTransferOptions(e){return void 0!==e.tokenIdentifier}static egldFromAmount(e){const t=new i.default(e).shiftedBy(18).decimalPlaces(0);return this.egldFromBigInteger(t)}static egldFromBigInteger(e){return new c({tokenIdentifier:o,nonce:0,amountAsBigInteger:e,numDecimals:18})}static fungibleFromAmount(e,t,n){const r=new i.default(t).shiftedBy(n).decimalPlaces(0);return this.fungibleFromBigInteger(e,r,n)}static fungibleFromBigInteger(e,t,n=0){return new c({tokenIdentifier:e,nonce:0,amountAsBigInteger:t,numDecimals:n})}static nonFungible(e,t){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:1,numDecimals:0})}static semiFungible(e,t,n){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:0})}static metaEsdtFromAmount(e,t,n,r){const s=new i.default(n).shiftedBy(r).decimalPlaces(0);return this.metaEsdtFromBigInteger(e,t,s,r)}static metaEsdtFromBigInteger(e,t,n,r=0){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:r})}toString(){return this.amount.toString()}valueOf(){return new i.default(this.amount.toString())}toPrettyString(){return`${this.toAmount()} ${this.tokenIdentifier}`}toAmount(){return this.amountAsBigInteger.shiftedBy(-this.numDecimals).toFixed(this.numDecimals)}isEgld(){return this.token.identifier==o}isFungible(){return 0n==this.token.nonce}}t.TokenTransfer=c,t.TokenComputer=class{constructor(){}isFungible(e){return 0n===e.nonce}extractNonceFromExtendedIdentifier(e){const t=e.split("-");if(this.checkIfExtendedIdentifierWasProvided(t),this.checkLengthOfRandomSequence(t[1]),2==t.length)return 0;return(n=Buffer.from(t[2],"hex")).readUIntBE(0,n.length);var n}extractIdentifierFromExtendedIdentifier(e){const t=e.split("-");return this.checkIfExtendedIdentifierWasProvided(t),this.ensureTokenTickerValidity(t[0]),this.checkLengthOfRandomSequence(t[1]),t[0]+"-"+t[1]}checkIfExtendedIdentifierWasProvided(e){if(e.length<2||e.length>3)throw new s.ErrInvalidTokenIdentifier("Invalid extended token identifier provided")}checkLengthOfRandomSequence(e){if(6!==e.length)throw new s.ErrInvalidTokenIdentifier("The identifier is not valid. The random sequence does not have the right length")}ensureTokenTickerValidity(e){if(e.length<3||e.length>10)throw new s.ErrInvalidTokenIdentifier("The token ticker should be between 3 and 10 characters");if(!e.match(/^[a-zA-Z0-9]+$/))throw new s.ErrInvalidTokenIdentifier("The token ticker should only contain alphanumeric characters");if(e!=e.toUpperCase())throw new s.ErrInvalidTokenIdentifier("The token ticker should be upper case")}},t.TokenPayment=class extends c{constructor(e,t,n,r){super({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:r})}}},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionHash=t.Transaction=void 0;const r=n(1594),i=n(236),s=n(7353),a=n(6659),o=n(9342),u=n(3500),c=n(9874),l=n(3548),d=n(9825);t.Transaction=class{constructor(e){this.nonce=BigInt(e.nonce?.valueOf()||0n),this.value=e.value?BigInt(new r.BigNumber(e.value.toString()).toFixed(0)):0n,this.sender=this.addressAsBech32(e.sender),this.receiver=this.addressAsBech32(e.receiver),this.senderUsername=e.senderUsername||"",this.receiverUsername=e.receiverUsername||"",this.gasPrice=BigInt(e.gasPrice?.valueOf()||s.TRANSACTION_MIN_GAS_PRICE),this.gasLimit=BigInt(e.gasLimit.valueOf()),this.data=e.data?.valueOf()||new Uint8Array,this.chainID=e.chainID.valueOf(),this.version=Number(e.version?.valueOf()||s.TRANSACTION_VERSION_DEFAULT),this.options=Number(e.options?.valueOf()||s.TRANSACTION_OPTIONS_DEFAULT),this.guardian=e.guardian?this.addressAsBech32(e.guardian):"",this.signature=e.signature||Buffer.from([]),this.guardianSignature=e.guardianSignature||Buffer.from([]),this.relayer=e.relayer||"",this.innerTransactions=e.innerTransactions||[]}addressAsBech32(e){return"string"==typeof e?e:e.bech32()}getNonce(){return Number(this.nonce)}setNonce(e){this.nonce=BigInt(e.valueOf())}getValue(){return this.value}setValue(e){this.value=BigInt(e.toString())}getSender(){return i.Address.fromBech32(this.sender)}setSender(e){this.sender="string"==typeof e?e:e.bech32()}getReceiver(){return i.Address.fromBech32(this.receiver)}getSenderUsername(){return this.senderUsername}setSenderUsername(e){this.senderUsername=e}getReceiverUsername(){return this.receiverUsername}setReceiverUsername(e){this.receiverUsername=e}getGuardian(){return new i.Address(this.guardian)}getGasPrice(){return Number(this.gasPrice)}setGasPrice(e){this.gasPrice=BigInt(e.valueOf())}getGasLimit(){return Number(this.gasLimit)}setGasLimit(e){this.gasLimit=BigInt(e.valueOf())}getData(){return new l.TransactionPayload(Buffer.from(this.data))}getChainID(){return this.chainID}setChainID(e){this.chainID=e.valueOf()}getVersion(){return new u.TransactionVersion(this.version)}setVersion(e){this.version=e.valueOf()}getOptions(){return new u.TransactionOptions(this.options.valueOf())}setOptions(e){this.options=e.valueOf()}getSignature(){return Buffer.from(this.signature)}getGuardianSignature(){return Buffer.from(this.guardianSignature)}setGuardian(e){this.guardian="string"==typeof e?e:e.bech32()}getHash(){return f.compute(this)}serializeForSigning(){const e=(new d.TransactionComputer).computeBytesForSigning(this);return Buffer.from(e)}isGuardedTransaction(){const e=this.guardian.length>0,t=this.guardianSignature.length>0;return this.getOptions().isWithGuardian()&&e&&t}toPlainObject(){return(new a.TransactionsConverter).transactionToPlainObject(this)}static fromPlainObject(e){return(new a.TransactionsConverter).plainObjectToTransaction(e)}applySignature(e){this.signature=c.interpretSignatureAsBuffer(e)}applyGuardianSignature(e){this.guardianSignature=c.interpretSignatureAsBuffer(e)}toSendable(){return this.toPlainObject()}computeFee(e){const t=(new d.TransactionComputer).computeTransactionFee(this,e);return new r.BigNumber(t.toString())}};class f extends o.Hash{constructor(e){super(e)}static compute(e){const t=(new d.TransactionComputer).computeTransactionHash(e);return new f(Buffer.from(t).toString("hex"))}}t.TransactionHash=f},9825:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionComputer=void 0;const o=a(n(1594)),u=n(7353),c=s(n(2581)),l=n(9277),d=n(476),f=n(2206),h=n(5508);t.TransactionComputer=class{constructor(){}computeTransactionFee(e,t){const n=BigInt(t.MinGasLimit+e.data.length*t.GasPerDataByte);if(n>e.gasLimit)throw new c.ErrNotEnoughGas(parseInt(e.gasLimit.toString(),10));const r=e.gasPrice,i=n*r;return n===e.gasLimit?i:i+(e.gasLimit-n)*BigInt(new o.default(r.toString()).multipliedBy(new o.default(t.GasPriceModifier)).toFixed(0))}computeBytesForSigning(e){this.ensureValidTransactionFields(e);const t=this.toPlainObject(e),n=JSON.stringify(t);return new Uint8Array(Buffer.from(n))}computeBytesForVerifying(e){return this.hasOptionsSetForHashSigning(e)?this.computeHashForSigning(e):this.computeBytesForSigning(e)}computeHashForSigning(e){const t=this.toPlainObject(e),n=Buffer.from(JSON.stringify(t));return h("keccak256").update(n).digest()}computeTransactionHash(e){const t=(new l.ProtoSerializer).serializeTransaction(new d.Transaction(e)),n=f(32).update(t).digest("hex");return Buffer.from(n,"hex")}hasOptionsSetForGuardedTransaction(e){return(e.options&u.TRANSACTION_OPTIONS_TX_GUARDED)==u.TRANSACTION_OPTIONS_TX_GUARDED}hasOptionsSetForHashSigning(e){return(e.options&u.TRANSACTION_OPTIONS_TX_HASH_SIGN)==u.TRANSACTION_OPTIONS_TX_HASH_SIGN}applyGuardian(e,t){e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|u.TRANSACTION_OPTIONS_TX_GUARDED,e.guardian=t}applyOptionsForHashSigning(e){e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|u.TRANSACTION_OPTIONS_TX_HASH_SIGN}toPlainObject(e,t){let n={nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data)};return t&&(n.signature=this.toHexOrUndefined(e.signature)),n.chainID=e.chainID,n.version=e.version,n.options=e.options?e.options:void 0,n.guardian=e.guardian?e.guardian:void 0,n.relayer=e.relayer?e.relayer:void 0,n.innerTransactions=e.innerTransactions.length?e.innerTransactions.map((e=>this.toPlainObject(e,!0))):void 0,n}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}ensureValidTransactionFields(e){if(!e.chainID.length)throw new c.ErrBadUsage("The `chainID` field is not set");if(e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(this.hasOptionsSetForGuardedTransaction(e)||this.hasOptionsSetForHashSigning(e)))throw new c.ErrBadUsage(`Non-empty transaction options requires transaction version >= ${u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS}`)}}},3548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionPayload=void 0;class n{constructor(e){this.data=Buffer.from(e||[])}static fromEncoded(e){if(!e)return new n("");let t=Buffer.from(e,"base64").toString();return new n(t)}isEmpty(){return 0==this.data.length}encoded(){return this.data.toString("base64")}valueOf(){return this.data}toString(){return this.data.toString()}getEncodedArguments(){return this.toString().split("@")}getRawArguments(){return this.getEncodedArguments().map((e=>Buffer.from(e,"hex")))}length(){return Buffer.from(this.data).length}}t.TransactionPayload=n},4650:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWatcher=void 0;const r=n(5519),i=n(7353),s=n(2581),a=n(6458);class o{constructor(e,t={}){this.fetcher=new u(e),this.pollingIntervalMilliseconds=t.pollingIntervalMilliseconds||o.DefaultPollingInterval,this.timeoutMilliseconds=t.timeoutMilliseconds||o.DefaultTimeout,this.patienceMilliseconds=t.patienceMilliseconds||o.DefaultPatience}async awaitPending(e){return this.awaitConditionally((e=>e.status.isPending()),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}async awaitCompleted(e){return this.awaitConditionally((e=>{if(void 0===e.isCompleted)throw new s.ErrIsCompletedFieldIsMissingOnTransaction;return e.isCompleted}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}async awaitAllEvents(e,t){return this.awaitConditionally((e=>{const n=this.getAllTransactionEvents(e).map((e=>e.identifier));return t.every((e=>n.includes(e)))}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionEventsNotFound))}async awaitAnyEvent(e,t){return this.awaitConditionally((e=>{const n=this.getAllTransactionEvents(e).map((e=>e.identifier));return null!=t.find((e=>n.includes(e)))}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionEventsNotFound))}async awaitOnCondition(e,t){return this.awaitConditionally(t,(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}transactionOrTxHashToTxHash(e){const t="string"==typeof e?e:e.getHash().hex();if(t.length!==i.HEX_TRANSACTION_HASH_LENGTH)throw new s.Err(`Invalid transaction hash length. The length of a hex encoded hash should be ${i.HEX_TRANSACTION_HASH_LENGTH}.`);return t}async awaitConditionally(e,t,n){const i=new r.AsyncTimer("watcher:periodic"),o=new r.AsyncTimer("watcher:patience"),u=new r.AsyncTimer("watcher:timeout");let c,l=!1,d=!1;for(u.start(this.timeoutMilliseconds).finally((()=>{u.stop(),l=!0}));!l;){await i.start(this.pollingIntervalMilliseconds);try{if(c=await t(),d=e(c),d||l)break}catch(e){if(a.Logger.debug("TransactionWatcher.awaitConditionally(): cannot (yet) fetch data."),e instanceof s.ErrIsCompletedFieldIsMissingOnTransaction)throw e;if(!(e instanceof s.Err))throw e}}if(d&&await o.start(this.patienceMilliseconds),u.isStopped()||u.stop(),!c||!d)throw n();return c}getAllTransactionEvents(e){const t=[...e.logs.events];for(const n of e.contractResults.items)t.push(...n.logs.events);return t}}t.TransactionWatcher=o,o.DefaultPollingInterval=6e3,o.DefaultTimeout=15*o.DefaultPollingInterval,o.DefaultPatience=0,o.NoopOnStatusReceived=e=>{};class u{constructor(e){this.fetcher=e}async getTransaction(e){return a.Logger.debug(`transactionWatcher, getTransaction(${e})`),await this.fetcher.getTransaction(e)}}},6520:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountTransactionsFactory=void 0;const r=n(236),i=n(4059);t.AccountTransactionsFactory=class{constructor(e){this.config=e.config}createTransactionForSavingKeyValue(e){const t=["SaveKeyValue",...this.computeDataPartsForSavingKeyValue(e.keyValuePairs)],n=this.computeExtraGasForSavingKeyValue(e.keyValuePairs);return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}computeExtraGasForSavingKeyValue(e){let t=0n;return e.forEach(((e,n)=>{t+=this.config.gasLimitPersistPerByte*BigInt(n.length+e.length)+this.config.gasLimitStorePerByte*BigInt(e.length)})),t+this.config.gasLimitSaveKeyValue}computeDataPartsForSavingKeyValue(e){const t=[];return e.forEach(((e,n)=>{t.push(Buffer.from(n).toString("hex"),Buffer.from(e).toString("hex"))})),t}createTransactionForSettingGuardian(e){const t=["SetGuardian",r.Address.fromBech32(e.guardianAddress.bech32()).toHex(),Buffer.from(e.serviceID).toString("hex")];return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitSetGuardian,addDataMovementGas:!0}).build()}createTransactionForGuardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["GuardAccount"],gasLimit:this.config.gasLimitGuardAccount,addDataMovementGas:!0}).build()}createTransactionForUnguardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["UnGuardAccount"],gasLimit:this.config.gasLimitUnguardAccount,addDataMovementGas:!0}).build()}}},7673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(661),o=n(4059);t.DelegationTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new a.ArgSerializer,this.delegationManagerAddress=r.Address.fromHex(i.DELEGATION_MANAGER_SC_ADDRESS_HEX,this.config.addressHrp)}createTransactionForNewDelegationContract(e){const t=["createNewDelegationContract",...this.argSerializer.valuesToStrings([new a.BigUIntValue(e.totalDelegationCap),new a.BigUIntValue(e.serviceFee)])],n=this.config.gasLimitCreateDelegationContract+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.delegationManagerAddress,dataParts:t,gasLimit:n,addDataMovementGas:!0,amount:e.amount}).build()}createTransactionForAddingNodes(e){if(e.publicKeys.length!==e.signedMessages.length)throw new s.Err("The number of public keys should match the number of signed messages");const t=e.signedMessages.map((e=>new a.BytesValue(Buffer.from(e)))),n=this.argSerializer.valuesToStrings(t),r=e.publicKeys.length,i=["addNodes"];for(let t=0;t<r;t++)i.push(e.publicKeys[t].hex(),n[t]);return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:i,gasLimit:this.computeExecutionGasLimitForNodesManagement(r),addDataMovementGas:!0}).build()}createTransactionForRemovingNodes(e){const t=["removeNodes"];for(const n of e.publicKeys)t.push(n.hex());const n=e.publicKeys.length;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(n),addDataMovementGas:!0}).build()}createTransactionForStakingNodes(e){let t=["stakeNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitStake+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnbondingNodes(e){let t=["unBondNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnbond+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnstakingNodes(e){let t=["unStakeNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnstake+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnjailingNodes(e){const t=["unJailNodes"];for(const n of e.publicKeys)t.push(n.hex());const n=e.publicKeys.length;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(n),addDataMovementGas:!0,amount:e.amount}).build()}createTransactionForChangingServiceFee(e){const t=["changeServiceFee",this.argSerializer.valuesToStrings([new a.BigUIntValue(e.serviceFee)])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForModifyingDelegationCap(e){const t=["modifyTotalDelegationCap",this.argSerializer.valuesToStrings([new a.BigUIntValue(e.delegationCap)])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new a.StringValue("true")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnsettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new a.StringValue("false")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new a.StringValue("true")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnsettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new a.StringValue("false")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingMetadata(e){const t=["setMetaData",...this.argSerializer.valuesToStrings([new a.StringValue(e.name),new a.StringValue(e.website),new a.StringValue(e.identifier)])],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}computeExecutionGasLimitForNodesManagement(e){const t=this.config.additionalGasLimitPerValidatorNode*BigInt(e);return this.config.gasLimitDelegationOperations+t}}},3102:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7673),t),i(n(2713),t),i(n(9712),t),i(n(6943),t),i(n(3473),t),i(n(4934),t),i(n(6520),t)},2713:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionsFactory=void 0;const i=r(n(1594)),s=n(236),a=n(2581),o=n(661),u=n(476),c=n(1013);t.RelayedTransactionsFactory=class{constructor(e){this.config=e.config}createRelayedV1Transaction(e){if(!e.innerTransaction.gasLimit)throw new a.ErrInvalidInnerTransaction("The gas limit is not set for the inner transaction");if(!e.innerTransaction.signature.length)throw new a.ErrInvalidInnerTransaction("The inner transaction is not signed");const t=this.prepareInnerTransactionForRelayedV1(e.innerTransaction),n=`relayedTx@${Buffer.from(t).toString("hex")}`,r=this.config.gasLimitPerByte*BigInt(n.length),i=this.config.minGasLimit+r+e.innerTransaction.gasLimit;return new u.Transaction({chainID:this.config.chainID,sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,gasLimit:i,data:Buffer.from(n)})}createRelayedV2Transaction(e){if(e.innerTransaction.gasLimit)throw new a.ErrInvalidInnerTransaction("The gas limit should not be set for the inner transaction");if(!e.innerTransaction.signature.length)throw new a.ErrInvalidInnerTransaction("The inner transaction is not signed");const{argumentsString:t}=(new o.ArgSerializer).valuesToString([new o.AddressValue(s.Address.fromBech32(e.innerTransaction.receiver)),new o.U64Value(new i.default(e.innerTransaction.nonce.toString())),new o.BytesValue(Buffer.from(e.innerTransaction.data)),new o.BytesValue(Buffer.from(e.innerTransaction.signature))]),n=`relayedTxV2@${t}`,r=this.config.gasLimitPerByte*BigInt(n.length),c=e.innerTransactionGasLimit+this.config.minGasLimit+r;return new u.Transaction({sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,value:0n,gasLimit:c,chainID:this.config.chainID,data:Buffer.from(n),version:e.innerTransaction.version,options:e.innerTransaction.options})}createRelayedV3Transaction(e){if(!e.innerTransactions.length)throw new a.ErrInvalidInnerTransaction("No inner transctions provided");let t=0n;for(const n of e.innerTransactions){if(!n.signature.length)throw new a.ErrInvalidInnerTransaction("Inner transaction is not signed");if(n.relayer!==e.relayerAddress.bech32())throw new a.ErrInvalidInnerTransaction("The inner transaction has an incorrect relayer address");t+=n.gasLimit}const n=this.config.minGasLimit*BigInt(e.innerTransactions.length)+t;return new u.Transaction({sender:e.relayerAddress.bech32(),receiver:e.relayerAddress.bech32(),chainID:this.config.chainID,gasLimit:n,innerTransactions:e.innerTransactions})}prepareInnerTransactionForRelayedV1(e){const t={nonce:e.nonce,sender:s.Address.newFromBech32(e.sender).getPublicKey().toString("base64"),receiver:s.Address.newFromBech32(e.receiver).getPublicKey().toString("base64"),value:e.value,gasPrice:e.gasPrice,gasLimit:e.gasLimit,data:Buffer.from(e.data).toString("base64"),signature:Buffer.from(e.signature).toString("base64"),chainID:Buffer.from(e.chainID).toString("base64"),version:e.version,options:0==e.options.valueOf()?void 0:e.options,guardian:e.guardian?s.Address.newFromBech32(e.guardian).getPublicKey().toString("base64"):void 0,guardianSignature:e.guardianSignature.length?Buffer.from(e.guardianSignature).toString("base64"):void 0,sndUserName:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,rcvUserName:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0};return c.stringify(t)}}},9712:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(6458),o=n(661),u=n(670),c=n(2747),l=n(5132),d=n(9161),f=n(5560),h=n(4059);t.SmartContractTransactionsFactory=class{constructor(e){this.config=e.config,this.abi=e.abi,this.tokenComputer=new l.TokenComputer,this.dataArgsBuilder=new f.TokenTransfersDataBuilder,this.contractDeployAddress=r.Address.fromHex(i.CONTRACT_DEPLOY_ADDRESS_HEX,this.config.addressHrp)}createTransactionForDeploy(e){const t=e.nativeTransferAmount??0n,n=e.isUpgradeable??!0,r=e.isReadable??!0,s=e.isPayable??!1,a=e.isPayableBySmartContract??!0,u=e.arguments||[],c=new o.CodeMetadata(n,r,s,a),l=[d.byteArrayToHex(e.bytecode),d.byteArrayToHex(i.VM_TYPE_WASM_VM),c.toString()],f=this.abi?.constructorDefinition,p=this.argsToDataParts(u,f);return l.push(...p),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.contractDeployAddress,dataParts:l,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}createTransactionForExecute(e){const t=e.arguments||[];let n=e.tokenTransfers?[...e.tokenTransfers]:[],r=e.nativeTransferAmount??0n,i=n.length;r&&i&&(n.push(l.TokenTransfer.newFromEgldAmount(r)),r=0n,i++);let s=e.contract,a=[];if(1===i){const t=n[0];this.tokenComputer.isFungible(t.token)?a=this.dataArgsBuilder.buildDataPartsForESDTTransfer(t):(a=this.dataArgsBuilder.buildDataPartsForSingleESDTNFTTransfer(t,s),s=e.sender)}else i>1&&(a=this.dataArgsBuilder.buildDataPartsForMultiESDTNFTTransfer(s,n),s=e.sender);a.push(a.length?d.utf8ToHex(e.function):e.function);const o=this.abi?.getEndpoint(e.function),u=this.argsToDataParts(t,o);return a.push(...u),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:s,dataParts:a,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:r}).build()}createTransactionForUpgrade(e){const t=e.nativeTransferAmount??0n,n=e.isUpgradeable??!0,r=e.isReadable??!0,i=e.isPayable??!1,s=e.isPayableBySmartContract??!0,a=e.arguments||[],u=new o.CodeMetadata(n,r,i,s),c=["upgradeContract",d.byteArrayToHex(e.bytecode),u.toString()],l=this.getEndpointForUpgrade(),f=this.argsToDataParts(a,l);return c.push(...f),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:c,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}getEndpointForUpgrade(){if(this.abi){if(this.abi.upgradeConstructorDefinition)return this.abi.upgradeConstructorDefinition;try{return this.abi.getEndpoint("upgrade")}catch(e){return a.Logger.warn("In the ABI, cannot find the 'upgrade' endpoint definition. Will use the constructor definition (fallback)."),this.abi.constructorDefinition}}}createTransactionForClaimingDeveloperRewards(e){return new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:["ClaimDeveloperRewards"],gasLimit:this.config.gasLimitClaimDeveloperRewards,addDataMovementGas:!1}).build()}createTransactionForChangingOwnerAddress(e){const t=["ChangeOwnerAddress",r.Address.fromBech32(e.newOwner.bech32()).toHex()];return new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:t,gasLimit:this.config.gasLimitChangeOwnerAddress,addDataMovementGas:!1}).build()}argsToDataParts(e,t){if(t){const n=u.NativeSerializer.nativeToTypedValues(e,t);return(new o.ArgSerializer).valuesToStrings(n)}if(this.areArgsOfTypedValue(e))return(new o.ArgSerializer).valuesToStrings(e);throw new s.Err("Can't convert args to TypedValues")}areArgsOfTypedValue(e){return e.every((e=>c.isTyped(e)))}}},6943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenManagementTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(6458),o=n(661),u=n(4059);t.TokenManagementTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new o.ArgSerializer,this.trueAsString="true",this.falseAsString="false",this.esdtContractAddress=r.Address.fromHex(i.ESDT_CONTRACT_ADDRESS_HEX,this.config.addressHrp)}createTransactionForIssuingFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.initialSupply),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issue",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issueSemiFungible",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issueNonFungible",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["registerMetaESDT",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringAndSettingRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerAndSetAllRoles",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType),new o.BigUIntValue(e.numDecimals)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForSettingBurnRoleGlobally(e){const t=["setBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForUnsettingBurnRoleGlobally(e){const t=["unsetBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleLocalMint&&t.push(new o.StringValue("ESDTRoleLocalMint")),e.addRoleLocalBurn&&t.push(new o.StringValue("ESDTRoleLocalBurn")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnSemiFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTAddQuantity&&t.push(new o.StringValue("ESDTRoleNFTAddQuantity")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole")),e.addRoleESDTModifyCreator&&t.push(new o.StringValue("ESDTRoleModifyCreator"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnMetaESDT(e){return this.createTransactionForSettingSpecialRoleOnSemiFungibleToken(e)}createTransactionForSettingSpecialRoleOnNonFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTUpdateAttributes&&t.push(new o.StringValue("ESDTRoleNFTUpdateAttributes")),e.addRoleNFTAddURI&&t.push(new o.StringValue("ESDTRoleNFTAddURI")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole")),e.addRoleESDTModifyCreator&&t.push(new o.StringValue("ESDTRoleModifyCreator")),e.addRoleNFTRecreate&&t.push(new o.StringValue("ESDTRoleNFTRecreate")),e.addRoleESDTSetNewURI&&t.push(new o.StringValue("ESDTRoleSetNewURI")),e.addRoleESDTModifyRoyalties&&t.push(new o.StringValue("ESDTRoleModifyRoyalties"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForCreatingNFT(e){const t=["ESDTNFTCreate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.initialQuantity),new o.StringValue(e.name),new o.BigUIntValue(e.royalties),new o.StringValue(e.hash),new o.BytesValue(Buffer.from(e.attributes)),...e.uris.map((e=>new o.StringValue(e)))])],n=e.name+e.hash+e.attributes+e.uris.join(""),r=this.config.gasLimitStorePerByte+BigInt(n.length);return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftCreate+r,addDataMovementGas:!0}).build()}createTransactionForPausing(e){const t=["pause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForUnpausing(e){const t=["unPause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForFreezing(e){const t=["freeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForUnfreezing(e){const t=["UnFreeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForWiping(e){const t=["wipe",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitWiping,addDataMovementGas:!0}).build()}createTransactionForLocalMint(e){const t=["ESDTLocalMint",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToMint)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalMint,addDataMovementGas:!0}).build()}createTransactionForLocalBurning(e){const t=["ESDTLocalBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToBurn)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalBurn,addDataMovementGas:!0}).build()}createTransactionForUpdatingAttributes(e){const t=["ESDTNFTUpdateAttributes",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BytesValue(Buffer.from(e.attributes))])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftUpdateAttributes,addDataMovementGas:!0}).build()}createTransactionForAddingQuantity(e){const t=["ESDTNFTAddQuantity",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToAdd)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftAddQuantity,addDataMovementGas:!0}).build()}createTransactionForBurningQuantity(e){const t=["ESDTNFTBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToBurn)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftBurn,addDataMovementGas:!0}).build()}createTransactionForModifyingRoyalties(e){const t=["ESDTModifyRoyalties",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.newRoyalties)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtModifyRoyalties,addDataMovementGas:!0}).build()}createTransactionForSettingNewUris(e){if(!e.newUris.length)throw new s.ErrBadUsage("No URIs provided");const t=["ESDTSetNewURIs",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newUris.map((e=>new o.StringValue(e)))])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitSetNewUris,addDataMovementGas:!0}).build()}createTransactionForModifyingCreator(e){const t=["ESDTModifyCreator",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtModifyCreator,addDataMovementGas:!0}).build()}createTransactionForUpdatingMetadata(e){const t=["ESDTMetaDataUpdate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newTokenName?[new o.StringValue(e.newTokenName)]:[],...e.newRoyalties?[new o.BigUIntValue(e.newRoyalties)]:[],...e.newHash?[new o.StringValue(e.newHash)]:[],...e.newAttributes?[new o.BytesValue(Buffer.from(e.newAttributes))]:[],...e.newUris?e.newUris.map((e=>new o.StringValue(e))):[]])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtMetadataUpdate,addDataMovementGas:!0}).build()}createTransactionForMetadataRecreate(e){const t=["ESDTMetaDataRecreate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newTokenName?[new o.StringValue(e.newTokenName)]:[],...e.newRoyalties?[new o.BigUIntValue(e.newRoyalties)]:[],...e.newHash?[new o.StringValue(e.newHash)]:[],...e.newAttributes?[new o.BytesValue(Buffer.from(e.newAttributes))]:[],...e.newUris?e.newUris.map((e=>new o.StringValue(e))):[]])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitNftMetadataRecreate,addDataMovementGas:!0}).build()}createTransactionForChangingTokenToDynamic(e){const t=["changeToDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitNftChangeToDynamic,addDataMovementGas:!0}).build()}createTransactionForUpdatingTokenId(e){const t=["updateTokenID",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitUpdateTokenId,addDataMovementGas:!0}).build()}createTransactionForRegisteringDynamicToken(e){const t=["registerDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitRegisterDynamic,addDataMovementGas:!0}).build()}createTransactionForRegisteringDynamicAndSettingRoles(e){const t=["registerAndSetAllRolesDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitRegisterDynamic,addDataMovementGas:!0}).build()}notifyAboutUnsettingBurnRoleGlobally(){a.Logger.info('\n==========\nIMPORTANT!\n==========\nYou are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally).\nOnce the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).')}boolToString(e){return e?this.trueAsString:this.falseAsString}}},5560:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransfersDataBuilder=void 0;const r=n(1157),i=n(2747),s=n(5132);t.TokenTransfersDataBuilder=class{constructor(){this.tokenComputer=new s.TokenComputer,this.argsSerializer=new r.ArgSerializer}buildDataPartsForESDTTransfer(e){return["ESDTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(e.token.identifier),new i.BigUIntValue(e.amount)])]}buildDataPartsForSingleESDTNFTTransfer(e,t){const n=e.token,r=this.tokenComputer.extractIdentifierFromExtendedIdentifier(n.identifier);return["ESDTNFTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(r),new i.BigUIntValue(n.nonce),new i.BigUIntValue(e.amount),new i.AddressValue(t)])]}buildDataPartsForMultiESDTNFTTransfer(e,t){const n=[new i.AddressValue(e),new i.U32Value(t.length)];for(const e of t){const t=this.tokenComputer.extractIdentifierFromExtendedIdentifier(e.token.identifier);n.push(new i.TokenIdentifierValue(t),new i.BigUIntValue(e.token.nonce),new i.BigUIntValue(e.amount))}return["MultiESDTNFTTransfer",...this.argsSerializer.valuesToStrings(n)]}}},4059:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=void 0;const r=n(7353),i=n(476),s=n(3548);t.TransactionBuilder=class{constructor(e){this.config=e.config,this.sender=e.sender,this.receiver=e.receiver,this.dataParts=e.dataParts,this.providedGasLimit=e.gasLimit,this.addDataMovementGas=e.addDataMovementGas,this.amount=e.amount}computeGasLimit(e){return this.addDataMovementGas?this.config.minGasLimit+this.config.gasLimitPerByte*BigInt(e.length())+this.providedGasLimit:this.providedGasLimit}buildTransactionPayload(){const e=this.dataParts.join(r.ARGUMENTS_SEPARATOR);return new s.TransactionPayload(e)}build(){const e=this.buildTransactionPayload(),t=this.computeGasLimit(e);return new i.Transaction({sender:this.sender.bech32(),receiver:this.receiver.bech32(),gasLimit:t,value:this.amount||0n,data:e.valueOf(),chainID:this.config.chainID})}}},3473:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsFactoryConfig=void 0;const r=n(6424);t.TransactionsFactoryConfig=class{constructor(e){this.chainID=e.chainID,this.addressHrp=r.LibraryConfig.DefaultAddressHrp,this.minGasLimit=50000n,this.gasLimitPerByte=1500n,this.gasLimitIssue=60000000n,this.gasLimitToggleBurnRoleGlobally=60000000n,this.gasLimitEsdtLocalMint=300000n,this.gasLimitEsdtLocalBurn=300000n,this.gasLimitSetSpecialRole=60000000n,this.gasLimitPausing=60000000n,this.gasLimitFreezing=60000000n,this.gasLimitWiping=60000000n,this.gasLimitEsdtNftCreate=3000000n,this.gasLimitEsdtNftUpdateAttributes=1000000n,this.gasLimitEsdtNftAddQuantity=1000000n,this.gasLimitEsdtNftBurn=1000000n,this.gasLimitStorePerByte=10000n,this.issueCost=50000000000000000n,this.gasLimitEsdtModifyRoyalties=60000000n,this.gasLimitEsdtModifyCreator=60000000n,this.gasLimitEsdtMetadataUpdate=60000000n,this.gasLimitSetNewUris=60000000n,this.gasLimitNftMetadataRecreate=60000000n,this.gasLimitNftChangeToDynamic=60000000n,this.gasLimitUpdateTokenId=60000000n,this.gasLimitRegisterDynamic=60000000n,this.gasLimitStake=5000000n,this.gasLimitUnstake=5000000n,this.gasLimitUnbond=5000000n,this.gasLimitCreateDelegationContract=50000000n,this.gasLimitDelegationOperations=1000000n,this.additionalGasLimitPerValidatorNode=6000000n,this.additionalGasLimitForDelegationOperations=10000000n,this.gasLimitSaveKeyValue=100000n,this.gasLimitPersistPerByte=1000n,this.gasLimitSetGuardian=250000n,this.gasLimitGuardAccount=250000n,this.gasLimitUnguardAccount=250000n,this.gasLimitESDTTransfer=200000n,this.gasLimitESDTNFTTransfer=200000n,this.gasLimitMultiESDTNFTTransfer=200000n,this.gasLimitClaimDeveloperRewards=6000000n,this.gasLimitChangeOwnerAddress=6000000n}}},4934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTransactionsFactory=void 0;const r=n(2581),i=n(661),s=n(5132),a=n(476),o=n(3548),u=n(5560),c=n(4059),l=8e5;t.TransferTransactionsFactory=class{constructor(e){this.isGasEstimator(e)?this.gasEstimator=e:(this.config=e.config,this.tokenComputer=new s.TokenComputer,this.tokenTransfersDataBuilder=new u.TokenTransfersDataBuilder)}isGasEstimator(e){return"object"==typeof e&&"function"==typeof e.forEGLDTransfer&&"function"==typeof e.forESDTTransfer&&"function"==typeof e.forESDTNFTTransfer&&"function"==typeof e.forMultiESDTNFTTransfer}isGasEstimatorDefined(){return void 0!==this.gasEstimator}ensureConfigIsDefined(){if(void 0===this.config)throw new r.Err("'config' is not defined")}createTransactionForNativeTokenTransfer(e){this.ensureConfigIsDefined();const t=e.data||new Uint8Array;return new a.Transaction({sender:e.sender.bech32(),receiver:e.receiver.bech32(),chainID:this.config.chainID,gasLimit:this.computeGasForMoveBalance(this.config,t),data:t,value:e.nativeAmount})}createTransactionForESDTTokenTransfer(e){this.ensureConfigIsDefined();const t=e.tokenTransfers.length;if(0===t)throw new r.ErrBadUsage("No token transfer has been provided");if(1===t)return this.createSingleESDTTransferTransaction(e);const n=this.tokenTransfersDataBuilder.buildDataPartsForMultiESDTNFTTransfer(e.receiver,e.tokenTransfers),i=this.config.gasLimitMultiESDTNFTTransfer*BigInt(t)+BigInt(l);return new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:n,gasLimit:i,addDataMovementGas:!0}).build()}createTransactionForTransfer(e){const t=e.nativeAmount??0n;let n=e.tokenTransfers?[...e.tokenTransfers]:[];const i=n.length;if(i&&e.data?.length)throw new r.ErrBadUsage("Can't set data field when sending esdt tokens");if(t&&0===i||e.data)return this.createTransactionForNativeTokenTransfer({sender:e.sender,receiver:e.receiver,nativeAmount:t,data:e.data});const a=t?s.TokenTransfer.newFromEgldAmount(t):void 0;return a&&n.push(a),this.createTransactionForESDTTokenTransfer({sender:e.sender,receiver:e.receiver,tokenTransfers:n})}createEGLDTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an EGLD transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForNativeTokenTransfer` method.");const t=e.data?.length()||0,n=this.gasEstimator.forEGLDTransfer(t);return new a.Transaction({nonce:e.nonce,value:e.value,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||n,data:e.data,chainID:e.chainID})}createESDTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an ESDT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.BigUIntValue(e.tokenTransfer.valueOf())]),n=`ESDTTransfer@${t}`,s=new o.TransactionPayload(n),u=s.length()||0,c=this.gasEstimator.forESDTTransfer(u);return new a.Transaction({nonce:e.nonce,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an ESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.U64Value(e.tokenTransfer.nonce),new i.BigUIntValue(e.tokenTransfer.valueOf()),new i.AddressValue(e.destination)]),n=`ESDTNFTTransfer@${t}`,s=new o.TransactionPayload(n),u=s.length()||0,c=this.gasEstimator.forESDTNFTTransfer(u);return new a.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createMultiESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create a MultiESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const t=[new i.AddressValue(e.destination),new i.U16Value(e.tokenTransfers.length)];for(const n of e.tokenTransfers)t.push(i.BytesValue.fromUTF8(n.tokenIdentifier),new i.U64Value(n.nonce),new i.BigUIntValue(n.valueOf()));const{argumentsString:n}=(new i.ArgSerializer).valuesToString(t),s=`MultiESDTNFTTransfer@${n}`,u=new o.TransactionPayload(s),c=u.length()||0,l=this.gasEstimator.forMultiESDTNFTTransfer(c,e.tokenTransfers.length);return new a.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||l,data:u,chainID:e.chainID})}createSingleESDTTransferTransaction(e){this.ensureConfigIsDefined();let t=[];const n=e.tokenTransfers[0];let r=0n,i=e.receiver;return this.tokenComputer.isFungible(n.token)?(t=this.tokenTransfersDataBuilder.buildDataPartsForESDTTransfer(n),r=this.config.gasLimitESDTTransfer+BigInt(1e5)):(t=this.tokenTransfersDataBuilder.buildDataPartsForSingleESDTNFTTransfer(n,i),r=this.config.gasLimitESDTNFTTransfer+BigInt(l),i=e.sender),new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:i,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}computeGasForMoveBalance(e,t){return e.minGasLimit+e.gasLimitPerByte*BigInt(t.length)}}},7058:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(3217);t.DelegationTransactionsOutcomeParser=class{constructor(){}parseCreateNewDelegationContract(e){return this.ensureNoError(e.logs.events),s.findEventsByIdentifier(e,"SCDeploy").map((e=>({contractAddress:this.extractContractAddress(e)})))}ensureNoError(e){for(const t of e)if("signalError"==t.identifier){const e=Buffer.from(t.dataItems[0]?.toString().slice(1)).toString()||"",n=this.decodeTopicAsString(t.topics[1]);throw new i.ErrParseTransactionOutcome(`encountered signalError: ${n} (${Buffer.from(e,"hex").toString()})`)}}extractContractAddress(e){if(!e.topics[0]?.length)return"";const t=Buffer.from(e.topics[0]);return r.Address.fromBuffer(t).bech32()}decodeTopicAsString(e){return Buffer.from(e).toString()}}},4476:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7058),t),i(n(3217),t),i(n(2483),t),i(n(6120),t),i(n(1494),t)},3217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gatherAllEvents=t.findEventsByFirstTopic=t.findEventsByIdentifier=t.findEventsByPredicate=t.SmartContractCallOutcome=t.TransactionOutcome=t.SmartContractResult=t.TransactionLogs=t.TransactionEvent=void 0,t.TransactionEvent=class{constructor(e){this.address="",this.identifier="",this.topics=[],this.dataItems=[],Object.assign(this,e)}};class n{constructor(e){this.address="",this.events=[],Object.assign(this,e)}}t.TransactionLogs=n,t.SmartContractResult=class{constructor(e){this.sender="",this.receiver="",this.data=new Uint8Array,this.logs=new n({}),Object.assign(this,e)}},t.TransactionOutcome=class{constructor(e){this.directSmartContractCallOutcome=new r({}),this.smartContractResults=[],this.logs=new n({}),Object.assign(this,e)}};class r{constructor(e){this.function="",this.returnDataParts=[],this.returnMessage="",this.returnCode="",Object.assign(this,e)}}function i(e,t){return s(e).filter(t)}function s(e){const t=[];t.push(...e.logs.events);for(const n of e.smartContractResults)t.push(...n.logs.events);return t}t.SmartContractCallOutcome=r,t.findEventsByPredicate=i,t.findEventsByIdentifier=function(e,t){return i(e,(e=>e.identifier==t))},t.findEventsByFirstTopic=function(e,t){return i(e,(e=>e.topics[0]?.toString()==t))},t.gatherAllEvents=s},2483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(661),a=n(3217);t.SmartContractTransactionsOutcomeParser=class{constructor(e){this.abi=e?.abi,this.legacyResultsParser=e?.legacyResultsParser||new s.ResultsParser}parseDeploy(e){const t=e.transactionOutcome.directSmartContractCallOutcome,n=a.findEventsByIdentifier(e.transactionOutcome,"SCDeploy").map((e=>this.parseScDeployEvent(e)));return{returnCode:t.returnCode,returnMessage:t.returnMessage,contracts:n}}parseScDeployEvent(e){const t=e.topics[0],n=e.topics[1],i=e.topics[2];return{address:t?.length?new r.Address(t).toBech32():"",ownerAddress:n?.length?new r.Address(n).toBech32():"",codeHash:i}}parseExecute(e){const t=e.transactionOutcome.directSmartContractCallOutcome;if(!this.abi)return{values:t.returnDataParts,returnCode:t.returnCode,returnMessage:t.returnMessage};const n=e.function||t.function;if(!n)throw new i.Err('Function name is not available in the transaction outcome, thus endpoint definition (ABI) cannot be picked (for parsing). Maybe provide the "function" parameter explicitly?');const r=this.abi.getEndpoint(n),a={returnCode:new s.ReturnCode(t.returnCode),returnMessage:t.returnMessage,values:t.returnDataParts.map((e=>Buffer.from(e)))},o=this.legacyResultsParser.parseOutcomeFromUntypedBundle(a,r);return{values:o.values.map((e=>e.valueOf())),returnCode:o.returnCode.toString(),returnMessage:o.returnMessage}}}},6120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenManagementTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(7553),a=n(3217);t.TokenManagementTransactionsOutcomeParser=class{constructor(){}parseIssueFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issue").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseIssueNonFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issueNonFungible").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseIssueSemiFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issueSemiFungible").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseRegisterMetaEsdt(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"registerMetaESDT").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseRegisterAndSetAllRoles(e){this.ensureNoError(e.logs.events);const t=a.findEventsByIdentifier(e,"registerAndSetAllRoles"),n=a.findEventsByIdentifier(e,"ESDTSetRole");if(t.length!==n.length)throw new i.ErrParseTransactionOutcome("Register Events and Set Role events mismatch. Should have the same number of events.");return t.map(((e,t)=>({tokenIdentifier:this.extractTokenIdentifier(e),roles:n[t].topics.slice(3).map((e=>this.decodeTopicAsString(e)))})))}parseSetBurnRoleGlobally(e){this.ensureNoError(e.logs.events)}parseUnsetBurnRoleGlobally(e){this.ensureNoError(e.logs.events)}parseSetSpecialRole(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTSetRole").map((e=>this.getOutputForSetSpecialRoleEvent(e)))}getOutputForSetSpecialRoleEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),roles:e.topics.slice(3).map((e=>this.decodeTopicAsString(e)))}}parseNftCreate(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTCreate").map((e=>this.getOutputForNftCreateEvent(e)))}getOutputForNftCreateEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),initialQuantity:this.extractAmount(e)}}parseLocalMint(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTLocalMint").map((e=>this.getOutputForLocalMintEvent(e)))}getOutputForLocalMintEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),mintedSupply:this.extractAmount(e)}}parseLocalBurn(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTLocalBurn").map((e=>this.getOutputForLocalBurnEvent(e)))}getOutputForLocalBurnEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),burntSupply:this.extractAmount(e)}}parsePause(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTPause").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseUnpause(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTUnPause").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseFreeze(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTFreeze").map((e=>this.getOutputForFreezeEvent(e)))}getOutputForFreezeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseUnfreeze(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTUnFreeze").map((e=>this.getOutputForUnfreezeEvent(e)))}getOutputForUnfreezeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseWipe(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTWipe").map((e=>this.getOutputForWipeEvent(e)))}getOutputForWipeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseUpdateAttributes(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTUpdateAttributes").map((e=>this.getOutputForUpdateAttributesEvent(e)))}getOutputForUpdateAttributesEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),attributes:e.topics[3]?e.topics[3]:new Uint8Array}}parseAddQuantity(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTAddQuantity").map((e=>this.getOutputForAddQuantityEvent(e)))}getOutputForAddQuantityEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),addedQuantity:this.extractAmount(e)}}parseBurnQuantity(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTBurn").map((e=>this.getOutputForBurnQuantityEvent(e)))}getOutputForBurnQuantityEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),burntQuantity:this.extractAmount(e)}}ensureNoError(e){for(const t of e)if("signalError"==t.identifier){const e=Buffer.from(t.dataItems[0]?.toString().slice(1)).toString()||"",n=this.decodeTopicAsString(t.topics[1]);throw new i.ErrParseTransactionOutcome(`encountered signalError: ${n} (${Buffer.from(e,"hex").toString()})`)}}extractTokenIdentifier(e){return e.topics[0]?.length?this.decodeTopicAsString(e.topics[0]):""}extractNonce(e){if(!e.topics[1]?.length)return BigInt(0);const t=Buffer.from(e.topics[1]);return BigInt(s.bufferToBigInt(t).toFixed(0))}extractAmount(e){if(!e.topics[2]?.length)return BigInt(0);const t=Buffer.from(e.topics[2]);return BigInt(s.bufferToBigInt(t).toFixed(0))}extractAddress(e){if(!e.topics[3]?.length)return"";const t=Buffer.from(e.topics[3]);return r.Address.fromBuffer(t).bech32()}decodeTopicAsString(e){return Buffer.from(e).toString()}}},1494:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEventsParser=void 0;const r=n(661);t.TransactionEventsParser=class{constructor(e){this.legacyResultsParser=new r.ResultsParser,this.abi=e.abi,this.firstTopicIsIdentifier=e.firstTopicIsIdentifier??!0}parseEvents(e){const t=[];for(const n of e.events){const e=this.parseEvent({event:n});t.push(e)}return t}parseEvent(e){const t=e.event.topics.map((e=>Buffer.from(e))),n=this.firstTopicIsIdentifier?t[0]?.toString():e.event.identifier;this.firstTopicIsIdentifier&&t.shift();const r=e.event.dataItems.map((e=>Buffer.from(e))),i=this.abi.getEvent(n);return this.legacyResultsParser.doParseEvent({topics:t,dataItems:r,eventDefinition:i})}}},9161:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.addressToHex=t.bigIntToHex=t.byteArrayToHex=t.boolToHex=t.utf8ToHex=t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=void 0;const o=a(n(1594)),u=n(236),c=s(n(7553));function l(e){return(e=e||"").length%2==1?"0"+e:e}function d(e){return l(Buffer.from(e).toString("hex"))}t.numberToPaddedHex=function(e){let t;return t="bigint"==typeof e||"number"==typeof e?e:new o.default(e),l(t.toString(16))},t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=l,t.utf8ToHex=d,t.boolToHex=function(e){return d(e.toString())},t.byteArrayToHex=function(e){return l(Buffer.from(e).toString("hex"))},t.bigIntToHex=function(e){return 0==e?"":c.getHexMagnitudeOfBigInt(e)},t.addressToHex=function(e){return u.Address.fromBech32(e.toString()).pubkey().toString("hex")}},1069:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=t.guardEmpty=t.guardNotEmpty=t.guardLength=t.guardSameLength=t.guardValueIsSetWithMessage=t.guardValueIsSet=t.guardTrue=void 0;const a=s(n(2581));function o(e,t){if(null==t||void 0===t)throw new a.ErrInvariantFailed(e)}function u(e){return e.isEmpty?e.isEmpty():0===e.length}t.guardTrue=function(e,t){if(!e)throw new a.ErrInvariantFailed(`[<${t}>] isn't true`)},t.guardValueIsSet=function(e,t){o(`${e} isn't set (null or undefined)`,t)},t.guardValueIsSetWithMessage=o,t.guardSameLength=function(e,t){if(t=t||[],(e=e||[]).length!=t.length)throw new a.ErrInvariantFailed("arrays do not have the same length")},t.guardLength=function(e,t){let n=e.length||0;if(n!=t)throw new a.ErrInvariantFailed(`wrong length, expected: ${t}, actual: ${n}`)},t.guardNotEmpty=function(e,t){if(u(e))throw new a.ErrInvariantFailed(`${t} is empty`)},t.guardEmpty=function(e,t){if(!u(e))throw new a.ErrInvariantFailed(`${t} is not empty`)},t.isEmpty=u},84:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GuardianData=t.AccountOnNetwork=void 0;const i=r(n(1594)),s=n(1466);class a{constructor(e){this.address=new s.Address(""),this.nonce=0,this.balance=new i.default(0),this.code="",this.userName="",Object.assign(this,e)}static fromHttpResponse(e){let t=new a;return t.address=new s.Address(e.address||""),t.nonce=Number(e.nonce||0),t.balance=new i.default(e.balance||0),t.code=e.code||"",t.userName=e.username||"",t}}t.AccountOnNetwork=a;class o{constructor(e){this.guarded=!1,Object.assign(this,e)}static fromHttpResponse(e){const t=new o;return t.guarded=e.guarded||!1,e.activeGuardian&&(t.activeGuardian=u.fromHttpResponse(e.activeGuardian)),e.pendingGuardian&&(t.pendingGuardian=u.fromHttpResponse(e.pendingGuardian)),t}getCurrentGuardianAddress(){var e;if(this.guarded)return null===(e=this.activeGuardian)||void 0===e?void 0:e.address}}t.GuardianData=o;class u{constructor(){this.activationEpoch=0,this.address=new s.Address(""),this.serviceUID=""}static fromHttpResponse(e){const t=new u;return t.activationEpoch=Number(e.activationEpoch||0),t.address=new s.Address(e.address||""),t.serviceUID=e.serviceUID||"",t}}},6482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPagination=t.defaultAxiosConfig=void 0;const r=n(1013)({constructorAction:"ignore"});t.defaultAxiosConfig={timeout:5e3,transformResponse:[function(e){return r.parse(e)}]},t.defaultPagination={from:0,size:100}},4027:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EsdtContractAddress=t.MaxUint64AsBigNumber=void 0;const i=r(n(1594)),s=n(1466);t.MaxUint64AsBigNumber=new i.default("18446744073709551615"),t.EsdtContractAddress=new s.Address("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u")},8419:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryRequest=void 0,t.ContractQueryRequest=class{constructor(e){this.query=e}toHttpRequest(){var e;let t={},n=this.query;return t.scAddress=n.address.bech32(),t.caller=(null===(e=n.caller)||void 0===e?void 0:e.bech32())?n.caller.bech32():void 0,t.funcName=n.func.toString(),t.value=n.value?n.value.toString():void 0,t.args=n.getEncodedArguments(),t}}},3767:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryResponse=void 0;const i=r(n(1594)),s=n(4027);class a{constructor(e){this.returnData=(null==e?void 0:e.returnData)||[],this.returnCode=(null==e?void 0:e.returnCode)||"",this.returnMessage=(null==e?void 0:e.returnMessage)||"",this.gasUsed=(null==e?void 0:e.gasUsed)||0}static fromHttpResponse(e){let t=e.returnData||e.ReturnData,n=e.returnCode||e.ReturnCode,r=e.returnMessage||e.ReturnMessage,o=new i.default(e.gasRemaining||e.GasRemaining||0),u=s.MaxUint64AsBigNumber.minus(o).toNumber();return new a({returnData:t,returnCode:n,returnMessage:r,gasUsed:u})}getReturnDataParts(){return this.returnData.map((e=>Buffer.from(e||"","base64")))}toJSON(){return{returnData:this.returnData,returnCode:this.returnCode,returnMessage:this.returnMessage,gasUsed:this.gasUsed.valueOf()}}}t.ContractQueryResponse=a},2286:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractResultItem=t.ContractResults=void 0;const r=n(9857),i=n(1466);class s{constructor(e){this.items=e,this.items.sort((function(e,t){return e.nonce.valueOf()-t.nonce.valueOf()}))}static fromProxyHttpResponse(e){let t=e.map((e=>a.fromProxyHttpResponse(e)));return new s(t)}static fromApiHttpResponse(e){let t=e.map((e=>a.fromApiHttpResponse(e)));return new s(t)}}t.ContractResults=s;class a{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new i.Address(""),this.sender=new i.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new r.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return a.fromHttpResponse(e)}static fromApiHttpResponse(e){let t=a.fromHttpResponse(e);return t.data=Buffer.from(t.data,"base64").toString(),t.callType=Number(t.callType),t}static fromHttpResponse(e){let t=new a;return t.hash=e.hash,t.nonce=Number(e.nonce||0),t.value=(e.value||0).toString(),t.receiver=new i.Address(e.receiver),t.sender=new i.Address(e.sender),t.previousHash=e.prevTxHash,t.originalHash=e.originalTxHash,t.gasLimit=Number(e.gasLimit||0),t.gasPrice=Number(e.gasPrice||0),t.data=e.data||"",t.callType=e.callType,t.returnMessage=e.returnMessage,t.logs=r.TransactionLogs.fromHttpResponse(e.logs||{}),t}}t.ContractResultItem=a},2591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrContractQuery=t.ErrNetworkProvider=t.ErrUnexpectedCondition=t.Err=void 0;class n extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}}t.Err=n,t.ErrUnexpectedCondition=class extends n{constructor(e){super(`Unexpected condition: [${e}]`)}},t.ErrNetworkProvider=class extends n{constructor(e,t,n){super(`Request error on url [${e}]: [${t}]`,n)}},t.ErrContractQuery=class extends n{constructor(e){super(e.message.replace("executeQuery:",""))}}},3802:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkConfig=void 0;const i=r(n(1594));class s{constructor(){this.ChainID="T",this.GasPerDataByte=1500,this.TopUpFactor=0,this.RoundDuration=0,this.RoundsPerEpoch=0,this.TopUpRewardsGradientPoint=new i.default(0),this.MinGasLimit=5e4,this.MinGasPrice=1e9,this.GasPriceModifier=1,this.MinTransactionVersion=1}static fromHttpResponse(e){let t=new s;return t.ChainID=String(e.erd_chain_id),t.GasPerDataByte=Number(e.erd_gas_per_data_byte),t.TopUpFactor=Number(e.erd_top_up_factor),t.RoundDuration=Number(e.erd_round_duration),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t.TopUpRewardsGradientPoint=new i.default(e.erd_rewards_top_up_gradient_point),t.MinGasLimit=Number(e.erd_min_gas_limit),t.MinGasPrice=Number(e.erd_min_gas_price),t.MinTransactionVersion=Number(e.erd_min_transaction_version),t.GasPriceModifier=Number(e.erd_gas_price_modifier),t}}t.NetworkConfig=s},9358:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkStatus=void 0;class n{constructor(){this.CurrentRound=0,this.EpochNumber=0,this.HighestFinalNonce=0,this.Nonce=0,this.NonceAtEpochStart=0,this.NoncesPassedInCurrentEpoch=0,this.RoundAtEpochStart=0,this.RoundsPassedInCurrentEpoch=0,this.RoundsPerEpoch=0}static fromHttpResponse(e){let t=new n;return t.CurrentRound=Number(e.erd_current_round),t.EpochNumber=Number(e.erd_epoch_number),t.HighestFinalNonce=Number(e.erd_highest_final_nonce),t.Nonce=Number(e.erd_nonce),t.NonceAtEpochStart=Number(e.erd_nonce_at_epoch_start),t.NoncesPassedInCurrentEpoch=Number(e.erd_nonces_passed_in_current_epoch),t.RoundAtEpochStart=Number(e.erd_round_at_epoch_start),t.RoundsPassedInCurrentEpoch=Number(e.erd_rounds_passed_in_current_epoch),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t}}t.NetworkStatus=n},1466:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=t.Nonce=t.Address=void 0;const a=s(n(9674));class o{constructor(e){this.value=e}static fromPubkey(e){let t=a.toWords(e),n=a.encode("erd",t);return new o(n)}bech32(){return this.value}toString(){return this.bech32()}}function u(e){return c(e.toString(16))}function c(e){return(e=e||"").length%2==1?"0"+e:e}t.Address=o,t.Nonce=class{constructor(e){this.value=e}valueOf(){return this.value}hex(){return u(this.value)}},t.numberToPaddedHex=u,t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=c},8403:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyNetworkProvider=void 0;const s=i(n(6425)),a=n(84),o=n(6482),u=n(4027),c=n(8419),l=n(3767),d=n(2591),f=n(3802),h=n(9358),p=n(8721),g=n(3962),m=n(6389),y=n(6188);t.ProxyNetworkProvider=class{constructor(e,t){this.url=e,this.config=Object.assign(Object.assign({},o.defaultAxiosConfig),t)}getNetworkConfig(){return r(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/config");return f.NetworkConfig.fromHttpResponse(e.config)}))}getNetworkStatus(){return r(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/status/4294967295");return h.NetworkStatus.fromHttpResponse(e.status)}))}getNetworkStakeStatistics(){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getNetworkGeneralStatistics(){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getAccount(e){return r(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`address/${e.bech32()}`);return a.AccountOnNetwork.fromHttpResponse(t.account)}))}getGuardianData(e){return r(this,void 0,void 0,(function*(){const t=yield this.doGetGeneric(`address/${e.bech32()}/guardian-data`);return a.GuardianData.fromHttpResponse(t.guardianData)}))}getFungibleTokensOfAccount(e,t){return r(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,n=yield this.doGetGeneric(t),r=Object.values(n.esdts).filter((e=>!e.nonce)).map((e=>g.FungibleTokenOfAccountOnNetwork.fromHttpResponse(e)));return r.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),r}))}getNonFungibleTokensOfAccount(e,t){return r(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,n=yield this.doGetGeneric(t),r=Object.values(n.esdts).filter((e=>e.nonce>=0)).map((e=>g.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponse(e)));return r.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),r}))}getFungibleTokenOfAccount(e,t){return r(this,void 0,void 0,(function*(){let n=yield this.doGetGeneric(`address/${e.bech32()}/esdt/${t}`);return g.FungibleTokenOfAccountOnNetwork.fromHttpResponse(n.tokenData)}))}getNonFungibleTokenOfAccount(e,t,n){return r(this,void 0,void 0,(function*(){let r=yield this.doGetGeneric(`address/${e.bech32()}/nft/${t}/nonce/${n.valueOf()}`);return g.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponseByNonce(r.tokenData)}))}getTransaction(e,t){return r(this,void 0,void 0,(function*(){let n;!0===t&&(n=this.getTransactionStatus(e));let r=this.buildUrlWithQueryParameters(`transaction/${e}`,{withResults:"true"}),i=yield this.doGetGeneric(r);if(n){const t=yield n;return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction,t)}return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction)}))}getTransactionStatus(e){return r(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`transaction/${e}/process-status`);return new y.TransactionStatus(t.status)}))}sendTransaction(e){return r(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return(yield this.doPostGeneric("transaction/send",t)).txHash}))}sendTransactions(e){return r(this,void 0,void 0,(function*(){const t=e.map((e=>m.prepareTransactionForBroadcasting(e))),n=yield this.doPostGeneric("transaction/send-multiple",t),r=Array(e.length).fill(null);for(let t=0;t<e.length;t++)r[t]=n.txsHashes[t.toString()]||null;return r}))}simulateTransaction(e){return r(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return yield this.doPostGeneric("transaction/simulate",t)}))}queryContract(e){return r(this,void 0,void 0,(function*(){try{let t=new c.ContractQueryRequest(e).toHttpRequest(),n=yield this.doPostGeneric("vm-values/query",t);return l.ContractQueryResponse.fromHttpResponse(n.data)}catch(e){throw new d.ErrContractQuery(e)}}))}getDefinitionOfFungibleToken(e){return r(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return p.DefinitionOfFungibleTokenOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getTokenProperties(e){return r(this,void 0,void 0,(function*(){let t=Buffer.from(e).toString("hex");return(yield this.queryContract({address:u.EsdtContractAddress,func:"getTokenProperties",getEncodedArguments:()=>[t]})).getReturnDataParts()}))}getDefinitionOfTokenCollection(e){return r(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return p.DefinitionOfTokenCollectionOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getNonFungibleToken(e,t){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}doGetGeneric(e){return r(this,void 0,void 0,(function*(){return yield this.doGet(e)}))}doPostGeneric(e,t){return r(this,void 0,void 0,(function*(){return yield this.doPost(e,t)}))}doGet(e){return r(this,void 0,void 0,(function*(){let t=`${this.url}/${e}`;try{return(yield s.default.get(t,this.config)).data.data}catch(t){this.handleApiError(t,e)}}))}doPost(e,t){return r(this,void 0,void 0,(function*(){let n=`${this.url}/${e}`;try{return(yield s.default.post(n,t,Object.assign(Object.assign({},this.config),{headers:Object.assign({"Content-Type":"application/json"},this.config.headers)}))).data.data}catch(t){this.handleApiError(t,e)}}))}buildUrlWithQueryParameters(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r&&n.append(e,r);return`${e}?${n.toString()}`}handleApiError(e,t){if(!e.response)throw new d.ErrNetworkProvider(t,e.toString(),e);const n=e.response.data,r=n.message||n.error||JSON.stringify(n);throw new d.ErrNetworkProvider(t,r,e)}}},8721:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefinitionOfTokenCollectionOnNetwork=t.DefinitionOfFungibleTokenOnNetwork=void 0;const i=r(n(1594)),s=n(1466);class a{constructor(){this.identifier="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.supply=new i.default(0),this.isPaused=!1,this.canUpgrade=!1,this.canMint=!1,this.canBurn=!1,this.canChangeOwner=!1,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canAddSpecialRoles=!1,this.assets={}}static fromApiHttpResponse(e){let t=new a;return t.identifier=e.identifier||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.supply=new i.default(e.supply||"0"),t.isPaused=e.isPaused||!1,t.canUpgrade=e.canUpgrade||!1,t.canMint=e.canMint||!1,t.canBurn=e.canBurn||!1,t.canChangeOwner=e.canChangeOwner||!1,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.assets=e.assets||{},t}static fromResponseOfGetTokenProperties(e,t){let n=new a,[r,o,c,l,...d]=t,f=u(d);return n.identifier=e,n.name=r.toString(),n.ticker=e,n.owner=s.Address.fromPubkey(c),n.decimals=f.NumDecimals.toNumber(),n.supply=new i.default(l.toString()).shiftedBy(-n.decimals),n.isPaused=f.IsPaused,n.canUpgrade=f.CanUpgrade,n.canMint=f.CanMint,n.canBurn=f.CanBurn,n.canChangeOwner=f.CanChangeOwner,n.canPause=f.CanPause,n.canFreeze=f.CanFreeze,n.canWipe=f.CanWipe,n}}t.DefinitionOfFungibleTokenOnNetwork=a;class o{constructor(){this.collection="",this.type="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canUpgrade=!1,this.canChangeOwner=!1,this.canAddSpecialRoles=!1,this.canTransferNftCreateRole=!1,this.canCreateMultiShard=!1}static fromApiHttpResponse(e){let t=new o;return t.collection=e.collection||"",t.type=e.type||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.canUpgrade=e.canUpgrade||!1,t.canAddSpecialRoles=e.canAddSpecialRoles||!1,t.canTransferNftCreateRole=e.canTransferNftCreateRole||!1,t}static fromResponseOfGetTokenProperties(e,t){var n;let r=new o,[i,a,c,l,d,...f]=t,h=u(f);return r.collection=e,r.type=a.toString(),r.name=i.toString(),r.ticker=e,r.owner=s.Address.fromPubkey(c),r.decimals=null!==(n=h.NumDecimals.toNumber())&&void 0!==n?n:0,r.canPause=h.CanPause||!1,r.canFreeze=h.CanFreeze||!1,r.canWipe=h.CanWipe||!1,r.canUpgrade=h.CanUpgrade||!1,r.canChangeOwner=h.CanChangeOwner||!1,r.canAddSpecialRoles=h.CanAddSpecialRoles||!1,r.canTransferNftCreateRole=h.CanTransferNFTCreateRole||!1,r.canCreateMultiShard=h.CanCreateMultiShard||!1,r}}function u(e){let t={};for(let n of e){let[e,r]=n.toString().split("-");t[e]=c(r)}return t}function c(e){switch(e){case"true":return!0;case"false":return!1;default:return new i.default(e)}}t.DefinitionOfTokenCollectionOnNetwork=o},3962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonFungibleTokenOfAccountOnNetwork=t.FungibleTokenOfAccountOnNetwork=void 0;const r=n(1594),i=n(1466);class s{constructor(){this.identifier="",this.balance=new r.BigNumber(0),this.rawResponse={}}static fromHttpResponse(e){let t=new s;return t.identifier=e.tokenIdentifier||e.identifier||"",t.balance=new r.BigNumber(e.balance||0),t.rawResponse=e,t}}t.FungibleTokenOfAccountOnNetwork=s;class a{constructor(e){this.identifier="",this.collection="",this.timestamp=0,this.attributes=Buffer.from([]),this.nonce=0,this.type="",this.name="",this.creator=new i.Address(""),this.supply=new r.BigNumber(0),this.decimals=0,this.royalties=new r.BigNumber(0),this.assets=[],this.balance=new r.BigNumber(0),Object.assign(this,e)}static fromProxyHttpResponse(e){let t=a.fromHttpResponse(e);return t.identifier=e.tokenIdentifier||"",t.collection=a.parseCollectionFromIdentifier(t.identifier),t.royalties=new r.BigNumber(e.royalties||0).div(100),t}static fromProxyHttpResponseByNonce(e){let t=a.fromHttpResponse(e),n=new i.Nonce(t.nonce).hex();return t.identifier=`${e.tokenIdentifier}-${n}`,t.collection=e.tokenIdentifier||"",t.royalties=new r.BigNumber(e.royalties||0).div(100),t}static fromApiHttpResponse(e){let t=a.fromHttpResponse(e);return t.identifier=e.identifier||"",t.collection=e.collection||"",t}static fromHttpResponse(e){let t=new a;return t.timestamp=Number(e.timestamp||0),t.attributes=Buffer.from(e.attributes||"","base64"),t.nonce=e.nonce||0,t.type=e.type||"",t.name=e.name||"",t.creator=new i.Address(e.creator||""),t.decimals=Number(e.decimals||0),t.supply=new r.BigNumber(e.balance||1),t.royalties=new r.BigNumber(e.royalties||0),t.assets=e.assets||[],t.balance=new r.BigNumber(e.balance||1),t}static parseCollectionFromIdentifier(e){return e.split("-").slice(0,2).join("-")}}t.NonFungibleTokenOfAccountOnNetwork=a},8427:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEventTopic=t.TransactionEventData=t.TransactionEvent=void 0;const r=n(1466);class i{constructor(e){this.address=new r.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new s(Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new i;return t.address=new r.Address(e.address),t.identifier=e.identifier||"",t.topics=(e.topics||[]).map((e=>new a(e))),t.dataPayload=s.fromBase64(e.data),t.additionalData=(e.additionalData||[]).map(s.fromBase64),t.data=t.dataPayload.toString(),t}findFirstOrNoneTopic(e){return this.topics.filter((t=>e(t)))[0]}getLastTopic(){return this.topics[this.topics.length-1]}}t.TransactionEvent=i;class s{constructor(e){this.raw=e}static fromBase64(e){return new s(Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventData=s;class a{constructor(e){this.raw=Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventTopic=a},9857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionLogs=void 0;const r=n(2591),i=n(1466),s=n(8427);class a{constructor(e){this.address=new i.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new a;return t.address=new i.Address(e.address),t.events=(e.events||[]).map((e=>s.TransactionEvent.fromHttpResponse(e))),t}findSingleOrNoneEvent(e,t){let n=this.findEvents(e,t);if(n.length>1)throw new r.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,t){return this.findEvents(e,t)[0]}findEvents(e,t){let n=this.events.filter((t=>t.identifier==e));return t&&(n=n.filter((e=>t(e)))),n}}t.TransactionLogs=a},496:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionReceipt=void 0;const r=n(1466);class i{constructor(){this.value="",this.sender=new r.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let t=new i;return t.value=(e.value||0).toString(),t.sender=new r.Address(e.sender),t.data=e.data,t.hash=e.txHash,t}}t.TransactionReceipt=i},6188:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionStatus=void 0;class n{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new n("unknown")}isPending(){return"received"==this.status||"pending"==this.status}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return"executed"==this.status||"success"==this.status||"successful"==this.status}isFailed(){return"fail"==this.status||"failed"==this.status||"unsuccessful"==this.status||this.isInvalid()}isInvalid(){return"invalid"==this.status}toString(){return this.status}valueOf(){return this.status}equals(e){return!!e&&this.status==e.status}}t.TransactionStatus=n},6389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOnNetwork=t.prepareTransactionForBroadcasting=void 0;const r=n(6188),i=n(2286),s=n(1466),a=n(9857),o=n(496);t.prepareTransactionForBroadcasting=function(e){return"toSendable"in e?e.toSendable():{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,receiverUsername:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0,gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:0===e.data.length?void 0:Buffer.from(e.data).toString("base64"),chainID:e.chainID,version:e.version,options:e.options,guardian:e.guardian||void 0,signature:Buffer.from(e.signature).toString("hex"),guardianSignature:0===e.guardianSignature.length?void 0:Buffer.from(e.guardianSignature).toString("hex")}};class u{constructor(e){this.hash="",this.type="",this.nonce=0,this.round=0,this.epoch=0,this.value="",this.receiver=new s.Address(""),this.sender=new s.Address(""),this.gasLimit=0,this.gasPrice=0,this.function="",this.data=Buffer.from([]),this.signature="",this.status=r.TransactionStatus.createUnknown(),this.timestamp=0,this.blockNonce=0,this.hyperblockNonce=0,this.hyperblockHash="",this.receipt=new o.TransactionReceipt,this.contractResults=new i.ContractResults([]),this.logs=new a.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e,t,n){let r=u.fromHttpResponse(e,t);return r.contractResults=i.ContractResults.fromProxyHttpResponse(t.smartContractResults||[]),n&&(r.status=n,r.isCompleted=r.status.isSuccessful()||r.status.isFailed()),r}static fromApiHttpResponse(e,t){let n=u.fromHttpResponse(e,t);return n.contractResults=i.ContractResults.fromApiHttpResponse(t.results||[]),n.isCompleted=!n.status.isPending(),n}static fromHttpResponse(e,t){let n=new u;return n.hash=e,n.type=t.type||"",n.nonce=t.nonce||0,n.round=t.round,n.epoch=t.epoch||0,n.value=(t.value||0).toString(),n.sender=new s.Address(t.sender),n.receiver=new s.Address(t.receiver),n.gasPrice=t.gasPrice||0,n.gasLimit=t.gasLimit||0,n.function=t.function||"",n.data=Buffer.from(t.data||"","base64"),n.status=new r.TransactionStatus(t.status),n.timestamp=t.timestamp||0,n.blockNonce=t.blockNonce||0,n.hyperblockNonce=t.hyperblockNonce||0,n.hyperblockHash=t.hyperblockHash||"",n.receipt=o.TransactionReceipt.fromHttpResponse(t.receipt||{}),n.logs=a.TransactionLogs.fromHttpResponse(t.logs||{}),n}getDateTime(){return new Date(1e3*this.timestamp)}}t.TransactionOnNetwork=u},2866:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransferProperties=t.TransactionMetadataTransfer=t.TransactionMetadata=t.TransactionToDecode=t.TransactionDecoder=void 0;const r=n(8603);t.TransactionDecoder=class{getTransactionMetadata(e){const t=this.getNormalTransactionMetadata(e),n=this.getEsdtTransactionMetadata(t);if(n)return n;const r=this.getNftTransferMetadata(t);if(r)return r;return this.getMultiTransferMetadata(t)||t}getNormalTransactionMetadata(e){const t=new s;if(t.sender=e.sender,t.receiver=e.receiver,t.value=BigInt(e.value),e.data){const n=this.base64Decode(e.data).split("@"),r=n.slice(1);if(r.every((e=>this.isSmartContractArgument(e)))&&(t.functionName=n[0],t.functionArgs=r),"relayedTx"===t.functionName&&t.functionArgs&&1===t.functionArgs.length)try{const e=JSON.parse(this.hexToString(t.functionArgs[0]));return e.value=e.value.toString(),e.sender=this.bech32Encode(this.base64ToHex(e.sender)),e.receiver=this.bech32Encode(this.base64ToHex(e.receiver)),this.getNormalTransactionMetadata(e)}catch(e){}if("relayedTxV2"===t.functionName&&t.functionArgs&&4===t.functionArgs.length)try{const n=new i;return n.sender=e.receiver,n.receiver=this.bech32Encode(t.functionArgs[0]),n.data=this.base64Encode(this.hexToString(t.functionArgs[2])),n.value="0",this.getNormalTransactionMetadata(n)}catch(e){}}return t}getMultiTransferMetadata(e){if(e.sender!==e.receiver)return;if("MultiESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<3)return;if(!this.isAddressValid(t[0]))return;const n=this.bech32Encode(t[0]),r=this.hexToNumber(t[1]),i=new s;i.transfers||(i.transfers=[]);let a=2;for(let e=0;e<r;e++){const e=this.hexToString(t[a++]),n=t[a++],r=this.hexToBigInt(t[a++]);n?i.transfers.push({value:r,properties:{collection:e,identifier:`${e}-${n}`}}):i.transfers.push({value:r,properties:{token:e}})}return i.sender=e.sender,i.receiver=n,t.length>a&&(i.functionName=this.hexToString(t[a++]),i.functionArgs=t.slice(a++)),i}getNftTransferMetadata(e){if(e.sender!==e.receiver)return;if("ESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<4)return;if(!this.isAddressValid(t[3]))return;const n=this.hexToString(t[0]),r=t[1],i=this.hexToBigInt(t[2]),a=this.bech32Encode(t[3]),o=new s;return o.sender=e.sender,o.receiver=a,o.value=i,t.length>4&&(o.functionName=this.hexToString(t[4]),o.functionArgs=t.slice(5)),o.transfers=[{value:i,properties:{collection:n,identifier:`${n}-${r}`}}],o}base64Encode(e){return Buffer.from(e).toString("base64")}base64Decode(e){return Buffer.from(e,"base64").toString("binary")}hexToNumber(e){return parseInt(e,16)}getEsdtTransactionMetadata(e){if("ESDTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<2)return;const n=this.hexToString(t[0]),r=this.hexToBigInt(t[1]),i=new s;return i.sender=e.sender,i.receiver=e.receiver,t.length>2&&(i.functionName=this.hexToString(t[2]),i.functionArgs=t.slice(3)),i.transfers=[{value:r,properties:{identifier:n}}],i.value=r,i}bech32Encode(e){const t=Buffer.from(e,"hex"),n=r.bech32.toWords(t);return r.bech32.encode("erd",n)}isAddressValid(e){return 32==Buffer.from(e,"hex").length}isSmartContractArgument(e){return!!this.isHex(e)&&e.length%2==0}isHex(e){return!1===new RegExp(/[^a-f0-9]/gi).test(e)}base64ToHex(e){return Buffer.from(e,"base64").toString("hex")}hexToString(e){return Buffer.from(e,"hex").toString("ascii")}hexToBigInt(e){return e?BigInt("0x"+e):BigInt(0)}};class i{constructor(){this.sender="",this.receiver="",this.data="",this.value="0"}}t.TransactionToDecode=i;class s{constructor(){this.sender="",this.receiver="",this.value=BigInt(0)}}t.TransactionMetadata=s,t.TransactionMetadataTransfer=class{constructor(){this.value=BigInt(0)}},t.TokenTransferProperties=class{}},8603:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={};for(let e=0;e<32;e++){const t=n.charAt(e);r[t]=e}function i(e){const t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){let t=1;for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=i(t)^r>>5}t=i(t);for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);t=i(t)^31&r}return t}function a(e,t,n,r){let i=0,s=0;const a=(1<<n)-1,o=[];for(let r=0;r<e.length;++r)for(i=i<<t|e[r],s+=t;s>=n;)s-=n,o.push(i>>s&a);if(r)s>0&&o.push(i<<n-s&a);else{if(s>=t)return"Excess padding";if(i<<n-s&a)return"Non-zero padding"}return o}function o(e){return a(e,8,5,!0)}function u(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t}function c(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function a(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";const a=e.toLowerCase(),o=e.toUpperCase();if(e!==a&&e!==o)return"Mixed-case string "+e;const u=(e=a).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),l=e.slice(u+1);if(l.length<6)return"Data too short";let d=s(c);if("string"==typeof d)return d;const f=[];for(let e=0;e<l.length;++e){const t=l.charAt(e),n=r[t];if(void 0===n)return"Unknown character "+t;d=i(d)^n,e+6>=l.length||f.push(n)}return d!==t?"Invalid checksum for "+e:{prefix:c,words:f}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const n=a(e,t);if("object"==typeof n)return n},decode:function(e,t){const n=a(e,t);if("object"==typeof n)return n;throw new Error(n)},encode:function(e,r,a){if(a=a||90,e.length+7+r.length>a)throw new TypeError("Exceeds length limit");let o=s(e=e.toLowerCase());if("string"==typeof o)throw new Error(o);let u=e+"1";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5)throw new Error("Non 5-bit word");o=i(o)^t,u+=n.charAt(t)}for(let e=0;e<6;++e)o=i(o);o^=t;for(let e=0;e<6;++e)u+=n.charAt(o>>5*(5-e)&31);return u},toWords:o,fromWordsUnsafe:u,fromWords:c}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},8045:e=>{"use strict";e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,s=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(s)if(s=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,a(e))}}))}},8839:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),s=0;s<64;)i[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var i,s=null,a=[],o=0,u=0;t<n;){var c=e[t++];switch(u){case 0:a[o++]=r[c>>2],i=(3&c)<<4,u=1;break;case 1:a[o++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[o++]=r[i|c>>6],a[o++]=r[63&c],u=0}o>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),o=0)}return u&&(a[o++]=r[i],a[o++]=61,1===u&&(a[o++]=61)),s?(o&&s.push(String.fromCharCode.apply(String,a.slice(0,o))),s.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,o=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&o>1)break;if(void 0===(c=i[c]))throw Error(a);switch(o){case 0:r=c,o=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,o=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,o=3;break;case 3:t[n++]=(3&r)<<6|c,o=0}}if(1===o)throw Error(a);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4358:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},9410:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function s(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function o(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:s,e.writeFloatBE=r?s:i,e.readFloatLE=r?a:o,e.readFloatBE=r?o:a}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),i=2*(r>>31)+1,s=r>>>23&255,a=8388607&r;return 255===s?a?NaN:i*(1/0):0===s?1401298464324817e-60*i*a:i*Math.pow(2,s-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function s(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function o(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:s,e.writeDoubleBE=r?s:i,e.readDoubleLE=r?a:o,e.readDoubleBE=r?o:a}():function(){function t(e,t,n,r,i,s){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,i,s+t),e(1/r>0?0:2147483648,i,s+n);else if(isNaN(r))e(0,i,s+t),e(2146959360,i,s+n);else if(r>17976931348623157e292)e(0,i,s+t),e((a<<31|2146435072)>>>0,i,s+n);else{var o;if(r<22250738585072014e-324)e((o=r/5e-324)>>>0,i,s+t),e((a<<31|o/4294967296)>>>0,i,s+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(o=r*Math.pow(2,-u))>>>0,i,s+t),e((a<<31|u+1023<<20|1048576*o&1048575)>>>0,i,s+n)}}}function a(e,t,n,r,i){var s=e(r,i+t),a=e(r,i+n),o=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+s;return 2047===u?c?NaN:o*(1/0):0===u?5e-324*o*c:o*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4153:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},9390:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,s=null,a=r;return function(n){if(n<1||n>i)return e(n);a+n>r&&(s=e(r),a=0);var o=t.call(s,a,a+=n);return 7&a&&(a=1+(7|a)),o}}},1447:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,s=[],a=0;t<n;)(r=e[t++])<128?s[a++]=r:r>191&&r<224?s[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[a++]=55296+(r>>10),s[a++]=56320+(1023&r)):s[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))},n.write=function(e,t,n){for(var r,i,s=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,s=o(e),a=s[0],u=s[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,u)),l=0,d=u>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],a=16383,o=0,c=r-i;o<c;o+=a)s.push(u(e,o,o+a>c?c:o+a));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,s,a=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},9674:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r<32;r++){var i=t.charAt(r);if(void 0!==n[i])throw new TypeError(i+" is ambiguous");n[i]=r}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);t=s(t)^31&i}return t}function o(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var u=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var l=a(u);if("string"==typeof l)return l;for(var d=[],f=0;f<c.length;++f){var h=c.charAt(f),p=n[h];if(void 0===p)return"Unknown character "+h;l=s(l)^p,f+6>=c.length||d.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:d}}function u(e,t,n,r){for(var i=0,s=0,a=(1<<n)-1,o=[],u=0;u<e.length;++u)for(i=i<<t|e[u],s+=t;s>=n;)s-=n,o.push(i>>s&a);if(r)s>0&&o.push(i<<n-s&a);else{if(s>=t)return"Excess padding";if(i<<n-s&a)return"Non-zero padding"}return o}e.exports={decodeUnsafe:function(){var e=o.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=o.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,n,r){if(r=r||90,e.length+7+n.length>r)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",u=0;u<n.length;++u){var c=n[u];if(c>>5)throw new Error("Non 5-bit word");i=s(i)^c,o+=t.charAt(c)}for(u=0;u<6;++u)i=s(i);for(i^=1,u=0;u<6;++u)o+=t.charAt(i>>5*(5-u)&31);return o},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},1594:function(e,t,n){var r;!function(){"use strict";var i,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,o=Math.floor,u="[BigNumber Error] ",c=u+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,f=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,r=1,i=e.length,s=e[0]+"";r<i;){for(t=e[r++]+"",n=d-t.length;n--;t="0"+t);s+=t}for(i=s.length;48===s.charCodeAt(--i););return s.slice(0,i+1||1)}function A(e,t){var n,r,i=e.c,s=t.c,a=e.s,o=t.s,u=e.e,c=t.e;if(!a||!o)return null;if(n=i&&!i[0],r=s&&!s[0],n||r)return n?r?0:-o:a;if(a!=o)return a;if(n=a<0,r=u==c,!i||!s)return r?0:!i^n?1:-1;if(!r)return u>c^n?1:-1;for(o=(u=i.length)<(c=s.length)?u:c,a=0;a<o;a++)if(i[a]!=s[a])return i[a]>s[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function b(e,t,n,r){if(e<t||e>n||e!==o(e))throw Error(u+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function T(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function w(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var n,r,i,I,S,E,C,_,B,O,N=j.prototype={constructor:j,toString:null,valueOf:null},x=new j(1),P=20,D=4,k=-7,R=21,L=-1e7,F=1e7,U=!1,M=1,V=0,G={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function j(e,t){var n,a,u,l,h,p,g,m,y=this;if(!(y instanceof j))return new j(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>F?y.c=y.e=null:e.e<L?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,h=e;h>=10;h/=10,l++);return void(l>F?y.c=y.e=null:(y.e=l,y.c=[e]))}m=String(e)}else{if(!s.test(m=String(e)))return i(y,m,p);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(l=m.indexOf("."))>-1&&(m=m.replace(".","")),(h=m.search(/e/i))>0?(l<0&&(l=h),l+=+m.slice(h+1),m=m.substring(0,h)):l<0&&(l=m.length)}else{if(b(t,2,H.length,"Base"),10==t)return K(y=new j(e),P+y.e+1,D);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(y,m,p,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,j.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(n=H.slice(0,t),l=h=0,g=m.length;h<g;h++)if(n.indexOf(a=m.charAt(h))<0){if("."==a){if(h>l){l=g;continue}}else if(!u&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){u=!0,h=-1,l=0;continue}return i(y,String(e),p,t)}p=!1,(l=(m=r(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):l=m.length}for(h=0;48===m.charCodeAt(h);h++);for(g=m.length;48===m.charCodeAt(--g););if(m=m.slice(h,++g)){if(g-=h,p&&j.DEBUG&&g>15&&(e>f||e!==o(e)))throw Error(c+y.s*e);if((l=l-h-1)>F)y.c=y.e=null;else if(l<L)y.c=[y.e=0];else{if(y.e=l,y.c=[],h=(l+1)%d,l<0&&(h+=d),h<g){for(h&&y.c.push(+m.slice(0,h)),g-=d;h<g;)y.c.push(+m.slice(h,h+=d));h=d-(m=m.slice(h)).length}else h-=g;for(;h--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function q(e,t,n,r){var i,s,a,o,u;if(null==n?n=D:b(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=y(e.c),u=1==r||2==r&&(a<=k||a>=R)?w(u,a):v(u,a,"0");else if(s=(e=K(new j(e),t,n)).e,o=(u=y(e.c)).length,1==r||2==r&&(t<=s||s<=k)){for(;o<t;u+="0",o++);u=w(u,s)}else if(t-=a,u=v(u,s,"0"),s+1>o){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-o)>0)for(s+1==o&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function Q(e,t){for(var n,r=1,i=new j(e[0]);r<e.length;r++){if(!(n=new j(e[r])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function z(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*d-1)>F?e.c=e.e=null:n<L?e.c=[e.e=0]:(e.e=n,e.c=t),e}function K(e,t,n,r){var i,s,u,c,f,p,g,m=e.c,y=h;if(m){e:{for(i=1,c=m[0];c>=10;c/=10,i++);if((s=t-i)<0)s+=d,u=t,g=(f=m[p=0])/y[i-u-1]%10|0;else if((p=a((s+1)/d))>=m.length){if(!r)break e;for(;m.length<=p;m.push(0));f=g=0,i=1,u=(s%=d)-d+1}else{for(f=c=m[p],i=1;c>=10;c/=10,i++);g=(u=(s%=d)-d+i)<0?0:f/y[i-u-1]%10|0}if(r=r||t<0||null!=m[p+1]||(u<0?f:f%y[i-u-1]),r=n<4?(g||r)&&(0==n||n==(e.s<0?3:2)):g>5||5==g&&(4==n||r||6==n&&(s>0?u>0?f/y[i-u]:0:m[p-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=y[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==s?(m.length=p,c=1,p--):(m.length=p+1,c=y[d-s],m[p]=u>0?o(f/y[i-u]%y[u])*c:0),r)for(;;){if(0==p){for(s=1,u=m[0];u>=10;u/=10,s++);for(u=m[0]+=c,c=1;u>=10;u/=10,c++);s!=c&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=c,m[p]!=l)break;m[p--]=0,c=1}for(s=m.length;0===m[--s];m.pop());}e.e>F?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function W(e){var t,n=e.e;return null===n?e.toString():(t=y(e.c),t=n<=k||n>=R?w(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return j.clone=e,j.ROUND_UP=0,j.ROUND_DOWN=1,j.ROUND_CEIL=2,j.ROUND_FLOOR=3,j.ROUND_HALF_UP=4,j.ROUND_HALF_DOWN=5,j.ROUND_HALF_EVEN=6,j.ROUND_HALF_CEIL=7,j.ROUND_HALF_FLOOR=8,j.EUCLID=9,j.config=j.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(n=e[t],0,g,t),P=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(n=e[t],0,8,t),D=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(b(n[0],-g,0,t),b(n[1],0,g,t),k=n[0],R=n[1]):(b(n,-g,g,t),k=-(R=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)b(n[0],-g,-1,t),b(n[1],1,g,t),L=n[0],F=n[1];else{if(b(n,-g,g,t),!n)throw Error(u+t+" cannot be zero: "+n);L=-(F=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(u+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!n,Error(u+"crypto unavailable");U=n}else U=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(n=e[t],0,9,t),M=n),e.hasOwnProperty(t="POW_PRECISION")&&(b(n=e[t],0,g,t),V=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(u+t+" not an object: "+n);G=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(u+t+" invalid: "+n);H=n}}return{DECIMAL_PLACES:P,ROUNDING_MODE:D,EXPONENTIAL_AT:[k,R],RANGE:[L,F],CRYPTO:U,MODULO_MODE:M,POW_PRECISION:V,FORMAT:G,ALPHABET:H}},j.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!j.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===s||-1===s)&&i>=-g&&i<=g&&i===o(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=l||n!==o(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},j.maximum=j.max=function(){return Q(arguments,N.lt)},j.minimum=j.min=function(){return Q(arguments,N.gt)},j.random=(I=9007199254740992,S=Math.random()*I&2097151?function(){return o(Math.random()*I)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,i,s,c=0,l=[],f=new j(x);if(null==e?e=P:b(e,0,g),i=a(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(s=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(l.push(s%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c<i;)(s=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(l.push(s%1e14),c+=7);c=i/7}if(!U)for(;c<i;)(s=S())<9e15&&(l[c++]=s%1e14);for(i=l[--c],e%=d,i&&e&&(s=h[d-e],l[c]=o(i/s)*s);0===l[c];l.pop(),c--);if(c<0)l=[r=0];else{for(r=-1;0===l[0];l.splice(0,1),r-=d);for(c=1,s=l[0];s>=10;s/=10,c++);c<d&&(r-=d-c)}return f.e=r,f.c=l,f}),j.sum=function(){for(var e=1,t=arguments,n=new j(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e="0123456789";function t(e,t,n,r){for(var i,s,a=[0],o=0,u=e.length;o<u;){for(s=a.length;s--;a[s]*=t);for(a[0]+=r.indexOf(e.charAt(o++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,s,a,o){var u,c,l,d,f,h,p,g,m=r.indexOf("."),A=P,b=D;for(m>=0&&(d=V,V=0,r=r.replace(".",""),h=(g=new j(i)).pow(r.length-m),V=d,g.c=t(v(y(h.c),h.e,"0"),10,s,e),g.e=g.c.length),l=d=(p=t(r,i,s,o?(u=H,e):(u=e,H))).length;0==p[--d];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=n(h,g,A,b,s)).c,f=h.r,l=h.e),m=p[c=l+A+1],d=s/2,f=f||c<0||null!=p[c+1],f=b<4?(null!=m||f)&&(0==b||b==(h.s<0?3:2)):m>d||m==d&&(4==b||f||6==b&&1&p[c-1]||b==(h.s<0?8:7)),c<1||!p[0])r=f?v(u.charAt(1),-A,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--s;++p[--c]>s;)p[c]=0,c||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(m=0,r="";m<=d;r+=u.charAt(p[m++]));r=v(r,l,u.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,s,a,o=0,u=e.length,c=t%p,l=t/p|0;for(e=e.slice();u--;)o=((i=c*(s=e[u]%p)+(r=l*s+(a=e[u]/p|0)*c)%p*p+o)/n|0)+(r/p|0)+l*a,e[u]=i%n;return o&&(e=[o].concat(e)),e}function t(e,t,n,r){var i,s;if(n!=r)s=n>r?1:-1;else for(i=s=0;i<n;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,s,a,u){var c,f,h,p,g,y,A,b,T,w,v,I,S,E,C,_,B,O=r.s==i.s?1:-1,N=r.c,x=i.c;if(!(N&&N[0]&&x&&x[0]))return new j(r.s&&i.s&&(N?!x||N[0]!=x[0]:x)?N&&0==N[0]||!x?0*O:O/0:NaN);for(T=(b=new j(O)).c=[],O=s+(f=r.e-i.e)+1,u||(u=l,f=m(r.e/d)-m(i.e/d),O=O/d|0),h=0;x[h]==(N[h]||0);h++);if(x[h]>(N[h]||0)&&f--,O<0)T.push(1),p=!0;else{for(E=N.length,_=x.length,h=0,O+=2,(g=o(u/(x[0]+1)))>1&&(x=e(x,g,u),N=e(N,g,u),_=x.length,E=N.length),S=_,v=(w=N.slice(0,_)).length;v<_;w[v++]=0);B=x.slice(),B=[0].concat(B),C=x[0],x[1]>=u/2&&C++;do{if(g=0,(c=t(x,w,_,v))<0){if(I=w[0],_!=v&&(I=I*u+(w[1]||0)),(g=o(I/C))>1)for(g>=u&&(g=u-1),A=(y=e(x,g,u)).length,v=w.length;1==t(y,w,A,v);)g--,n(y,_<A?B:x,A,u),A=y.length,c=1;else 0==g&&(c=g=1),A=(y=x.slice()).length;if(A<v&&(y=[0].concat(y)),n(w,y,v,u),v=w.length,-1==c)for(;t(x,w,_,v)<1;)g++,n(w,_<v?B:x,v,u),v=w.length}else 0===c&&(g++,w=[0]);T[h++]=g,w[0]?w[v++]=N[S]||0:(w=[N[S]],v=1)}while((S++<E||null!=w[0])&&O--);p=null!=w[0],T[0]||T.splice(0,1)}if(u==l){for(h=1,O=T[0];O>=10;O/=10,h++);K(b,s+(b.e=h+f*d-1)+1,a,p)}else b.e=f,b.r=+p;return b}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,_=/^\.([^.]+)$/,B=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,r){var i,s=n?t:t.replace(O,"");if(B.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(E,(function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t})),r&&(i=r,s=s.replace(C,"$1").replace(_,"0.$1")),t!=s))return new j(s,i);if(j.DEBUG)throw Error(u+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},N.absoluteValue=N.abs=function(){var e=new j(this);return e.s<0&&(e.s=1),e},N.comparedTo=function(e,t){return A(this,new j(e,t))},N.decimalPlaces=N.dp=function(e,t){var n,r,i,s=this;if(null!=e)return b(e,0,g),null==t?t=D:b(t,0,8),K(new j(s),e+s.e+1,t);if(!(n=s.c))return null;if(r=((i=n.length-1)-m(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},N.dividedBy=N.div=function(e,t){return n(this,new j(e,t),P,D)},N.dividedToIntegerBy=N.idiv=function(e,t){return n(this,new j(e,t),0,1)},N.exponentiatedBy=N.pow=function(e,t){var n,r,i,s,c,l,f,h,p=this;if((e=new j(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+W(e));if(null!=t&&(t=new j(t)),c=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new j(Math.pow(+W(p),c?2-T(e):+W(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new j(NaN);(r=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||c&&p.c[1]>=24e7:p.c[0]<8e13||c&&p.c[0]<=9999975e7)))return s=p.s<0&&T(e)?-0:0,p.e>-1&&(s=1/s),new j(l?1/s:s);V&&(s=a(V/d+2))}for(c?(n=new j(.5),l&&(e.s=1),f=T(e)):f=(i=Math.abs(+W(e)))%2,h=new j(x);;){if(f){if(!(h=h.times(p)).c)break;s?h.c.length>s&&(h.c.length=s):r&&(h=h.mod(t))}if(i){if(0===(i=o(i/2)))break;f=i%2}else if(K(e=e.times(n),e.e+1,1),e.e>14)f=T(e);else{if(0==(i=+W(e)))break;f=i%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):r&&(p=p.mod(t))}return r?h:(l&&(h=x.div(h)),t?h.mod(t):s?K(h,V,D,void 0):h)},N.integerValue=function(e){var t=new j(this);return null==e?e=D:b(e,0,8),K(t,t.e+1,e)},N.isEqualTo=N.eq=function(e,t){return 0===A(this,new j(e,t))},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(e,t){return A(this,new j(e,t))>0},N.isGreaterThanOrEqualTo=N.gte=function(e,t){return 1===(t=A(this,new j(e,t)))||0===t},N.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},N.isLessThan=N.lt=function(e,t){return A(this,new j(e,t))<0},N.isLessThanOrEqualTo=N.lte=function(e,t){return-1===(t=A(this,new j(e,t)))||0===t},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.minus=function(e,t){var n,r,i,s,a=this,o=a.s;if(t=(e=new j(e,t)).s,!o||!t)return new j(NaN);if(o!=t)return e.s=-t,a.plus(e);var u=a.e/d,c=e.e/d,f=a.c,h=e.c;if(!u||!c){if(!f||!h)return f?(e.s=-t,e):new j(h?a:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new j(f[0]?a:3==D?-0:0)}if(u=m(u),c=m(c),f=f.slice(),o=u-c){for((s=o<0)?(o=-o,i=f):(c=u,i=h),i.reverse(),t=o;t--;i.push(0));i.reverse()}else for(r=(s=(o=f.length)<(t=h.length))?o:t,o=t=0;t<r;t++)if(f[t]!=h[t]){s=f[t]<h[t];break}if(s&&(i=f,f=h,h=i,e.s=-e.s),(t=(r=h.length)-(n=f.length))>0)for(;t--;f[n++]=0);for(t=l-1;r>o;){if(f[--r]<h[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=l}f[r]-=h[r]}for(;0==f[0];f.splice(0,1),--c);return f[0]?z(e,f,c):(e.s=3==D?-1:1,e.c=[e.e=0],e)},N.modulo=N.mod=function(e,t){var r,i,s=this;return e=new j(e,t),!s.c||!e.s||e.c&&!e.c[0]?new j(NaN):!e.c||s.c&&!s.c[0]?new j(s):(9==M?(i=e.s,e.s=1,r=n(s,e,0,3),e.s=i,r.s*=i):r=n(s,e,0,M),(e=s.minus(r.times(e))).c[0]||1!=M||(e.s=s.s),e)},N.multipliedBy=N.times=function(e,t){var n,r,i,s,a,o,u,c,f,h,g,y,A,b,T,w=this,v=w.c,I=(e=new j(e,t)).c;if(!(v&&I&&v[0]&&I[0]))return!w.s||!e.s||v&&!v[0]&&!I||I&&!I[0]&&!v?e.c=e.e=e.s=null:(e.s*=w.s,v&&I?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=m(w.e/d)+m(e.e/d),e.s*=w.s,(u=v.length)<(h=I.length)&&(A=v,v=I,I=A,i=u,u=h,h=i),i=u+h,A=[];i--;A.push(0));for(b=l,T=p,i=h;--i>=0;){for(n=0,g=I[i]%T,y=I[i]/T|0,s=i+(a=u);s>i;)n=((c=g*(c=v[--a]%T)+(o=y*c+(f=v[a]/T|0)*g)%T*T+A[s]+n)/b|0)+(o/T|0)+y*f,A[s--]=c%b;A[s]=n}return n?++r:A.splice(0,1),z(e,A,r)},N.negated=function(){var e=new j(this);return e.s=-e.s||null,e},N.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new j(e,t)).s,!i||!t)return new j(NaN);if(i!=t)return e.s=-t,r.minus(e);var s=r.e/d,a=e.e/d,o=r.c,u=e.c;if(!s||!a){if(!o||!u)return new j(i/0);if(!o[0]||!u[0])return u[0]?e:new j(o[0]?r:0*i)}if(s=m(s),a=m(a),o=o.slice(),i=s-a){for(i>0?(a=s,n=u):(i=-i,n=o),n.reverse();i--;n.push(0));n.reverse()}for((i=o.length)-(t=u.length)<0&&(n=u,u=o,o=n,t=i),i=0;t;)i=(o[--t]=o[t]+u[t]+i)/l|0,o[t]=l===o[t]?0:o[t]%l;return i&&(o=[i].concat(o),++a),z(e,o,a)},N.precision=N.sd=function(e,t){var n,r,i,s=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=D:b(t,0,8),K(new j(s),e,t);if(!(n=s.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&s.e+1>r&&(r=s.e+1),r},N.shiftedBy=function(e){return b(e,-9007199254740991,f),this.times("1e"+e)},N.squareRoot=N.sqrt=function(){var e,t,r,i,s,a=this,o=a.c,u=a.s,c=a.e,l=P+4,d=new j("0.5");if(1!==u||!o||!o[0])return new j(!u||u<0&&(!o||o[0])?NaN:o?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=y(o)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=m((c+1)/2)-(c<0||c%2),r=new j(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new j(u+""),r.c[0])for((u=(c=r.e)+l)<3&&(u=0);;)if(s=r,r=d.times(s.plus(n(a,s,l,1))),y(s.c).slice(0,u)===(t=y(r.c)).slice(0,u)){if(r.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(r,r.e+P+2,1),e=!r.times(r).eq(a));break}if(!i&&(K(s,s.e+P+2,0),s.times(s).eq(a))){r=s;break}l+=4,u+=4,i=1}return K(r,r.e+P+1,D,e)},N.toExponential=function(e,t){return null!=e&&(b(e,0,g),e++),q(this,e,t,1)},N.toFixed=function(e,t){return null!=e&&(b(e,0,g),e=e+this.e+1),q(this,e,t)},N.toFormat=function(e,t,n){var r,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=G;else if("object"!=typeof n)throw Error(u+"Argument not an object: "+n);if(r=i.toFixed(e,t),i.c){var s,a=r.split("."),o=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",d=a[0],f=a[1],h=i.s<0,p=h?d.slice(1):d,g=p.length;if(c&&(s=o,o=c,c=s,g-=s),o>0&&g>0){for(s=g%o||o,d=p.substr(0,s);s<g;s+=o)d+=l+p.substr(s,o);c>0&&(d+=l+p.slice(s)),h&&(d="-"+d)}r=f?d+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):f):d}return(n.prefix||"")+r+(n.suffix||"")},N.toFraction=function(e){var t,r,i,s,a,o,c,l,f,p,g,m,A=this,b=A.c;if(null!=e&&(!(c=new j(e)).isInteger()&&(c.c||1!==c.s)||c.lt(x)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!b)return new j(A);for(t=new j(x),f=r=new j(x),i=l=new j(x),m=y(b),a=t.e=m.length-A.e-1,t.c[0]=h[(o=a%d)<0?d+o:o],e=!e||c.comparedTo(t)>0?a>0?t:f:c,o=F,F=1/0,c=new j(m),l.c[0]=0;p=n(c,t,0,1),1!=(s=r.plus(p.times(i))).comparedTo(e);)r=i,i=s,f=l.plus(p.times(s=f)),l=s,t=c.minus(p.times(s=t)),c=s;return s=n(e.minus(r),i,0,1),l=l.plus(s.times(f)),r=r.plus(s.times(i)),l.s=f.s=A.s,g=n(f,i,a*=2,D).minus(A).abs().comparedTo(n(l,r,a,D).minus(A).abs())<1?[f,i]:[l,r],F=o,g},N.toNumber=function(){return+W(this)},N.toPrecision=function(e,t){return null!=e&&b(e,1,g),q(this,e,t,2)},N.toString=function(e){var t,n=this,i=n.s,s=n.e;return null===s?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=s<=k||s>=R?w(y(n.c),s):v(y(n.c),s,"0"):10===e?t=v(y((n=K(new j(n),P+s+1,D)).c),n.e,"0"):(b(e,2,H.length,"Base"),t=r(v(y(n.c),s,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},N.valueOf=N.toJSON=function(){return W(this)},N._isBigNumber=!0,null!=t&&j.set(t),j}(),i.default=i.BigNumber=i,void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},1892:(e,t,n)=>{function r(e){if(!r.supported)return null;var t,s=e&&e.imports,a=(t="AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBx8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAZfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgHXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBF8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAWfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgE3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIICB8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAefHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgG3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB98fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAUfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgF3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBh8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCASfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBV8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAYfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgGnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBR8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiASfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB18fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAcfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggH3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBN8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAXfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgFnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBt8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAVfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggEXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFICB8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAZfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgGnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBF8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAWfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBN8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAVfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggG3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIICB8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAffHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBx8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAdfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggF3x8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBl8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAUfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgHnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBN8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAdfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgF3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBt8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByARfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBl8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAUfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgFXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB58fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAYfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFnx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIICB8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAffHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgEnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBp8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAdfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgFnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBJ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAgfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgH3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB58fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAVfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggG3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBF8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAYfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgF3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBR8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAafHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggE3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBl8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAcfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBx8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAYfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgH3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIB18fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByASfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggFHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBp8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAWfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHICB8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAVfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBd8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSATfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgG3x8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBd8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAgfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgH3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBp8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAcfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBF8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAZfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgHXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBN8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAefHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgGHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBJ8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAVfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgG3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBZ8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAbfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgE3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBl8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAVfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGHx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBd8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCASfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggFnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGICB8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAcfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgGnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB98fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAUfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB58fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSARfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgEXx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBJ8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiATfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgFHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBV8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAWfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggF3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBh8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAZfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgGnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBt8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAcfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB58fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAffHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgIHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB98fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAbfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBl8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAafHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgIHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIB58fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAXfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEnx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB18fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL","function"==typeof atob?new Uint8Array(atob(t).split("").map(i)):new(n(8287).Buffer)(t,"base64")),o=null,u={buffer:a,memory:null,exports:null,realloc:function(e){u.exports.memory.grow(Math.ceil(Math.abs(e-u.memory.length)/65536)),u.memory=new Uint8Array(u.exports.memory.buffer)},onload:c};return c((function(){})),u;function c(t){if(u.exports)return t();if(o)o.then(t.bind(null,null)).catch(t);else{try{if(e&&e.async)throw new Error("async");l({instance:new WebAssembly.Instance(new WebAssembly.Module(a),s)})}catch(e){o=WebAssembly.instantiate(a,s).then(l)}c(t)}}function l(e){u.exports=e.instance.exports,u.memory=u.exports.memory&&u.exports.memory.buffer&&new Uint8Array(u.exports.memory.buffer)}}function i(e){return e.charCodeAt(0)}e.exports=r,r.supported="undefined"!=typeof WebAssembly},1685:(e,t,n)=>{var r=n(6889),i=n(1892)(),s=64,a=[];e.exports=h;var o=e.exports.BYTES_MIN=16,u=e.exports.BYTES_MAX=64,c=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,d=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),f=e.exports.PERSONALBYTES=16;function h(e,t,n,p,g){if(!(this instanceof h))return new h(e,t,n,p,g);if(!i||!i.exports)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==g&&(r(e>=o,"digestLength must be at least "+o+", was given "+e),r(e<=u,"digestLength must be at most "+u+", was given "+e),null!=t&&r(t.length>=c,"key must be at least "+c+", was given "+t.length),null!=t&&r(t.length<=l,"key must be at least "+l+", was given "+t.length),null!=n&&r(n.length===d,"salt must be exactly "+d+", was given "+n.length),null!=p&&r(p.length===f,"personal must be exactly "+f+", was given "+p.length)),a.length||(a.push(s),s+=216),this.digestLength=e,this.finalized=!1,this.pointer=a.pop(),i.memory.fill(0,0,64),i.memory[0]=this.digestLength,i.memory[1]=t?t.length:0,i.memory[2]=1,i.memory[3]=1,n&&i.memory.set(n,32),p&&i.memory.set(p,48),this.pointer+216>i.memory.length&&i.realloc(this.pointer+216),i.exports.blake2b_init(this.pointer,this.digestLength),t&&(this.update(t),i.memory.fill(0,s,s+t.length),i.memory[this.pointer+200]=128)}function p(){}h.prototype.update=function(e){return r(!1===this.finalized,"Hash instance finalized"),r(e,"input must be TypedArray or Buffer"),s+e.length>i.memory.length&&i.realloc(s+e.length),i.memory.set(e,s),i.exports.blake2b_update(this.pointer,s,s+e.length),this},h.prototype.digest=function(e){if(r(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,a.push(this.pointer),i.exports.blake2b_final(this.pointer),!e||"binary"===e)return i.memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("hex"===e)return function(e,t,n){for(var r="",i=0;i<n;i++)r+=(s=e[t+i])<16?"0"+s.toString(16):s.toString(16);var s;return r}(i.memory,this.pointer+128,this.digestLength);r(e.length>=this.digestLength,"input must be TypedArray or Buffer");for(var t=0;t<this.digestLength;t++)e[t]=i.memory[this.pointer+128+t];return e},h.prototype.final=h.prototype.digest,h.WASM=i&&i.buffer,h.SUPPORTED="undefined"!=typeof WebAssembly,h.ready=function(e){return e||(e=p),i?new Promise((function(t,n){i.onload((function(r){r?n():t(),e(r)}))})):e(new Error("WebAssembly not supported"))},h.prototype.ready=h.ready},2206:(e,t,n)=>{var r=n(6889),i=n(1685);function s(e,t,n){var r=e[t]+e[n],i=e[t+1]+e[n+1];r>=4294967296&&i++,e[t]=r,e[t+1]=i}function a(e,t,n,r){var i=e[t]+n;n<0&&(i+=4294967296);var s=e[t+1]+r;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function u(e,t,n,r,i,o){var u=f[i],c=f[i+1],l=f[o],h=f[o+1];s(d,e,t),a(d,e,u,c);var p=d[r]^d[e],g=d[r+1]^d[e+1];d[r]=g,d[r+1]=p,s(d,n,r),p=d[t]^d[n],g=d[t+1]^d[n+1],d[t]=p>>>24^g<<8,d[t+1]=g>>>24^p<<8,s(d,e,t),a(d,e,l,h),p=d[r]^d[e],g=d[r+1]^d[e+1],d[r]=p>>>16^g<<16,d[r+1]=g>>>16^p<<16,s(d,n,r),p=d[t]^d[n],g=d[t+1]^d[n+1],d[t]=g>>>31^p<<1,d[t+1]=p>>>31^g<<1}var c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),l=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),d=new Uint32Array(32),f=new Uint32Array(32);function h(e,t){var n=0;for(n=0;n<16;n++)d[n]=e.h[n],d[n+16]=c[n];for(d[24]=d[24]^e.t,d[25]=d[25]^e.t/4294967296,t&&(d[28]=~d[28],d[29]=~d[29]),n=0;n<32;n++)f[n]=o(e.b,4*n);for(n=0;n<12;n++)u(0,8,16,24,l[16*n+0],l[16*n+1]),u(2,10,18,26,l[16*n+2],l[16*n+3]),u(4,12,20,28,l[16*n+4],l[16*n+5]),u(6,14,22,30,l[16*n+6],l[16*n+7]),u(0,10,20,30,l[16*n+8],l[16*n+9]),u(2,12,22,24,l[16*n+10],l[16*n+11]),u(4,14,16,26,l[16*n+12],l[16*n+13]),u(6,8,18,28,l[16*n+14],l[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^d[n]^d[n+16]}var p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function g(e,t,n,r){p.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,n&&p.set(n,32),r&&p.set(r,48);for(var i=0;i<16;i++)this.h[i]=c[i]^o(p,4*i);t&&(m(this,t),this.c=128)}function m(e,t){for(var n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[n]}g.prototype.update=function(e){return r(null!=e,"input must be Uint8Array or Buffer"),m(this,e),this},g.prototype.digest=function(e){var t=e&&"binary"!==e&&"hex"!==e?e:new Uint8Array(this.outlen);return r(t.length>=this.outlen,"out must have at least outlen bytes of space"),function(e,t){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);for(var n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n)}(this,t),"hex"===e?function(e){for(var t="",n=0;n<e.length;n++)t+=(r=e[n])<16?"0"+r.toString(16):r.toString(16);var r;return t}(t):t},g.prototype.final=g.prototype.digest,g.ready=function(e){i.ready((function(){e()}))};var y=g;e.exports=function(e,t,n,i,s){return!0!==s&&(r(e>=A,"outlen must be at least "+A+", was given "+e),r(e<=b,"outlen must be at most "+b+", was given "+e),null!=t&&r(t.length>=T,"key must be at least "+T+", was given "+t.length),null!=t&&r(t.length<=w,"key must be at most "+w+", was given "+t.length),null!=n&&r(n.length===v,"salt must be exactly "+v+", was given "+n.length),null!=i&&r(i.length===I,"personal must be exactly "+I+", was given "+i.length)),new y(e,t,n,i)},e.exports.ready=function(e){i.ready((function(){e()}))},e.exports.WASM_SUPPORTED=i.SUPPORTED,e.exports.WASM_LOADED=!1;var A=e.exports.BYTES_MIN=16,b=e.exports.BYTES_MAX=64,T=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),w=e.exports.KEYBYTES_MAX=64,v=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),I=e.exports.PERSONALBYTES=16;i.ready((function(t){t||(e.exports.WASM_LOADED=!0,y=i)}))},8287:(e,t,n)=>{"use strict";const r=n(7526),i=n(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=o(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),o(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=o(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return B(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function A(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){let s,a=1,o=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(s=n;s<o;s++)if(c(e,s)===c(t,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===u)return r*a}else-1!==r&&(s-=s-r),r=-1}else for(n+u>o&&(n=o-u),s=n;s>=0;s--){let n=!0;for(let r=0;r<u;r++)if(c(e,s+r)!==c(t,r)){n=!1;break}if(n)return s}return-1}function T(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=t.length;let a;for(r>s/2&&(r=s/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Y(r))return a;e[n+a]=r}return a}function w(e,t,n,r){return W(z(t,e.length-n),e,n,r)}function v(e,t,n,r){return W(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function I(e,t,n,r){return W(K(t),e,n,r)}function S(e,t,n,r){return W(function(e,t){let n,r,i;const s=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let s=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,o,u;switch(a){case 1:t<128&&(s=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(s=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:n=e[i+1],r=e[i+2],o=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&o,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,s=Math.min(n,r);i<s;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if($(t,Uint8Array))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const o=Math.min(s,a),c=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<o;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:a<s?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return A(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return A(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return I(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function B(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function N(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function x(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function k(e,t,n,r,i){H(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function R(e,t,n,r,i){H(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function L(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,s){return t=+t,n>>>=0,s||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,s){return t=+t,n>>>=0,s||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,i=1,s=this[e+--r];for(;r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const s=u.isBuffer(e)?e:u.from(e,r),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%a]}return this};const M={};function V(e,t,n){M[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function G(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,i,s){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new M.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,i,s)}function j(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new M.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),V("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=G(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const s=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function K(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},7007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,s,a,c;if(o(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),a=s[t]),void 0===a)a=s[t]=n,++e._eventsCount;else if("function"==typeof a?a=s[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,s,a;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){a=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,n,r,i){var s,a,o=8*i-r-1,u=(1<<o)-1,c=u>>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=o;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=c}return(h?-1:1)*a*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var a,o,u,c=8*s-i-1,l=(1<<c)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(o=0,a=l):a+d>=1?(o=(t*u-1)*Math.pow(2,i),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},1013:(e,t,n)=>{var r=n(7372).stringify,i=n(8146);e.exports=function(e){return{parse:i(e),stringify:r}},e.exports.parse=i(),e.exports.stringify=r},8146:(e,t,n)=>{var r=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,s=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var a,o,u,c,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},d=function(e){throw{name:"SyntaxError",message:e,at:a,text:u}},f=function(e){return e&&e!==o&&d("Expected '"+e+"' instead of '"+o+"'"),o=u.charAt(a),a+=1,o},h=function(){var e,i="";for("-"===o&&(i="-",f("-"));o>="0"&&o<="9";)i+=o,f();if("."===o)for(i+=".";f()&&o>="0"&&o<="9";)i+=o;if("e"===o||"E"===o)for(i+=o,f(),"-"!==o&&"+"!==o||(i+=o,f());o>="0"&&o<="9";)i+=o,f();if(e=+i,isFinite(e))return null==r&&(r=n(1594)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new r(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new r(e):e;d("Bad number")},p=function(){var e,t,n,r="";if('"'===o)for(var i=a;f();){if('"'===o)return a-1>i&&(r+=u.substring(i,a-1)),f(),r;if("\\"===o){if(a-1>i&&(r+=u.substring(i,a-1)),f(),"u"===o){for(n=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof l[o])break;r+=l[o]}i=a}}d("Bad string")},g=function(){for(;o&&o<=" ";)f()};return c=function(){switch(g(),o){case"{":return function(){var e,n=Object.create(null);if("{"===o){if(f("{"),g(),"}"===o)return f("}"),n;for(;o;){if(e=p(),g(),f(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&d('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?d("Object contains forbidden prototype property"):"ignore"===t.protoAction?c():n[e]=c():!0===s.test(e)?"error"===t.constructorAction?d("Object contains forbidden constructor property"):"ignore"===t.constructorAction?c():n[e]=c():n[e]=c(),g(),"}"===o)return f("}"),n;f(","),g()}}d("Bad object")}();case"[":return function(){var e=[];if("["===o){if(f("["),g(),"]"===o)return f("]"),e;for(;o;){if(e.push(c()),g(),"]"===o)return f("]"),e;f(","),g()}}d("Bad array")}();case'"':return p();case"-":return h();default:return o>="0"&&o<="9"?h():function(){switch(o){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}d("Unexpected '"+o+"'")}()}},function(e,t){var n;return u=e+"",a=0,o=" ",n=c(),g(),o&&d("Syntax error"),"function"==typeof t?function e(n,r){var i,s=n[r];return s&&"object"==typeof s&&Object.keys(s).forEach((function(t){void 0!==(i=e(s,t))?s[t]=i:delete s[t]})),t.call(n,r,s)}({"":n},""):n}}},7372:(e,t,n)=>{var r=n(1594),i=e.exports;!function(){"use strict";var e,t,n,s=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return s.lastIndex=0,s.test(e)?'"'+e.replace(s,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function u(i,s){var a,c,l,d,f,h=e,p=s[i],g=null!=p&&(p instanceof r||r.isBigNumber(p));switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(i)),"function"==typeof n&&(p=n.call(s,i,p)),typeof p){case"string":return g?p:o(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(e+=t,f=[],"[object Array]"===Object.prototype.toString.apply(p)){for(d=p.length,a=0;a<d;a+=1)f[a]=u(a,p)||"null";return l=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+h+"]":"["+f.join(",")+"]",e=h,l}if(n&&"object"==typeof n)for(d=n.length,a=0;a<d;a+=1)"string"==typeof n[a]&&(l=u(c=n[a],p))&&f.push(o(c)+(e?": ":":")+l);else Object.keys(p).forEach((function(t){var n=u(t,p);n&&f.push(o(t)+(e?": ":":")+n)}));return l=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+h+"}":"{"+f.join(",")+"}",e=h,l}}"function"!=typeof i.stringify&&(i.stringify=function(r,i,s){var a;if(e="",t="","number"==typeof s)for(a=0;a<s;a+=1)t+=" ";else"string"==typeof s&&(t=s);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return u("",{"":r})})}()},5508:(e,t,n)=>{e.exports=n(9792)(n(4817))},9792:(e,t,n)=>{const r=n(212),i=n(4614);e.exports=function(e){const t=r(e),n=i(e);return function(e,r){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,r);case"keccak256":return new t(1088,512,null,256,r);case"keccak384":return new t(832,768,null,384,r);case"keccak512":return new t(576,1024,null,512,r);case"sha3-224":return new t(1152,448,6,224,r);case"sha3-256":return new t(1088,512,6,256,r);case"sha3-384":return new t(832,768,6,384,r);case"sha3-512":return new t(576,1024,6,512,r);case"shake128":return new n(1344,256,31,r);case"shake256":return new n(1088,512,31,r);default:throw new Error("Invald algorithm: "+e)}}}},212:(e,t,n)=>{const{Transform:r}=n(8399);e.exports=e=>class t extends r{constructor(t,n,r,i,s){super(s),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=i,this._options=s,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},4614:(e,t,n)=>{const{Transform:r}=n(8399);e.exports=e=>class t extends r{constructor(t,n,r,i){super(i),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._options=i,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(e);return void 0!==t&&(n=n.toString(t)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},9078:(e,t)=>{const n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let h=d^(s<<1|a>>>31),p=f^(a<<1|s>>>31);const g=e[0]^h,m=e[1]^p,y=e[10]^h,A=e[11]^p,b=e[20]^h,T=e[21]^p,w=e[30]^h,v=e[31]^p,I=e[40]^h,S=e[41]^p;h=r^(o<<1|u>>>31),p=i^(u<<1|o>>>31);const E=e[2]^h,C=e[3]^p,_=e[12]^h,B=e[13]^p,O=e[22]^h,N=e[23]^p,x=e[32]^h,P=e[33]^p,D=e[42]^h,k=e[43]^p;h=s^(c<<1|l>>>31),p=a^(l<<1|c>>>31);const R=e[4]^h,L=e[5]^p,F=e[14]^h,U=e[15]^p,M=e[24]^h,V=e[25]^p,G=e[34]^h,H=e[35]^p,j=e[44]^h,q=e[45]^p;h=o^(d<<1|f>>>31),p=u^(f<<1|d>>>31);const Q=e[6]^h,z=e[7]^p,K=e[16]^h,W=e[17]^p,$=e[26]^h,Y=e[27]^p,J=e[36]^h,X=e[37]^p,Z=e[46]^h,ee=e[47]^p;h=c^(r<<1|i>>>31),p=l^(i<<1|r>>>31);const te=e[8]^h,ne=e[9]^p,re=e[18]^h,ie=e[19]^p,se=e[28]^h,ae=e[29]^p,oe=e[38]^h,ue=e[39]^p,ce=e[48]^h,le=e[49]^p,de=g,fe=m,he=A<<4|y>>>28,pe=y<<4|A>>>28,ge=b<<3|T>>>29,me=T<<3|b>>>29,ye=v<<9|w>>>23,Ae=w<<9|v>>>23,be=I<<18|S>>>14,Te=S<<18|I>>>14,we=E<<1|C>>>31,ve=C<<1|E>>>31,Ie=B<<12|_>>>20,Se=_<<12|B>>>20,Ee=O<<10|N>>>22,Ce=N<<10|O>>>22,_e=P<<13|x>>>19,Be=x<<13|P>>>19,Oe=D<<2|k>>>30,Ne=k<<2|D>>>30,xe=L<<30|R>>>2,Pe=R<<30|L>>>2,De=F<<6|U>>>26,ke=U<<6|F>>>26,Re=V<<11|M>>>21,Le=M<<11|V>>>21,Fe=G<<15|H>>>17,Ue=H<<15|G>>>17,Me=q<<29|j>>>3,Ve=j<<29|q>>>3,Ge=Q<<28|z>>>4,He=z<<28|Q>>>4,je=W<<23|K>>>9,qe=K<<23|W>>>9,Qe=$<<25|Y>>>7,ze=Y<<25|$>>>7,Ke=J<<21|X>>>11,We=X<<21|J>>>11,$e=ee<<24|Z>>>8,Ye=Z<<24|ee>>>8,Je=te<<27|ne>>>5,Xe=ne<<27|te>>>5,Ze=re<<20|ie>>>12,et=ie<<20|re>>>12,tt=ae<<7|se>>>25,nt=se<<7|ae>>>25,rt=oe<<8|ue>>>24,it=ue<<8|oe>>>24,st=ce<<14|le>>>18,at=le<<14|ce>>>18;e[0]=de^~Ie&Re,e[1]=fe^~Se&Le,e[10]=Ge^~Ze&ge,e[11]=He^~et&me,e[20]=we^~De&Qe,e[21]=ve^~ke&ze,e[30]=Je^~he&Ee,e[31]=Xe^~pe&Ce,e[40]=xe^~je&tt,e[41]=Pe^~qe&nt,e[2]=Ie^~Re&Ke,e[3]=Se^~Le&We,e[12]=Ze^~ge&_e,e[13]=et^~me&Be,e[22]=De^~Qe&rt,e[23]=ke^~ze&it,e[32]=he^~Ee&Fe,e[33]=pe^~Ce&Ue,e[42]=je^~tt&ye,e[43]=qe^~nt&Ae,e[4]=Re^~Ke&st,e[5]=Le^~We&at,e[14]=ge^~_e&Me,e[15]=me^~Be&Ve,e[24]=Qe^~rt&be,e[25]=ze^~it&Te,e[34]=Ee^~Fe&$e,e[35]=Ce^~Ue&Ye,e[44]=tt^~ye&Oe,e[45]=nt^~Ae&Ne,e[6]=Ke^~st&de,e[7]=We^~at&fe,e[16]=_e^~Me&Ge,e[17]=Be^~Ve&He,e[26]=rt^~be&we,e[27]=it^~Te&ve,e[36]=Fe^~$e&Je,e[37]=Ue^~Ye&Xe,e[46]=ye^~Oe&xe,e[47]=Ae^~Ne&Pe,e[8]=st^~de&Ie,e[9]=at^~fe&Se,e[18]=Me^~Ge&Ze,e[19]=Ve^~He&et,e[28]=be^~we&De,e[29]=Te^~ve&ke,e[38]=$e^~Je&he,e[39]=Ye^~Xe&pe,e[48]=Oe^~xe&je,e[49]=Ne^~Pe&qe,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},4817:(e,t,n)=>{const r=n(9078);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,128&e&&this.count===this.blockSize-1&&r.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,r.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let n=0;n<e;++n)t[n]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},6889:e=>{function t(e,t){if(!e)throw new Error(t||"AssertionError")}t.notEqual=function(e,n,r){t(e!=n,r)},t.notOk=function(e,n){t(!e,n)},t.equal=function(e,n,r){t(e==n,r)},t.ok=t,e.exports=t},6946:(e,t,n)=>{"use strict";e.exports=n(4394)},4394:(e,t,n)=>{"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(3449),r.BufferWriter=n(818),r.Reader=n(6237),r.BufferReader=n(777),r.util=n(3610),r.rpc=n(5047),r.roots=n(4529),r.configure=i,i()},6237:(e,t,n)=>{"use strict";e.exports=u;var r,i=n(3610),s=i.LongBits,a=i.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},d=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function f(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw o(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},777:(e,t,n)=>{"use strict";e.exports=s;var r=n(6237);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3610);function s(e){r.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},4529:e=>{"use strict";e.exports={}},5047:(e,t,n)=>{"use strict";t.Service=n(7595)},7595:(e,t,n)=>{"use strict";e.exports=i;var r=n(3610);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,s,a){if(!s)throw TypeError("request must be specified");var o=this;if(!a)return r.asPromise(e,o,t,n,i,s);if(o.rpcImpl)try{return o.rpcImpl(t,n[o.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return o.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof i))try{n=i[o.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return o.emit("error",e,t),a(e)}return o.emit("data",n,t),a(null,n)}o.end(!0)}))}catch(e){return o.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},2239:(e,t,n)=>{"use strict";e.exports=i;var r=n(3610);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var o=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?s:new i((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},3610:function(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(8045),r.base64=n(8839),r.EventEmitter=n(4358),r.float=n(9410),r.inquire=n(4153),r.utf8=n(1447),r.pool=n(9390),r.LongBits=n(2239),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},3449:(e,t,n)=>{"use strict";e.exports=d;var r,i=n(3610),s=i.LongBits,a=i.base64,o=i.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function h(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function g(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function m(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(g,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(g,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(g,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var n=d.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},d.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},818:(e,t,n)=>{"use strict";e.exports=s;var r=n(3449);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3610);function s(){r.call(this)}function a(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},s._configure()},6048:e=>{"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,s,a,o,u;if("string"==typeof t&&(s="not ",t.substr(0,4)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(o=e).length||-1===o.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(r(t,"type"))}return a+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382:(e,t,n)=>{"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var i=n(5412),s=n(6708);n(6698)(c,i);for(var a=r(s.prototype),o=0;o<a.length;o++){var u=a[o];c.prototype[u]||(c.prototype[u]=s.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600:(e,t,n)=>{"use strict";e.exports=i;var r=n(4610);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(6698)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},5412:(e,t,n)=>{"use strict";var r;e.exports=S,S.ReadableState=I,n(7007).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},a=n(345),o=n(8287).Buffer,u=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=n(9838);i=c&&c.debuglog?c.debuglog("stream"):function(){};var l,d,f,h=n(2726),p=n(5896),g=n(5291).getHighWaterMark,m=n(6048).F,y=m.ERR_INVALID_ARG_TYPE,A=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(6698)(S,a);var w=p.errorOrDestroy,v=["error","close","destroy","pause","resume"];function I(e,t,i){r=r||n(5382),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(r=r||n(5382),!(this instanceof S))return new S(e);var t=this instanceof r;this._readableState=new I(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function E(e,t,n,r,s){i("readableAddChunk",t);var a,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}(e,c);else if(s||(a=function(e,t){var n,r;return r=t,o.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t)),n}(c,t)),a)w(e,a);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),r)c.endEmitted?w(e,new T):C(e,c,t,!0);else if(c.ended)w(e,new A);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!n?(t=c.decoder.write(t),c.objectMode||0!==t.length?C(e,c,t,!1):x(e,c)):C(e,c,t,!1)}else r||(c.reading=!1,x(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function C(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),x(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=o.from(e,t),t=""),n=!0),E(this,e,t,!1,n)},S.prototype.unshift=function(e){return E(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=n(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var _=1073741824;function B(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(N,e))}function N(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function x(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function R(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(M,t,e))}function M(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function V(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}S.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=B(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,s=t.needReadable;return i("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",s=!0),t.ended||t.reading?i("reading or ended",s=!1):s&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=B(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},S.prototype._read=function(e){w(this,new b("_read()"))},S.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?p:o;function o(){i("onend"),e.end()}r.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",(function t(s,a){i("onunpipe"),s===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",p),n.removeListener("data",l),c=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(n);e.on("drain",u);var c=!1;function l(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==V(r.pipes,e))&&!c&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function d(t){i("onerror",t),p(),e.removeListener("error",d),0===s(e,"error")&&w(e,t)}function f(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",f),p()}function p(){i("unpipe"),n.unpipe(e)}return n.on("data",l),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",h),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=V(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},S.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?O(this):r.reading||process.nextTick(k,this))),n},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(D,this),n},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(D,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(R,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var s in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){i("wrapped data"),n.decoder&&(s=n.decoder.write(s)),n.objectMode&&null==s||(n.objectMode||s&&s.length)&&(t.push(s)||(r=!0,e.pause()))})),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var a=0;a<v.length;a++)e.on(v[a],this.emit.bind(this,v[a]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n(2955)),d(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=F,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===f&&(f=n(5157)),f(S,e,t)})},4610:(e,t,n)=>{"use strict";e.exports=l;var r=n(6048).F,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(5382);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new s);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}n(6698)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new i("_transform()"))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},6708:(e,t,n)=>{"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=S,S.WritableState=I;var s,a={deprecate:n(4643)},o=n(345),u=n(8287).Buffer,c=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=n(5896),d=n(5291).getHighWaterMark,f=n(6048).F,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,A=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,T=f.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function v(){}function I(e,t,s){i=i||n(5382),e=e||{},"boolean"!=typeof s&&(s=t instanceof i),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(N,e,t),e._writableState.errorEmitted=!0,w(e,r)):(i(r),e._writableState.errorEmitted=!0,w(e,r),N(e,t))}(e,n,r,t,i);else{var s=B(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?process.nextTick(C,e,n,s,i):C(e,n,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function S(e){var t=this instanceof(i=i||n(5382));if(!t&&!s.call(S,this))return new S(e);this._writableState=new I(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function E(e,t,n,r,i,s,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function C(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),N(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,s=new Array(i),a=t.corkedRequestsFree;a.entry=n;for(var o=0,u=!0;n;)s[o]=n,n.isBuf||(u=!1),n=n.next,o+=1;s.allBuffers=u,E(e,t,!0,t.length,s,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,d=n.callback;if(E(e,t,!1,t.objectMode?1:c.length,c,l,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(n){t.pendingcb--,n&&w(e,n),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var n=B(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(6698)(S,o),I.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(I.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===S&&e&&e._writableState instanceof I}})):s=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new m)},S.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,a=!i.objectMode&&(r=e,u.isBuffer(r)||r instanceof c);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=v),i.ending?function(e,t){var n=new b;w(e,n),process.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new A:"string"==typeof n||t.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(w(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,s){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var o=t.objectMode?1:r.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,o,r,i,s);return c}(this,i,a,e,t,n)),s},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,n){n(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,N(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},2955:(e,t,n)=>{"use strict";var r;function i(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(6238),a=Symbol("lastResolve"),o=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[o]=null,t(h(n,!1)))}}function g(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[u]?n(e[u]):t(h(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[c]?n(h(void 0,!0)):t[d](n,r)}),r)}}(r,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[d])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,n=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[l]=null,n[a]=null,n[o]=null,e(h(r,!1))):(n[a]=e,n[o]=t)},writable:!0}),t));return n[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[o];return null!==t&&(n[l]=null,n[a]=null,n[o]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[o]=null,r(h(void 0,!0))),n[c]=!0})),e.on("readable",g.bind(null,n)),n}},2726:(e,t,n)=>{"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=n(8287).Buffer,c=n(5340).inspect,l=c&&c.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,n,r,i=u.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,r=a,u.prototype.copy.call(t,n,r),a+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?r+=i:r+=i.slice(0,e),0==(e-=s)){s===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896:e=>{"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var s=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(n,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):i?(process.nextTick(n,s),i(e)):process.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238:(e,t,n)=>{"use strict";var r=n(6048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,s){if("function"==typeof n)return e(t,null,n);n||(n={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(s||i);var a=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){o=!1,c=!0,a||s.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){a=!1,d=!0,o||s.call(t)},h=function(e){s.call(t,e)},p=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new r),s.call(t,e)):o&&!c?(t._writableState&&t._writableState.ended||(e=new r),s.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)):o&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",f),t.on("finish",l),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},5157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,t,n)=>{"use strict";var r,i=n(6048).F,s=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var f=t.map((function(e,i){var s=i<t.length-1;return function(e,t,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=n(6238)),r(e,{readable:t,writable:i},(function(e){if(e)return s(e);o=!0,s()}));var u=!1;return function(t){if(!o&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}(e,s,i>0,(function(e){l||(l=e),e&&f.forEach(u),s||(f.forEach(u),d(l))}))}));return t.reduce(c)}},5291:(e,t,n)=>{"use strict";var r=n(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var s=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},345:(e,t,n)=>{e.exports=n(7007).EventEmitter},8399:(e,t,n)=>{(t=e.exports=n(5412)).Stream=t,t.Readable=t,t.Writable=n(6708),t.Duplex=n(5382),t.Transform=n(4610),t.PassThrough=n(3600),t.finished=n(6238),t.pipeline=n(7758)},2861:(e,t,n)=>{var r=n(8287),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),s(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},3141:(e,t,n)=>{"use strict";var r=n(2861).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4643:(e,t,n)=>{function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},5340:()=>{},9838:()=>{},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,a=(o=Object.create(null),e=>{const t=i.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const u=e=>(e=e.toLowerCase(),t=>a(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,d=c("undefined"),f=u("ArrayBuffer"),h=c("string"),p=c("function"),g=c("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},A=u("Date"),b=u("File"),T=u("Blob"),w=u("FileList"),v=u("URLSearchParams"),[I,S,E,C]=["ReadableStream","Request","Response","Headers"].map(u);function _(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function B(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,N=e=>!d(e)&&e!==O,x=(P="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>P&&e instanceof P);var P;const D=u("HTMLFormElement"),k=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),R=u("RegExp"),L=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,((n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)})),Object.defineProperties(e,r)},F="abcdefghijklmnopqrstuvwxyz",U="0123456789",M={DIGIT:U,ALPHA:F,ALPHA_DIGIT:F+F.toUpperCase()+U},V=u("AsyncFunction"),G=(H="function"==typeof setImmediate,j=p(O.postMessage),H?setImmediate:j?(q=`axios@${Math.random()}`,Q=[],O.addEventListener("message",(({source:e,data:t})=>{e===O&&t===q&&Q.length&&Q.shift()()}),!1),e=>{Q.push(e),O.postMessage(q,"*")}):e=>setTimeout(e));var H,j,q,Q;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):"undefined"!=typeof process&&process.nextTick||G;var K={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=a(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isReadableStream:I,isRequest:S,isResponse:E,isHeaders:C,isUndefined:d,isDate:A,isFile:b,isBlob:T,isRegExp:R,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:v,isTypedArray:x,isFileList:w,forEach:_,merge:function e(){const{caseless:t}=N(this)&&this||{},n={},r=(r,i)=>{const s=t&&B(n,i)||i;y(n[s])&&y(r)?n[s]=e(n[s],r):y(r)?n[s]=e({},r):l(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(_(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||u[o]||(t[o]=e[o],u[o]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:D,hasOwnProperty:k,hasOwnProp:k,reduceDescriptors:L,freezeMethods:e=>{L(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:B,global:O,isContextDefined:N,ALPHABET:M,generateString:(e=16,t=M.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=l(e)?[]:{};return _(e,((e,t)=>{const s=n(e,r+1);!d(s)&&(i[t]=s)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:V,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch),setImmediate:G,asap:z};function W(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const $=W.prototype,Y={};function J(e){return K.isPlainObject(e)||K.isArray(e)}function X(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=X(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Y[e]={value:e}})),Object.defineProperties(W,Y),Object.defineProperty($,"isAxiosError",{value:!0}),W.from=(e,t,n,r,i,s)=>{const a=Object.create($);return K.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),W.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const ee=K.toFlatObject(K,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!K.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,s=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(!o&&K.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let o=e;if(e&&!i&&"object"==typeof e)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(K.isArray(e)&&function(e){return K.isArray(e)&&!e.some(J)}(e)||(K.isFileList(e)||K.endsWith(n,"[]"))&&(o=K.toArray(e)))return n=X(n),o.forEach((function(e,r){!K.isUndefined(e)&&null!==e&&t.append(!0===a?Z([n],r,s):null===a?n:n+"[]",u(e))})),!1;return!!J(e)||(t.append(Z(i,n,s),u(e)),!1)}const l=[],d=Object.assign(ee,{defaultVisitor:c,convertValue:u,isVisitable:J});if(!K.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!K.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),K.forEach(n,(function(n,s){!0===(!(K.isUndefined(n)||null===n)&&i.call(t,n,K.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const ie=re.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,n){if(!t)return e;const r=n&&n.encode||se,i=n&&n.serialize;let s;if(s=i?i(t,n):K.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ce={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,fe=le&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pe=le&&window.location.href||"http://localhost";var ge={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:he,hasStandardBrowserEnv:fe,navigator:de,origin:pe}),...ce};function me(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),o=i>=e.length;return s=!s&&K.isArray(r)?r.length:s,o?(K.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!a):(r[s]&&K.isObject(r[s])||(r[s]=[]),t(e,n,r[s],i)&&K.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!a)}if(K.isFormData(e)&&K.isFunction(e.entries)){const n={};return K.forEachEntry(e,((e,r)=>{t(function(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ye={transitional:ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=K.isObject(e);if(i&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return r?JSON.stringify(me(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ge.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=K.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(K.isString(e))try{return(0,JSON.parse)(e),K.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ye.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],(e=>{ye.headers[e]={}}));var Ae=ye;const be=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Te=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function ve(e){return!1===e||null==e?e:K.isArray(e)?e.map(ve):String(e)}function Ie(e,t,n,r,i){return K.isFunction(r)?r.call(this,t,n):(i&&(t=n),K.isString(t)?K.isString(r)?-1!==t.indexOf(r):K.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=we(t);if(!i)throw new Error("header name must be a non-empty string");const s=K.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ve(e))}const s=(e,t)=>K.forEach(e,((e,n)=>i(e,n,t)));if(K.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(K.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&be[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(K.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=we(e)){const n=K.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const n=K.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ie(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=we(e)){const i=K.findKey(n,e);!i||t&&!Ie(0,n[i],i,t)||(delete n[i],r=!0)}}return K.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Ie(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return K.forEach(this,((r,i)=>{const s=K.findKey(n,i);if(s)return t[s]=ve(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ve(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return K.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&K.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Te]=this[Te]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=we(e);t[r]||(function(e,t){const n=K.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return K.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(Se.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),K.freezeMethods(Se);var Ee=Se;function Ce(e,t){const n=this||Ae,r=t||n,i=Ee.from(r.headers);let s=r.data;return K.forEach(e,(function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)})),i.normalize(),s}function _e(e){return!(!e||!e.__CANCEL__)}function Be(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function Oe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}K.inherits(Be,W,{__CANCEL__:!0});const Ne=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,a=0;return t=void 0!==t?t:1e3,function(o){const u=Date.now(),c=r[a];i||(i=u),n[s]=o,r[s]=u;let l=a,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const a=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-i;o>=s?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),s-o)))},()=>n&&a(n)]}((n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,o=s-r,u=i(o);r=s,e({loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&s<=a?(a-s)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},xe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pe=e=>(...t)=>K.asap((()=>e(...t)));var De=ge.hasStandardBrowserEnv?function(){const e=ge.navigator&&/(msie|trident)/i.test(ge.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=K.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},ke=ge.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const a=[e+"="+encodeURIComponent(t)];K.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),K.isString(r)&&a.push("path="+r),K.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Re(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Le=e=>e instanceof Ee?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:n},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function i(e,t,n){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!K.isUndefined(t))return r(void 0,t)}function a(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>i(Le(e),Le(t),!0)};return K.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=u[r]||i,a=s(e[r],t[r],r);K.isUndefined(a)&&s!==o||(n[r]=a)})),n}var Ue=e=>{const t=Fe({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:u}=t;if(t.headers=o=Ee.from(o),t.url=ae(Re(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),K.isFormData(r))if(ge.hasStandardBrowserEnv||ge.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(n=o.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(ge.hasStandardBrowserEnv&&(i&&K.isFunction(i)&&(i=i(t)),i||!1!==i&&De(t.url))){const e=s&&a&&ke.read(a);e&&o.set(s,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ue(e);let i=r.data;const s=Ee.from(r.headers).normalize();let a,o,u,c,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Ee.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Oe((function(e){t(e),p()}),(function(e){n(e),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new W("Request aborted",W.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new W("Network Error",W.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||ue;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,i.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,g)),g=null},void 0===i&&s.setContentType(null),"setRequestHeader"in g&&K.forEach(s.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),K.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([u,l]=Ne(h,!0),g.addEventListener("progress",u)),f&&g.upload&&([o,c]=Ne(f),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Be(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ge.protocols.indexOf(y)?n(new W("Unsupported protocol "+y+":",W.ERR_BAD_REQUEST,e)):g.send(i||null)}))},Ve=(e,t)=>{let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new Be(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{i(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))}),t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",i)));const{signal:o}=r;return o.unsubscribe=a,[o,()=>{s&&clearTimeout(s),s=null}]};const Ge=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},He=(e,t,n,r,i)=>{const s=async function*(e,t,n){for await(const r of e)yield*Ge(ArrayBuffer.isView(r)?r:await n(String(r)),t)}(e,t,i);let a,o=0,u=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return u(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw u(e),e}},cancel:e=>(u(e),s.return())},{highWaterMark:2})},je="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,qe=je&&"function"==typeof ReadableStream,Qe=je&&("function"==typeof TextEncoder?(ze=new TextEncoder,e=>ze.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var ze;const Ke=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},We=qe&&Ke((()=>{let e=!1;const t=new Request(ge.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),$e=qe&&Ke((()=>K.isReadableStream(new Response("").body))),Ye={stream:$e&&(e=>e.body)};var Je;je&&(Je=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ye[e]&&(Ye[e]=K.isFunction(Je[e])?t=>t[e]():(t,n)=>{throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})})));const Xe={http:null,xhr:Me,fetch:je&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:u,responseType:c,headers:l,withCredentials:d="same-origin",fetchOptions:f}=Ue(e);c=c?(c+"").toLowerCase():"text";let h,p,[g,m]=i||s||a?Ve([i,s],a):[];const y=()=>{!h&&setTimeout((()=>{g&&g.unsubscribe()})),h=!0};let A;try{if(u&&We&&"get"!==n&&"head"!==n&&0!==(A=await(async(e,t)=>{const n=K.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:K.isBlob(e)?e.size:K.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e)?(await Qe(e)).byteLength:void 0))(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(K.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=xe(A,Ne(Pe(u)));r=He(n.body,65536,e,t,Qe)}}K.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;p=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(p);const a=$e&&("stream"===c||"response"===c);if($e&&(o||a)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=K.toFiniteNumber(s.headers.get("content-length")),[n,r]=o&&xe(t,Ne(Pe(o),!0))||[];s=new Response(He(s.body,65536,n,(()=>{r&&r(),a&&y()}),Qe),e)}c=c||"text";let h=await Ye[K.findKey(Ye,c)||"text"](s,e);return!a&&y(),m&&m(),await new Promise(((t,n)=>{Oe(t,n,{data:h,headers:Ee.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(t){if(y(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,p),{cause:t.cause||t});throw W.from(t,t&&t.code,e,p)}})};K.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>K.isFunction(e)||null===e||!1===e;var tt=e=>{e=K.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!et(n)&&(r=Xe[(t=String(n)).toLowerCase()],void 0===r))throw new W(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new W("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Be(null,e)}function rt(e){return nt(e),e.headers=Ee.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||Ae.adapter)(e).then((function(t){return nt(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=Ee.from(t.headers),t}),(function(t){return _e(t)||(nt(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=Ee.from(t.response.headers))),Promise.reject(t)}))}const it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.5] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new W(r(i," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!st[i]&&(st[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],a=t[s];if(a){const t=e[s],n=void 0===t||a(t,s,e);if(!0!==n)throw new W("option "+s+" must be "+n,W.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new W("Unknown option "+s,W.ERR_BAD_OPTION)}},validators:it};const ot=at.validators;class ut{constructor(e){this.defaults=e,this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),null!=r&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&K.merge(i.common,i[t.method]);i&&K.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Ee.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!o){const e=[rt.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(d=0;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=rt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return ae(Re((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),K.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Fe(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var ct=ut;class lt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Be(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new lt((function(t){e=t})),cancel:e}}}var dt=lt;const ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ft).forEach((([e,t])=>{ft[t]=e}));var ht=ft;const pt=function e(t){const n=new ct(t),i=r(ct.prototype.request,n);return K.extend(i,ct.prototype,n,{allOwnKeys:!0}),K.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Fe(t,n))},i}(Ae);pt.Axios=ct,pt.CanceledError=Be,pt.CancelToken=dt,pt.isCancel=_e,pt.VERSION="1.7.5",pt.toFormData=te,pt.AxiosError=W,pt.Cancel=pt.CanceledError,pt.all=function(e){return Promise.all(e)},pt.spread=function(e){return function(t){return e.apply(null,t)}},pt.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},pt.mergeConfig=Fe,pt.AxiosHeaders=Ee,pt.formToJSON=e=>me(K.isHTMLForm(e)?new FormData(e):e),pt.getAdapter=tt,pt.HttpStatusCode=ht,pt.default=pt,e.exports=pt}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,__webpack_require__.d(n,r),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AssetCategory:()=>H,AuctionType:()=>y,AuctionTypes:()=>G,Chain:()=>m,CollectionStatsOrderBy:()=>Q,CollectionStatsSelectFields:()=>q,CollectionsFieldsToSelect:()=>M,CollectionsOrderBy:()=>F,CollectionsSummaryFilter:()=>j,DropsOderBy:()=>R,EventUserRolePermission:()=>te,EventUserRoles:()=>ee,FieldsToSelect:()=>D,GlobalOfferFieldsToSelect:()=>V,GlobalOfferOrderBy:()=>U,IssuingType:()=>$,LaunchpadModule:()=>x,Marketplace:()=>P,NftActivityType:()=>z,OfferType:()=>X,OrderByTradingActivity:()=>K,PoolType:()=>Y,SCInteraction:()=>N,SearchOrderBy:()=>k,SelectFieldsTradingActivity:()=>W,StakingStatus:()=>J,SuggestOrderBy:()=>L,Type:()=>Z,XOXNOClient:()=>A,eventPermissions:()=>re,eventRoles:()=>ne});var e=__webpack_require__(4820),t=__webpack_require__(236),n=__webpack_require__(3979),r=__webpack_require__(5766),i=__webpack_require__(4473),s=__webpack_require__(7586),a=__webpack_require__(3145),o=__webpack_require__(5132),u=__webpack_require__(9712),c=__webpack_require__(3473),l=__webpack_require__(1594),d=__webpack_require__.n(l);const f="https://api.xoxno.com",h="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",p="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",g="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var m,y;!function(e){e.MAINNET="1",e.DEVNET="D"}(m||(m={}));class A{static instance;apiUrl;apiKey;chain;config;constructor(e=f,t="",n){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n==m.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:h,DR_SC:p,KG_SC:g,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:h,DR_SC:p,KG_SC:g,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:e=f,apiKey:t="",chain:n=m.MAINNET}={}){if(null==A.instance||null==A.instance){if(n==m.DEVNET)return A.instance=new A(e??"https://devnet-api.xoxno.com",t,n),A.instance;A.instance=new A(e,t,n)}return A.instance}static getInstance(){if(null==A.instance||null==A.instance)throw new Error("XOXNOClient is not initialized");return A.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const r={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,s=new AbortController;setTimeout((()=>s.abort()),n);const a=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:s.signal,...Object.keys(r).length?{headers:r}:{},method:t.method??"GET"});if(!a.ok)throw new Error((await a.json()).message.toString());return a.json()}}!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(y||(y={}));var b=__webpack_require__(2528),T=__webpack_require__(8403);class w{proxy;parser=new b.ResultsParser;constructor(){const e=A.getInstance().config.gatewayUrl;this.proxy=new T.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var v=__webpack_require__(4966);const I=JSON.parse('{"buildInfo":{"rustc":{"version":"1.80.0-nightly","commitHash":"8679004993f08807289911d9f400f4ac4391d2bc","commitDate":"2024-05-23","channel":"Nightly","short":"rustc 1.80.0-nightly (867900499 2024-05-23)"},"contractCrate":{"name":"xoxno-protocol","version":"1.0.0"},"framework":{"name":"multiversx-sc","version":"0.50.5"}},"name":"XOXNOProtocol","constructor":{"inputs":[{"name":"bid_cut_percentage","type":"u64"},{"name":"signer","type":"Address"},{"name":"wrapping_sc","type":"Address"},{"name":"wrapping_token","type":"TokenIdentifier"},{"name":"aggregator","type":"Address"}],"outputs":[]},"upgradeConstructor":{"inputs":[{"name":"sc_accumulator","type":"Address"},{"name":"aggregator","type":"Address"}],"outputs":[]},"endpoints":[{"name":"listing","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"listings","type":"variadic<BulkListing>","multi_arg":true}],"outputs":[]},{"name":"bid","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"}],"outputs":[]},{"name":"endAuction","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"buy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true}],"outputs":[]},{"name":"buySwap","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"steps","type":"List<AggregatorStep>"},{"name":"limits","type":"List<TokenAmount>"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"buyFor","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true},{"name":"buy_for","type":"optional<Address>","multi_arg":true},{"name":"message","type":"optional<bytes>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"bulkBuy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<EsdtTokenPayment>"}]},{"name":"withdraw","mutability":"mutable","inputs":[{"name":"signature","type":"bytes"},{"name":"withdraws","type":"variadic<u64>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"changeListing","mutability":"mutable","inputs":[{"name":"updates","type":"variadic<BulkUpdateListing>","multi_arg":true}],"outputs":[]},{"name":"getMarketplaceCutPercentage","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getOffersByWallet","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"checkOfferSent","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"nft","type":"TokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"getListingsByWallet","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getActiveListingsBids","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenItemsForSale","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenAuctionIds","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenOffersIds","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenItemsQuantityForSale","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"BigUint"}]},{"name":"getAcceptedTokens","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"blackListWallets","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"whitelistedContracts","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"getClaimableAmount","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"token_id","type":"EgldOrEsdtTokenIdentifier"},{"name":"token_nonce","type":"u64"}],"outputs":[{"type":"BigUint"}]},{"name":"getClaimableTokens","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"getClaimableTokenNonces","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionsListed","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<TokenIdentifier>","multi_result":true}]},{"name":"getAllListings","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getOffers","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getStatus","mutability":"readonly","inputs":[],"outputs":[{"type":"bool"}]},{"name":"getFullAuctionData","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"Auction"}]},{"name":"offerById","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"Offer"}]},{"name":"getRewardBalance","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getRewardTicker","mutability":"readonly","inputs":[],"outputs":[{"type":"EgldOrEsdtTokenIdentifier"}]},{"name":"specialRewardAmount","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"BigUint"}]},{"name":"defaultRewardAmount","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getGlobalOffers","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getGlobalOffer","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"GlobalOffer"}]},{"name":"getCollectionGlobalOffers","mutability":"readonly","inputs":[{"name":"collection","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"userGlobalOffers","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"userCollectionGlobalOffers","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"collection","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionConfig","mutability":"readonly","inputs":[{"name":"ticker","type":"TokenIdentifier"}],"outputs":[{"type":"CollectionFeeConfig"}]},{"name":"freezedAuctions","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getAccumulator","mutability":"readonly","inputs":[],"outputs":[{"type":"Address"}]},{"name":"getListingsCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getGlobalOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getListings","mutability":"readonly","inputs":[{"name":"from","type":"u32"},{"name":"to","type":"u32"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionsCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"isCollectionListed","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"expiredOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"List<u64>"}]},{"name":"getAcceptedTokensCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getTokenItemsForSaleCount","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"u32"}]},{"name":"getOnSaleTokensForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<TokensOnSale>"}]},{"name":"getAuctionsForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"List<u64>"}]},{"name":"getFullAuctionsForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"List<Auction>"}]},{"name":"getTokenOffers","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<BulkOffers>"}]},{"name":"getBulkOffers","mutability":"readonly","inputs":[{"name":"offers","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<BulkOffers>"}]},{"name":"getBulkGlobalOffers","mutability":"readonly","inputs":[{"name":"offers","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<GlobalOffer>"}]},{"name":"getBulkGlobalOffersByCollection","mutability":"readonly","inputs":[{"name":"ticker","type":"TokenIdentifier"}],"outputs":[{"type":"List<GlobalOffer>"}]},{"name":"getBulkListings","mutability":"readonly","inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<TokensOnSale>"}]},{"name":"doesAuctionExist","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"doesGlobalOfferExist","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"doesOfferExist","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"isSCWl","mutability":"readonly","inputs":[{"name":"sc","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"acceptOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id","type":"optional<u64>","multi_arg":true}],"outputs":[]},{"name":"declineOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id","type":"optional<u64>","multi_arg":true}],"outputs":[]},{"name":"withdrawOffer","mutability":"mutable","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[]},{"name":"sendOffer","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"payment_amount","type":"BigUint"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"nft_amount","type":"BigUint"},{"name":"deadline","type":"u64"}],"outputs":[{"type":"u64"}]},{"name":"sendGlobalOffer","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"collection","type":"TokenIdentifier"},{"name":"quantity","type":"BigUint"},{"name":"attributes","type":"optional<bytes>","multi_arg":true}],"outputs":[{"type":"u64"}]},{"name":"withdrawGlobalOffer","mutability":"mutable","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[]},{"name":"acceptGlobalOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id_opt","type":"optional<List<u64>>","multi_arg":true},{"name":"signature","type":"optional<bytes>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"returnListing","mutability":"mutable","inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"withdrawGlobalOffers","mutability":"mutable","inputs":[{"name":"offer_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"deleteOffersByWallet","mutability":"mutable","inputs":[{"name":"user","type":"Address"}],"outputs":[]},{"name":"cleanExpiredOffers","mutability":"mutable","inputs":[{"name":"offer_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"addRewardBalance","onlyOwner":true,"mutability":"mutable","payableInTokens":["*"],"inputs":[],"outputs":[]},{"name":"setRewardTicker","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[]},{"name":"setSpecialRewardAmount","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"setDefaultRewardAmount","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"setAcceptedTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[]},{"name":"removeAcceptedTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"addWhitelist","mutability":"mutable","inputs":[{"name":"sc","type":"Address"}],"outputs":[]},{"name":"removeWhitelist","mutability":"mutable","inputs":[{"name":"sc","type":"Address"}],"outputs":[]},{"name":"setStatus","mutability":"mutable","inputs":[{"name":"status","type":"bool"}],"outputs":[]},{"name":"setCutPercentage","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"new_cut_percentage","type":"u64"}],"outputs":[]},{"name":"unFreezeAuctionId","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"unFreezeAllAuctionIds","mutability":"mutable","inputs":[],"outputs":[]},{"name":"freezeAuctionId","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"claimLeftOverDust","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"claimSavedFundsForUser","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[]},{"name":"addBlackListWallet","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"removeBlackListWallet","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"setCutFeesReverted","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"value","type":"bool"}],"outputs":[]},{"name":"setRoyaltiesReverted","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"value","type":"bool"}],"outputs":[]},{"name":"setExtraFees","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"},{"name":"address","type":"Address"}],"outputs":[]},{"name":"setCustomRoyalties","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"min","type":"BigUint"},{"name":"max","type":"BigUint"},{"name":"enabled","type":"bool"}],"outputs":[]},{"name":"setConfigAdmin","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"admin","type":"Address"}],"outputs":[]},{"name":"deposit","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[],"outputs":[]},{"name":"withdrawDeposit","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"userDeposit","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"EgldOrEsdtTokenPayment"}]}],"promisesCallbackNames":["callback_ash"],"events":[{"identifier":"auction_token_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"auctioned_token_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"min_bid","type":"BigUint","indexed":true},{"name":"max_bid","type":"BigUint","indexed":true},{"name":"start_time","type":"u64","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"accepted_payment_token_nonce","type":"u64","indexed":true},{"name":"auction_type","type":"AuctionType","indexed":true},{"name":"creator_royalties_percentage","type":"BigUint","indexed":true}]},{"identifier":"send_global_offer","inputs":[{"name":"offer","type":"GlobalOffer","indexed":true}]},{"identifier":"remove_global_offer","inputs":[{"name":"offer_id","type":"u64","indexed":true},{"name":"collection","type":"TokenIdentifier","indexed":true}]},{"identifier":"accept_global_offer","inputs":[{"name":"offer","type":"GlobalOffer","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"nonces","type":"List<EsdtTokenPayment>","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"auction_ids","type":"List<u64>","indexed":true}]},{"identifier":"offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true}]},{"identifier":"withdraw_offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true}]},{"identifier":"accept_offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"auction_removed","type":"u64","indexed":true}]},{"identifier":"bid_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"bidder","type":"Address","indexed":true},{"name":"bid_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"token_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"token_payment_nonce","type":"u64","indexed":true}]},{"identifier":"end_auction_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"auction_winner","type":"Address","indexed":true},{"name":"winning_bid_amount","type":"BigUint","indexed":true},{"name":"auction_seller","type":"Address","indexed":true},{"name":"token_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"token_payment_nonce","type":"u64","indexed":true}]},{"identifier":"change_listing_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"owner","type":"Address","indexed":true},{"name":"old_price","type":"BigUint","indexed":true},{"name":"new_price","type":"BigUint","indexed":true},{"name":"payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_nonce","type":"u64","indexed":true},{"name":"deadline","type":"u64","indexed":true}]},{"identifier":"out_bid_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"old_bidder","type":"Address","indexed":true},{"name":"new_bidder","type":"Address","indexed":true},{"name":"refund_amount","type":"BigUint","indexed":true},{"name":"new_amount","type":"BigUint","indexed":true},{"name":"refund_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"refund_payment_nonce","type":"u64","indexed":true}]},{"identifier":"buy_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_bought_tokens","type":"BigUint","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"bid_sft_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"accepted_payment_token_nonce","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"message","type":"bytes","indexed":true},{"name":"buy_by","type":"Address","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"original_payment","type":"EgldOrEsdtTokenPayment","indexed":true}]},{"identifier":"withdraw_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true}]},{"identifier":"user_deposit","inputs":[{"name":"owner","type":"Address","indexed":true},{"name":"payment","type":"EgldOrEsdtTokenPayment","indexed":true}]},{"identifier":"collection_config_event","inputs":[{"name":"collection","type":"TokenIdentifier","indexed":true},{"name":"config","type":"CollectionFeeConfig","indexed":true}]}],"esdtAttributes":[],"hasCallback":false,"types":{"AggregatorStep":{"type":"struct","fields":[{"name":"token_in","type":"TokenIdentifier"},{"name":"token_out","type":"TokenIdentifier"},{"name":"amount_in","type":"BigUint"},{"name":"pool_address","type":"Address"},{"name":"function_name","type":"bytes"},{"name":"arguments","type":"List<bytes>"}]},"Auction":{"type":"struct","fields":[{"name":"auctioned_token_type","type":"TokenIdentifier"},{"name":"auctioned_token_nonce","type":"u64"},{"name":"nr_auctioned_tokens","type":"BigUint"},{"name":"auction_type","type":"AuctionType"},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"min_bid","type":"BigUint"},{"name":"max_bid","type":"Option<BigUint>"},{"name":"start_time","type":"u64"},{"name":"deadline","type":"u64"},{"name":"original_owner","type":"Address"},{"name":"current_bid","type":"BigUint"},{"name":"current_winner","type":"Address"},{"name":"marketplace_cut_percentage","type":"BigUint"},{"name":"creator_royalties_percentage","type":"BigUint"}]},"AuctionType":{"type":"enum","variants":[{"name":"None","discriminant":0},{"name":"NftBid","discriminant":1},{"name":"Nft","discriminant":2},{"name":"SftAll","discriminant":3},{"name":"SftOnePerPayment","discriminant":4}]},"BulkListing":{"type":"struct","fields":[{"name":"min_bid","type":"BigUint"},{"name":"max_bid","type":"BigUint"},{"name":"deadline","type":"u64"},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"bid","type":"bool"},{"name":"opt_sft_max_one_per_payment","type":"bool"},{"name":"opt_start_time","type":"u64"},{"name":"collection","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"nft_amount","type":"BigUint"},{"name":"royalties","type":"BigUint"}]},"BulkOffers":{"type":"struct","fields":[{"name":"offer_id","type":"u64"},{"name":"nonce","type":"u64"},{"name":"offer","type":"Offer"}]},"BulkUpdateListing":{"type":"struct","fields":[{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"new_price","type":"BigUint"},{"name":"auction_id","type":"u64"},{"name":"deadline","type":"u64"}]},"CollectionExtraFeesConfig":{"type":"struct","fields":[{"name":"amount","type":"BigUint"},{"name":"address","type":"Address"}]},"CollectionFeeConfig":{"type":"struct","fields":[{"name":"reverse_cut_fees","type":"bool"},{"name":"reverse_royalties","type":"bool"},{"name":"custom_royalties","type":"bool"},{"name":"min_royalties","type":"BigUint"},{"name":"max_royalties","type":"BigUint"},{"name":"extra_fees","type":"CollectionExtraFeesConfig"},{"name":"admin","type":"Address"}]},"EgldOrEsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"EgldOrEsdtTokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"EsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"GlobalOffer":{"type":"struct","fields":[{"name":"offer_id","type":"u64"},{"name":"collection","type":"TokenIdentifier"},{"name":"quantity","type":"BigUint"},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"timestamp","type":"u64"},{"name":"owner","type":"Address"},{"name":"attributes","type":"Option<bytes>"},{"name":"new_version","type":"bool"}]},"Offer":{"type":"struct","fields":[{"name":"token_type","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"quantity","type":"BigUint"},{"name":"status","type":"OfferStatus"},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"deadline","type":"u64"},{"name":"timestamp","type":"u64"},{"name":"offer_owner","type":"Address"},{"name":"marketplace_cut_percentage","type":"BigUint"},{"name":"new_version","type":"bool"}]},"OfferStatus":{"type":"enum","variants":[{"name":"Pending","discriminant":0},{"name":"Accepted","discriminant":1},{"name":"Declined","discriminant":2},{"name":"Withdraw","discriminant":3}]},"TokenAmount":{"type":"struct","fields":[{"name":"token","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"}]},"TokensOnSale":{"type":"struct","fields":[{"name":"auction_id","type":"u64"},{"name":"token_type","type":"u8"},{"name":"auction","type":"Auction"}]}}}');var S=__webpack_require__.t(I,2);const E=JSON.parse('{"buildInfo":{"rustc":{"version":"1.69.0-nightly","commitHash":"c8e6a9e8b6251bbc8276cb78cabe1998deecbed7","commitDate":"2023-01-23","channel":"Nightly","short":"rustc 1.69.0-nightly (c8e6a9e8b 2023-01-23)"},"contractCrate":{"name":"minter","version":"0.0.0"},"framework":{"name":"multiversx-sc","version":"0.39.6"}},"name":"Minter","constructor":{"inputs":[{"name":"local_owner","type":"Address"},{"name":"cut_percentage","type":"BigUint"},{"name":"signer_wallet","type":"Address"}],"outputs":[]},"endpoints":[{"name":"buy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"quantity","type":"u32"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"buyFor","onlyOwner":true,"mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"quantity","type":"u32"},{"name":"user","type":"Address"},{"name":"twispay","type":"bytes"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"giveaway","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"to","type":"Address"},{"name":"quantity","type":"u32"}],"outputs":[]},{"name":"giveawayAdmin","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"to","type":"Address"},{"name":"quantity","type":"u32"},{"name":"twispay","type":"bytes"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"reveal","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"changeLocalOwner","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"owner","type":"Address"}],"outputs":[]},{"name":"tradingControl","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"burn","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"}],"outputs":[]},{"name":"transferOwner","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"}],"outputs":[]},{"name":"claim_royalties","mutability":"mutable","inputs":[],"outputs":[]},{"name":"claimESDT","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"setCutPercentage","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"new_cut_percentage","type":"BigUint"}],"outputs":[]},{"name":"claimTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u32"}],"outputs":[]},{"name":"addRewards","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"},{"name":"reward","type":"BigUint"}],"outputs":[]},{"name":"removeRewards","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"stopMintShareholder","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"stopRoyaltiesShareholder","mutability":"mutable","inputs":[],"outputs":[]},{"name":"addMintShareholder","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"shareholders","type":"variadic<multi<Address,BigUint>>","multi_arg":true}],"outputs":[]},{"name":"addRoyaltiesShareholder","mutability":"mutable","inputs":[{"name":"shareholders","type":"variadic<multi<Address,BigUint>>","multi_arg":true}],"outputs":[]},{"name":"getMintShareholders","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<ShareHolders>","multi_result":true}]},{"name":"getRoyaltiesShareholders","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<ShareHolders>","multi_result":true}]},{"name":"isMintEditBlocked","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"bool"}]},{"name":"rewardPerCollection","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"RewardStruct"}]},{"name":"isRoyaltiesEditBlocked","mutability":"readonly","inputs":[],"outputs":[{"type":"bool"}]},{"name":"cutPercentage","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"localOwner","mutability":"readonly","inputs":[],"outputs":[{"type":"Address"}]},{"name":"buysPerWallet","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"buysStagePerWallet","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"getNFTsIDs","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<bytes>","multi_result":true}]},{"name":"nextNftNonce","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"getAcceptedTokens","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"lastNFTIdAdded","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"listingByTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"Listing"}]},{"name":"maxBuysPerTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"tokenByTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"TokenIdentifier"}]},{"name":"isActive","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"bool"}]},{"name":"getPaymentTokenPrice","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"BigUint"}]},{"name":"revealID","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"bytes"}]},{"name":"collections","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<bytes>","multi_result":true}]},{"name":"signer","mutability":"readonly","inputs":[],"outputs":[{"type":"bytes"}]},{"name":"listingByTagV2","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"NewListing"}]},{"name":"mintStage","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<multi<bytes,Stage>>","multi_result":true}]},{"name":"getWhitelistedWallets","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"isWhitelisted","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"address","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"getListings","mutability":"readonly","inputs":[],"outputs":[{"type":"List<NewListing>"}]},{"name":"getListing","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"NewListing"}]},{"name":"getStages","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"List<Stage>"}]},{"name":"getStage","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"Stage"}]},{"name":"whitelistSize","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"listing","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"royalties","type":"BigUint"},{"name":"token_name","type":"bytes"},{"name":"token_ticker","type":"bytes"},{"name":"collection_size","type":"u32"},{"name":"global_max_per_wallet","type":"u32"},{"name":"collectiontag","type":"bytes"},{"name":"nft_ending","type":"bytes"},{"name":"name_shuffle","type":"bool"},{"name":"has_attributes","type":"bool"},{"name":"has_kyc","type":"bool"},{"name":"refund_policy","type":"bool"},{"name":"public_burn","type":"bool"},{"name":"bot_protection","type":"bool"},{"name":"has_reveal","type":"bool"}],"outputs":[]},{"name":"createStage","mutability":"mutable","inputs":[{"name":"args","type":"StageArgs"}],"outputs":[]},{"name":"removeStage","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[]},{"name":"changeTime","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"start_date","type":"u64"},{"name":"end_time","type":"u64"}],"outputs":[]},{"name":"removePaymentToken","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"token","type":"TokenIdentifier"}],"outputs":[]},{"name":"addPaymentToken","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"price","type":"BigUint"}],"outputs":[]},{"name":"addWhitelists","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"wallets","type":"variadic<Address>","multi_arg":true}],"outputs":[]},{"name":"removeWhitelists","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"wallets","type":"variadic<Address>","multi_arg":true}],"outputs":[]},{"name":"clearWhitelist","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[]},{"name":"maxBuysPerWallet","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"max","type":"u32"}],"outputs":[]},{"name":"maxStageBuysPerWallet","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"max","type":"u32"}],"outputs":[]},{"name":"changeStageMintLimit","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"mint_limit","type":"u32"}],"outputs":[]},{"name":"changeWLStatus","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"botProtection","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"enableReveal","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"cid","type":"bytes"}],"outputs":[]},{"name":"publicBurn","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"setActive","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"is_active","type":"bool"}],"outputs":[]}],"events":[{"identifier":"emit_minting_stage_status","inputs":[{"name":"stage","type":"Stage","indexed":true}]},{"identifier":"emit_minting_status","inputs":[{"name":"contract_info","type":"NewListing","indexed":true}]},{"identifier":"emit_listing_event","inputs":[{"name":"listing","type":"NewListing","indexed":true}]},{"identifier":"emit_stage_event","inputs":[{"name":"stage","type":"Stage","indexed":true}]},{"identifier":"emit_stage_mint_event","inputs":[{"name":"stage","type":"Stage","indexed":true},{"name":"total_mint","type":"u32","indexed":true}]},{"identifier":"emit_buy_event","inputs":[{"name":"payments","type":"List<EsdtTokenPayment>","indexed":true},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"token_identifier","type":"TokenIdentifier","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"epoch","type":"u64","indexed":true}]},{"identifier":"emit_buy_fiat_event","inputs":[{"name":"payments","type":"List<EsdtTokenPayment>","indexed":true},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"token_identifier","type":"TokenIdentifier","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"epoch","type":"u64","indexed":true},{"name":"twispay","type":"bytes","indexed":true}]}],"hasCallback":true,"types":{"EsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"Listing":{"type":"struct","fields":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"collectiontag","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"nft_ending","type":"bytes"},{"name":"royalties","type":"BigUint"},{"name":"mint_price","type":"BigUint"},{"name":"collection_size","type":"u32"},{"name":"start_date","type":"u64"},{"name":"mint_roles","type":"bool"},{"name":"owner_transfered","type":"bool"}]},"NewListing":{"type":"struct","fields":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"collection_tag","type":"bytes"},{"name":"media_type","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"has_attributes","type":"bool"},{"name":"owner_transfered","type":"bool"},{"name":"collection_size","type":"u32"},{"name":"nft_minted","type":"u32"},{"name":"global_max_per_wallet","type":"u32"},{"name":"royalties","type":"BigUint"},{"name":"token","type":"TokenIdentifier"},{"name":"old_version","type":"bool"},{"name":"name_shuffle","type":"bool"},{"name":"transfer_role","type":"bool"},{"name":"public_burn","type":"bool"},{"name":"has_kyc","type":"bool"},{"name":"refund_policy","type":"bool"},{"name":"bot_protection","type":"bool"},{"name":"has_reveal","type":"bool"}]},"RewardStruct":{"type":"struct","fields":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"amount","type":"BigUint"},{"name":"reward","type":"BigUint"}]},"ShareHolders":{"type":"struct","fields":[{"name":"address","type":"Address"},{"name":"share","type":"BigUint"}]},"Stage":{"type":"struct","fields":[{"name":"name","type":"bytes"},{"name":"tag","type":"bytes"},{"name":"status","type":"bool"},{"name":"is_whitelist","type":"bool"},{"name":"start_time","type":"u64"},{"name":"end_time","type":"u64"},{"name":"mint_limit","type":"u32"},{"name":"mint_count","type":"u32"},{"name":"prices","type":"List<EsdtTokenPayment>"},{"name":"max_per_wallet","type":"u32"}]},"StageArgs":{"type":"struct","fields":[{"name":"name","type":"bytes"},{"name":"tag","type":"bytes"},{"name":"is_whitelist","type":"bool"},{"name":"start_time","type":"u64"},{"name":"end_time","type":"u64"},{"name":"mint_limit","type":"u32"},{"name":"prices","type":"List<EsdtTokenPayment>"},{"name":"max_per_wallet","type":"u32"}]}}}');var C=__webpack_require__.t(E,2);class _{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!_.market){const e=v.AbiRegistry.create(S);_.market=e}return _.market}static async getManager(){if(!_.manager){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/manage.json`,{next:{tags:["getManager"]}}),t=v.AbiRegistry.create(e);_.manager=t}return _.manager}static async getMinter(){if(!_.minter){const e=v.AbiRegistry.create(C);_.minter=e}return _.minter}static async getStaking(){if(!_.staking){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/staking-nfts.abi.json`,{next:{tags:["getStaking"]}}),t=v.AbiRegistry.create(e);_.staking=t}return _.staking}static async getExchange(){if(!_.exchange){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/rs-exchange.abi.json`,{next:{tags:["getExchange"]}}),t=v.AbiRegistry.create(e);_.exchange=t}return _.exchange}static async getP2P(){if(!_.p2p){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/p2p.abi.json`,{next:{tags:["getP2P"]}}),t=v.AbiRegistry.create(e);_.p2p=t}return _.p2p}}var B=__webpack_require__(1998);const O=(e,n)=>new B.SmartContract({address:new t.Address(n),abi:e});class N{xo;call;api;config;factory;constructor(e){this.config=A.getInstance().config;const t=O(e,this.config.XO_SC);this.xo=t,this.call=new w,this.api=A.getInstance();const n=new c.TransactionsFactoryConfig({chainID:this.api.chain.valueOf()});this.factory=new u.SmartContractTransactionsFactory({config:n,abi:e})}static async init(){const e=await _.getMarket();return new N(e)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const r=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return r?.firstValue?new i.BigUIntValue(r.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),r=n.firstValue?.valueOf();return r.offer_id=parseInt(r.offer_id.valueOf()),r.marketplace="xoxno",r.short_price=parseFloat(new i.BigUIntValue(r.price).valueOf().shiftedBy(-18).toString()),r.new_version=Boolean(r.new_version),r.new_version?r.isActive=!0:r.isActive=this.isOfferActive(r.short_price,await this.getUserPoolBalance(r.owner,r.payment_token,r.payment_nonce)),r.quantity=parseInt(r.quantity.valueOf()),r.payment_nonce=parseInt(r.payment_nonce.valueOf()),r.price=r.price.valueOf(),r.timestamp=parseInt(r.timestamp.valueOf()),r.owner=r.owner.valueOf().toString(),r.attributes&&(r.attributes=JSON.parse(Buffer.from(r.attributes.valueOf().toString(),"base64").toString("ascii"))),r};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),r=n.firstValue?.valueOf();return r?(r.auctioned_token_nonce=parseInt(r.auctioned_token_nonce.valueOf()),r.nr_auctioned_tokens=parseInt(r.nr_auctioned_tokens.valueOf()),r.auction_type=r.auction_type.name,r.payment_token_nonce=parseInt(r.payment_token_nonce.valueOf()),r.min_bid=r.min_bid.valueOf(),r.max_bid=r.max_bid.valueOf(),r.start_time=parseInt(r.start_time.valueOf()),r.deadline=parseInt(r.deadline.valueOf()),r.original_owner=r.original_owner.valueOf().toString(),r.current_winner=r.current_winner.valueOf().toString(),r.current_bid=r.current_bid.valueOf().toString(),r.marketplace_cut_percentage=r.marketplace_cut_percentage.valueOf(),r.creator_royalties_percentage=r.creator_royalties_percentage.valueOf(),r):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions({auctionIDs:n,sender:r,market:s="xoxno",signature:a}){if("xoxno"===s){const s=this.xo.methodsExplicit.withdraw([e.BytesValue.fromHex(a),...n.map((e=>new i.U64Value(e)))]);return r.nonce&&s.withNonce(r.nonce),[s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6+8e6*n.length)).buildTransaction().toPlainObject()]}if("frameit"==s)return n.map(((e,n)=>{const s=this.xo.methodsExplicit.withdraw([new i.U64Value(e)]);return r.nonce&&s.withNonce(r.nonce+n),s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6)).withExplicitReceiver(new t.Address(this.config.FM_SC)).buildTransaction().toPlainObject()}));if("deadrare"==s)return n.map(((e,n)=>{const s=this.xo.methodsExplicit.withdraw([new i.U64Value(e)]);return r.nonce&&s.withNonce(r.nonce+n),s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6)).withExplicitReceiver(new t.Address(this.config.DR_SC)).buildTransaction().toPlainObject()}));throw new Error("Market not supported")}withdrawGlobalOffer(e,n="xoxno",r){if("xoxno"!=n)throw Error("Marketplace not supported");const i=this.xo.methods.withdrawGlobalOffer([e]);return r.nonce&&i.withNonce(r.nonce),i.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(2e7).buildTransaction().toPlainObject()}acceptGlobalOffer({signature:e,offer_id:n,auction_ids_opt:r,market:i,nfts:s,address:a,nonce:u}){if("xoxno"!=i)throw Error("Marketplace not supported");const c=e?this.xo.methods.acceptGlobalOffer([n,r??[],e]):this.xo.methods.acceptGlobalOffer([n,r]);return c.withSender(new t.Address(a)),s.length>0&&c.withMultiESDTNFTTransfer(s.map((e=>o.TokenTransfer.semiFungible(e.collection,e.nonce,e.amount??1)))),u&&c.withNonce(u),c.withChainID(this.api.chain).withGasLimit(Math.min(35e6+7e6*(s.length+r.length)+(null==e?15e6:0),6e8)).buildTransaction().toPlainObject()}sendGlobalOffer({payment_token:e,payment_nonce:n,price:r,collection:i,quantity:s,attributes:a,depositAmount:u,address:c,nonce:l}){const d=this.xo.methods.sendGlobalOffer([e,n,o.TokenTransfer.egldFromAmount(r).toString(),i,s,...a?[a]:[]]);return l&&d.withNonce(l),d.withSender(new t.Address(c)),u&&d.withValue(u),d.withChainID(this.api.chain).withGasLimit(25e6+(a?1500*a?.length:0)).buildTransaction().toPlainObject()}sendCustomOffer({payment_token:e,payment_nonce:n,price:r,deadline:i,nft:s,depositAmount:a,address:u,nonce:c}){const l=this.xo.methods.sendOffer([e,n,o.TokenTransfer.egldFromAmount(r).toString(),s.collection,s.nonce,s.amount??1,i]);return c&&l.withNonce(c),l.withSender(new t.Address(u)),a&&l.withValue(a),l.withChainID(this.api.chain).withGasLimit(3e7).buildTransaction().toPlainObject()}withdrawCustomOffer(e,n,r){if("xoxno"===r){const r=this.xo.methods.withdrawOffer([e]);return n.nonce&&r.withNonce(n.nonce),r.withSender(new t.Address(n.address)),r.withChainID(this.api.chain).withGasLimit(15e6).buildTransaction().toPlainObject()}throw Error("Market not supported")}declineCustomOffer(e,n,r,i){if("xoxno"==i){const i=r.onSale?this.xo.methods.declineOffer([e,r.saleInfo?.auctionId]):this.xo.methods.declineOffer([e]);return n.nonce&&i.withNonce(n.nonce),i.withSender(new t.Address(n.address)),r.onSale||i.withSingleESDTNFTTransfer(o.TokenTransfer.semiFungible(r.collection,r.nonce,1)),i.withChainID(this.api.chain).withGasLimit(2e7).buildTransaction().toPlainObject()}throw Error("Market not supported")}acceptCustomOffer(e,n,r,i){if("xoxno"==i){const i=r.onSale?this.xo.methods.acceptOffer([e,r.saleInfo?.auctionId]):this.xo.methods.acceptOffer([e]);return n.nonce&&i.withNonce(n.nonce),i.withSender(new t.Address(n.address)),r.onSale||i.withSingleESDTNFTTransfer(o.TokenTransfer.semiFungible(r.collection,r.nonce,1)),i.withChainID(this.api.chain).withGasLimit(45e6).buildTransaction().toPlainObject()}throw Error("Market not supported")}endAuction(e,n,r="xoxno"){if("xoxno"==r){const r=this.xo.methods.endAuction([e]);return n.nonce&&r.withNonce(n.nonce),r.withSender(new t.Address(n.address)),r.withChainID(this.api.chain).withGasLimit(25e6).buildTransaction().toPlainObject()}throw new Error("Market not supported")}bidOnAuctionId(e,n,r,i,s){if(!i.amount)throw new Error("Payment amount is required");const a="EGLD"==i.collection,u=this.factory.createTransactionForExecute({sender:new t.Address(s.address),contract:new t.Address(this.config.XO_SC),function:"bid",gasLimit:25000000n,arguments:[e,n,r],nativeTransferAmount:a?BigInt(i.amount):void 0,tokenTransfers:a?void 0:[new o.TokenTransfer({token:new o.Token({identifier:i.collection,nonce:BigInt(i.nonce??0)}),amount:BigInt(i.amount)})]});return s.nonce&&(u.nonce=BigInt(s.nonce)),u.toPlainObject()}bulkBuy(e,n,r){const i=this.xo.methods.bulkBuy(e);if(r.nonce&&i.withNonce(r.nonce),i.withSender(new t.Address(r.address)),!n.amount)throw new Error("Payment amount is required");return"EGLD"==n.collection&&n.amount?i.withValue(o.TokenTransfer.egldFromAmount(n.amount)):i.withSingleESDTTransfer(o.TokenTransfer.fungibleFromAmount(n.collection,n.amount,n.decimals??18)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+2e7*e.length)).buildTransaction().toPlainObject()}async buyAuctionById({auctionID:e,collection:n,nonce:r,paymentAmount:i,quantity:s=1,token:a="EGLD",withCheck:u=!0,isBigUintPayment:c=!1,isBid:l=!1,decimals:f=18,market:h="xoxno",sender:p}){if("xoxno"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!i||!a||!n||!r||u){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===y.Nft||g.auction_type===y.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const m=g?.payment_token_type??a,A=!!g||c;let b=l?g?.max_bid??i:g?.min_bid??i;if(!b)throw new Error("Payment amount not provided");const T=this.xo.methods.buy([e,g?.auctioned_token_type??n,g?.auctioned_token_nonce??r,s??1]);if(p.nonce&&T.withNonce(p.nonce),T.withSender(new t.Address(p.address)),"EGLD"===a)T.withValue(A?o.TokenTransfer.egldFromBigInteger(new(d())(b).multipliedBy(s)):o.TokenTransfer.egldFromAmount(new(d())(b).multipliedBy(s)));else{if(!A){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");b=l?g.max_bid:g.min_bid}T.withSingleESDTTransfer(o.TokenTransfer.fungibleFromBigInteger(m,b,f))}return T.withChainID(this.api.chain).withGasLimit(45e6).buildTransaction().toPlainObject()}async changeListing(n,o,u){if(!u)throw Error("Market is required");const c=new s.StructType("BulkUpdateListing",[new r.FieldDefinition("payment_token_type","",new a.TokenIdentifierType),new r.FieldDefinition("new_price","",new i.BigUIntType),new r.FieldDefinition("auction_id","",new i.U64Type),new r.FieldDefinition("deadline","",new i.U64Type)]),l=[];n.forEach((({paymentToken:e,price:t,auctionID:n,deadline:o})=>{l.push(new s.Struct(c,[new r.Field(new a.TokenIdentifierValue(e),"payment_token_type"),new r.Field(new i.BigUIntValue(t),"new_price"),new r.Field(new i.U64Value(n),"auction_id"),new r.Field(new i.U64Value(o),"deadline")]))}));const d=this.xo.methods.changeListing([e.VariadicValue.fromItems(...l)]);return o.nonce&&d.withNonce(o.nonce),d.withSender(new t.Address(o.address)),d.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+5e6*n.length)).buildTransaction().toPlainObject()}async listNFTs(e,u){const c=new s.StructType("BulkListing",[new r.FieldDefinition("min_bid","",new i.BigUIntType),new r.FieldDefinition("max_bid","",new i.BigUIntType),new r.FieldDefinition("deadline","",new i.U64Type),new r.FieldDefinition("accepted_payment_token","",new a.TokenIdentifierType),new r.FieldDefinition("bid","",new n.BooleanType),new r.FieldDefinition("opt_sft_max_one_per_payment","",new n.BooleanType),new r.FieldDefinition("opt_start_time","",new i.U64Type),new r.FieldDefinition("collection","",new a.TokenIdentifierType),new r.FieldDefinition("nonce","",new i.U64Type),new r.FieldDefinition("nft_amount","",new i.BigUIntType)]),l=[],f=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,u=new(d())(e.min_bid).shiftedBy(t),h=new(d())(e.max_bid??0).shiftedBy(t);f.push(o.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),l.push(new s.Struct(c,[new r.Field(new i.BigUIntValue(u),"min_bid"),new r.Field(new i.BigUIntValue(h),"max_bid"),new r.Field(new i.U64Value(new(d())(e.deadline??0)),"deadline"),new r.Field(new a.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new r.Field(new n.BooleanValue(e.bid??!1),"bid"),new r.Field(new n.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new r.Field(new i.U64Value(new(d())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new r.Field(new a.TokenIdentifierValue(e.collection),"collection"),new r.Field(new i.U64Value(e.nonce),"nonce"),new r.Field(new i.BigUIntValue(new(d())(e.nft_amount)),"nft_amount")]))}));const h=this.xo.methods.listings(l);return u.nonce&&h.withNonce(u.nonce),h.withSender(new t.Address(u.address)),h.withMultiESDTNFTTransfer(f),h.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+45e5*e.length)).buildTransaction().toPlainObject()}}class x{minter;call;constructor(e){this.minter=e,this.call=new w}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await _.getMinter(),n=O(t,e);return new x(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),r=await this.getResult(n);return r.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const r=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(r);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),r=await this.getResult(n);return r.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}var P,D,k,R,L,F,U,M,V,G,H,j,q,Q,z,K,W,$,Y,J,X,Z,ee,te;!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(P||(P={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(D||(D={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(k||(k={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(R||(R={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(L||(L={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(F||(F={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(U||(U={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(M||(M={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(V||(V={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(G||(G={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(H||(H={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(j||(j={})),function(e){e.TradingStats="tradingStats"}(q||(q={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(Q||(Q={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(z||(z={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(K||(K={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(W||(W={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}($||($={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(Y||(Y={})),function(e){e.Staked="staked",e.Unbounding="unstaked",e.Available="available"}(J||(J={})),function(e){e.Received="received",e.Placed="placed"}(X||(X={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(Z||(Z={})),function(e){e.EVENT_MANAGER="event-manager",e.CHECK_IN_MANAGER="check-in-manager",e.EVENT_READER="event-reader"}(ee||(ee={})),function(e){e.EVENT_READER_VIEW="event-reader-view",e.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",e.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",e.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",e.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",e.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",e.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",e.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(te||(te={}));const ne=Object.values(ee),re=Object.values(te)})(),module.exports=__webpack_exports__})();
|
|
2
|
+
(()=>{var __webpack_modules__={8095:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormula=void 0,t.TypeFormula=class{constructor(e,t){this.name=e,this.typeParameters=t}toString(){if(this.typeParameters.length>0){const e=this.typeParameters.map((e=>e.toString())).join(", ");return`${this.name}<${e}>`}return this.name}}},9132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormulaParser=void 0;const r=n(8095);class i{parseExpression(e){e=e.trim();const t=this.tokenizeExpression(e).filter((e=>e!==i.COMMA)),n=[];for(const e of t)if(this.isPunctuation(e))if(this.isEndOfTypeParameters(e)){const e=this.acquireTypeWithParameters(n);n.push(e)}else{if(!this.isBeginningOfTypeParameters(e))throw new Error(`Unexpected token (punctuation): ${e}`);n.push(e)}else n.push(e);if(1!==n.length)throw new Error(`Unexpected stack length at end of parsing: ${n.length}`);if(i.PUNCTUATION.includes(n[0]))throw new Error("Unexpected root element.");const s=n[0];if(s instanceof r.TypeFormula)return s;if("string"==typeof s)return new r.TypeFormula(s,[]);throw new Error(`Unexpected item on stack: ${s}`)}tokenizeExpression(e){const t=[];let n="";for(const r of e)this.isPunctuation(r)?(n&&(t.push(n.trim()),n=""),t.push(r)):n+=r;return n&&t.push(n.trim()),t}acquireTypeWithParameters(e){const t=this.acquireTypeParameters(e),n=e.pop();return new r.TypeFormula(n,t.reverse())}acquireTypeParameters(e){const t=[];for(;;){const n=e.pop();if(void 0===n)throw new Error("Badly specified type parameters");if(this.isBeginningOfTypeParameters(n))break;if(n instanceof r.TypeFormula)t.push(n);else{if("string"!=typeof n)throw new Error(`Unexpected type parameter object in stack: ${n}`);t.push(new r.TypeFormula(n,[]))}}return t}isPunctuation(e){return i.PUNCTUATION.includes(e)}isEndOfTypeParameters(e){return e===i.END_TYPE_PARAMETERS}isBeginningOfTypeParameters(e){return e===i.BEGIN_TYPE_PARAMETERS}}t.TypeFormulaParser=i,i.BEGIN_TYPE_PARAMETERS="<",i.END_TYPE_PARAMETERS=">",i.COMMA=",",i.PUNCTUATION=[i.COMMA,i.BEGIN_TYPE_PARAMETERS,i.END_TYPE_PARAMETERS]},1703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;const r=n(236);t.Account=class{constructor(e){this.address=r.Address.empty(),this.nonce=0,this.balance="0",this.address=e}update(e){this.nonce=e.nonce,this.balance=e.balance}incrementNonce(){this.nonce=this.nonce.valueOf()+1}getNonceThenIncrement(){let e=this.nonce;return this.nonce=this.nonce.valueOf()+1,e}toJSON(){return{address:this.address.bech32(),nonce:this.nonce.valueOf(),balance:this.balance.toString()}}}},2969:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(620),t)},620:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryRunnerAdapter=void 0;const r=n(236),i=n(3647);t.QueryRunnerAdapter=class{constructor(e){this.networkProvider=e.networkProvider}async runQuery(e){const t={address:r.Address.fromBech32(e.contract),caller:e.caller?r.Address.fromBech32(e.caller):void 0,func:e.function,value:e.value,getEncodedArguments:()=>e.arguments.map((e=>Buffer.from(e).toString("hex")))},n=await this.networkProvider.queryContract(t);return new i.SmartContractQueryResponse({function:e.function,returnCode:n.returnCode.toString(),returnMessage:n.returnMessage,returnDataParts:n.getReturnDataParts()})}}},236:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddressComputer=t.Address=void 0;const o=s(n(9674)),u=a(n(1594)),c=n(6424),l=n(7353),d=s(n(2581)),f=n(8390),h=n(5508),p="0".repeat(16);class g{constructor(e,t){if(!e)return this.publicKey=Buffer.from([]),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(ArrayBuffer.isView(e)){if(32!=e.length)throw new d.ErrAddressCannotCreate(e);return this.publicKey=Buffer.from(e),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp)}if(e instanceof g){if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");return this.publicKey=e.publicKey,void(this.hrp=e.hrp)}if("string"==typeof e){if(g.isValidHex(e))return this.publicKey=Buffer.from(e,"hex"),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");const{hrp:n,pubkey:r}=m({value:e,allowCustomHrp:!1});return this.publicKey=r,void(this.hrp=n)}throw new d.ErrAddressCannotCreate(e)}static newFromBech32(e){const{hrp:t,pubkey:n}=m({value:e,allowCustomHrp:!0});return new g(n,t)}static fromBech32(e){const{hrp:t,pubkey:n}=m({value:e,allowCustomHrp:!1});return new g(n,t)}static newFromHex(e,t){if(!g.isValidHex(e))throw new d.ErrAddressCannotCreate(e);return new g(Buffer.from(e,"hex"),t)}static fromHex(e,t){return g.newFromHex(e,t)}static fromAddress(e){return new g(e)}static fromBuffer(e,t){return new g(e,t)}static fromString(e,t){return new g(e,t)}static isValidHex(e){return 32==Buffer.from(e,"hex").length}static empty(){return new g("")}static isValid(e){const t=o.decodeUnsafe(e),n=t?.prefix,r=t?Buffer.from(o.fromWords(t.words)):void 0;return n===c.LibraryConfig.DefaultAddressHrp&&32===r?.length}hex(){return this.toHex()}toHex(){return this.isEmpty()?"":this.publicKey.toString("hex")}bech32(){return this.toBech32()}toBech32(){if(this.isEmpty())return"";let e=o.toWords(this.pubkey());return o.encode(this.hrp,e)}pubkey(){return this.getPublicKey()}getPublicKey(){return this.publicKey}getHrp(){return this.hrp}isEmpty(){return 0==this.publicKey.length}equals(e){return!!e&&this.publicKey.toString()==e.publicKey.toString()}toString(){return this.toBech32()}toJSON(){return{bech32:this.toBech32(),pubkey:this.toHex()}}static Zero(){return new g("0".repeat(64))}isContractAddress(){return this.isSmartContract()}isSmartContract(){return this.toHex().startsWith(p)}}function m(e){const t=e.value,n=e.allowCustomHrp;let r,i;try{const e=o.decode(t);r=e.prefix,i=Buffer.from(o.fromWords(e.words))}catch(e){throw new d.ErrAddressCannotCreate(t,e)}if(!n&&r!=c.LibraryConfig.DefaultAddressHrp)throw new d.ErrAddressBadHrp(c.LibraryConfig.DefaultAddressHrp,r);return{hrp:r,pubkey:i}}t.Address=g,t.AddressComputer=class{constructor(e){this.numberOfShardsWithoutMeta=e||l.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META}computeContractAddress(e,t){const n=Buffer.alloc(8,0),r=e.getPublicKey(),i=r.slice(30),s=Buffer.alloc(8),a=new u.default(t.toString()),o=f.bigIntToBuffer(a);s.write(o.reverse().toString("hex"),"hex");const c=Buffer.concat([r,s]),d=h("keccak256").update(c).digest(),p=Buffer.from(l.WasmVirtualMachine,"hex"),m=Buffer.concat([n,p,d.slice(10,30),i]);return new g(m)}getShardOfAddress(e){return this.getShardOfPubkey(e.getPublicKey(),this.numberOfShardsWithoutMeta)}getShardOfPubkey(e,t){const n=parseInt("11",2),r=parseInt("01",2),i=e[31];if(this.isPubkeyOfMetachain(e))return l.METACHAIN_ID;let s=i&n;return s>t-1&&(s=i&r),s}isPubkeyOfMetachain(e){const t=Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=Buffer.from(e).slice(0,t.length);return!!t.equals(n)||!!Buffer.alloc(32).equals(Buffer.from(e))}}},5519:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncTimer=void 0;const a=s(n(2581)),o=n(2581),u=n(6458);t.AsyncTimer=class{constructor(e){this.timeoutHandle=null,this.rejectionFunc=null,this.name=e,this.correlationTag=0}start(e){if(this.timeoutHandle)throw new a.ErrAsyncTimerAlreadyRunning;return this.correlationTag++,u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].start()`),new Promise(((t,n)=>{this.rejectionFunc=n,this.timeoutHandle=setTimeout((()=>{this.rejectionFunc=null,this.stop(),t()}),e)}))}abort(){u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].abort()`),this.rejectionFunc&&(this.rejectionFunc(new o.ErrAsyncTimerAborted),this.rejectionFunc=null),this.stop()}stop(){this.isStopped()||(u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].stop()`),this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null))}isStopped(){return!this.timeoutHandle}}},1220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Compatibility=void 0;const r=n(236);t.Compatibility=class{static guardAddressIsSetAndNonZero(e,t,n){e&&""!=e.bech32()?e.bech32()==r.Address.Zero().bech32()&&console.warn(`${t}: address should not be the 'zero' address (also known as the 'contracts deployment address'); ${n}. In the future, this will throw an exception instead of emitting a WARN.`):console.warn(`${t}: address should be set; ${n}. In the future, this will throw an exception instead of emitting a WARN.`)}}},6424:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LibraryConfig=void 0;class n{}t.LibraryConfig=n,n.DefaultAddressHrp="erd"},7353:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ESDT_CONTRACT_ADDRESS=t.DELEGATION_MANAGER_SC_ADDRESS=t.CONTRACT_DEPLOY_ADDRESS=t.BECH32_ADDRESS_LENGTH=t.DEFAULT_HRP=t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER=t.UNKNOWN_SIGNER=t.SDK_JS_SIGNER=t.METACHAIN_ID=t.WasmVirtualMachine=t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=t.HEX_TRANSACTION_HASH_LENGTH=t.MESSAGE_PREFIX=t.DEFAULT_MESSAGE_VERSION=t.ESDT_CONTRACT_ADDRESS_HEX=t.DELEGATION_MANAGER_SC_ADDRESS_HEX=t.CONTRACT_DEPLOY_ADDRESS_HEX=t.VM_TYPE_WASM_VM=t.ARGUMENTS_SEPARATOR=t.ESDT_TRANSFER_VALUE=t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_GAS_LIMIT=t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=t.TRANSACTION_VERSION_DEFAULT=t.TRANSACTION_OPTIONS_TX_GUARDED=t.TRANSACTION_OPTIONS_TX_HASH_SIGN=t.TRANSACTION_OPTIONS_DEFAULT=t.TRANSACTION_MIN_GAS_PRICE=void 0,t.TRANSACTION_MIN_GAS_PRICE=1e9,t.TRANSACTION_OPTIONS_DEFAULT=0,t.TRANSACTION_OPTIONS_TX_HASH_SIGN=1,t.TRANSACTION_OPTIONS_TX_GUARDED=2,t.TRANSACTION_VERSION_DEFAULT=2,t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=2,t.ESDT_TRANSFER_GAS_LIMIT=5e5,t.ESDT_TRANSFER_FUNCTION_NAME="ESDTTransfer",t.ESDTNFT_TRANSFER_FUNCTION_NAME="ESDTNFTTransfer",t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME="MultiESDTNFTTransfer",t.ESDT_TRANSFER_VALUE="0",t.ARGUMENTS_SEPARATOR="@",t.VM_TYPE_WASM_VM=new Uint8Array([5,0]),t.CONTRACT_DEPLOY_ADDRESS_HEX="0000000000000000000000000000000000000000000000000000000000000000",t.DELEGATION_MANAGER_SC_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000004ffff",t.ESDT_CONTRACT_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000002ffff",t.DEFAULT_MESSAGE_VERSION=1,t.MESSAGE_PREFIX="Elrond Signed Message:\n",t.HEX_TRANSACTION_HASH_LENGTH=64,t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=3,t.WasmVirtualMachine="0500",t.METACHAIN_ID=4294967295,t.SDK_JS_SIGNER="sdk-js",t.UNKNOWN_SIGNER="unknown",t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER="EGLD-000000",t.DEFAULT_HRP="erd",t.BECH32_ADDRESS_LENGTH=62,t.CONTRACT_DEPLOY_ADDRESS="erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu",t.DELEGATION_MANAGER_SC_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqylllslmq6y6",t.ESDT_CONTRACT_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"},4408:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6659),t)},6659:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsConverter=void 0;const r=n(661),i=n(476),s=n(3217);t.TransactionsConverter=class{transactionToPlainObject(e){return{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data),chainID:e.chainID.valueOf(),version:e.version,options:0==e.options?void 0:e.options,guardian:e.guardian?e.guardian:void 0,signature:this.toHexOrUndefined(e.signature),guardianSignature:this.toHexOrUndefined(e.guardianSignature),relayer:e.relayer?e.relayer:void 0,innerTransactions:e.innerTransactions.length?e.innerTransactions.map((e=>this.transactionToPlainObject(e))):void 0}}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}plainObjectToTransaction(e){return new i.Transaction({nonce:BigInt(e.nonce),value:BigInt(e.value||""),receiver:e.receiver,receiverUsername:this.bufferFromBase64(e.receiverUsername).toString(),sender:e.sender,senderUsername:this.bufferFromBase64(e.senderUsername).toString(),guardian:e.guardian,gasPrice:BigInt(e.gasPrice),gasLimit:BigInt(e.gasLimit),data:this.bufferFromBase64(e.data),chainID:String(e.chainID),version:Number(e.version),options:Number(e.options),signature:this.bufferFromHex(e.signature),guardianSignature:this.bufferFromHex(e.guardianSignature),relayer:e.relayer,innerTransactions:e.innerTransactions?e.innerTransactions.map((e=>this.plainObjectToTransaction(e))):void 0})}bufferFromBase64(e){return Buffer.from(e||"","base64")}bufferFromHex(e){return Buffer.from(e||"","hex")}transactionOnNetworkToOutcome(e){const t=(new r.ResultsParser).parseUntypedOutcome(e),n=new s.SmartContractCallOutcome({function:e.function,returnCode:t.returnCode.toString(),returnMessage:t.returnMessage,returnDataParts:t.values}),i=e.contractResults.items.map((e=>this.smartContractResultOnNetworkToSmartContractResult(e))),a=new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))});return new s.TransactionOutcome({logs:a,smartContractResults:i,directSmartContractCallOutcome:n})}smartContractResultOnNetworkToSmartContractResult(e){return new s.SmartContractResult({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:Buffer.from(e.data),logs:new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))})})}eventOnNetworkToEvent(e){const t=e.dataPayload?.valueOf()||Buffer.from(e.data||""),n=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===n.length&&t.length&&n.push(Buffer.from(t)),new s.TransactionEvent({address:e.address.bech32(),identifier:e.identifier,topics:e.topics.map((e=>Buffer.from(e.hex(),"hex"))),dataItems:n})}}},2581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrSmartContractQuery=t.ErrParseTransactionOutcome=t.ErrInvalidInnerTransaction=t.ErrBadUsage=t.ErrInvalidTokenIdentifier=t.ErrIsCompletedFieldIsMissingOnTransaction=t.ErrGasLimitShouldBe0ForInnerTransaction=t.ErrInvalidRelayedV2BuilderArguments=t.ErrInvalidRelayedV1BuilderArguments=t.ErrNotImplemented=t.ErrContractInteraction=t.ErrCodec=t.ErrCannotParseTransactionOutcome=t.ErrCannotParseContractResults=t.ErrMissingFieldOnEnum=t.ErrMissingFieldOnStruct=t.ErrTypingSystem=t.ErrMock=t.ErrContractHasNoAddress=t.ErrContract=t.ErrExpectedTransactionEventsNotFound=t.ErrExpectedTransactionStatusNotReached=t.ErrTransactionWatcherTimeout=t.ErrAsyncTimerAborted=t.ErrAsyncTimerAlreadyRunning=t.ErrInvalidFunctionName=t.ErrSignatureCannotCreate=t.ErrTransactionOptionsInvalid=t.ErrTransactionVersionInvalid=t.ErrNonceInvalid=t.ErrNotEnoughGas=t.ErrAddressEmpty=t.ErrAddressBadHrp=t.ErrAddressCannotCreate=t.ErrUnexpectedCondition=t.ErrInvariantFailed=t.ErrBadType=t.ErrUnsupportedOperation=t.ErrInvalidArgument=t.Err=void 0;class n extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}summary(){let e=[];e.push({name:this.name,message:this.message});let t=this.inner;for(;t;)e.push({name:t.name,message:t.message}),t=t.inner;return e}}t.Err=n,t.ErrInvalidArgument=class extends n{constructor(e,t){super(`Invalid argument: ${e}`,t)}},t.ErrUnsupportedOperation=class extends n{constructor(e,t="not specified"){super(`Operation "${e}" not supported. Reason: ${t}`)}},t.ErrBadType=class extends n{constructor(e,t,n){super(`Bad type of "${e}": ${n}. Expected type: ${t}`)}},t.ErrInvariantFailed=class extends n{constructor(e){super(`Invariant failed: [${e}]`)}},t.ErrUnexpectedCondition=class extends n{constructor(e){super(`Unexpected condition: [${e}]`)}},t.ErrAddressCannotCreate=class extends n{constructor(e,t){super(`Cannot create address from: ${e}`,t)}},t.ErrAddressBadHrp=class extends n{constructor(e,t){super(`Wrong address HRP. Expected: ${e}, got ${t}`)}},t.ErrAddressEmpty=class extends n{constructor(){super("Address is empty")}},t.ErrNotEnoughGas=class extends n{constructor(e){super(`Not enough gas provided: ${e}`)}},t.ErrNonceInvalid=class extends n{constructor(e){super(`Invalid nonce: ${e}`)}},t.ErrTransactionVersionInvalid=class extends n{constructor(e){super(`Invalid transaction version: ${e}`)}},t.ErrTransactionOptionsInvalid=class extends n{constructor(e){super(`Invalid transaction options: ${e}`)}},t.ErrSignatureCannotCreate=class extends n{constructor(e,t){super(`Cannot create signature from: ${e}`,t)}},t.ErrInvalidFunctionName=class extends n{constructor(){super("Invalid function name")}},t.ErrAsyncTimerAlreadyRunning=class extends n{constructor(){super("Async timer already running")}},t.ErrAsyncTimerAborted=class extends n{constructor(){super("Async timer aborted")}},t.ErrTransactionWatcherTimeout=class extends n{constructor(){super("TransactionWatcher has timed out")}},t.ErrExpectedTransactionStatusNotReached=class extends n{constructor(){super("Expected transaction status not reached")}},t.ErrExpectedTransactionEventsNotFound=class extends n{constructor(){super("Expected transaction events not found")}};class r extends n{constructor(e){super(e)}}t.ErrContract=r,t.ErrContractHasNoAddress=class extends r{constructor(){super("\nThe smart contract has no address set. Make sure you provide the address in the constructor, or call setAddress() appropriately.\nIf you need to recompute the address of the contract, make use of SmartContract.computeAddress() (static method). \n")}},t.ErrMock=class extends n{constructor(e){super(e)}},t.ErrTypingSystem=class extends n{constructor(e){super(e)}},t.ErrMissingFieldOnStruct=class extends n{constructor(e,t){super(`field ${e} does not exist on struct ${t}`)}},t.ErrMissingFieldOnEnum=class extends n{constructor(e,t){super(`field ${e} does not exist on enum ${t}`)}},t.ErrCannotParseContractResults=class extends n{constructor(e){super(`cannot parse contract results: ${e}`)}},t.ErrCannotParseTransactionOutcome=class extends n{constructor(e,t){super(`cannot parse outcome of transaction ${e}: ${t}`)}},t.ErrCodec=class extends n{constructor(e){super(e)}},t.ErrContractInteraction=class extends n{constructor(e){super(e)}},t.ErrNotImplemented=class extends n{constructor(){super("Method not yet implemented")}},t.ErrInvalidRelayedV1BuilderArguments=class extends n{constructor(){super("invalid arguments for relayed v1 builder")}},t.ErrInvalidRelayedV2BuilderArguments=class extends n{constructor(){super("invalid arguments for relayed v2 builder")}},t.ErrGasLimitShouldBe0ForInnerTransaction=class extends n{constructor(){super("gas limit must be 0 for the inner transaction for relayed v2")}},t.ErrIsCompletedFieldIsMissingOnTransaction=class extends n{constructor(){super("The transaction watcher requires the `isCompleted` property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's `ProxyNetworkProvider.getTransaction()` and in that case you should also pass `withProcessStatus=true`.")}},t.ErrInvalidTokenIdentifier=class extends n{constructor(e){super(e)}},t.ErrBadUsage=class extends n{constructor(e){super(e)}},t.ErrInvalidInnerTransaction=class extends n{constructor(e){super(e)}},t.ErrParseTransactionOutcome=class extends n{constructor(e){super(e)}},t.ErrSmartContractQuery=class extends n{constructor(e,t){super(t),this.returnCode=e}}},523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GasEstimator=t.DefaultGasConfiguration=void 0,t.DefaultGasConfiguration={minGasLimit:5e4,gasPerDataByte:1500,gasCostESDTTransfer:2e5,gasCostESDTNFTTransfer:2e5,gasCostESDTNFTMultiTransfer:2e5};const n=8e5;t.GasEstimator=class{constructor(e){this.gasConfiguration=e||t.DefaultGasConfiguration}forEGLDTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasPerDataByte*e}forESDTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTTransfer+this.gasConfiguration.gasPerDataByte*e+1e5}forESDTNFTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTNFTTransfer+this.gasConfiguration.gasPerDataByte*e+n}forMultiESDTNFTTransfer(e,t){return this.gasConfiguration.minGasLimit+(this.gasConfiguration.gasCostESDTNFTMultiTransfer+n)*t+this.gasConfiguration.gasPerDataByte*e}}},1944:(e,t,n)=>{"use strict";n.g.Buffer||(n.g.Buffer=n(8287).Buffer)},9342:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;const a=s(n(2581));class o{constructor(e){if(e)if(e instanceof Buffer)this.hash=e;else{if("string"!=typeof e)throw new a.ErrBadType("hash","buffer | string",e);this.hash=Buffer.from(e,"hex")}else this.hash=Buffer.from([])}static empty(){return new o(Buffer.from([]))}isEmpty(){return 0==this.hash.length}toString(){return this.hex()}hex(){return this.hash.toString("hex")}valueOf(){return this.hash}}t.Hash=o},4820:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(1944),i(n(1703),t),i(n(2969),t),i(n(236),t),i(n(5519),t),i(n(6424),t),i(n(4408),t),i(n(2581),t),i(n(523),t),i(n(8979),t),i(n(8622),t),i(n(6458),t),i(n(1212),t),i(n(3500),t),i(n(7376),t),i(n(207),t),i(n(3508),t),i(n(5003),t),i(n(661),t),i(n(3856),t),i(n(5132),t),i(n(476),t),i(n(9825),t),i(n(3548),t),i(n(4650),t),i(n(3102),t),i(n(4476),t),i(n(1069),t)},8979:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6458:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.None=5]="None"}(n=t.LogLevel||(t.LogLevel={}));class r{static setLevel(e){r.logLevel=e}static trace(e,...t){r.logLevel>=n.Debug||console.debug(e,t)}static debug(e,...t){r.logLevel>=n.Debug||console.debug(e,t)}static info(e,...t){r.logLevel>=n.Info||console.log(e,t)}static warn(e,...t){r.logLevel>=n.Warn||console.warn(e,t)}static error(e,...t){r.logLevel>=n.Error||console.error(e,t)}}t.Logger=r,r.logLevel=n.Debug},1212:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageComputer=t.Message=void 0;const r=n(7353),i=n(236),s=n(5508);class a{constructor(e){this.data=e.data,this.signature=e.signature,this.address=e.address,this.version=e.version||r.DEFAULT_MESSAGE_VERSION,this.signer=e.signer||r.SDK_JS_SIGNER}}t.Message=a,t.MessageComputer=class{constructor(){}computeBytesForSigning(e){const t=Buffer.from(e.data.length.toString()),n=Buffer.concat([t,e.data]);let i=Buffer.concat([Buffer.from(r.MESSAGE_PREFIX),n]);return s("keccak256").update(i).digest()}computeBytesForVerifying(e){return this.computeBytesForSigning(e)}packMessage(e){return{message:Buffer.from(e.data).toString("hex"),signature:e.signature?Buffer.from(e.signature).toString("hex"):"",address:e.address?e.address.bech32():"",version:e.version,signer:e.signer}}unpackMessage(e){const t=this.trimHexPrefix(e.message),n=Buffer.from(t,"hex"),s=this.trimHexPrefix(e.signature||""),o=Buffer.from(s,"hex");let u;e.address&&(u=i.Address.fromBech32(e.address));const c=e.version||r.DEFAULT_MESSAGE_VERSION,l=e.signer||r.UNKNOWN_SIGNER;return new a({data:n,signature:o,address:u,version:c,signer:l})}trimHexPrefix(e){return e.startsWith("0x")||e.startsWith("0X")?e.slice(2):e}}},3500:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOptions=t.TransactionVersion=void 0;const a=n(7353),o=s(n(2581));class u{constructor(e){if((e=Number(e))<1)throw new o.ErrTransactionVersionInvalid(e);this.value=e}static withDefaultVersion(){return new u(a.TRANSACTION_VERSION_DEFAULT)}static withTxOptions(){return new u(a.TRANSACTION_VERSION_DEFAULT)}valueOf(){return this.value}}t.TransactionVersion=u;class c{constructor(e){if((e=Number(e))<0)throw new o.ErrTransactionOptionsInvalid(e);this.value=e}static withDefaultOptions(){return new c(a.TRANSACTION_OPTIONS_DEFAULT)}static withOptions(e){let t=0;return e.hashSign&&(t|=a.TRANSACTION_OPTIONS_TX_HASH_SIGN),e.guarded&&(t|=a.TRANSACTION_OPTIONS_TX_GUARDED),new c(t)}isWithHashSign(){return(this.value&a.TRANSACTION_OPTIONS_TX_HASH_SIGN)==a.TRANSACTION_OPTIONS_TX_HASH_SIGN}isWithGuardian(){return(this.value&a.TRANSACTION_OPTIONS_TX_GUARDED)==a.TRANSACTION_OPTIONS_TX_GUARDED}setWithHashSign(){this.value|=a.TRANSACTION_OPTIONS_TX_HASH_SIGN}setWithGuardian(){this.value|=a.TRANSACTION_OPTIONS_TX_GUARDED}valueOf(){return this.value}}t.TransactionOptions=c},4330:function(e,t,n){"use strict";var r,i,s;i=[n(6946)],void 0===(s="function"==typeof(r=function(e){var t,n=e.Reader,r=e.Writer,i=e.util,s=e.roots.default||(e.roots.default={});return s.proto=((t={}).Transaction=function(){function t(e){if(this.InnerTransactions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.Nonce=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Value=i.newBuffer([]),t.prototype.RcvAddr=i.newBuffer([]),t.prototype.RcvUserName=i.newBuffer([]),t.prototype.SndAddr=i.newBuffer([]),t.prototype.SndUserName=i.newBuffer([]),t.prototype.GasPrice=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.GasLimit=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Data=i.newBuffer([]),t.prototype.ChainID=i.newBuffer([]),t.prototype.Version=0,t.prototype.Signature=i.newBuffer([]),t.prototype.Options=0,t.prototype.GuardianAddr=i.newBuffer([]),t.prototype.GuardianSignature=i.newBuffer([]),t.prototype.Relayer=i.newBuffer([]),t.prototype.InnerTransactions=i.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=r.create()),null!=e.Nonce&&Object.hasOwnProperty.call(e,"Nonce")&&t.uint32(8).uint64(e.Nonce),null!=e.Value&&Object.hasOwnProperty.call(e,"Value")&&t.uint32(18).bytes(e.Value),null!=e.RcvAddr&&Object.hasOwnProperty.call(e,"RcvAddr")&&t.uint32(26).bytes(e.RcvAddr),null!=e.RcvUserName&&Object.hasOwnProperty.call(e,"RcvUserName")&&t.uint32(34).bytes(e.RcvUserName),null!=e.SndAddr&&Object.hasOwnProperty.call(e,"SndAddr")&&t.uint32(42).bytes(e.SndAddr),null!=e.SndUserName&&Object.hasOwnProperty.call(e,"SndUserName")&&t.uint32(50).bytes(e.SndUserName),null!=e.GasPrice&&Object.hasOwnProperty.call(e,"GasPrice")&&t.uint32(56).uint64(e.GasPrice),null!=e.GasLimit&&Object.hasOwnProperty.call(e,"GasLimit")&&t.uint32(64).uint64(e.GasLimit),null!=e.Data&&Object.hasOwnProperty.call(e,"Data")&&t.uint32(74).bytes(e.Data),null!=e.ChainID&&Object.hasOwnProperty.call(e,"ChainID")&&t.uint32(82).bytes(e.ChainID),null!=e.Version&&Object.hasOwnProperty.call(e,"Version")&&t.uint32(88).uint32(e.Version),null!=e.Signature&&Object.hasOwnProperty.call(e,"Signature")&&t.uint32(98).bytes(e.Signature),null!=e.Options&&Object.hasOwnProperty.call(e,"Options")&&t.uint32(104).uint32(e.Options),null!=e.GuardianAddr&&Object.hasOwnProperty.call(e,"GuardianAddr")&&t.uint32(114).bytes(e.GuardianAddr),null!=e.GuardianSignature&&Object.hasOwnProperty.call(e,"GuardianSignature")&&t.uint32(122).bytes(e.GuardianSignature),null!=e.Relayer&&Object.hasOwnProperty.call(e,"Relayer")&&t.uint32(130).bytes(e.Relayer),null!=e.InnerTransactions&&e.InnerTransactions.length)for(var n=0;n<e.InnerTransactions.length;++n)s.proto.Transaction.encode(e.InnerTransactions[n],t.uint32(138).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof n||(e=n.create(e));for(var r=void 0===t?e.len:e.pos+t,i=new s.proto.Transaction;e.pos<r;){var a=e.uint32();switch(a>>>3){case 1:i.Nonce=e.uint64();break;case 2:i.Value=e.bytes();break;case 3:i.RcvAddr=e.bytes();break;case 4:i.RcvUserName=e.bytes();break;case 5:i.SndAddr=e.bytes();break;case 6:i.SndUserName=e.bytes();break;case 7:i.GasPrice=e.uint64();break;case 8:i.GasLimit=e.uint64();break;case 9:i.Data=e.bytes();break;case 10:i.ChainID=e.bytes();break;case 11:i.Version=e.uint32();break;case 12:i.Signature=e.bytes();break;case 13:i.Options=e.uint32();break;case 14:i.GuardianAddr=e.bytes();break;case 15:i.GuardianSignature=e.bytes();break;case 16:i.Relayer=e.bytes();break;case 17:i.InnerTransactions&&i.InnerTransactions.length||(i.InnerTransactions=[]),i.InnerTransactions.push(s.proto.Transaction.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},t.decodeDelimited=function(e){return e instanceof n||(e=new n(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.Nonce&&e.hasOwnProperty("Nonce")&&!(i.isInteger(e.Nonce)||e.Nonce&&i.isInteger(e.Nonce.low)&&i.isInteger(e.Nonce.high)))return"Nonce: integer|Long expected";if(null!=e.Value&&e.hasOwnProperty("Value")&&!(e.Value&&"number"==typeof e.Value.length||i.isString(e.Value)))return"Value: buffer expected";if(null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&!(e.RcvAddr&&"number"==typeof e.RcvAddr.length||i.isString(e.RcvAddr)))return"RcvAddr: buffer expected";if(null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&!(e.RcvUserName&&"number"==typeof e.RcvUserName.length||i.isString(e.RcvUserName)))return"RcvUserName: buffer expected";if(null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&!(e.SndAddr&&"number"==typeof e.SndAddr.length||i.isString(e.SndAddr)))return"SndAddr: buffer expected";if(null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&!(e.SndUserName&&"number"==typeof e.SndUserName.length||i.isString(e.SndUserName)))return"SndUserName: buffer expected";if(null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&!(i.isInteger(e.GasPrice)||e.GasPrice&&i.isInteger(e.GasPrice.low)&&i.isInteger(e.GasPrice.high)))return"GasPrice: integer|Long expected";if(null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&!(i.isInteger(e.GasLimit)||e.GasLimit&&i.isInteger(e.GasLimit.low)&&i.isInteger(e.GasLimit.high)))return"GasLimit: integer|Long expected";if(null!=e.Data&&e.hasOwnProperty("Data")&&!(e.Data&&"number"==typeof e.Data.length||i.isString(e.Data)))return"Data: buffer expected";if(null!=e.ChainID&&e.hasOwnProperty("ChainID")&&!(e.ChainID&&"number"==typeof e.ChainID.length||i.isString(e.ChainID)))return"ChainID: buffer expected";if(null!=e.Version&&e.hasOwnProperty("Version")&&!i.isInteger(e.Version))return"Version: integer expected";if(null!=e.Signature&&e.hasOwnProperty("Signature")&&!(e.Signature&&"number"==typeof e.Signature.length||i.isString(e.Signature)))return"Signature: buffer expected";if(null!=e.Options&&e.hasOwnProperty("Options")&&!i.isInteger(e.Options))return"Options: integer expected";if(null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&!(e.GuardianAddr&&"number"==typeof e.GuardianAddr.length||i.isString(e.GuardianAddr)))return"GuardianAddr: buffer expected";if(null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&!(e.GuardianSignature&&"number"==typeof e.GuardianSignature.length||i.isString(e.GuardianSignature)))return"GuardianSignature: buffer expected";if(null!=e.Relayer&&e.hasOwnProperty("Relayer")&&!(e.Relayer&&"number"==typeof e.Relayer.length||i.isString(e.Relayer)))return"Relayer: buffer expected";if(null!=e.InnerTransactions&&e.hasOwnProperty("InnerTransactions")){if(!Array.isArray(e.InnerTransactions))return"InnerTransactions: array expected";for(var t=0;t<e.InnerTransactions.length;++t){var n=s.proto.Transaction.verify(e.InnerTransactions[t]);if(n)return"InnerTransactions."+n}}return null},t.fromObject=function(e){if(e instanceof s.proto.Transaction)return e;var t=new s.proto.Transaction;if(null!=e.Nonce&&(i.Long?(t.Nonce=i.Long.fromValue(e.Nonce)).unsigned=!0:"string"==typeof e.Nonce?t.Nonce=parseInt(e.Nonce,10):"number"==typeof e.Nonce?t.Nonce=e.Nonce:"object"==typeof e.Nonce&&(t.Nonce=new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0))),null!=e.Value&&("string"==typeof e.Value?i.base64.decode(e.Value,t.Value=i.newBuffer(i.base64.length(e.Value)),0):e.Value.length>=0&&(t.Value=e.Value)),null!=e.RcvAddr&&("string"==typeof e.RcvAddr?i.base64.decode(e.RcvAddr,t.RcvAddr=i.newBuffer(i.base64.length(e.RcvAddr)),0):e.RcvAddr.length>=0&&(t.RcvAddr=e.RcvAddr)),null!=e.RcvUserName&&("string"==typeof e.RcvUserName?i.base64.decode(e.RcvUserName,t.RcvUserName=i.newBuffer(i.base64.length(e.RcvUserName)),0):e.RcvUserName.length>=0&&(t.RcvUserName=e.RcvUserName)),null!=e.SndAddr&&("string"==typeof e.SndAddr?i.base64.decode(e.SndAddr,t.SndAddr=i.newBuffer(i.base64.length(e.SndAddr)),0):e.SndAddr.length>=0&&(t.SndAddr=e.SndAddr)),null!=e.SndUserName&&("string"==typeof e.SndUserName?i.base64.decode(e.SndUserName,t.SndUserName=i.newBuffer(i.base64.length(e.SndUserName)),0):e.SndUserName.length>=0&&(t.SndUserName=e.SndUserName)),null!=e.GasPrice&&(i.Long?(t.GasPrice=i.Long.fromValue(e.GasPrice)).unsigned=!0:"string"==typeof e.GasPrice?t.GasPrice=parseInt(e.GasPrice,10):"number"==typeof e.GasPrice?t.GasPrice=e.GasPrice:"object"==typeof e.GasPrice&&(t.GasPrice=new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0))),null!=e.GasLimit&&(i.Long?(t.GasLimit=i.Long.fromValue(e.GasLimit)).unsigned=!0:"string"==typeof e.GasLimit?t.GasLimit=parseInt(e.GasLimit,10):"number"==typeof e.GasLimit?t.GasLimit=e.GasLimit:"object"==typeof e.GasLimit&&(t.GasLimit=new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0))),null!=e.Data&&("string"==typeof e.Data?i.base64.decode(e.Data,t.Data=i.newBuffer(i.base64.length(e.Data)),0):e.Data.length>=0&&(t.Data=e.Data)),null!=e.ChainID&&("string"==typeof e.ChainID?i.base64.decode(e.ChainID,t.ChainID=i.newBuffer(i.base64.length(e.ChainID)),0):e.ChainID.length>=0&&(t.ChainID=e.ChainID)),null!=e.Version&&(t.Version=e.Version>>>0),null!=e.Signature&&("string"==typeof e.Signature?i.base64.decode(e.Signature,t.Signature=i.newBuffer(i.base64.length(e.Signature)),0):e.Signature.length>=0&&(t.Signature=e.Signature)),null!=e.Options&&(t.Options=e.Options>>>0),null!=e.GuardianAddr&&("string"==typeof e.GuardianAddr?i.base64.decode(e.GuardianAddr,t.GuardianAddr=i.newBuffer(i.base64.length(e.GuardianAddr)),0):e.GuardianAddr.length>=0&&(t.GuardianAddr=e.GuardianAddr)),null!=e.GuardianSignature&&("string"==typeof e.GuardianSignature?i.base64.decode(e.GuardianSignature,t.GuardianSignature=i.newBuffer(i.base64.length(e.GuardianSignature)),0):e.GuardianSignature.length>=0&&(t.GuardianSignature=e.GuardianSignature)),null!=e.Relayer&&("string"==typeof e.Relayer?i.base64.decode(e.Relayer,t.Relayer=i.newBuffer(i.base64.length(e.Relayer)),0):e.Relayer.length>=0&&(t.Relayer=e.Relayer)),e.InnerTransactions){if(!Array.isArray(e.InnerTransactions))throw TypeError(".proto.Transaction.InnerTransactions: array expected");t.InnerTransactions=[];for(var n=0;n<e.InnerTransactions.length;++n){if("object"!=typeof e.InnerTransactions[n])throw TypeError(".proto.Transaction.InnerTransactions: object expected");t.InnerTransactions[n]=s.proto.Transaction.fromObject(e.InnerTransactions[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.InnerTransactions=[]),t.defaults){if(i.Long){var r=new i.Long(0,0,!0);n.Nonce=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.Nonce=t.longs===String?"0":0;t.bytes===String?n.Value="":(n.Value=[],t.bytes!==Array&&(n.Value=i.newBuffer(n.Value))),t.bytes===String?n.RcvAddr="":(n.RcvAddr=[],t.bytes!==Array&&(n.RcvAddr=i.newBuffer(n.RcvAddr))),t.bytes===String?n.RcvUserName="":(n.RcvUserName=[],t.bytes!==Array&&(n.RcvUserName=i.newBuffer(n.RcvUserName))),t.bytes===String?n.SndAddr="":(n.SndAddr=[],t.bytes!==Array&&(n.SndAddr=i.newBuffer(n.SndAddr))),t.bytes===String?n.SndUserName="":(n.SndUserName=[],t.bytes!==Array&&(n.SndUserName=i.newBuffer(n.SndUserName))),i.Long?(r=new i.Long(0,0,!0),n.GasPrice=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.GasPrice=t.longs===String?"0":0,i.Long?(r=new i.Long(0,0,!0),n.GasLimit=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.GasLimit=t.longs===String?"0":0,t.bytes===String?n.Data="":(n.Data=[],t.bytes!==Array&&(n.Data=i.newBuffer(n.Data))),t.bytes===String?n.ChainID="":(n.ChainID=[],t.bytes!==Array&&(n.ChainID=i.newBuffer(n.ChainID))),n.Version=0,t.bytes===String?n.Signature="":(n.Signature=[],t.bytes!==Array&&(n.Signature=i.newBuffer(n.Signature))),n.Options=0,t.bytes===String?n.GuardianAddr="":(n.GuardianAddr=[],t.bytes!==Array&&(n.GuardianAddr=i.newBuffer(n.GuardianAddr))),t.bytes===String?n.GuardianSignature="":(n.GuardianSignature=[],t.bytes!==Array&&(n.GuardianSignature=i.newBuffer(n.GuardianSignature))),t.bytes===String?n.Relayer="":(n.Relayer=[],t.bytes!==Array&&(n.Relayer=i.newBuffer(n.Relayer)))}if(null!=e.Nonce&&e.hasOwnProperty("Nonce")&&("number"==typeof e.Nonce?n.Nonce=t.longs===String?String(e.Nonce):e.Nonce:n.Nonce=t.longs===String?i.Long.prototype.toString.call(e.Nonce):t.longs===Number?new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0):e.Nonce),null!=e.Value&&e.hasOwnProperty("Value")&&(n.Value=t.bytes===String?i.base64.encode(e.Value,0,e.Value.length):t.bytes===Array?Array.prototype.slice.call(e.Value):e.Value),null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&(n.RcvAddr=t.bytes===String?i.base64.encode(e.RcvAddr,0,e.RcvAddr.length):t.bytes===Array?Array.prototype.slice.call(e.RcvAddr):e.RcvAddr),null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&(n.RcvUserName=t.bytes===String?i.base64.encode(e.RcvUserName,0,e.RcvUserName.length):t.bytes===Array?Array.prototype.slice.call(e.RcvUserName):e.RcvUserName),null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&(n.SndAddr=t.bytes===String?i.base64.encode(e.SndAddr,0,e.SndAddr.length):t.bytes===Array?Array.prototype.slice.call(e.SndAddr):e.SndAddr),null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&(n.SndUserName=t.bytes===String?i.base64.encode(e.SndUserName,0,e.SndUserName.length):t.bytes===Array?Array.prototype.slice.call(e.SndUserName):e.SndUserName),null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&("number"==typeof e.GasPrice?n.GasPrice=t.longs===String?String(e.GasPrice):e.GasPrice:n.GasPrice=t.longs===String?i.Long.prototype.toString.call(e.GasPrice):t.longs===Number?new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0):e.GasPrice),null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&("number"==typeof e.GasLimit?n.GasLimit=t.longs===String?String(e.GasLimit):e.GasLimit:n.GasLimit=t.longs===String?i.Long.prototype.toString.call(e.GasLimit):t.longs===Number?new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0):e.GasLimit),null!=e.Data&&e.hasOwnProperty("Data")&&(n.Data=t.bytes===String?i.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.ChainID&&e.hasOwnProperty("ChainID")&&(n.ChainID=t.bytes===String?i.base64.encode(e.ChainID,0,e.ChainID.length):t.bytes===Array?Array.prototype.slice.call(e.ChainID):e.ChainID),null!=e.Version&&e.hasOwnProperty("Version")&&(n.Version=e.Version),null!=e.Signature&&e.hasOwnProperty("Signature")&&(n.Signature=t.bytes===String?i.base64.encode(e.Signature,0,e.Signature.length):t.bytes===Array?Array.prototype.slice.call(e.Signature):e.Signature),null!=e.Options&&e.hasOwnProperty("Options")&&(n.Options=e.Options),null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&(n.GuardianAddr=t.bytes===String?i.base64.encode(e.GuardianAddr,0,e.GuardianAddr.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianAddr):e.GuardianAddr),null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&(n.GuardianSignature=t.bytes===String?i.base64.encode(e.GuardianSignature,0,e.GuardianSignature.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianSignature):e.GuardianSignature),null!=e.Relayer&&e.hasOwnProperty("Relayer")&&(n.Relayer=t.bytes===String?i.base64.encode(e.Relayer,0,e.Relayer.length):t.bytes===Array?Array.prototype.slice.call(e.Relayer):e.Relayer),e.InnerTransactions&&e.InnerTransactions.length){n.InnerTransactions=[];for(var a=0;a<e.InnerTransactions.length;++a)n.InnerTransactions[a]=s.proto.Transaction.toObject(e.InnerTransactions[a],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Transaction"},t}(),t),s})?r.apply(t,i):r)||(e.exports=s)},9277:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3325),t)},3325:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoSerializer=void 0;const o=a(n(1594)),u=n(236),c=n(7353),l=s(n(2581)),d=n(7553);t.ProtoSerializer=class{serializeTransaction(e){const t=n(4330).proto,r=this.convertToProtoMessage(e),i=t.Transaction.encode(r).finish();return Buffer.from(i)}convertToProtoMessage(e){const t=n(4330).proto,r=new u.Address(e.receiver).getPublicKey(),i=new u.Address(e.sender).getPublicKey();let s=new t.Transaction({Nonce:Number(e.nonce)?Number(e.nonce):void 0,Value:this.serializeTransactionValue(e.value),RcvAddr:r,RcvUserName:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0,SndAddr:i,SndUserName:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,GasPrice:Number(e.gasPrice),GasLimit:Number(e.gasLimit),Data:0==e.data.length?null:e.data,ChainID:Buffer.from(e.chainID),Version:e.version,Signature:e.signature});return e.options!==c.TRANSACTION_OPTIONS_DEFAULT&&(s.Options=e.options),this.isGuardedTransaction(e)&&(s.GuardianAddr=new u.Address(e.guardian).getPublicKey(),s.GuardianSignature=e.guardianSignature),e.relayer&&(s.Relayer=new u.Address(e.relayer).getPublicKey()),s.InnerTransactions=e.innerTransactions.map((e=>this.convertToProtoMessage(e))),s}serializeTransactionValue(e){let t=new o.default(e.toString());if(t.isZero())return Buffer.from([0,0]);let n=d.bigIntToBuffer(t);return n=Buffer.concat([Buffer.from([0]),n]),n}isGuardedTransaction(e){const t=e.guardian.length>0,n=e.guardianSignature.length>0;return this.isWithGuardian(e)&&t&&n}isWithGuardian(e){return(e.options&c.TRANSACTION_OPTIONS_TX_GUARDED)==c.TRANSACTION_OPTIONS_TX_GUARDED}deserializeTransaction(e){throw new l.ErrUnsupportedOperation("deserializeTransaction")}}},6063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJavascriptPrototypesInHierarchy=void 0,t.getJavascriptPrototypesInHierarchy=function(e,t){let n=[],r=Object.getPrototypeOf(e);for(;r&&t(r);)n.push(r),r=Object.getPrototypeOf(r);return n}},7376:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionV1Builder=void 0;const r=n(236),i=n(2581),s=n(476),a=n(3548),o=n(1013);t.RelayedTransactionV1Builder=class{setInnerTransaction(e){return this.innerTransaction=e,this}setNetworkConfig(e){return this.netConfig=e,this}setRelayerAddress(e){return this.relayerAddress=e,this}setRelayerNonce(e){return this.relayerNonce=e,this}setRelayedTransactionVersion(e){return this.relayedTransactionVersion=e,this}setRelayedTransactionOptions(e){return this.relayedTransactionOptions=e,this}setRelayedTransactionGuardian(e){return this.relayedTransactionGuardian=e,this}build(){if(!(this.innerTransaction&&this.netConfig&&this.relayerAddress&&this.innerTransaction.getSignature()))throw new i.ErrInvalidRelayedV1BuilderArguments;const e=this.prepareInnerTransaction(),t=`relayedTx@${Buffer.from(e).toString("hex")}`,n=new a.TransactionPayload(t),r=this.netConfig.MinGasLimit+this.netConfig.GasPerDataByte*n.length()+this.innerTransaction.getGasLimit().valueOf();let o=new s.Transaction({nonce:this.relayerNonce,sender:this.relayerAddress,receiver:this.innerTransaction.getSender(),value:0,gasLimit:r,data:n,chainID:this.netConfig.ChainID,version:this.relayedTransactionVersion,options:this.relayedTransactionOptions,guardian:this.relayedTransactionGuardian});return this.relayerNonce&&o.setNonce(this.relayerNonce),o}prepareInnerTransaction(){if(!this.innerTransaction)return"";const e={nonce:this.innerTransaction.getNonce().valueOf(),sender:new r.Address(this.innerTransaction.getSender().bech32()).pubkey().toString("base64"),receiver:new r.Address(this.innerTransaction.getReceiver().bech32()).pubkey().toString("base64"),value:BigInt(this.innerTransaction.getValue().toString()),gasPrice:this.innerTransaction.getGasPrice().valueOf(),gasLimit:this.innerTransaction.getGasLimit().valueOf(),data:this.innerTransaction.getData().valueOf().toString("base64"),signature:this.innerTransaction.getSignature().toString("base64"),chainID:Buffer.from(this.innerTransaction.getChainID().valueOf()).toString("base64"),version:this.innerTransaction.getVersion().valueOf(),options:0==this.innerTransaction.getOptions().valueOf()?void 0:this.innerTransaction.getOptions().valueOf(),guardian:this.innerTransaction.getGuardian().bech32()?new r.Address(this.innerTransaction.getGuardian().bech32()).pubkey().toString("base64"):void 0,guardianSignature:this.innerTransaction.getGuardianSignature().toString("hex")?this.innerTransaction.getGuardianSignature().toString("base64"):void 0,sndUserName:this.innerTransaction.getSenderUsername()?Buffer.from(this.innerTransaction.getSenderUsername()).toString("base64"):void 0,rcvUserName:this.innerTransaction.getReceiverUsername()?Buffer.from(this.innerTransaction.getReceiverUsername()).toString("base64"):void 0};return o.stringify(e)}}},207:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionV2Builder=void 0;const r=n(2581),i=n(661),s=n(476),a=n(3548);t.RelayedTransactionV2Builder=class{setInnerTransaction(e){return this.innerTransaction=e,this}setInnerTransactionGasLimit(e){return this.innerTransactionGasLimit=e,this}setNetworkConfig(e){return this.netConfig=e,this}setRelayerAddress(e){return this.relayerAddress=e,this}setRelayerNonce(e){return this.relayerNonce=e,this}build(){if(!(this.innerTransaction&&this.innerTransactionGasLimit&&this.relayerAddress&&this.netConfig&&this.innerTransaction.getSignature()))throw new r.ErrInvalidRelayedV2BuilderArguments;if(0!=this.innerTransaction.getGasLimit())throw new r.ErrGasLimitShouldBe0ForInnerTransaction;const{argumentsString:e}=(new i.ArgSerializer).valuesToString([new i.AddressValue(this.innerTransaction.getReceiver()),new i.U64Value(this.innerTransaction.getNonce().valueOf()),new i.BytesValue(this.innerTransaction.getData().valueOf()),new i.BytesValue(this.innerTransaction.getSignature())]),t=`relayedTxV2@${e}`,n=new a.TransactionPayload(t);let o=new s.Transaction({sender:this.relayerAddress,receiver:this.innerTransaction.getSender(),value:0,gasLimit:this.innerTransactionGasLimit.valueOf()+this.netConfig.MinGasLimit+this.netConfig.GasPerDataByte*n.length(),data:n,chainID:this.netConfig.ChainID,version:this.innerTransaction.getVersion(),options:this.innerTransaction.getOptions()});return this.relayerNonce&&o.setNonce(this.relayerNonce),o}}},3508:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignableMessage=void 0;const r=n(236),i=n(9874),s=n(7353),a=n(5508);t.SignableMessage=class{constructor(e){this.message=Buffer.from([]),this.signature=Buffer.from([]),this.version=1,this.signer="ErdJS",this.address=r.Address.empty(),Object.assign(this,e)}serializeForSigning(){const e=Buffer.from(this.message.length.toString()),t=Buffer.concat([e,this.message]);let n=Buffer.concat([Buffer.from(s.MESSAGE_PREFIX),t]);return a("keccak256").update(n).digest()}serializeForSigningRaw(){return Buffer.concat([this.getMessageSize(),this.message])}getSignature(){return this.signature}applySignature(e){this.signature=i.interpretSignatureAsBuffer(e)}getMessageSize(){const e=Buffer.alloc(4);return e.writeUInt32BE(this.message.length,0),e}toJSON(){return{address:this.address.bech32(),message:"0x"+this.message.toString("hex"),signature:"0x"+this.signature.toString("hex"),version:this.version,signer:this.signer}}}},9874:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.interpretSignatureAsBuffer=t.Signature=void 0;const a=s(n(2581));class o{constructor(e){if(this.valueHex="",e)return"string"==typeof e?o.fromHex(e):e instanceof Buffer?o.fromBuffer(e):void 0}static empty(){return new o}static fromHex(e){if(e.startsWith("0x")&&(e=e.slice(2)),!o.isValidHex(e))throw new a.ErrSignatureCannotCreate(e);return o.fromValidHex(e)}static isValidHex(e){return 64==Buffer.from(e,"hex").length}static fromValidHex(e){let t=new o;return t.valueHex=e,t}static fromBuffer(e){if(64!=e.length)throw new a.ErrSignatureCannotCreate(e);return o.fromValidHex(e.toString("hex"))}hex(){return this.valueHex}}t.Signature=o,t.interpretSignatureAsBuffer=function(e){if(ArrayBuffer.isView(e))return Buffer.from(e);if(null!=e.hex)return Buffer.from(e.hex(),"hex");throw new Error(`Object cannot be interpreted as a signature: ${e}`)}},5003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractQueriesController=void 0;const r=n(2581),i=n(3647),s=n(661),a=n(2747);t.SmartContractQueriesController=class{constructor(e){this.abi=e.abi,this.queryRunner=e.queryRunner,this.legacyResultsParser=new s.ResultsParser}async query(e){const t=this.createQuery(e),n=await this.runQuery(t);return this.raiseForStatus(n),this.parseQueryResponse(n)}raiseForStatus(e){if("ok"!==e.returnCode)throw new r.ErrSmartContractQuery(e.returnCode,e.returnMessage)}createQuery(e){const t=this.encodeArguments(e.function,e.arguments);return new i.SmartContractQuery({contract:e.contract,caller:e.caller,function:e.function,arguments:t,value:e.value})}encodeArguments(e,t){const n=this.abi?.getEndpoint(e);if(n){const e=s.NativeSerializer.nativeToTypedValues(t,n);return(new s.ArgSerializer).valuesToBuffers(e)}if(this.areArgsOfTypedValue(t))return(new s.ArgSerializer).valuesToBuffers(t);if(this.areArgsBuffers(t))return t.map((e=>Buffer.from(e)));throw new r.Err("cannot encode arguments: when ABI is not available, they must be either typed values or buffers")}areArgsOfTypedValue(e){return e.every((e=>a.isTyped(e)))}areArgsBuffers(e){for(const t of e)if(!ArrayBuffer.isView(t))return!1;return!0}async runQuery(e){return await this.queryRunner.runQuery(e)}parseQueryResponse(e){if(!this.abi)return e.returnDataParts;const t={returnCode:e.returnCode,returnMessage:e.returnMessage,getReturnDataParts:()=>e.returnDataParts.map((e=>Buffer.from(e)))},n=e.function,r=this.abi.getEndpoint(n);return this.legacyResultsParser.parseQueryResponse(t,r).values.map((e=>e.valueOf()))}}},3647:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractQueryResponse=t.SmartContractQuery=void 0,t.SmartContractQuery=class{constructor(e){this.contract=e.contract,this.caller=e.caller,this.value=e.value,this.function=e.function,this.arguments=e.arguments}},t.SmartContractQueryResponse=class{constructor(e){this.function=e.function,this.returnCode=e.returnCode,this.returnMessage=e.returnMessage,this.returnDataParts=e.returnDataParts}}},1157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgSerializer=void 0;const r=n(7353),i=n(9272),s=n(2747),a=n(1055),o=n(7472),u=n(6054),c={codec:new i.BinaryCodec};t.ArgSerializer=class{constructor(e){e={...c,...e},this.codec=e.codec}stringToValues(e,t){let n=this.stringToBuffers(e);return this.buffersToValues(n,t)}stringToBuffers(e){return e.split(r.ARGUMENTS_SEPARATOR).map((e=>Buffer.from(e,"hex")))}buffersToValues(e,t){const n=this;let r=[],i=0,c=(e=e||[]).length;for(let e=0;e<t.length;e++){let n=l(t[e].type);r.push(n)}function l(t){if(t.hasExactClass(a.OptionalType.ClassName)){const e=l(t.getFirstTypeParameter());return new a.OptionalValue(t,e)}if(t.hasExactClass(u.VariadicType.ClassName))return function(e){const t=e,n=[];if(t.isCounted){const t=l(new s.U32Type).valueOf().toNumber();for(let r=0;r<t;r++)n.push(l(e.getFirstTypeParameter()))}else for(;!d();)n.push(l(e.getFirstTypeParameter()));return new u.VariadicValue(t,n)}(t);if(t.hasExactClass(o.CompositeType.ClassName)){const e=[];for(const n of t.getTypeParameters())e.push(l(n));return new o.CompositeValue(t,e)}const r=function(t){if(d())return null;let r=e[i++];return n.codec.decodeTopLevel(r,t)}(t);return r}function d(){return i>=c}return r}valuesToString(e){let t=this.valuesToStrings(e);return{argumentsString:t.join(r.ARGUMENTS_SEPARATOR),count:t.length}}valuesToStrings(e){return this.valuesToBuffers(e).map((e=>e.toString("hex")))}valuesToBuffers(e){const t=this,n=[];for(const t of e)r(t);function r(e){if(e.hasExactClass(a.OptionalValue.ClassName)){const t=e;return void(t.isSet()&&r(t.getTypedValue()))}if(e.hasExactClass(u.VariadicValue.ClassName))return void function(e){if(e.getType().isCounted){const r=new s.U32Value(e.getItems().length);n.push(t.codec.encodeTopLevel(r))}for(const t of e.getItems())r(t)}(e);if(e.hasExactClass(o.CompositeValue.ClassName)){const t=e;for(const e of t.getItems())r(e);return}const i=t.codec.encodeTopLevel(e);n.push(i)}return n}}},6147:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentErrorContext=void 0;const r=n(2581);t.ArgumentErrorContext=class{constructor(e,t,n){this.endpointName=e,this.argumentIndex=t,this.parameterDefinition=n}throwError(e){throw new r.ErrInvalidArgument(`Error when converting arguments for endpoint (endpoint name: ${this.endpointName}, argument index: ${this.argumentIndex}, name: ${this.parameterDefinition.name}, type: ${this.parameterDefinition.type})\nNested error: ${e}`)}convertError(e,t){this.throwError(`Can't convert argument (argument: ${e}, type ${typeof e}), wanted type: ${t})`)}unhandledType(e,t){this.throwError(`Unhandled type (function: ${e}, type: ${t})`)}guardSameLength(e,t){(e=e||[]).length!=t.length&&this.throwError(`Incorrect composite type length: have ${e.length}, expected ${t.length} (argument: ${e})`)}guardHasField(e,t){t in(e=e||{})||this.throwError(`Struct argument does not contain a field named "${t}" (argument: ${JSON.stringify(e)})`)}}},8976:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Code=void 0;const r=n(2206);class i{constructor(e){this.hex=e}static fromBuffer(e){return new i(e.toString("hex"))}static fromHex(e){return new i(e)}toString(){return this.hex}valueOf(){return Buffer.from(this.hex,"hex")}computeHash(){const e=r(32).update(this.valueOf()).digest();return Buffer.from(e)}}t.Code=i},5225:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadata=void 0;class n{constructor(e=!0,t=!1,n=!1,r=!1){this.upgradeable=e,this.readable=t,this.payable=n,this.payableBySc=r}static fromBytes(e){return n.fromBuffer(Buffer.from(e))}static fromBuffer(e){if(e.length<this.codeMetadataLength)throw new Error("Buffer is too short.");const t=e[0],r=e[1],i=!!(t&n.ByteZero.Upgradeable),s=!!(t&n.ByteZero.Readable),a=!!(r&n.ByteOne.Payable),o=!!(r&n.ByteOne.PayableBySc);return new n(i,s,a,o)}toggleUpgradeable(e){this.upgradeable=e}toggleReadable(e){this.readable=e}togglePayable(e){this.payable=e}togglePayableBySc(e){this.payableBySc=e}toBuffer(){let e=0,t=0;return this.upgradeable&&(e|=n.ByteZero.Upgradeable),this.readable&&(e|=n.ByteZero.Readable),this.payable&&(t|=n.ByteOne.Payable),this.payableBySc&&(t|=n.ByteOne.PayableBySc),Buffer.from([e,t])}toString(){return this.toBuffer().toString("hex")}toJSON(){return{upgradeable:this.upgradeable,readable:this.readable,payable:this.payable,payableBySc:this.payableBySc}}equals(e){return this.upgradeable==e.upgradeable&&this.readable==e.readable&&this.payable==e.payable&&this.payableBySc==e.payableBySc}}t.CodeMetadata=n,n.codeMetadataLength=2,n.ByteZero={Upgradeable:1,Reserved2:2,Readable:4},n.ByteOne={Reserved1:1,Payable:2,PayableBySc:4}},7648:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressBinaryCodec=void 0;const r=n(236),i=n(2747);t.AddressBinaryCodec=class{decodeNested(e){let t=e.slice(0,32),n=new r.Address(t);return[new i.AddressValue(n),32]}decodeTopLevel(e){let[t,n]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf().pubkey()}encodeTopLevel(e){return e.valueOf().pubkey()}}},2739:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVecBinaryCodec=void 0;const r=n(2747);t.ArrayVecBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=t.length,i=t.getFirstTypeParameter(),s=[],a=0;for(let t=0;t<n;t++){let[t,n]=this.binaryCodec.decodeNested(e,i);s.push(t),a+=n,e=e.slice(n)}return[new r.ArrayVec(t,s),a]}decodeTopLevel(e,t){let[n,r]=this.decodeNested(e,t);return n}encodeNested(e){let t=[];for(const n of e.getItems()){let e=this.binaryCodec.encodeNested(n);t.push(e)}return Buffer.concat(t)}encodeTopLevel(e){return this.encodeNested(e)}}},675:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryCodecConstraints=t.BinaryCodec=void 0;const a=s(n(2581)),o=n(2747),u=n(1069),c=n(9603),l=n(8673),d=n(82),f=n(3551),h=n(6855),p=n(8954),g=n(2739);t.BinaryCodec=class{constructor(e=null){this.constraints=e||new m,this.optionCodec=new c.OptionValueBinaryCodec(this),this.listCodec=new d.ListBinaryCodec(this),this.arrayCodec=new g.ArrayVecBinaryCodec(this),this.primitiveCodec=new l.PrimitiveBinaryCodec(this),this.structCodec=new f.StructBinaryCodec(this),this.tupleCodec=new p.TupleBinaryCodec(this),this.enumCodec=new h.EnumBinaryCodec(this)}decodeTopLevel(e,t){return this.constraints.checkBufferLength(e),o.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeTopLevel(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeTopLevel(e,t),onArray:()=>this.arrayCodec.decodeTopLevel(e,t),onPrimitive:()=>this.primitiveCodec.decodeTopLevel(e,t),onStruct:()=>this.structCodec.decodeTopLevel(e,t),onTuple:()=>this.tupleCodec.decodeTopLevel(e,t),onEnum:()=>this.enumCodec.decodeTopLevel(e,t)})}decodeNested(e,t){this.constraints.checkBufferLength(e);let[n,r]=o.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeNested(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeNested(e,t),onArray:()=>this.arrayCodec.decodeNested(e,t),onPrimitive:()=>this.primitiveCodec.decodeNested(e,t),onStruct:()=>this.structCodec.decodeNested(e,t),onTuple:()=>this.tupleCodec.decodeNested(e,t),onEnum:()=>this.enumCodec.decodeNested(e,t)});return[n,r]}encodeNested(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),o.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeNested(e),onOption:()=>this.optionCodec.encodeNested(e),onList:()=>this.listCodec.encodeNested(e),onArray:()=>this.arrayCodec.encodeNested(e),onStruct:()=>this.structCodec.encodeNested(e),onTuple:()=>this.tupleCodec.encodeNested(e),onEnum:()=>this.enumCodec.encodeNested(e)})}encodeTopLevel(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),o.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeTopLevel(e),onOption:()=>this.optionCodec.encodeTopLevel(e),onList:()=>this.listCodec.encodeTopLevel(e),onArray:()=>this.arrayCodec.encodeTopLevel(e),onStruct:()=>this.structCodec.encodeTopLevel(e),onTuple:()=>this.tupleCodec.encodeTopLevel(e),onEnum:()=>this.enumCodec.encodeTopLevel(e)})}};class m{constructor(e){this.maxBufferLength=e?.maxBufferLength||256e3,this.maxListLength=e?.maxListLength||128e3}checkBufferLength(e){if(e.length>this.maxBufferLength)throw new a.ErrCodec(`Buffer too large: ${e.length} > ${this.maxBufferLength}`)}checkListLength(e){if(e>this.maxListLength)throw new a.ErrCodec(`List too large: ${e} > ${this.maxListLength}`)}}t.BinaryCodecConstraints=m},3232:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBigNumber=t.decodeString=t.decodeBool=t.decodeUnsignedNumber=void 0;const i=r(n(1594)),s=n(2747),a=new(n(675).BinaryCodec);t.decodeUnsignedNumber=function(e){let t=a.decodeTopLevel(e,new s.BigUIntType);return Number(t.valueOf())},t.decodeBool=function(e){let t=a.decodeTopLevel(e,new s.BooleanType);return Boolean(t.valueOf())},t.decodeString=function(e){let t=a.decodeTopLevel(e,new s.BytesType);return String(t.valueOf())},t.decodeBigNumber=function(e){let t=a.decodeTopLevel(e,new s.BigUIntType);return new i.default(t.valueOf())}},7380:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanBinaryCodec=void 0;const a=s(n(2581)),o=n(2747);class u{decodeNested(e){let t=e.readUInt8(0);return[new o.BooleanValue(t==u.TRUE),1]}decodeTopLevel(e){if(e.length>1)throw new a.ErrInvalidArgument("buffer should be of size <= 1");let t=e[0];return new o.BooleanValue(t==u.TRUE)}encodeNested(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([u.FALSE])}encodeTopLevel(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([])}}t.BooleanBinaryCodec=u,u.TRUE=1,u.FALSE=0},8843:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesBinaryCodec=void 0;const r=n(1392),i=n(2461);t.BytesBinaryCodec=class{decodeNested(e){let t=e.readUInt32BE(0),n=e.slice(i.SizeOfU32,i.SizeOfU32+t);return[new r.BytesValue(n),i.SizeOfU32+t]}decodeTopLevel(e){return new r.BytesValue(e)}encodeNested(e){let t=Buffer.alloc(i.SizeOfU32);return t.writeUInt32BE(e.getLength()),Buffer.concat([t,e.valueOf()])}encodeTopLevel(e){return e.valueOf()}}},2461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizeOfU32=void 0,t.SizeOfU32=4},6855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumBinaryCodec=void 0;const r=n(2747),i=n(9995);t.EnumBinaryCodec=class{constructor(e){this.binaryCodec=e,this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[n]=this.decodeNested(e,t);return n}decodeNested(e,t){let[n,i]=this.readDiscriminant(e);e=e.slice(i);let s=t.getVariantByDiscriminant(n),a=s.getFieldsDefinitions(),[o,u]=this.fieldsCodec.decodeNested(e,a);return[new r.EnumValue(t,s,o),i+u]}readDiscriminant(e){let[t,n]=this.binaryCodec.decodeNested(e,new r.U8Type);return[t.valueOf(),n]}encodeNested(e){let t=new r.U8Value(e.discriminant),n=this.binaryCodec.encodeNested(t),i=e.getFields(),s=this.fieldsCodec.encodeNested(i);return Buffer.concat([n,s])}encodeTopLevel(e){let t=e.getFields(),n=t.length>0,i=this.fieldsCodec.encodeNested(t),s=new r.U8Value(e.discriminant),a=n?this.binaryCodec.encodeNested(s):this.binaryCodec.encodeTopLevel(s);return Buffer.concat([a,i])}}},9995:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldsBinaryCodec=void 0;const r=n(2747);t.FieldsBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=[],i=0;for(const s of t){let[t,a]=this.binaryCodec.decodeNested(e,s.type);e=e.slice(a),i+=a;let o=new r.Field(t,s.name);n.push(o)}return[n,i]}encodeNested(e){let t=[];for(const n of e){let e=this.binaryCodec.encodeNested(n.value);t.push(e)}return Buffer.concat(t)}}},8831:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.H256BinaryCodec=void 0;const r=n(1038);t.H256BinaryCodec=class{decodeNested(e){let t=e.slice(0,32);return[new r.H256Value(t),32]}decodeTopLevel(e){let[t,n]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf()}encodeTopLevel(e){return e.valueOf()}}},9272:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(675),t),i(n(3232),t)},82:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListBinaryCodec=void 0;const r=n(2747),i=n(2461);t.ListBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let n=t.getFirstTypeParameter(),s=[],a=e.readUInt32BE(0);this.binaryCodec.constraints.checkListLength(a);let o=e,u=i.SizeOfU32;e=o.slice(u);for(let t=0;t<a;t++){let[t,r]=this.binaryCodec.decodeNested(e,n);s.push(t),u+=r,e=o.slice(u)}return[new r.List(t,s),u]}decodeTopLevel(e,t){let n=t.getFirstTypeParameter(),i=[],s=e,a=0;for(;e.length>0;){let[t,r]=this.binaryCodec.decodeNested(e,n);i.push(t),a+=r,e=s.slice(a),this.binaryCodec.constraints.checkListLength(i.length)}return new r.List(t,i)}encodeNested(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=Buffer.alloc(i.SizeOfU32);t.writeUInt32BE(e.getLength());let n=[];for(const t of e.getItems()){let e=this.binaryCodec.encodeNested(t);n.push(e)}return Buffer.concat([t,...n])}encodeTopLevel(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=[];for(const n of e.getItems()){let e=this.binaryCodec.encodeNested(n);t.push(e)}return Buffer.concat(t)}}},3157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NothingCodec=void 0;const r=n(2747);t.NothingCodec=class{decodeNested(){return[new r.NothingValue,0]}decodeTopLevel(){return new r.NothingValue}encodeNested(){return Buffer.from([])}encodeTopLevel(){return Buffer.from([])}}},62:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NumericalBinaryCodec=void 0;const i=r(n(1594)),s=n(2747),a=n(2461),o=n(7553);t.NumericalBinaryCodec=class{decodeNested(e,t){let n=0,r=t.sizeInBytes;r||(n=a.SizeOfU32,r=e.readUInt32BE(0));let i=e.slice(n,n+r);return[this.decodeTopLevel(i,t),r+n]}decodeTopLevel(e,t){let n=o.cloneBuffer(e);if(0==e.length)return new s.NumericalValue(t,new i.default(0));if(!t.withSign||o.isMsbZero(n)){let e=o.bufferToBigInt(n);return new s.NumericalValue(t,e)}o.flipBufferBitsInPlace(n);let r=o.bufferToBigInt(n).multipliedBy(new i.default(-1)).minus(new i.default(1));return new s.NumericalValue(t,r)}encodeNested(e){if(e.sizeInBytes)return this.encodeNestedFixedSize(e,e.sizeInBytes);let t=this.encodeTopLevel(e),n=Buffer.alloc(a.SizeOfU32);return n.writeUInt32BE(t.length),Buffer.concat([n,t])}encodeNestedFixedSize(e,t){if(e.value.isZero())return Buffer.alloc(t,0);if(!e.withSign){const n=o.bigIntToBuffer(e.value),r=Buffer.alloc(t-n.length,0);return Buffer.concat([r,n])}if(e.value.isPositive()){let n=o.bigIntToBuffer(e.value);o.isMsbOne(n)&&(n=o.prependByteToBuffer(n,0));const r=Buffer.alloc(t-n.length,0);return Buffer.concat([r,n])}let n=e.value.plus(new i.default(1)),r=o.bigIntToBuffer(n);o.flipBufferBitsInPlace(r),o.isMsbZero(r)&&(r=o.prependByteToBuffer(r,255));const s=Buffer.alloc(t-r.length,255);return Buffer.concat([s,r])}encodeTopLevel(e){let t=e.withSign;return e.value.isZero()?Buffer.alloc(0):t?this.encodePrimitive(e):o.bigIntToBuffer(e.value)}encodePrimitive(e){if(e.value.isPositive()){let t=o.bigIntToBuffer(e.value);return o.isMsbOne(t)&&(t=o.prependByteToBuffer(t,0)),t}let t=e.value.plus(new i.default(1)),n=o.bigIntToBuffer(t);return o.flipBufferBitsInPlace(n),o.isMsbZero(n)&&(n=o.prependByteToBuffer(n,255)),n}}},9603:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OptionValueBinaryCodec=void 0;const a=s(n(2581)),o=n(2747);t.OptionValueBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){if(0==e[0])return[o.OptionValue.newMissingTyped(t),1];if(1!=e[0])throw new a.ErrCodec("invalid buffer for optional value");let[n,r]=this.binaryCodec.decodeNested(e.slice(1),t);return[o.OptionValue.newProvided(n),r+1]}decodeTopLevel(e,t){if(0==e.length)return new o.OptionValue(t);if(1!=e[0])throw new a.ErrCodec("invalid buffer for optional value");let[n,r]=this.binaryCodec.decodeNested(e.slice(1),t);return new o.OptionValue(t,n)}encodeNested(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([0])}encodeTopLevel(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([])}}},8673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveBinaryCodec=void 0;const r=n(2747),i=n(7648),s=n(7380),a=n(62),o=n(8831),u=n(8843),c=n(6714),l=n(3157),d=n(1367);t.PrimitiveBinaryCodec=class{constructor(e){this.binaryCodec=e,this.booleanCodec=new s.BooleanBinaryCodec,this.numericalCodec=new a.NumericalBinaryCodec,this.addressCodec=new i.AddressBinaryCodec,this.h256Codec=new o.H256BinaryCodec,this.bytesCodec=new u.BytesBinaryCodec,this.stringCodec=new d.StringBinaryCodec,this.tokenIdentifierCodec=new c.TokenIdentifierCodec,this.nothingCodec=new l.NothingCodec}decodeNested(e,t){return r.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeNested(e),onNumerical:()=>this.numericalCodec.decodeNested(e,t),onAddress:()=>this.addressCodec.decodeNested(e),onBytes:()=>this.bytesCodec.decodeNested(e),onString:()=>this.stringCodec.decodeNested(e),onH256:()=>this.h256Codec.decodeNested(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeNested(e),onNothing:()=>this.nothingCodec.decodeNested()})}decodeTopLevel(e,t){return r.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeTopLevel(e),onNumerical:()=>this.numericalCodec.decodeTopLevel(e,t),onAddress:()=>this.addressCodec.decodeTopLevel(e),onBytes:()=>this.bytesCodec.decodeTopLevel(e),onString:()=>this.stringCodec.decodeTopLevel(e),onH256:()=>this.h256Codec.decodeTopLevel(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeTopLevel(e),onNothing:()=>this.nothingCodec.decodeTopLevel()})}encodeNested(e){return r.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeNested(e),onNumerical:()=>this.numericalCodec.encodeNested(e),onAddress:()=>this.addressCodec.encodeNested(e),onBytes:()=>this.bytesCodec.encodeNested(e),onString:()=>this.stringCodec.encodeNested(e),onH256:()=>this.h256Codec.encodeNested(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeNested(e),onNothing:()=>this.nothingCodec.encodeNested()})}encodeTopLevel(e){return r.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeTopLevel(e),onNumerical:()=>this.numericalCodec.encodeTopLevel(e),onAddress:()=>this.addressCodec.encodeTopLevel(e),onBytes:()=>this.bytesCodec.encodeTopLevel(e),onString:()=>this.stringCodec.encodeTopLevel(e),onH256:()=>this.h256Codec.encodeTopLevel(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeTopLevel(e),onNothing:()=>this.nothingCodec.encodeTopLevel()})}}},1367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringBinaryCodec=void 0;const r=n(2747),i=n(1392),s=n(8843);t.StringBinaryCodec=class{constructor(){this.bytesBinaryCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,n]=this.bytesBinaryCodec.decodeNested(e);return[new r.StringValue(t.valueOf().toString()),n]}decodeTopLevel(e){return new r.StringValue(e.toString())}encodeNested(e){let t=i.BytesValue.fromUTF8(e.valueOf());return this.bytesBinaryCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},3551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructBinaryCodec=void 0;const r=n(2747),i=n(9995);t.StructBinaryCodec=class{constructor(e){this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[n]=this.decodeNested(e,t);return n}decodeNested(e,t){let n=t.getFieldsDefinitions(),[i,s]=this.fieldsCodec.decodeNested(e,n);return[new r.Struct(t,i),s]}encodeNested(e){let t=e.getFields();return this.fieldsCodec.encodeNested(t)}encodeTopLevel(e){return this.encodeNested(e)}}},6714:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierCodec=void 0;const r=n(1392),i=n(3145),s=n(8843);t.TokenIdentifierCodec=class{constructor(){this.bytesCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,n]=this.bytesCodec.decodeNested(e);return[new i.TokenIdentifierValue(t.toString()),n]}decodeTopLevel(e){let t=this.bytesCodec.decodeTopLevel(e);return new i.TokenIdentifierValue(t.toString())}encodeNested(e){let t=r.BytesValue.fromUTF8(e.valueOf());return this.bytesCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},8954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBinaryCodec=void 0;const r=n(3551);t.TupleBinaryCodec=class{constructor(e){this.structCodec=new r.StructBinaryCodec(e)}decodeTopLevel(e,t){return this.structCodec.decodeTopLevel(e,t)}decodeNested(e,t){return this.structCodec.decodeNested(e,t)}encodeNested(e){return this.structCodec.encodeNested(e)}encodeTopLevel(e){return this.structCodec.encodeTopLevel(e)}}},7553:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.prependByteToBuffer=t.flipBufferBitsInPlace=t.getHexMagnitudeOfBigInt=t.bigIntToBuffer=t.bufferToBigInt=t.cloneBuffer=t.isMsbZero=t.isMsbOne=void 0;const i=r(n(1594)),s=n(9161);function a(e,t=0){return 1==e[t]>>7}function o(e){return(e=new i.default(e))?(e.isNegative()&&(e=e.multipliedBy(new i.default(-1))),s.numberToPaddedHex(e)):""}t.isMsbOne=a,t.isMsbZero=function(e,t=0){return!a(e,t)},t.cloneBuffer=function(e){let t=Buffer.alloc(e.length);return e.copy(t),t},t.bufferToBigInt=function(e){let t=e.toString("hex");return new i.default(`0x${t}`,16)},t.bigIntToBuffer=function(e){let t=o(e);return Buffer.from(t,"hex")},t.getHexMagnitudeOfBigInt=o,t.flipBufferBitsInPlace=function(e){for(let t=0;t<e.length;t++)e[t]=~e[t]},t.prependByteToBuffer=function(e,t){return Buffer.concat([Buffer.from([t]),e])}},3685:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFunction=void 0;const a=s(n(2581));class o{constructor(e){if(this.name=e,null==e)throw new a.ErrInvalidFunctionName}static none(){return new o("untitled")}toString(){return this.name}valueOf(){return this.name}}t.ContractFunction=o},661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(1157),t),i(n(8976),t),i(n(9272),t),i(n(5225),t),i(n(3685),t),i(n(1945),t),i(n(1146),t),i(n(662),t),i(n(670),t),i(n(7453),t),i(n(2528),t),i(n(3462),t),i(n(1998),t),i(n(7331),t),i(n(2747),t)},1945:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interaction=void 0;const r=n(236),i=n(1220),s=n(7353),a=n(5132),o=n(3102),u=n(1146),c=n(7453);t.Interaction=class{constructor(e,t,n){this.nonce=0,this.value="0",this.gasLimit=0,this.gasPrice=void 0,this.chainID="",this.querent=r.Address.empty(),this.sender=r.Address.empty(),this.version=s.TRANSACTION_VERSION_DEFAULT,this.contract=e,this.function=t,this.args=n,this.tokenTransfers=[]}getContractAddress(){return this.contract.getAddress()}getFunction(){return this.function}getEndpoint(){return this.contract.getEndpoint(this.function)}getArguments(){return this.args}getValue(){return this.value}getTokenTransfers(){return this.tokenTransfers}getGasLimit(){return this.gasLimit}getExplicitReceiver(){return this.explicitReceiver}buildTransaction(){i.Compatibility.guardAddressIsSetAndNonZero(this.sender,"'sender' of interaction","use interaction.withSender()");const e=new o.TransactionsFactoryConfig({chainID:this.chainID.valueOf()}),t=new o.SmartContractTransactionsFactory({config:e}).createTransactionForExecute({sender:this.sender,contract:this.contract.getAddress(),function:this.function.valueOf(),gasLimit:BigInt(this.gasLimit.valueOf()),arguments:this.args,nativeTransferAmount:BigInt(this.value.toString()),tokenTransfers:this.tokenTransfers});return t.chainID=this.chainID.valueOf(),t.nonce=BigInt(this.nonce.valueOf()),t.version=this.version,this.gasPrice&&(t.gasPrice=BigInt(this.gasPrice.valueOf())),t}buildQuery(){return new c.Query({address:this.contract.getAddress(),func:this.function,args:this.args,value:this.value,caller:this.querent})}withValue(e){return this.value=e,this}withSingleESDTTransfer(e){return this.tokenTransfers=[e].map((e=>new a.TokenTransfer(e))),this}withSingleESDTNFTTransfer(e){return this.tokenTransfers=[e].map((e=>new a.TokenTransfer(e))),this}withMultiESDTNFTTransfer(e){return this.tokenTransfers=e.map((e=>new a.TokenTransfer(e))),this}withGasLimit(e){return this.gasLimit=e,this}withGasPrice(e){return this.gasPrice=e,this}withNonce(e){return this.nonce=e,this}useThenIncrementNonceOf(e){return this.withNonce(e.getNonceThenIncrement())}withChainID(e){return this.chainID=e,this}withSender(e){return this.sender=e,this}withVersion(e){return this.version=e,this}withQuerent(e){return this.querent=e,this}withExplicitReceiver(e){return this.explicitReceiver=e,this}check(){return(new u.InteractionChecker).checkInteraction(this,this.getEndpoint()),this}}},1146:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionChecker=void 0;const o=s(n(2581)),u=a(n(1594));t.InteractionChecker=class{checkInteraction(e,t){this.checkPayable(e,t),this.checkArguments(e,t)}checkPayable(e,t){let n=!new u.default(e.getValue().toString()).isZero(),r=t.modifiers.isPayableInEGLD();if(n&&!r)throw new o.ErrContractInteraction("cannot send EGLD value to non-payable")}checkArguments(e,t){let n=t.input,r=e.getArguments(),i=n.length,s=r.length;if(i!=s)throw new o.ErrContractInteraction(`bad arguments, expected: ${i}, got: ${s}`);for(let e=0;e<i;e++){let t=n[e].type,i=r[e].getType();if(!t.isAssignableFrom(i))throw new o.ErrContractInteraction(`type mismatch at index ${e}, expected: ${t}, got: ${i}`)}}}},662:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},670:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSerializer=void 0;const i=r(n(1594)),s=n(236),a=n(2581),o=n(9161),u=n(6147),c=n(2747);!function(e){function t(e){let t=[...e].reverse(),n=e.length,r=e.length,i=!1;t.length>0&&t[0].type.getCardinality().isComposite()&&(r=1/0,i=!0);for(let e of t){if(e.type.getCardinality().isSingular())break;n-=1}return{min:n,max:r,variadic:i}}function n(e,t,s){return e&&c.isTyped(e)?e:t instanceof c.OptionType?function(e,t,r){if(null==e)return c.OptionValue.newMissing();let i=n(e,t.getFirstTypeParameter(),r);return c.OptionValue.newProvided(i)}(e,t,s):t instanceof c.OptionalType?function(e,t,r){if(null==e)return new c.OptionalValue(t);let i=n(e,t.getFirstTypeParameter(),r);return new c.OptionalValue(t,i)}(e,t,s):t instanceof c.VariadicType?function(e,t,r){if(t.isCounted)throw new a.ErrInvalidArgument('Counted variadic arguments must be explicitly typed. E.g. use "VariadicValue.fromItemsCounted()" or "new VariadicValue()"');null==e&&(e=[]),void 0===e.map&&r.convertError(e,"Variadic");let i=e.map((function(e){return n(e,t.getFirstTypeParameter(),r)}));return new c.VariadicValue(t,i)}(e,t,s):t instanceof c.CompositeType?function(e,t,r){let i=[],s=t.getTypeParameters();r.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(n(e[t],s[t],r));return new c.CompositeValue(t,i)}(e,t,s):t instanceof c.TupleType?function(e,t,r){let i=[];const s=t.getFieldsDefinitions();r.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(n(e[t],s[t].type,r));return c.Tuple.fromItems(i)}(e,t,s):t instanceof c.StructType?function(e,t,r){let i=[];const s=t.getFieldsDefinitions();for(let t=0;t<s.length;t++){const a=s[t].name;r.guardHasField(e,a);const o=n(e[a],s[t].type,r);i.push(new c.Field(o,a))}return new c.Struct(t,i)}(e,t,s):t instanceof c.ListType?function(e,t,r){void 0===e.map&&r.convertError(e,"List");let i=e.map((function(e){return n(e,t.getFirstTypeParameter(),r)}));return new c.List(t,i)}(e,t,s):t instanceof c.PrimitiveType?function(e,t,n){if(t instanceof c.NumericalType)return function(e,t,n){switch(t.constructor){case c.U8Type:return new c.U8Value(e);case c.I8Type:return new c.I8Value(e);case c.U16Type:return new c.U16Value(e);case c.I16Type:return new c.I16Value(e);case c.U32Type:return new c.U32Value(e);case c.I32Type:return new c.I32Value(e);case c.U64Type:return new c.U64Value(e);case c.I64Type:return new c.I64Value(e);case c.BigUIntType:return new c.BigUIntValue(e);case c.BigIntType:return new c.BigIntValue(e);default:n.unhandledType("convertNumericalType",t)}}(new i.default(e),t,n);if(t instanceof c.BytesType)return function(e,t){const n=e.valueOf();return void 0===e&&t.convertError(e,"BytesValue"),e instanceof Buffer?new c.BytesValue(e):"string"==typeof e?c.BytesValue.fromUTF8(e):n instanceof Buffer?new c.BytesValue(n):"number"==typeof n?c.BytesValue.fromHex(o.numberToPaddedHex(n)):void t.convertError(e,"BytesValue")}(e,n);if(t instanceof c.AddressType)return new c.AddressValue(r(e,n));if(t instanceof c.BooleanType){const t="true"===e.toString().toLowerCase()||"1"===e.toString();return new c.BooleanValue(t)}if(t instanceof c.TokenIdentifierType)return new c.TokenIdentifierValue(function(e,t){return void 0===e&&t.convertError(e,"Buffer"),e instanceof Buffer?e.toString():"string"==typeof e?e:void t.convertError(e,"Buffer")}(e,n));n.throwError(`(function: toPrimitive) unsupported type ${t}`)}(e,t,s):t instanceof c.EnumType?function(e,t,r){if("number"==typeof e)return c.EnumValue.fromDiscriminant(t,e);if("string"==typeof e)return c.EnumValue.fromName(t,e);if("object"==typeof e){r.guardHasField(e,"name");const i=t.getVariantByName(e.name);r.guardHasField(e,"fields");const s=e.fields,a=[],o=i.getFieldsDefinitions();for(let e=0;e<o.length;e++){const t=o[e].name;r.guardHasField(s,t);const i=n(s[t],o[e].type,r);a.push(new c.Field(i,t))}return new c.EnumValue(t,i,a)}r.throwError("(function: toEnumValue) unsupported native type "+typeof e)}(e,t,s):void s.throwError(`convertToTypedValue: unhandled type ${t}`)}function r(e,t){if(e.bech32)return e;if(e.getAddress)return e.getAddress();switch(e.constructor){case Buffer:case String:return new s.Address(e);default:t.convertError(e,"Address")}}e.nativeToTypedValues=function(e,r){(function(e,n){const{min:r,max:i}=t(n.input);if(!(r<=e.length&&e.length<=i))throw new a.ErrInvalidArgument(`Wrong number of arguments for endpoint ${n.name}: expected between ${r} and ${i} arguments, have ${e.length}`)})(e=e||[],r),function(e){const t=e.input[e.input.length-1];return t?.type instanceof c.VariadicType&&!t.type.isCounted}(r)&&(e=function(e,t){const n=t.input.length-1,r=e[n];if(r?.belongsToTypesystem){if(!r.hasClassOrSuperclass(c.VariadicValue.ClassName))throw new a.ErrInvalidArgument(`Wrong argument type for endpoint ${t.name}: typed value provided; expected variadic type, have ${r.getClassName()}`)}else e[n]=e.slice(n);return e}(e,r));let i=r.input,s=[];for(let t=0;t<i.length;t++){let a=i[t],o=new u.ArgumentErrorContext(r.name,t,a),c=n(e[t],a.type,o);s.push(c)}return s},e.getArgumentsCardinality=t,e.convertNativeToAddress=r}(t.NativeSerializer||(t.NativeSerializer={}))},7453:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Query=void 0;const r=n(236),i=n(1157);t.Query=class{constructor(e){this.caller=e.caller||r.Address.empty(),this.address=e.address,this.func=e.func,this.args=e.args||[],this.value=e.value||0}getEncodedArguments(){return(new i.ArgSerializer).valuesToStrings(this.args)}}},2528:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResultsParser=void 0;const r=n(2866),i=n(236),s=n(2581),a=n(6458),o=n(1157),u=n(3462);var c,l;!function(e){e.OnTransactionCompleted="completedTxEvent",e.OnSignalError="signalError",e.OnWriteLog="writeLog"}(c||(c={})),function(e){e.TooMuchGas="@too much gas provided for processing"}(l||(l={}));const d={argsSerializer:new o.ArgSerializer};t.ResultsParser=class{constructor(e){e={...d,...e},this.argsSerializer=e.argsSerializer}parseQueryResponse(e,t){let n=e.getReturnDataParts(),r=this.argsSerializer.buffersToValues(n,t.output);return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:r,firstValue:r[0],secondValue:r[1],thirdValue:r[2],lastValue:r[r.length-1]}}parseUntypedQueryResponse(e){return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:e.getReturnDataParts()}}parseOutcome(e,t){const n=this.parseUntypedOutcome(e);return this.parseOutcomeFromUntypedBundle(n,t)}parseOutcomeFromUntypedBundle(e,t){const n=this.argsSerializer.buffersToValues(e.values,t.output);return{returnCode:e.returnCode,returnMessage:e.returnMessage,values:n,firstValue:n[0],secondValue:n[1],thirdValue:n[2],lastValue:n[n.length-1]}}parseUntypedOutcome(e){let t,n=this.parseTransactionMetadata(e);if(t=this.createBundleOnSimpleMoveBalance(e),t)return a.Logger.trace("parseUntypedOutcome(): on simple move balance"),t;if(t=this.createBundleOnInvalidTransaction(e),t)return a.Logger.trace("parseUntypedOutcome(): on invalid transaction"),t;if(t=this.createBundleOnEasilyFoundResultWithReturnData(e.contractResults),t)return a.Logger.trace("parseUntypedOutcome(): on easily found result with return data"),t;if(t=this.createBundleOnSignalError(e.logs),t)return a.Logger.trace("parseUntypedOutcome(): on signal error"),t;if(t=this.createBundleOnTooMuchGasWarning(e.logs),t)return a.Logger.trace("parseUntypedOutcome(): on 'too much gas' warning"),t;if(t=this.createBundleOnWriteLogWhereFirstTopicEqualsAddress(e.logs,e.sender),t)return a.Logger.trace("parseUntypedOutcome(): on writelog with topics[0] == tx.sender"),t;if(t=this.createBundleWithCustomHeuristics(e,n),t)return a.Logger.trace("parseUntypedOutcome(): with custom heuristics"),t;if(t=this.createBundleWithFallbackHeuristics(e,n),t)return a.Logger.trace("parseUntypedOutcome(): with fallback heuristics"),t;throw new s.ErrCannotParseContractResults(`transaction ${e.hash.toString()}`)}parseTransactionMetadata(e){return(new r.TransactionDecoder).getTransactionMetadata({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:e.data.toString("base64"),value:e.value.toString()})}createBundleOnSimpleMoveBalance(e){let t=0==e.contractResults.items.length,n=0==e.logs.events.length;return t&&n?{returnCode:u.ReturnCode.None,returnMessage:u.ReturnCode.None.toString(),values:[]}:null}createBundleOnInvalidTransaction(e){return e.status.isInvalid()&&e.receipt.data?{returnCode:u.ReturnCode.OutOfFunds,returnMessage:e.receipt.data,values:[]}:null}createBundleOnEasilyFoundResultWithReturnData(e){let t=e.items.find((e=>0!=e.nonce.valueOf()&&e.data.startsWith("@")));if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.returnMessage||n.toString();return{returnCode:n,returnMessage:i,values:r}}createBundleOnSignalError(e){let t=e.findSingleOrNoneEvent(c.OnSignalError);if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||n.toString();return{returnCode:n,returnMessage:s,values:r}}createBundleOnTooMuchGasWarning(e){let t=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.toString().startsWith(l.TooMuchGas)))));if(!t)return null;let{returnCode:n,returnDataParts:r}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||n.toString();return{returnCode:n,returnMessage:s,values:r}}createBundleOnWriteLogWhereFirstTopicEqualsAddress(e,t){let n=new i.Address(t.bech32()).hex(),r=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.hex()==n))));if(!r)return null;let{returnCode:s,returnDataParts:a}=this.sliceDataFieldInParts(r.data),o=s.toString();return{returnCode:s,returnMessage:o,values:a}}createBundleWithCustomHeuristics(e,t){return null}createBundleWithFallbackHeuristics(e,t){let n=new i.Address(t.receiver);for(const t of e.contractResults.items){let r=t.logs.findSingleOrNoneEvent(c.OnWriteLog,(t=>{let r=t.address.bech32()==e.sender.bech32(),i=t.topics[0]?.hex()==n.hex();return r&&i}));if(r){let{returnCode:e,returnDataParts:t}=this.sliceDataFieldInParts(r.data),n=e.toString();return{returnCode:e,returnMessage:n,values:t}}}return null}sliceDataFieldInParts(e){let t=1;e.startsWith("ESDTTransfer")&&(t=3);let n=this.argsSerializer.stringToBuffers(e),r=n[t]||Buffer.from([]),i=n.slice(t+1);if(0==r.length)throw new s.ErrCannotParseContractResults("no return code");return{returnCode:u.ReturnCode.fromBuffer(r),returnDataParts:i}}parseEvent(e,t){const n=e.topics.map((e=>Buffer.from(e.valueOf()))).slice(1),r=e.dataPayload?.valueOf()||Buffer.from([]),i=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===i.length&&r.length&&i.push(Buffer.from(r)),this.doParseEvent({topics:n,dataItems:i,eventDefinition:t})}doParseEvent(e){const t={},n=e.eventDefinition.inputs.filter((e=>e.indexed)),r=this.argsSerializer.buffersToValues(e.topics,n);for(let e=0;e<n.length;e++)t[n[e].name]=r[e].valueOf();const i=e.eventDefinition.inputs.filter((e=>!e.indexed)),s=this.argsSerializer.buffersToValues(e.dataItems,i);for(let e=0;e<i.length;e++)t[i[e].name]=s[e].valueOf();return t}}},3462:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReturnCode=void 0;class n{constructor(e){this.text=e}static fromBuffer(e){let t=e.toString();return new n(t)}toString(){return this.text}valueOf(){return this.text}equals(e){return!!e&&this.text==e.text}isSuccess(){return this.equals(n.Ok)||this.equals(n.None)}}t.ReturnCode=n,n.None=new n(""),n.Ok=new n("ok"),n.FunctionNotFound=new n("function not found"),n.FunctionWrongSignature=new n("wrong signature for function"),n.ContractNotFound=new n("contract not found"),n.UserError=new n("user error"),n.OutOfGas=new n("out of gas"),n.AccountCollision=new n("account collision"),n.OutOfFunds=new n("out of funds"),n.CallStackOverFlow=new n("call stack overflow"),n.ContractInvalid=new n("contract invalid"),n.ExecutionFailed=new n("execution failed"),n.Unknown=new n("unknown")},1998:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContract=void 0;const r=n(236),i=n(1220),s=n(7353),a=n(2581),o=n(9712),u=n(3473),c=n(1069),l=n(5225),d=n(3685),f=n(1945),h=n(670),p=n(7453);t.SmartContract=class{constructor(e={}){this.address=r.Address.empty(),this.methodsExplicit={},this.methods={},this.address=e.address||r.Address.empty(),this.abi=e.abi,this.abi&&this.setupMethods()}setupMethods(){let e=this,t=this.getAbi();for(const n of t.getEndpoints()){let t=n.name;this.methodsExplicit[t]=function(n){let r=new d.ContractFunction(t);return new f.Interaction(e,r,n||[])},this.methods[t]=function(r){let i=new d.ContractFunction(t),s=h.NativeSerializer.nativeToTypedValues(r||[],n);return new f.Interaction(e,i,s||[])}}}setAddress(e){this.address=e}getAddress(){return this.address}getAbi(){return c.guardValueIsSet("abi",this.abi),this.abi}getEndpoint(e){return this.getAbi().getEndpoint(e)}deploy({deployer:e,code:t,codeMetadata:n,initArguments:r,value:a,gasLimit:c,gasPrice:l,chainID:d}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'deployer' of SmartContract.deploy()","pass the actual address to deploy()");const f=new u.TransactionsFactoryConfig({chainID:d.valueOf()}),h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}),p=Buffer.from(t.toString(),"hex"),g=this.getMetadataPropertiesAsObject(n),m=h.createTransactionForDeploy({sender:e,bytecode:p,gasLimit:BigInt(c.valueOf()),arguments:r,isUpgradeable:g.upgradeable,isReadable:g.readable,isPayable:g.payable,isPayableBySmartContract:g.payableBySc});return m.setChainID(d),m.setValue(a??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}getMetadataPropertiesAsObject(e){let t;return t=e?l.CodeMetadata.fromBytes(Buffer.from(e.toString(),"hex")):new l.CodeMetadata,t.toJSON()}upgrade({caller:e,code:t,codeMetadata:n,initArguments:r,value:a,gasLimit:c,gasPrice:l,chainID:d}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'caller' of SmartContract.upgrade()","pass the actual address to upgrade()"),this.ensureHasAddress();const f=new u.TransactionsFactoryConfig({chainID:d.valueOf()}),h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}),p=Uint8Array.from(Buffer.from(t.toString(),"hex")),g=this.getMetadataPropertiesAsObject(n),m=h.createTransactionForUpgrade({sender:e,contract:this.getAddress(),bytecode:p,gasLimit:BigInt(c.valueOf()),arguments:r,isUpgradeable:g.upgradeable,isReadable:g.readable,isPayable:g.payable,isPayableBySmartContract:g.payableBySc});return m.setChainID(d),m.setValue(a??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}call({func:e,args:t,value:n,gasLimit:r,receiver:a,gasPrice:c,chainID:l,caller:d}){i.Compatibility.guardAddressIsSetAndNonZero(d,"'caller' of SmartContract.call()","pass the actual address to call()"),this.ensureHasAddress();const f=new u.TransactionsFactoryConfig({chainID:l.valueOf()});t=t||[],n=n||0;const h=new o.SmartContractTransactionsFactory({config:f,abi:this.abi}).createTransactionForExecute({sender:d,contract:a||this.getAddress(),function:e.toString(),gasLimit:BigInt(r.valueOf()),arguments:t});return h.setChainID(l),h.setValue(n),h.setGasPrice(c??s.TRANSACTION_MIN_GAS_PRICE),h}createQuery({func:e,args:t,value:n,caller:r}){return this.ensureHasAddress(),new p.Query({address:this.getAddress(),func:e,args:t,value:n,caller:r})}ensureHasAddress(){if(!this.getAddress().bech32())throw new a.ErrContractHasNoAddress}static computeAddress(e,t){const n=r.Address.fromBech32(e.bech32());return(new r.AddressComputer).computeContractAddress(n,BigInt(t.valueOf()))}}},7331:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractCallPayloadBuilder=t.ContractUpgradePayloadBuilder=t.ContractDeployPayloadBuilder=void 0;const r=n(7353),i=n(3548),s=n(1069),a=n(1157);function o(e,t){let{argumentsString:n,count:r}=(new a.ArgSerializer).valuesToString(t);return 0==r?e:`${e}@${n}`}t.ContractDeployPayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=this.code.toString(),t=this.codeMetadata.toString(),n=`${e}@${r.WasmVirtualMachine}@${t}`;return n=o(n,this.arguments),new i.TransactionPayload(n)}},t.ContractUpgradePayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=`upgradeContract@${this.code.toString()}@${this.codeMetadata.toString()}`;return e=o(e,this.arguments),new i.TransactionPayload(e)}},t.ContractCallPayloadBuilder=class{constructor(){this.contractFunction=null,this.arguments=[]}setFunction(e){return this.contractFunction=e,this}addArg(e){return this.arguments.push(e),this}setArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("calledFunction",this.contractFunction);let e=this.contractFunction.toString();return e=o(e,this.arguments),new i.TransactionPayload(e)}}},4966:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbiRegistry=void 0;const a=s(n(2581)),o=n(1069),u=n(5730),c=n(1414),l=n(4143),d=n(7586),f=n(7654);class h{constructor(e){this.endpoints=[],this.customTypes=[],this.events=[],this.name=e.name,this.constructorDefinition=e.constructorDefinition,this.upgradeConstructorDefinition=e.upgradeConstructorDefinition,this.endpoints=e.endpoints,this.customTypes=e.customTypes,this.events=e.events||[]}static create(e){const t=e.name||"?",n=e.constructor||{},r=e.upgradeConstructor||{},i=e.endpoints||[],s=e.types||{},o=e.events||[],f=u.EndpointDefinition.fromJSON({name:"constructor",...n}),p=u.EndpointDefinition.fromJSON({name:"upgradeConstructor",...r}),g=i.map((e=>u.EndpointDefinition.fromJSON(e))),m=[];for(const e in s){const t=s[e];if("struct"==t.type)m.push(d.StructType.fromJSON({name:e,fields:t.fields}));else{if("enum"!=t.type&&"explicit-enum"!=t.type)throw new a.ErrTypingSystem(`Cannot handle custom type: ${e}`);m.push(c.EnumType.fromJSON({name:e,variants:t.variants}))}}const y=o.map((e=>l.EventDefinition.fromJSON(e)));return new h({name:t,constructorDefinition:f,upgradeConstructorDefinition:p,endpoints:g,customTypes:m,events:y}).remapToKnownTypes()}getCustomType(e){const t=this.customTypes.find((t=>t.getName()==e));return o.guardValueIsSetWithMessage(`custom type [${e}] not found`,t),t}getStruct(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(d.StructType.ClassName)));return o.guardValueIsSetWithMessage(`struct [${e}] not found`,t),t}getStructs(e){return e.map((e=>this.getStruct(e)))}getEnum(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(c.EnumType.ClassName)));return o.guardValueIsSetWithMessage(`enum [${e}] not found`,t),t}getEnums(e){return e.map((e=>this.getEnum(e)))}getEndpoints(){return this.endpoints}getEndpoint(e){const t=this.endpoints.find((t=>t.name==e));return o.guardValueIsSetWithMessage(`endpoint [${e}] not found`,t),t}getEvent(e){const t=this.events.find((t=>t.identifier==e));return o.guardValueIsSetWithMessage(`event [${e}] not found`,t),t}remapToKnownTypes(){const e=new f.TypeMapper([]),t=[];for(const n of this.customTypes)this.mapCustomTypeDepthFirst(n,this.customTypes,e,t);if(this.customTypes.length!=t.length)throw new a.ErrTypingSystem("Did not re-map all custom types");const n=p(this.constructorDefinition,e),r=this.upgradeConstructorDefinition?p(this.upgradeConstructorDefinition,e):void 0,i=[];for(const t of this.endpoints)i.push(p(t,e));const s=this.events.map((t=>function(e,t){const n=e.inputs.map((e=>new l.EventTopicDefinition({name:e.name,type:t.mapType(e.type),indexed:e.indexed})));return new l.EventDefinition(e.identifier,n)}(t,e)));return new h({name:this.name,constructorDefinition:n,upgradeConstructorDefinition:r,endpoints:i,customTypes:t,events:s})}mapCustomTypeDepthFirst(e,t,n,r){if(r.findIndex((t=>t.getName()==e.getName()))>=0)return;for(const i of e.getNamesOfDependencies()){const e=t.find((e=>e.getName()==i));e&&this.mapCustomTypeDepthFirst(e,t,n,r)}const i=n.mapType(e);r.push(i)}}function p(e,t){const n=e.input.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type)))),r=e.output.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type))));return new u.EndpointDefinition(e.name,n,r,e.modifiers)}t.AbiRegistry=h},8551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressValue=t.AddressType=void 0;const r=n(236),i=n(5626);class s extends i.PrimitiveType{constructor(){super("Address")}getClassName(){return s.ClassName}}t.AddressType=s,s.ClassName="AddressType";class a extends i.PrimitiveValue{constructor(e){super(new s),this.value=new r.Address(e.bech32())}getClassName(){return a.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.AddressValue=a,a.ClassName="AddressValue"},1055:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalValue=t.OptionalType=void 0;const r=n(1069),i=n(5626);class s extends i.Type{constructor(e){super("Optional",[e],i.TypeCardinality.variable(1))}getClassName(){return s.ClassName}isAssignableFrom(e){if(!e.hasExactClass(s.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),n=e.getFirstTypeParameter().hasExactClass(i.NullType.ClassName);return t||n}}t.OptionalType=s,s.ClassName="OptionalType";class a extends i.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return a.ClassName}static newMissing(){let e=new s(new i.NullType);return new a(e)}isSet(){return!!this.value}getTypedValue(){return r.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionalValue=a,a.ClassName="OptionalValue"},3979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanValue=t.BooleanType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("bool")}getClassName(){return i.ClassName}}t.BooleanType=i,i.ClassName="BooleanType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value===e.value}isTrue(){return!0===this.value}isFalse(){return!this.isTrue()}valueOf(){return this.value}}t.BooleanValue=s,s.ClassName="BooleanValue"},1392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesValue=t.BytesType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("bytes")}getClassName(){return i.ClassName}}t.BytesType=i,i.ClassName="BytesType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){let t=Buffer.from(e,"utf-8");return new s(t)}static fromHex(e){let t=Buffer.from(e,"hex");return new s(t)}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value.equals(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.BytesValue=s,s.ClassName="BytesValue"},1847:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadataValue=t.CodeMetadataType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("CodeMetadata")}}t.CodeMetadataType=i;class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.CodeMetadataValue=s},902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionOfTypedValues=void 0,t.CollectionOfTypedValues=class{constructor(e){this.items=e}getLength(){return this.items.length}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getLength()!=e.getLength())return!1;for(let t=0;t<this.getLength();t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}},7472:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeValue=t.CompositeType=void 0;const r=n(1069),i=n(5626);class s extends i.Type{constructor(...e){super("Composite",e,i.TypeCardinality.variable(e.length))}getClassName(){return s.ClassName}}t.CompositeType=s,s.ClassName="CompositeType";class a extends i.TypedValue{constructor(e,t){super(e),r.guardLength(t,e.getTypeParameters().length),this.items=t}getClassName(){return a.ClassName}static fromItems(...e){let t=e.map((e=>e.getType())),n=new s(...t);return new a(n,e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e?.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}t.CompositeValue=a,a.ClassName="CompositeValue"},5730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndpointParameterDefinition=t.EndpointModifiers=t.EndpointDefinition=void 0;const r=n(7966);class i{constructor(e,t,n,r){this.input=[],this.output=[],this.name=e,this.input=t||[],this.output=n||[],this.modifiers=r}isConstructor(){return"constructor"==this.name}static fromJSON(e){e.name=null==e.name?"?":e.name,e.onlyOwner=e.onlyOwner||!1,e.payableInTokens=e.payableInTokens||[],e.inputs=e.inputs||[],e.outputs=e.outputs||[];let t=e.inputs.map((e=>a.fromJSON(e))),n=e.outputs.map((e=>a.fromJSON(e))),r=new s(e.mutability,e.payableInTokens,e.onlyOwner);return new i(e.name,t,n,r)}}t.EndpointDefinition=i;class s{constructor(e,t,n){this.mutability=e||"",this.payableInTokens=t||[],this.onlyOwner=n||!1}isPayableInEGLD(){return this.isPayableInToken("EGLD")}isPayableInToken(e){return!!this.payableInTokens.includes(e)||!this.payableInTokens.includes(`!${e}`)&&!!this.payableInTokens.includes("*")}isPayable(){return 0!=this.payableInTokens.length}isReadonly(){return"readonly"==this.mutability}isOnlyOwner(){return this.onlyOwner}}t.EndpointModifiers=s;class a{constructor(e,t,n){this.name=e,this.description=t,this.type=n}static fromJSON(e){let t=(new r.TypeExpressionParser).parse(e.type);return new a(e.name||"?",e.description||"N / A",t)}}t.EndpointParameterDefinition=a},1414:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnumValue=t.EnumVariantDefinition=t.EnumType=void 0;const r=n(2581),i=n(1069),s=n(5766),a=n(5626);class o extends a.CustomType{constructor(e,t){super(e),this.variants=[],this.variants=t}getClassName(){return o.ClassName}static fromJSON(e){const t=o.assignMissingDiscriminants(e.variants||[]).map((e=>u.fromJSON(e)));return new o(e.name,t)}static assignMissingDiscriminants(e){return e.every((e=>null==e.discriminant))?e.map(((e,t)=>({...e,discriminant:t}))):e}getVariantByDiscriminant(e){let t=this.variants.find((t=>t.discriminant==e));return i.guardValueIsSet(`variant by discriminant (${e})`,t),t}getVariantByName(e){let t=this.variants.find((t=>t.name==e));return i.guardValueIsSet(`variant by name (${e})`,t),t}getNamesOfDependencies(){const e=[];for(const t of this.variants)e.push(...t.getNamesOfDependencies());return[...new Set(e)]}}t.EnumType=o,o.ClassName="EnumType";class u{constructor(e,t,n=[]){this.fieldsDefinitions=[],i.guardTrue(t<256,"discriminant for simple enum should be less than 256"),this.name=e,this.discriminant=t,this.fieldsDefinitions=n}static fromJSON(e){let t=(e.fields||[]).map((e=>s.FieldDefinition.fromJSON(e)));return new u(e.name,e.discriminant,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return s.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.EnumVariantDefinition=u;class c extends a.TypedValue{constructor(e,t,n){super(e),this.fields=[],this.name=t.name,this.discriminant=t.discriminant,this.fields=n,this.fieldsByName=new Map(n.map((e=>[e.name,e])));let r=t.getFieldsDefinitions();s.Fields.checkTyping(this.fields,r)}getClassName(){return c.ClassName}static fromName(e,t){let n=e.getVariantByName(t);return new c(e,n,[])}static fromDiscriminant(e,t){let n=e.getVariantByDiscriminant(t);return new c(e,n,[])}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),n=e.getFields();const r=this.name==e.name,i=this.discriminant==e.discriminant,a=s.Fields.equals(t,n);return r&&i&&a}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new r.ErrMissingFieldOnEnum(e,this.getType().getName())}valueOf(){let e={name:this.name,fields:[]};return this.fields.forEach(((t,n)=>e.fields[n]=t.value.valueOf())),e}}t.EnumValue=c,c.ClassName="EnumValue"},4143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventTopicDefinition=t.EventDefinition=void 0;const r=n(7966);class i{constructor(e,t){this.inputs=[],this.identifier=e,this.inputs=t||[]}static fromJSON(e){e.identifier=null==e.identifier?"?":e.identifier,e.inputs=e.inputs||[];const t=e.inputs.map((e=>s.fromJSON(e)));return new i(e.identifier,t)}}t.EventDefinition=i;class s{constructor(e){this.name=e.name,this.type=e.type,this.indexed=e.indexed}static fromJSON(e){const t=(new r.TypeExpressionParser).parse(e.type);return new s({name:e.name||"?",type:t,indexed:e.indexed})}}t.EventTopicDefinition=s},8689:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createListOfTokenIdentifiers=t.createListOfAddresses=void 0;const r=n(8551),i=n(926),s=n(3145);t.createListOfAddresses=function(e){let t=e.map((e=>new r.AddressValue(e)));return i.List.fromItems(t)},t.createListOfTokenIdentifiers=function(e){let t=e.map((e=>new s.TokenIdentifierValue(e)));return i.List.fromItems(t)}},5766:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Fields=t.Field=t.FieldDefinition=void 0;const a=s(n(2581)),o=n(7966);class u{constructor(e,t,n){this.name=e,this.description=t,this.type=n}static fromJSON(e){let t=(new o.TypeExpressionParser).parse(e.type);return new u(e.name,e.description,t)}}t.FieldDefinition=u,t.Field=class{constructor(e,t=""){this.value=e,this.name=t}checkTyping(e){const t=this.value.getType();if(!t.equals(e.type))throw new a.ErrTypingSystem(`check type of field "${e.name}; expected: ${e.type}, actual: ${t}"`);if(this.name!=e.name)throw new a.ErrTypingSystem(`check name of field "${e.name}"`)}equals(e){return this.name==e.name&&this.value.equals(e.value)}},t.Fields=class{static checkTyping(e,t){if(e.length!=t.length)throw new a.ErrTypingSystem("fields length vs. field definitions length");for(let n=0;n<e.length;n++){let r=e[n],i=t[n];r.checkTyping(i)}}static equals(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(!r.equals(i))return!1}return!0}static getNamesOfTypeDependencies(e){const t=[];for(const n of e)t.push(n.type.getName()),t.push(...n.type.getNamesOfDependencies());return[...new Set(t)]}}},926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.List=t.OptionValue=t.ListType=t.OptionType=void 0;const r=n(1069),i=n(902),s=n(5626);class a extends s.Type{constructor(e){super("Option",[e])}getClassName(){return a.ClassName}isAssignableFrom(e){if(!e.hasExactClass(a.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),n=e.getFirstTypeParameter().hasExactClass(s.NullType.ClassName);return t||n}}t.OptionType=a,a.ClassName="OptionType";class o extends s.Type{constructor(e){super("List",[e])}getClassName(){return o.ClassName}}t.ListType=o,o.ClassName="ListType";class u extends s.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return u.ClassName}static newMissing(){let e=new a(new s.NullType);return new u(e)}static newMissingTyped(e){return new u(new a(e))}static newProvided(e){let t=new a(e.getType());return new u(t,e)}isSet(){return!!this.value}getTypedValue(){return r.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionValue=u,u.ClassName="OptionValue";class c extends s.TypedValue{constructor(e,t){super(e),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return c.ClassName}static fromItems(e){if(0==e.length)return new c(new s.TypePlaceholder,[]);let t=e[0].getType(),n=new o(t);return new c(n,e)}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.List=c,c.ClassName="List"},177:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVec=t.ArrayVecType=void 0;const r=n(1069),i=n(902),s=n(5626);class a extends s.Type{constructor(e,t){super("Array",[t]),r.guardTrue(e>0,"array length > 0"),this.length=e}getClassName(){return a.ClassName}}t.ArrayVecType=a,a.ClassName="ArrayVecType";class o extends s.TypedValue{constructor(e,t){super(e),r.guardLength(t,e.length),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return o.ClassName}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.ArrayVec=o,o.ClassName="ArrayVec"},1038:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.H256Value=t.H256Type=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("H256")}getClassName(){return i.ClassName}}t.H256Type=i,i.ClassName="H256Type";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.H256Value=s,s.ClassName="H256Value"},2747:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(4966),t),i(n(8551),t),i(n(1055),t),i(n(3979),t),i(n(1392),t),i(n(7472),t),i(n(5730),t),i(n(1414),t),i(n(8689),t),i(n(5766),t),i(n(926),t),i(n(177),t),i(n(1038),t),i(n(5648),t),i(n(1782),t),i(n(4473),t),i(n(6514),t),i(n(7586),t),i(n(3145),t),i(n(1025),t),i(n(7966),t),i(n(7654),t),i(n(5626),t),i(n(6054),t)},5648:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.onPrimitiveTypeSelect=t.onPrimitiveValueSelect=t.onTypedValueSelect=t.onTypeSelect=void 0;const a=s(n(2581)),o=n(8551),u=n(3979),c=n(1392),l=n(1414),d=n(926),f=n(1038),h=n(4473),p=n(1782),g=n(7586),m=n(3145),y=n(1025),A=n(5626),b=n(177),T=n(6514);t.onTypeSelect=function(e,t){if(e.hasExactClass(d.OptionType.ClassName))return t.onOption();if(e.hasExactClass(d.ListType.ClassName))return t.onList();if(e.hasExactClass(b.ArrayVecType.ClassName))return t.onArray();if(e.hasClassOrSuperclass(A.PrimitiveType.ClassName))return t.onPrimitive();if(e.hasExactClass(g.StructType.ClassName))return t.onStruct();if(e.hasExactClass(y.TupleType.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumType.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`type isn't known: ${e}`)},t.onTypedValueSelect=function(e,t){if(e.hasClassOrSuperclass(A.PrimitiveValue.ClassName))return t.onPrimitive();if(e.hasExactClass(d.OptionValue.ClassName))return t.onOption();if(e.hasExactClass(d.List.ClassName))return t.onList();if(e.hasExactClass(b.ArrayVec.ClassName))return t.onArray();if(e.hasExactClass(g.Struct.ClassName))return t.onStruct();if(e.hasExactClass(y.Tuple.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumValue.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`value isn't typed: ${e}`)},t.onPrimitiveValueSelect=function(e,t){if(e.hasExactClass(u.BooleanValue.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalValue.ClassName))return t.onNumerical();if(e.hasExactClass(o.AddressValue.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesValue.ClassName))return t.onBytes();if(e.hasExactClass(T.StringValue.ClassName))return t.onString();if(e.hasExactClass(f.H256Value.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierValue.ClassName))return t.onTypeIdentifier();if(e.hasExactClass(p.NothingValue.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`value isn't a primitive: ${e.getType()}`)},t.onPrimitiveTypeSelect=function(e,t){if(e.hasExactClass(u.BooleanType.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalType.ClassName))return t.onNumerical();if(e.hasExactClass(o.AddressType.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesType.ClassName))return t.onBytes();if(e.hasExactClass(T.StringType.ClassName))return t.onString();if(e.hasExactClass(f.H256Type.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierType.ClassName))return t.onTokenIndetifier();if(e.hasExactClass(p.NothingType.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new a.ErrTypingSystem(`type isn't a known primitive: ${e}`)}},1782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NothingValue=t.NothingType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("nothing")}getClassName(){return i.ClassName}}t.NothingType=i,i.ClassName="NothingType";class s extends r.PrimitiveValue{constructor(){super(new i)}getClassName(){return s.ClassName}equals(e){return!1}valueOf(){return{}}}t.NothingValue=s,s.ClassName="NothingValue"},4473:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BigIntValue=t.BigUIntValue=t.I64Value=t.U64Value=t.I32Value=t.U32Value=t.I16Value=t.U16Value=t.I8Value=t.U8Value=t.NumericalValue=t.BigIntType=t.BigUIntType=t.I64Type=t.U64Type=t.I32Type=t.U32Type=t.I16Type=t.U16Type=t.I8Type=t.U8Type=t.NumericalType=void 0;const o=a(n(1594)),u=s(n(2581)),c=n(5626);class l extends c.PrimitiveType{constructor(e,t,n){super(e),this.sizeInBytes=t,this.withSign=n}getClassName(){return l.ClassName}hasFixedSize(){return!!this.sizeInBytes}hasArbitrarySize(){return!this.hasFixedSize()}}t.NumericalType=l,l.ClassName="NumericalType";class d extends l{constructor(){super("u8",1,!1)}getClassName(){return d.ClassName}}t.U8Type=d,d.ClassName="U8Type";class f extends l{constructor(){super("i8",1,!0)}getClassName(){return f.ClassName}}t.I8Type=f,f.ClassName="I8Type";class h extends l{constructor(){super("u16",2,!1)}getClassName(){return h.ClassName}}t.U16Type=h,h.ClassName="U16Type";class p extends l{constructor(){super("i16",2,!0)}getClassName(){return p.ClassName}}t.I16Type=p,p.ClassName="I16Type";class g extends l{constructor(){super("u32",4,!1)}getClassName(){return g.ClassName}}t.U32Type=g,g.ClassName="U32Type";class m extends l{constructor(){super("i32",4,!0)}getClassName(){return m.ClassName}}t.I32Type=m,m.ClassName="I32Type";class y extends l{constructor(){super("u64",8,!1)}getClassName(){return y.ClassName}}t.U64Type=y,y.ClassName="U64Type";class A extends l{constructor(){super("i64",8,!0)}getClassName(){return A.ClassName}}t.I64Type=A,A.ClassName="I64Type";class b extends l{constructor(){super("BigUint",0,!1)}getClassName(){return b.ClassName}}t.BigUIntType=b,b.ClassName="BigUIntType";class T extends l{constructor(){super("Bigint",0,!0)}getClassName(){return T.ClassName}}t.BigIntType=T,T.ClassName="BigIntType";class w extends c.PrimitiveValue{constructor(e,t){if(super(e),"bigint"==typeof t&&(t=t.toString()),this.value=new o.default(t),this.sizeInBytes=e.sizeInBytes,this.withSign=e.withSign,this.value.isNaN())throw new u.ErrInvalidArgument(`not a number: ${t}`);if(!this.withSign&&this.value.isNegative())throw new u.ErrInvalidArgument(`negative, but type is unsigned: ${t}`)}getClassName(){return w.ClassName}equals(e){return this.value.isEqualTo(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.NumericalValue=w,w.ClassName="NumericalValue";class v extends w{constructor(e){super(new d,e)}getClassName(){return v.ClassName}}t.U8Value=v,v.ClassName="U8Value";class I extends w{constructor(e){super(new f,e)}getClassName(){return I.ClassName}}t.I8Value=I,I.ClassName="I8Value";class S extends w{constructor(e){super(new h,e)}getClassName(){return S.ClassName}}t.U16Value=S,S.ClassName="U16Value";class E extends w{constructor(e){super(new p,e)}getClassName(){return E.ClassName}}t.I16Value=E,E.ClassName="I16Value";class C extends w{constructor(e){super(new g,e)}getClassName(){return C.ClassName}}t.U32Value=C,C.ClassName="U32Value";class _ extends w{constructor(e){super(new m,e)}getClassName(){return _.ClassName}}t.I32Value=_,_.ClassName="I32Value";class B extends w{constructor(e){super(new y,e)}getClassName(){return B.ClassName}}t.U64Value=B,B.ClassName="U64Value";class O extends w{constructor(e){super(new A,e)}getClassName(){return O.ClassName}}t.I64Value=O,O.ClassName="I64Value";class N extends w{constructor(e){super(new b,e)}getClassName(){return N.ClassName}}t.BigUIntValue=N,N.ClassName="BigUIntValue";class x extends w{constructor(e){super(new T,e)}getClassName(){return x.ClassName}}t.BigIntValue=x,x.ClassName="BigIntValue"},6514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringValue=t.StringType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("utf-8 string")}getClassName(){return i.ClassName}}t.StringType=i,i.ClassName="StringType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){return new s(e)}static fromHex(e){let t=Buffer.from(e,"hex").toString();return new s(t)}getLength(){return this.value.length}equals(e){return this.value===e.value}valueOf(){return this.value}}t.StringValue=s,s.ClassName="StringValue"},7586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Struct=t.StructType=void 0;const r=n(2581),i=n(5766),s=n(5626);class a extends s.CustomType{constructor(e,t){super(e),this.fieldsDefinitions=[],this.fieldsDefinitions=t}getClassName(){return a.ClassName}static fromJSON(e){let t=(e.fields||[]).map((e=>i.FieldDefinition.fromJSON(e)));return new a(e.name,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return i.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.StructType=a,a.ClassName="StructType";class o extends s.TypedValue{constructor(e,t){super(e),this.fields=t,this.fieldsByName=new Map(t.map((e=>[e.name,e]))),this.checkTyping()}getClassName(){return o.ClassName}checkTyping(){let e=this.getType().getFieldsDefinitions();i.Fields.checkTyping(this.fields,e)}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new r.ErrMissingFieldOnStruct(e,this.getType().getName())}valueOf(){let e={};for(const t of this.fields)e[t.name]=t.value.valueOf();return e}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),n=e.getFields();return i.Fields.equals(t,n)}}t.Struct=o,o.ClassName="Struct"},3145:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierValue=t.TokenIdentifierType=void 0;const r=n(5626);class i extends r.PrimitiveType{constructor(){super("TokenIdentifier")}getClassName(){return i.ClassName}}t.TokenIdentifierType=i,i.ClassName="TokenIdentifierType";class s extends r.PrimitiveValue{constructor(e){super(new i),this.value=e}static egld(){return new s("EGLD")}static esdtTokenIdentifier(e){return new s(e)}getClassName(){return s.ClassName}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value==e.value}valueOf(){return this.value}toString(){return this.value.toString()}}t.TokenIdentifierValue=s,s.ClassName="TokenIdentifierValue"},1025:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Tuple=t.TupleType=void 0;const a=s(n(2581)),o=n(5766),u=n(7586);class c extends u.StructType{constructor(...e){super(c.prepareName(e),c.prepareFieldDefinitions(e))}getClassName(){return c.ClassName}static prepareName(e){return`tuple<${e.map((e=>e.toString())).join(", ")}>`}static prepareFieldDefinitions(e){return e.map(((e,t)=>new o.FieldDefinition(l(t),"anonymous tuple field",e)))}}function l(e){return`field${e}`}t.TupleType=c,c.ClassName="TupleType";class d extends u.Struct{constructor(e,t){super(e,t)}getClassName(){return d.ClassName}static fromItems(e){if(e.length<1)throw new a.ErrTypingSystem("bad tuple items");let t=e.map((e=>e.getType())),n=new c(...t),r=e.map(((e,t)=>new o.Field(e,l(t))));return new d(n,r)}}t.Tuple=d,d.ClassName="Tuple"},7966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeExpressionParser=void 0;const r=n(9132),i=n(2581),s=n(5626);t.TypeExpressionParser=class{constructor(){this.backingTypeFormulaParser=new r.TypeFormulaParser}parse(e){try{return this.doParse(e)}catch(t){throw new i.ErrTypingSystem(`Failed to parse type expression: ${e}. Error: ${t}`)}}doParse(e){const t=this.backingTypeFormulaParser.parseExpression(e);return this.typeFormulaToType(t)}typeFormulaToType(e){const t=e.typeParameters.map((e=>this.typeFormulaToType(e)));return new s.Type(e.name,t)}}},7654:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeMapper=void 0;const a=s(n(2581)),o=n(8551),u=n(1055),c=n(3979),l=n(1392),d=n(1847),f=n(7472),h=n(1414),p=n(5766),g=n(926),m=n(177),y=n(1038),A=n(1782),b=n(4473),T=n(6514),w=n(7586),v=n(3145),I=n(1025),S=n(6054);t.TypeMapper=class{constructor(e=[]){this.openTypesFactories=new Map([["Option",(...e)=>new g.OptionType(e[0])],["List",(...e)=>new g.ListType(e[0])],["VarArgs",(...e)=>new S.VariadicType(e[0])],["MultiResultVec",(...e)=>new S.VariadicType(e[0])],["variadic",(...e)=>new S.VariadicType(e[0])],["counted-variadic",(...e)=>new S.VariadicType(e[0],!0)],["OptionalArg",(...e)=>new u.OptionalType(e[0])],["optional",(...e)=>new u.OptionalType(e[0])],["OptionalResult",(...e)=>new u.OptionalType(e[0])],["multi",(...e)=>new f.CompositeType(...e)],["MultiArg",(...e)=>new f.CompositeType(...e)],["MultiResult",(...e)=>new f.CompositeType(...e)],["multi",(...e)=>new f.CompositeType(...e)],["tuple",(...e)=>new I.TupleType(...e)],["tuple2",(...e)=>new I.TupleType(...e)],["tuple3",(...e)=>new I.TupleType(...e)],["tuple4",(...e)=>new I.TupleType(...e)],["tuple5",(...e)=>new I.TupleType(...e)],["tuple6",(...e)=>new I.TupleType(...e)],["tuple7",(...e)=>new I.TupleType(...e)],["tuple8",(...e)=>new I.TupleType(...e)],["array2",(...e)=>new m.ArrayVecType(2,e[0])],["array8",(...e)=>new m.ArrayVecType(8,e[0])],["array16",(...e)=>new m.ArrayVecType(16,e[0])],["array20",(...e)=>new m.ArrayVecType(20,e[0])],["array32",(...e)=>new m.ArrayVecType(32,e[0])],["array46",(...e)=>new m.ArrayVecType(46,e[0])],["array48",(...e)=>new m.ArrayVecType(48,e[0])],["array64",(...e)=>new m.ArrayVecType(64,e[0])],["array128",(...e)=>new m.ArrayVecType(128,e[0])],["array256",(...e)=>new m.ArrayVecType(256,e[0])]]),this.closedTypesMap=new Map([["u8",new b.U8Type],["u16",new b.U16Type],["u32",new b.U32Type],["u64",new b.U64Type],["U64",new b.U64Type],["BigUint",new b.BigUIntType],["i8",new b.I8Type],["i16",new b.I16Type],["i32",new b.I32Type],["i64",new b.I64Type],["Bigint",new b.BigIntType],["BigInt",new b.BigIntType],["bool",new c.BooleanType],["bytes",new l.BytesType],["Address",new o.AddressType],["H256",new y.H256Type],["utf-8 string",new T.StringType],["TokenIdentifier",new v.TokenIdentifierType],["EgldOrEsdtTokenIdentifier",new v.TokenIdentifierType],["CodeMetadata",new d.CodeMetadataType],["nothing",new A.NothingType],["AsyncCall",new A.NothingType]]),this.learnedTypesMap=new Map;for(const t of e)this.learnedTypesMap.set(t.getName(),t)}mapType(e){let t=this.mapTypeRecursively(e);if(t)return t.isGenericType()||this.learnType(t),t;throw new a.ErrTypingSystem(`Cannot map the type "${e.getName()}" to a known type`)}mapTypeRecursively(e){let t=e.isGenericType(),n=this.learnedTypesMap.get(e.getName());return n||(this.closedTypesMap.get(e.getName())||(e.hasExactClass(h.EnumType.ClassName)?this.mapEnumType(e):e.hasExactClass(w.StructType.ClassName)?this.mapStructType(e):t?this.mapGenericType(e):null))}learnType(e){this.learnedTypesMap.delete(e.getName()),this.learnedTypesMap.set(e.getName(),e)}mapStructType(e){let t=this.mappedFields(e.getFieldsDefinitions());return new w.StructType(e.getName(),t)}mapEnumType(e){let t=e.variants.map((e=>new h.EnumVariantDefinition(e.name,e.discriminant,this.mappedFields(e.getFieldsDefinitions()))));return new h.EnumType(e.getName(),t)}mappedFields(e){return e.map((e=>new p.FieldDefinition(e.name,e.description,this.mapType(e.type))))}mapGenericType(e){let t=e.getTypeParameters().map((e=>this.mapType(e))),n=this.openTypesFactories.get(e.getName());if(!n)throw new a.ErrTypingSystem(`Cannot map the generic type "${e.getName()}" to a known type`);return n(...t)}}},5626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullType=t.TypePlaceholder=t.isTyped=t.PrimitiveValue=t.TypedValue=t.CustomType=t.PrimitiveType=t.TypeCardinality=t.Type=void 0;const r=n(6063),i=n(1069);class s{constructor(e,t=[],n=a.fixed(1)){i.guardValueIsSet("name",e),this.name=e,this.typeParameters=t,this.cardinality=n}getName(){return this.name}getClassName(){return s.ClassName}getClassHierarchy(){return r.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getFullyQualifiedName(){let e=this.getTypeParameters().map((e=>e.getFullyQualifiedName())).join(", ");return this.isGenericType()?`multiversx:types:${this.getName()}<${e}>`:`multiversx:types:${this.getName()}`}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}getTypeParameters(){return this.typeParameters}isGenericType(){return this.typeParameters.length>0}getFirstTypeParameter(){return i.guardTrue(this.typeParameters.length>0,"type parameters length > 0"),this.typeParameters[0]}toString(){let e=this.getTypeParameters().map((e=>e.toString())).join(", "),t=e?`<${e}>`:"";return`${this.name}${t}`}equals(e){return s.equals(this,e)}static equals(e,t){return e.getFullyQualifiedName()==t.getFullyQualifiedName()}static equalsMany(e,t){return e.every(((e,n)=>e.equals(t[n])))}static isAssignableFromMany(e,t){return e.every(((e,n)=>e.isAssignableFrom(t[n])))}differs(e){return!this.equals(e)}valueOf(){return this.name}isAssignableFrom(e){if(!s.equalsMany(this.getTypeParameters(),e.getTypeParameters()))return!1;let t=this.getFullyQualifiedName();return!!s.getFullyQualifiedNamesInHierarchy(e).includes(t)||e.hasClassOrSuperclass(this.getClassName())}static getFullyQualifiedNamesInHierarchy(e){return r.getJavascriptPrototypesInHierarchy(e,(e=>e.belongsToTypesystem)).map((t=>t.getFullyQualifiedName.call(e)))}getNamesOfDependencies(){const e=[];for(const t of this.typeParameters)e.push(t.getName()),e.push(...t.getNamesOfDependencies());return[...new Set(e)]}toJSON(){return{name:this.name,typeParameters:this.typeParameters.map((e=>e.toJSON()))}}getCardinality(){return this.cardinality}belongsToTypesystem(){}}t.Type=s,s.ClassName="Type";class a{constructor(e,t){this.lowerBound=e,this.upperBound=t}static fixed(e){return new a(e,e)}static variable(e){return new a(0,e)}isSingular(){return 1==this.lowerBound&&1==this.upperBound}isSingularOrNone(){return 0==this.lowerBound&&1==this.upperBound}isComposite(){return 1!=this.upperBound}isFixed(){return this.lowerBound==this.upperBound}getLowerBound(){return this.lowerBound}getUpperBound(){return this.upperBound||a.MaxCardinality}}t.TypeCardinality=a,a.MaxCardinality=4096;class o extends s{constructor(e){super(e)}getClassName(){return o.ClassName}}t.PrimitiveType=o,o.ClassName="PrimitiveType";class u extends s{getClassName(){return u.ClassName}}t.CustomType=u,u.ClassName="CustomType";class c{constructor(e){this.type=e}getClassName(){return c.ClassName}getClassHierarchy(){return r.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getType(){return this.type}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}belongsToTypesystem(){}}t.TypedValue=c,c.ClassName="TypedValue";class l extends c{constructor(e){super(e)}getClassName(){return l.ClassName}}t.PrimitiveValue=l,l.ClassName="PrimitiveValue",t.isTyped=function(e){return void 0!==e.belongsToTypesystem};class d extends s{constructor(){super("...")}getClassName(){return d.ClassName}}t.TypePlaceholder=d,d.ClassName="TypePlaceholder";class f extends s{constructor(){super("?")}getClassName(){return f.ClassName}}t.NullType=f,f.ClassName="NullType"},6054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariadicValue=t.CountedVariadicType=t.VariadicType=void 0;const r=n(5626);class i extends r.Type{constructor(e,t=!1){super("Variadic",[e],r.TypeCardinality.variable()),this.isCounted=t}getClassName(){return i.ClassName}}t.VariadicType=i,i.ClassName="VariadicType";class s extends r.Type{constructor(e){super("Variadic",[e],r.TypeCardinality.variable())}getClassName(){return i.ClassName}}t.CountedVariadicType=s,s.ClassName="VariadicType";class a extends r.TypedValue{constructor(e,t){super(e),this.items=t}getClassName(){return a.ClassName}static fromItems(...e){return this.createFromItems(e,!1)}static fromItemsCounted(...e){return this.createFromItems(e,!0)}static createFromItems(e,t){if(0==e.length)return new a(new i(new r.TypePlaceholder,t),[]);const n=e[0].getType();return new a(new i(n,t),e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t],r=e.items[t];if(!n.equals(r))return!1}return!0}}t.VariadicValue=a,a.ClassName="VariadicValue"},8390:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToHex=t.addressToHex=t.bigIntToHex=t.utf8ToHex=t.bigIntToBuffer=t.bufferToBigInt=t.stringToBuffer=void 0;const o=a(n(1594)),u=s(n(7553)),c=s(n(9161));t.stringToBuffer=function(e){return Buffer.from(e)},t.bufferToBigInt=function(e){return 0==e.length?new o.default(0):u.bufferToBigInt(e)},t.bigIntToBuffer=function(e){return 0==e?Buffer.from([]):u.bigIntToBuffer(e)};var l=n(9161);Object.defineProperty(t,"utf8ToHex",{enumerable:!0,get:function(){return l.utf8ToHex}}),Object.defineProperty(t,"bigIntToHex",{enumerable:!0,get:function(){return l.bigIntToHex}}),Object.defineProperty(t,"addressToHex",{enumerable:!0,get:function(){return l.addressToHex}}),t.bufferToHex=function(e){const t=e.toString("hex");return c.zeroPadStringIfOddLength(t)}},3856:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(9229),t),i(n(7384),t),i(n(1772),t)},9229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsFactory=void 0;const r=n(7353),i=n(6458),s=n(3500),a=n(476),o=n(3548),u=n(8390);t.TokenOperationsFactory=class{constructor(e){this.config=e,this.trueAsHex=u.utf8ToHex("true"),this.falseAsHex=u.utf8ToHex("false")}issueFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issue",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.bigIntToHex(e.initialSupply),u.bigIntToHex(e.numDecimals),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}notifyAboutUnsettingBurnRoleGlobally(){i.Logger.info('\n==========\nIMPORTANT!\n==========\nYou are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally).\nOnce the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).')}issueSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issueSemiFungible",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}issueNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["issueNonFungible",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}registerMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerMetaESDT",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.bigIntToHex(e.numDecimals),u.utf8ToHex("canFreeze"),e.canFreeze?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canWipe"),e.canWipe?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canPause"),e.canPause?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canTransferNFTCreateRole"),e.canTransferNFTCreateRole?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canChangeOwner"),e.canChangeOwner?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canUpgrade"),e.canUpgrade?this.trueAsHex:this.falseAsHex,u.utf8ToHex("canAddSpecialRoles"),e.canAddSpecialRoles?this.trueAsHex:this.falseAsHex];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}registerAndSetAllRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerAndSetAllRoles",u.utf8ToHex(e.tokenName),u.utf8ToHex(e.tokenTicker),u.utf8ToHex(e.tokenType),u.bigIntToHex(e.numDecimals)];return this.createTransaction({sender:e.issuer,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,value:this.config.issueCost,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitIssue,dataParts:t})}setBurnRoleGlobally(e){const t=["setBurnRoleGlobally",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:t})}unsetBurnRoleGlobally(e){const t=["unsetBurnRoleGlobally",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitToggleBurnRoleGlobally,dataParts:t})}setSpecialRoleOnFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleLocalMint?[u.utf8ToHex("ESDTRoleLocalMint")]:[],...e.addRoleLocalBurn?[u.utf8ToHex("ESDTRoleLocalBurn")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}setSpecialRoleOnSemiFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleNFTCreate?[u.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[u.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTAddQuantity?[u.utf8ToHex("ESDTRoleNFTAddQuantity")]:[],...e.addRoleESDTTransferRole?[u.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}setSpecialRoleOnMetaESDT(e){return this.setSpecialRoleOnSemiFungible(e)}setSpecialRoleOnNonFungible(e){const t=["setSpecialRole",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user),...e.addRoleNFTCreate?[u.utf8ToHex("ESDTRoleNFTCreate")]:[],...e.addRoleNFTBurn?[u.utf8ToHex("ESDTRoleNFTBurn")]:[],...e.addRoleNFTUpdateAttributes?[u.utf8ToHex("ESDTRoleNFTUpdateAttributes")]:[],...e.addRoleNFTAddURI?[u.utf8ToHex("ESDTRoleNFTAddURI")]:[],...e.addRoleESDTTransferRole?[u.utf8ToHex("ESDTTransferRole")]:[]];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitSetSpecialRole,dataParts:t})}nftCreate(e){const t=["ESDTNFTCreate",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.initialQuantity),u.utf8ToHex(e.name),u.bigIntToHex(e.royalties),u.utf8ToHex(e.hash),u.bufferToHex(e.attributes),...e.uris.map(u.utf8ToHex)],n=(e.name+e.hash+e.attributes+e.uris.join("")).length*this.config.gasLimitStorePerByte.valueOf();return this.createTransaction({sender:e.creator,receiver:e.creator,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTCreate.valueOf()+n.valueOf(),dataParts:t})}pause(e){const t=["pause",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:t})}unpause(e){const t=["unPause",u.utf8ToHex(e.tokenIdentifier)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitPausing,dataParts:t})}freeze(e){const t=["freeze",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:t})}unfreeze(e){const t=["unFreeze",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitFreezing,dataParts:t})}wipe(e){const t=["wipe",u.utf8ToHex(e.tokenIdentifier),u.addressToHex(e.user)];return this.createTransaction({sender:e.manager,receiver:this.config.esdtContractAddress,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitWiping,dataParts:t})}localMint(e){const t=["ESDTLocalMint",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.supplyToMint)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalMint,dataParts:t})}localBurn(e){const t=["ESDTLocalBurn",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.supplyToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTLocalBurn,dataParts:t})}updateAttributes(e){const t=["ESDTNFTUpdateAttributes",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bufferToHex(e.attributes)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTUpdateAttributes,dataParts:t})}addQuantity(e){const t=["ESDTNFTAddQuantity",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bigIntToHex(e.quantityToAdd)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTAddQuantity,dataParts:t})}burnQuantity(e){const t=["ESDTNFTBurn",u.utf8ToHex(e.tokenIdentifier),u.bigIntToHex(e.tokenNonce),u.bigIntToHex(e.quantityToBurn)];return this.createTransaction({sender:e.manager,receiver:e.manager,nonce:e.transactionNonce,gasPrice:e.gasPrice,gasLimitHint:e.gasLimit,executionGasLimit:this.config.gasLimitESDTNFTBurn,dataParts:t})}createTransaction({sender:e,receiver:t,nonce:n,value:i,gasPrice:o,gasLimitHint:u,executionGasLimit:c,dataParts:l}){const d=this.buildTransactionPayload(l),f=u||this.computeGasLimit(d,c),h=new s.TransactionVersion(r.TRANSACTION_VERSION_DEFAULT),p=new s.TransactionOptions(r.TRANSACTION_OPTIONS_DEFAULT);return new a.Transaction({chainID:this.config.chainID,sender:e,receiver:t,gasLimit:f,gasPrice:o,nonce:n||0,value:i||0,data:d,version:h,options:p})}buildTransactionPayload(e){const t=e.join(r.ARGUMENTS_SEPARATOR);return new o.TransactionPayload(t)}computeGasLimit(e,t){return this.config.minGasLimit.valueOf()+this.config.gasLimitPerByte.valueOf()*e.length()+t.valueOf()}}},7384:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsFactoryConfig=void 0;const r=n(236);t.TokenOperationsFactoryConfig=class{constructor(e){this.minGasPrice=1e9,this.minGasLimit=5e4,this.gasLimitPerByte=1500,this.gasLimitIssue=6e7,this.gasLimitToggleBurnRoleGlobally=6e7,this.gasLimitESDTLocalMint=3e5,this.gasLimitESDTLocalBurn=3e5,this.gasLimitSetSpecialRole=6e7,this.gasLimitPausing=6e7,this.gasLimitFreezing=6e7,this.gasLimitWiping=6e7,this.gasLimitESDTNFTCreate=3e6,this.gasLimitESDTNFTUpdateAttributes=1e6,this.gasLimitESDTNFTAddQuantity=1e6,this.gasLimitESDTNFTBurn=1e6,this.gasLimitStorePerByte=5e4,this.issueCost="50000000000000000",this.esdtContractAddress=r.Address.fromBech32("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"),this.chainID=e}}},1772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenOperationsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(8390);t.TokenOperationsOutcomeParser=class{parseIssueFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issue");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseIssueNonFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issueNonFungible");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseIssueSemiFungible(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"issueSemiFungible");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseRegisterMetaESDT(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"registerMetaESDT");return{tokenIdentifier:this.extractTokenIdentifier(t)}}parseRegisterAndSetAllRoles(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"registerAndSetAllRoles");return{tokenIdentifier:this.extractTokenIdentifier(t),roles:this.findSingleEventByIdentifier(e,"ESDTSetRole").topics.slice(3).map((e=>e.valueOf().toString()))}}parseSetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseUnsetBurnRoleGlobally(e){return this.ensureNoError(e),{}}parseSetSpecialRole(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTSetRole");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),roles:t.topics.slice(3).map((e=>e.valueOf().toString()))}}parseNFTCreate(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTCreate");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),initialQuantity:this.extractAmount(t)}}parseLocalMint(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTLocalMint");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),mintedSupply:this.extractAmount(t)}}parseLocalBurn(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTLocalBurn");return{userAddress:t.address.toString(),tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),burntSupply:this.extractAmount(t)}}parsePause(e){return this.ensureNoError(e),this.findSingleEventByIdentifier(e,"ESDTPause"),{}}parseUnpause(e){return this.ensureNoError(e),this.findSingleEventByIdentifier(e,"ESDTUnPause"),{}}parseFreeze(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTFreeze"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseUnfreeze(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTUnFreeze"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseWipe(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTWipe"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=this.extractAmount(t);return{userAddress:this.extractAddress(t),tokenIdentifier:n,nonce:r,balance:i}}parseUpdateAttributes(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTUpdateAttributes"),n=this.extractTokenIdentifier(t),r=this.extractNonce(t),i=t.topics[3]?.valueOf();return{tokenIdentifier:n,nonce:r,attributes:i}}parseAddQuantity(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTAddQuantity");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),addedQuantity:this.extractAmount(t)}}parseBurnQuantity(e){this.ensureNoError(e);const t=this.findSingleEventByIdentifier(e,"ESDTNFTBurn");return{tokenIdentifier:this.extractTokenIdentifier(t),nonce:this.extractNonce(t),burntQuantity:this.extractAmount(t)}}ensureNoError(e){for(const t of e.logs.events)if("signalError"==t.identifier){const n=Buffer.from(t.data.substring(1),"hex").toString(),r=t.topics[1]?.valueOf().toString();throw new i.ErrCannotParseTransactionOutcome(e.hash,`encountered signalError: ${r} (${n})`)}}findSingleEventByIdentifier(e,t){const n=this.gatherAllEvents(e).filter((e=>e.identifier==t));if(0==n.length)throw new i.ErrCannotParseTransactionOutcome(e.hash,`cannot find event of type ${t}`);if(n.length>1)throw new i.ErrCannotParseTransactionOutcome(e.hash,`more than one event of type ${t}`);return n[0]}gatherAllEvents(e){const t=[];t.push(...e.logs.events);for(const n of e.contractResults.items)t.push(...n.logs.events);return t}extractTokenIdentifier(e){return e.topics[0]?.valueOf().toString()}extractNonce(e){return s.bufferToBigInt(e.topics[1]?.valueOf()).toFixed(0)}extractAmount(e){return s.bufferToBigInt(e.topics[2]?.valueOf()).toFixed(0)}extractAddress(e){return r.Address.fromBuffer(e.topics[3]?.valueOf()).toString()}}},5132:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenPayment=t.TokenComputer=t.TokenTransfer=t.Token=void 0;const i=r(n(1594)),s=n(2581),a=n(7353),o="EGLD";i.default.set({ROUNDING_MODE:1});class u{constructor(e){this.identifier=e.identifier,this.nonce=e.nonce||0n}}t.Token=u;class c{constructor(e){if(this.isLegacyTokenTransferOptions(e)){const t=new i.default(e.amountAsBigInteger);if(!t.isInteger()||t.isNegative())throw new s.ErrInvalidArgument(`bad amountAsBigInteger: ${e.amountAsBigInteger}`);this.tokenIdentifier=e.tokenIdentifier,this.nonce=e.nonce,this.amountAsBigInteger=t,this.numDecimals=e.numDecimals||0,this.token=new u({identifier:e.tokenIdentifier,nonce:BigInt(e.nonce)}),this.amount=BigInt(this.amountAsBigInteger.toFixed(0))}else this.token=e.token,this.amount=e.amount,this.tokenIdentifier=e.token.identifier,this.nonce=Number(e.token.nonce),this.amountAsBigInteger=new i.default(this.amount.toString()),this.numDecimals=0}static newFromEgldAmount(e){const t=new u({identifier:a.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER});return new c({token:t,amount:e})}isLegacyTokenTransferOptions(e){return void 0!==e.tokenIdentifier}static egldFromAmount(e){const t=new i.default(e).shiftedBy(18).decimalPlaces(0);return this.egldFromBigInteger(t)}static egldFromBigInteger(e){return new c({tokenIdentifier:o,nonce:0,amountAsBigInteger:e,numDecimals:18})}static fungibleFromAmount(e,t,n){const r=new i.default(t).shiftedBy(n).decimalPlaces(0);return this.fungibleFromBigInteger(e,r,n)}static fungibleFromBigInteger(e,t,n=0){return new c({tokenIdentifier:e,nonce:0,amountAsBigInteger:t,numDecimals:n})}static nonFungible(e,t){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:1,numDecimals:0})}static semiFungible(e,t,n){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:0})}static metaEsdtFromAmount(e,t,n,r){const s=new i.default(n).shiftedBy(r).decimalPlaces(0);return this.metaEsdtFromBigInteger(e,t,s,r)}static metaEsdtFromBigInteger(e,t,n,r=0){return new c({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:r})}toString(){return this.amount.toString()}valueOf(){return new i.default(this.amount.toString())}toPrettyString(){return`${this.toAmount()} ${this.tokenIdentifier}`}toAmount(){return this.amountAsBigInteger.shiftedBy(-this.numDecimals).toFixed(this.numDecimals)}isEgld(){return this.token.identifier==o}isFungible(){return 0n==this.token.nonce}}t.TokenTransfer=c,t.TokenComputer=class{constructor(){}isFungible(e){return 0n===e.nonce}extractNonceFromExtendedIdentifier(e){const t=e.split("-");if(this.checkIfExtendedIdentifierWasProvided(t),this.checkLengthOfRandomSequence(t[1]),2==t.length)return 0;return(n=Buffer.from(t[2],"hex")).readUIntBE(0,n.length);var n}extractIdentifierFromExtendedIdentifier(e){const t=e.split("-");return this.checkIfExtendedIdentifierWasProvided(t),this.ensureTokenTickerValidity(t[0]),this.checkLengthOfRandomSequence(t[1]),t[0]+"-"+t[1]}checkIfExtendedIdentifierWasProvided(e){if(e.length<2||e.length>3)throw new s.ErrInvalidTokenIdentifier("Invalid extended token identifier provided")}checkLengthOfRandomSequence(e){if(6!==e.length)throw new s.ErrInvalidTokenIdentifier("The identifier is not valid. The random sequence does not have the right length")}ensureTokenTickerValidity(e){if(e.length<3||e.length>10)throw new s.ErrInvalidTokenIdentifier("The token ticker should be between 3 and 10 characters");if(!e.match(/^[a-zA-Z0-9]+$/))throw new s.ErrInvalidTokenIdentifier("The token ticker should only contain alphanumeric characters");if(e!=e.toUpperCase())throw new s.ErrInvalidTokenIdentifier("The token ticker should be upper case")}},t.TokenPayment=class extends c{constructor(e,t,n,r){super({tokenIdentifier:e,nonce:t,amountAsBigInteger:n,numDecimals:r})}}},476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionHash=t.Transaction=void 0;const r=n(1594),i=n(236),s=n(7353),a=n(6659),o=n(9342),u=n(3500),c=n(9874),l=n(3548),d=n(9825);t.Transaction=class{constructor(e){this.nonce=BigInt(e.nonce?.valueOf()||0n),this.value=e.value?BigInt(new r.BigNumber(e.value.toString()).toFixed(0)):0n,this.sender=this.addressAsBech32(e.sender),this.receiver=this.addressAsBech32(e.receiver),this.senderUsername=e.senderUsername||"",this.receiverUsername=e.receiverUsername||"",this.gasPrice=BigInt(e.gasPrice?.valueOf()||s.TRANSACTION_MIN_GAS_PRICE),this.gasLimit=BigInt(e.gasLimit.valueOf()),this.data=e.data?.valueOf()||new Uint8Array,this.chainID=e.chainID.valueOf(),this.version=Number(e.version?.valueOf()||s.TRANSACTION_VERSION_DEFAULT),this.options=Number(e.options?.valueOf()||s.TRANSACTION_OPTIONS_DEFAULT),this.guardian=e.guardian?this.addressAsBech32(e.guardian):"",this.signature=e.signature||Buffer.from([]),this.guardianSignature=e.guardianSignature||Buffer.from([]),this.relayer=e.relayer||"",this.innerTransactions=e.innerTransactions||[]}addressAsBech32(e){return"string"==typeof e?e:e.bech32()}getNonce(){return Number(this.nonce)}setNonce(e){this.nonce=BigInt(e.valueOf())}getValue(){return this.value}setValue(e){this.value=BigInt(e.toString())}getSender(){return i.Address.fromBech32(this.sender)}setSender(e){this.sender="string"==typeof e?e:e.bech32()}getReceiver(){return i.Address.fromBech32(this.receiver)}getSenderUsername(){return this.senderUsername}setSenderUsername(e){this.senderUsername=e}getReceiverUsername(){return this.receiverUsername}setReceiverUsername(e){this.receiverUsername=e}getGuardian(){return new i.Address(this.guardian)}getGasPrice(){return Number(this.gasPrice)}setGasPrice(e){this.gasPrice=BigInt(e.valueOf())}getGasLimit(){return Number(this.gasLimit)}setGasLimit(e){this.gasLimit=BigInt(e.valueOf())}getData(){return new l.TransactionPayload(Buffer.from(this.data))}getChainID(){return this.chainID}setChainID(e){this.chainID=e.valueOf()}getVersion(){return new u.TransactionVersion(this.version)}setVersion(e){this.version=e.valueOf()}getOptions(){return new u.TransactionOptions(this.options.valueOf())}setOptions(e){this.options=e.valueOf()}getSignature(){return Buffer.from(this.signature)}getGuardianSignature(){return Buffer.from(this.guardianSignature)}setGuardian(e){this.guardian="string"==typeof e?e:e.bech32()}getHash(){return f.compute(this)}serializeForSigning(){const e=(new d.TransactionComputer).computeBytesForSigning(this);return Buffer.from(e)}isGuardedTransaction(){const e=this.guardian.length>0,t=this.guardianSignature.length>0;return this.getOptions().isWithGuardian()&&e&&t}toPlainObject(){return(new a.TransactionsConverter).transactionToPlainObject(this)}static fromPlainObject(e){return(new a.TransactionsConverter).plainObjectToTransaction(e)}applySignature(e){this.signature=c.interpretSignatureAsBuffer(e)}applyGuardianSignature(e){this.guardianSignature=c.interpretSignatureAsBuffer(e)}toSendable(){return this.toPlainObject()}computeFee(e){const t=(new d.TransactionComputer).computeTransactionFee(this,e);return new r.BigNumber(t.toString())}};class f extends o.Hash{constructor(e){super(e)}static compute(e){const t=(new d.TransactionComputer).computeTransactionHash(e);return new f(Buffer.from(t).toString("hex"))}}t.TransactionHash=f},9825:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionComputer=void 0;const o=a(n(1594)),u=n(7353),c=s(n(2581)),l=n(9277),d=n(476),f=n(2206),h=n(5508);t.TransactionComputer=class{constructor(){}computeTransactionFee(e,t){const n=BigInt(t.MinGasLimit+e.data.length*t.GasPerDataByte);if(n>e.gasLimit)throw new c.ErrNotEnoughGas(parseInt(e.gasLimit.toString(),10));const r=e.gasPrice,i=n*r;return n===e.gasLimit?i:i+(e.gasLimit-n)*BigInt(new o.default(r.toString()).multipliedBy(new o.default(t.GasPriceModifier)).toFixed(0))}computeBytesForSigning(e){this.ensureValidTransactionFields(e);const t=this.toPlainObject(e),n=JSON.stringify(t);return new Uint8Array(Buffer.from(n))}computeBytesForVerifying(e){return this.hasOptionsSetForHashSigning(e)?this.computeHashForSigning(e):this.computeBytesForSigning(e)}computeHashForSigning(e){const t=this.toPlainObject(e),n=Buffer.from(JSON.stringify(t));return h("keccak256").update(n).digest()}computeTransactionHash(e){const t=(new l.ProtoSerializer).serializeTransaction(new d.Transaction(e)),n=f(32).update(t).digest("hex");return Buffer.from(n,"hex")}hasOptionsSetForGuardedTransaction(e){return(e.options&u.TRANSACTION_OPTIONS_TX_GUARDED)==u.TRANSACTION_OPTIONS_TX_GUARDED}hasOptionsSetForHashSigning(e){return(e.options&u.TRANSACTION_OPTIONS_TX_HASH_SIGN)==u.TRANSACTION_OPTIONS_TX_HASH_SIGN}applyGuardian(e,t){e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|u.TRANSACTION_OPTIONS_TX_GUARDED,e.guardian=t}applyOptionsForHashSigning(e){e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|u.TRANSACTION_OPTIONS_TX_HASH_SIGN}toPlainObject(e,t){let n={nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data)};return t&&(n.signature=this.toHexOrUndefined(e.signature)),n.chainID=e.chainID,n.version=e.version,n.options=e.options?e.options:void 0,n.guardian=e.guardian?e.guardian:void 0,n.relayer=e.relayer?e.relayer:void 0,n.innerTransactions=e.innerTransactions.length?e.innerTransactions.map((e=>this.toPlainObject(e,!0))):void 0,n}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}ensureValidTransactionFields(e){if(!e.chainID.length)throw new c.ErrBadUsage("The `chainID` field is not set");if(e.version<u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(this.hasOptionsSetForGuardedTransaction(e)||this.hasOptionsSetForHashSigning(e)))throw new c.ErrBadUsage(`Non-empty transaction options requires transaction version >= ${u.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS}`)}}},3548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionPayload=void 0;class n{constructor(e){this.data=Buffer.from(e||[])}static fromEncoded(e){if(!e)return new n("");let t=Buffer.from(e,"base64").toString();return new n(t)}isEmpty(){return 0==this.data.length}encoded(){return this.data.toString("base64")}valueOf(){return this.data}toString(){return this.data.toString()}getEncodedArguments(){return this.toString().split("@")}getRawArguments(){return this.getEncodedArguments().map((e=>Buffer.from(e,"hex")))}length(){return Buffer.from(this.data).length}}t.TransactionPayload=n},4650:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWatcher=void 0;const r=n(5519),i=n(7353),s=n(2581),a=n(6458);class o{constructor(e,t={}){this.fetcher=new u(e),this.pollingIntervalMilliseconds=t.pollingIntervalMilliseconds||o.DefaultPollingInterval,this.timeoutMilliseconds=t.timeoutMilliseconds||o.DefaultTimeout,this.patienceMilliseconds=t.patienceMilliseconds||o.DefaultPatience}async awaitPending(e){return this.awaitConditionally((e=>e.status.isPending()),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}async awaitCompleted(e){return this.awaitConditionally((e=>{if(void 0===e.isCompleted)throw new s.ErrIsCompletedFieldIsMissingOnTransaction;return e.isCompleted}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}async awaitAllEvents(e,t){return this.awaitConditionally((e=>{const n=this.getAllTransactionEvents(e).map((e=>e.identifier));return t.every((e=>n.includes(e)))}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionEventsNotFound))}async awaitAnyEvent(e,t){return this.awaitConditionally((e=>{const n=this.getAllTransactionEvents(e).map((e=>e.identifier));return null!=t.find((e=>n.includes(e)))}),(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionEventsNotFound))}async awaitOnCondition(e,t){return this.awaitConditionally(t,(async()=>{const t=this.transactionOrTxHashToTxHash(e);return await this.fetcher.getTransaction(t)}),(()=>new s.ErrExpectedTransactionStatusNotReached))}transactionOrTxHashToTxHash(e){const t="string"==typeof e?e:e.getHash().hex();if(t.length!==i.HEX_TRANSACTION_HASH_LENGTH)throw new s.Err(`Invalid transaction hash length. The length of a hex encoded hash should be ${i.HEX_TRANSACTION_HASH_LENGTH}.`);return t}async awaitConditionally(e,t,n){const i=new r.AsyncTimer("watcher:periodic"),o=new r.AsyncTimer("watcher:patience"),u=new r.AsyncTimer("watcher:timeout");let c,l=!1,d=!1;for(u.start(this.timeoutMilliseconds).finally((()=>{u.stop(),l=!0}));!l;){await i.start(this.pollingIntervalMilliseconds);try{if(c=await t(),d=e(c),d||l)break}catch(e){if(a.Logger.debug("TransactionWatcher.awaitConditionally(): cannot (yet) fetch data."),e instanceof s.ErrIsCompletedFieldIsMissingOnTransaction)throw e;if(!(e instanceof s.Err))throw e}}if(d&&await o.start(this.patienceMilliseconds),u.isStopped()||u.stop(),!c||!d)throw n();return c}getAllTransactionEvents(e){const t=[...e.logs.events];for(const n of e.contractResults.items)t.push(...n.logs.events);return t}}t.TransactionWatcher=o,o.DefaultPollingInterval=6e3,o.DefaultTimeout=15*o.DefaultPollingInterval,o.DefaultPatience=0,o.NoopOnStatusReceived=e=>{};class u{constructor(e){this.fetcher=e}async getTransaction(e){return a.Logger.debug(`transactionWatcher, getTransaction(${e})`),await this.fetcher.getTransaction(e)}}},6520:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountTransactionsFactory=void 0;const r=n(236),i=n(4059);t.AccountTransactionsFactory=class{constructor(e){this.config=e.config}createTransactionForSavingKeyValue(e){const t=["SaveKeyValue",...this.computeDataPartsForSavingKeyValue(e.keyValuePairs)],n=this.computeExtraGasForSavingKeyValue(e.keyValuePairs);return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}computeExtraGasForSavingKeyValue(e){let t=0n;return e.forEach(((e,n)=>{t+=this.config.gasLimitPersistPerByte*BigInt(n.length+e.length)+this.config.gasLimitStorePerByte*BigInt(e.length)})),t+this.config.gasLimitSaveKeyValue}computeDataPartsForSavingKeyValue(e){const t=[];return e.forEach(((e,n)=>{t.push(Buffer.from(n).toString("hex"),Buffer.from(e).toString("hex"))})),t}createTransactionForSettingGuardian(e){const t=["SetGuardian",r.Address.fromBech32(e.guardianAddress.bech32()).toHex(),Buffer.from(e.serviceID).toString("hex")];return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitSetGuardian,addDataMovementGas:!0}).build()}createTransactionForGuardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["GuardAccount"],gasLimit:this.config.gasLimitGuardAccount,addDataMovementGas:!0}).build()}createTransactionForUnguardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["UnGuardAccount"],gasLimit:this.config.gasLimitUnguardAccount,addDataMovementGas:!0}).build()}}},7673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(661),o=n(4059);t.DelegationTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new a.ArgSerializer,this.delegationManagerAddress=r.Address.fromHex(i.DELEGATION_MANAGER_SC_ADDRESS_HEX,this.config.addressHrp)}createTransactionForNewDelegationContract(e){const t=["createNewDelegationContract",...this.argSerializer.valuesToStrings([new a.BigUIntValue(e.totalDelegationCap),new a.BigUIntValue(e.serviceFee)])],n=this.config.gasLimitCreateDelegationContract+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.delegationManagerAddress,dataParts:t,gasLimit:n,addDataMovementGas:!0,amount:e.amount}).build()}createTransactionForAddingNodes(e){if(e.publicKeys.length!==e.signedMessages.length)throw new s.Err("The number of public keys should match the number of signed messages");const t=e.signedMessages.map((e=>new a.BytesValue(Buffer.from(e)))),n=this.argSerializer.valuesToStrings(t),r=e.publicKeys.length,i=["addNodes"];for(let t=0;t<r;t++)i.push(e.publicKeys[t].hex(),n[t]);return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:i,gasLimit:this.computeExecutionGasLimitForNodesManagement(r),addDataMovementGas:!0}).build()}createTransactionForRemovingNodes(e){const t=["removeNodes"];for(const n of e.publicKeys)t.push(n.hex());const n=e.publicKeys.length;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(n),addDataMovementGas:!0}).build()}createTransactionForStakingNodes(e){let t=["stakeNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitStake+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnbondingNodes(e){let t=["unBondNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnbond+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnstakingNodes(e){let t=["unStakeNodes"];for(const n of e.publicKeys)t=t.concat(n.hex());const n=e.publicKeys.length,r=BigInt(n)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnstake+this.config.gasLimitDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnjailingNodes(e){const t=["unJailNodes"];for(const n of e.publicKeys)t.push(n.hex());const n=e.publicKeys.length;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(n),addDataMovementGas:!0,amount:e.amount}).build()}createTransactionForChangingServiceFee(e){const t=["changeServiceFee",this.argSerializer.valuesToStrings([new a.BigUIntValue(e.serviceFee)])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForModifyingDelegationCap(e){const t=["modifyTotalDelegationCap",this.argSerializer.valuesToStrings([new a.BigUIntValue(e.delegationCap)])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new a.StringValue("true")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnsettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new a.StringValue("false")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new a.StringValue("true")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnsettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new a.StringValue("false")])[0]],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForSettingMetadata(e){const t=["setMetaData",...this.argSerializer.valuesToStrings([new a.StringValue(e.name),new a.StringValue(e.website),new a.StringValue(e.identifier)])],n=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new o.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}computeExecutionGasLimitForNodesManagement(e){const t=this.config.additionalGasLimitPerValidatorNode*BigInt(e);return this.config.gasLimitDelegationOperations+t}}},3102:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7673),t),i(n(2713),t),i(n(9712),t),i(n(6943),t),i(n(3473),t),i(n(4934),t),i(n(6520),t)},2713:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionsFactory=void 0;const i=r(n(1594)),s=n(236),a=n(2581),o=n(661),u=n(476),c=n(1013);t.RelayedTransactionsFactory=class{constructor(e){this.config=e.config}createRelayedV1Transaction(e){if(!e.innerTransaction.gasLimit)throw new a.ErrInvalidInnerTransaction("The gas limit is not set for the inner transaction");if(!e.innerTransaction.signature.length)throw new a.ErrInvalidInnerTransaction("The inner transaction is not signed");const t=this.prepareInnerTransactionForRelayedV1(e.innerTransaction),n=`relayedTx@${Buffer.from(t).toString("hex")}`,r=this.config.gasLimitPerByte*BigInt(n.length),i=this.config.minGasLimit+r+e.innerTransaction.gasLimit;return new u.Transaction({chainID:this.config.chainID,sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,gasLimit:i,data:Buffer.from(n)})}createRelayedV2Transaction(e){if(e.innerTransaction.gasLimit)throw new a.ErrInvalidInnerTransaction("The gas limit should not be set for the inner transaction");if(!e.innerTransaction.signature.length)throw new a.ErrInvalidInnerTransaction("The inner transaction is not signed");const{argumentsString:t}=(new o.ArgSerializer).valuesToString([new o.AddressValue(s.Address.fromBech32(e.innerTransaction.receiver)),new o.U64Value(new i.default(e.innerTransaction.nonce.toString())),new o.BytesValue(Buffer.from(e.innerTransaction.data)),new o.BytesValue(Buffer.from(e.innerTransaction.signature))]),n=`relayedTxV2@${t}`,r=this.config.gasLimitPerByte*BigInt(n.length),c=e.innerTransactionGasLimit+this.config.minGasLimit+r;return new u.Transaction({sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,value:0n,gasLimit:c,chainID:this.config.chainID,data:Buffer.from(n),version:e.innerTransaction.version,options:e.innerTransaction.options})}createRelayedV3Transaction(e){if(!e.innerTransactions.length)throw new a.ErrInvalidInnerTransaction("No inner transctions provided");let t=0n;for(const n of e.innerTransactions){if(!n.signature.length)throw new a.ErrInvalidInnerTransaction("Inner transaction is not signed");if(n.relayer!==e.relayerAddress.bech32())throw new a.ErrInvalidInnerTransaction("The inner transaction has an incorrect relayer address");t+=n.gasLimit}const n=this.config.minGasLimit*BigInt(e.innerTransactions.length)+t;return new u.Transaction({sender:e.relayerAddress.bech32(),receiver:e.relayerAddress.bech32(),chainID:this.config.chainID,gasLimit:n,innerTransactions:e.innerTransactions})}prepareInnerTransactionForRelayedV1(e){const t={nonce:e.nonce,sender:s.Address.newFromBech32(e.sender).getPublicKey().toString("base64"),receiver:s.Address.newFromBech32(e.receiver).getPublicKey().toString("base64"),value:e.value,gasPrice:e.gasPrice,gasLimit:e.gasLimit,data:Buffer.from(e.data).toString("base64"),signature:Buffer.from(e.signature).toString("base64"),chainID:Buffer.from(e.chainID).toString("base64"),version:e.version,options:0==e.options.valueOf()?void 0:e.options,guardian:e.guardian?s.Address.newFromBech32(e.guardian).getPublicKey().toString("base64"):void 0,guardianSignature:e.guardianSignature.length?Buffer.from(e.guardianSignature).toString("base64"):void 0,sndUserName:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,rcvUserName:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0};return c.stringify(t)}}},9712:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(6458),o=n(661),u=n(670),c=n(2747),l=n(5132),d=n(9161),f=n(5560),h=n(4059);t.SmartContractTransactionsFactory=class{constructor(e){this.config=e.config,this.abi=e.abi,this.tokenComputer=new l.TokenComputer,this.dataArgsBuilder=new f.TokenTransfersDataBuilder,this.contractDeployAddress=r.Address.fromHex(i.CONTRACT_DEPLOY_ADDRESS_HEX,this.config.addressHrp)}createTransactionForDeploy(e){const t=e.nativeTransferAmount??0n,n=e.isUpgradeable??!0,r=e.isReadable??!0,s=e.isPayable??!1,a=e.isPayableBySmartContract??!0,u=e.arguments||[],c=new o.CodeMetadata(n,r,s,a),l=[d.byteArrayToHex(e.bytecode),d.byteArrayToHex(i.VM_TYPE_WASM_VM),c.toString()],f=this.abi?.constructorDefinition,p=this.argsToDataParts(u,f);return l.push(...p),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.contractDeployAddress,dataParts:l,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}createTransactionForExecute(e){const t=e.arguments||[];let n=e.tokenTransfers?[...e.tokenTransfers]:[],r=e.nativeTransferAmount??0n,i=n.length;r&&i&&(n.push(l.TokenTransfer.newFromEgldAmount(r)),r=0n,i++);let s=e.contract,a=[];if(1===i){const t=n[0];this.tokenComputer.isFungible(t.token)?a=this.dataArgsBuilder.buildDataPartsForESDTTransfer(t):(a=this.dataArgsBuilder.buildDataPartsForSingleESDTNFTTransfer(t,s),s=e.sender)}else i>1&&(a=this.dataArgsBuilder.buildDataPartsForMultiESDTNFTTransfer(s,n),s=e.sender);a.push(a.length?d.utf8ToHex(e.function):e.function);const o=this.abi?.getEndpoint(e.function),u=this.argsToDataParts(t,o);return a.push(...u),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:s,dataParts:a,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:r}).build()}createTransactionForUpgrade(e){const t=e.nativeTransferAmount??0n,n=e.isUpgradeable??!0,r=e.isReadable??!0,i=e.isPayable??!1,s=e.isPayableBySmartContract??!0,a=e.arguments||[],u=new o.CodeMetadata(n,r,i,s),c=["upgradeContract",d.byteArrayToHex(e.bytecode),u.toString()],l=this.getEndpointForUpgrade(),f=this.argsToDataParts(a,l);return c.push(...f),new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:c,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}getEndpointForUpgrade(){if(this.abi){if(this.abi.upgradeConstructorDefinition)return this.abi.upgradeConstructorDefinition;try{return this.abi.getEndpoint("upgrade")}catch(e){return a.Logger.warn("In the ABI, cannot find the 'upgrade' endpoint definition. Will use the constructor definition (fallback)."),this.abi.constructorDefinition}}}createTransactionForClaimingDeveloperRewards(e){return new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:["ClaimDeveloperRewards"],gasLimit:this.config.gasLimitClaimDeveloperRewards,addDataMovementGas:!1}).build()}createTransactionForChangingOwnerAddress(e){const t=["ChangeOwnerAddress",r.Address.fromBech32(e.newOwner.bech32()).toHex()];return new h.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:t,gasLimit:this.config.gasLimitChangeOwnerAddress,addDataMovementGas:!1}).build()}argsToDataParts(e,t){if(t){const n=u.NativeSerializer.nativeToTypedValues(e,t);return(new o.ArgSerializer).valuesToStrings(n)}if(this.areArgsOfTypedValue(e))return(new o.ArgSerializer).valuesToStrings(e);throw new s.Err("Can't convert args to TypedValues")}areArgsOfTypedValue(e){return e.every((e=>c.isTyped(e)))}}},6943:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenManagementTransactionsFactory=void 0;const r=n(236),i=n(7353),s=n(2581),a=n(6458),o=n(661),u=n(4059);t.TokenManagementTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new o.ArgSerializer,this.trueAsString="true",this.falseAsString="false",this.esdtContractAddress=r.Address.fromHex(i.ESDT_CONTRACT_ADDRESS_HEX,this.config.addressHrp)}createTransactionForIssuingFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.initialSupply),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issue",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issueSemiFungible",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["issueNonFungible",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],n=["registerMetaESDT",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringAndSettingRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerAndSetAllRoles",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType),new o.BigUIntValue(e.numDecimals)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForSettingBurnRoleGlobally(e){const t=["setBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForUnsettingBurnRoleGlobally(e){const t=["unsetBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleLocalMint&&t.push(new o.StringValue("ESDTRoleLocalMint")),e.addRoleLocalBurn&&t.push(new o.StringValue("ESDTRoleLocalBurn")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnSemiFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTAddQuantity&&t.push(new o.StringValue("ESDTRoleNFTAddQuantity")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole")),e.addRoleESDTModifyCreator&&t.push(new o.StringValue("ESDTRoleModifyCreator"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnMetaESDT(e){return this.createTransactionForSettingSpecialRoleOnSemiFungibleToken(e)}createTransactionForSettingSpecialRoleOnNonFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTUpdateAttributes&&t.push(new o.StringValue("ESDTRoleNFTUpdateAttributes")),e.addRoleNFTAddURI&&t.push(new o.StringValue("ESDTRoleNFTAddURI")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole")),e.addRoleESDTModifyCreator&&t.push(new o.StringValue("ESDTRoleModifyCreator")),e.addRoleNFTRecreate&&t.push(new o.StringValue("ESDTRoleNFTRecreate")),e.addRoleESDTSetNewURI&&t.push(new o.StringValue("ESDTRoleSetNewURI")),e.addRoleESDTModifyRoyalties&&t.push(new o.StringValue("ESDTRoleModifyRoyalties"));const n=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:n,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForCreatingNFT(e){const t=["ESDTNFTCreate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.initialQuantity),new o.StringValue(e.name),new o.BigUIntValue(e.royalties),new o.StringValue(e.hash),new o.BytesValue(Buffer.from(e.attributes)),...e.uris.map((e=>new o.StringValue(e)))])],n=e.name+e.hash+e.attributes+e.uris.join(""),r=this.config.gasLimitStorePerByte+BigInt(n.length);return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftCreate+r,addDataMovementGas:!0}).build()}createTransactionForPausing(e){const t=["pause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForUnpausing(e){const t=["unPause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForFreezing(e){const t=["freeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForUnfreezing(e){const t=["UnFreeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForWiping(e){const t=["wipe",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitWiping,addDataMovementGas:!0}).build()}createTransactionForLocalMint(e){const t=["ESDTLocalMint",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToMint)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalMint,addDataMovementGas:!0}).build()}createTransactionForLocalBurning(e){const t=["ESDTLocalBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToBurn)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalBurn,addDataMovementGas:!0}).build()}createTransactionForUpdatingAttributes(e){const t=["ESDTNFTUpdateAttributes",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BytesValue(Buffer.from(e.attributes))])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftUpdateAttributes,addDataMovementGas:!0}).build()}createTransactionForAddingQuantity(e){const t=["ESDTNFTAddQuantity",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToAdd)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftAddQuantity,addDataMovementGas:!0}).build()}createTransactionForBurningQuantity(e){const t=["ESDTNFTBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToBurn)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftBurn,addDataMovementGas:!0}).build()}createTransactionForModifyingRoyalties(e){const t=["ESDTModifyRoyalties",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.newRoyalties)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtModifyRoyalties,addDataMovementGas:!0}).build()}createTransactionForSettingNewUris(e){if(!e.newUris.length)throw new s.ErrBadUsage("No URIs provided");const t=["ESDTSetNewURIs",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newUris.map((e=>new o.StringValue(e)))])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitSetNewUris,addDataMovementGas:!0}).build()}createTransactionForModifyingCreator(e){const t=["ESDTModifyCreator",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtModifyCreator,addDataMovementGas:!0}).build()}createTransactionForUpdatingMetadata(e){const t=["ESDTMetaDataUpdate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newTokenName?[new o.StringValue(e.newTokenName)]:[],...e.newRoyalties?[new o.BigUIntValue(e.newRoyalties)]:[],...e.newHash?[new o.StringValue(e.newHash)]:[],...e.newAttributes?[new o.BytesValue(Buffer.from(e.newAttributes))]:[],...e.newUris?e.newUris.map((e=>new o.StringValue(e))):[]])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtMetadataUpdate,addDataMovementGas:!0}).build()}createTransactionForMetadataRecreate(e){const t=["ESDTMetaDataRecreate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),...e.newTokenName?[new o.StringValue(e.newTokenName)]:[],...e.newRoyalties?[new o.BigUIntValue(e.newRoyalties)]:[],...e.newHash?[new o.StringValue(e.newHash)]:[],...e.newAttributes?[new o.BytesValue(Buffer.from(e.newAttributes))]:[],...e.newUris?e.newUris.map((e=>new o.StringValue(e))):[]])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitNftMetadataRecreate,addDataMovementGas:!0}).build()}createTransactionForChangingTokenToDynamic(e){const t=["changeToDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitNftChangeToDynamic,addDataMovementGas:!0}).build()}createTransactionForUpdatingTokenId(e){const t=["updateTokenID",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitUpdateTokenId,addDataMovementGas:!0}).build()}createTransactionForRegisteringDynamicToken(e){const t=["registerDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitRegisterDynamic,addDataMovementGas:!0}).build()}createTransactionForRegisteringDynamicAndSettingRoles(e){const t=["registerAndSetAllRolesDynamic",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType)])];return new u.TransactionBuilder({config:this.config,sender:e.sender,receiver:this.esdtContractAddress,dataParts:t,gasLimit:this.config.gasLimitRegisterDynamic,addDataMovementGas:!0}).build()}notifyAboutUnsettingBurnRoleGlobally(){a.Logger.info('\n==========\nIMPORTANT!\n==========\nYou are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally).\nOnce the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).')}boolToString(e){return e?this.trueAsString:this.falseAsString}}},5560:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransfersDataBuilder=void 0;const r=n(1157),i=n(2747),s=n(5132);t.TokenTransfersDataBuilder=class{constructor(){this.tokenComputer=new s.TokenComputer,this.argsSerializer=new r.ArgSerializer}buildDataPartsForESDTTransfer(e){return["ESDTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(e.token.identifier),new i.BigUIntValue(e.amount)])]}buildDataPartsForSingleESDTNFTTransfer(e,t){const n=e.token,r=this.tokenComputer.extractIdentifierFromExtendedIdentifier(n.identifier);return["ESDTNFTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(r),new i.BigUIntValue(n.nonce),new i.BigUIntValue(e.amount),new i.AddressValue(t)])]}buildDataPartsForMultiESDTNFTTransfer(e,t){const n=[new i.AddressValue(e),new i.U32Value(t.length)];for(const e of t){const t=this.tokenComputer.extractIdentifierFromExtendedIdentifier(e.token.identifier);n.push(new i.TokenIdentifierValue(t),new i.BigUIntValue(e.token.nonce),new i.BigUIntValue(e.amount))}return["MultiESDTNFTTransfer",...this.argsSerializer.valuesToStrings(n)]}}},4059:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=void 0;const r=n(7353),i=n(476),s=n(3548);t.TransactionBuilder=class{constructor(e){this.config=e.config,this.sender=e.sender,this.receiver=e.receiver,this.dataParts=e.dataParts,this.providedGasLimit=e.gasLimit,this.addDataMovementGas=e.addDataMovementGas,this.amount=e.amount}computeGasLimit(e){return this.addDataMovementGas?this.config.minGasLimit+this.config.gasLimitPerByte*BigInt(e.length())+this.providedGasLimit:this.providedGasLimit}buildTransactionPayload(){const e=this.dataParts.join(r.ARGUMENTS_SEPARATOR);return new s.TransactionPayload(e)}build(){const e=this.buildTransactionPayload(),t=this.computeGasLimit(e);return new i.Transaction({sender:this.sender.bech32(),receiver:this.receiver.bech32(),gasLimit:t,value:this.amount||0n,data:e.valueOf(),chainID:this.config.chainID})}}},3473:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsFactoryConfig=void 0;const r=n(6424);t.TransactionsFactoryConfig=class{constructor(e){this.chainID=e.chainID,this.addressHrp=r.LibraryConfig.DefaultAddressHrp,this.minGasLimit=50000n,this.gasLimitPerByte=1500n,this.gasLimitIssue=60000000n,this.gasLimitToggleBurnRoleGlobally=60000000n,this.gasLimitEsdtLocalMint=300000n,this.gasLimitEsdtLocalBurn=300000n,this.gasLimitSetSpecialRole=60000000n,this.gasLimitPausing=60000000n,this.gasLimitFreezing=60000000n,this.gasLimitWiping=60000000n,this.gasLimitEsdtNftCreate=3000000n,this.gasLimitEsdtNftUpdateAttributes=1000000n,this.gasLimitEsdtNftAddQuantity=1000000n,this.gasLimitEsdtNftBurn=1000000n,this.gasLimitStorePerByte=10000n,this.issueCost=50000000000000000n,this.gasLimitEsdtModifyRoyalties=60000000n,this.gasLimitEsdtModifyCreator=60000000n,this.gasLimitEsdtMetadataUpdate=60000000n,this.gasLimitSetNewUris=60000000n,this.gasLimitNftMetadataRecreate=60000000n,this.gasLimitNftChangeToDynamic=60000000n,this.gasLimitUpdateTokenId=60000000n,this.gasLimitRegisterDynamic=60000000n,this.gasLimitStake=5000000n,this.gasLimitUnstake=5000000n,this.gasLimitUnbond=5000000n,this.gasLimitCreateDelegationContract=50000000n,this.gasLimitDelegationOperations=1000000n,this.additionalGasLimitPerValidatorNode=6000000n,this.additionalGasLimitForDelegationOperations=10000000n,this.gasLimitSaveKeyValue=100000n,this.gasLimitPersistPerByte=1000n,this.gasLimitSetGuardian=250000n,this.gasLimitGuardAccount=250000n,this.gasLimitUnguardAccount=250000n,this.gasLimitESDTTransfer=200000n,this.gasLimitESDTNFTTransfer=200000n,this.gasLimitMultiESDTNFTTransfer=200000n,this.gasLimitClaimDeveloperRewards=6000000n,this.gasLimitChangeOwnerAddress=6000000n}}},4934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTransactionsFactory=void 0;const r=n(2581),i=n(661),s=n(5132),a=n(476),o=n(3548),u=n(5560),c=n(4059),l=8e5;t.TransferTransactionsFactory=class{constructor(e){this.isGasEstimator(e)?this.gasEstimator=e:(this.config=e.config,this.tokenComputer=new s.TokenComputer,this.tokenTransfersDataBuilder=new u.TokenTransfersDataBuilder)}isGasEstimator(e){return"object"==typeof e&&"function"==typeof e.forEGLDTransfer&&"function"==typeof e.forESDTTransfer&&"function"==typeof e.forESDTNFTTransfer&&"function"==typeof e.forMultiESDTNFTTransfer}isGasEstimatorDefined(){return void 0!==this.gasEstimator}ensureConfigIsDefined(){if(void 0===this.config)throw new r.Err("'config' is not defined")}createTransactionForNativeTokenTransfer(e){this.ensureConfigIsDefined();const t=e.data||new Uint8Array;return new a.Transaction({sender:e.sender.bech32(),receiver:e.receiver.bech32(),chainID:this.config.chainID,gasLimit:this.computeGasForMoveBalance(this.config,t),data:t,value:e.nativeAmount})}createTransactionForESDTTokenTransfer(e){this.ensureConfigIsDefined();const t=e.tokenTransfers.length;if(0===t)throw new r.ErrBadUsage("No token transfer has been provided");if(1===t)return this.createSingleESDTTransferTransaction(e);const n=this.tokenTransfersDataBuilder.buildDataPartsForMultiESDTNFTTransfer(e.receiver,e.tokenTransfers),i=this.config.gasLimitMultiESDTNFTTransfer*BigInt(t)+BigInt(l);return new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:n,gasLimit:i,addDataMovementGas:!0}).build()}createTransactionForTransfer(e){const t=e.nativeAmount??0n;let n=e.tokenTransfers?[...e.tokenTransfers]:[];const i=n.length;if(i&&e.data?.length)throw new r.ErrBadUsage("Can't set data field when sending esdt tokens");if(t&&0===i||e.data)return this.createTransactionForNativeTokenTransfer({sender:e.sender,receiver:e.receiver,nativeAmount:t,data:e.data});const a=t?s.TokenTransfer.newFromEgldAmount(t):void 0;return a&&n.push(a),this.createTransactionForESDTTokenTransfer({sender:e.sender,receiver:e.receiver,tokenTransfers:n})}createEGLDTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an EGLD transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForNativeTokenTransfer` method.");const t=e.data?.length()||0,n=this.gasEstimator.forEGLDTransfer(t);return new a.Transaction({nonce:e.nonce,value:e.value,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||n,data:e.data,chainID:e.chainID})}createESDTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an ESDT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.BigUIntValue(e.tokenTransfer.valueOf())]),n=`ESDTTransfer@${t}`,s=new o.TransactionPayload(n),u=s.length()||0,c=this.gasEstimator.forESDTTransfer(u);return new a.Transaction({nonce:e.nonce,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create an ESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.U64Value(e.tokenTransfer.nonce),new i.BigUIntValue(e.tokenTransfer.valueOf()),new i.AddressValue(e.destination)]),n=`ESDTNFTTransfer@${t}`,s=new o.TransactionPayload(n),u=s.length()||0,c=this.gasEstimator.forESDTNFTTransfer(u);return new a.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createMultiESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new r.Err("You are calling a legacy function to create a MultiESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const t=[new i.AddressValue(e.destination),new i.U16Value(e.tokenTransfers.length)];for(const n of e.tokenTransfers)t.push(i.BytesValue.fromUTF8(n.tokenIdentifier),new i.U64Value(n.nonce),new i.BigUIntValue(n.valueOf()));const{argumentsString:n}=(new i.ArgSerializer).valuesToString(t),s=`MultiESDTNFTTransfer@${n}`,u=new o.TransactionPayload(s),c=u.length()||0,l=this.gasEstimator.forMultiESDTNFTTransfer(c,e.tokenTransfers.length);return new a.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||l,data:u,chainID:e.chainID})}createSingleESDTTransferTransaction(e){this.ensureConfigIsDefined();let t=[];const n=e.tokenTransfers[0];let r=0n,i=e.receiver;return this.tokenComputer.isFungible(n.token)?(t=this.tokenTransfersDataBuilder.buildDataPartsForESDTTransfer(n),r=this.config.gasLimitESDTTransfer+BigInt(1e5)):(t=this.tokenTransfersDataBuilder.buildDataPartsForSingleESDTNFTTransfer(n,i),r=this.config.gasLimitESDTNFTTransfer+BigInt(l),i=e.sender),new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:i,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}computeGasForMoveBalance(e,t){return e.minGasLimit+e.gasLimitPerByte*BigInt(t.length)}}},7058:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(3217);t.DelegationTransactionsOutcomeParser=class{constructor(){}parseCreateNewDelegationContract(e){return this.ensureNoError(e.logs.events),s.findEventsByIdentifier(e,"SCDeploy").map((e=>({contractAddress:this.extractContractAddress(e)})))}ensureNoError(e){for(const t of e)if("signalError"==t.identifier){const e=Buffer.from(t.dataItems[0]?.toString().slice(1)).toString()||"",n=this.decodeTopicAsString(t.topics[1]);throw new i.ErrParseTransactionOutcome(`encountered signalError: ${n} (${Buffer.from(e,"hex").toString()})`)}}extractContractAddress(e){if(!e.topics[0]?.length)return"";const t=Buffer.from(e.topics[0]);return r.Address.fromBuffer(t).bech32()}decodeTopicAsString(e){return Buffer.from(e).toString()}}},4476:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(7058),t),i(n(3217),t),i(n(2483),t),i(n(6120),t),i(n(1494),t)},3217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gatherAllEvents=t.findEventsByFirstTopic=t.findEventsByIdentifier=t.findEventsByPredicate=t.SmartContractCallOutcome=t.TransactionOutcome=t.SmartContractResult=t.TransactionLogs=t.TransactionEvent=void 0,t.TransactionEvent=class{constructor(e){this.address="",this.identifier="",this.topics=[],this.dataItems=[],Object.assign(this,e)}};class n{constructor(e){this.address="",this.events=[],Object.assign(this,e)}}t.TransactionLogs=n,t.SmartContractResult=class{constructor(e){this.sender="",this.receiver="",this.data=new Uint8Array,this.logs=new n({}),Object.assign(this,e)}},t.TransactionOutcome=class{constructor(e){this.directSmartContractCallOutcome=new r({}),this.smartContractResults=[],this.logs=new n({}),Object.assign(this,e)}};class r{constructor(e){this.function="",this.returnDataParts=[],this.returnMessage="",this.returnCode="",Object.assign(this,e)}}function i(e,t){return s(e).filter(t)}function s(e){const t=[];t.push(...e.logs.events);for(const n of e.smartContractResults)t.push(...n.logs.events);return t}t.SmartContractCallOutcome=r,t.findEventsByPredicate=i,t.findEventsByIdentifier=function(e,t){return i(e,(e=>e.identifier==t))},t.findEventsByFirstTopic=function(e,t){return i(e,(e=>e.topics[0]?.toString()==t))},t.gatherAllEvents=s},2483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(661),a=n(3217);t.SmartContractTransactionsOutcomeParser=class{constructor(e){this.abi=e?.abi,this.legacyResultsParser=e?.legacyResultsParser||new s.ResultsParser}parseDeploy(e){const t=e.transactionOutcome.directSmartContractCallOutcome,n=a.findEventsByIdentifier(e.transactionOutcome,"SCDeploy").map((e=>this.parseScDeployEvent(e)));return{returnCode:t.returnCode,returnMessage:t.returnMessage,contracts:n}}parseScDeployEvent(e){const t=e.topics[0],n=e.topics[1],i=e.topics[2];return{address:t?.length?new r.Address(t).toBech32():"",ownerAddress:n?.length?new r.Address(n).toBech32():"",codeHash:i}}parseExecute(e){const t=e.transactionOutcome.directSmartContractCallOutcome;if(!this.abi)return{values:t.returnDataParts,returnCode:t.returnCode,returnMessage:t.returnMessage};const n=e.function||t.function;if(!n)throw new i.Err('Function name is not available in the transaction outcome, thus endpoint definition (ABI) cannot be picked (for parsing). Maybe provide the "function" parameter explicitly?');const r=this.abi.getEndpoint(n),a={returnCode:new s.ReturnCode(t.returnCode),returnMessage:t.returnMessage,values:t.returnDataParts.map((e=>Buffer.from(e)))},o=this.legacyResultsParser.parseOutcomeFromUntypedBundle(a,r);return{values:o.values.map((e=>e.valueOf())),returnCode:o.returnCode.toString(),returnMessage:o.returnMessage}}}},6120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenManagementTransactionsOutcomeParser=void 0;const r=n(236),i=n(2581),s=n(7553),a=n(3217);t.TokenManagementTransactionsOutcomeParser=class{constructor(){}parseIssueFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issue").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseIssueNonFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issueNonFungible").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseIssueSemiFungible(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"issueSemiFungible").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseRegisterMetaEsdt(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"registerMetaESDT").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseRegisterAndSetAllRoles(e){this.ensureNoError(e.logs.events);const t=a.findEventsByIdentifier(e,"registerAndSetAllRoles"),n=a.findEventsByIdentifier(e,"ESDTSetRole");if(t.length!==n.length)throw new i.ErrParseTransactionOutcome("Register Events and Set Role events mismatch. Should have the same number of events.");return t.map(((e,t)=>({tokenIdentifier:this.extractTokenIdentifier(e),roles:n[t].topics.slice(3).map((e=>this.decodeTopicAsString(e)))})))}parseSetBurnRoleGlobally(e){this.ensureNoError(e.logs.events)}parseUnsetBurnRoleGlobally(e){this.ensureNoError(e.logs.events)}parseSetSpecialRole(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTSetRole").map((e=>this.getOutputForSetSpecialRoleEvent(e)))}getOutputForSetSpecialRoleEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),roles:e.topics.slice(3).map((e=>this.decodeTopicAsString(e)))}}parseNftCreate(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTCreate").map((e=>this.getOutputForNftCreateEvent(e)))}getOutputForNftCreateEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),initialQuantity:this.extractAmount(e)}}parseLocalMint(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTLocalMint").map((e=>this.getOutputForLocalMintEvent(e)))}getOutputForLocalMintEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),mintedSupply:this.extractAmount(e)}}parseLocalBurn(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTLocalBurn").map((e=>this.getOutputForLocalBurnEvent(e)))}getOutputForLocalBurnEvent(e){return{userAddress:e.address,tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),burntSupply:this.extractAmount(e)}}parsePause(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTPause").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseUnpause(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTUnPause").map((e=>({tokenIdentifier:this.extractTokenIdentifier(e)})))}parseFreeze(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTFreeze").map((e=>this.getOutputForFreezeEvent(e)))}getOutputForFreezeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseUnfreeze(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTUnFreeze").map((e=>this.getOutputForUnfreezeEvent(e)))}getOutputForUnfreezeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseWipe(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTWipe").map((e=>this.getOutputForWipeEvent(e)))}getOutputForWipeEvent(e){return{userAddress:this.extractAddress(e),tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),balance:this.extractAmount(e)}}parseUpdateAttributes(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTUpdateAttributes").map((e=>this.getOutputForUpdateAttributesEvent(e)))}getOutputForUpdateAttributesEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),attributes:e.topics[3]?e.topics[3]:new Uint8Array}}parseAddQuantity(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTAddQuantity").map((e=>this.getOutputForAddQuantityEvent(e)))}getOutputForAddQuantityEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),addedQuantity:this.extractAmount(e)}}parseBurnQuantity(e){return this.ensureNoError(e.logs.events),a.findEventsByIdentifier(e,"ESDTNFTBurn").map((e=>this.getOutputForBurnQuantityEvent(e)))}getOutputForBurnQuantityEvent(e){return{tokenIdentifier:this.extractTokenIdentifier(e),nonce:this.extractNonce(e),burntQuantity:this.extractAmount(e)}}ensureNoError(e){for(const t of e)if("signalError"==t.identifier){const e=Buffer.from(t.dataItems[0]?.toString().slice(1)).toString()||"",n=this.decodeTopicAsString(t.topics[1]);throw new i.ErrParseTransactionOutcome(`encountered signalError: ${n} (${Buffer.from(e,"hex").toString()})`)}}extractTokenIdentifier(e){return e.topics[0]?.length?this.decodeTopicAsString(e.topics[0]):""}extractNonce(e){if(!e.topics[1]?.length)return BigInt(0);const t=Buffer.from(e.topics[1]);return BigInt(s.bufferToBigInt(t).toFixed(0))}extractAmount(e){if(!e.topics[2]?.length)return BigInt(0);const t=Buffer.from(e.topics[2]);return BigInt(s.bufferToBigInt(t).toFixed(0))}extractAddress(e){if(!e.topics[3]?.length)return"";const t=Buffer.from(e.topics[3]);return r.Address.fromBuffer(t).bech32()}decodeTopicAsString(e){return Buffer.from(e).toString()}}},1494:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEventsParser=void 0;const r=n(661);t.TransactionEventsParser=class{constructor(e){this.legacyResultsParser=new r.ResultsParser,this.abi=e.abi,this.firstTopicIsIdentifier=e.firstTopicIsIdentifier??!0}parseEvents(e){const t=[];for(const n of e.events){const e=this.parseEvent({event:n});t.push(e)}return t}parseEvent(e){const t=e.event.topics.map((e=>Buffer.from(e))),n=this.firstTopicIsIdentifier?t[0]?.toString():e.event.identifier;this.firstTopicIsIdentifier&&t.shift();const r=e.event.dataItems.map((e=>Buffer.from(e))),i=this.abi.getEvent(n);return this.legacyResultsParser.doParseEvent({topics:t,dataItems:r,eventDefinition:i})}}},9161:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.addressToHex=t.bigIntToHex=t.byteArrayToHex=t.boolToHex=t.utf8ToHex=t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=void 0;const o=a(n(1594)),u=n(236),c=s(n(7553));function l(e){return(e=e||"").length%2==1?"0"+e:e}function d(e){return l(Buffer.from(e).toString("hex"))}t.numberToPaddedHex=function(e){let t;return t="bigint"==typeof e||"number"==typeof e?e:new o.default(e),l(t.toString(16))},t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=l,t.utf8ToHex=d,t.boolToHex=function(e){return d(e.toString())},t.byteArrayToHex=function(e){return l(Buffer.from(e).toString("hex"))},t.bigIntToHex=function(e){return 0==e?"":c.getHexMagnitudeOfBigInt(e)},t.addressToHex=function(e){return u.Address.fromBech32(e.toString()).pubkey().toString("hex")}},1069:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=t.guardEmpty=t.guardNotEmpty=t.guardLength=t.guardSameLength=t.guardValueIsSetWithMessage=t.guardValueIsSet=t.guardTrue=void 0;const a=s(n(2581));function o(e,t){if(null==t||void 0===t)throw new a.ErrInvariantFailed(e)}function u(e){return e.isEmpty?e.isEmpty():0===e.length}t.guardTrue=function(e,t){if(!e)throw new a.ErrInvariantFailed(`[<${t}>] isn't true`)},t.guardValueIsSet=function(e,t){o(`${e} isn't set (null or undefined)`,t)},t.guardValueIsSetWithMessage=o,t.guardSameLength=function(e,t){if(t=t||[],(e=e||[]).length!=t.length)throw new a.ErrInvariantFailed("arrays do not have the same length")},t.guardLength=function(e,t){let n=e.length||0;if(n!=t)throw new a.ErrInvariantFailed(`wrong length, expected: ${t}, actual: ${n}`)},t.guardNotEmpty=function(e,t){if(u(e))throw new a.ErrInvariantFailed(`${t} is empty`)},t.guardEmpty=function(e,t){if(!u(e))throw new a.ErrInvariantFailed(`${t} is not empty`)},t.isEmpty=u},84:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GuardianData=t.AccountOnNetwork=void 0;const i=r(n(1594)),s=n(1466);class a{constructor(e){this.address=new s.Address(""),this.nonce=0,this.balance=new i.default(0),this.code="",this.userName="",Object.assign(this,e)}static fromHttpResponse(e){let t=new a;return t.address=new s.Address(e.address||""),t.nonce=Number(e.nonce||0),t.balance=new i.default(e.balance||0),t.code=e.code||"",t.userName=e.username||"",t}}t.AccountOnNetwork=a;class o{constructor(e){this.guarded=!1,Object.assign(this,e)}static fromHttpResponse(e){const t=new o;return t.guarded=e.guarded||!1,e.activeGuardian&&(t.activeGuardian=u.fromHttpResponse(e.activeGuardian)),e.pendingGuardian&&(t.pendingGuardian=u.fromHttpResponse(e.pendingGuardian)),t}getCurrentGuardianAddress(){var e;if(this.guarded)return null===(e=this.activeGuardian)||void 0===e?void 0:e.address}}t.GuardianData=o;class u{constructor(){this.activationEpoch=0,this.address=new s.Address(""),this.serviceUID=""}static fromHttpResponse(e){const t=new u;return t.activationEpoch=Number(e.activationEpoch||0),t.address=new s.Address(e.address||""),t.serviceUID=e.serviceUID||"",t}}},6482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPagination=t.defaultAxiosConfig=void 0;const r=n(1013)({constructorAction:"ignore"});t.defaultAxiosConfig={timeout:5e3,transformResponse:[function(e){return r.parse(e)}]},t.defaultPagination={from:0,size:100}},4027:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EsdtContractAddress=t.MaxUint64AsBigNumber=void 0;const i=r(n(1594)),s=n(1466);t.MaxUint64AsBigNumber=new i.default("18446744073709551615"),t.EsdtContractAddress=new s.Address("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u")},8419:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryRequest=void 0,t.ContractQueryRequest=class{constructor(e){this.query=e}toHttpRequest(){var e;let t={},n=this.query;return t.scAddress=n.address.bech32(),t.caller=(null===(e=n.caller)||void 0===e?void 0:e.bech32())?n.caller.bech32():void 0,t.funcName=n.func.toString(),t.value=n.value?n.value.toString():void 0,t.args=n.getEncodedArguments(),t}}},3767:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryResponse=void 0;const i=r(n(1594)),s=n(4027);class a{constructor(e){this.returnData=(null==e?void 0:e.returnData)||[],this.returnCode=(null==e?void 0:e.returnCode)||"",this.returnMessage=(null==e?void 0:e.returnMessage)||"",this.gasUsed=(null==e?void 0:e.gasUsed)||0}static fromHttpResponse(e){let t=e.returnData||e.ReturnData,n=e.returnCode||e.ReturnCode,r=e.returnMessage||e.ReturnMessage,o=new i.default(e.gasRemaining||e.GasRemaining||0),u=s.MaxUint64AsBigNumber.minus(o).toNumber();return new a({returnData:t,returnCode:n,returnMessage:r,gasUsed:u})}getReturnDataParts(){return this.returnData.map((e=>Buffer.from(e||"","base64")))}toJSON(){return{returnData:this.returnData,returnCode:this.returnCode,returnMessage:this.returnMessage,gasUsed:this.gasUsed.valueOf()}}}t.ContractQueryResponse=a},2286:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractResultItem=t.ContractResults=void 0;const r=n(9857),i=n(1466);class s{constructor(e){this.items=e,this.items.sort((function(e,t){return e.nonce.valueOf()-t.nonce.valueOf()}))}static fromProxyHttpResponse(e){let t=e.map((e=>a.fromProxyHttpResponse(e)));return new s(t)}static fromApiHttpResponse(e){let t=e.map((e=>a.fromApiHttpResponse(e)));return new s(t)}}t.ContractResults=s;class a{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new i.Address(""),this.sender=new i.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new r.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return a.fromHttpResponse(e)}static fromApiHttpResponse(e){let t=a.fromHttpResponse(e);return t.data=Buffer.from(t.data,"base64").toString(),t.callType=Number(t.callType),t}static fromHttpResponse(e){let t=new a;return t.hash=e.hash,t.nonce=Number(e.nonce||0),t.value=(e.value||0).toString(),t.receiver=new i.Address(e.receiver),t.sender=new i.Address(e.sender),t.previousHash=e.prevTxHash,t.originalHash=e.originalTxHash,t.gasLimit=Number(e.gasLimit||0),t.gasPrice=Number(e.gasPrice||0),t.data=e.data||"",t.callType=e.callType,t.returnMessage=e.returnMessage,t.logs=r.TransactionLogs.fromHttpResponse(e.logs||{}),t}}t.ContractResultItem=a},2591:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrContractQuery=t.ErrNetworkProvider=t.ErrUnexpectedCondition=t.Err=void 0;class n extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}}t.Err=n,t.ErrUnexpectedCondition=class extends n{constructor(e){super(`Unexpected condition: [${e}]`)}},t.ErrNetworkProvider=class extends n{constructor(e,t,n){super(`Request error on url [${e}]: [${t}]`,n)}},t.ErrContractQuery=class extends n{constructor(e){super(e.message.replace("executeQuery:",""))}}},3802:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkConfig=void 0;const i=r(n(1594));class s{constructor(){this.ChainID="T",this.GasPerDataByte=1500,this.TopUpFactor=0,this.RoundDuration=0,this.RoundsPerEpoch=0,this.TopUpRewardsGradientPoint=new i.default(0),this.MinGasLimit=5e4,this.MinGasPrice=1e9,this.GasPriceModifier=1,this.MinTransactionVersion=1}static fromHttpResponse(e){let t=new s;return t.ChainID=String(e.erd_chain_id),t.GasPerDataByte=Number(e.erd_gas_per_data_byte),t.TopUpFactor=Number(e.erd_top_up_factor),t.RoundDuration=Number(e.erd_round_duration),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t.TopUpRewardsGradientPoint=new i.default(e.erd_rewards_top_up_gradient_point),t.MinGasLimit=Number(e.erd_min_gas_limit),t.MinGasPrice=Number(e.erd_min_gas_price),t.MinTransactionVersion=Number(e.erd_min_transaction_version),t.GasPriceModifier=Number(e.erd_gas_price_modifier),t}}t.NetworkConfig=s},9358:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkStatus=void 0;class n{constructor(){this.CurrentRound=0,this.EpochNumber=0,this.HighestFinalNonce=0,this.Nonce=0,this.NonceAtEpochStart=0,this.NoncesPassedInCurrentEpoch=0,this.RoundAtEpochStart=0,this.RoundsPassedInCurrentEpoch=0,this.RoundsPerEpoch=0}static fromHttpResponse(e){let t=new n;return t.CurrentRound=Number(e.erd_current_round),t.EpochNumber=Number(e.erd_epoch_number),t.HighestFinalNonce=Number(e.erd_highest_final_nonce),t.Nonce=Number(e.erd_nonce),t.NonceAtEpochStart=Number(e.erd_nonce_at_epoch_start),t.NoncesPassedInCurrentEpoch=Number(e.erd_nonces_passed_in_current_epoch),t.RoundAtEpochStart=Number(e.erd_round_at_epoch_start),t.RoundsPassedInCurrentEpoch=Number(e.erd_rounds_passed_in_current_epoch),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t}}t.NetworkStatus=n},1466:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=t.Nonce=t.Address=void 0;const a=s(n(9674));class o{constructor(e){this.value=e}static fromPubkey(e){let t=a.toWords(e),n=a.encode("erd",t);return new o(n)}bech32(){return this.value}toString(){return this.bech32()}}function u(e){return c(e.toString(16))}function c(e){return(e=e||"").length%2==1?"0"+e:e}t.Address=o,t.Nonce=class{constructor(e){this.value=e}valueOf(){return this.value}hex(){return u(this.value)}},t.numberToPaddedHex=u,t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=c},8403:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{u(r.next(e))}catch(e){s(e)}}function o(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyNetworkProvider=void 0;const s=i(n(6425)),a=n(84),o=n(6482),u=n(4027),c=n(8419),l=n(3767),d=n(2591),f=n(3802),h=n(9358),p=n(8721),g=n(3962),m=n(6389),y=n(6188);t.ProxyNetworkProvider=class{constructor(e,t){this.url=e,this.config=Object.assign(Object.assign({},o.defaultAxiosConfig),t)}getNetworkConfig(){return r(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/config");return f.NetworkConfig.fromHttpResponse(e.config)}))}getNetworkStatus(){return r(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/status/4294967295");return h.NetworkStatus.fromHttpResponse(e.status)}))}getNetworkStakeStatistics(){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getNetworkGeneralStatistics(){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getAccount(e){return r(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`address/${e.bech32()}`);return a.AccountOnNetwork.fromHttpResponse(t.account)}))}getGuardianData(e){return r(this,void 0,void 0,(function*(){const t=yield this.doGetGeneric(`address/${e.bech32()}/guardian-data`);return a.GuardianData.fromHttpResponse(t.guardianData)}))}getFungibleTokensOfAccount(e,t){return r(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,n=yield this.doGetGeneric(t),r=Object.values(n.esdts).filter((e=>!e.nonce)).map((e=>g.FungibleTokenOfAccountOnNetwork.fromHttpResponse(e)));return r.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),r}))}getNonFungibleTokensOfAccount(e,t){return r(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,n=yield this.doGetGeneric(t),r=Object.values(n.esdts).filter((e=>e.nonce>=0)).map((e=>g.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponse(e)));return r.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),r}))}getFungibleTokenOfAccount(e,t){return r(this,void 0,void 0,(function*(){let n=yield this.doGetGeneric(`address/${e.bech32()}/esdt/${t}`);return g.FungibleTokenOfAccountOnNetwork.fromHttpResponse(n.tokenData)}))}getNonFungibleTokenOfAccount(e,t,n){return r(this,void 0,void 0,(function*(){let r=yield this.doGetGeneric(`address/${e.bech32()}/nft/${t}/nonce/${n.valueOf()}`);return g.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponseByNonce(r.tokenData)}))}getTransaction(e,t){return r(this,void 0,void 0,(function*(){let n;!0===t&&(n=this.getTransactionStatus(e));let r=this.buildUrlWithQueryParameters(`transaction/${e}`,{withResults:"true"}),i=yield this.doGetGeneric(r);if(n){const t=yield n;return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction,t)}return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction)}))}getTransactionStatus(e){return r(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`transaction/${e}/process-status`);return new y.TransactionStatus(t.status)}))}sendTransaction(e){return r(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return(yield this.doPostGeneric("transaction/send",t)).txHash}))}sendTransactions(e){return r(this,void 0,void 0,(function*(){const t=e.map((e=>m.prepareTransactionForBroadcasting(e))),n=yield this.doPostGeneric("transaction/send-multiple",t),r=Array(e.length).fill(null);for(let t=0;t<e.length;t++)r[t]=n.txsHashes[t.toString()]||null;return r}))}simulateTransaction(e){return r(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return yield this.doPostGeneric("transaction/simulate",t)}))}queryContract(e){return r(this,void 0,void 0,(function*(){try{let t=new c.ContractQueryRequest(e).toHttpRequest(),n=yield this.doPostGeneric("vm-values/query",t);return l.ContractQueryResponse.fromHttpResponse(n.data)}catch(e){throw new d.ErrContractQuery(e)}}))}getDefinitionOfFungibleToken(e){return r(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return p.DefinitionOfFungibleTokenOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getTokenProperties(e){return r(this,void 0,void 0,(function*(){let t=Buffer.from(e).toString("hex");return(yield this.queryContract({address:u.EsdtContractAddress,func:"getTokenProperties",getEncodedArguments:()=>[t]})).getReturnDataParts()}))}getDefinitionOfTokenCollection(e){return r(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return p.DefinitionOfTokenCollectionOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getNonFungibleToken(e,t){return r(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}doGetGeneric(e){return r(this,void 0,void 0,(function*(){return yield this.doGet(e)}))}doPostGeneric(e,t){return r(this,void 0,void 0,(function*(){return yield this.doPost(e,t)}))}doGet(e){return r(this,void 0,void 0,(function*(){let t=`${this.url}/${e}`;try{return(yield s.default.get(t,this.config)).data.data}catch(t){this.handleApiError(t,e)}}))}doPost(e,t){return r(this,void 0,void 0,(function*(){let n=`${this.url}/${e}`;try{return(yield s.default.post(n,t,Object.assign(Object.assign({},this.config),{headers:Object.assign({"Content-Type":"application/json"},this.config.headers)}))).data.data}catch(t){this.handleApiError(t,e)}}))}buildUrlWithQueryParameters(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r&&n.append(e,r);return`${e}?${n.toString()}`}handleApiError(e,t){if(!e.response)throw new d.ErrNetworkProvider(t,e.toString(),e);const n=e.response.data,r=n.message||n.error||JSON.stringify(n);throw new d.ErrNetworkProvider(t,r,e)}}},8721:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefinitionOfTokenCollectionOnNetwork=t.DefinitionOfFungibleTokenOnNetwork=void 0;const i=r(n(1594)),s=n(1466);class a{constructor(){this.identifier="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.supply=new i.default(0),this.isPaused=!1,this.canUpgrade=!1,this.canMint=!1,this.canBurn=!1,this.canChangeOwner=!1,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canAddSpecialRoles=!1,this.assets={}}static fromApiHttpResponse(e){let t=new a;return t.identifier=e.identifier||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.supply=new i.default(e.supply||"0"),t.isPaused=e.isPaused||!1,t.canUpgrade=e.canUpgrade||!1,t.canMint=e.canMint||!1,t.canBurn=e.canBurn||!1,t.canChangeOwner=e.canChangeOwner||!1,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.assets=e.assets||{},t}static fromResponseOfGetTokenProperties(e,t){let n=new a,[r,o,c,l,...d]=t,f=u(d);return n.identifier=e,n.name=r.toString(),n.ticker=e,n.owner=s.Address.fromPubkey(c),n.decimals=f.NumDecimals.toNumber(),n.supply=new i.default(l.toString()).shiftedBy(-n.decimals),n.isPaused=f.IsPaused,n.canUpgrade=f.CanUpgrade,n.canMint=f.CanMint,n.canBurn=f.CanBurn,n.canChangeOwner=f.CanChangeOwner,n.canPause=f.CanPause,n.canFreeze=f.CanFreeze,n.canWipe=f.CanWipe,n}}t.DefinitionOfFungibleTokenOnNetwork=a;class o{constructor(){this.collection="",this.type="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canUpgrade=!1,this.canChangeOwner=!1,this.canAddSpecialRoles=!1,this.canTransferNftCreateRole=!1,this.canCreateMultiShard=!1}static fromApiHttpResponse(e){let t=new o;return t.collection=e.collection||"",t.type=e.type||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.canUpgrade=e.canUpgrade||!1,t.canAddSpecialRoles=e.canAddSpecialRoles||!1,t.canTransferNftCreateRole=e.canTransferNftCreateRole||!1,t}static fromResponseOfGetTokenProperties(e,t){var n;let r=new o,[i,a,c,l,d,...f]=t,h=u(f);return r.collection=e,r.type=a.toString(),r.name=i.toString(),r.ticker=e,r.owner=s.Address.fromPubkey(c),r.decimals=null!==(n=h.NumDecimals.toNumber())&&void 0!==n?n:0,r.canPause=h.CanPause||!1,r.canFreeze=h.CanFreeze||!1,r.canWipe=h.CanWipe||!1,r.canUpgrade=h.CanUpgrade||!1,r.canChangeOwner=h.CanChangeOwner||!1,r.canAddSpecialRoles=h.CanAddSpecialRoles||!1,r.canTransferNftCreateRole=h.CanTransferNFTCreateRole||!1,r.canCreateMultiShard=h.CanCreateMultiShard||!1,r}}function u(e){let t={};for(let n of e){let[e,r]=n.toString().split("-");t[e]=c(r)}return t}function c(e){switch(e){case"true":return!0;case"false":return!1;default:return new i.default(e)}}t.DefinitionOfTokenCollectionOnNetwork=o},3962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonFungibleTokenOfAccountOnNetwork=t.FungibleTokenOfAccountOnNetwork=void 0;const r=n(1594),i=n(1466);class s{constructor(){this.identifier="",this.balance=new r.BigNumber(0),this.rawResponse={}}static fromHttpResponse(e){let t=new s;return t.identifier=e.tokenIdentifier||e.identifier||"",t.balance=new r.BigNumber(e.balance||0),t.rawResponse=e,t}}t.FungibleTokenOfAccountOnNetwork=s;class a{constructor(e){this.identifier="",this.collection="",this.timestamp=0,this.attributes=Buffer.from([]),this.nonce=0,this.type="",this.name="",this.creator=new i.Address(""),this.supply=new r.BigNumber(0),this.decimals=0,this.royalties=new r.BigNumber(0),this.assets=[],this.balance=new r.BigNumber(0),Object.assign(this,e)}static fromProxyHttpResponse(e){let t=a.fromHttpResponse(e);return t.identifier=e.tokenIdentifier||"",t.collection=a.parseCollectionFromIdentifier(t.identifier),t.royalties=new r.BigNumber(e.royalties||0).div(100),t}static fromProxyHttpResponseByNonce(e){let t=a.fromHttpResponse(e),n=new i.Nonce(t.nonce).hex();return t.identifier=`${e.tokenIdentifier}-${n}`,t.collection=e.tokenIdentifier||"",t.royalties=new r.BigNumber(e.royalties||0).div(100),t}static fromApiHttpResponse(e){let t=a.fromHttpResponse(e);return t.identifier=e.identifier||"",t.collection=e.collection||"",t}static fromHttpResponse(e){let t=new a;return t.timestamp=Number(e.timestamp||0),t.attributes=Buffer.from(e.attributes||"","base64"),t.nonce=e.nonce||0,t.type=e.type||"",t.name=e.name||"",t.creator=new i.Address(e.creator||""),t.decimals=Number(e.decimals||0),t.supply=new r.BigNumber(e.balance||1),t.royalties=new r.BigNumber(e.royalties||0),t.assets=e.assets||[],t.balance=new r.BigNumber(e.balance||1),t}static parseCollectionFromIdentifier(e){return e.split("-").slice(0,2).join("-")}}t.NonFungibleTokenOfAccountOnNetwork=a},8427:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEventTopic=t.TransactionEventData=t.TransactionEvent=void 0;const r=n(1466);class i{constructor(e){this.address=new r.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new s(Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new i;return t.address=new r.Address(e.address),t.identifier=e.identifier||"",t.topics=(e.topics||[]).map((e=>new a(e))),t.dataPayload=s.fromBase64(e.data),t.additionalData=(e.additionalData||[]).map(s.fromBase64),t.data=t.dataPayload.toString(),t}findFirstOrNoneTopic(e){return this.topics.filter((t=>e(t)))[0]}getLastTopic(){return this.topics[this.topics.length-1]}}t.TransactionEvent=i;class s{constructor(e){this.raw=e}static fromBase64(e){return new s(Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventData=s;class a{constructor(e){this.raw=Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventTopic=a},9857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionLogs=void 0;const r=n(2591),i=n(1466),s=n(8427);class a{constructor(e){this.address=new i.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new a;return t.address=new i.Address(e.address),t.events=(e.events||[]).map((e=>s.TransactionEvent.fromHttpResponse(e))),t}findSingleOrNoneEvent(e,t){let n=this.findEvents(e,t);if(n.length>1)throw new r.ErrUnexpectedCondition(`more than one event of type ${e}`);return n[0]}findFirstOrNoneEvent(e,t){return this.findEvents(e,t)[0]}findEvents(e,t){let n=this.events.filter((t=>t.identifier==e));return t&&(n=n.filter((e=>t(e)))),n}}t.TransactionLogs=a},496:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionReceipt=void 0;const r=n(1466);class i{constructor(){this.value="",this.sender=new r.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let t=new i;return t.value=(e.value||0).toString(),t.sender=new r.Address(e.sender),t.data=e.data,t.hash=e.txHash,t}}t.TransactionReceipt=i},6188:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionStatus=void 0;class n{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new n("unknown")}isPending(){return"received"==this.status||"pending"==this.status}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return"executed"==this.status||"success"==this.status||"successful"==this.status}isFailed(){return"fail"==this.status||"failed"==this.status||"unsuccessful"==this.status||this.isInvalid()}isInvalid(){return"invalid"==this.status}toString(){return this.status}valueOf(){return this.status}equals(e){return!!e&&this.status==e.status}}t.TransactionStatus=n},6389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOnNetwork=t.prepareTransactionForBroadcasting=void 0;const r=n(6188),i=n(2286),s=n(1466),a=n(9857),o=n(496);t.prepareTransactionForBroadcasting=function(e){return"toSendable"in e?e.toSendable():{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,receiverUsername:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0,gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:0===e.data.length?void 0:Buffer.from(e.data).toString("base64"),chainID:e.chainID,version:e.version,options:e.options,guardian:e.guardian||void 0,signature:Buffer.from(e.signature).toString("hex"),guardianSignature:0===e.guardianSignature.length?void 0:Buffer.from(e.guardianSignature).toString("hex")}};class u{constructor(e){this.hash="",this.type="",this.nonce=0,this.round=0,this.epoch=0,this.value="",this.receiver=new s.Address(""),this.sender=new s.Address(""),this.gasLimit=0,this.gasPrice=0,this.function="",this.data=Buffer.from([]),this.signature="",this.status=r.TransactionStatus.createUnknown(),this.timestamp=0,this.blockNonce=0,this.hyperblockNonce=0,this.hyperblockHash="",this.receipt=new o.TransactionReceipt,this.contractResults=new i.ContractResults([]),this.logs=new a.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e,t,n){let r=u.fromHttpResponse(e,t);return r.contractResults=i.ContractResults.fromProxyHttpResponse(t.smartContractResults||[]),n&&(r.status=n,r.isCompleted=r.status.isSuccessful()||r.status.isFailed()),r}static fromApiHttpResponse(e,t){let n=u.fromHttpResponse(e,t);return n.contractResults=i.ContractResults.fromApiHttpResponse(t.results||[]),n.isCompleted=!n.status.isPending(),n}static fromHttpResponse(e,t){let n=new u;return n.hash=e,n.type=t.type||"",n.nonce=t.nonce||0,n.round=t.round,n.epoch=t.epoch||0,n.value=(t.value||0).toString(),n.sender=new s.Address(t.sender),n.receiver=new s.Address(t.receiver),n.gasPrice=t.gasPrice||0,n.gasLimit=t.gasLimit||0,n.function=t.function||"",n.data=Buffer.from(t.data||"","base64"),n.status=new r.TransactionStatus(t.status),n.timestamp=t.timestamp||0,n.blockNonce=t.blockNonce||0,n.hyperblockNonce=t.hyperblockNonce||0,n.hyperblockHash=t.hyperblockHash||"",n.receipt=o.TransactionReceipt.fromHttpResponse(t.receipt||{}),n.logs=a.TransactionLogs.fromHttpResponse(t.logs||{}),n}getDateTime(){return new Date(1e3*this.timestamp)}}t.TransactionOnNetwork=u},2866:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransferProperties=t.TransactionMetadataTransfer=t.TransactionMetadata=t.TransactionToDecode=t.TransactionDecoder=void 0;const r=n(8603);t.TransactionDecoder=class{getTransactionMetadata(e){const t=this.getNormalTransactionMetadata(e),n=this.getEsdtTransactionMetadata(t);if(n)return n;const r=this.getNftTransferMetadata(t);if(r)return r;return this.getMultiTransferMetadata(t)||t}getNormalTransactionMetadata(e){const t=new s;if(t.sender=e.sender,t.receiver=e.receiver,t.value=BigInt(e.value),e.data){const n=this.base64Decode(e.data).split("@"),r=n.slice(1);if(r.every((e=>this.isSmartContractArgument(e)))&&(t.functionName=n[0],t.functionArgs=r),"relayedTx"===t.functionName&&t.functionArgs&&1===t.functionArgs.length)try{const e=JSON.parse(this.hexToString(t.functionArgs[0]));return e.value=e.value.toString(),e.sender=this.bech32Encode(this.base64ToHex(e.sender)),e.receiver=this.bech32Encode(this.base64ToHex(e.receiver)),this.getNormalTransactionMetadata(e)}catch(e){}if("relayedTxV2"===t.functionName&&t.functionArgs&&4===t.functionArgs.length)try{const n=new i;return n.sender=e.receiver,n.receiver=this.bech32Encode(t.functionArgs[0]),n.data=this.base64Encode(this.hexToString(t.functionArgs[2])),n.value="0",this.getNormalTransactionMetadata(n)}catch(e){}}return t}getMultiTransferMetadata(e){if(e.sender!==e.receiver)return;if("MultiESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<3)return;if(!this.isAddressValid(t[0]))return;const n=this.bech32Encode(t[0]),r=this.hexToNumber(t[1]),i=new s;i.transfers||(i.transfers=[]);let a=2;for(let e=0;e<r;e++){const e=this.hexToString(t[a++]),n=t[a++],r=this.hexToBigInt(t[a++]);n?i.transfers.push({value:r,properties:{collection:e,identifier:`${e}-${n}`}}):i.transfers.push({value:r,properties:{token:e}})}return i.sender=e.sender,i.receiver=n,t.length>a&&(i.functionName=this.hexToString(t[a++]),i.functionArgs=t.slice(a++)),i}getNftTransferMetadata(e){if(e.sender!==e.receiver)return;if("ESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<4)return;if(!this.isAddressValid(t[3]))return;const n=this.hexToString(t[0]),r=t[1],i=this.hexToBigInt(t[2]),a=this.bech32Encode(t[3]),o=new s;return o.sender=e.sender,o.receiver=a,o.value=i,t.length>4&&(o.functionName=this.hexToString(t[4]),o.functionArgs=t.slice(5)),o.transfers=[{value:i,properties:{collection:n,identifier:`${n}-${r}`}}],o}base64Encode(e){return Buffer.from(e).toString("base64")}base64Decode(e){return Buffer.from(e,"base64").toString("binary")}hexToNumber(e){return parseInt(e,16)}getEsdtTransactionMetadata(e){if("ESDTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<2)return;const n=this.hexToString(t[0]),r=this.hexToBigInt(t[1]),i=new s;return i.sender=e.sender,i.receiver=e.receiver,t.length>2&&(i.functionName=this.hexToString(t[2]),i.functionArgs=t.slice(3)),i.transfers=[{value:r,properties:{identifier:n}}],i.value=r,i}bech32Encode(e){const t=Buffer.from(e,"hex"),n=r.bech32.toWords(t);return r.bech32.encode("erd",n)}isAddressValid(e){return 32==Buffer.from(e,"hex").length}isSmartContractArgument(e){return!!this.isHex(e)&&e.length%2==0}isHex(e){return!1===new RegExp(/[^a-f0-9]/gi).test(e)}base64ToHex(e){return Buffer.from(e,"base64").toString("hex")}hexToString(e){return Buffer.from(e,"hex").toString("ascii")}hexToBigInt(e){return e?BigInt("0x"+e):BigInt(0)}};class i{constructor(){this.sender="",this.receiver="",this.data="",this.value="0"}}t.TransactionToDecode=i;class s{constructor(){this.sender="",this.receiver="",this.value=BigInt(0)}}t.TransactionMetadata=s,t.TransactionMetadataTransfer=class{constructor(){this.value=BigInt(0)}},t.TokenTransferProperties=class{}},8603:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={};for(let e=0;e<32;e++){const t=n.charAt(e);r[t]=e}function i(e){const t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){let t=1;for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=i(t)^r>>5}t=i(t);for(let n=0;n<e.length;++n){const r=e.charCodeAt(n);t=i(t)^31&r}return t}function a(e,t,n,r){let i=0,s=0;const a=(1<<n)-1,o=[];for(let r=0;r<e.length;++r)for(i=i<<t|e[r],s+=t;s>=n;)s-=n,o.push(i>>s&a);if(r)s>0&&o.push(i<<n-s&a);else{if(s>=t)return"Excess padding";if(i<<n-s&a)return"Non-zero padding"}return o}function o(e){return a(e,8,5,!0)}function u(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t}function c(e){const t=a(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function a(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";const a=e.toLowerCase(),o=e.toUpperCase();if(e!==a&&e!==o)return"Mixed-case string "+e;const u=(e=a).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),l=e.slice(u+1);if(l.length<6)return"Data too short";let d=s(c);if("string"==typeof d)return d;const f=[];for(let e=0;e<l.length;++e){const t=l.charAt(e),n=r[t];if(void 0===n)return"Unknown character "+t;d=i(d)^n,e+6>=l.length||f.push(n)}return d!==t?"Invalid checksum for "+e:{prefix:c,words:f}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const n=a(e,t);if("object"==typeof n)return n},decode:function(e,t){const n=a(e,t);if("object"==typeof n)return n;throw new Error(n)},encode:function(e,r,a){if(a=a||90,e.length+7+r.length>a)throw new TypeError("Exceeds length limit");let o=s(e=e.toLowerCase());if("string"==typeof o)throw new Error(o);let u=e+"1";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5)throw new Error("Non 5-bit word");o=i(o)^t,u+=n.charAt(t)}for(let e=0;e<6;++e)o=i(o);o^=t;for(let e=0;e<6;++e)u+=n.charAt(o>>5*(5-e)&31);return u},toWords:o,fromWordsUnsafe:u,fromWords:c}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},8045:e=>{"use strict";e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,s=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(s)if(s=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,a(e))}}))}},8839:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),s=0;s<64;)i[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var i,s=null,a=[],o=0,u=0;t<n;){var c=e[t++];switch(u){case 0:a[o++]=r[c>>2],i=(3&c)<<4,u=1;break;case 1:a[o++]=r[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[o++]=r[i|c>>6],a[o++]=r[63&c],u=0}o>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),o=0)}return u&&(a[o++]=r[i],a[o++]=61,1===u&&(a[o++]=61)),s?(o&&s.push(String.fromCharCode.apply(String,a.slice(0,o))),s.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,o=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&o>1)break;if(void 0===(c=i[c]))throw Error(a);switch(o){case 0:r=c,o=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,o=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,o=3;break;case 3:t[n++]=(3&r)<<6|c,o=0}}if(1===o)throw Error(a);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4358:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},9410:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function s(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function o(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:s,e.writeFloatBE=r?s:i,e.readFloatLE=r?a:o,e.readFloatBE=r?o:a}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),i=2*(r>>31)+1,s=r>>>23&255,a=8388607&r;return 255===s?a?NaN:i*(1/0):0===s?1401298464324817e-60*i*a:i*Math.pow(2,s-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function s(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function o(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:s,e.writeDoubleBE=r?s:i,e.readDoubleLE=r?a:o,e.readDoubleBE=r?o:a}():function(){function t(e,t,n,r,i,s){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,i,s+t),e(1/r>0?0:2147483648,i,s+n);else if(isNaN(r))e(0,i,s+t),e(2146959360,i,s+n);else if(r>17976931348623157e292)e(0,i,s+t),e((a<<31|2146435072)>>>0,i,s+n);else{var o;if(r<22250738585072014e-324)e((o=r/5e-324)>>>0,i,s+t),e((a<<31|o/4294967296)>>>0,i,s+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(o=r*Math.pow(2,-u))>>>0,i,s+t),e((a<<31|u+1023<<20|1048576*o&1048575)>>>0,i,s+n)}}}function a(e,t,n,r,i){var s=e(r,i+t),a=e(r,i+n),o=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+s;return 2047===u?c?NaN:o*(1/0):0===u?5e-324*o*c:o*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4153:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},9390:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,s=null,a=r;return function(n){if(n<1||n>i)return e(n);a+n>r&&(s=e(r),a=0);var o=t.call(s,a,a+=n);return 7&a&&(a=1+(7|a)),o}}},1447:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,s=[],a=0;t<n;)(r=e[t++])<128?s[a++]=r:r>191&&r<224?s[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[a++]=55296+(r>>10),s[a++]=56320+(1023&r)):s[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))},n.write=function(e,t,n){for(var r,i,s=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,s=o(e),a=s[0],u=s[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,u)),l=0,d=u>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t),1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],a=16383,o=0,c=r-i;o<c;o+=a)s.push(u(e,o,o+a>c?c:o+a));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,s,a=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},9674:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r<32;r++){var i=t.charAt(r);if(void 0!==n[i])throw new TypeError(i+" is ambiguous");n[i]=r}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,n=0;n<e.length;++n){var r=e.charCodeAt(n);if(r<33||r>126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);t=s(t)^31&i}return t}function o(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var u=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var l=a(u);if("string"==typeof l)return l;for(var d=[],f=0;f<c.length;++f){var h=c.charAt(f),p=n[h];if(void 0===p)return"Unknown character "+h;l=s(l)^p,f+6>=c.length||d.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:d}}function u(e,t,n,r){for(var i=0,s=0,a=(1<<n)-1,o=[],u=0;u<e.length;++u)for(i=i<<t|e[u],s+=t;s>=n;)s-=n,o.push(i>>s&a);if(r)s>0&&o.push(i<<n-s&a);else{if(s>=t)return"Excess padding";if(i<<n-s&a)return"Non-zero padding"}return o}e.exports={decodeUnsafe:function(){var e=o.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=o.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,n,r){if(r=r||90,e.length+7+n.length>r)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",u=0;u<n.length;++u){var c=n[u];if(c>>5)throw new Error("Non 5-bit word");i=s(i)^c,o+=t.charAt(c)}for(u=0;u<6;++u)i=s(i);for(i^=1,u=0;u<6;++u)o+=t.charAt(i>>5*(5-u)&31);return o},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},1594:function(e,t,n){var r;!function(){"use strict";var i,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,o=Math.floor,u="[BigNumber Error] ",c=u+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,f=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,n,r=1,i=e.length,s=e[0]+"";r<i;){for(t=e[r++]+"",n=d-t.length;n--;t="0"+t);s+=t}for(i=s.length;48===s.charCodeAt(--i););return s.slice(0,i+1||1)}function A(e,t){var n,r,i=e.c,s=t.c,a=e.s,o=t.s,u=e.e,c=t.e;if(!a||!o)return null;if(n=i&&!i[0],r=s&&!s[0],n||r)return n?r?0:-o:a;if(a!=o)return a;if(n=a<0,r=u==c,!i||!s)return r?0:!i^n?1:-1;if(!r)return u>c^n?1:-1;for(o=(u=i.length)<(c=s.length)?u:c,a=0;a<o;a++)if(i[a]!=s[a])return i[a]>s[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function b(e,t,n,r){if(e<t||e>n||e!==o(e))throw Error(u+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function T(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function w(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var n,r,i,I,S,E,C,_,B,O,N=j.prototype={constructor:j,toString:null,valueOf:null},x=new j(1),P=20,D=4,k=-7,R=21,L=-1e7,F=1e7,U=!1,M=1,V=0,G={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function j(e,t){var n,a,u,l,h,p,g,m,y=this;if(!(y instanceof j))return new j(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>F?y.c=y.e=null:e.e<L?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,h=e;h>=10;h/=10,l++);return void(l>F?y.c=y.e=null:(y.e=l,y.c=[e]))}m=String(e)}else{if(!s.test(m=String(e)))return i(y,m,p);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(l=m.indexOf("."))>-1&&(m=m.replace(".","")),(h=m.search(/e/i))>0?(l<0&&(l=h),l+=+m.slice(h+1),m=m.substring(0,h)):l<0&&(l=m.length)}else{if(b(t,2,H.length,"Base"),10==t)return K(y=new j(e),P+y.e+1,D);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(y,m,p,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,j.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(n=H.slice(0,t),l=h=0,g=m.length;h<g;h++)if(n.indexOf(a=m.charAt(h))<0){if("."==a){if(h>l){l=g;continue}}else if(!u&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){u=!0,h=-1,l=0;continue}return i(y,String(e),p,t)}p=!1,(l=(m=r(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):l=m.length}for(h=0;48===m.charCodeAt(h);h++);for(g=m.length;48===m.charCodeAt(--g););if(m=m.slice(h,++g)){if(g-=h,p&&j.DEBUG&&g>15&&(e>f||e!==o(e)))throw Error(c+y.s*e);if((l=l-h-1)>F)y.c=y.e=null;else if(l<L)y.c=[y.e=0];else{if(y.e=l,y.c=[],h=(l+1)%d,l<0&&(h+=d),h<g){for(h&&y.c.push(+m.slice(0,h)),g-=d;h<g;)y.c.push(+m.slice(h,h+=d));h=d-(m=m.slice(h)).length}else h-=g;for(;h--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function q(e,t,n,r){var i,s,a,o,u;if(null==n?n=D:b(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=y(e.c),u=1==r||2==r&&(a<=k||a>=R)?w(u,a):v(u,a,"0");else if(s=(e=K(new j(e),t,n)).e,o=(u=y(e.c)).length,1==r||2==r&&(t<=s||s<=k)){for(;o<t;u+="0",o++);u=w(u,s)}else if(t-=a,u=v(u,s,"0"),s+1>o){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-o)>0)for(s+1==o&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function Q(e,t){for(var n,r=1,i=new j(e[0]);r<e.length;r++){if(!(n=new j(e[r])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function z(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*d-1)>F?e.c=e.e=null:n<L?e.c=[e.e=0]:(e.e=n,e.c=t),e}function K(e,t,n,r){var i,s,u,c,f,p,g,m=e.c,y=h;if(m){e:{for(i=1,c=m[0];c>=10;c/=10,i++);if((s=t-i)<0)s+=d,u=t,g=(f=m[p=0])/y[i-u-1]%10|0;else if((p=a((s+1)/d))>=m.length){if(!r)break e;for(;m.length<=p;m.push(0));f=g=0,i=1,u=(s%=d)-d+1}else{for(f=c=m[p],i=1;c>=10;c/=10,i++);g=(u=(s%=d)-d+i)<0?0:f/y[i-u-1]%10|0}if(r=r||t<0||null!=m[p+1]||(u<0?f:f%y[i-u-1]),r=n<4?(g||r)&&(0==n||n==(e.s<0?3:2)):g>5||5==g&&(4==n||r||6==n&&(s>0?u>0?f/y[i-u]:0:m[p-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=y[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==s?(m.length=p,c=1,p--):(m.length=p+1,c=y[d-s],m[p]=u>0?o(f/y[i-u]%y[u])*c:0),r)for(;;){if(0==p){for(s=1,u=m[0];u>=10;u/=10,s++);for(u=m[0]+=c,c=1;u>=10;u/=10,c++);s!=c&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=c,m[p]!=l)break;m[p--]=0,c=1}for(s=m.length;0===m[--s];m.pop());}e.e>F?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function W(e){var t,n=e.e;return null===n?e.toString():(t=y(e.c),t=n<=k||n>=R?w(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return j.clone=e,j.ROUND_UP=0,j.ROUND_DOWN=1,j.ROUND_CEIL=2,j.ROUND_FLOOR=3,j.ROUND_HALF_UP=4,j.ROUND_HALF_DOWN=5,j.ROUND_HALF_EVEN=6,j.ROUND_HALF_CEIL=7,j.ROUND_HALF_FLOOR=8,j.EUCLID=9,j.config=j.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(n=e[t],0,g,t),P=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(n=e[t],0,8,t),D=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(b(n[0],-g,0,t),b(n[1],0,g,t),k=n[0],R=n[1]):(b(n,-g,g,t),k=-(R=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)b(n[0],-g,-1,t),b(n[1],1,g,t),L=n[0],F=n[1];else{if(b(n,-g,g,t),!n)throw Error(u+t+" cannot be zero: "+n);L=-(F=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(u+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!n,Error(u+"crypto unavailable");U=n}else U=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(n=e[t],0,9,t),M=n),e.hasOwnProperty(t="POW_PRECISION")&&(b(n=e[t],0,g,t),V=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(u+t+" not an object: "+n);G=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(u+t+" invalid: "+n);H=n}}return{DECIMAL_PLACES:P,ROUNDING_MODE:D,EXPONENTIAL_AT:[k,R],RANGE:[L,F],CRYPTO:U,MODULO_MODE:M,POW_PRECISION:V,FORMAT:G,ALPHABET:H}},j.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!j.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===s||-1===s)&&i>=-g&&i<=g&&i===o(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=l||n!==o(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},j.maximum=j.max=function(){return Q(arguments,N.lt)},j.minimum=j.min=function(){return Q(arguments,N.gt)},j.random=(I=9007199254740992,S=Math.random()*I&2097151?function(){return o(Math.random()*I)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,i,s,c=0,l=[],f=new j(x);if(null==e?e=P:b(e,0,g),i=a(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(s=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(l.push(s%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);c<i;)(s=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(l.push(s%1e14),c+=7);c=i/7}if(!U)for(;c<i;)(s=S())<9e15&&(l[c++]=s%1e14);for(i=l[--c],e%=d,i&&e&&(s=h[d-e],l[c]=o(i/s)*s);0===l[c];l.pop(),c--);if(c<0)l=[r=0];else{for(r=-1;0===l[0];l.splice(0,1),r-=d);for(c=1,s=l[0];s>=10;s/=10,c++);c<d&&(r-=d-c)}return f.e=r,f.c=l,f}),j.sum=function(){for(var e=1,t=arguments,n=new j(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e="0123456789";function t(e,t,n,r){for(var i,s,a=[0],o=0,u=e.length;o<u;){for(s=a.length;s--;a[s]*=t);for(a[0]+=r.indexOf(e.charAt(o++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,s,a,o){var u,c,l,d,f,h,p,g,m=r.indexOf("."),A=P,b=D;for(m>=0&&(d=V,V=0,r=r.replace(".",""),h=(g=new j(i)).pow(r.length-m),V=d,g.c=t(v(y(h.c),h.e,"0"),10,s,e),g.e=g.c.length),l=d=(p=t(r,i,s,o?(u=H,e):(u=e,H))).length;0==p[--d];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=n(h,g,A,b,s)).c,f=h.r,l=h.e),m=p[c=l+A+1],d=s/2,f=f||c<0||null!=p[c+1],f=b<4?(null!=m||f)&&(0==b||b==(h.s<0?3:2)):m>d||m==d&&(4==b||f||6==b&&1&p[c-1]||b==(h.s<0?8:7)),c<1||!p[0])r=f?v(u.charAt(1),-A,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--s;++p[--c]>s;)p[c]=0,c||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(m=0,r="";m<=d;r+=u.charAt(p[m++]));r=v(r,l,u.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,s,a,o=0,u=e.length,c=t%p,l=t/p|0;for(e=e.slice();u--;)o=((i=c*(s=e[u]%p)+(r=l*s+(a=e[u]/p|0)*c)%p*p+o)/n|0)+(r/p|0)+l*a,e[u]=i%n;return o&&(e=[o].concat(e)),e}function t(e,t,n,r){var i,s;if(n!=r)s=n>r?1:-1;else for(i=s=0;i<n;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,s,a,u){var c,f,h,p,g,y,A,b,T,w,v,I,S,E,C,_,B,O=r.s==i.s?1:-1,N=r.c,x=i.c;if(!(N&&N[0]&&x&&x[0]))return new j(r.s&&i.s&&(N?!x||N[0]!=x[0]:x)?N&&0==N[0]||!x?0*O:O/0:NaN);for(T=(b=new j(O)).c=[],O=s+(f=r.e-i.e)+1,u||(u=l,f=m(r.e/d)-m(i.e/d),O=O/d|0),h=0;x[h]==(N[h]||0);h++);if(x[h]>(N[h]||0)&&f--,O<0)T.push(1),p=!0;else{for(E=N.length,_=x.length,h=0,O+=2,(g=o(u/(x[0]+1)))>1&&(x=e(x,g,u),N=e(N,g,u),_=x.length,E=N.length),S=_,v=(w=N.slice(0,_)).length;v<_;w[v++]=0);B=x.slice(),B=[0].concat(B),C=x[0],x[1]>=u/2&&C++;do{if(g=0,(c=t(x,w,_,v))<0){if(I=w[0],_!=v&&(I=I*u+(w[1]||0)),(g=o(I/C))>1)for(g>=u&&(g=u-1),A=(y=e(x,g,u)).length,v=w.length;1==t(y,w,A,v);)g--,n(y,_<A?B:x,A,u),A=y.length,c=1;else 0==g&&(c=g=1),A=(y=x.slice()).length;if(A<v&&(y=[0].concat(y)),n(w,y,v,u),v=w.length,-1==c)for(;t(x,w,_,v)<1;)g++,n(w,_<v?B:x,v,u),v=w.length}else 0===c&&(g++,w=[0]);T[h++]=g,w[0]?w[v++]=N[S]||0:(w=[N[S]],v=1)}while((S++<E||null!=w[0])&&O--);p=null!=w[0],T[0]||T.splice(0,1)}if(u==l){for(h=1,O=T[0];O>=10;O/=10,h++);K(b,s+(b.e=h+f*d-1)+1,a,p)}else b.e=f,b.r=+p;return b}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,_=/^\.([^.]+)$/,B=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,r){var i,s=n?t:t.replace(O,"");if(B.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(E,(function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t})),r&&(i=r,s=s.replace(C,"$1").replace(_,"0.$1")),t!=s))return new j(s,i);if(j.DEBUG)throw Error(u+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},N.absoluteValue=N.abs=function(){var e=new j(this);return e.s<0&&(e.s=1),e},N.comparedTo=function(e,t){return A(this,new j(e,t))},N.decimalPlaces=N.dp=function(e,t){var n,r,i,s=this;if(null!=e)return b(e,0,g),null==t?t=D:b(t,0,8),K(new j(s),e+s.e+1,t);if(!(n=s.c))return null;if(r=((i=n.length-1)-m(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},N.dividedBy=N.div=function(e,t){return n(this,new j(e,t),P,D)},N.dividedToIntegerBy=N.idiv=function(e,t){return n(this,new j(e,t),0,1)},N.exponentiatedBy=N.pow=function(e,t){var n,r,i,s,c,l,f,h,p=this;if((e=new j(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+W(e));if(null!=t&&(t=new j(t)),c=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new j(Math.pow(+W(p),c?2-T(e):+W(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new j(NaN);(r=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||c&&p.c[1]>=24e7:p.c[0]<8e13||c&&p.c[0]<=9999975e7)))return s=p.s<0&&T(e)?-0:0,p.e>-1&&(s=1/s),new j(l?1/s:s);V&&(s=a(V/d+2))}for(c?(n=new j(.5),l&&(e.s=1),f=T(e)):f=(i=Math.abs(+W(e)))%2,h=new j(x);;){if(f){if(!(h=h.times(p)).c)break;s?h.c.length>s&&(h.c.length=s):r&&(h=h.mod(t))}if(i){if(0===(i=o(i/2)))break;f=i%2}else if(K(e=e.times(n),e.e+1,1),e.e>14)f=T(e);else{if(0==(i=+W(e)))break;f=i%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):r&&(p=p.mod(t))}return r?h:(l&&(h=x.div(h)),t?h.mod(t):s?K(h,V,D,void 0):h)},N.integerValue=function(e){var t=new j(this);return null==e?e=D:b(e,0,8),K(t,t.e+1,e)},N.isEqualTo=N.eq=function(e,t){return 0===A(this,new j(e,t))},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(e,t){return A(this,new j(e,t))>0},N.isGreaterThanOrEqualTo=N.gte=function(e,t){return 1===(t=A(this,new j(e,t)))||0===t},N.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},N.isLessThan=N.lt=function(e,t){return A(this,new j(e,t))<0},N.isLessThanOrEqualTo=N.lte=function(e,t){return-1===(t=A(this,new j(e,t)))||0===t},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.minus=function(e,t){var n,r,i,s,a=this,o=a.s;if(t=(e=new j(e,t)).s,!o||!t)return new j(NaN);if(o!=t)return e.s=-t,a.plus(e);var u=a.e/d,c=e.e/d,f=a.c,h=e.c;if(!u||!c){if(!f||!h)return f?(e.s=-t,e):new j(h?a:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new j(f[0]?a:3==D?-0:0)}if(u=m(u),c=m(c),f=f.slice(),o=u-c){for((s=o<0)?(o=-o,i=f):(c=u,i=h),i.reverse(),t=o;t--;i.push(0));i.reverse()}else for(r=(s=(o=f.length)<(t=h.length))?o:t,o=t=0;t<r;t++)if(f[t]!=h[t]){s=f[t]<h[t];break}if(s&&(i=f,f=h,h=i,e.s=-e.s),(t=(r=h.length)-(n=f.length))>0)for(;t--;f[n++]=0);for(t=l-1;r>o;){if(f[--r]<h[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=l}f[r]-=h[r]}for(;0==f[0];f.splice(0,1),--c);return f[0]?z(e,f,c):(e.s=3==D?-1:1,e.c=[e.e=0],e)},N.modulo=N.mod=function(e,t){var r,i,s=this;return e=new j(e,t),!s.c||!e.s||e.c&&!e.c[0]?new j(NaN):!e.c||s.c&&!s.c[0]?new j(s):(9==M?(i=e.s,e.s=1,r=n(s,e,0,3),e.s=i,r.s*=i):r=n(s,e,0,M),(e=s.minus(r.times(e))).c[0]||1!=M||(e.s=s.s),e)},N.multipliedBy=N.times=function(e,t){var n,r,i,s,a,o,u,c,f,h,g,y,A,b,T,w=this,v=w.c,I=(e=new j(e,t)).c;if(!(v&&I&&v[0]&&I[0]))return!w.s||!e.s||v&&!v[0]&&!I||I&&!I[0]&&!v?e.c=e.e=e.s=null:(e.s*=w.s,v&&I?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=m(w.e/d)+m(e.e/d),e.s*=w.s,(u=v.length)<(h=I.length)&&(A=v,v=I,I=A,i=u,u=h,h=i),i=u+h,A=[];i--;A.push(0));for(b=l,T=p,i=h;--i>=0;){for(n=0,g=I[i]%T,y=I[i]/T|0,s=i+(a=u);s>i;)n=((c=g*(c=v[--a]%T)+(o=y*c+(f=v[a]/T|0)*g)%T*T+A[s]+n)/b|0)+(o/T|0)+y*f,A[s--]=c%b;A[s]=n}return n?++r:A.splice(0,1),z(e,A,r)},N.negated=function(){var e=new j(this);return e.s=-e.s||null,e},N.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new j(e,t)).s,!i||!t)return new j(NaN);if(i!=t)return e.s=-t,r.minus(e);var s=r.e/d,a=e.e/d,o=r.c,u=e.c;if(!s||!a){if(!o||!u)return new j(i/0);if(!o[0]||!u[0])return u[0]?e:new j(o[0]?r:0*i)}if(s=m(s),a=m(a),o=o.slice(),i=s-a){for(i>0?(a=s,n=u):(i=-i,n=o),n.reverse();i--;n.push(0));n.reverse()}for((i=o.length)-(t=u.length)<0&&(n=u,u=o,o=n,t=i),i=0;t;)i=(o[--t]=o[t]+u[t]+i)/l|0,o[t]=l===o[t]?0:o[t]%l;return i&&(o=[i].concat(o),++a),z(e,o,a)},N.precision=N.sd=function(e,t){var n,r,i,s=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=D:b(t,0,8),K(new j(s),e,t);if(!(n=s.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&s.e+1>r&&(r=s.e+1),r},N.shiftedBy=function(e){return b(e,-9007199254740991,f),this.times("1e"+e)},N.squareRoot=N.sqrt=function(){var e,t,r,i,s,a=this,o=a.c,u=a.s,c=a.e,l=P+4,d=new j("0.5");if(1!==u||!o||!o[0])return new j(!u||u<0&&(!o||o[0])?NaN:o?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=y(o)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=m((c+1)/2)-(c<0||c%2),r=new j(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new j(u+""),r.c[0])for((u=(c=r.e)+l)<3&&(u=0);;)if(s=r,r=d.times(s.plus(n(a,s,l,1))),y(s.c).slice(0,u)===(t=y(r.c)).slice(0,u)){if(r.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(r,r.e+P+2,1),e=!r.times(r).eq(a));break}if(!i&&(K(s,s.e+P+2,0),s.times(s).eq(a))){r=s;break}l+=4,u+=4,i=1}return K(r,r.e+P+1,D,e)},N.toExponential=function(e,t){return null!=e&&(b(e,0,g),e++),q(this,e,t,1)},N.toFixed=function(e,t){return null!=e&&(b(e,0,g),e=e+this.e+1),q(this,e,t)},N.toFormat=function(e,t,n){var r,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=G;else if("object"!=typeof n)throw Error(u+"Argument not an object: "+n);if(r=i.toFixed(e,t),i.c){var s,a=r.split("."),o=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",d=a[0],f=a[1],h=i.s<0,p=h?d.slice(1):d,g=p.length;if(c&&(s=o,o=c,c=s,g-=s),o>0&&g>0){for(s=g%o||o,d=p.substr(0,s);s<g;s+=o)d+=l+p.substr(s,o);c>0&&(d+=l+p.slice(s)),h&&(d="-"+d)}r=f?d+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):f):d}return(n.prefix||"")+r+(n.suffix||"")},N.toFraction=function(e){var t,r,i,s,a,o,c,l,f,p,g,m,A=this,b=A.c;if(null!=e&&(!(c=new j(e)).isInteger()&&(c.c||1!==c.s)||c.lt(x)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!b)return new j(A);for(t=new j(x),f=r=new j(x),i=l=new j(x),m=y(b),a=t.e=m.length-A.e-1,t.c[0]=h[(o=a%d)<0?d+o:o],e=!e||c.comparedTo(t)>0?a>0?t:f:c,o=F,F=1/0,c=new j(m),l.c[0]=0;p=n(c,t,0,1),1!=(s=r.plus(p.times(i))).comparedTo(e);)r=i,i=s,f=l.plus(p.times(s=f)),l=s,t=c.minus(p.times(s=t)),c=s;return s=n(e.minus(r),i,0,1),l=l.plus(s.times(f)),r=r.plus(s.times(i)),l.s=f.s=A.s,g=n(f,i,a*=2,D).minus(A).abs().comparedTo(n(l,r,a,D).minus(A).abs())<1?[f,i]:[l,r],F=o,g},N.toNumber=function(){return+W(this)},N.toPrecision=function(e,t){return null!=e&&b(e,1,g),q(this,e,t,2)},N.toString=function(e){var t,n=this,i=n.s,s=n.e;return null===s?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=s<=k||s>=R?w(y(n.c),s):v(y(n.c),s,"0"):10===e?t=v(y((n=K(new j(n),P+s+1,D)).c),n.e,"0"):(b(e,2,H.length,"Base"),t=r(v(y(n.c),s,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},N.valueOf=N.toJSON=function(){return W(this)},N._isBigNumber=!0,null!=t&&j.set(t),j}(),i.default=i.BigNumber=i,void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},1892:(e,t,n)=>{function r(e){if(!r.supported)return null;var t,s=e&&e.imports,a=(t="AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBx8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAZfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgHXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBF8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAWfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgE3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIICB8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAefHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgG3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB98fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAUfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgF3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBh8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCASfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBV8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAYfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgGnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBR8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiASfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB18fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAcfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggH3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBN8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAXfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgFnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBt8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAVfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggEXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFICB8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAZfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgGnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBF8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAWfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBN8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAVfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggG3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIICB8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAffHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBx8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAdfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggF3x8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBl8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAUfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgHnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBN8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAdfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgF3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBt8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByARfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBl8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAUfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgFXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB58fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAYfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFnx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIICB8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAffHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgEnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBp8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAdfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgFnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBJ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAgfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgH3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB58fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAVfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggG3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBF8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAYfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgF3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBR8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAafHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggE3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBl8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAcfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBx8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAYfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgH3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIB18fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByASfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggFHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBp8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAWfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHICB8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAVfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBd8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSATfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgG3x8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBd8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAgfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgH3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBp8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAcfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBF8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAZfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgHXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBN8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAefHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgGHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBJ8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAVfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgG3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBZ8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAbfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgE3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBl8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAVfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGHx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBd8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCASfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggFnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGICB8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAcfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgGnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB98fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAUfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB58fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSARfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgEXx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBJ8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiATfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgFHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBV8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAWfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggF3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBh8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAZfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgGnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBt8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAcfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB58fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAffHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgIHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB98fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAbfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBl8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAafHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgIHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIB58fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAXfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEnx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB18fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL","function"==typeof atob?new Uint8Array(atob(t).split("").map(i)):new(n(8287).Buffer)(t,"base64")),o=null,u={buffer:a,memory:null,exports:null,realloc:function(e){u.exports.memory.grow(Math.ceil(Math.abs(e-u.memory.length)/65536)),u.memory=new Uint8Array(u.exports.memory.buffer)},onload:c};return c((function(){})),u;function c(t){if(u.exports)return t();if(o)o.then(t.bind(null,null)).catch(t);else{try{if(e&&e.async)throw new Error("async");l({instance:new WebAssembly.Instance(new WebAssembly.Module(a),s)})}catch(e){o=WebAssembly.instantiate(a,s).then(l)}c(t)}}function l(e){u.exports=e.instance.exports,u.memory=u.exports.memory&&u.exports.memory.buffer&&new Uint8Array(u.exports.memory.buffer)}}function i(e){return e.charCodeAt(0)}e.exports=r,r.supported="undefined"!=typeof WebAssembly},1685:(e,t,n)=>{var r=n(6889),i=n(1892)(),s=64,a=[];e.exports=h;var o=e.exports.BYTES_MIN=16,u=e.exports.BYTES_MAX=64,c=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,d=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),f=e.exports.PERSONALBYTES=16;function h(e,t,n,p,g){if(!(this instanceof h))return new h(e,t,n,p,g);if(!i||!i.exports)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==g&&(r(e>=o,"digestLength must be at least "+o+", was given "+e),r(e<=u,"digestLength must be at most "+u+", was given "+e),null!=t&&r(t.length>=c,"key must be at least "+c+", was given "+t.length),null!=t&&r(t.length<=l,"key must be at least "+l+", was given "+t.length),null!=n&&r(n.length===d,"salt must be exactly "+d+", was given "+n.length),null!=p&&r(p.length===f,"personal must be exactly "+f+", was given "+p.length)),a.length||(a.push(s),s+=216),this.digestLength=e,this.finalized=!1,this.pointer=a.pop(),i.memory.fill(0,0,64),i.memory[0]=this.digestLength,i.memory[1]=t?t.length:0,i.memory[2]=1,i.memory[3]=1,n&&i.memory.set(n,32),p&&i.memory.set(p,48),this.pointer+216>i.memory.length&&i.realloc(this.pointer+216),i.exports.blake2b_init(this.pointer,this.digestLength),t&&(this.update(t),i.memory.fill(0,s,s+t.length),i.memory[this.pointer+200]=128)}function p(){}h.prototype.update=function(e){return r(!1===this.finalized,"Hash instance finalized"),r(e,"input must be TypedArray or Buffer"),s+e.length>i.memory.length&&i.realloc(s+e.length),i.memory.set(e,s),i.exports.blake2b_update(this.pointer,s,s+e.length),this},h.prototype.digest=function(e){if(r(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,a.push(this.pointer),i.exports.blake2b_final(this.pointer),!e||"binary"===e)return i.memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("hex"===e)return function(e,t,n){for(var r="",i=0;i<n;i++)r+=(s=e[t+i])<16?"0"+s.toString(16):s.toString(16);var s;return r}(i.memory,this.pointer+128,this.digestLength);r(e.length>=this.digestLength,"input must be TypedArray or Buffer");for(var t=0;t<this.digestLength;t++)e[t]=i.memory[this.pointer+128+t];return e},h.prototype.final=h.prototype.digest,h.WASM=i&&i.buffer,h.SUPPORTED="undefined"!=typeof WebAssembly,h.ready=function(e){return e||(e=p),i?new Promise((function(t,n){i.onload((function(r){r?n():t(),e(r)}))})):e(new Error("WebAssembly not supported"))},h.prototype.ready=h.ready},2206:(e,t,n)=>{var r=n(6889),i=n(1685);function s(e,t,n){var r=e[t]+e[n],i=e[t+1]+e[n+1];r>=4294967296&&i++,e[t]=r,e[t+1]=i}function a(e,t,n,r){var i=e[t]+n;n<0&&(i+=4294967296);var s=e[t+1]+r;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function u(e,t,n,r,i,o){var u=f[i],c=f[i+1],l=f[o],h=f[o+1];s(d,e,t),a(d,e,u,c);var p=d[r]^d[e],g=d[r+1]^d[e+1];d[r]=g,d[r+1]=p,s(d,n,r),p=d[t]^d[n],g=d[t+1]^d[n+1],d[t]=p>>>24^g<<8,d[t+1]=g>>>24^p<<8,s(d,e,t),a(d,e,l,h),p=d[r]^d[e],g=d[r+1]^d[e+1],d[r]=p>>>16^g<<16,d[r+1]=g>>>16^p<<16,s(d,n,r),p=d[t]^d[n],g=d[t+1]^d[n+1],d[t]=g>>>31^p<<1,d[t+1]=p>>>31^g<<1}var c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),l=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),d=new Uint32Array(32),f=new Uint32Array(32);function h(e,t){var n=0;for(n=0;n<16;n++)d[n]=e.h[n],d[n+16]=c[n];for(d[24]=d[24]^e.t,d[25]=d[25]^e.t/4294967296,t&&(d[28]=~d[28],d[29]=~d[29]),n=0;n<32;n++)f[n]=o(e.b,4*n);for(n=0;n<12;n++)u(0,8,16,24,l[16*n+0],l[16*n+1]),u(2,10,18,26,l[16*n+2],l[16*n+3]),u(4,12,20,28,l[16*n+4],l[16*n+5]),u(6,14,22,30,l[16*n+6],l[16*n+7]),u(0,10,20,30,l[16*n+8],l[16*n+9]),u(2,12,22,24,l[16*n+10],l[16*n+11]),u(4,14,16,26,l[16*n+12],l[16*n+13]),u(6,8,18,28,l[16*n+14],l[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^d[n]^d[n+16]}var p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function g(e,t,n,r){p.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,n&&p.set(n,32),r&&p.set(r,48);for(var i=0;i<16;i++)this.h[i]=c[i]^o(p,4*i);t&&(m(this,t),this.c=128)}function m(e,t){for(var n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[n]}g.prototype.update=function(e){return r(null!=e,"input must be Uint8Array or Buffer"),m(this,e),this},g.prototype.digest=function(e){var t=e&&"binary"!==e&&"hex"!==e?e:new Uint8Array(this.outlen);return r(t.length>=this.outlen,"out must have at least outlen bytes of space"),function(e,t){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);for(var n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n)}(this,t),"hex"===e?function(e){for(var t="",n=0;n<e.length;n++)t+=(r=e[n])<16?"0"+r.toString(16):r.toString(16);var r;return t}(t):t},g.prototype.final=g.prototype.digest,g.ready=function(e){i.ready((function(){e()}))};var y=g;e.exports=function(e,t,n,i,s){return!0!==s&&(r(e>=A,"outlen must be at least "+A+", was given "+e),r(e<=b,"outlen must be at most "+b+", was given "+e),null!=t&&r(t.length>=T,"key must be at least "+T+", was given "+t.length),null!=t&&r(t.length<=w,"key must be at most "+w+", was given "+t.length),null!=n&&r(n.length===v,"salt must be exactly "+v+", was given "+n.length),null!=i&&r(i.length===I,"personal must be exactly "+I+", was given "+i.length)),new y(e,t,n,i)},e.exports.ready=function(e){i.ready((function(){e()}))},e.exports.WASM_SUPPORTED=i.SUPPORTED,e.exports.WASM_LOADED=!1;var A=e.exports.BYTES_MIN=16,b=e.exports.BYTES_MAX=64,T=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),w=e.exports.KEYBYTES_MAX=64,v=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),I=e.exports.PERSONALBYTES=16;i.ready((function(t){t||(e.exports.WASM_LOADED=!0,y=i)}))},8287:(e,t,n)=>{"use strict";const r=n(7526),i=n(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=o(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),o(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=o(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return B(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function A(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){let s,a=1,o=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(s=n;s<o;s++)if(c(e,s)===c(t,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===u)return r*a}else-1!==r&&(s-=s-r),r=-1}else for(n+u>o&&(n=o-u),s=n;s>=0;s--){let n=!0;for(let r=0;r<u;r++)if(c(e,s+r)!==c(t,r)){n=!1;break}if(n)return s}return-1}function T(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=t.length;let a;for(r>s/2&&(r=s/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(Y(r))return a;e[n+a]=r}return a}function w(e,t,n,r){return W(z(t,e.length-n),e,n,r)}function v(e,t,n,r){return W(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function I(e,t,n,r){return W(K(t),e,n,r)}function S(e,t,n,r){return W(function(e,t){let n,r,i;const s=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let s=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,o,u;switch(a){case 1:t<128&&(s=t);break;case 2:n=e[i+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(s=u));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:n=e[i+1],r=e[i+2],o=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&o)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&o,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},u.allocUnsafe=function(e){return d(e)},u.allocUnsafeSlow=function(e){return d(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,s=Math.min(n,r);i<s;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=u.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if($(t,Uint8Array))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const o=Math.min(s,a),c=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<o;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:a<s?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return A(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return A(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return I(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function B(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function N(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=J[e[r]];return i}function x(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function k(e,t,n,r,i){H(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function R(e,t,n,r,i){H(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function L(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,s){return t=+t,n>>>=0,s||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,s){return t=+t,n>>>=0,s||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,i=1,s=this[e+--r];for(;r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||q(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const s=u.isBuffer(e)?e:u.from(e,r),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%a]}return this};const M={};function V(e,t,n){M[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function G(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,i,s){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new M.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||q(t,e.length-(n+1))}(r,i,s)}function j(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new M.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),V("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=G(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const Q=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const s=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function K(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},7007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,s,a,c;if(o(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),a=s[t]),void 0===a)a=s[t]=n,++e._eventsCount;else if("function"==typeof a?a=s[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var c=u.length,l=p(u,c);for(n=0;n<c;++n)r(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,s,a;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){a=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,n,r,i){var s,a,o=8*i-r-1,u=(1<<o)-1,c=u>>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=o;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=c}return(h?-1:1)*a*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var a,o,u,c=8*s-i-1,l=(1<<c)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(o=0,a=l):a+d>=1?(o=(t*u-1)*Math.pow(2,i),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},1013:(e,t,n)=>{var r=n(7372).stringify,i=n(8146);e.exports=function(e){return{parse:i(e),stringify:r}},e.exports.parse=i(),e.exports.stringify=r},8146:(e,t,n)=>{var r=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,s=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var a,o,u,c,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},d=function(e){throw{name:"SyntaxError",message:e,at:a,text:u}},f=function(e){return e&&e!==o&&d("Expected '"+e+"' instead of '"+o+"'"),o=u.charAt(a),a+=1,o},h=function(){var e,i="";for("-"===o&&(i="-",f("-"));o>="0"&&o<="9";)i+=o,f();if("."===o)for(i+=".";f()&&o>="0"&&o<="9";)i+=o;if("e"===o||"E"===o)for(i+=o,f(),"-"!==o&&"+"!==o||(i+=o,f());o>="0"&&o<="9";)i+=o,f();if(e=+i,isFinite(e))return null==r&&(r=n(1594)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new r(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new r(e):e;d("Bad number")},p=function(){var e,t,n,r="";if('"'===o)for(var i=a;f();){if('"'===o)return a-1>i&&(r+=u.substring(i,a-1)),f(),r;if("\\"===o){if(a-1>i&&(r+=u.substring(i,a-1)),f(),"u"===o){for(n=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof l[o])break;r+=l[o]}i=a}}d("Bad string")},g=function(){for(;o&&o<=" ";)f()};return c=function(){switch(g(),o){case"{":return function(){var e,n=Object.create(null);if("{"===o){if(f("{"),g(),"}"===o)return f("}"),n;for(;o;){if(e=p(),g(),f(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&d('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?d("Object contains forbidden prototype property"):"ignore"===t.protoAction?c():n[e]=c():!0===s.test(e)?"error"===t.constructorAction?d("Object contains forbidden constructor property"):"ignore"===t.constructorAction?c():n[e]=c():n[e]=c(),g(),"}"===o)return f("}"),n;f(","),g()}}d("Bad object")}();case"[":return function(){var e=[];if("["===o){if(f("["),g(),"]"===o)return f("]"),e;for(;o;){if(e.push(c()),g(),"]"===o)return f("]"),e;f(","),g()}}d("Bad array")}();case'"':return p();case"-":return h();default:return o>="0"&&o<="9"?h():function(){switch(o){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}d("Unexpected '"+o+"'")}()}},function(e,t){var n;return u=e+"",a=0,o=" ",n=c(),g(),o&&d("Syntax error"),"function"==typeof t?function e(n,r){var i,s=n[r];return s&&"object"==typeof s&&Object.keys(s).forEach((function(t){void 0!==(i=e(s,t))?s[t]=i:delete s[t]})),t.call(n,r,s)}({"":n},""):n}}},7372:(e,t,n)=>{var r=n(1594),i=e.exports;!function(){"use strict";var e,t,n,s=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return s.lastIndex=0,s.test(e)?'"'+e.replace(s,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function u(i,s){var a,c,l,d,f,h=e,p=s[i],g=null!=p&&(p instanceof r||r.isBigNumber(p));switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(i)),"function"==typeof n&&(p=n.call(s,i,p)),typeof p){case"string":return g?p:o(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(e+=t,f=[],"[object Array]"===Object.prototype.toString.apply(p)){for(d=p.length,a=0;a<d;a+=1)f[a]=u(a,p)||"null";return l=0===f.length?"[]":e?"[\n"+e+f.join(",\n"+e)+"\n"+h+"]":"["+f.join(",")+"]",e=h,l}if(n&&"object"==typeof n)for(d=n.length,a=0;a<d;a+=1)"string"==typeof n[a]&&(l=u(c=n[a],p))&&f.push(o(c)+(e?": ":":")+l);else Object.keys(p).forEach((function(t){var n=u(t,p);n&&f.push(o(t)+(e?": ":":")+n)}));return l=0===f.length?"{}":e?"{\n"+e+f.join(",\n"+e)+"\n"+h+"}":"{"+f.join(",")+"}",e=h,l}}"function"!=typeof i.stringify&&(i.stringify=function(r,i,s){var a;if(e="",t="","number"==typeof s)for(a=0;a<s;a+=1)t+=" ";else"string"==typeof s&&(t=s);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return u("",{"":r})})}()},5508:(e,t,n)=>{e.exports=n(9792)(n(4817))},9792:(e,t,n)=>{const r=n(212),i=n(4614);e.exports=function(e){const t=r(e),n=i(e);return function(e,r){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,r);case"keccak256":return new t(1088,512,null,256,r);case"keccak384":return new t(832,768,null,384,r);case"keccak512":return new t(576,1024,null,512,r);case"sha3-224":return new t(1152,448,6,224,r);case"sha3-256":return new t(1088,512,6,256,r);case"sha3-384":return new t(832,768,6,384,r);case"sha3-512":return new t(576,1024,6,512,r);case"shake128":return new n(1344,256,31,r);case"shake256":return new n(1088,512,31,r);default:throw new Error("Invald algorithm: "+e)}}}},212:(e,t,n)=>{const{Transform:r}=n(8399);e.exports=e=>class t extends r{constructor(t,n,r,i,s){super(s),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=i,this._options=s,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},4614:(e,t,n)=>{const{Transform:r}=n(8399);e.exports=e=>class t extends r{constructor(t,n,r,i){super(i),this._rate=t,this._capacity=n,this._delimitedSuffix=r,this._options=i,this._state=new e,this._state.initialize(t,n),this._finalized=!1}_transform(e,t,n){let r=null;try{this.update(e,t)}catch(e){r=e}n(r)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(e);return void 0!==t&&(n=n.toString(t)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},9078:(e,t)=>{const n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let h=d^(s<<1|a>>>31),p=f^(a<<1|s>>>31);const g=e[0]^h,m=e[1]^p,y=e[10]^h,A=e[11]^p,b=e[20]^h,T=e[21]^p,w=e[30]^h,v=e[31]^p,I=e[40]^h,S=e[41]^p;h=r^(o<<1|u>>>31),p=i^(u<<1|o>>>31);const E=e[2]^h,C=e[3]^p,_=e[12]^h,B=e[13]^p,O=e[22]^h,N=e[23]^p,x=e[32]^h,P=e[33]^p,D=e[42]^h,k=e[43]^p;h=s^(c<<1|l>>>31),p=a^(l<<1|c>>>31);const R=e[4]^h,L=e[5]^p,F=e[14]^h,U=e[15]^p,M=e[24]^h,V=e[25]^p,G=e[34]^h,H=e[35]^p,j=e[44]^h,q=e[45]^p;h=o^(d<<1|f>>>31),p=u^(f<<1|d>>>31);const Q=e[6]^h,z=e[7]^p,K=e[16]^h,W=e[17]^p,$=e[26]^h,Y=e[27]^p,J=e[36]^h,X=e[37]^p,Z=e[46]^h,ee=e[47]^p;h=c^(r<<1|i>>>31),p=l^(i<<1|r>>>31);const te=e[8]^h,ne=e[9]^p,re=e[18]^h,ie=e[19]^p,se=e[28]^h,ae=e[29]^p,oe=e[38]^h,ue=e[39]^p,ce=e[48]^h,le=e[49]^p,de=g,fe=m,he=A<<4|y>>>28,pe=y<<4|A>>>28,ge=b<<3|T>>>29,me=T<<3|b>>>29,ye=v<<9|w>>>23,Ae=w<<9|v>>>23,be=I<<18|S>>>14,Te=S<<18|I>>>14,we=E<<1|C>>>31,ve=C<<1|E>>>31,Ie=B<<12|_>>>20,Se=_<<12|B>>>20,Ee=O<<10|N>>>22,Ce=N<<10|O>>>22,_e=P<<13|x>>>19,Be=x<<13|P>>>19,Oe=D<<2|k>>>30,Ne=k<<2|D>>>30,xe=L<<30|R>>>2,Pe=R<<30|L>>>2,De=F<<6|U>>>26,ke=U<<6|F>>>26,Re=V<<11|M>>>21,Le=M<<11|V>>>21,Fe=G<<15|H>>>17,Ue=H<<15|G>>>17,Me=q<<29|j>>>3,Ve=j<<29|q>>>3,Ge=Q<<28|z>>>4,He=z<<28|Q>>>4,je=W<<23|K>>>9,qe=K<<23|W>>>9,Qe=$<<25|Y>>>7,ze=Y<<25|$>>>7,Ke=J<<21|X>>>11,We=X<<21|J>>>11,$e=ee<<24|Z>>>8,Ye=Z<<24|ee>>>8,Je=te<<27|ne>>>5,Xe=ne<<27|te>>>5,Ze=re<<20|ie>>>12,et=ie<<20|re>>>12,tt=ae<<7|se>>>25,nt=se<<7|ae>>>25,rt=oe<<8|ue>>>24,it=ue<<8|oe>>>24,st=ce<<14|le>>>18,at=le<<14|ce>>>18;e[0]=de^~Ie&Re,e[1]=fe^~Se&Le,e[10]=Ge^~Ze&ge,e[11]=He^~et&me,e[20]=we^~De&Qe,e[21]=ve^~ke&ze,e[30]=Je^~he&Ee,e[31]=Xe^~pe&Ce,e[40]=xe^~je&tt,e[41]=Pe^~qe&nt,e[2]=Ie^~Re&Ke,e[3]=Se^~Le&We,e[12]=Ze^~ge&_e,e[13]=et^~me&Be,e[22]=De^~Qe&rt,e[23]=ke^~ze&it,e[32]=he^~Ee&Fe,e[33]=pe^~Ce&Ue,e[42]=je^~tt&ye,e[43]=qe^~nt&Ae,e[4]=Re^~Ke&st,e[5]=Le^~We&at,e[14]=ge^~_e&Me,e[15]=me^~Be&Ve,e[24]=Qe^~rt&be,e[25]=ze^~it&Te,e[34]=Ee^~Fe&$e,e[35]=Ce^~Ue&Ye,e[44]=tt^~ye&Oe,e[45]=nt^~Ae&Ne,e[6]=Ke^~st&de,e[7]=We^~at&fe,e[16]=_e^~Me&Ge,e[17]=Be^~Ve&He,e[26]=rt^~be&we,e[27]=it^~Te&ve,e[36]=Fe^~$e&Je,e[37]=Ue^~Ye&Xe,e[46]=ye^~Oe&xe,e[47]=Ae^~Ne&Pe,e[8]=st^~de&Ie,e[9]=at^~fe&Se,e[18]=Me^~Ge&Ze,e[19]=Ve^~He&et,e[28]=be^~we&De,e[29]=Te^~ve&ke,e[38]=$e^~Je&he,e[39]=Ye^~Xe&pe,e[48]=Oe^~xe&je,e[49]=Ne^~Pe&qe,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},4817:(e,t,n)=>{const r=n(9078);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,128&e&&this.count===this.blockSize-1&&r.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,r.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let n=0;n<e;++n)t[n]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},6889:e=>{function t(e,t){if(!e)throw new Error(t||"AssertionError")}t.notEqual=function(e,n,r){t(e!=n,r)},t.notOk=function(e,n){t(!e,n)},t.equal=function(e,n,r){t(e==n,r)},t.ok=t,e.exports=t},6946:(e,t,n)=>{"use strict";e.exports=n(4394)},4394:(e,t,n)=>{"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(3449),r.BufferWriter=n(818),r.Reader=n(6237),r.BufferReader=n(777),r.util=n(3610),r.rpc=n(5047),r.roots=n(4529),r.configure=i,i()},6237:(e,t,n)=>{"use strict";e.exports=u;var r,i=n(3610),s=i.LongBits,a=i.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},d=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function f(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw o(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=d(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},777:(e,t,n)=>{"use strict";e.exports=s;var r=n(6237);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3610);function s(e){r.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},4529:e=>{"use strict";e.exports={}},5047:(e,t,n)=>{"use strict";t.Service=n(7595)},7595:(e,t,n)=>{"use strict";e.exports=i;var r=n(3610);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,s,a){if(!s)throw TypeError("request must be specified");var o=this;if(!a)return r.asPromise(e,o,t,n,i,s);if(o.rpcImpl)try{return o.rpcImpl(t,n[o.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return o.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof i))try{n=i[o.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return o.emit("error",e,t),a(e)}return o.emit("data",n,t),a(null,n)}o.end(!0)}))}catch(e){return o.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},2239:(e,t,n)=>{"use strict";e.exports=i;var r=n(3610);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var o=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?s:new i((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},3610:function(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(8045),r.base64=n(8839),r.EventEmitter=n(4358),r.float=n(9410),r.inquire=n(4153),r.utf8=n(1447),r.pool=n(9390),r.LongBits=n(2239),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},3449:(e,t,n)=>{"use strict";e.exports=d;var r,i=n(3610),s=i.LongBits,a=i.base64,o=i.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function h(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function g(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function m(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=f(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(g,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(g,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(g,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var n=d.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},d.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=f(),r._configure()}},818:(e,t,n)=>{"use strict";e.exports=s;var r=n(3449);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(3610);function s(){r.call(this)}function a(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},s._configure()},6048:e=>{"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,s,a,o,u;if("string"==typeof t&&(s="not ",t.substr(0,4)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(o=e).length||-1===o.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(r(t,"type"))}return a+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382:(e,t,n)=>{"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var i=n(5412),s=n(6708);n(6698)(c,i);for(var a=r(s.prototype),o=0;o<a.length;o++){var u=a[o];c.prototype[u]||(c.prototype[u]=s.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600:(e,t,n)=>{"use strict";e.exports=i;var r=n(4610);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(6698)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},5412:(e,t,n)=>{"use strict";var r;e.exports=S,S.ReadableState=I,n(7007).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},a=n(345),o=n(8287).Buffer,u=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=n(9838);i=c&&c.debuglog?c.debuglog("stream"):function(){};var l,d,f,h=n(2726),p=n(5896),g=n(5291).getHighWaterMark,m=n(6048).F,y=m.ERR_INVALID_ARG_TYPE,A=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(6698)(S,a);var w=p.errorOrDestroy,v=["error","close","destroy","pause","resume"];function I(e,t,i){r=r||n(5382),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(r=r||n(5382),!(this instanceof S))return new S(e);var t=this instanceof r;this._readableState=new I(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function E(e,t,n,r,s){i("readableAddChunk",t);var a,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}(e,c);else if(s||(a=function(e,t){var n,r;return r=t,o.isBuffer(r)||r instanceof u||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t)),n}(c,t)),a)w(e,a);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),r)c.endEmitted?w(e,new T):C(e,c,t,!0);else if(c.ended)w(e,new A);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!n?(t=c.decoder.write(t),c.objectMode||0!==t.length?C(e,c,t,!1):x(e,c)):C(e,c,t,!1)}else r||(c.reading=!1,x(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function C(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&O(e)),x(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=o.from(e,t),t=""),n=!0),E(this,e,t,!1,n)},S.prototype.unshift=function(e){return E(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=n(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var _=1073741824;function B(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(N,e))}function N(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function x(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function D(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){i("readable nexttick read 0"),e.read(0)}function R(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(M,t,e))}function M(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function V(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}S.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=B(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,s=t.needReadable;return i("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",s=!0),t.ended||t.reading?i("reading or ended",s=!1):s&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=B(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},S.prototype._read=function(e){w(this,new b("_read()"))},S.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?p:o;function o(){i("onend"),e.end()}r.endEmitted?process.nextTick(a):n.once("end",a),e.on("unpipe",(function t(s,a){i("onunpipe"),s===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",p),n.removeListener("data",l),c=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(n);e.on("drain",u);var c=!1;function l(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==V(r.pipes,e))&&!c&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function d(t){i("onerror",t),p(),e.removeListener("error",d),0===s(e,"error")&&w(e,t)}function f(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",f),p()}function p(){i("unpipe"),n.unpipe(e)}return n.on("data",l),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",h),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=V(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},S.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?O(this):r.reading||process.nextTick(k,this))),n},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(D,this),n},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(D,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(R,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var s in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(s){i("wrapped data"),n.decoder&&(s=n.decoder.write(s)),n.objectMode&&null==s||(n.objectMode||s&&s.length)&&(t.push(s)||(r=!0,e.pause()))})),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var a=0;a<v.length;a++)e.on(v[a],this.emit.bind(this,v[a]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n(2955)),d(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=F,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===f&&(f=n(5157)),f(S,e,t)})},4610:(e,t,n)=>{"use strict";e.exports=l;var r=n(6048).F,i=r.ERR_METHOD_NOT_IMPLEMENTED,s=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(5382);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new s);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}n(6698)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new i("_transform()"))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},6708:(e,t,n)=>{"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=S,S.WritableState=I;var s,a={deprecate:n(4643)},o=n(345),u=n(8287).Buffer,c=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=n(5896),d=n(5291).getHighWaterMark,f=n(6048).F,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,A=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,T=f.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function v(){}function I(e,t,s){i=i||n(5382),e=e||{},"boolean"!=typeof s&&(s=t instanceof i),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(N,e,t),e._writableState.errorEmitted=!0,w(e,r)):(i(r),e._writableState.errorEmitted=!0,w(e,r),N(e,t))}(e,n,r,t,i);else{var s=B(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?process.nextTick(C,e,n,s,i):C(e,n,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function S(e){var t=this instanceof(i=i||n(5382));if(!t&&!s.call(S,this))return new S(e);this._writableState=new I(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function E(e,t,n,r,i,s,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function C(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),N(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,s=new Array(i),a=t.corkedRequestsFree;a.entry=n;for(var o=0,u=!0;n;)s[o]=n,n.isBuf||(u=!1),n=n.next,o+=1;s.allBuffers=u,E(e,t,!0,t.length,s,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,d=n.callback;if(E(e,t,!1,t.objectMode?1:c.length,c,l,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(n){t.pendingcb--,n&&w(e,n),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var n=B(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(6698)(S,o),I.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(I.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===S&&e&&e._writableState instanceof I}})):s=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new m)},S.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,a=!i.objectMode&&(r=e,u.isBuffer(r)||r instanceof c);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=v),i.ending?function(e,t){var n=new b;w(e,n),process.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var i;return null===n?i=new A:"string"==typeof n||t.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(w(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,s){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var o=t.objectMode?1:r.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,o,r,i,s);return c}(this,i,a,e,t,n)),s},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,n){n(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,N(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},2955:(e,t,n)=>{"use strict";var r;function i(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(6238),a=Symbol("lastResolve"),o=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[a]=null,e[o]=null,t(h(n,!1)))}}function g(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[u]?n(e[u]):t(h(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[c]?n(h(void 0,!0)):t[d](n,r)}),r)}}(r,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[d])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,n=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[l]=null,n[a]=null,n[o]=null,e(h(r,!1))):(n[a]=e,n[o]=t)},writable:!0}),t));return n[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[o];return null!==t&&(n[l]=null,n[a]=null,n[o]=null,t(e)),void(n[u]=e)}var r=n[a];null!==r&&(n[l]=null,n[a]=null,n[o]=null,r(h(void 0,!0))),n[c]=!0})),e.on("readable",g.bind(null,n)),n}},2726:(e,t,n)=>{"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=n(8287).Buffer,c=n(5340).inspect,l=c&&c.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,n,r,i=u.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,r=a,u.prototype.copy.call(t,n,r),a+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?r+=i:r+=i.slice(0,e),0==(e-=s)){s===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896:e=>{"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var s=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(n,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):i?(process.nextTick(n,s),i(e)):process.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238:(e,t,n)=>{"use strict";var r=n(6048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,s){if("function"==typeof n)return e(t,null,n);n||(n={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(s||i);var a=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){o=!1,c=!0,a||s.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){a=!1,d=!0,o||s.call(t)},h=function(e){s.call(t,e)},p=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new r),s.call(t,e)):o&&!c?(t._writableState&&t._writableState.ended||(e=new r),s.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)):o&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",f),t.on("finish",l),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},5157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,t,n)=>{"use strict";var r,i=n(6048).F,s=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,d=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var f=t.map((function(e,i){var s=i<t.length-1;return function(e,t,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=n(6238)),r(e,{readable:t,writable:i},(function(e){if(e)return s(e);o=!0,s()}));var u=!1;return function(t){if(!o&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}(e,s,i>0,(function(e){l||(l=e),e&&f.forEach(u),s||(f.forEach(u),d(l))}))}));return t.reduce(c)}},5291:(e,t,n)=>{"use strict";var r=n(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var s=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},345:(e,t,n)=>{e.exports=n(7007).EventEmitter},8399:(e,t,n)=>{(t=e.exports=n(5412)).Stream=t,t.Readable=t,t.Writable=n(6708),t.Duplex=n(5382),t.Transform=n(4610),t.PassThrough=n(3600),t.finished=n(6238),t.pipeline=n(7758)},2861:(e,t,n)=>{var r=n(8287),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),s(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},3141:(e,t,n)=>{"use strict";var r=n(2861).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=a(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4643:(e,t,n)=>{function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},5340:()=>{},9838:()=>{},6425:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,a=(o=Object.create(null),e=>{const t=i.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const u=e=>(e=e.toLowerCase(),t=>a(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,d=c("undefined"),f=u("ArrayBuffer"),h=c("string"),p=c("function"),g=c("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},A=u("Date"),b=u("File"),T=u("Blob"),w=u("FileList"),v=u("URLSearchParams"),[I,S,E,C]=["ReadableStream","Request","Response","Headers"].map(u);function _(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(r=0;r<s;r++)a=i[r],t.call(null,e[a],a,e)}}function B(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,N=e=>!d(e)&&e!==O,x=(P="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>P&&e instanceof P);var P;const D=u("HTMLFormElement"),k=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),R=u("RegExp"),L=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};_(n,((n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)})),Object.defineProperties(e,r)},F="abcdefghijklmnopqrstuvwxyz",U="0123456789",M={DIGIT:U,ALPHA:F,ALPHA_DIGIT:F+F.toUpperCase()+U},V=u("AsyncFunction"),G=(H="function"==typeof setImmediate,j=p(O.postMessage),H?setImmediate:j?(q=`axios@${Math.random()}`,Q=[],O.addEventListener("message",(({source:e,data:t})=>{e===O&&t===q&&Q.length&&Q.shift()()}),!1),e=>{Q.push(e),O.postMessage(q,"*")}):e=>setTimeout(e));var H,j,q,Q;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(O):"undefined"!=typeof process&&process.nextTick||G;var K={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=a(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isReadableStream:I,isRequest:S,isResponse:E,isHeaders:C,isUndefined:d,isDate:A,isFile:b,isBlob:T,isRegExp:R,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:v,isTypedArray:x,isFileList:w,forEach:_,merge:function e(){const{caseless:t}=N(this)&&this||{},n={},r=(r,i)=>{const s=t&&B(n,i)||i;y(n[s])&&y(r)?n[s]=e(n[s],r):y(r)?n[s]=e({},r):l(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(_(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||u[o]||(t[o]=e[o],u[o]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:D,hasOwnProperty:k,hasOwnProp:k,reduceDescriptors:L,freezeMethods:e=>{L(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:B,global:O,isContextDefined:N,ALPHABET:M,generateString:(e=16,t=M.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=l(e)?[]:{};return _(e,((e,t)=>{const s=n(e,r+1);!d(s)&&(i[t]=s)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:V,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch),setImmediate:G,asap:z};function W(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const $=W.prototype,Y={};function J(e){return K.isPlainObject(e)||K.isArray(e)}function X(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=X(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Y[e]={value:e}})),Object.defineProperties(W,Y),Object.defineProperty($,"isAxiosError",{value:!0}),W.from=(e,t,n,r,i,s)=>{const a=Object.create($);return K.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),W.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const ee=K.toFlatObject(K,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!K.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,s=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(!o&&K.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let o=e;if(e&&!i&&"object"==typeof e)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(K.isArray(e)&&function(e){return K.isArray(e)&&!e.some(J)}(e)||(K.isFileList(e)||K.endsWith(n,"[]"))&&(o=K.toArray(e)))return n=X(n),o.forEach((function(e,r){!K.isUndefined(e)&&null!==e&&t.append(!0===a?Z([n],r,s):null===a?n:n+"[]",u(e))})),!1;return!!J(e)||(t.append(Z(i,n,s),u(e)),!1)}const l=[],d=Object.assign(ee,{defaultVisitor:c,convertValue:u,isVisitable:J});if(!K.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!K.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),K.forEach(n,(function(n,s){!0===(!(K.isUndefined(n)||null===n)&&i.call(t,n,K.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const ie=re.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,n){if(!t)return e;const r=n&&n.encode||se,i=n&&n.serialize;let s;if(s=i?i(t,n):K.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ie.append=function(e,t){this._pairs.push([e,t])},ie.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ce={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,fe=le&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,pe=le&&window.location.href||"http://localhost";var ge={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:he,hasStandardBrowserEnv:fe,navigator:de,origin:pe}),...ce};function me(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),o=i>=e.length;return s=!s&&K.isArray(r)?r.length:s,o?(K.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!a):(r[s]&&K.isObject(r[s])||(r[s]=[]),t(e,n,r[s],i)&&K.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!a)}if(K.isFormData(e)&&K.isFunction(e.entries)){const n={};return K.forEachEntry(e,((e,r)=>{t(function(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ye={transitional:ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=K.isObject(e);if(i&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return r?JSON.stringify(me(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ge.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=K.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e){if(K.isString(e))try{return(0,JSON.parse)(e),K.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ye.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],(e=>{ye.headers[e]={}}));var Ae=ye;const be=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Te=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function ve(e){return!1===e||null==e?e:K.isArray(e)?e.map(ve):String(e)}function Ie(e,t,n,r,i){return K.isFunction(r)?r.call(this,t,n):(i&&(t=n),K.isString(t)?K.isString(r)?-1!==t.indexOf(r):K.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=we(t);if(!i)throw new Error("header name must be a non-empty string");const s=K.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ve(e))}const s=(e,t)=>K.forEach(e,((e,n)=>i(e,n,t)));if(K.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(K.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&be[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(K.isHeaders(e))for(const[t,r]of e.entries())i(r,t,n);else null!=e&&i(t,e,n);return this}get(e,t){if(e=we(e)){const n=K.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const n=K.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ie(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=we(e)){const i=K.findKey(n,e);!i||t&&!Ie(0,n[i],i,t)||(delete n[i],r=!0)}}return K.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Ie(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return K.forEach(this,((r,i)=>{const s=K.findKey(n,i);if(s)return t[s]=ve(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ve(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return K.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&K.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Te]=this[Te]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=we(e);t[r]||(function(e,t){const n=K.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return K.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(Se.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),K.freezeMethods(Se);var Ee=Se;function Ce(e,t){const n=this||Ae,r=t||n,i=Ee.from(r.headers);let s=r.data;return K.forEach(e,(function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)})),i.normalize(),s}function _e(e){return!(!e||!e.__CANCEL__)}function Be(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function Oe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}K.inherits(Be,W,{__CANCEL__:!0});const Ne=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,a=0;return t=void 0!==t?t:1e3,function(o){const u=Date.now(),c=r[a];i||(i=u),n[s]=o,r[s]=u;let l=a,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const a=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-i;o>=s?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),s-o)))},()=>n&&a(n)]}((n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,o=s-r,u=i(o);r=s,e({loaded:s,total:a,progress:a?s/a:void 0,bytes:o,rate:u||void 0,estimated:u&&a&&s<=a?(a-s)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},xe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pe=e=>(...t)=>K.asap((()=>e(...t)));var De=ge.hasStandardBrowserEnv?function(){const e=ge.navigator&&/(msie|trident)/i.test(ge.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=K.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},ke=ge.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const a=[e+"="+encodeURIComponent(t)];K.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),K.isString(r)&&a.push("path="+r),K.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Re(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Le=e=>e instanceof Ee?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:n},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function i(e,t,n){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!K.isUndefined(t))return r(void 0,t)}function a(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>i(Le(e),Le(t),!0)};return K.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=u[r]||i,a=s(e[r],t[r],r);K.isUndefined(a)&&s!==o||(n[r]=a)})),n}var Ue=e=>{const t=Fe({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:u}=t;if(t.headers=o=Ee.from(o),t.url=ae(Re(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),K.isFormData(r))if(ge.hasStandardBrowserEnv||ge.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(n=o.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(ge.hasStandardBrowserEnv&&(i&&K.isFunction(i)&&(i=i(t)),i||!1!==i&&De(t.url))){const e=s&&a&&ke.read(a);e&&o.set(s,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ue(e);let i=r.data;const s=Ee.from(r.headers).normalize();let a,o,u,c,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Ee.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Oe((function(e){t(e),p()}),(function(e){n(e),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new W("Request aborted",W.ECONNABORTED,e,g)),g=null)},g.onerror=function(){n(new W("Network Error",W.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||ue;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,i.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,g)),g=null},void 0===i&&s.setContentType(null),"setRequestHeader"in g&&K.forEach(s.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),K.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([u,l]=Ne(h,!0),g.addEventListener("progress",u)),f&&g.upload&&([o,c]=Ne(f),g.upload.addEventListener("progress",o),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Be(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ge.protocols.indexOf(y)?n(new W("Unsupported protocol "+y+":",W.ERR_BAD_REQUEST,e)):g.send(i||null)}))},Ve=(e,t)=>{let n,r=new AbortController;const i=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new Be(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{i(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))}),t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e&&(e.removeEventListener?e.removeEventListener("abort",i):e.unsubscribe(i))})),e=null)};e.forEach((e=>e&&e.addEventListener&&e.addEventListener("abort",i)));const{signal:o}=r;return o.unsubscribe=a,[o,()=>{s&&clearTimeout(s),s=null}]};const Ge=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},He=(e,t,n,r,i)=>{const s=async function*(e,t,n){for await(const r of e)yield*Ge(ArrayBuffer.isView(r)?r:await n(String(r)),t)}(e,t,i);let a,o=0,u=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return u(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw u(e),e}},cancel:e=>(u(e),s.return())},{highWaterMark:2})},je="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,qe=je&&"function"==typeof ReadableStream,Qe=je&&("function"==typeof TextEncoder?(ze=new TextEncoder,e=>ze.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var ze;const Ke=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},We=qe&&Ke((()=>{let e=!1;const t=new Request(ge.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),$e=qe&&Ke((()=>K.isReadableStream(new Response("").body))),Ye={stream:$e&&(e=>e.body)};var Je;je&&(Je=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Ye[e]&&(Ye[e]=K.isFunction(Je[e])?t=>t[e]():(t,n)=>{throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})})));const Xe={http:null,xhr:Me,fetch:je&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:u,responseType:c,headers:l,withCredentials:d="same-origin",fetchOptions:f}=Ue(e);c=c?(c+"").toLowerCase():"text";let h,p,[g,m]=i||s||a?Ve([i,s],a):[];const y=()=>{!h&&setTimeout((()=>{g&&g.unsubscribe()})),h=!0};let A;try{if(u&&We&&"get"!==n&&"head"!==n&&0!==(A=await(async(e,t)=>{const n=K.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:K.isBlob(e)?e.size:K.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e)?(await Qe(e)).byteLength:void 0))(t):n})(l,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(K.isFormData(r)&&(e=n.headers.get("content-type"))&&l.setContentType(e),n.body){const[e,t]=xe(A,Ne(Pe(u)));r=He(n.body,65536,e,t,Qe)}}K.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;p=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(p);const a=$e&&("stream"===c||"response"===c);if($e&&(o||a)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=K.toFiniteNumber(s.headers.get("content-length")),[n,r]=o&&xe(t,Ne(Pe(o),!0))||[];s=new Response(He(s.body,65536,n,(()=>{r&&r(),a&&y()}),Qe),e)}c=c||"text";let h=await Ye[K.findKey(Ye,c)||"text"](s,e);return!a&&y(),m&&m(),await new Promise(((t,n)=>{Oe(t,n,{data:h,headers:Ee.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(t){if(y(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,p),{cause:t.cause||t});throw W.from(t,t&&t.code,e,p)}})};K.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>K.isFunction(e)||null===e||!1===e;var tt=e=>{e=K.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!et(n)&&(r=Xe[(t=String(n)).toLowerCase()],void 0===r))throw new W(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new W("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Be(null,e)}function rt(e){return nt(e),e.headers=Ee.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||Ae.adapter)(e).then((function(t){return nt(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=Ee.from(t.headers),t}),(function(t){return _e(t)||(nt(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=Ee.from(t.response.headers))),Promise.reject(t)}))}const it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.5] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new W(r(i," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!st[i]&&(st[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],a=t[s];if(a){const t=e[s],n=void 0===t||a(t,s,e);if(!0!==n)throw new W("option "+s+" must be "+n,W.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new W("Unknown option "+s,W.ERR_BAD_OPTION)}},validators:it};const ot=at.validators;class ut{constructor(e){this.defaults=e,this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),null!=r&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&K.merge(i.common,i[t.method]);i&&K.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Ee.concat(s,i);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,d=0;if(!o){const e=[rt.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);d<l;)c=c.then(e[d++],e[d++]);return c}l=a.length;let f=t;for(d=0;d<l;){const e=a[d++],t=a[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=rt.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=u.length;d<l;)c=c.then(u[d++],u[d++]);return c}getUri(e){return ae(Re((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),K.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Fe(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var ct=ut;class lt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Be(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new lt((function(t){e=t})),cancel:e}}}var dt=lt;const ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ft).forEach((([e,t])=>{ft[t]=e}));var ht=ft;const pt=function e(t){const n=new ct(t),i=r(ct.prototype.request,n);return K.extend(i,ct.prototype,n,{allOwnKeys:!0}),K.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Fe(t,n))},i}(Ae);pt.Axios=ct,pt.CanceledError=Be,pt.CancelToken=dt,pt.isCancel=_e,pt.VERSION="1.7.5",pt.toFormData=te,pt.AxiosError=W,pt.Cancel=pt.CanceledError,pt.all=function(e){return Promise.all(e)},pt.spread=function(e){return function(t){return e.apply(null,t)}},pt.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},pt.mergeConfig=Fe,pt.AxiosHeaders=Ee,pt.formToJSON=e=>me(K.isHTMLForm(e)?new FormData(e):e),pt.getAdapter=tt,pt.HttpStatusCode=ht,pt.default=pt,e.exports=pt}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,__webpack_require__.d(n,r),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AssetCategory:()=>H,AuctionType:()=>y,AuctionTypes:()=>G,Chain:()=>m,CollectionStatsOrderBy:()=>Q,CollectionStatsSelectFields:()=>q,CollectionsFieldsToSelect:()=>M,CollectionsOrderBy:()=>F,CollectionsSummaryFilter:()=>j,DropsOderBy:()=>R,EventUserRolePermission:()=>te,EventUserRoles:()=>ee,FieldsToSelect:()=>D,GlobalOfferFieldsToSelect:()=>V,GlobalOfferOrderBy:()=>U,IssuingType:()=>$,LaunchpadModule:()=>x,Marketplace:()=>P,NftActivityType:()=>z,OfferType:()=>X,OrderByTradingActivity:()=>K,PoolType:()=>Y,SCInteraction:()=>N,SearchOrderBy:()=>k,SelectFieldsTradingActivity:()=>W,StakingStatus:()=>J,SuggestOrderBy:()=>L,Type:()=>Z,XOXNOClient:()=>A,eventPermissions:()=>re,eventRoles:()=>ne});var e=__webpack_require__(4820),t=__webpack_require__(236),n=__webpack_require__(3979),r=__webpack_require__(5766),i=__webpack_require__(4473),s=__webpack_require__(7586),a=__webpack_require__(3145),o=__webpack_require__(5132),u=__webpack_require__(9712),c=__webpack_require__(3473),l=__webpack_require__(1594),d=__webpack_require__.n(l);const f="https://api.xoxno.com",h="erd1qqqqqqqqqqqqqpgq705fxpfrjne0tl3ece0rrspykq88mynn4kxs2cg43s",p="erd1qqqqqqqqqqqqqpgqd9rvv2n378e27jcts8vfwynpx0gfl5ufz6hqhfy0u0",g="erd1qqqqqqqqqqqqqpgq8xwzu82v8ex3h4ayl5lsvxqxnhecpwyvwe0sf2qj4e";var m,y;!function(e){e.MAINNET="1",e.DEVNET="D"}(m||(m={}));class A{static instance;apiUrl;apiKey;chain;config;constructor(e=f,t="",n){this.apiUrl=e,this.apiKey=t,this.chain=n,this.config=n==m.MAINNET?{mediaUrl:"https://media.xoxno.com",gatewayUrl:"https://gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgq6wegs2xkypfpync8mn2sa5cmpqjlvrhwz5nqgepyg8",FM_SC:h,DR_SC:p,KG_SC:g,Staking_SC:"erd1qqqqqqqqqqqqqpgqvpkd3g3uwludduv3797j54qt6c888wa59w2shntt6z",Manager_SC:"erd1qqqqqqqqqqqqqpgqg9fa0dmpn8fu3fnleeqn5zt8rl8mdqjkys5s2gtas7",P2P_SC:"erd1qqqqqqqqqqqqqpgq47y8hnct68v6asjv6gxem6h9rumn9frzah0skhxxt6"}:{mediaUrl:"https://devnet-media.xoxno.com",gatewayUrl:"https://devnet-gateway.xoxno.com",XO_SC:"erd1qqqqqqqqqqqqqpgql0dnz6n5hpuw8cptlt00khd0nn4ja8eadsfq2xrqw4",FM_SC:h,DR_SC:p,KG_SC:g,Staking_SC:"erd1qqqqqqqqqqqqqpgqsc5hnewwpep8qq0d7kjjzrquapuucrygah0s85zres",Manager_SC:"erd1qqqqqqqqqqqqqpgqluclyhfsa2uw7q9cjwd8knk989hg57u8ah0slq2nlr",P2P_SC:"erd1qqqqqqqqqqqqqpgqfja7ukpngrun78ueq583l0vd6aj4ekhrah0sa9wyrv"}}static init({apiUrl:e=f,apiKey:t="",chain:n=m.MAINNET}={}){if(null==A.instance||null==A.instance){if(n==m.DEVNET)return A.instance=new A(e??"https://devnet-api.xoxno.com",t,n),A.instance;A.instance=new A(e,t,n)}return A.instance}static getInstance(){if(null==A.instance||null==A.instance)throw new Error("XOXNOClient is not initialized");return A.instance}fetchWithTimeout=async(e,t={},n=4e4)=>{const r={"Accept-Encoding":"gzip,deflate,br",Referer:"https://xoxno.sdk","User-Agent":"XOXNO/1.0/SDK",..."POST"===t.method?{"Content-Type":"application/json"}:{},...t.headers??{}},i=`${"string"==typeof e&&e.startsWith("/")?`${this.apiUrl}${e}`:e}${t.params?"?"+Object.keys(t.params).map((e=>`${e}=${encodeURIComponent(t.params[e])}`)).join("&"):""}`,s=new AbortController;setTimeout((()=>s.abort()),n);const a=await fetch(i,{...t,...t?.next&&t.next.revalidate?{}:{cache:"no-store"},signal:s.signal,...Object.keys(r).length?{headers:r}:{},method:t.method??"GET"});if(!a.ok)throw new Error((await a.json()).message.toString());return a.json()}}!function(e){e[e.NftBid=0]="NftBid",e[e.Nft=1]="Nft",e[e.SftAll=2]="SftAll",e[e.SftOnePerPayment=3]="SftOnePerPayment"}(y||(y={}));var b=__webpack_require__(2528),T=__webpack_require__(8403);class w{proxy;parser=new b.ResultsParser;constructor(){const e=A.getInstance().config.gatewayUrl;this.proxy=new T.ProxyNetworkProvider(e,{timeout:1e4})}async runQuery(e,t){try{const e=await this.proxy.queryContract(t.buildQuery());return this.parser.parseQueryResponse(e,t.getEndpoint())}catch(n){throw console.log(`Unexpected error when running query '${t.buildQuery().func}' to sc '${e.getAddress().bech32()}' `),console.error(n),n}}}var v=__webpack_require__(4966);const I=JSON.parse('{"buildInfo":{"rustc":{"version":"1.80.0-nightly","commitHash":"8679004993f08807289911d9f400f4ac4391d2bc","commitDate":"2024-05-23","channel":"Nightly","short":"rustc 1.80.0-nightly (867900499 2024-05-23)"},"contractCrate":{"name":"xoxno-protocol","version":"1.0.0"},"framework":{"name":"multiversx-sc","version":"0.50.5"}},"name":"XOXNOProtocol","constructor":{"inputs":[{"name":"bid_cut_percentage","type":"u64"},{"name":"signer","type":"Address"},{"name":"wrapping_sc","type":"Address"},{"name":"wrapping_token","type":"TokenIdentifier"},{"name":"aggregator","type":"Address"}],"outputs":[]},"upgradeConstructor":{"inputs":[{"name":"sc_accumulator","type":"Address"},{"name":"aggregator","type":"Address"}],"outputs":[]},"endpoints":[{"name":"listing","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"listings","type":"variadic<BulkListing>","multi_arg":true}],"outputs":[]},{"name":"bid","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"}],"outputs":[]},{"name":"endAuction","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"buy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true}],"outputs":[]},{"name":"buySwap","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"steps","type":"List<AggregatorStep>"},{"name":"limits","type":"List<TokenAmount>"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"buyFor","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_id","type":"u64"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"opt_sft_buy_amount","type":"optional<BigUint>","multi_arg":true},{"name":"buy_for","type":"optional<Address>","multi_arg":true},{"name":"message","type":"optional<bytes>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"bulkBuy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<EsdtTokenPayment>"}]},{"name":"withdraw","mutability":"mutable","inputs":[{"name":"signature","type":"bytes"},{"name":"withdraws","type":"variadic<u64>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"changeListing","mutability":"mutable","inputs":[{"name":"updates","type":"variadic<BulkUpdateListing>","multi_arg":true}],"outputs":[]},{"name":"getMarketplaceCutPercentage","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getOffersByWallet","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"checkOfferSent","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"nft","type":"TokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"getListingsByWallet","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getActiveListingsBids","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenItemsForSale","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenAuctionIds","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenOffersIds","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getTokenItemsQuantityForSale","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"BigUint"}]},{"name":"getAcceptedTokens","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"blackListWallets","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"whitelistedContracts","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"getClaimableAmount","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"token_id","type":"EgldOrEsdtTokenIdentifier"},{"name":"token_nonce","type":"u64"}],"outputs":[{"type":"BigUint"}]},{"name":"getClaimableTokens","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"getClaimableTokenNonces","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionsListed","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<TokenIdentifier>","multi_result":true}]},{"name":"getAllListings","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getOffers","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getStatus","mutability":"readonly","inputs":[],"outputs":[{"type":"bool"}]},{"name":"getFullAuctionData","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"Auction"}]},{"name":"offerById","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"Offer"}]},{"name":"getRewardBalance","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getRewardTicker","mutability":"readonly","inputs":[],"outputs":[{"type":"EgldOrEsdtTokenIdentifier"}]},{"name":"specialRewardAmount","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"BigUint"}]},{"name":"defaultRewardAmount","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"getGlobalOffers","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getGlobalOffer","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"GlobalOffer"}]},{"name":"getCollectionGlobalOffers","mutability":"readonly","inputs":[{"name":"collection","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"userGlobalOffers","mutability":"readonly","inputs":[{"name":"address","type":"Address"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"userCollectionGlobalOffers","mutability":"readonly","inputs":[{"name":"address","type":"Address"},{"name":"collection","type":"TokenIdentifier"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionConfig","mutability":"readonly","inputs":[{"name":"ticker","type":"TokenIdentifier"}],"outputs":[{"type":"CollectionFeeConfig"}]},{"name":"freezedAuctions","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getAccumulator","mutability":"readonly","inputs":[],"outputs":[{"type":"Address"}]},{"name":"getListingsCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getGlobalOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getListings","mutability":"readonly","inputs":[{"name":"from","type":"u32"},{"name":"to","type":"u32"}],"outputs":[{"type":"variadic<u64>","multi_result":true}]},{"name":"getCollectionsCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"isCollectionListed","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"expiredOffersCount","mutability":"readonly","inputs":[],"outputs":[{"type":"List<u64>"}]},{"name":"getAcceptedTokensCount","mutability":"readonly","inputs":[],"outputs":[{"type":"u32"}]},{"name":"getTokenItemsForSaleCount","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"u32"}]},{"name":"getOnSaleTokensForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<TokensOnSale>"}]},{"name":"getAuctionsForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"List<u64>"}]},{"name":"getFullAuctionsForTicker","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"}],"outputs":[{"type":"List<Auction>"}]},{"name":"getTokenOffers","mutability":"readonly","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<BulkOffers>"}]},{"name":"getBulkOffers","mutability":"readonly","inputs":[{"name":"offers","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<BulkOffers>"}]},{"name":"getBulkGlobalOffers","mutability":"readonly","inputs":[{"name":"offers","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<GlobalOffer>"}]},{"name":"getBulkGlobalOffersByCollection","mutability":"readonly","inputs":[{"name":"ticker","type":"TokenIdentifier"}],"outputs":[{"type":"List<GlobalOffer>"}]},{"name":"getBulkListings","mutability":"readonly","inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[{"type":"List<TokensOnSale>"}]},{"name":"doesAuctionExist","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"doesGlobalOfferExist","mutability":"readonly","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"doesOfferExist","mutability":"readonly","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[{"type":"bool"}]},{"name":"isSCWl","mutability":"readonly","inputs":[{"name":"sc","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"acceptOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id","type":"optional<u64>","multi_arg":true}],"outputs":[]},{"name":"declineOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id","type":"optional<u64>","multi_arg":true}],"outputs":[]},{"name":"withdrawOffer","mutability":"mutable","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[]},{"name":"sendOffer","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"payment_amount","type":"BigUint"},{"name":"nft_type","type":"TokenIdentifier"},{"name":"nft_nonce","type":"u64"},{"name":"nft_amount","type":"BigUint"},{"name":"deadline","type":"u64"}],"outputs":[{"type":"u64"}]},{"name":"sendGlobalOffer","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"collection","type":"TokenIdentifier"},{"name":"quantity","type":"BigUint"},{"name":"attributes","type":"optional<bytes>","multi_arg":true}],"outputs":[{"type":"u64"}]},{"name":"withdrawGlobalOffer","mutability":"mutable","inputs":[{"name":"offer_id","type":"u64"}],"outputs":[]},{"name":"acceptGlobalOffer","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"offer_id","type":"u64"},{"name":"auction_id_opt","type":"optional<List<u64>>","multi_arg":true},{"name":"signature","type":"optional<bytes>","multi_arg":true}],"outputs":[],"allow_multiple_var_args":true},{"name":"returnListing","mutability":"mutable","inputs":[{"name":"auction_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"withdrawGlobalOffers","mutability":"mutable","inputs":[{"name":"offer_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"deleteOffersByWallet","mutability":"mutable","inputs":[{"name":"user","type":"Address"}],"outputs":[]},{"name":"cleanExpiredOffers","mutability":"mutable","inputs":[{"name":"offer_ids","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"addRewardBalance","onlyOwner":true,"mutability":"mutable","payableInTokens":["*"],"inputs":[],"outputs":[]},{"name":"setRewardTicker","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[]},{"name":"setSpecialRewardAmount","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"setDefaultRewardAmount","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"setAcceptedTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[]},{"name":"removeAcceptedTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"bool"}]},{"name":"addWhitelist","mutability":"mutable","inputs":[{"name":"sc","type":"Address"}],"outputs":[]},{"name":"removeWhitelist","mutability":"mutable","inputs":[{"name":"sc","type":"Address"}],"outputs":[]},{"name":"setStatus","mutability":"mutable","inputs":[{"name":"status","type":"bool"}],"outputs":[]},{"name":"setCutPercentage","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"new_cut_percentage","type":"u64"}],"outputs":[]},{"name":"unFreezeAuctionId","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"unFreezeAllAuctionIds","mutability":"mutable","inputs":[],"outputs":[]},{"name":"freezeAuctionId","mutability":"mutable","inputs":[{"name":"auction_id","type":"u64"}],"outputs":[]},{"name":"claimLeftOverDust","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"claimSavedFundsForUser","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[]},{"name":"addBlackListWallet","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"removeBlackListWallet","mutability":"mutable","inputs":[{"name":"wallet","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"setCutFeesReverted","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"value","type":"bool"}],"outputs":[]},{"name":"setRoyaltiesReverted","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"value","type":"bool"}],"outputs":[]},{"name":"setExtraFees","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"},{"name":"address","type":"Address"}],"outputs":[]},{"name":"setCustomRoyalties","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"min","type":"BigUint"},{"name":"max","type":"BigUint"},{"name":"enabled","type":"bool"}],"outputs":[]},{"name":"setConfigAdmin","mutability":"mutable","inputs":[{"name":"token_id","type":"TokenIdentifier"},{"name":"admin","type":"Address"}],"outputs":[]},{"name":"deposit","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[],"outputs":[]},{"name":"withdrawDeposit","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"amount","type":"BigUint"}],"outputs":[]},{"name":"userDeposit","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"EgldOrEsdtTokenPayment"}]}],"promisesCallbackNames":["callback_ash"],"events":[{"identifier":"auction_token_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"auctioned_token_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"min_bid","type":"BigUint","indexed":true},{"name":"max_bid","type":"BigUint","indexed":true},{"name":"start_time","type":"u64","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"accepted_payment_token_nonce","type":"u64","indexed":true},{"name":"auction_type","type":"AuctionType","indexed":true},{"name":"creator_royalties_percentage","type":"BigUint","indexed":true}]},{"identifier":"send_global_offer","inputs":[{"name":"offer","type":"GlobalOffer","indexed":true}]},{"identifier":"remove_global_offer","inputs":[{"name":"offer_id","type":"u64","indexed":true},{"name":"collection","type":"TokenIdentifier","indexed":true}]},{"identifier":"accept_global_offer","inputs":[{"name":"offer","type":"GlobalOffer","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"nonces","type":"List<EsdtTokenPayment>","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"auction_ids","type":"List<u64>","indexed":true}]},{"identifier":"offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true}]},{"identifier":"withdraw_offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true}]},{"identifier":"accept_offer_token_event","inputs":[{"name":"token_type","type":"TokenIdentifier","indexed":true},{"name":"token_nonce","type":"u64","indexed":true},{"name":"quantity","type":"BigUint","indexed":true},{"name":"status","type":"OfferStatus","indexed":true},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_token_nonce","type":"u64","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"deadline","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"offer_owner","type":"Address","indexed":true},{"name":"marketplace_cut_percentage","type":"BigUint","indexed":true},{"name":"offer_id","type":"u64","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"auction_removed","type":"u64","indexed":true}]},{"identifier":"bid_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"bidder","type":"Address","indexed":true},{"name":"bid_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"token_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"token_payment_nonce","type":"u64","indexed":true}]},{"identifier":"end_auction_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"auction_winner","type":"Address","indexed":true},{"name":"winning_bid_amount","type":"BigUint","indexed":true},{"name":"auction_seller","type":"Address","indexed":true},{"name":"token_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"token_payment_nonce","type":"u64","indexed":true}]},{"identifier":"change_listing_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"owner","type":"Address","indexed":true},{"name":"old_price","type":"BigUint","indexed":true},{"name":"new_price","type":"BigUint","indexed":true},{"name":"payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"payment_nonce","type":"u64","indexed":true},{"name":"deadline","type":"u64","indexed":true}]},{"identifier":"out_bid_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"old_bidder","type":"Address","indexed":true},{"name":"new_bidder","type":"Address","indexed":true},{"name":"refund_amount","type":"BigUint","indexed":true},{"name":"new_amount","type":"BigUint","indexed":true},{"name":"refund_payment_type","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"refund_payment_nonce","type":"u64","indexed":true}]},{"identifier":"buy_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_bought_tokens","type":"BigUint","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"bid_sft_amount","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"accepted_payment_token_nonce","type":"u64","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"message","type":"bytes","indexed":true},{"name":"buy_by","type":"Address","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"original_payment","type":"EgldOrEsdtTokenPayment","indexed":true}]},{"identifier":"withdraw_event","inputs":[{"name":"auction_token_id","type":"TokenIdentifier","indexed":true},{"name":"auctioned_token_nonce","type":"u64","indexed":true},{"name":"auction_id","type":"u64","indexed":true},{"name":"nr_auctioned_tokens","type":"BigUint","indexed":true},{"name":"seller","type":"Address","indexed":true}]},{"identifier":"user_deposit","inputs":[{"name":"owner","type":"Address","indexed":true},{"name":"payment","type":"EgldOrEsdtTokenPayment","indexed":true}]},{"identifier":"collection_config_event","inputs":[{"name":"collection","type":"TokenIdentifier","indexed":true},{"name":"config","type":"CollectionFeeConfig","indexed":true}]}],"esdtAttributes":[],"hasCallback":false,"types":{"AggregatorStep":{"type":"struct","fields":[{"name":"token_in","type":"TokenIdentifier"},{"name":"token_out","type":"TokenIdentifier"},{"name":"amount_in","type":"BigUint"},{"name":"pool_address","type":"Address"},{"name":"function_name","type":"bytes"},{"name":"arguments","type":"List<bytes>"}]},"Auction":{"type":"struct","fields":[{"name":"auctioned_token_type","type":"TokenIdentifier"},{"name":"auctioned_token_nonce","type":"u64"},{"name":"nr_auctioned_tokens","type":"BigUint"},{"name":"auction_type","type":"AuctionType"},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"min_bid","type":"BigUint"},{"name":"max_bid","type":"Option<BigUint>"},{"name":"start_time","type":"u64"},{"name":"deadline","type":"u64"},{"name":"original_owner","type":"Address"},{"name":"current_bid","type":"BigUint"},{"name":"current_winner","type":"Address"},{"name":"marketplace_cut_percentage","type":"BigUint"},{"name":"creator_royalties_percentage","type":"BigUint"}]},"AuctionType":{"type":"enum","variants":[{"name":"None","discriminant":0},{"name":"NftBid","discriminant":1},{"name":"Nft","discriminant":2},{"name":"SftAll","discriminant":3},{"name":"SftOnePerPayment","discriminant":4}]},"BulkListing":{"type":"struct","fields":[{"name":"min_bid","type":"BigUint"},{"name":"max_bid","type":"BigUint"},{"name":"deadline","type":"u64"},{"name":"accepted_payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"bid","type":"bool"},{"name":"opt_sft_max_one_per_payment","type":"bool"},{"name":"opt_start_time","type":"u64"},{"name":"collection","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"nft_amount","type":"BigUint"},{"name":"royalties","type":"BigUint"}]},"BulkOffers":{"type":"struct","fields":[{"name":"offer_id","type":"u64"},{"name":"nonce","type":"u64"},{"name":"offer","type":"Offer"}]},"BulkUpdateListing":{"type":"struct","fields":[{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"new_price","type":"BigUint"},{"name":"auction_id","type":"u64"},{"name":"deadline","type":"u64"}]},"CollectionExtraFeesConfig":{"type":"struct","fields":[{"name":"amount","type":"BigUint"},{"name":"address","type":"Address"}]},"CollectionFeeConfig":{"type":"struct","fields":[{"name":"reverse_cut_fees","type":"bool"},{"name":"reverse_royalties","type":"bool"},{"name":"custom_royalties","type":"bool"},{"name":"min_royalties","type":"BigUint"},{"name":"max_royalties","type":"BigUint"},{"name":"extra_fees","type":"CollectionExtraFeesConfig"},{"name":"admin","type":"Address"}]},"EgldOrEsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"EgldOrEsdtTokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"EsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"GlobalOffer":{"type":"struct","fields":[{"name":"offer_id","type":"u64"},{"name":"collection","type":"TokenIdentifier"},{"name":"quantity","type":"BigUint"},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"timestamp","type":"u64"},{"name":"owner","type":"Address"},{"name":"attributes","type":"Option<bytes>"},{"name":"new_version","type":"bool"}]},"Offer":{"type":"struct","fields":[{"name":"token_type","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"quantity","type":"BigUint"},{"name":"status","type":"OfferStatus"},{"name":"payment_token_type","type":"EgldOrEsdtTokenIdentifier"},{"name":"payment_token_nonce","type":"u64"},{"name":"price","type":"BigUint"},{"name":"deadline","type":"u64"},{"name":"timestamp","type":"u64"},{"name":"offer_owner","type":"Address"},{"name":"marketplace_cut_percentage","type":"BigUint"},{"name":"new_version","type":"bool"}]},"OfferStatus":{"type":"enum","variants":[{"name":"Pending","discriminant":0},{"name":"Accepted","discriminant":1},{"name":"Declined","discriminant":2},{"name":"Withdraw","discriminant":3}]},"TokenAmount":{"type":"struct","fields":[{"name":"token","type":"TokenIdentifier"},{"name":"amount","type":"BigUint"}]},"TokensOnSale":{"type":"struct","fields":[{"name":"auction_id","type":"u64"},{"name":"token_type","type":"u8"},{"name":"auction","type":"Auction"}]}}}');var S=__webpack_require__.t(I,2);const E=JSON.parse('{"buildInfo":{"rustc":{"version":"1.69.0-nightly","commitHash":"c8e6a9e8b6251bbc8276cb78cabe1998deecbed7","commitDate":"2023-01-23","channel":"Nightly","short":"rustc 1.69.0-nightly (c8e6a9e8b 2023-01-23)"},"contractCrate":{"name":"minter","version":"0.0.0"},"framework":{"name":"multiversx-sc","version":"0.39.6"}},"name":"Minter","constructor":{"inputs":[{"name":"local_owner","type":"Address"},{"name":"cut_percentage","type":"BigUint"},{"name":"signer_wallet","type":"Address"}],"outputs":[]},"endpoints":[{"name":"buy","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"quantity","type":"u32"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"buyFor","onlyOwner":true,"mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"quantity","type":"u32"},{"name":"user","type":"Address"},{"name":"twispay","type":"bytes"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"giveaway","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"to","type":"Address"},{"name":"quantity","type":"u32"}],"outputs":[]},{"name":"giveawayAdmin","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"to","type":"Address"},{"name":"quantity","type":"u32"},{"name":"twispay","type":"bytes"},{"name":"signature","type":"optional<bytes>","multi_arg":true},{"name":"data","type":"optional<bytes>","multi_arg":true}],"outputs":[]},{"name":"reveal","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"changeLocalOwner","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"owner","type":"Address"}],"outputs":[]},{"name":"tradingControl","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"burn","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"}],"outputs":[]},{"name":"transferOwner","mutability":"mutable","inputs":[{"name":"collection","type":"bytes"}],"outputs":[]},{"name":"claim_royalties","mutability":"mutable","inputs":[],"outputs":[]},{"name":"claimESDT","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonces","type":"variadic<u64>","multi_arg":true}],"outputs":[]},{"name":"setCutPercentage","onlyOwner":true,"mutability":"mutable","inputs":[{"name":"new_cut_percentage","type":"BigUint"}],"outputs":[]},{"name":"claimTokens","mutability":"mutable","inputs":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u32"}],"outputs":[]},{"name":"addRewards","mutability":"mutable","payableInTokens":["*"],"inputs":[{"name":"tag","type":"bytes"},{"name":"reward","type":"BigUint"}],"outputs":[]},{"name":"removeRewards","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"stopMintShareholder","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"}],"outputs":[]},{"name":"stopRoyaltiesShareholder","mutability":"mutable","inputs":[],"outputs":[]},{"name":"addMintShareholder","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"shareholders","type":"variadic<multi<Address,BigUint>>","multi_arg":true}],"outputs":[]},{"name":"addRoyaltiesShareholder","mutability":"mutable","inputs":[{"name":"shareholders","type":"variadic<multi<Address,BigUint>>","multi_arg":true}],"outputs":[]},{"name":"getMintShareholders","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<ShareHolders>","multi_result":true}]},{"name":"getRoyaltiesShareholders","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<ShareHolders>","multi_result":true}]},{"name":"isMintEditBlocked","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"bool"}]},{"name":"rewardPerCollection","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"RewardStruct"}]},{"name":"isRoyaltiesEditBlocked","mutability":"readonly","inputs":[],"outputs":[{"type":"bool"}]},{"name":"cutPercentage","mutability":"readonly","inputs":[],"outputs":[{"type":"BigUint"}]},{"name":"localOwner","mutability":"readonly","inputs":[],"outputs":[{"type":"Address"}]},{"name":"buysPerWallet","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"buysStagePerWallet","mutability":"readonly","inputs":[{"name":"user","type":"Address"},{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"getNFTsIDs","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<bytes>","multi_result":true}]},{"name":"nextNftNonce","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"getAcceptedTokens","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<EgldOrEsdtTokenIdentifier>","multi_result":true}]},{"name":"lastNFTIdAdded","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"listingByTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"Listing"}]},{"name":"maxBuysPerTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"tokenByTag","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"TokenIdentifier"}]},{"name":"isActive","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"bool"}]},{"name":"getPaymentTokenPrice","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"token","type":"EgldOrEsdtTokenIdentifier"}],"outputs":[{"type":"BigUint"}]},{"name":"revealID","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"nonce","type":"u64"}],"outputs":[{"type":"bytes"}]},{"name":"collections","mutability":"readonly","inputs":[],"outputs":[{"type":"variadic<bytes>","multi_result":true}]},{"name":"signer","mutability":"readonly","inputs":[],"outputs":[{"type":"bytes"}]},{"name":"listingByTagV2","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"NewListing"}]},{"name":"mintStage","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"variadic<multi<bytes,Stage>>","multi_result":true}]},{"name":"getWhitelistedWallets","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"variadic<Address>","multi_result":true}]},{"name":"isWhitelisted","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"address","type":"Address"}],"outputs":[{"type":"bool"}]},{"name":"getListings","mutability":"readonly","inputs":[],"outputs":[{"type":"List<NewListing>"}]},{"name":"getListing","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"NewListing"}]},{"name":"getStages","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"}],"outputs":[{"type":"List<Stage>"}]},{"name":"getStage","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"Stage"}]},{"name":"whitelistSize","mutability":"readonly","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[{"type":"u32"}]},{"name":"listing","mutability":"mutable","payableInTokens":["EGLD"],"inputs":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"royalties","type":"BigUint"},{"name":"token_name","type":"bytes"},{"name":"token_ticker","type":"bytes"},{"name":"collection_size","type":"u32"},{"name":"global_max_per_wallet","type":"u32"},{"name":"collectiontag","type":"bytes"},{"name":"nft_ending","type":"bytes"},{"name":"name_shuffle","type":"bool"},{"name":"has_attributes","type":"bool"},{"name":"has_kyc","type":"bool"},{"name":"refund_policy","type":"bool"},{"name":"public_burn","type":"bool"},{"name":"bot_protection","type":"bool"},{"name":"has_reveal","type":"bool"}],"outputs":[]},{"name":"createStage","mutability":"mutable","inputs":[{"name":"args","type":"StageArgs"}],"outputs":[]},{"name":"removeStage","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[]},{"name":"changeTime","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"start_date","type":"u64"},{"name":"end_time","type":"u64"}],"outputs":[]},{"name":"removePaymentToken","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"token","type":"TokenIdentifier"}],"outputs":[]},{"name":"addPaymentToken","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"token","type":"TokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"price","type":"BigUint"}],"outputs":[]},{"name":"addWhitelists","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"wallets","type":"variadic<Address>","multi_arg":true}],"outputs":[]},{"name":"removeWhitelists","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"},{"name":"wallets","type":"variadic<Address>","multi_arg":true}],"outputs":[]},{"name":"clearWhitelist","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage","type":"bytes"}],"outputs":[]},{"name":"maxBuysPerWallet","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"max","type":"u32"}],"outputs":[]},{"name":"maxStageBuysPerWallet","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"max","type":"u32"}],"outputs":[]},{"name":"changeStageMintLimit","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"mint_limit","type":"u32"}],"outputs":[]},{"name":"changeWLStatus","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"botProtection","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"enableReveal","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"cid","type":"bytes"}],"outputs":[]},{"name":"publicBurn","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"status","type":"bool"}],"outputs":[]},{"name":"setActive","mutability":"mutable","inputs":[{"name":"tag","type":"bytes"},{"name":"stage_name","type":"bytes"},{"name":"is_active","type":"bool"}],"outputs":[]}],"events":[{"identifier":"emit_minting_stage_status","inputs":[{"name":"stage","type":"Stage","indexed":true}]},{"identifier":"emit_minting_status","inputs":[{"name":"contract_info","type":"NewListing","indexed":true}]},{"identifier":"emit_listing_event","inputs":[{"name":"listing","type":"NewListing","indexed":true}]},{"identifier":"emit_stage_event","inputs":[{"name":"stage","type":"Stage","indexed":true}]},{"identifier":"emit_stage_mint_event","inputs":[{"name":"stage","type":"Stage","indexed":true},{"name":"total_mint","type":"u32","indexed":true}]},{"identifier":"emit_buy_event","inputs":[{"name":"payments","type":"List<EsdtTokenPayment>","indexed":true},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"token_identifier","type":"TokenIdentifier","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"epoch","type":"u64","indexed":true}]},{"identifier":"emit_buy_fiat_event","inputs":[{"name":"payments","type":"List<EsdtTokenPayment>","indexed":true},{"name":"payment_token","type":"EgldOrEsdtTokenIdentifier","indexed":true},{"name":"buyer","type":"Address","indexed":true},{"name":"price","type":"BigUint","indexed":true},{"name":"token_identifier","type":"TokenIdentifier","indexed":true},{"name":"timestamp","type":"u64","indexed":true},{"name":"epoch","type":"u64","indexed":true},{"name":"twispay","type":"bytes","indexed":true}]}],"hasCallback":true,"types":{"EsdtTokenPayment":{"type":"struct","fields":[{"name":"token_identifier","type":"TokenIdentifier"},{"name":"token_nonce","type":"u64"},{"name":"amount","type":"BigUint"}]},"Listing":{"type":"struct","fields":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"collectiontag","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"nft_ending","type":"bytes"},{"name":"royalties","type":"BigUint"},{"name":"mint_price","type":"BigUint"},{"name":"collection_size","type":"u32"},{"name":"start_date","type":"u64"},{"name":"mint_roles","type":"bool"},{"name":"owner_transfered","type":"bool"}]},"NewListing":{"type":"struct","fields":[{"name":"cid","type":"bytes"},{"name":"tags","type":"bytes"},{"name":"collection_tag","type":"bytes"},{"name":"media_type","type":"bytes"},{"name":"base_nft_name","type":"bytes"},{"name":"has_attributes","type":"bool"},{"name":"owner_transfered","type":"bool"},{"name":"collection_size","type":"u32"},{"name":"nft_minted","type":"u32"},{"name":"global_max_per_wallet","type":"u32"},{"name":"royalties","type":"BigUint"},{"name":"token","type":"TokenIdentifier"},{"name":"old_version","type":"bool"},{"name":"name_shuffle","type":"bool"},{"name":"transfer_role","type":"bool"},{"name":"public_burn","type":"bool"},{"name":"has_kyc","type":"bool"},{"name":"refund_policy","type":"bool"},{"name":"bot_protection","type":"bool"},{"name":"has_reveal","type":"bool"}]},"RewardStruct":{"type":"struct","fields":[{"name":"token","type":"EgldOrEsdtTokenIdentifier"},{"name":"nonce","type":"u64"},{"name":"amount","type":"BigUint"},{"name":"reward","type":"BigUint"}]},"ShareHolders":{"type":"struct","fields":[{"name":"address","type":"Address"},{"name":"share","type":"BigUint"}]},"Stage":{"type":"struct","fields":[{"name":"name","type":"bytes"},{"name":"tag","type":"bytes"},{"name":"status","type":"bool"},{"name":"is_whitelist","type":"bool"},{"name":"start_time","type":"u64"},{"name":"end_time","type":"u64"},{"name":"mint_limit","type":"u32"},{"name":"mint_count","type":"u32"},{"name":"prices","type":"List<EsdtTokenPayment>"},{"name":"max_per_wallet","type":"u32"}]},"StageArgs":{"type":"struct","fields":[{"name":"name","type":"bytes"},{"name":"tag","type":"bytes"},{"name":"is_whitelist","type":"bool"},{"name":"start_time","type":"u64"},{"name":"end_time","type":"u64"},{"name":"mint_limit","type":"u32"},{"name":"prices","type":"List<EsdtTokenPayment>"},{"name":"max_per_wallet","type":"u32"}]}}}');var C=__webpack_require__.t(E,2);class _{static manager;static exchange;static minter;static market;static staking;static p2p;static async getMarket(){if(!_.market){const e=v.AbiRegistry.create(S);_.market=e}return _.market}static async getManager(){if(!_.manager){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/manage.json`,{next:{tags:["getManager"]}}),t=v.AbiRegistry.create(e);_.manager=t}return _.manager}static async getMinter(){if(!_.minter){const e=v.AbiRegistry.create(C);_.minter=e}return _.minter}static async getStaking(){if(!_.staking){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/staking-nfts.abi.json`,{next:{tags:["getStaking"]}}),t=v.AbiRegistry.create(e);_.staking=t}return _.staking}static async getExchange(){if(!_.exchange){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/rs-exchange.abi.json`,{next:{tags:["getExchange"]}}),t=v.AbiRegistry.create(e);_.exchange=t}return _.exchange}static async getP2P(){if(!_.p2p){const e=await A.getInstance().fetchWithTimeout(`${A.getInstance().config.mediaUrl}/smartcontractabi/p2p.abi.json`,{next:{tags:["getP2P"]}}),t=v.AbiRegistry.create(e);_.p2p=t}return _.p2p}}var B=__webpack_require__(1998);const O=(e,n)=>new B.SmartContract({address:new t.Address(n),abi:e});class N{xo;call;api;config;factory;constructor(e){this.config=A.getInstance().config;const t=O(e,this.config.XO_SC);this.xo=t,this.call=new w,this.api=A.getInstance();const n=new c.TransactionsFactoryConfig({chainID:this.api.chain.valueOf()});this.factory=new u.SmartContractTransactionsFactory({config:n,abi:e})}static async init(){const e=await _.getMarket();return new N(e)}async getResult(e){return await this.call.runQuery(this.xo,e)}getMarketplaceFees=async()=>{const e=this.xo.methods.getMarketplaceCutPercentage(),t=await this.getResult(e);return parseInt(t.firstValue?.valueOf())};getAcceptedPaymentTokens=async()=>{const e=this.xo.methods.getAcceptedTokens(),t=await this.getResult(e);return t.firstValue?.valueOf()};getGlobalOfferIDs=async()=>{const e=this.xo.methods.getGlobalOffers(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>parseInt(e)))};async getUserPoolBalance(e,t,n){const r=await this.getResult(this.xo.methods.userDeposit([e,t,n]));return r?.firstValue?new i.BigUIntValue(r.firstValue.valueOf().amount).valueOf().shiftedBy(-18).toNumber():0}isOfferActive(e,t){return e<=t}getGlobalOfferData=async e=>{const t=this.xo.methods.getGlobalOffer([e]),n=await this.getResult(t),r=n.firstValue?.valueOf();return r.offer_id=parseInt(r.offer_id.valueOf()),r.marketplace="xoxno",r.short_price=parseFloat(new i.BigUIntValue(r.price).valueOf().shiftedBy(-18).toString()),r.new_version=Boolean(r.new_version),r.new_version?r.isActive=!0:r.isActive=this.isOfferActive(r.short_price,await this.getUserPoolBalance(r.owner,r.payment_token,r.payment_nonce)),r.quantity=parseInt(r.quantity.valueOf()),r.payment_nonce=parseInt(r.payment_nonce.valueOf()),r.price=r.price.valueOf(),r.timestamp=parseInt(r.timestamp.valueOf()),r.owner=r.owner.valueOf().toString(),r.attributes&&(r.attributes=JSON.parse(Buffer.from(r.attributes.valueOf().toString(),"base64").toString("ascii"))),r};getAuctionInfo=async e=>{const t=this.xo.methods.getFullAuctionData([e]),n=await this.getResult(t),r=n.firstValue?.valueOf();return r?(r.auctioned_token_nonce=parseInt(r.auctioned_token_nonce.valueOf()),r.nr_auctioned_tokens=parseInt(r.nr_auctioned_tokens.valueOf()),r.auction_type=r.auction_type.name,r.payment_token_nonce=parseInt(r.payment_token_nonce.valueOf()),r.min_bid=r.min_bid.valueOf(),r.max_bid=r.max_bid.valueOf(),r.start_time=parseInt(r.start_time.valueOf()),r.deadline=parseInt(r.deadline.valueOf()),r.original_owner=r.original_owner.valueOf().toString(),r.current_winner=r.current_winner.valueOf().toString(),r.current_bid=r.current_bid.valueOf().toString(),r.marketplace_cut_percentage=r.marketplace_cut_percentage.valueOf(),r.creator_royalties_percentage=r.creator_royalties_percentage.valueOf(),r):null};async getListingsCount(){const e=await this.getResult(this.xo.methods.getListingsCount());return parseInt(e.firstValue?.valueOf())}async getOffersCount(){const e=await this.getResult(this.xo.methods.getOffersCount());return parseInt(e.firstValue?.valueOf())}async getGlobalOffersCount(){const e=await this.getResult(this.xo.methods.getGlobalOffersCount());return parseInt(e.firstValue?.valueOf())}async getCollectionsCount(){const e=await this.getResult(this.xo.methods.getCollectionsCount());return parseInt(e.firstValue?.valueOf())}async isCollectionListed(e){const t=await this.getResult(this.xo.methods.isCollectionListed([e]));return Boolean(t.firstValue?.valueOf())}async getCollectionNFTsOnSaleCount(e){const t=await this.getResult(this.xo.methods.getTokenItemsForSaleCount([e]));return parseInt(t.firstValue?.valueOf())}async getAuctionIDsForCollection(e){const t=await this.getResult(this.xo.methods.getAuctionsForTicker([e])),n=t.firstValue?.valueOf().map((e=>parseInt(e)));return n}withdrawAuctions({auctionIDs:n,sender:r,market:s="xoxno",signature:a}){if("xoxno"===s){const s=this.xo.methodsExplicit.withdraw([e.BytesValue.fromHex(a),...n.map((e=>new i.U64Value(e)))]);return r.nonce&&s.withNonce(r.nonce),[s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6+8e6*n.length)).buildTransaction().toPlainObject()]}if("frameit"==s)return n.map(((e,n)=>{const s=this.xo.methodsExplicit.withdraw([new i.U64Value(e)]);return r.nonce&&s.withNonce(r.nonce+n),s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6)).withExplicitReceiver(new t.Address(this.config.FM_SC)).buildTransaction().toPlainObject()}));if("deadrare"==s)return n.map(((e,n)=>{const s=this.xo.methodsExplicit.withdraw([new i.U64Value(e)]);return r.nonce&&s.withNonce(r.nonce+n),s.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(Math.min(6e8,25e6)).withExplicitReceiver(new t.Address(this.config.DR_SC)).buildTransaction().toPlainObject()}));throw new Error("Market not supported")}withdrawGlobalOffer(e,n="xoxno",r){if("xoxno"!=n)throw Error("Marketplace not supported");const i=this.xo.methods.withdrawGlobalOffer([e]);return r.nonce&&i.withNonce(r.nonce),i.withChainID(this.api.chain).withSender(new t.Address(r.address)).withGasLimit(2e7).buildTransaction().toPlainObject()}acceptGlobalOffer({signature:e,offer_id:n,auction_ids_opt:r,market:i,nfts:s,address:a,nonce:u}){if("xoxno"!=i)throw Error("Marketplace not supported");const c=e?this.xo.methods.acceptGlobalOffer([n,r??[],e]):this.xo.methods.acceptGlobalOffer([n,r]);return c.withSender(new t.Address(a)),s.length>0&&c.withMultiESDTNFTTransfer(s.map((e=>o.TokenTransfer.semiFungible(e.collection,e.nonce,e.amount??1)))),u&&c.withNonce(u),c.withChainID(this.api.chain).withGasLimit(Math.min(35e6+7e6*(s.length+r.length)+(null==e?15e6:0),6e8)).buildTransaction().toPlainObject()}sendGlobalOffer({payment_token:e,payment_nonce:n,price:r,collection:i,quantity:s,attributes:a,depositAmount:u,address:c,nonce:l}){const d=this.xo.methods.sendGlobalOffer([e,n,o.TokenTransfer.egldFromAmount(r).toString(),i,s,...a?[a]:[]]);return l&&d.withNonce(l),d.withSender(new t.Address(c)),u&&d.withValue(u),d.withChainID(this.api.chain).withGasLimit(25e6+(a?1500*a?.length:0)).buildTransaction().toPlainObject()}sendCustomOffer({payment_token:e,payment_nonce:n,price:r,deadline:i,nft:s,depositAmount:a,address:u,nonce:c}){const l=this.xo.methods.sendOffer([e,n,o.TokenTransfer.egldFromAmount(r).toString(),s.collection,s.nonce,s.amount??1,i]);return c&&l.withNonce(c),l.withSender(new t.Address(u)),a&&l.withValue(a),l.withChainID(this.api.chain).withGasLimit(3e7).buildTransaction().toPlainObject()}withdrawCustomOffer(e,n,r){if("xoxno"===r){const r=this.xo.methods.withdrawOffer([e]);return n.nonce&&r.withNonce(n.nonce),r.withSender(new t.Address(n.address)),r.withChainID(this.api.chain).withGasLimit(15e6).buildTransaction().toPlainObject()}throw Error("Market not supported")}declineCustomOffer(e,n,r,i){if("xoxno"==i){const i=r.onSale?this.xo.methods.declineOffer([e,r.saleInfo?.auctionId]):this.xo.methods.declineOffer([e]);return n.nonce&&i.withNonce(n.nonce),i.withSender(new t.Address(n.address)),r.onSale||i.withSingleESDTNFTTransfer(o.TokenTransfer.semiFungible(r.collection,r.nonce,1)),i.withChainID(this.api.chain).withGasLimit(2e7).buildTransaction().toPlainObject()}throw Error("Market not supported")}acceptCustomOffer(e,n,r,i){if("xoxno"==i){const i=r.onSale?this.xo.methods.acceptOffer([e,r.saleInfo?.auctionId]):this.xo.methods.acceptOffer([e]);return n.nonce&&i.withNonce(n.nonce),i.withSender(new t.Address(n.address)),r.onSale||i.withSingleESDTNFTTransfer(o.TokenTransfer.semiFungible(r.collection,r.nonce,1)),i.withChainID(this.api.chain).withGasLimit(45e6).buildTransaction().toPlainObject()}throw Error("Market not supported")}endAuction(e,n,r="xoxno"){if("xoxno"==r){const r=this.xo.methods.endAuction([e]);return n.nonce&&r.withNonce(n.nonce),r.withSender(new t.Address(n.address)),r.withChainID(this.api.chain).withGasLimit(25e6).buildTransaction().toPlainObject()}throw new Error("Market not supported")}bidOnAuctionId(e,n,r,i,s){if(!i.amount)throw new Error("Payment amount is required");const a="EGLD"==i.collection,u=this.factory.createTransactionForExecute({sender:new t.Address(s.address),contract:new t.Address(this.config.XO_SC),function:"bid",gasLimit:25000000n,arguments:[e,n,r],nativeTransferAmount:a?BigInt(i.amount):void 0,tokenTransfers:a?void 0:[new o.TokenTransfer({token:new o.Token({identifier:i.collection,nonce:BigInt(i.nonce??0)}),amount:BigInt(i.amount)})]});return s.nonce&&(u.nonce=BigInt(s.nonce)),u.toPlainObject()}bulkBuy(e,n,r){const i=this.xo.methods.bulkBuy(e);if(r.nonce&&i.withNonce(r.nonce),i.withSender(new t.Address(r.address)),!n.amount)throw new Error("Payment amount is required");return"EGLD"==n.collection?i.withValue(n.amount):i.withSingleESDTTransfer(o.TokenTransfer.fungibleFromBigInteger(n.collection,n.amount,n.decimals??18)),i.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+2e7*e.length)).buildTransaction().toPlainObject()}async buyAuctionById({auctionID:e,collection:n,nonce:r,paymentAmount:i,quantity:s=1,token:a="EGLD",withCheck:u=!0,isBigUintPayment:c=!1,isBid:l=!1,decimals:f=18,market:h="xoxno",sender:p}){if("xoxno"!==h)throw new Error("Market not supported");if(!e)throw new Error("AuctionID not provided");let g=null;if(!i||!a||!n||!r||u){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");if(g.auction_type===y.Nft||g.auction_type===y.SftOnePerPayment)throw new Error("Auction type is not NFT or SftOnePerPayment")}const m=g?.payment_token_type??a,A=!!g||c;let b=l?g?.max_bid??i:g?.min_bid??i;if(!b)throw new Error("Payment amount not provided");const T=this.xo.methods.buy([e,g?.auctioned_token_type??n,g?.auctioned_token_nonce??r,s??1]);if(p.nonce&&T.withNonce(p.nonce),T.withSender(new t.Address(p.address)),"EGLD"===a)T.withValue(A?o.TokenTransfer.egldFromBigInteger(new(d())(b).multipliedBy(s)):o.TokenTransfer.egldFromAmount(new(d())(b).multipliedBy(s)));else{if(!A){if(g=await this.getAuctionInfo(e),null===g)throw new Error("Auction not found");b=l?g.max_bid:g.min_bid}T.withSingleESDTTransfer(o.TokenTransfer.fungibleFromBigInteger(m,b,f))}return T.withChainID(this.api.chain).withGasLimit(45e6).buildTransaction().toPlainObject()}async changeListing(n,o,u){if(!u)throw Error("Market is required");const c=new s.StructType("BulkUpdateListing",[new r.FieldDefinition("payment_token_type","",new a.TokenIdentifierType),new r.FieldDefinition("new_price","",new i.BigUIntType),new r.FieldDefinition("auction_id","",new i.U64Type),new r.FieldDefinition("deadline","",new i.U64Type)]),l=[];n.forEach((({paymentToken:e,price:t,auctionID:n,deadline:o})=>{l.push(new s.Struct(c,[new r.Field(new a.TokenIdentifierValue(e),"payment_token_type"),new r.Field(new i.BigUIntValue(t),"new_price"),new r.Field(new i.U64Value(n),"auction_id"),new r.Field(new i.U64Value(o),"deadline")]))}));const d=this.xo.methods.changeListing([e.VariadicValue.fromItems(...l)]);return o.nonce&&d.withNonce(o.nonce),d.withSender(new t.Address(o.address)),d.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+5e6*n.length)).buildTransaction().toPlainObject()}async listNFTs(e,u){const c=new s.StructType("BulkListing",[new r.FieldDefinition("min_bid","",new i.BigUIntType),new r.FieldDefinition("max_bid","",new i.BigUIntType),new r.FieldDefinition("deadline","",new i.U64Type),new r.FieldDefinition("accepted_payment_token","",new a.TokenIdentifierType),new r.FieldDefinition("bid","",new n.BooleanType),new r.FieldDefinition("opt_sft_max_one_per_payment","",new n.BooleanType),new r.FieldDefinition("opt_start_time","",new i.U64Type),new r.FieldDefinition("collection","",new a.TokenIdentifierType),new r.FieldDefinition("nonce","",new i.U64Type),new r.FieldDefinition("nft_amount","",new i.BigUIntType)]),l=[],f=[];e.forEach((e=>{const t=e.accepted_payment_token_decimals??18,u=new(d())(e.min_bid).shiftedBy(t),h=new(d())(e.max_bid??0).shiftedBy(t);f.push(o.TokenTransfer.semiFungible(e.collection,e.nonce,e.nft_amount)),l.push(new s.Struct(c,[new r.Field(new i.BigUIntValue(u),"min_bid"),new r.Field(new i.BigUIntValue(h),"max_bid"),new r.Field(new i.U64Value(new(d())(e.deadline??0)),"deadline"),new r.Field(new a.TokenIdentifierValue(e.accepted_payment_token??"EGLD"),"accepted_payment_token"),new r.Field(new n.BooleanValue(e.bid??!1),"bid"),new r.Field(new n.BooleanValue(e.isSFTPack??!1),"opt_sft_max_one_per_payment"),new r.Field(new i.U64Value(new(d())(e.opt_start_time?e.opt_start_time:0)),"opt_start_time"),new r.Field(new a.TokenIdentifierValue(e.collection),"collection"),new r.Field(new i.U64Value(e.nonce),"nonce"),new r.Field(new i.BigUIntValue(new(d())(e.nft_amount)),"nft_amount")]))}));const h=this.xo.methods.listings(l);return u.nonce&&h.withNonce(u.nonce),h.withSender(new t.Address(u.address)),h.withMultiESDTNFTTransfer(f),h.withChainID(this.api.chain).withGasLimit(Math.min(6e8,25e6+45e5*e.length)).buildTransaction().toPlainObject()}}class x{minter;call;constructor(e){this.minter=e,this.call=new w}async getResult(e){return await this.call.runQuery(this.minter,e)}static async init(e){const t=await _.getMinter(),n=O(t,e);return new x(n)}getAllUniqueTags=async()=>{const e=this.minter.methods.collections(),t=await this.getResult(e);return t.firstValue?.valueOf().map((e=>e.toString()))};getWalletGlobalBuyCount=async(e,t)=>{const n=this.minter.methods.buysPerWallet([e,t]),r=await this.getResult(n);return r.firstValue?.valueOf()};getWalletStageBuyCount=async(e,t,n)=>{const r=this.minter.methods.buysStagePerWallet([e,t,n]),i=await this.getResult(r);return i.firstValue?.valueOf()};getLocalOwner=async()=>{const e=this.minter.methods.localOwner(),t=await this.getResult(e);return t.firstValue?.valueOf()};getLaunchpadCutFee=async()=>{const e=this.minter.methods.cutPercentage(),t=await this.getResult(e);return t.firstValue?.valueOf()};getStageWhitelist=async(e,t)=>{const n=this.minter.methods.getWhitelistedWallets([e,t]),r=await this.getResult(n);return r.firstValue?.valueOf().map((e=>e.toString()))};getStages=async e=>{const t=this.minter.methods.mintStage([e]),n=await this.getResult(t);return n.firstValue?.valueOf().map((e=>{const t=e[1].valueOf();return t.name=t.name.toString(),t.tag=t.name.toString(),t.start_time=parseInt(t.start_time.toString()),t.end_time=parseInt(t.end_time.toString()),t.mint_limit=parseInt(t.mint_limit.toString()),t.mint_count=parseInt(t.mint_count.toString()),t.max_per_wallet=parseInt(t.max_per_wallet.toString()),t.prices=t.prices.map((e=>{const t=e.valueOf();return{...t,token_nonce:parseInt(t.token_nonce.toString()),amount:t.amount.toString()}})),t}))}}var P,D,k,R,L,F,U,M,V,G,H,j,q,Q,z,K,W,$,Y,J,X,Z,ee,te;!function(e){e.XO="xoxno",e.FM="frameit",e.DR="deadrare",e.KG="krogan"}(P||(P={})),function(e){e.Rank="metadata.rarity.rank",e.Attributes="metadata.attributes",e.Description="metadata.description",e.Name="name",e.OnSale="onSale",e.SaleInfo="saleInfo",e.Royalties="royalties",e.Identifier="identifier",e.Collection="collection",e.OriginalURL="url",e.Nonce="nonce",e.ContentType="originalMedia.contentType",e.WasProcessed="wasProcessed",e.AvifURL="avifUrl",e.WebpURL="webpUrl",e.Type="type"}(D||(D={})),function(e){e.PriceHighToLow="saleInfo.minBidShort desc",e.PriceLowToHigh="saleInfo.minBidShort asc",e.MaxPriceHighToLow="saleInfo.maxBidShort desc",e.MaxPriceLowToHigh="saleInfo.maxBidShort asc",e.BidPriceHighToLow="saleInfo.currentBidShort desc",e.BidPriceLowToHigh="saleInfo.currentBidShort asc",e.RarityHighToLow="metadata.rarity.rank desc",e.RarityLowToHigh="metadata.rarity.rank asc",e.NonceHighToLow="nonce desc",e.NonceLowToHigh="nonce asc",e.RecentListed="saleInfo.timestamp desc",e.OldestListed="saleInfo.timestamp asc",e.EndingLate="saleInfo.deadline desc",e.EndingSoon="saleInfo.deadline asc"}(k||(k={})),function(e){e.EndingLate="startTime desc",e.EndingSoon="startTime asc"}(R||(R={})),function(e){e.TotalVolumeHighToLow="statistics/tradeData/totalEgldVolume desc",e.FollowersHighToLow="statistics/other/followCount desc",e.IsVerifiedTrueToFalse="isVerified desc",e.HasImageTrueToFalse="profile desc",e.HasBannerTrueToFalse="banner desc"}(L||(L={})),function(e){e.WeekVolumeHighToLow="statistics.tradeData.weekEgldVolume desc",e.WeekVolumeLowToHigh="statistics.tradeData.weekEgldVolume asc",e.DailyVolumeHighToLow="statistics.tradeData.dayEgldVolume desc",e.DailyVolumeLowToHigh="statistics.tradeData.dayEgldVolume asc",e.TotalVolumeHighToLow="statistics.tradeData.totalEgldVolume desc",e.TotalVolumeLowToHigh="statistics.tradeData.totalEgldVolume asc",e.AvgVolumePriceHighToLow="statistics.tradeData.averageEgldPrice desc",e.AvgVolumePriceLowToHigh="statistics.tradeData.averageEgldPrice asc",e.ATHHighToLow="statistics.tradeData.athEgldPrice desc",e.ATHLowToHigh="statistics.tradeData.athEgldPrice asc",e.TotalTradesHighToLow="statistics.tradeData.totalTrades desc",e.TotalTradesLowToHigh="statistics.tradeData.totalTrades asc",e.SupplyHighToLow="statistics.other.nftCount desc",e.SupplyLowToHigh="statistics.other.nftCount asc",e.FollowersHighToLow="statistics.other.followCount desc",e.FollowersLowToHigh="statistics.other.followCount asc"}(F||(F={})),function(e){e.PriceHighToLow="priceShort desc",e.PriceLowToHigh="priceShort asc",e.OfferIdHighToLow="offerIddesc",e.OfferIdLowToHigh="offerId asc",e.RecentListed="timestamp desc",e.OldestListed="timestamp asc"}(U||(U={})),function(e){e.Profile="profile",e.Description="description",e.Creator="creator",e.Owner="owner",e.Socials="socials",e.Type="type",e.HasStaking="hasStaking",e.Name="name",e.Banner="banner",e.IsVerified="isVerified",e.IsMintable="isMintable",e.Statistics="statistics",e.Collection="collection"}(M||(M={})),function(e){e.Attributes="attributes",e.Collection="collection",e.Marketplace="marketplace",e.PaymentToken="paymentToken",e.LongPrice="price",e.ShortPrice="priceShort"}(V||(V={})),function(e){e.FixedPrice="FixedPrice",e.Auctions="Auctions",e.All="All",e.AllListed="AllListed"}(G||(G={})),function(e){e.ALL="all",e.Trade="trade",e.P2P="p2p",e.Staking="staking",e.Minting="minting"}(H||(H={})),function(e){e.TotalVolume="TotalVolume",e.TotalTrades="TotalTrades",e.DailyVolume="DailyVolume",e.Last2DaysVolume="Last2DaysVolume",e.DailyTrades="DailyTrades",e.Last2DaysTrades="Last2DaysTrades",e.WeekTrades="WeekTrades",e.LastWeekTrades="LastWeekTrades",e.WeekVolume="WeekVolume",e.LastWeekVolume="LastWeekVolume",e.WeeklyTradesMargin="WeeklyTradesMargin",e.DailyTradesMargin="DailyTradesMargin",e.WeeklyVolumeMargin="WeeklyVolumeMargin",e.DailyVolumeEgldMargin="DailyVolumeEgldMargin",e.CollectionAthTrade="CollectionAthTrade"}(j||(j={})),function(e){e.TradingStats="tradingStats"}(q||(q={})),function(e){e.ListedCountDesc="tradingStats.listedCount DESC",e.ListedCountAsc="tradingStats.listedCount ASC",e.FloorPriceDesc="tradingStats.floorPrice DESC",e.FloorPriceAsc="tradingStats.floorPrice ASC",e.TotalVolumeDesc="tradingStats.totalVolume DESC",e.TotalVolumeAsc="tradingStats.totalVolume ASC",e.TotalTradesDesc="tradingStats.totalTrades DESC",e.TotalTradesAsc="tradingStats.totalTrades ASC",e.AllTimeHighDesc="tradingStats.allTimeHigh.price DESC",e.AllTimeHighAsc="tradingStats.allTimeHigh.price ASC",e.DayVolumeDesc="tradingStats.day.volume DESC",e.DayVolumeAsc="tradingStats.day.volume ASC",e.DayVolumeMarginDesc="tradingStats.day.volumeMargin DESC",e.DayVolumeMarginAsc="tradingStats.day.volumeMargin ASC",e.DayTradesDesc="tradingStats.day.trades DESC",e.DayTradesAsc="tradingStats.day.trades ASC",e.DayTradesMarginDesc="tradingStats.day.tradesMargin DESC",e.DayTradesMarginAsc="tradingStats.day.tradesMargin ASC",e.WeekVolumeDesc="tradingStats.week.volume DESC",e.WeekVolumeAsc="tradingStats.week.volume ASC",e.WeekVolumeMarginDesc="tradingStats.week.volumeMargin DESC",e.WeekVolumeMarginAsc="tradingStats.week.volumeMargin ASC",e.WeekTradesDesc="tradingStats.week.trades DESC",e.WeekTradesAsc="tradingStats.week.trades ASC",e.WeekTradesMarginDesc="tradingStats.week.tradesMargin DESC",e.WeekTradesMarginAsc="tradingStats.week.tradesMargin ASC",e.MonthVolumeDesc="tradingStats.month.volume DESC",e.MonthVolumeAsc="tradingStats.month.volume ASC",e.MonthVolumeMarginDesc="tradingStats.month.volumeMargin DESC",e.MonthVolumeMarginAsc="tradingStats.month.volumeMargin ASC",e.MonthTradesDesc="tradingStats.month.trades DESC",e.MonthTradesAsc="tradingStats.month.trades ASC",e.MonthTradesMarginDesc="tradingStats.month.tradesMargin DESC",e.MonthTradesMarginAsc="tradingStats.month.tradesMargin ASC",e.YearVolumeDesc="tradingStats.year.volume DESC",e.YearVolumeAsc="tradingStats.year.volume ASC",e.YearVolumeMarginDesc="tradingStats.year.volumeMargin DESC",e.YearVolumeMarginAsc="tradingStats.year.volumeMargin ASC",e.YearTradesDesc="tradingStats.year.trades DESC",e.YearTradesAsc="tradingStats.year.trades ASC",e.YearTradesMarginDesc="tradingStats.year.tradesMargin DESC",e.YearTradesMarginAsc="tradingStats.year.tradesMargin ASC"}(Q||(Q={})),function(e){e.NFT_CREATE="nftCreate",e.NFT_BURN="nftBurn",e.NFT_UPDATE="nftUpdate",e.NFT_TRANSFER="nftTransfer",e.LISTING_CREATE="listingCreate",e.LISTING_WITHDRAW="listingWithdraw",e.LISTING_UPDATE="listingUpdate",e.AUCTION_BID="auctionBid",e.AUCTION_OUT_BID="auctionOutBid",e.OFFER_CREATE="offerCreate",e.OFFER_WITHDRAW="offerWithdraw",e.OFFER_REJECT="offerReject",e.GLOBAL_OFFER_CREATE="globalOfferCreate",e.GLOBAL_OFFER_WITHDRAW="globalOfferWithdraw",e.TRADE="trade",e.BULK_TRADE="bulkTrade",e.AUCTION_TRADE="auctionTrade",e.OTHER_TRADE="otherTrade",e.OFFER_TRADE="offerTrade",e.GLOBAL_OFFER_TRADE="globalOfferTrade",e.STAKE="stake",e.UN_STAKE="unStake"}(z||(z={})),function(e){e.PriceHighToLow="activityData.egldValue desc",e.PriceLowToHigh="activityData.egldValue asc",e.RecentPlaced="timestamp desc",e.OldestPlaced="timestamp asc"}(K||(K={})),function(e){e[e.attributes=0]="attributes",e[e.collection=1]="collection",e[e.offer_id=2]="offer_id",e[e.owner=3]="owner",e[e.short_price=4]="short_price",e[e.price=5]="price",e[e.id=6]="id",e[e.dataType=7]="dataType",e[e.marketplace=8]="marketplace",e[e.payment_token=9]="payment_token"}(W||(W={})),function(e){e.Dynamic="Dynamic",e.Fixed="Fixed"}($||($={})),function(e){e.Duo="Duo",e.Single="Single",e.Perk="Perk"}(Y||(Y={})),function(e){e.Staked="staked",e.Unbounding="unstaked",e.Available="available"}(J||(J={})),function(e){e.Received="received",e.Placed="placed"}(X||(X={})),function(e){e.NonFungibleESDT="NonFungibleESDT"}(Z||(Z={})),function(e){e.EVENT_MANAGER="event-manager",e.CHECK_IN_MANAGER="check-in-manager",e.EVENT_READER="event-reader"}(ee||(ee={})),function(e){e.EVENT_READER_VIEW="event-reader-view",e.EVENT_MANAGER_EDIT_PAGE="event-manager-edit-page",e.EVENT_MANAGER_CREATE_TICKET="event-manager-create-ticket",e.EVENT_MANAGER_EDIT_TICKET="event-manager-edit-ticket",e.EVENT_MANAGER_DELETE_TICKET="event-manager-delete-ticket",e.EVENT_MANAGER_EDIT_GUEST="event-manager-edit-guest",e.EVENT_MANAGER_CREATE_STAGE="event-manager-create-stage",e.EVENT_MANAGER_EDIT_STAGE="event-manager-edit-stage"}(te||(te={}));const ne=Object.values(ee),re=Object.values(te)})(),module.exports=__webpack_exports__})();
|