UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 96.3 kB
var ur=Object.create;var We=Object.defineProperty,cr=Object.defineProperties,lr=Object.getOwnPropertyDescriptor,mr=Object.getOwnPropertyDescriptors,fr=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols,pr=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable;var on=(n,t,e)=>t in n?We(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,K=(n,t)=>{for(var e in t||(t={}))St.call(t,e)&&on(n,e,t[e]);if(nt)for(var e of nt(t))sn.call(t,e)&&on(n,e,t[e]);return n},H=(n,t)=>cr(n,mr(t));var pe=(n,t)=>{var e={};for(var r in n)St.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&nt)for(var r of nt(n))t.indexOf(r)<0&&sn.call(n,r)&&(e[r]=n[r]);return e};var dr=(n,t)=>{for(var e in t)We(n,e,{get:t[e],enumerable:!0})},an=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fr(t))!St.call(n,i)&&i!==e&&We(n,i,{get:()=>t[i],enumerable:!(r=lr(t,i))||r.enumerable});return n};var J=(n,t,e)=>(e=n!=null?ur(pr(n)):{},an(t||!n||!n.__esModule?We(e,"default",{value:n,enumerable:!0}):e,n)),gr=n=>an(We({},"__esModule",{value:!0}),n);var Fi={};dr(Fi,{default:()=>kt});module.exports=gr(Fi);var x=require("@solana/web3.js"),Q=require("@solana/spl-token");var vn=J(require("big.js")),bi=J(require("bn.js"));var re=J(require("bn.js"));var Ne=9e15,Te=1e9,Ct="0123456789abcdef",it="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ot="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",It={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ne,maxE:Ne,crypto:!1},mn,de,N=!0,at="[DecimalError] ",Pe=at+"Invalid argument: ",fn=at+"Precision limit exceeded",pn=at+"crypto unavailable",dn="[object Decimal]",$=Math.floor,j=Math.pow,hr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,br=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,yr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,gn=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ue=1e7,C=7,wr=9007199254740991,Pr=it.length-1,Nt=ot.length-1,h={toStringTag:dn};h.absoluteValue=h.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),B(n)};h.ceil=function(){return B(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(n,t){var e,r=this,i=r.constructor;if(n=new i(n),t=new i(t),!n.s||!t.s)return new i(NaN);if(n.gt(t))throw Error(Pe+t);return e=r.cmp(n),e<0?n:r.cmp(t)>0?t:new i(r)};h.comparedTo=h.cmp=function(n){var t,e,r,i,o=this,s=o.d,a=(n=new o.constructor(n)).d,u=o.s,c=n.s;if(!s||!a)return!u||!c?NaN:u!==c?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-c:0;if(u!==c)return u;if(o.e!==n.e)return o.e>n.e^u<0?1:-1;for(r=s.length,i=a.length,t=0,e=r<i?r:i;t<e;++t)if(s[t]!==a[t])return s[t]>a[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1};h.cosine=h.cos=function(){var n,t,e=this,r=e.constructor;return e.d?e.d[0]?(n=r.precision,t=r.rounding,r.precision=n+Math.max(e.e,e.sd())+C,r.rounding=1,e=Tr(r,Pn(r,e)),r.precision=n,r.rounding=t,B(de==2||de==3?e.neg():e,n,t,!0)):new r(1):new r(NaN)};h.cubeRoot=h.cbrt=function(){var n,t,e,r,i,o,s,a,u,c,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(N=!1,o=l.s*j(l.s*l,1/3),!o||Math.abs(o)==1/0?(e=X(l.d),n=l.e,(o=(n-e.length+1)%3)&&(e+=o==1||o==-2?"0":"00"),o=j(e,1/3),n=$((n+1)/3)-(n%3==(n<0?-1:2)),o==1/0?e="5e"+n:(e=o.toExponential(),e=e.slice(0,e.indexOf("e")+1)+n),r=new m(e),r.s=l.s):r=new m(o.toString()),s=(n=m.precision)+3;;)if(a=r,u=a.times(a).times(a),c=u.plus(l),r=U(c.plus(l).times(a),c.plus(u),s+2,1),X(a.d).slice(0,s)===(e=X(r.d)).slice(0,s))if(e=e.slice(s-3,s+1),e=="9999"||!i&&e=="4999"){if(!i&&(B(a,n+1,0),a.times(a).times(a).eq(l))){r=a;break}s+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(B(r,n+1,1),t=!r.times(r).times(r).eq(l));break}return N=!0,B(r,n,m.rounding,t)};h.decimalPlaces=h.dp=function(){var n,t=this.d,e=NaN;if(t){if(n=t.length-1,e=(n-$(this.e/C))*C,n=t[n],n)for(;n%10==0;n/=10)e--;e<0&&(e=0)}return e};h.dividedBy=h.div=function(n){return U(this,new this.constructor(n))};h.dividedToIntegerBy=h.divToInt=function(n){var t=this,e=t.constructor;return B(U(t,new e(n),0,1,1),e.precision,e.rounding)};h.equals=h.eq=function(n){return this.cmp(n)===0};h.floor=function(){return B(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(n){return this.cmp(n)>0};h.greaterThanOrEqualTo=h.gte=function(n){var t=this.cmp(n);return t==1||t===0};h.hyperbolicCosine=h.cosh=function(){var n,t,e,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;e=s.precision,r=s.rounding,s.precision=e+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(n=Math.ceil(i/3),t=(1/ct(4,n)).toString()):(n=16,t="2.3283064365386962890625e-10"),o=Le(s,1,o.times(t),new s(1),!0);for(var u,c=n,l=new s(8);c--;)u=o.times(o),o=a.minus(u.times(l.minus(u.times(l))));return B(o,s.precision=e,s.rounding=r,!0)};h.hyperbolicSine=h.sinh=function(){var n,t,e,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,e=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=Le(o,2,i,i,!0);else{n=1.4*Math.sqrt(r),n=n>16?16:n|0,i=i.times(1/ct(5,n)),i=Le(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),c=new o(20);n--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(c))))}return o.precision=t,o.rounding=e,B(i,t,e,!0)};h.hyperbolicTangent=h.tanh=function(){var n,t,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(n=r.precision,t=r.rounding,r.precision=n+7,r.rounding=1,U(e.sinh(),e.cosh(),r.precision=n,r.rounding=t)):new r(e.s)};h.inverseCosine=h.acos=function(){var n,t=this,e=t.constructor,r=t.abs().cmp(1),i=e.precision,o=e.rounding;return r!==-1?r===0?t.isNeg()?ae(e,i,o):new e(0):new e(NaN):t.isZero()?ae(e,i+4,o).times(.5):(e.precision=i+6,e.rounding=1,t=t.asin(),n=ae(e,i+4,o).times(.5),e.precision=i,e.rounding=o,n.minus(t))};h.inverseHyperbolicCosine=h.acosh=function(){var n,t,e=this,r=e.constructor;return e.lte(1)?new r(e.eq(1)?0:NaN):e.isFinite()?(n=r.precision,t=r.rounding,r.precision=n+Math.max(Math.abs(e.e),e.sd())+4,r.rounding=1,N=!1,e=e.times(e).minus(1).sqrt().plus(e),N=!0,r.precision=n,r.rounding=t,e.ln()):new r(e)};h.inverseHyperbolicSine=h.asinh=function(){var n,t,e=this,r=e.constructor;return!e.isFinite()||e.isZero()?new r(e):(n=r.precision,t=r.rounding,r.precision=n+2*Math.max(Math.abs(e.e),e.sd())+6,r.rounding=1,N=!1,e=e.times(e).plus(1).sqrt().plus(e),N=!0,r.precision=n,r.rounding=t,e.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var n,t,e,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(n=o.precision,t=o.rounding,r=i.sd(),Math.max(r,n)<2*-i.e-1?B(new o(i),n,t,!0):(o.precision=e=r-i.e,i=U(i.plus(1),new o(1).minus(i),e+n,1),o.precision=n+4,o.rounding=1,i=i.ln(),o.precision=n,o.rounding=t,i.times(.5))):new o(NaN)};h.inverseSine=h.asin=function(){var n,t,e,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),e=o.precision,r=o.rounding,t!==-1?t===0?(n=ae(o,e+4,r).times(.5),n.s=i.s,n):new o(NaN):(o.precision=e+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=e,o.rounding=r,i.times(2)))};h.inverseTangent=h.atan=function(){var n,t,e,r,i,o,s,a,u,c=this,l=c.constructor,m=l.precision,f=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&m+4<=Nt)return s=ae(l,m+4,f).times(.25),s.s=c.s,s}else{if(!c.s)return new l(NaN);if(m+4<=Nt)return s=ae(l,m+4,f).times(.5),s.s=c.s,s}for(l.precision=a=m+10,l.rounding=1,e=Math.min(28,a/C+2|0),n=e;n;--n)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(N=!1,t=Math.ceil(a/C),r=1,u=c.times(c),s=new l(c),i=c;n!==-1;)if(i=i.times(u),o=s.minus(i.div(r+=2)),i=i.times(u),s=o.plus(i.div(r+=2)),s.d[t]!==void 0)for(n=t;s.d[n]===o.d[n]&&n--;);return e&&(s=s.times(2<<e-1)),N=!0,B(s,l.precision=m,l.rounding=f,!0)};h.isFinite=function(){return!!this.d};h.isInteger=h.isInt=function(){return!!this.d&&$(this.e/C)>this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(n){return this.cmp(n)<0};h.lessThanOrEqualTo=h.lte=function(n){return this.cmp(n)<1};h.logarithm=h.log=function(n){var t,e,r,i,o,s,a,u,c=this,l=c.constructor,m=l.precision,f=l.rounding,p=5;if(n==null)n=new l(10),t=!0;else{if(n=new l(n),e=n.d,n.s<0||!e||!e[0]||n.eq(1))return new l(NaN);t=n.eq(10)}if(e=c.d,c.s<0||!e||!e[0]||c.eq(1))return new l(e&&!e[0]?-1/0:c.s!=1?NaN:e?0:1/0);if(t)if(e.length>1)o=!0;else{for(i=e[0];i%10===0;)i/=10;o=i!==1}if(N=!1,a=m+p,s=we(c,a),r=t?st(l,a+10):we(n,a),u=U(s,r,a,1),Ve(u.d,i=m,f))do if(a+=10,s=we(c,a),r=t?st(l,a+10):we(n,a),u=U(s,r,a,1),!o){+X(u.d).slice(i+1,i+15)+1==1e14&&(u=B(u,m+1,0));break}while(Ve(u.d,i+=10,f));return N=!0,B(u,m,f)};h.minus=h.sub=function(n){var t,e,r,i,o,s,a,u,c,l,m,f,p=this,y=p.constructor;if(n=new y(n),!p.d||!n.d)return!p.s||!n.s?n=new y(NaN):p.d?n.s=-n.s:n=new y(n.d||p.s!==n.s?p:NaN),n;if(p.s!=n.s)return n.s=-n.s,p.plus(n);if(c=p.d,f=n.d,a=y.precision,u=y.rounding,!c[0]||!f[0]){if(f[0])n.s=-n.s;else if(c[0])n=new y(p);else return new y(u===3?-0:0);return N?B(n,a,u):n}if(e=$(n.e/C),l=$(p.e/C),c=c.slice(),o=l-e,o){for(m=o<0,m?(t=c,o=-o,s=f.length):(t=f,e=l,s=c.length),r=Math.max(Math.ceil(a/C),s)+2,o>r&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for(r=c.length,s=f.length,m=r<s,m&&(s=r),r=0;r<s;r++)if(c[r]!=f[r]){m=c[r]<f[r];break}o=0}for(m&&(t=c,c=f,f=t,n.s=-n.s),s=c.length,r=f.length-s;r>0;--r)c[s++]=0;for(r=f.length;r>o;){if(c[--r]<f[r]){for(i=r;i&&c[--i]===0;)c[i]=ue-1;--c[i],c[r]+=ue}c[r]-=f[r]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--e;return c[0]?(n.d=c,n.e=ut(c,e),N?B(n,a,u):n):new y(u===3?-0:0)};h.modulo=h.mod=function(n){var t,e=this,r=e.constructor;return n=new r(n),!e.d||!n.s||n.d&&!n.d[0]?new r(NaN):!n.d||e.d&&!e.d[0]?B(new r(e),r.precision,r.rounding):(N=!1,r.modulo==9?(t=U(e,n.abs(),0,3,1),t.s*=n.s):t=U(e,n,0,r.modulo,1),t=t.times(n),N=!0,e.minus(t))};h.naturalExponential=h.exp=function(){return Lt(this)};h.naturalLogarithm=h.ln=function(){return we(this)};h.negated=h.neg=function(){var n=new this.constructor(this);return n.s=-n.s,B(n)};h.plus=h.add=function(n){var t,e,r,i,o,s,a,u,c,l,m=this,f=m.constructor;if(n=new f(n),!m.d||!n.d)return!m.s||!n.s?n=new f(NaN):m.d||(n=new f(n.d||m.s===n.s?m:NaN)),n;if(m.s!=n.s)return n.s=-n.s,m.minus(n);if(c=m.d,l=n.d,a=f.precision,u=f.rounding,!c[0]||!l[0])return l[0]||(n=new f(m)),N?B(n,a,u):n;if(o=$(m.e/C),r=$(n.e/C),c=c.slice(),i=o-r,i){for(i<0?(e=c,i=-i,s=l.length):(e=l,r=o,s=c.length),o=Math.ceil(a/C),s=o>s?o+1:s+1,i>s&&(i=s,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for(s=c.length,i=l.length,s-i<0&&(i=s,e=l,l=c,c=e),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/ue|0,c[i]%=ue;for(t&&(c.unshift(t),++r),s=c.length;c[--s]==0;)c.pop();return n.d=c,n.e=ut(c,r),N?B(n,a,u):n};h.precision=h.sd=function(n){var t,e=this;if(n!==void 0&&n!==!!n&&n!==1&&n!==0)throw Error(Pe+n);return e.d?(t=hn(e.d),n&&e.e+1>t&&(t=e.e+1)):t=NaN,t};h.round=function(){var n=this,t=n.constructor;return B(new t(n),n.e+1,t.rounding)};h.sine=h.sin=function(){var n,t,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(n=r.precision,t=r.rounding,r.precision=n+Math.max(e.e,e.sd())+C,r.rounding=1,e=xr(r,Pn(r,e)),r.precision=n,r.rounding=t,B(de>2?e.neg():e,n,t,!0)):new r(NaN)};h.squareRoot=h.sqrt=function(){var n,t,e,r,i,o,s=this,a=s.d,u=s.e,c=s.s,l=s.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(N=!1,c=Math.sqrt(+s),c==0||c==1/0?(t=X(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=$((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),r=new l(t)):r=new l(c.toString()),e=(u=l.precision)+3;;)if(o=r,r=o.plus(U(s,o,e+2,1)).times(.5),X(o.d).slice(0,e)===(t=X(r.d)).slice(0,e))if(t=t.slice(e-3,e+1),t=="9999"||!i&&t=="4999"){if(!i&&(B(o,u+1,0),o.times(o).eq(s))){r=o;break}e+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(B(r,u+1,1),n=!r.times(r).eq(s));break}return N=!0,B(r,u,l.rounding,n)};h.tangent=h.tan=function(){var n,t,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(n=r.precision,t=r.rounding,r.precision=n+10,r.rounding=1,e=e.sin(),e.s=1,e=U(e,new r(1).minus(e.times(e)).sqrt(),n+10,0),r.precision=n,r.rounding=t,B(de==2||de==4?e.neg():e,n,t,!0)):new r(NaN)};h.times=h.mul=function(n){var t,e,r,i,o,s,a,u,c,l=this,m=l.constructor,f=l.d,p=(n=new m(n)).d;if(n.s*=l.s,!f||!f[0]||!p||!p[0])return new m(!n.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?n.s/0:n.s*0);for(e=$(l.e/C)+$(n.e/C),u=f.length,c=p.length,u<c&&(o=f,f=p,p=o,s=u,u=c,c=s),o=[],s=u+c,r=s;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)a=o[i]+p[r]*f[i-r-1]+t,o[i--]=a%ue|0,t=a/ue|0;o[i]=(o[i]+t)%ue|0}for(;!o[--s];)o.pop();return t?++e:o.shift(),n.d=o,n.e=ut(o,e),N?B(n,m.precision,m.rounding):n};h.toBinary=function(n,t){return Rt(this,2,n,t)};h.toDecimalPlaces=h.toDP=function(n,t){var e=this,r=e.constructor;return e=new r(e),n===void 0?e:(ie(n,0,Te),t===void 0?t=r.rounding:ie(t,0,8),B(e,n+e.e+1,t))};h.toExponential=function(n,t){var e,r=this,i=r.constructor;return n===void 0?e=le(r,!0):(ie(n,0,Te),t===void 0?t=i.rounding:ie(t,0,8),r=B(new i(r),n+1,t),e=le(r,!0,n+1)),r.isNeg()&&!r.isZero()?"-"+e:e};h.toFixed=function(n,t){var e,r,i=this,o=i.constructor;return n===void 0?e=le(i):(ie(n,0,Te),t===void 0?t=o.rounding:ie(t,0,8),r=B(new o(i),n+i.e+1,t),e=le(r,!1,n+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e};h.toFraction=function(n){var t,e,r,i,o,s,a,u,c,l,m,f,p=this,y=p.d,d=p.constructor;if(!y)return new d(p);if(c=e=new d(1),r=u=new d(0),t=new d(r),o=t.e=hn(y)-p.e-1,s=o%C,t.d[0]=j(10,s<0?C+s:s),n==null)n=o>0?t:c;else{if(a=new d(n),!a.isInt()||a.lt(c))throw Error(Pe+a);n=a.gt(t)?o>0?t:c:a}for(N=!1,a=new d(X(y)),l=d.precision,d.precision=o=y.length*C*2;m=U(a,t,0,1,1),i=e.plus(m.times(r)),i.cmp(n)!=1;)e=r,r=i,i=c,c=u.plus(m.times(i)),u=i,i=t,t=a.minus(m.times(i)),a=i;return i=U(n.minus(e),r,0,1,1),u=u.plus(i.times(c)),e=e.plus(i.times(r)),u.s=c.s=p.s,f=U(c,r,o,1).minus(p).abs().cmp(U(u,e,o,1).minus(p).abs())<1?[c,r]:[u,e],d.precision=l,N=!0,f};h.toHexadecimal=h.toHex=function(n,t){return Rt(this,16,n,t)};h.toNearest=function(n,t){var e=this,r=e.constructor;if(e=new r(e),n==null){if(!e.d)return e;n=new r(1),t=r.rounding}else{if(n=new r(n),t===void 0?t=r.rounding:ie(t,0,8),!e.d)return n.s?e:n;if(!n.d)return n.s&&(n.s=e.s),n}return n.d[0]?(N=!1,e=U(e,n,0,t,1).times(n),N=!0,B(e)):(n.s=e.s,e=n),e};h.toNumber=function(){return+this};h.toOctal=function(n,t){return Rt(this,8,n,t)};h.toPower=h.pow=function(n){var t,e,r,i,o,s,a=this,u=a.constructor,c=+(n=new u(n));if(!a.d||!n.d||!a.d[0]||!n.d[0])return new u(j(+a,c));if(a=new u(a),a.eq(1))return a;if(r=u.precision,o=u.rounding,n.eq(1))return B(a,r,o);if(t=$(n.e/C),t>=n.d.length-1&&(e=c<0?-c:c)<=wr)return i=bn(u,a,e,r),n.s<0?new u(1).div(i):B(i,r,o);if(s=a.s,s<0){if(t<n.d.length-1)return new u(NaN);if((n.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return e=j(+a,c),t=e==0||!isFinite(e)?$(c*(Math.log("0."+X(a.d))/Math.LN10+a.e+1)):new u(e+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?s/0:0):(N=!1,u.rounding=a.s=1,e=Math.min(12,(t+"").length),i=Lt(n.times(we(a,r+e)),r),i.d&&(i=B(i,r+5,1),Ve(i.d,r,o)&&(t=r+10,i=B(Lt(n.times(we(a,t+e)),t),t+5,1),+X(i.d).slice(r+1,r+15)+1==1e14&&(i=B(i,r+1,0)))),i.s=s,N=!0,u.rounding=o,B(i,r,o))};h.toPrecision=function(n,t){var e,r=this,i=r.constructor;return n===void 0?e=le(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(ie(n,1,Te),t===void 0?t=i.rounding:ie(t,0,8),r=B(new i(r),n,t),e=le(r,n<=r.e||r.e<=i.toExpNeg,n)),r.isNeg()&&!r.isZero()?"-"+e:e};h.toSignificantDigits=h.toSD=function(n,t){var e=this,r=e.constructor;return n===void 0?(n=r.precision,t=r.rounding):(ie(n,1,Te),t===void 0?t=r.rounding:ie(t,0,8)),B(new r(e),n,t)};h.toString=function(){var n=this,t=n.constructor,e=le(n,n.e<=t.toExpNeg||n.e>=t.toExpPos);return n.isNeg()&&!n.isZero()?"-"+e:e};h.truncated=h.trunc=function(){return B(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var n=this,t=n.constructor,e=le(n,n.e<=t.toExpNeg||n.e>=t.toExpPos);return n.isNeg()?"-"+e:e};function X(n){var t,e,r,i=n.length-1,o="",s=n[0];if(i>0){for(o+=s,t=1;t<i;t++)r=n[t]+"",e=C-r.length,e&&(o+=ye(e)),o+=r;s=n[t],r=s+"",e=C-r.length,e&&(o+=ye(e))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ie(n,t,e){if(n!==~~n||n<t||n>e)throw Error(Pe+n)}function Ve(n,t,e,r){var i,o,s,a;for(o=n[0];o>=10;o/=10)--t;return--t<0?(t+=C,i=0):(i=Math.ceil((t+1)/C),t%=C),o=j(10,C-t),a=n[i]%o|0,r==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=e<4&&a==99999||e>3&&a==49999||a==5e4||a==0):s=(e<4&&a+1==o||e>3&&a+1==o/2)&&(n[i+1]/o/100|0)==j(10,t-2)-1||(a==o/2||a==0)&&(n[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(r||e<4)&&a==9999||!r&&e>3&&a==4999):s=((r||e<4)&&a+1==o||!r&&e>3&&a+1==o/2)&&(n[i+1]/o/1e3|0)==j(10,t-3)-1,s}function rt(n,t,e){for(var r,i=[0],o,s=0,a=n.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Ct.indexOf(n.charAt(s++)),r=0;r<i.length;r++)i[r]>e-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/e|0,i[r]%=e)}return i.reverse()}function Tr(n,t){var e,r,i;if(t.isZero())return t;r=t.d.length,r<32?(e=Math.ceil(r/3),i=(1/ct(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10"),n.precision+=e,t=Le(n,1,t.times(i),new n(1));for(var o=e;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return n.precision-=e,t}var U=function(){function n(r,i,o){var s,a=0,u=r.length;for(r=r.slice();u--;)s=r[u]*i+a,r[u]=s%o|0,a=s/o|0;return a&&r.unshift(a),r}function t(r,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;a<o;a++)if(r[a]!=i[a]){u=r[a]>i[a]?1:-1;break}return u}function e(r,i,o,s){for(var a=0;o--;)r[o]-=a,a=r[o]<i[o]?1:0,r[o]=a*s+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s,a,u){var c,l,m,f,p,y,d,P,T,w,g,b,k,A,M,I,R,E,_,v,Z=r.constructor,Y=r.s==i.s?1:-1,q=r.d,W=i.d;if(!q||!q[0]||!W||!W[0])return new Z(!r.s||!i.s||(q?W&&q[0]==W[0]:!W)?NaN:q&&q[0]==0||!W?Y*0:Y/0);for(u?(p=1,l=r.e-i.e):(u=ue,p=C,l=$(r.e/p)-$(i.e/p)),_=W.length,R=q.length,T=new Z(Y),w=T.d=[],m=0;W[m]==(q[m]||0);m++);if(W[m]>(q[m]||0)&&l--,o==null?(A=o=Z.precision,s=Z.rounding):a?A=o+(r.e-i.e)+1:A=o,A<0)w.push(1),y=!0;else{if(A=A/p+2|0,m=0,_==1){for(f=0,W=W[0],A++;(m<R||f)&&A--;m++)M=f*u+(q[m]||0),w[m]=M/W|0,f=M%W|0;y=f||m<R}else{for(f=u/(W[0]+1)|0,f>1&&(W=n(W,f,u),q=n(q,f,u),_=W.length,R=q.length),I=_,g=q.slice(0,_),b=g.length;b<_;)g[b++]=0;v=W.slice(),v.unshift(0),E=W[0],W[1]>=u/2&&++E;do f=0,c=t(W,g,_,b),c<0?(k=g[0],_!=b&&(k=k*u+(g[1]||0)),f=k/E|0,f>1?(f>=u&&(f=u-1),d=n(W,f,u),P=d.length,b=g.length,c=t(d,g,P,b),c==1&&(f--,e(d,_<P?v:W,P,u))):(f==0&&(c=f=1),d=W.slice()),P=d.length,P<b&&d.unshift(0),e(g,d,b,u),c==-1&&(b=g.length,c=t(W,g,_,b),c<1&&(f++,e(g,_<b?v:W,b,u))),b=g.length):c===0&&(f++,g=[0]),w[m++]=f,c&&g[0]?g[b++]=q[I]||0:(g=[q[I]],b=1);while((I++<R||g[0]!==void 0)&&A--);y=g[0]!==void 0}w[0]||w.shift()}if(p==1)T.e=l,mn=y;else{for(m=1,f=w[0];f>=10;f/=10)m++;T.e=m+l*p-1,B(T,a?o+T.e+1:o,s,y)}return T}}();function B(n,t,e,r){var i,o,s,a,u,c,l,m,f,p=n.constructor;e:if(t!=null){if(m=n.d,!m)return n;for(i=1,a=m[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=C,s=t,l=m[f=0],u=l/j(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/C),a=m.length,f>=a)if(r){for(;a++<=f;)m.push(0);l=u=0,i=1,o%=C,s=o-C+1}else break e;else{for(l=a=m[f],i=1;a>=10;a/=10)i++;o%=C,s=o-C+i,u=s<0?0:l/j(10,i-s-1)%10|0}if(r=r||t<0||m[f+1]!==void 0||(s<0?l:l%j(10,i-s-1)),c=e<4?(u||r)&&(e==0||e==(n.s<0?3:2)):u>5||u==5&&(e==4||r||e==6&&(o>0?s>0?l/j(10,i-s):0:m[f-1])%10&1||e==(n.s<0?8:7)),t<1||!m[0])return m.length=0,c?(t-=n.e+1,m[0]=j(10,(C-t%C)%C),n.e=-t||0):m[0]=n.e=0,n;if(o==0?(m.length=f,a=1,f--):(m.length=f+1,a=j(10,C-o),m[f]=s>0?(l/j(10,i-s)%j(10,s)|0)*a:0),c)for(;;)if(f==0){for(o=1,s=m[0];s>=10;s/=10)o++;for(s=m[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(n.e++,m[0]==ue&&(m[0]=1));break}else{if(m[f]+=a,m[f]!=ue)break;m[f--]=0,a=1}for(o=m.length;m[--o]===0;)m.pop()}return N&&(n.e>p.maxE?(n.d=null,n.e=NaN):n.e<p.minE&&(n.e=0,n.d=[0])),n}function le(n,t,e){if(!n.isFinite())return wn(n);var r,i=n.e,o=X(n.d),s=o.length;return t?(e&&(r=e-s)>0?o=o.charAt(0)+"."+o.slice(1)+ye(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):i<0?(o="0."+ye(-i-1)+o,e&&(r=e-s)>0&&(o+=ye(r))):i>=s?(o+=ye(i+1-s),e&&(r=e-i-1)>0&&(o=o+"."+ye(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),e&&(r=e-s)>0&&(i+1===s&&(o+="."),o+=ye(r))),o}function ut(n,t){var e=n[0];for(t*=C;e>=10;e/=10)t++;return t}function st(n,t,e){if(t>Pr)throw N=!0,e&&(n.precision=e),Error(fn);return B(new n(it),t,1,!0)}function ae(n,t,e){if(t>Nt)throw Error(fn);return B(new n(ot),t,e,!0)}function hn(n){var t=n.length-1,e=t*C+1;if(t=n[t],t){for(;t%10==0;t/=10)e--;for(t=n[0];t>=10;t/=10)e++}return e}function ye(n){for(var t="";n--;)t+="0";return t}function bn(n,t,e,r){var i,o=new n(1),s=Math.ceil(r/C+4);for(N=!1;;){if(e%2&&(o=o.times(t),cn(o.d,s)&&(i=!0)),e=$(e/2),e===0){e=o.d.length-1,i&&o.d[e]===0&&++o.d[e];break}t=t.times(t),cn(t.d,s)}return N=!0,o}function un(n){return n.d[n.d.length-1]&1}function yn(n,t,e){for(var r,i=new n(t[0]),o=0;++o<t.length;)if(r=new n(t[o]),r.s)i[e](r)&&(i=r);else{i=r;break}return i}function Lt(n,t){var e,r,i,o,s,a,u,c=0,l=0,m=0,f=n.constructor,p=f.rounding,y=f.precision;if(!n.d||!n.d[0]||n.e>17)return new f(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:0/0);for(t==null?(N=!1,u=y):u=t,a=new f(.03125);n.e>-2;)n=n.times(a),m+=5;for(r=Math.log(j(2,m))/Math.LN10*2+5|0,u+=r,e=o=s=new f(1),f.precision=u;;){if(o=B(o.times(n),u,1),e=e.times(++l),a=s.plus(U(o,e,u,1)),X(a.d).slice(0,u)===X(s.d).slice(0,u)){for(i=m;i--;)s=B(s.times(s),u,1);if(t==null)if(c<3&&Ve(s.d,u-r,p,c))f.precision=u+=10,e=o=a=new f(1),l=0,c++;else return B(s,f.precision=y,p,N=!0);else return f.precision=y,s}s=a}}function we(n,t){var e,r,i,o,s,a,u,c,l,m,f,p=1,y=10,d=n,P=d.d,T=d.constructor,w=T.rounding,g=T.precision;if(d.s<0||!P||!P[0]||!d.e&&P[0]==1&&P.length==1)return new T(P&&!P[0]?-1/0:d.s!=1?NaN:P?0:d);if(t==null?(N=!1,l=g):l=t,T.precision=l+=y,e=X(P),r=e.charAt(0),Math.abs(o=d.e)<15e14){for(;r<7&&r!=1||r==1&&e.charAt(1)>3;)d=d.times(n),e=X(d.d),r=e.charAt(0),p++;o=d.e,r>1?(d=new T("0."+e),o++):d=new T(r+"."+e.slice(1))}else return c=st(T,l+2,g).times(o+""),d=we(new T(r+"."+e.slice(1)),l-y).plus(c),T.precision=g,t==null?B(d,g,w,N=!0):d;for(m=d,u=s=d=U(d.minus(1),d.plus(1),l,1),f=B(d.times(d),l,1),i=3;;){if(s=B(s.times(f),l,1),c=u.plus(U(s,new T(i),l,1)),X(c.d).slice(0,l)===X(u.d).slice(0,l))if(u=u.times(2),o!==0&&(u=u.plus(st(T,l+2,g).times(o+""))),u=U(u,new T(p),l,1),t==null)if(Ve(u.d,l-y,w,a))T.precision=l+=y,c=s=d=U(m.minus(1),m.plus(1),l,1),f=B(d.times(d),l,1),i=a=1;else return B(u,T.precision=g,w,N=!0);else return T.precision=g,u;u=c,i+=2}}function wn(n){return String(n.s*n.s/0)}function Mt(n,t){var e,r,i;for((e=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(e<0&&(e=r),e+=+t.slice(r+1),t=t.substring(0,r)):e<0&&(e=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,n.e=e=e-r-1,n.d=[],r=(e+1)%C,e<0&&(r+=C),r<i){for(r&&n.d.push(+t.slice(0,r)),i-=C;r<i;)n.d.push(+t.slice(r,r+=C));t=t.slice(r),r=C-t.length}else r-=i;for(;r--;)t+="0";n.d.push(+t),N&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function Ar(n,t){var e,r,i,o,s,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),gn.test(t))return Mt(n,t)}else if(t==="Infinity"||t==="NaN")return+t||(n.s=NaN),n.e=NaN,n.d=null,n;if(br.test(t))e=16,t=t.toLowerCase();else if(hr.test(t))e=2;else if(yr.test(t))e=8;else throw Error(Pe+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,r=n.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=bn(r,new r(e),o,o*2)),c=rt(t,e,ue),l=c.length-1,o=l;c[o]===0;--o)c.pop();return o<0?new r(n.s*0):(n.e=ut(c,l),n.d=c,N=!1,s&&(n=U(n,i,a*4)),u&&(n=n.times(Math.abs(u)<54?j(2,u):qe.pow(2,u))),N=!0,n)}function xr(n,t){var e,r=t.d.length;if(r<3)return t.isZero()?t:Le(n,2,t,t);e=1.4*Math.sqrt(r),e=e>16?16:e|0,t=t.times(1/ct(5,e)),t=Le(n,2,t,t);for(var i,o=new n(5),s=new n(16),a=new n(20);e--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function Le(n,t,e,r,i){var o,s,a,u,c=1,l=n.precision,m=Math.ceil(l/C);for(N=!1,u=e.times(e),a=new n(r);;){if(s=U(a.times(u),new n(t++*t++),l,1),a=i?r.plus(s):r.minus(s),r=U(s.times(u),new n(t++*t++),l,1),s=a.plus(r),s.d[m]!==void 0){for(o=m;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=r,r=s,s=o,c++}return N=!0,s.d.length=m+1,s}function ct(n,t){for(var e=n;--t;)e*=n;return e}function Pn(n,t){var e,r=t.s<0,i=ae(n,n.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return de=r?4:1,t;if(e=t.divToInt(i),e.isZero())de=r?3:2;else{if(t=t.minus(e.times(i)),t.lte(o))return de=un(e)?r?2:3:r?4:1,t;de=un(e)?r?1:4:r?3:2}return t.minus(i).abs()}function Rt(n,t,e,r){var i,o,s,a,u,c,l,m,f,p=n.constructor,y=e!==void 0;if(y?(ie(e,1,Te),r===void 0?r=p.rounding:ie(r,0,8)):(e=p.precision,r=p.rounding),!n.isFinite())l=wn(n);else{for(l=le(n),s=l.indexOf("."),y?(i=2,t==16?e=e*4-3:t==8&&(e=e*3-2)):i=t,s>=0&&(l=l.replace(".",""),f=new p(1),f.e=l.length-s,f.d=rt(le(f),10,i),f.e=f.d.length),m=rt(l,10,i),o=u=m.length;m[--u]==0;)m.pop();if(!m[0])l=y?"0p+0":"0";else{if(s<0?o--:(n=new p(n),n.d=m,n.e=o,n=U(n,f,e,r,0,i),m=n.d,o=n.e,c=mn),s=m[e],a=i/2,c=c||m[e+1]!==void 0,c=r<4?(s!==void 0||c)&&(r===0||r===(n.s<0?3:2)):s>a||s===a&&(r===4||c||r===6&&m[e-1]&1||r===(n.s<0?8:7)),m.length=e,c)for(;++m[--e]>i-1;)m[e]=0,e||(++o,m.unshift(1));for(u=m.length;!m[u-1];--u);for(s=0,l="";s<u;s++)l+=Ct.charAt(m[s]);if(y){if(u>1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)l+="0";for(m=rt(l,i,t),u=m.length;!m[u-1];--u);for(s=1,l="1.";s<u;s++)l+=Ct.charAt(m[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>u)for(o-=u;o--;)l+="0";else o<u&&(l=l.slice(0,o)+"."+l.slice(o))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return n.s<0?"-"+l:l}function cn(n,t){if(n.length>t)return n.length=t,!0}function Br(n){return new this(n).abs()}function kr(n){return new this(n).acos()}function Sr(n){return new this(n).acosh()}function Cr(n,t){return new this(n).plus(t)}function Ir(n){return new this(n).asin()}function Nr(n){return new this(n).asinh()}function Lr(n){return new this(n).atan()}function Mr(n){return new this(n).atanh()}function Rr(n,t){n=new this(n),t=new this(t);var e,r=this.precision,i=this.rounding,o=r+4;return!n.s||!t.s?e=new this(NaN):!n.d&&!t.d?(e=ae(this,o,1).times(t.s>0?.25:.75),e.s=n.s):!t.d||n.isZero()?(e=t.s<0?ae(this,r,i):new this(0),e.s=n.s):!n.d||t.isZero()?(e=ae(this,o,1).times(.5),e.s=n.s):t.s<0?(this.precision=o,this.rounding=1,e=this.atan(U(n,t,o,1)),t=ae(this,o,1),this.precision=r,this.rounding=i,e=n.s<0?e.minus(t):e.plus(t)):e=this.atan(U(n,t,o,1)),e}function Dr(n){return new this(n).cbrt()}function Er(n){return B(n=new this(n),n.e+1,2)}function Kr(n,t,e){return new this(n).clamp(t,e)}function vr(n){if(!n||typeof n!="object")throw Error(at+"Object expected");var t,e,r,i=n.defaults===!0,o=["precision",1,Te,"rounding",0,8,"toExpNeg",-Ne,0,"toExpPos",0,Ne,"maxE",0,Ne,"minE",-Ne,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(e=o[t],i&&(this[e]=It[e]),(r=n[e])!==void 0)if($(r)===r&&r>=o[t+1]&&r<=o[t+2])this[e]=r;else throw Error(Pe+e+": "+r);if(e="crypto",i&&(this[e]=It[e]),(r=n[e])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[e]=!0;else throw Error(pn);else this[e]=!1;else throw Error(Pe+e+": "+r);return this}function Or(n){return new this(n).cos()}function Fr(n){return new this(n).cosh()}function Tn(n){var t,e,r;function i(o){var s,a,u,c=this;if(!(c instanceof i))return new i(o);if(c.constructor=i,ln(o)){c.s=o.s,N?!o.d||o.e>i.maxE?(c.e=NaN,c.d=null):o.e<i.minE?(c.e=0,c.d=[0]):(c.e=o.e,c.d=o.d.slice()):(c.e=o.e,c.d=o.d?o.d.slice():o.d);return}if(u=typeof o,u==="number"){if(o===0){c.s=1/o<0?-1:1,c.e=0,c.d=[0];return}if(o<0?(o=-o,c.s=-1):c.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;N?s>i.maxE?(c.e=NaN,c.d=null):s<i.minE?(c.e=0,c.d=[0]):(c.e=s,c.d=[o]):(c.e=s,c.d=[o]);return}else if(o*0!==0){o||(c.s=NaN),c.e=NaN,c.d=null;return}return Mt(c,o.toString())}else if(u!=="string")throw Error(Pe+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),c.s=-1):(a===43&&(o=o.slice(1)),c.s=1),gn.test(o)?Mt(c,o):Ar(c,o)}if(i.prototype=h,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=vr,i.clone=Tn,i.isDecimal=ln,i.abs=Br,i.acos=kr,i.acosh=Sr,i.add=Cr,i.asin=Ir,i.asinh=Nr,i.atan=Lr,i.atanh=Mr,i.atan2=Rr,i.cbrt=Dr,i.ceil=Er,i.clamp=Kr,i.cos=Or,i.cosh=Fr,i.div=_r,i.exp=Wr,i.floor=Vr,i.hypot=qr,i.ln=Ur,i.log=Gr,i.log10=zr,i.log2=Hr,i.max=jr,i.min=Zr,i.mod=Yr,i.mul=Jr,i.pow=Xr,i.random=Qr,i.round=$r,i.sign=ei,i.sin=ti,i.sinh=ni,i.sqrt=ri,i.sub=ii,i.sum=oi,i.tan=si,i.tanh=ai,i.trunc=ui,n===void 0&&(n={}),n&&n.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)n.hasOwnProperty(e=r[t++])||(n[e]=this[e]);return i.config(n),i}function _r(n,t){return new this(n).div(t)}function Wr(n){return new this(n).exp()}function Vr(n){return B(n=new this(n),n.e+1,3)}function qr(){var n,t,e=new this(0);for(N=!1,n=0;n<arguments.length;)if(t=new this(arguments[n++]),t.d)e.d&&(e=e.plus(t.times(t)));else{if(t.s)return N=!0,new this(1/0);e=t}return N=!0,e.sqrt()}function ln(n){return n instanceof qe||n&&n.toStringTag===dn||!1}function Ur(n){return new this(n).ln()}function Gr(n,t){return new this(n).log(t)}function Hr(n){return new this(n).log(2)}function zr(n){return new this(n).log(10)}function jr(){return yn(this,arguments,"lt")}function Zr(){return yn(this,arguments,"gt")}function Yr(n,t){return new this(n).mod(t)}function Jr(n,t){return new this(n).mul(t)}function Xr(n,t){return new this(n).pow(t)}function Qr(n){var t,e,r,i,o=0,s=new this(1),a=[];if(n===void 0?n=this.precision:ie(n,1,Te),r=Math.ceil(n/C),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);o<r;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=r/4}else throw Error(pn);else for(;o<r;)a[o++]=Math.random()*1e7|0;for(r=a[--o],n%=C,r&&n&&(i=j(10,C-n),a[o]=(r/i|0)*i);a[o]===0;o--)a.pop();if(o<0)e=0,a=[0];else{for(e=-1;a[0]===0;e-=C)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<C&&(e-=C-r)}return s.e=e,s.d=a,s}function $r(n){return B(n=new this(n),n.e+1,this.rounding)}function ei(n){return n=new this(n),n.d?n.d[0]?n.s:0*n.s:n.s||NaN}function ti(n){return new this(n).sin()}function ni(n){return new this(n).sinh()}function ri(n){return new this(n).sqrt()}function ii(n,t){return new this(n).sub(t)}function oi(){var n=0,t=arguments,e=new this(t[n]);for(N=!1;e.s&&++n<t.length;)e=e.plus(t[n]);return N=!0,B(e,this.precision,this.rounding)}function si(n){return new this(n).tan()}function ai(n){return new this(n).tanh()}function ui(n){return B(n=new this(n),n.e+1,1)}h[Symbol.for("nodejs.util.inspect.custom")]=h.toString;h[Symbol.toStringTag]="Decimal";var qe=h.constructor=Tn(It);it=new qe(it);ot=new qe(ot);var oe=qe;var mt=require("@solana/web3.js");var An=require("@solana/spl-token"),O=require("@solana/web3.js");function Dt({pubkey:n,isSigner:t=!1,isWritable:e=!0}){return{pubkey:n,isWritable:e,isSigner:t}}var qi=[Dt({pubkey:An.TOKEN_PROGRAM_ID,isWritable:!1}),Dt({pubkey:O.SystemProgram.programId,isWritable:!1}),Dt({pubkey:O.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Et({publicKey:n,transformSol:t}){let e=xn(n.toString());if(e instanceof O.PublicKey)return t&&e.equals(Ue)?ge:e;if(t&&e.toString()===Ue.toBase58())return ge;if(typeof e=="string"){if(e===O.PublicKey.default.toBase58())return O.PublicKey.default;try{return new O.PublicKey(e)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function xn(n){try{return new O.PublicKey(n)}catch{return n}}var Ui=new O.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Bn=new O.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),kn=new O.PublicKey("SysvarRent111111111111111111111111111111111"),Gi=new O.PublicKey("SysvarC1ock11111111111111111111111111111111"),Hi=new O.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),zi=new O.PublicKey("Sysvar1nstructions1111111111111111111111111"),Sn=O.SystemProgram.programId,ji=new O.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),Zi=new O.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Yi=new O.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Ji=new O.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Xi=new O.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Qi=new O.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),$i=new O.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),eo=new O.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),to=new O.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),no=new O.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),ro=new O.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),ge=new O.PublicKey("So11111111111111111111111111111111111111112"),Ue=O.PublicKey.default;function lt(n){return Et({publicKey:n,transformSol:!0})}var Cn=require("@solana/web3.js"),Kt=require("@solana/spl-token"),vt={chainId:101,address:Cn.PublicKey.default.toBase58(),programId:Kt.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},Ae={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Kt.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var Ot=class{constructor({mint:t,decimals:e,symbol:r,name:i,skipMint:o=!1,isToken2022:s=!1}){if(t===Ue.toBase58()||t instanceof mt.PublicKey&&Ue.equals(t)){this.decimals=Ae.decimals,this.symbol=Ae.symbol,this.name=Ae.name,this.mint=new mt.PublicKey(Ae.address),this.isToken2022=!1;return}this.decimals=e,this.symbol=r||t.toString().substring(0,6),this.name=i||t.toString().substring(0,6),this.mint=o?mt.PublicKey.default:Et({publicKey:t}),this.isToken2022=s}equals(t){return this===t?!0:this.mint.equals(t.mint)}},Ce=Ot;Ce.WSOL=new Ot(H(K({},Ae),{mint:Ae.address}));var Ge=require("lodash");var Ft=class{constructor(t){this.logLevel=t.logLevel!==void 0?t.logLevel:0,this.name=t.name}set level(t){this.logLevel=t}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(t){return t<=this.logLevel}error(...t){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...t),this):this}logWithError(...t){let e=t.map(r=>typeof r=="object"?JSON.stringify(r):r).join(", ");throw new Error(e)}warning(...t){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...t),this):this}info(...t){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...t),this):this}debug(...t){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...t),this):this}},In={},ci={};function ee(n){let t=(0,Ge.get)(In,n);if(!t){let e=(0,Ge.get)(ci,n);t=new Ft({name:n,logLevel:e}),(0,Ge.set)(In,n,t)}return t}var ze=J(require("big.js")),Ln=J(require("bn.js")),Mn=J(require("decimal.js-light"));var Nn=J(require("toformat")),li=Nn.default,He=li;var ft=ee("module/fraction"),_t=He(ze.default),je=He(Mn.default),mi={[0]:je.ROUND_DOWN,[1]:je.ROUND_HALF_UP,[2]:je.ROUND_UP},fi={[0]:ze.default.roundDown,[1]:ze.default.roundHalfUp,[2]:ze.default.roundUp},G=class{constructor(t,e=new Ln.default(1)){this.numerator=xe(t),this.denominator=xe(e)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new G(this.denominator,this.numerator)}add(t){let e=t instanceof G?t:new G(xe(t));return this.denominator.eq(e.denominator)?new G(this.numerator.add(e.numerator),this.denominator):new G(this.numerator.mul(e.denominator).add(e.numerator.mul(this.denominator)),this.denominator.mul(e.denominator))}sub(t){let e=t instanceof G?t:new G(xe(t));return this.denominator.eq(e.denominator)?new G(this.numerator.sub(e.numerator),this.denominator):new G(this.numerator.mul(e.denominator).sub(e.numerator.mul(this.denominator)),this.denominator.mul(e.denominator))}mul(t){let e=t instanceof G?t:new G(xe(t));return new G(this.numerator.mul(e.numerator),this.denominator.mul(e.denominator))}div(t){let e=t instanceof G?t:new G(xe(t));return new G(this.numerator.mul(e.denominator),this.denominator.mul(e.numerator))}toSignificant(t,e={groupSeparator:""},r=1){Number.isInteger(t)||ft.logWithError(`${t} is not an integer.`),t<=0&&ft.logWithError(`${t} is not positive.`),je.set({precision:t+1,rounding:mi[r]});let i=new je(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t);return i.toFormat(i.decimalPlaces(),e)}toFixed(t,e={groupSeparator:""},r=1){return Number.isInteger(t)||ft.logWithError(`${t} is not an integer.`),t<0&&ft.logWithError(`${t} is negative.`),_t.DP=t,_t.RM=fi[r]||1,new _t(this.numerator.toString()).div(this.denominator.toString()).toFormat(t,e)}isZero(){return this.numerator.isZero()}};var Bo=ee("Raydium_price");var Wt=class{constructor({decimals:t,symbol:e="UNKNOWN",name:r="UNKNOWN"}){this.decimals=t,this.symbol=e,this.name=r}equals(t){return this===t}},pt=Wt;pt.SOL=new Wt(vt);var Dn=J(require("bn.js"));var Rn=new G(new Dn.default(100)),me=class extends G{toSignificant(t=5,e,r){return this.mul(Rn).toSignificant(t,e,r)}toFixed(t=2,e,r){return this.mul(Rn).toFixed(t,e,r)}};var di=require("@solana/web3.js"),gi=J(require("bn.js"));var Vt=new re.default(0),Qo=new re.default(1),$o=new re.default(2),es=new re.default(3),ts=new re.default(5),hi=new re.default(10),ns=new re.default(100),rs=new re.default(1e3),is=new re.default(1e4),Kn=9007199254740991;function xe(n){let t=ee("Raydium_parseBigNumberish");if(n instanceof re.default)return n;if(typeof n=="string"){if(n.match(/^-?[0-9]+$/))return new re.default(n);t.logWithError(`invalid BigNumberish string: ${n}`)}return typeof n=="number"?(n%1&&t.logWithError(`BigNumberish number underflow: ${n}`),(n>=Kn||n<=-Kn)&&t.logWithError(`BigNumberish number overflow: ${n}`),new re.default(String(n))):typeof n=="bigint"?new re.default(n.toString()):(t.error(`invalid BigNumberish value: ${n}`),new re.default(0))}var ds=ee("Raydium_amount"),gs=He(vn.default);var Wn=require("@solana/web3.js");var te=require("@solana/web3.js"),Fn=require("@solana/spl-token");var he={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut"};var On=ee("Raydium_txUtil"),_n=1644;function dt(n){let t=[],e=[];return n.microLamports&&(t.push(te.ComputeBudgetProgram.setComputeUnitPrice({microLamports:n.microLamports})),e.push(he.SetComputeUnitPrice)),n.units&&(t.push(te.ComputeBudgetProgram.setComputeUnitLimit({units:n.units})),e.push(he.SetComputeUnitLimit)),{instructions:t,instructionTypes:e}}async function Me(n,t){var r,i;let e=t!=null?t:"confirmed";try{return((i=await((r=n.getLatestBlockhash)==null?void 0:r.call(n,{commitment:e})))==null?void 0:i.blockhash)||(await n.getRecentBlockhash(e)).blockhash}catch{return(await n.getRecentBlockhash(e)).blockhash}}function yi(n,t){n.length<1&&On.logWithError(`no instructions provided: ${n.toString()}`),t.length<1&&On.logWithError(`no signers provided:, ${t.toString()}`);let e=new te.Transaction;e.recentBlockhash="11111111111111111111111111111111",e.feePayer=t[0],e.add(...n);try{return Buffer.from(e.serialize({verifySignatures:!1})).toString("base64").length<_n}catch{return!1}}function Be(n,t){let[e,r]=te.PublicKey.findProgramAddressSync(n,t);return{publicKey:e,nonce:r}}function Ze({instructions:n,payer:t,signers:e}){return yi(n,[t,...e])}function Ye({instructions:n,payer:t,lookupTableAddressAccount:e,recentBlockhash:r=te.Keypair.generate().publicKey.toString()}){let o=new te.TransactionMessage({payerKey:t,recentBlockhash:r,instructions:n}).compileToV0Message(Object.values(e!=null?e:{}));try{return Buffer.from(new te.VersionedTransaction(o).serialize()).toString("base64").length<_n}catch{return!1}}var wi=n=>Buffer.isBuffer(n)?n:n instanceof Uint8Array?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n),Pi=n=>{let t=n.serialize({requireAllSignatures:!1,verifySignatures:!1});n instanceof te.VersionedTransaction&&(t=wi(t));try{return t instanceof Buffer?t.toString("base64"):Buffer.from(t).toString("base64")}catch{return t.toString("base64")}};function Ie(n){let t=[];return n.forEach(e=>{e instanceof te.Transaction&&(e.recentBlockhash||(e.recentBlockhash=Fn.TOKEN_PROGRAM_ID.toBase58()),e.feePayer||(e.feePayer=te.Keypair.generate().publicKey)),t.push(Pi(e))}),console.log("simulate tx string:",t),t}var Vn=require("@solana/spl-token");function qn(n,t,e){return Be([n.toBuffer(),(e!=null?e:Vn.TOKEN_PROGRAM_ID).toBuffer(),t.toBuffer()],new Wn.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var Pt=J(require("bn.js"));var Gt=J(require("bn.js")),Ut=new Gt.default(1e6);function Ti(n,t,e){return n.mul(t).add(e).sub(new Gt.default(1)).div(e)}function Un(n,t,e){return n.mul(t).div(e)}var gt=class{static tradingFee(t,e){return Ti(t,e,Ut)}static protocolFee(t,e){return Un(t,e,Ut)}static fundFee(t,e){return Un(t,e,Ut)}};var De=J(require("bn.js"));function ht(n,t){if(t.isZero())throw Error("divisor is zero");return n.mod(t)}function Ai(n,t){if(t.isZero())throw Error("rhs is zero");let e=n.div(t);if(e.isZero())throw Error("quotient is zero");let r=ht(n,t);return r.gt(Re)&&(e=e.add(new De.default(1)),t=n.div(e),r=ht(n,e),r.gt(Re)&&(t=t.add(new De.default(1)))),[e,t]}var Re=new De.default(0),bt=class{static swapWithoutFees(t,e,r){let i=e.mul(r),o=e.add(t),[s,a]=Ai(i,o),u=a.sub(e),c=r.sub(s);if(c.isZero())throw Error("destinationAmountSwapped is zero");return{sourceAmountSwapped:u,destinationAmountSwapped:c}}static lpTokensToTradingTokens(t,e,r,i,o){let s=t.mul(r).div(e),a=t.mul(i).div(e);if(o===0)return{tokenAmount0:s,tokenAmount1:a};if(o===1)return ht(t.mul(r),e).gt(Re)&&s.gt(Re)&&(s=s.add(new De.default(1))),ht(t.mul(i),e).gt(Re)&&a.gt(Re)&&(a=a.add(new De.default(1))),{tokenAmount0:s,tokenAmount1:a};throw Error("roundDirection value error")}};var V=require("@solana/web3.js"),Hn=J(require("axios"));var Se=require("@solana/web3.js");var jt=require("@solana/web3.js"),ke=require("@solana/spl-token");var Ht=ee("Raydium_accountInfo_util");async function Zt(n,t,e){let{batchRequest:r,commitment:i="confirmed",chunkCount:o=100}=K({batchRequest:!1},e),s=zt(t,o),a=new Array(s.length).fill([]);if(r){let u=s.map(m=>{let f=n._buildArgs([m.map(p=>p.toBase58())],i,"base64");return{methodName:"getMultipleAccounts",args:f}}),c=zt(u,10);a=(await(await Promise.all(c.map(async m=>await n._rpcBatchRequest(m)))).flat()).map(m=>(m.error&&Ht.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${m.error.message}`),m.result.value.map(f=>{if(f){let{data:p,executable:y,lamports:d,owner:P,rentEpoch:T}=f;return p.length!==2&&p[1]!=="base64"&&Ht.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:y,lamports:d,owner:new jt.PublicKey(P),rentEpoch:T}}return null})))}else try{a=await Promise.all(s.map(u=>n.getMultipleAccountsInfo(u,i)))}catch(u){u instanceof Error&&Ht.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${u.message}`)}return a.flat()}async function Je(n,t,e){let r=await Zt(n,t.map(i=>i.pubkey),e);return t.map((i,o)=>H(K({},i),{accountInfo:r[o]}))}async function Gn({connection:n,mints:t,config:e}){var o,s,a;if(t.length===0)return{};let r=await Je(n,t.map(u=>({pubkey:lt(u)})),e),i={};for(let u of r){if(!u.accountInfo||u.accountInfo.data.length<ke.MINT_SIZE){console.log("invalid mint account",u.pubkey.toBase58());continue}let c=(0,ke.unpackMint)(u.pubkey,u.accountInfo,(o=u.accountInfo)==null?void 0:o.owner);i[u.pubkey.toString()]=H(K({},c),{programId:((s=u.accountInfo)==null?void 0:s.owner)||ke.TOKEN_PROGRAM_ID,feeConfig:(a=(0,ke.getTransferFeeConfig)(c))!=null?a:void 0})}return i[jt.PublicKey.default.toBase58()]=i[ge.toBase58()],i}async function Yt({connection:n,address:t}){let e=await Zt(n,[...new Set(t.map(i=>i.toString()))].map(i=>new Se.PublicKey(i))),r={};for(let i=0;i<t.length;i++){let o=e[i],s=t[i];if(!o)continue;let a=new Se.AddressLookupTableAccount({key:s,state:Se.AddressLookupTableAccount.deserialize(o.data)});r[s.toString()]=a,yt[s.toString()]=a}return r}var yt={"2immgwYNHBbyVQKVGCEkgWpi53bLwWNRMB5G2nbgYV17":new Se.AddressLookupTableAccount({key:new Se.PublicKey("2immgwYNHBbyVQKVGCEkgWpi53bLwWNRMB5G2nbgYV17"),state:Se.AddressLookupTableAccount.deserialize(Buffer.from("AQAAAP//////////d49+DAAAAAAAAQZMWvw7GUNJdaccNBVnb57OKakxL2BHLYvhRwVILRsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAABt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKkG3fbh7nWP3hhCXbzkbM3athr8TYO5DSf+vfko2KGL/AVKU1D4XciC1hSlVnJ4iilt3x6rq9CmBniISTL07vagBqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAGp9UXGMd0yShWY5hpHV62i164o5tLbVxzVVshAAAAAIyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZC3BlsePRfEU4nVJ/awTDzVi4bHMaoP21SbbRvAP4KUbIScv+6Yw2LHF/6K0ZjUPibbSWXCirYPGuuVl7zT789IUPLW4CpHr4JNCatp3ELXDLKMv6JJ+37le50lbBJ2LvDQdRqCgtphMF/imcN7mY5YRx2xE1A3MQ+L4QRaYK9u4GRfZP3LsAd00a+IkCpA22UNQMKdq5BFbJuwuOLqc8zxCTDlqxBG8J0HcxtfogQHDK06ukzfaXiNDKAob1MqBHS9lJxDYCwz8gd5DtFqNSTKG5l1zxIaKpDP/sffi2is1H9aKveyXSu5StXElYRl9SD5As0DHE4N0GLnf84/siiKXVyp4Ez121kLcUui/jLLFZEz/BwZK3Ilf9B9OcsEAeDMKAy2vjGSxQODgBz0QwGA+eP4ZjIjrIAQaXENv31QfLlOdXSRCkaybRniDHF4C8YcwhcvsqrOVuTP4B2Na+9wLdtrB31uz2rtlFI5kahdsnp/d1SrASDInYCtTYtdoke4kX+hoKWcEWM4Tle8pTUkUVv4BxS6fje/EzKBE4Qu9N9LMnrw/JNO0hqMVB4rk/2ou4AB1loQ7FZoPwut2o4KZB+0p9xnbrQKw038qjpHar+PyDwvxBRcu5hpHw3dguezeWv+IwvgW5icu8EGkhGa9AkFPPJT7VMSFb8xowveU=","base64"))})};var wt=class{constructor(t){this.instructions=[];this.endInstructions=[];this.lookupTableAddress=[];this.signers=[];this.instructionTypes=[];thi