@hashgraphonline/hedera-agent-kit
Version:
Build LLM-powered applications that interact with the Hedera Network. Create conversational agents that can understand user requests in natural language and execute Hedera transactions, or build backend systems that leverage AI for on-chain operations.
20 lines • 3.61 MB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HederaAgentKit={})}(this,(function(exports){"use strict";var __defProp2=Object.defineProperty,__defNormalProp2=(e,t,r)=>t in e?__defProp2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__publicField2=(e,t,r)=>__defNormalProp2(e,"symbol"!=typeof t?t+"":t,r);function _mergeNamespaces(e,t){for(var r=0;r<t.length;r++){const n=t[r];if("string"!=typeof n&&!Array.isArray(n))for(const t in n)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function getDefaultExportFromCjs$3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$g={exports:{}},process$2=browser$g.exports={},cachedSetTimeout$1,cachedClearTimeout$1;function defaultSetTimout$1(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout$1(){throw new Error("clearTimeout has not been defined")}function runTimeout$1(e){if(cachedSetTimeout$1===setTimeout)return setTimeout(e,0);if((cachedSetTimeout$1===defaultSetTimout$1||!cachedSetTimeout$1)&&setTimeout)return cachedSetTimeout$1=setTimeout,setTimeout(e,0);try{return cachedSetTimeout$1(e,0)}catch(t){try{return cachedSetTimeout$1.call(null,e,0)}catch(r){return cachedSetTimeout$1.call(this,e,0)}}}function runClearTimeout$1(e){if(cachedClearTimeout$1===clearTimeout)return clearTimeout(e);if((cachedClearTimeout$1===defaultClearTimeout$1||!cachedClearTimeout$1)&&clearTimeout)return cachedClearTimeout$1=clearTimeout,clearTimeout(e);try{return cachedClearTimeout$1(e)}catch(t){try{return cachedClearTimeout$1.call(null,e)}catch(r){return cachedClearTimeout$1.call(this,e)}}}!function(){try{cachedSetTimeout$1="function"==typeof setTimeout?setTimeout:defaultSetTimout$1}catch(e){cachedSetTimeout$1=defaultSetTimout$1}try{cachedClearTimeout$1="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout$1}catch(e){cachedClearTimeout$1=defaultClearTimeout$1}}();var queue$2=[],draining$1=!1,currentQueue$1,queueIndex$1=-1;function cleanUpNextTick$1(){draining$1&¤tQueue$1&&(draining$1=!1,currentQueue$1.length?queue$2=currentQueue$1.concat(queue$2):queueIndex$1=-1,queue$2.length&&drainQueue$1())}function drainQueue$1(){if(!draining$1){var e=runTimeout$1(cleanUpNextTick$1);draining$1=!0;for(var t=queue$2.length;t;){for(currentQueue$1=queue$2,queue$2=[];++queueIndex$1<t;)currentQueue$1&¤tQueue$1[queueIndex$1].run();queueIndex$1=-1,t=queue$2.length}currentQueue$1=null,draining$1=!1,runClearTimeout$1(e)}}function Item$1(e,t){this.fun=e,this.array=t}function noop$3(){}process$2.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue$2.push(new Item$1(e,t)),1!==queue$2.length||draining$1||runTimeout$1(drainQueue$1)},Item$1.prototype.run=function(){this.fun.apply(null,this.array)},process$2.title="browser",process$2.browser=!0,process$2.env={},process$2.argv=[],process$2.version="",process$2.versions={},process$2.on=noop$3,process$2.addListener=noop$3,process$2.once=noop$3,process$2.off=noop$3,process$2.removeListener=noop$3,process$2.removeAllListeners=noop$3,process$2.emit=noop$3,process$2.prependListener=noop$3,process$2.prependOnceListener=noop$3,process$2.listeners=function(e){return[]},process$2.binding=function(e){throw new Error("process.binding is not supported")},process$2.cwd=function(){return"/"},process$2.chdir=function(e){throw new Error("process.chdir is not supported")},process$2.umask=function(){return 0};var browserExports$2=browser$g.exports;const process$1$1=getDefaultExportFromCjs$3(browserExports$2);
/**
* @license
* Copyright 2009 The Closure Library Authors
* Copyright 2020 Daniel Wirtz / The long.js Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function isLong(e){return!0===(e&&e.__isLong__)}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=UINT_CACHE[e])?n:(r=fromBits(e,0,!0),o&&(UINT_CACHE[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=INT_CACHE[e])?n:(r=fromBits(e,e<0?-1:0,!1),o&&(INT_CACHE[e]=r),r)}function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-0x8000000000000000)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL|0,e/TWO_PWR_32_DBL|0,t)}function fromBits(e,t,r){return new Long(e,t,r)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,r){if(0===e.length)throw Error("empty string");if("number"==typeof t?(r=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?UZERO:ZERO;if((r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return fromString(e.substring(1),t,r).neg();for(var o=fromNumber(pow_dbl(r,8)),i=ZERO,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+s),r);if(s<8){var u=fromNumber(pow_dbl(r,s));i=i.mul(u).add(fromNumber(c))}else i=(i=i.mul(o)).add(fromNumber(c))}return i.unsigned=t,i}function fromValue(e,t){return"number"==typeof e?fromNumber(e,t):"string"==typeof e?fromString(e,t):fromBits(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(MIN_VALUE)){var t=fromNumber(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=fromNumber(pow_dbl(e,6),this.unsigned),i=this,a="";;){var s=i.div(o),c=(i.sub(s.mul(o)).toInt()>>>0).toString(e);if((i=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},LongPrototype.getHighBits=function(){return this.high},LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0},LongPrototype.getLowBits=function(){return this.low},LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0},LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},LongPrototype.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&(-1===e&&!(0===this.low&&-2097152===this.high))},LongPrototype.isZero=function(){return 0===this.high&&0===this.low},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function(){return!(1&~this.low)},LongPrototype.isEven=function(){return!(1&this.low)},LongPrototype.equals=function(e){return isLong(e)||(e=fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function(e){return!this.eq(e)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function(e){return this.comp(e)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function(e){return this.comp(e)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function(e){return this.comp(e)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function(e){if(isLong(e)||(e=fromValue(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function(e){isLong(e)||(e=fromValue(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,u=0,l=0,d=0;return l+=(d+=o+(65535&e.low))>>>16,u+=(l+=n+s)>>>16,c+=(u+=r+a)>>>16,c+=t+i,fromBits((l&=65535)<<16|(d&=65535),(c&=65535)<<16|(u&=65535),this.unsigned)},LongPrototype.subtract=function(e){return isLong(e)||(e=fromValue(e)),this.add(e.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function(e){if(this.isZero())return this;if(isLong(e)||(e=fromValue(e)),wasm)return fromBits(wasm.mul(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned);if(e.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return e.isOdd()?MIN_VALUE:ZERO;if(e.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(TWO_PWR_24)&&e.lt(TWO_PWR_24))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=65535&e.low,u=0,l=0,d=0,h=0;return d+=(h+=o*c)>>>16,l+=(d+=n*c)>>>16,d&=65535,l+=(d+=o*s)>>>16,u+=(l+=r*c)>>>16,l&=65535,u+=(l+=n*s)>>>16,l&=65535,u+=(l+=o*a)>>>16,u+=t*c+r*s+n*a+o*i,fromBits((d&=65535)<<16|(h&=65535),(u&=65535)<<16|(l&=65535),this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function(e){if(isLong(e)||(e=fromValue(e)),e.isZero())throw Error("division by zero");var t,r,n;if(wasm)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?fromBits((this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?UZERO:ZERO;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return UZERO;if(e.gt(this.shru(1)))return UONE;n=UZERO}else{if(this.eq(MIN_VALUE))return e.eq(ONE)||e.eq(NEG_ONE)?MIN_VALUE:e.eq(MIN_VALUE)?ONE:(t=this.shr(1).div(e).shl(1)).eq(ZERO)?e.isNegative()?ONE:NEG_ONE:(r=this.sub(e.mul(t)),n=t.add(r.div(e)));if(e.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=ZERO}for(r=this;r.gte(e);){t=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),i=o<=48?1:pow_dbl(2,o-48),a=fromNumber(t),s=a.mul(e);s.isNegative()||s.gt(r);)s=(a=fromNumber(t-=i,this.unsigned)).mul(e);a.isZero()&&(a=ONE),n=n.add(a),r=r.sub(s)}return n},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function(e){return isLong(e)||(e=fromValue(e)),wasm?fromBits((this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low&e.low,this.high&e.high,this.unsigned)},LongPrototype.or=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low|e.low,this.high|e.high,this.unsigned)},LongPrototype.xor=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low^e.low,this.high^e.high,this.unsigned)},LongPrototype.shiftLeft=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):fromBits(0,this.low<<e-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):fromBits(32===e?this.high:this.high>>>e-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},LongPrototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},Long.fromBytes=function(e,t,r){return r?Long.fromBytesLE(e,t):Long.fromBytesBE(e,t)},Long.fromBytesLE=function(e,t){return new Long(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},Long.fromBytesBE=function(e,t){return new Long(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},"function"==typeof BigInt&&(Long.fromBigInt=function(e,t){return fromBits(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},Long.fromValue=function(e,t){return"bigint"==typeof e?Long.fromBigInt(e,t):fromValue(e,t)},LongPrototype.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,i,a=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),c=20,u=4,l=-7,d=21,h=-1e7,p=1e7,f=!1,m=1,g=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function w(e,t){var o,i,a,s,l,d,f,m,g=this;if(!(g instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>p?g.c=g.e=null:e.e<h?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,l=e;l>=10;l/=10,s++);return void(s>p?g.c=g.e=null:(g.e=s,g.c=[e]))}m=String(e)}else{if(!isNumeric.test(m=String(e)))return n(g,m,d);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(s=m.indexOf("."))>-1&&(m=m.replace(".","")),(l=m.search(/e/i))>0?(s<0&&(s=l),s+=+m.slice(l+1),m=m.substring(0,l)):s<0&&(s=m.length)}else{if(intCheck(t,2,b.length,"Base"),10==t&&v)return k(g=new w(e),c+g.e+1,u);if(m=String(e),d="number"==typeof e){if(0*e!=0)return n(g,m,d,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,w.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(o=b.slice(0,t),s=l=0,f=m.length;l<f;l++)if(o.indexOf(i=m.charAt(l))<0){if("."==i){if(l>s){s=f;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,l=-1,s=0;continue}return n(g,String(e),d,t)}d=!1,(s=(m=r(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):s=m.length}for(l=0;48===m.charCodeAt(l);l++);for(f=m.length;48===m.charCodeAt(--f););if(m=m.slice(l,++f)){if(f-=l,d&&w.DEBUG&&f>15&&(e>MAX_SAFE_INTEGER$1||e!==mathfloor(e)))throw Error(tooManyDigits+g.s*e);if((s=s-l-1)>p)g.c=g.e=null;else if(s<h)g.c=[g.e=0];else{if(g.e=s,g.c=[],l=(s+1)%LOG_BASE,s<0&&(l+=LOG_BASE),l<f){for(l&&g.c.push(+m.slice(0,l)),f-=LOG_BASE;l<f;)g.c.push(+m.slice(l,l+=LOG_BASE));l=LOG_BASE-(m=m.slice(l)).length}else l-=f;for(;l--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function _(e,t,r,n){var o,i,a,s,c;if(null==r?r=u:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(a<=l||a>=d)?toExponential(c,a):toFixedPoint(c,a,"0");else if(i=(e=k(new w(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=i||i<=l)){for(;s<t;c+="0",s++);c=toExponential(c,i)}else if(t-=a,c=toFixedPoint(c,i,"0"),i+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-s)>0)for(i+1==s&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function I(e,t){for(var r,n,o=1,i=new w(e[0]);o<e.length;o++)(!(n=new w(e[o])).s||(r=compare$1(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function T(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*LOG_BASE-1)>p?e.c=e.e=null:r<h?e.c=[e.e=0]:(e.e=r,e.c=t),e}function k(e,t,r,n){var o,i,a,s,c,u,l,d=e.c,f=POWS_TEN;if(d){e:{for(o=1,s=d[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=LOG_BASE,a=t,c=d[u=0],l=mathfloor(c/f[o-a-1]%10);else if((u=mathceil((i+1)/LOG_BASE))>=d.length){if(!n)break e;for(;d.length<=u;d.push(0));c=l=0,o=1,a=(i%=LOG_BASE)-LOG_BASE+1}else{for(c=s=d[u],o=1;s>=10;s/=10,o++);l=(a=(i%=LOG_BASE)-LOG_BASE+o)<0?0:mathfloor(c/f[o-a-1]%10)}if(n=n||t<0||null!=d[u+1]||(a<0?c:c%f[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?c/f[o-a]:0:d[u-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=f[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):d[0]=e.e=0,e;if(0==i?(d.length=u,s=1,u--):(d.length=u+1,s=f[LOG_BASE-i],d[u]=a>0?mathfloor(c/f[o-a]%f[a])*s:0),n)for(;;){if(0==u){for(i=1,a=d[0];a>=10;a/=10,i++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,d[0]==BASE&&(d[0]=1));break}if(d[u]+=s,d[u]!=BASE)break;d[u--]=0,s=1}for(i=d.length;0===d[--i];d.pop());}e.e>p?e.c=e.e=null:e.e<h&&(e.c=[e.e=0])}return e}function A(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=l||r>=d?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),c=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),u=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-1e9,0,t),intCheck(r[1],0,MAX,t),l=r[0],d=r[1]):(intCheck(r,-1e9,MAX,t),l=-(d=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-1e9,-1,t),intCheck(r[1],1,MAX,t),h=r[0],p=r[1];else{if(intCheck(r,-1e9,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);h=-(p=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw f=!r,Error(bignumberError+"crypto unavailable");f=r}else f=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),m=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),g=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);y=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);v="0123456789"==r.slice(0,10),b=r}}return{DECIMAL_PLACES:c,ROUNDING_MODE:u,EXPONENTIAL_AT:[l,d],RANGE:[h,p],CRYPTO:f,MODULO_MODE:m,POW_PRECISION:g,FORMAT:y,ALPHABET:b}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.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>=-1e9&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return I(arguments,-1)},w.minimum=w.min=function(){return I(arguments,1)},w.random=(o=9007199254740992,i=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,a,u=0,l=[],d=new w(s);if(null==e?e=c:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),f)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(a=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(l.push(a%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw f=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);u<o;)(a=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(l.push(a%1e14),u+=7);u=o/7}if(!f)for(;u<o;)(a=i())<9e15&&(l[u++]=a%1e14);for(o=l[--u],e%=LOG_BASE,o&&e&&(a=POWS_TEN[LOG_BASE-e],l[u]=mathfloor(o/a)*a);0===l[u];l.pop(),u--);if(u<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=LOG_BASE);for(u=1,a=l[0];a>=10;a/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return d.e=n,d.c=l,d}),w.sum=function(){for(var e=1,t=arguments,r=new w(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,i,a=[0],s=0,c=e.length;s<c;){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 l,d,h,p,f,m,y,v,_=n.indexOf("."),I=c,T=u;for(_>=0&&(p=g,g=0,n=n.replace(".",""),m=(v=new w(o)).pow(n.length-_),g=p,v.c=r(toFixedPoint(coeffToString(m.c),m.e,"0"),10,i,e),v.e=v.c.length),h=p=(y=r(n,o,i,s?(l=b,e):(l=e,b))).length;0==y[--p];y.pop());if(!y[0])return l.charAt(0);if(_<0?--h:(m.c=y,m.e=h,m.s=a,y=(m=t(m,v,I,T,i)).c,f=m.r,h=m.e),_=y[d=h+I+1],p=i/2,f=f||d<0||null!=y[d+1],f=T<4?(null!=_||f)&&(0==T||T==(m.s<0?3:2)):_>p||_==p&&(4==T||f||6==T&&1&y[d-1]||T==(m.s<0?8:7)),d<1||!y[0])n=f?toFixedPoint(l.charAt(1),-I,l.charAt(0)):l.charAt(0);else{if(y.length=d,f)for(--i;++y[--d]>i;)y[d]=0,d||(++h,y=[1].concat(y));for(p=y.length;!y[--p];);for(_=0,n="";_<=p;n+=l.charAt(y[_++]));n=toFixedPoint(n,h,l.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,i,a,s=0,c=e.length,u=t%SQRT_BASE,l=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((o=u*(i=e[c]%SQRT_BASE)+(n=l*i+(a=e[c]/SQRT_BASE|0)*u)%SQRT_BASE*SQRT_BASE+s)/r|0)+(n/SQRT_BASE|0)+l*a,e[c]=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,s){var c,u,l,d,h,p,f,m,g,y,b,v,_,I,T,A,S,E=n.s==o.s?1:-1,$=n.c,x=o.c;if(!($&&$[0]&&x&&x[0]))return new w(n.s&&o.s&&($?!x||$[0]!=x[0]:x)?$&&0==$[0]||!x?0*E:E/0:NaN);for(g=(m=new w(E)).c=[],E=i+(u=n.e-o.e)+1,s||(s=BASE,u=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),E=E/LOG_BASE|0),l=0;x[l]==($[l]||0);l++);if(x[l]>($[l]||0)&&u--,E<0)g.push(1),d=!0;else{for(I=$.length,A=x.length,l=0,E+=2,(h=mathfloor(s/(x[0]+1)))>1&&(x=e(x,h,s),$=e($,h,s),A=x.length,I=$.length),_=A,b=(y=$.slice(0,A)).length;b<A;y[b++]=0);S=x.slice(),S=[0].concat(S),T=x[0],x[1]>=s/2&&T++;do{if(h=0,(c=t(x,y,A,b))<0){if(v=y[0],A!=b&&(v=v*s+(y[1]||0)),(h=mathfloor(v/T))>1)for(h>=s&&(h=s-1),f=(p=e(x,h,s)).length,b=y.length;1==t(p,y,f,b);)h--,r(p,A<f?S:x,f,s),f=p.length,c=1;else 0==h&&(c=h=1),f=(p=x.slice()).length;if(f<b&&(p=[0].concat(p)),r(y,p,b,s),b=y.length,-1==c)for(;t(x,y,A,b)<1;)h++,r(y,A<b?S:x,b,s),b=y.length}else 0===c&&(h++,y=[0]);g[l++]=h,y[0]?y[b++]=$[_]||0:(y=[$[_]],b=1)}while((_++<I||null!=y[0])&&E--);d=null!=y[0],g[0]||g.splice(0,1)}if(s==BASE){for(l=1,E=g[0];E>=10;E/=10,l++);k(m,i+(m.e=l+u*LOG_BASE-1)+1,a,d)}else m.e=u,m.r=+d;return m}}(),n=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(i,a,s,c){var u,l=s?a:a.replace(o,"");if(n.test(l))i.s=isNaN(l)?null:l<0?-1:1;else{if(!s&&(l=l.replace(e,(function(e,t,r){return u="x"==(r=r.toLowerCase())?16:"b"==r?2:8,c&&c!=u?e:t})),c&&(u=c,l=l.replace(t,"$1").replace(r,"0.$1")),a!=l))return new w(l,u);if(w.DEBUG)throw Error(bignumberError+"Not a"+(c?" base "+c:"")+" number: "+a);i.s=null}i.c=i.e=null}}(),a.absoluteValue=a.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},a.comparedTo=function(e,t){return compare$1(this,new w(e,t))},a.decimalPlaces=a.dp=function(e,t){var r,n,o,i=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=u:intCheck(t,0,8),k(new w(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},a.dividedBy=a.div=function(e,r){return t(this,new w(e,r),c,u)},a.dividedToIntegerBy=a.idiv=function(e,r){return t(this,new w(e,r),0,1)},a.exponentiatedBy=a.pow=function(e,t){var r,n,o,i,a,c,l,d,h=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+A(e));if(null!=t&&(t=new w(t)),a=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 w(Math.pow(+A(h),a?e.s*(2-isOdd(e)):+A(e))),t?d.mod(t):d;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(n=!c&&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||a&&h.c[1]>=24e7:h.c[0]<8e13||a&&h.c[0]<=9999975e7)))return i=h.s<0&&isOdd(e)?-0:0,h.e>-1&&(i=1/i),new w(c?1/i:i);g&&(i=mathceil(g/LOG_BASE+2))}for(a?(r=new w(.5),c&&(e.s=1),l=isOdd(e)):l=(o=Math.abs(+A(e)))%2,d=new w(s);;){if(l){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=mathfloor(o/2)))break;l=o%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)l=isOdd(e);else{if(0===(o=+A(e)))break;l=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:(c&&(d=s.div(d)),t?d.mod(t):i?k(d,g,u,undefined):d)},a.integerValue=function(e){var t=new w(this);return null==e?e=u:intCheck(e,0,8),k(t,t.e+1,e)},a.isEqualTo=a.eq=function(e,t){return 0===compare$1(this,new w(e,t))},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(e,t){return compare$1(this,new w(e,t))>0},a.isGreaterThanOrEqualTo=a.gte=function(e,t){return 1===(t=compare$1(this,new w(e,t)))||0===t},a.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},a.isLessThan=a.lt=function(e,t){return compare$1(this,new w(e,t))<0},a.isLessThanOrEqualTo=a.lte=function(e,t){return-1===(t=compare$1(this,new w(e,t)))||0===t},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&0==this.c[0]},a.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/LOG_BASE,l=e.e/LOG_BASE,d=a.c,h=e.c;if(!c||!l){if(!d||!h)return d?(e.s=-t,e):new w(h?a:NaN);if(!d[0]||!h[0])return h[0]?(e.s=-t,e):new w(d[0]?a:3==u?-0:0)}if(c=bitFloor(c),l=bitFloor(l),d=d.slice(),s=c-l){for((i=s<0)?(s=-s,o=d):(l=c,o=h),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=d.length)<(t=h.length))?s:t,s=t=0;t<n;t++)if(d[t]!=h[t]){i=d[t]<h[t];break}if(i&&(o=d,d=h,h=o,e.s=-e.s),(t=(n=h.length)-(r=d.length))>0)for(;t--;d[r++]=0);for(t=BASE-1;n>s;){if(d[--n]<h[n]){for(r=n;r&&!d[--r];d[r]=t);--d[r],d[n]+=BASE}d[n]-=h[n]}for(;0==d[0];d.splice(0,1),--l);return d[0]?T(e,d,l):(e.s=3==u?-1:1,e.c=[e.e=0],e)},a.modulo=a.mod=function(e,r){var n,o,i=this;return e=new w(e,r),!i.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||i.c&&!i.c[0]?new w(i):(9==m?(o=e.s,e.s=1,n=t(i,e,0,3),e.s=o,n.s*=o):n=t(i,e,0,m),(e=i.minus(n.times(e))).c[0]||1!=m||(e.s=i.s),e)},a.multipliedBy=a.times=function(e,t){var r,n,o,i,a,s,c,u,l,d,h,p,f,m,g,y=this,b=y.c,v=(e=new w(e,t)).c;if(!(b&&v&&b[0]&&v[0]))return!y.s||!e.s||b&&!b[0]&&!v||v&&!v[0]&&!b?e.c=e.e=e.s=null:(e.s*=y.s,b&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(y.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=y.s,(c=b.length)<(d=v.length)&&(f=b,b=v,v=f,o=c,c=d,d=o),o=c+d,f=[];o--;f.push(0));for(m=BASE,g=SQRT_BASE,o=d;--o>=0;){for(r=0,h=v[o]%g,p=v[o]/g|0,i=o+(a=c);i>o;)r=((u=h*(u=b[--a]%g)+(s=p*u+(l=b[a]/g|0)*h)%g*g+f[i]+r)/m|0)+(s/g|0)+p*l,f[i--]=u%m;f[i]=r}return r?++n:f.splice(0,1),T(e,f,n)},a.negated=function(){var e=new w(this);return e.s=-e.s||null,e},a.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new w(e,t)).s,!o||!t)return new w(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/LOG_BASE,a=e.e/LOG_BASE,s=n.c,c=e.c;if(!i||!a){if(!s||!c)return new w(o/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?n:0*o)}if(i=bitFloor(i),a=bitFloor(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=c):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return o&&(s=[o].concat(s),++a),T(e,s,a)},a.precision=a.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=u:intCheck(t,0,8),k(new w(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*LOG_BASE+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},a.shiftedBy=function(e){return intCheck(e,-9007199254740991,MAX_SAFE_INTEGER$1),this.times("1e"+e)},a.squareRoot=a.sqrt=function(){var e,r,n,o,i,a=this,s=a.c,l=a.s,d=a.e,h=c+4,p=new w("0.5");if(1!==l||!s||!s[0])return new w(!l||l<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(l=Math.sqrt(+A(a)))||l==1/0?(((r=coeffToString(s)).length+d)%2==0&&(r+="0"),l=Math.sqrt(+r),d=bitFloor((d+1)/2)-(d<0||d%2),n=new w(r=l==1/0?"5e"+d:(r=l.toExponential()).slice(0,r.indexOf("e")+1)+d)):n=new w(l+""),n.c[0])for((l=(d=n.e)+h)<3&&(l=0);;)if(i=n,n=p.times(i.plus(t(a,i,h,1))),coeffToString(i.c).slice(0,l)===(r=coeffToString(n.c)).slice(0,l)){if(n.e<d&&--l,"9999"!=(r=r.slice(l-3,l+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(k(n,n.e+c+2,1),e=!n.times(n).eq(a));break}if(!o&&(k(i,i.e+c+2,0),i.times(i).eq(a))){n=i;break}h+=4,l+=4,o=1}return k(n,n.e+c+1,u,e)},a.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),_(this,e,t,1)},a.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),_(this,e,t)},a.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=y;else if("object"!=typeof r)throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",l=a[0],d=a[1],h=o.s<0,p=h?l.slice(1):l,f=p.length;if(c&&(i=s,s=c,c=i,f-=i),s>0&&f>0){for(i=f%s||s,l=p.substr(0,i);i<f;i+=s)l+=u+p.substr(i,s);c>0&&(l+=u+p.slice(i)),h&&(l="-"+l)}n=d?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+n+(r.suffix||"")},a.toFraction=function(e){var r,n,o,i,a,c,l,d,h,f,m,g,y=this,b=y.c;if(null!=e&&(!(l=new w(e)).isInteger()&&(l.c||1!==l.s)||l.lt(s)))throw Error(bignumberError+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+A(l));if(!b)return new w(y);for(r=new w(s),h=n=new w(s),o=d=new w(s),g=coeffToString(b),a=r.e=g.length-y.e-1,r.c[0]=POWS_TEN[(c=a%LOG_BASE)<0?LOG_BASE+c:c],e=!e||l.comparedTo(r)>0?a>0?r:h:l,c=p,p=1/0,l=new w(g),d.c[0]=0;f=t(l,r,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,h=d.plus(f.times(i=h)),d=i,r=l.minus(f.times(i=r)),l=i;return i=t(e.minus(n),o,0,1),d=d.plus(i.times(h)),n=n.plus(i.times(o)),d.s=h.s=y.s,m=t(h,o,a*=2,u).minus(y).abs().comparedTo(t(d,n,a,u).minus(y).abs())<1?[h,o]:[d,n],p=c,m},a.toNumber=function(){return+A(this)},a.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),_(this,e,t,2)},a.toString=function(e){var t,n=this,o=n.s,i=n.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=l||i>=d?toExponential(coeffToString(n.c),i):toFixedPoint(coeffToString(n.c),i,"0"):10===e&&v?t=toFixedPoint(coeffToString((n=k(new w(n),c+i+1,u)).c),n.e,"0"):(intCheck(e,2,b.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),i,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},a.valueOf=a.toJSON=function(){return A(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function compare$1(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,c=e.e,u=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=c==u,!o||!i)return n?0:!o^r?1:-1;if(!n)return c>u^r?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(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}var BigNumber$2=clone(),commonjsGlobal$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var lib={},indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var r=new Array(arguments.length-1),n=0,o=2,i=!0;for(;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(s){i&&(i=!1,a(s))}}))},aspromise}var base64$1={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,n){for(var o,i=null,a=[],s=0,c=0;t<n;){var u=e[t++];switch(c){case 0:a[s++]=r[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=r[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=r[o|u>>6],a[s++]=r[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=r[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var o,a=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=n[u]))throw Error(i);switch(s){case 0:o=u,s=1;break;case 1:t[r++]=o<<2|(48&u)>>4,o=u,s=2;break;case 2:t[r++]=(15&o)<<4|(60&u)>>2,o=u,s=3;break;case 3:t[r++]=(3&o)<<6|u,s=0}}if(1===s)throw Error(i);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64$1)),base64$1}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function i(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,r),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function i(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=n*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,r,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function r(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e2){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(e=utf8).length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},e.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},e.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}),utf8;var e}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var r=t.zero=new t(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var n=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return r;var n=e<0;n&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return n&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(n){if("number"==typeof n)return t.fromNumber(n);if(e.isString(n)){if(!e.Long)return t.fromNumber(parseInt(n,10));n=e.Long.fromString(n)}return n.low||n.high?new t(n.low>>>0,n.high>>>0):r},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===n?r:new t((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)},t.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)},t.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},t.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},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function r(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function n(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&&r(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}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal$1&&commonjsGlobal$1&&commonjsGlobal$1.process&&commonjsGlobal$1.process.versions&&commonjsGlobal$1.process.versions.node),t.global=t.isNode&&commonjsGlobal$1||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||minimal$1,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(r){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeI