@stellar/stellar-sdk
Version:
A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.
2 lines • 793 kB
JavaScript
/*! For license information please see stellar-sdk-no-eventsource.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("StellarSdk",[],t):"object"==typeof exports?exports.StellarSdk=t():e.StellarSdk=t()}(self,(()=>(()=>{var e={15:(e,t,r)=>{"use strict";var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.FastSigning=void 0,t.generate=function(e){return o.generate(e)},t.sign=function(e,t){return o.sign(e,t)},t.verify=function(e,t,r){return o.verify(e,t,r)};var o={};t.FastSigning="undefined"==typeof window?function(){var e;try{e=r(Object(function(){var e=new Error("Cannot find module 'sodium-native'");throw e.code="MODULE_NOT_FOUND",e}()))}catch(e){return i()}return Object.keys(e).length?(o.generate=function(t){var r=n.alloc(e.crypto_sign_PUBLICKEYBYTES),o=n.alloc(e.crypto_sign_SECRETKEYBYTES);return e.crypto_sign_seed_keypair(r,o,t),r},o.sign=function(t,r){t=n.from(t);var o=n.alloc(e.crypto_sign_BYTES);return e.crypto_sign_detached(o,t,r),o},o.verify=function(t,r,o){t=n.from(t);try{return e.crypto_sign_verify_detached(r,t,o)}catch(e){return!1}},!0):i()}():i();function i(){var e=r(4940);return o.generate=function(t){var r=new Uint8Array(t),o=e.sign.keyPair.fromSeed(r);return n.from(o.publicKey)},o.sign=function(t,r){t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data);var o=e.sign.detached(t,r);return n.from(o)},o.verify=function(t,r,o){return t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data),o=new Uint8Array(o.toJSON().data),e.sign.detached.verify(t,r,o)},!1}},149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new o.default.RestoreFootprintOp({ext:new o.default.ExtensionPoint(0)}),r={body:o.default.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!=e?e:{}),new o.default.Operation(r)};var n,o=(n=r(1918))&&n.__esModule?n:{default:n}},225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignerKey=void 0;var n,o=(n=r(1918))&&n.__esModule?n:{default:n},i=r(7120);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}t.SignerKey=function(){return function(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}),null,[{key:"decodeAddress",value:function(e){var t={ed25519PublicKey:o.default.SignerKey.signerKeyTypeEd25519,preAuthTx:o.default.SignerKey.signerKeyTypePreAuthTx,sha256Hash:o.default.SignerKey.signerKeyTypeHashX,signedPayload:o.default.SignerKey.signerKeyTypeEd25519SignedPayload},r=i.StrKey.getVersionByteForPrefix(e),n=t[r];if(!n)throw new Error("invalid signer key type (".concat(r,")"));var a=(0,i.decodeCheck)(r,e);return n("signedPayload"===r?new o.default.SignerKeyEd25519SignedPayload({ed25519:a.slice(0,32),payload:a.slice(36)}):a)}},{key:"encodeSignerKey",value:function(e){var t,r;switch(e.switch()){case o.default.SignerKeyType.signerKeyTypeEd25519():t="ed25519PublicKey",r=e.value();break;case o.default.SignerKeyType.signerKeyTypePreAuthTx():t="preAuthTx",r=e.value();break;case o.default.SignerKeyType.signerKeyTypeHashX():t="sha256Hash",r=e.value();break;case o.default.SignerKeyType.signerKeyTypeEd25519SignedPayload():t="signedPayload",r=e.ed25519SignedPayload().toXDR("raw");break;default:throw new Error("invalid SignerKey (type: ".concat(e.switch(),")"))}return(0,i.encodeCheck)(t,r)}}])}()},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=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+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}},356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={xdr:!0,cereal:!0,hash:!0,sign:!0,verify:!0,FastSigning:!0,getLiquidityPoolId:!0,LiquidityPoolFeeV18:!0,Keypair:!0,UnsignedHyper:!0,Hyper:!0,TransactionBase:!0,Transaction:!0,FeeBumpTransaction:!0,TransactionBuilder:!0,TimeoutInfinite:!0,BASE_FEE:!0,Asset:!0,LiquidityPoolAsset:!0,LiquidityPoolId:!0,Operation:!0,AuthRequiredFlag:!0,AuthRevocableFlag:!0,AuthImmutableFlag:!0,AuthClawbackEnabledFlag:!0,Account:!0,MuxedAccount:!0,Claimant:!0,Networks:!0,StrKey:!0,SignerKey:!0,Soroban:!0,decodeAddressToMuxedAccount:!0,encodeMuxedAccountToAddress:!0,extractBaseAddress:!0,encodeMuxedAccount:!0,Contract:!0,Address:!0};Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return w.Account}}),Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return P.Address}}),Object.defineProperty(t,"Asset",{enumerable:!0,get:function(){return y.Asset}}),Object.defineProperty(t,"AuthClawbackEnabledFlag",{enumerable:!0,get:function(){return g.AuthClawbackEnabledFlag}}),Object.defineProperty(t,"AuthImmutableFlag",{enumerable:!0,get:function(){return g.AuthImmutableFlag}}),Object.defineProperty(t,"AuthRequiredFlag",{enumerable:!0,get:function(){return g.AuthRequiredFlag}}),Object.defineProperty(t,"AuthRevocableFlag",{enumerable:!0,get:function(){return g.AuthRevocableFlag}}),Object.defineProperty(t,"BASE_FEE",{enumerable:!0,get:function(){return h.BASE_FEE}}),Object.defineProperty(t,"Claimant",{enumerable:!0,get:function(){return k.Claimant}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return A.Contract}}),Object.defineProperty(t,"FastSigning",{enumerable:!0,get:function(){return s.FastSigning}}),Object.defineProperty(t,"FeeBumpTransaction",{enumerable:!0,get:function(){return d.FeeBumpTransaction}}),Object.defineProperty(t,"Hyper",{enumerable:!0,get:function(){return l.Hyper}}),Object.defineProperty(t,"Keypair",{enumerable:!0,get:function(){return c.Keypair}}),Object.defineProperty(t,"LiquidityPoolAsset",{enumerable:!0,get:function(){return m.LiquidityPoolAsset}}),Object.defineProperty(t,"LiquidityPoolFeeV18",{enumerable:!0,get:function(){return u.LiquidityPoolFeeV18}}),Object.defineProperty(t,"LiquidityPoolId",{enumerable:!0,get:function(){return v.LiquidityPoolId}}),Object.defineProperty(t,"MuxedAccount",{enumerable:!0,get:function(){return S.MuxedAccount}}),Object.defineProperty(t,"Networks",{enumerable:!0,get:function(){return E.Networks}}),Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return g.Operation}}),Object.defineProperty(t,"SignerKey",{enumerable:!0,get:function(){return _.SignerKey}}),Object.defineProperty(t,"Soroban",{enumerable:!0,get:function(){return O.Soroban}}),Object.defineProperty(t,"StrKey",{enumerable:!0,get:function(){return T.StrKey}}),Object.defineProperty(t,"TimeoutInfinite",{enumerable:!0,get:function(){return h.TimeoutInfinite}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return p.Transaction}}),Object.defineProperty(t,"TransactionBase",{enumerable:!0,get:function(){return f.TransactionBase}}),Object.defineProperty(t,"TransactionBuilder",{enumerable:!0,get:function(){return h.TransactionBuilder}}),Object.defineProperty(t,"UnsignedHyper",{enumerable:!0,get:function(){return l.UnsignedHyper}}),Object.defineProperty(t,"cereal",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decodeAddressToMuxedAccount",{enumerable:!0,get:function(){return x.decodeAddressToMuxedAccount}}),t.default=void 0,Object.defineProperty(t,"encodeMuxedAccount",{enumerable:!0,get:function(){return x.encodeMuxedAccount}}),Object.defineProperty(t,"encodeMuxedAccountToAddress",{enumerable:!0,get:function(){return x.encodeMuxedAccountToAddress}}),Object.defineProperty(t,"extractBaseAddress",{enumerable:!0,get:function(){return x.extractBaseAddress}}),Object.defineProperty(t,"getLiquidityPoolId",{enumerable:!0,get:function(){return u.getLiquidityPoolId}}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return a.hash}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return s.sign}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return s.verify}}),Object.defineProperty(t,"xdr",{enumerable:!0,get:function(){return o.default}});var o=N(r(1918)),i=N(r(3335)),a=r(9152),s=r(15),u=r(5578),c=r(6691),l=r(3740),f=r(3758),p=r(380),d=r(9260),h=r(6396),y=r(1764),m=r(2262),v=r(9353),g=r(7237),b=r(4172);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var w=r(2135),S=r(2243),k=r(1387),E=r(6202),T=r(7120),_=r(225),O=r(4062),x=r(6160),A=r(7452),P=r(1180),R=r(8549);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var I=r(7177);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var C=r(3919);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var j=r(4842);Object.keys(j).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===j[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return j[e]}}))}));var B=r(5328);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var L=r(3564);function N(e){return e&&e.__esModule?e:{default:e}}Object.keys(L).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===L[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return L[e]}}))}));t.default=e.exports},380:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i,a=(i=r(1918))&&i.__esModule?i:{default:i},s=r(9152),u=r(7120),c=r(7237),l=r(4172),f=r(3758),p=r(6160);function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function y(e,t,r){return t=v(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,m()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}t.Transaction=function(e){function t(e,r){var o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e){var i=n.from(e,"base64");e=a.default.TransactionEnvelope.fromXDR(i)}var s=e.switch();if(s!==a.default.EnvelopeType.envelopeTypeTxV0()&&s!==a.default.EnvelopeType.envelopeTypeTx())throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(s.name,"."));var l=e.value(),f=l.tx(),d=f.fee().toString();if((o=y(this,t,[f,(l.signatures()||[]).slice(),d,r]))._envelopeType=s,o._memo=f.memo(),o._sequence=f.seqNum().toString(),o._envelopeType===a.default.EnvelopeType.envelopeTypeTxV0())o._source=u.StrKey.encodeEd25519PublicKey(o.tx.sourceAccountEd25519());else o._source=(0,p.encodeMuxedAccountToAddress)(o.tx.sourceAccount());var h=null,m=null;switch(o._envelopeType){case a.default.EnvelopeType.envelopeTypeTxV0():m=f.timeBounds();break;case a.default.EnvelopeType.envelopeTypeTx():switch(f.cond().switch()){case a.default.PreconditionType.precondTime():m=f.cond().timeBounds();break;case a.default.PreconditionType.precondV2():m=(h=f.cond().v2()).timeBounds()}}if(m&&(o._timeBounds={minTime:m.minTime().toString(),maxTime:m.maxTime().toString()}),h){var v=h.ledgerBounds();v&&(o._ledgerBounds={minLedger:v.minLedger(),maxLedger:v.maxLedger()});var g=h.minSeqNum();g&&(o._minAccountSequence=g.toString()),o._minAccountSequenceAge=h.minSeqAge(),o._minAccountSequenceLedgerGap=h.minSeqLedgerGap(),o._extraSigners=h.extraSigners()}var b=f.operations()||[];return o._operations=b.map((function(e){return c.Operation.fromXDRObject(e)})),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(t,e),function(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"timeBounds",get:function(){return this._timeBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"ledgerBounds",get:function(){return this._ledgerBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequence",get:function(){return this._minAccountSequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceAge",get:function(){return this._minAccountSequenceAge},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceLedgerGap",get:function(){return this._minAccountSequenceLedgerGap},set:function(e){throw new Error("Transaction is immutable")}},{key:"extraSigners",get:function(){return this._extraSigners},set:function(e){throw new Error("Transaction is immutable")}},{key:"sequence",get:function(){return this._sequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"source",get:function(){return this._source},set:function(e){throw new Error("Transaction is immutable")}},{key:"operations",get:function(){return this._operations},set:function(e){throw new Error("Transaction is immutable")}},{key:"memo",get:function(){return l.Memo.fromXDRObject(this._memo)},set:function(e){throw new Error("Transaction is immutable")}},{key:"signatureBase",value:function(){var e=this.tx;this._envelopeType===a.default.EnvelopeType.envelopeTypeTxV0()&&(e=a.default.Transaction.fromXDR(n.concat([a.default.PublicKeyType.publicKeyTypeEd25519().toXDR(),e.toXDR()])));var t=new a.default.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(e);return new a.default.TransactionSignaturePayload({networkId:a.default.Hash.fromXDR((0,s.hash)(this.networkPassphrase)),taggedTransaction:t}).toXDR()}},{key:"toEnvelope",value:function(){var e,t=this.tx.toXDR(),r=this.signatures.slice();switch(this._envelopeType){case a.default.EnvelopeType.envelopeTypeTxV0():e=new a.default.TransactionEnvelope.envelopeTypeTxV0(new a.default.TransactionV0Envelope({tx:a.default.TransactionV0.fromXDR(t),signatures:r}));break;case a.default.EnvelopeType.envelopeTypeTx():e=new a.default.TransactionEnvelope.envelopeTypeTx(new a.default.TransactionV1Envelope({tx:a.default.Transaction.fromXDR(t),signatures:r}));break;default:throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(this._envelopeType.name,"."))}return e}},{key:"getClaimableBalanceId",value:function(e){if(!Number.isInteger(e)||e<0||e>=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=c.Operation.createClaimableBalance(t)}catch(e){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(e))}var r=u.StrKey.decodeEd25519PublicKey((0,p.extractBaseAddress)(this.source)),n=a.default.HashIdPreimage.envelopeTypeOpId(new a.default.HashIdPreimageOperationId({sourceAccount:a.default.AccountId.publicKeyTypeEd25519(r),seqNum:a.default.SequenceNumber.fromString(this.sequence),opNum:e})),o=(0,s.hash)(n.toXDR("raw"));return a.default.ClaimableBalanceId.claimableBalanceIdTypeV0(o).toXDR("hex")}}])}(f.TransactionBase)},392:(e,t,r)=>{var n=r(2861).Buffer;function o(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,o=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var u=a%o,c=Math.min(i-s,o-u),l=0;l<c;l++)r[u+l]=e[s+l];s+=c,(a+=c)%o==0&&this._update(r)}return this._len+=i,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},645:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimEnd=void 0;t.trimEnd=function(e,t){for(var r="number"==typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n}},721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(1918))&&n.__esModule?n:{default:n}},784:(e,t,r)=>{"use strict";r.d(t,{$D:()=>d,Af:()=>c,WC:()=>l,fG:()=>p,jr:()=>h,tR:()=>f});var n=r(356),o=r(4076);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=e.errorResultXdr,r=e.diagnosticEventsXdr;return delete e.errorResultXdr,delete e.diagnosticEventsXdr,t?s(s(s({},e),void 0!==r&&r.length>0&&{diagnosticEvents:r.map((function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")}))}),{},{errorResult:n.xdr.TransactionResult.fromXDR(t,"base64")}):s({},e)}function l(e){var t,r=n.xdr.TransactionMeta.fromXDR(e.resultMetaXdr,"base64"),o={ledger:e.ledger,createdAt:e.createdAt,applicationOrder:e.applicationOrder,feeBump:e.feeBump,envelopeXdr:n.xdr.TransactionEnvelope.fromXDR(e.envelopeXdr,"base64"),resultXdr:n.xdr.TransactionResult.fromXDR(e.resultXdr,"base64"),resultMetaXdr:r};3===r.switch()&&null!==r.v3().sorobanMeta()&&(o.returnValue=null===(t=r.v3().sorobanMeta())||void 0===t?void 0:t.returnValue());return"diagnosticEventsXdr"in e&&e.diagnosticEventsXdr&&(o.diagnosticEventsXdr=e.diagnosticEventsXdr.map((function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")}))),o}function f(e){return s({status:e.status,txHash:e.txHash},l(e))}function p(e){var t;return{latestLedger:e.latestLedger,cursor:e.cursor,events:(null!==(t=e.events)&&void 0!==t?t:[]).map((function(e){var t=s({},e);return delete t.contractId,s(s(s({},t),""!==e.contractId&&{contractId:new n.Contract(e.contractId)}),{},{topic:e.topic.map((function(e){return n.xdr.ScVal.fromXDR(e,"base64")})),value:n.xdr.ScVal.fromXDR(e.value,"base64")})}))}}function d(e){var t;return{latestLedger:e.latestLedger,entries:(null!==(t=e.entries)&&void 0!==t?t:[]).map((function(e){if(!e.key||!e.xdr)throw new TypeError("invalid ledger entry: ".concat(JSON.stringify(e)));return s({lastModifiedLedgerSeq:e.lastModifiedLedgerSeq,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),val:n.xdr.LedgerEntryData.fromXDR(e.xdr,"base64")},void 0!==e.liveUntilLedgerSeq&&{liveUntilLedgerSeq:e.liveUntilLedgerSeq})}))}}function h(e){var t,r;if(!o.j.isSimulationRaw(e))return e;var i={_parsed:!0,id:e.id,latestLedger:e.latestLedger,events:null!==(t=null===(r=e.events)||void 0===r?void 0:r.map((function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")})))&&void 0!==t?t:[]};return"string"==typeof e.error?s(s({},i),{},{error:e.error}):function(e,t){var r,o,i,a,u,c=s(s(s({},t),{},{transactionData:new n.SorobanDataBuilder(e.transactionData),minResourceFee:e.minResourceFee},null!==(r=null===(o=e.results)||void 0===o?void 0:o.length)&&void 0!==r&&r&&{result:e.results.map((function(e){var t;return{auth:(null!==(t=e.auth)&&void 0!==t?t:[]).map((function(e){return n.xdr.SorobanAuthorizationEntry.fromXDR(e,"base64")})),retval:e.xdr?n.xdr.ScVal.fromXDR(e.xdr,"base64"):n.xdr.ScVal.scvVoid()}}))[0]}),null!==(i=null===(a=e.stateChanges)||void 0===a?void 0:a.length)&&void 0!==i&&i&&{stateChanges:null===(u=e.stateChanges)||void 0===u?void 0:u.map((function(e){return{type:e.type,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),before:e.before?n.xdr.LedgerEntry.fromXDR(e.before,"base64"):null,after:e.after?n.xdr.LedgerEntry.fromXDR(e.after,"base64"):null}}))});return e.restorePreamble&&""!==e.restorePreamble.transactionData?s(s({},c),{},{restorePreamble:{minResourceFee:e.restorePreamble.minResourceFee,transactionData:new n.SorobanDataBuilder(e.restorePreamble.transactionData)}}):c}(e,i)}},862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0";t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageSellOfferOp(t),n={};return n.body=i.default.OperationBody.manageSellOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(3740),i=(n=r(1918))&&n.__esModule?n:{default:n}},1180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r(7120),i=(n=r(1918))&&n.__esModule?n:{default:n};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}t.Address=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o.StrKey.isValidEd25519PublicKey(t))this._type="account",this._key=o.StrKey.decodeEd25519PublicKey(t);else{if(!o.StrKey.isValidContract(t))throw new Error("Unsupported address type: ".concat(t));this._type="contract",this._key=o.StrKey.decodeContract(t)}}return function(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"toString",value:function(){switch(this._type){case"account":return o.StrKey.encodeEd25519PublicKey(this._key);case"contract":return o.StrKey.encodeContract(this._key);default:throw new Error("Unsupported address type")}}},{key:"toScVal",value:function(){return i.default.ScVal.scvAddress(this.toScAddress())}},{key:"toScAddress",value:function(){switch(this._type){case"account":return i.default.ScAddress.scAddressTypeAccount(i.default.PublicKey.publicKeyTypeEd25519(this._key));case"contract":return i.default.ScAddress.scAddressTypeContract(this._key);default:throw new Error("Unsupported address type")}}},{key:"toBuffer",value:function(){return this._key}}],[{key:"fromString",value:function(t){return new e(t)}},{key:"account",value:function(t){return new e(o.StrKey.encodeEd25519PublicKey(t))}},{key:"contract",value:function(t){return new e(o.StrKey.encodeContract(t))}},{key:"fromScVal",value:function(t){return e.fromScAddress(t.address())}},{key:"fromScAddress",value:function(t){switch(t.switch().value){case i.default.ScAddressType.scAddressTypeAccount().value:return e.account(t.accountId().ed25519());case i.default.ScAddressType.scAddressTypeContract().value:return e.contract(t.contractId());default:throw new Error("Unsupported address type")}}}])}()},1242:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((n=r(1594))&&n.__esModule?n:{default:n}).default.clone();o.DEBUG=!0;t.default=o},1293:(e,t,r)=>{var n=r(5546),o=r(2708);e.exports={parse:function(e){var t=n.parse(e.toString());return o.compile(t)}}},1346:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyChecksum=function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}},1387:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Claimant=void 0;var n,o=(n=r(1918))&&n.__esModule?n:{default:n},i=r(6691),a=r(7120);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}t.Claimant=function(){return function(e,t,r){return t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&!a.StrKey.isValidEd25519PublicKey(t))throw new Error("Destination is invalid");if(this._destination=t,r){if(!(r instanceof o.default.ClaimPredicate))throw new Error("Predicate should be an xdr.ClaimPredicate");this._predicate=r}else this._predicate=o.default.ClaimPredicate.claimPredicateUnconditional()}),[{key:"toXDRObject",value:function(){var e=new o.default.ClaimantV0({destination:i.Keypair.fromPublicKey(this._destination).xdrAccountId(),predicate:this._predicate});return o.default.Claimant.claimantTypeV0(e)}},{key:"destination",get:function(){return this._destination},set:function(e){throw new Error("Claimant is immutable")}},{key:"predicate",get:function(){return this._predicate},set:function(e){throw new Error("Claimant is immutable")}}],[{key:"predicateUnconditional",value:function(){return o.default.ClaimPredicate.claimPredicateUnconditional()}},{key:"predicateAnd",value:function(e,t){if(!(e instanceof o.default.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof o.default.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return o.default.ClaimPredicate.claimPredicateAnd([e,t])}},{key:"predicateOr",value:function(e,t){if(!(e instanceof o.default.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof o.default.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return o.default.ClaimPredicate.claimPredicateOr([e,t])}},{key:"predicateNot",value:function(e){if(!(e instanceof o.default.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return o.default.ClaimPredicate.claimPredicateNot(e)}},{key:"predicateBeforeAbsoluteTime",value:function(e){return o.default.ClaimPredicate.claimPredicateBeforeAbsoluteTime(o.default.Int64.fromString(e))}},{key:"predicateBeforeRelativeTime",value:function(e){return o.default.ClaimPredicate.claimPredicateBeforeRelativeTime(o.default.Int64.fromString(e))}},{key:"fromXDR",value:function(e){var t;if(e.switch()===o.default.ClaimantType.claimantTypeV0())return t=e.v0(),new this(a.StrKey.encodeEd25519PublicKey(t.destination().ed25519()),t.predicate());throw new Error("Invalid claimant type: ".concat(e.switch().name))}}])}()},1411:(e,t,r)=>{"use strict";var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.manageData=function(e){var t={};if(!("string"==typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!=typeof e.value&&!n.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");"string"==typeof e.value?t.dataValue=n.from(e.value):t.dataValue=e.value;if(null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new i.default.ManageDataOp(t),o={};return o.body=i.default.OperationBody.manageData(r),this.setSourceAccount(o,e),new i.default.Operation(o)};var o,i=(o=r(1918))&&o.__esModule?o:{default:o}},1430:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==n[t];t++);if(t<i)for(n.splice(t,1,"0000");n.length<i;)n.splice(t,0,"0000");for(var a=0;a<i;a++){r=n[a].split("");for(var s=0;s<3&&("0"===r[0]&&r.length>1);s++)r.splice(0,1);n[a]=r.join("")}var u=-1,c=0,l=0,f=-1,p=!1;for(a=0;a<i;a++)p?"0"===n[a]?l+=1:(p=!1,l>c&&(u=f,c=l)):"0"===n[a]&&(p=!0,f=a,l=1);l>c&&(u=f,c=l),c>1&&n.splice(u,c,""),o=n.length;var d="";for(""===n[0]&&(d=":"),a=0;a<o&&(d+=n[a],a!==o-1);a++)d+=":";return""===n[o-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},1594:function(e,t,r){var n;!function(){"use strict";var o,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,u="[BigNumber Error] ",c=u+"Number primitive has more than 15 significant digits: ",l=1e14,f=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,y=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=f-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function g(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==s(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return m(e.e/f)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,o,E,T,_,O,x,A,P,R=H.prototype={constructor:H,toString:null,valueOf:null},I=new H(1),C=20,j=4,B=-7,L=21,N=-1e7,U=1e7,M=!1,F=1,D=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",K=!0;function H(e,t){var r,a,u,l,d,h,y,m,v=this;if(!(v instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return v.s=e.s,void(!e.c||e.e>U?v.c=v.e=null:e.e<N?v.c=[v.e=0]:(v.e=e.e,v.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(v.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;d>=10;d/=10,l++);return void(l>U?v.c=v.e=null:(v.e=l,v.c=[e]))}m=String(e)}else{if(!i.test(m=String(e)))return o(v,m,h);v.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(l=m.indexOf("."))>-1&&(m=m.replace(".","")),(d=m.search(/e/i))>0?(l<0&&(l=d),l+=+m.slice(d+1),m=m.substring(0,d)):l<0&&(l=m.length)}else{if(b(t,2,q.length,"Base"),10==t&&K)return $(v=new H(e),C+v.e+1,j);if(m=String(e),h="number"==typeof e){if(0*e!=0)return o(v,m,h,t);if(v.s=1/e<0?(m=m.slice(1),-1):1,H.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else v.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=q.slice(0,t),l=d=0,y=m.length;d<y;d++)if(r.indexOf(a=m.charAt(d))<0){if("."==a){if(d>l){l=y;continue}}else if(!u&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){u=!0,d=-1,l=0;continue}return o(v,String(e),h,t)}h=!1,(l=(m=n(m,t,10,v.s)).indexOf("."))>-1?m=m.replace(".",""):l=m.length}for(d=0;48===m.charCodeAt(d);d++);for(y=m.length;48===m.charCodeAt(--y););if(m=m.slice(d,++y)){if(y-=d,h&&H.DEBUG&&y>15&&(e>p||e!==s(e)))throw Error(c+v.s*e);if((l=l-d-1)>U)v.c=v.e=null;else if(l<N)v.c=[v.e=0];else{if(v.e=l,v.c=[],d=(l+1)%f,l<0&&(d+=f),d<y){for(d&&v.c.push(+m.slice(0,d)),y-=f;d<y;)v.c.push(+m.slice(d,d+=f));d=f-(m=m.slice(d)).length}else d-=y;for(;d--;m+="0");v.c.push(+m)}}else v.c=[v.e=0]}function z(e,t,r,n){var o,i,a,s,u;if(null==r?r=j:b(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=v(e.c),u=1==n||2==n&&(a<=B||a>=L)?S(u,a):k(u,a,"0");else if(i=(e=$(new H(e),t,r)).e,s=(u=v(e.c)).length,1==n||2==n&&(t<=i||i<=B)){for(;s<t;u+="0",s++);u=S(u,i)}else if(t-=a,u=k(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function X(e,t){for(var r,n,o=1,i=new H(e[0]);o<e.length;o++)(!(n=new H(e[o])).s||(r=g(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function G(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*f-1)>U?e.c=e.e=null:r<N?e.c=[e.e=0]:(e.e=r,e.c=t),e}function $(e,t,r,n){var o,i,u,c,p,h,y,m=e.c,v=d;if(m){e:{for(o=1,c=m[0];c>=10;c/=10,o++);if((i=t-o)<0)i+=f,u=t,p=m[h=0],y=s(p/v[o-u-1]%10);else if((h=a((i+1)/f))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));p=y=0,o=1,u=(i%=f)-f+1}else{for(p=c=m[h],o=1;c>=10;c/=10,o++);y=(u=(i%=f)-f+o)<0?0:s(p/v[o-u-1]%10)}if(n=n||t<0||null!=m[h+1]||(u<0?p:p%v[o-u-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(i>0?u>0?p/v[o-u]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=v[(f-t%f)%f],e.e=-t||0):m[0]=e.e=0,e;if(0==i?(m.length=h,c=1,h--):(m.length=h+1,c=v[f-i],m[h]=u>0?s(p/v[o-u]%v[u])*c:0),n)for(;;){if(0==h){for(i=1,u=m[0];u>=10;u/=10,i++);for(u=m[0]+=c,c=1;u>=10;u/=10,c++);i!=c&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[h]+=c,m[h]!=l)break;m[h--]=0,c=1}for(i=m.length;0===m[--i];m.pop());}e.e>U?e.c=e.e=null:e.e<N&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=B||r>=L?S(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,y,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),j=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-y,0,t),b(r[1],0,y,t),B=r[0],L=r[1]):(b(r,-y,y,t),B=-(L=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-y,-1,t),b(r[1],1,y,t),N=r[0],U=r[1];else{if(b(r,-y,y,t),!r)throw Error(u+t+" cannot be zero: "+r);N=-(U=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!r,Error(u+"crypto unavailable");M=r}else M=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,y,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);V=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);K="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:j,EXPONENTIAL_AT:[B,L],RANGE:[N,U],CRYPTO:M,MODULO_MODE:F,POW_PRECISION:D,FORMAT:V,ALPHABET:q}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-y&&o<=y&&o===s(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%f)<1&&(t+=f),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==s(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(u+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return X(arguments,-1)},H.minimum=H.min=function(){return X(arguments,1)},H.random=(E=9007199254740992,T=Math.random()*E&2097151?function(){return s(Math.random()*E)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,c=0,l=[],p=new H(I);if(null==e?e=C:b(e,0,y),o=a(e/f),M)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));c<o;)(i=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(l.push(i%1e14),c+=2);c=o/2}else{if(!crypto.randomBytes)throw M=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(o*=7);c<o;)(i=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(i%1e14),c+=7);c=o/7}if(!M)for(;c<o;)(i=T())<9e15&&(l[c++]=i%1e14);for(o=l[--c],e%=f,o&&e&&(i=d[f-e],l[c]=s(o/i)*i);0===l[c];l.pop(),c--);if(c<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=f);for(c=1,i=l[0];i>=10;i/=10,c++);c<f&&(n-=f-c)}return p.e=n,p.c=l,p}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,p,d,h,y,m=n.indexOf("."),g=C,b=j;for(m>=0&&(f=D,D=0,n=n.replace(".",""),d=(y=new H(o)).pow(n.length-m),D=f,y.c=t(k(v(d.c),d.e,"0"),10,i,e),y.e=y.c.length),l=f=(h=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==h[--f];h.pop());if(!h[0])return u.charAt(0);if(m<0?--l:(d.c=h,d.e=l,d.s=a,h=(d=r(d,y,g,b,i)).c,p=d.r,l=d.e),m=h[c=l+g+1],f=i/2,p=p||c<0||null!=h[c+1],p=b<4?(null!=m||p)&&(0==b||b==(d.s<0?3:2)):m>f||m==f&&(4==b||p||6==b&&1&h[c-1]||b==(d.s<0?8:7)),c<1||!h[0])n=p?k(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(h.length=c,p)for(--i;++h[--c]>i;)h[c]=0,c||(++l,h=[1].concat(h));for(f=h.length;!h[--f];);for(m=0,n="";m<=f;n+=u.charAt(h[m++]));n=k(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%h,l=t/h|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%h)+(n=l*i+(a=e[u]/h|0)*c)%h*h+s)/r|0)+(n/h|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,u){var c,p,d,h,y,v,g,b,w,S,k,E,T,_,O,x,A,P=n.s==o.s?1:-1,R=n.c,I=o.c;if(!(R&&R[0]&&I&&I[0]))return new H(n.s&&o.s&&(R?!I||R[0]!=I[0]:I)?R&&0==R[0]||!I?0*P:P/0:NaN);for(w=(b=new H(P)).c=[],P=i+(p=n.e-o.e)+1,u||(u=l,p=m(n.e/f)-m(o.e/f),P=P/f|0),d=0;I[d]==(R[d]||0);d++);if(I[d]>(R[d]||0)&&p--,P<0)w.push(1),h=!0;else{for(_=R.length,x=I.length,d=0,P+=2,(y=s(u/(I[0]+1)))>1&&(I=e(I,y,u),R=e(R,y,u),x=I.length,_=R.length),T=x,k=(S=R.slice(0,x)).length;k<x;S[k++]=0);A=I.slice(),A=[0].concat(A),O=I[0],I[1]>=u/2&&O++;do{if(y=0,(c=t(I,S,x,k))<0){if(E=S[0],x!=k&&(E=E*u+(S[1]||0)),(y=s(E/O))>1)for(y>=u&&(y=u-1),g=(v=e(I,y,u)).length,k=S.length;1==t(v,S,g,k);)y--,r(v,x<g?A:I,g,u),g=v.length,c=1;else 0==y&&(c=y=1),g=(v=I.slice()).length;if(g<k&&(v=[0].concat(v)),r(S,v,k,u),k=S.length,-1==c)for(;t(I,S,x,k)<1;)y++,r(S,x<k?A:I,k,u),k=S.length}else 0===c&&(y++,S=[0]);w[d++]=y,S[0]?S[k++]=R[T]||0:(S=[R[T]],k=1)}while((T++<_||null!=S[0])&&P--);h=null!=S[0],w[0]||w.splice(0,1)}if(u==l){for(d=1,P=w[0];P>=10;P/=10,d++);$(b,i+(b.e=d+p*f-1)+1,a,h)}else b.e=p,b.r=+h;return b}}(),_=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,x=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(P,"");if(A.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(_,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(O,"$1").replace(x,"0.$1")),t!=i))return new H(i,o);if(H.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,t){return g(this,new H(e,t))},R.decimalPlaces=R.dp=function(e,t){var r,n,o,i=this;if(null!=e)return b(e,0,y),null==t?t=j:b(t,0,8),$(new H(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-m(this.e/f))*f,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},R.dividedBy=R.div=function(e,t){return r(this,new H(e,t),C,j)},R.dividedToIntegerBy=R.idiv=function(e,t){return r(this,new H(e,t),0,1)},R.exponentiatedBy=R.pow=function(e,t){var r,n,o,i,c,l,p,d,h=this;if((e=new H(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+W(e));if(null!=t&&(t=new H(t)),c=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return d=new H(Math.pow(+W(h),c?e.s*(2-w(e)):+W(e))),t?d.mod(t):d;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!l&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||c&&h.c[1]>=24e7:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return i=h.s<0&&w(e)?-0:0,h.e>-1&&(i=1/i),new H(l?1/i:i);D&&(i=a(D/f+2))}for(c?(r=new H(.5),l&&(e.s=1),p=w(e)):p=(o=Math.abs(+W(e)))%2,d=new H(I);;){if(p){if(!(d=d.times(h)).c)break;i?d.c.length>i&&(d.c.length=i):n&&(d=d.mod(t))}if(o){if(0===(o=s(o/2)))break;p=o%2}else if($(e=e.times(r),e.e+1,1),e.e>14)p=w(e);else{if(0===(o=+W(e)))break;p=o%2}h=h.times(h),i?h.c&&h.c.length>i&&(h.c.length=i):n&&(h=h.mod(t))}return n?d:(l&&(d=I.div(d)),t?d.mod(t):i?$(d,D,j,undefined):d)},R.integerValue=function(e){var t=new H(this);return null==e?e=j:b(e,0,8),$(t,t.e+1,e)},R.isEqualTo=R.eq=function(e,t){return 0===g(this,new H(e,t))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,t){return g(this,new H(e,t))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,t){return 1===(t=g(this,new H(e,t)))||0===t},R.isInteger=function(){return!!this.c&&m(this.e/f)>this.c.length-2},R.isLessThan=R.lt=function(e,t){return g(this,new H(e,t))<0},R.isLessThanOrEqualTo=R.lte=function(e,t){return-1===(t=g(this,new H(e,t)))||0===t},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/f,c=e.e/f,p=a.c,d=e.c;if(!u||!c){if(!p||!d)return p?(e.s=-t,e):new H(d?a:NaN);if(!p[0]||!d[0])return d[0]?(e.s=-t,e):new H(p[0]?a:3==j?-0:0)}if(u=m(u),c=m(c),p=p.slice(),s=u-c){for((i=s<0)?(s=-s,o=p):(c=u,o=d),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=p.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(p[t]!=d[t]){i=p[t]<d[t];break}if(i&&(o=p,p=d,d=o,e.s=-e.s),(t=(n=d.length)-(r=p.length))>0)for(;t--;p[r++]=0);for(t=l-1;n>s;){if(p[--n]<d[n]){for(r=n;r&&!p[--r];p[r]=t);--p[r],p[n]+=l}p[n]-=d[n]}for(;0==p[0];p.splice(0,1),--c);return p[0]?G(e,p,c):(e.s=3==j?-1:1,e.c=[e.e=0],e)},R.modulo=R.mod=function(e,t){var n,o,i=this;return e=new H(e,t),!i.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||i.c&&!i.c[0]?new H(i):(9==F?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,F),(e=i.minus(n.times(e))).c[0]||1!=F||(e.s=i.s),e)},R.multipliedBy=R.times=function(e,t){var r,n,o,i,a,s,u,c,p,d,y,v,g,b,w,S=this,k=S.c,E=(e=new H(e,t)).c;if(!(k&&E&&k[0]&&E[0]))return!S.s||!e.s||k&&!k[0]&&!E||E&&!E[0]&&!k?e.c=e.e=e.s=null:(e.s*=S.s,k&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(S.e/f)+m(e.e/f),e.s*=S.s,(u=k.length)<(d=E.length)&&(g=k,k=E,E=g,o=u,u=d,d=o),o=u+d,g=[];o--;g.push(0));for(b=l,w=h,o=d;--o>=0;){for(r=0,y=E[o]%w,v=E[o]/w|0,i=o+(a=u);i>o;)r=((c=y*(c=k[--a]%w)+(s=v*c+(p=k[a]/w|0)*y)%w*w+g[i]+r)/b|0)+(s/w|0)+v*p,g[i--]=c%b;g[i]=r}return r?++n:g.splice(0,1),G(e,g,n)},R.negated=function(){var e=new H(this);return e.s=-e.s||null,e},R.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new H(e,t)).s,!o||!t)return new H(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/f,a=e.e/f,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new H(o/0);if(!s[0]||!u[0])return u[0]?e:new H(s[0]?n:0*o)}if(i=m(i),a=m(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/l|0,s[t]=l===s[t]?0:s[t]%l;return o&&(s=[o].concat(s),++a),G(e,s,a)},R.precision=R.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return b(e,1,y),null==t?t=j:b(t,0,8),$(new H(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*f+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},R.shiftedBy=function(e){return b(e,-9007199254740991,p),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=C+4,f=new H("0.5");if(1!==u||!s||!s[0])return new H(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=v(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=m((c+1)/2)-(c<0||c%2),n=new H(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new H(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),v(i.c).slice(0,u)===(t=v(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(n,n.e+C+2,1),e=!n.times(n).eq(a));break}if(!o&&($(i,i.e+C+2,0),i.times(i).eq(a))){n=i;break}l+=4,u+=4,o=1}return $(n,n.e+C+1,j,e)},R.toExponential=function(e,t){return null!=e&&(b(e,0,y),e++),z(this,e,t,1)},R.toFixed=function(e,t){return