const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../utils/amounts.utils.cjs`),n=require(`../../data-structures/utxo/Utxo.cjs`);var r=(r,i,a,o,s=!0,c,l)=>{let u=t.countTotalAmountInUtxos(i),{erc20TokenAddress:d,mintAddress:f}=i[0];if(s&&a<0n&&u+a<0n)throw Error(e.transactionErrorCodes.INSUFFICIENT_FUNDS_TO_TRANSACT);let p=[new n.Utxo({amount:t.bigintMax(u+a,0n),erc20TokenAddress:d,mintAddress:f,nullifyingKey:r.getShieldedPrivateKey(),timeStamp:o,spendingPublicKey:r.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0})];if(c!==void 0&&l!==void 0){let[e,t,r,,i]=c.split(`,`);p.push(new n.Utxo({amount:l,erc20TokenAddress:d,mintAddress:f,H0:[BigInt(t),BigInt(r)],stealthAddress:e,encryptionKey:i,timeStamp:o,isNewStyle:!0}))}return{outputUtxos:p}};exports.outputUtxoProcessing=r;