UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

1 lines 241 kB
var ks=Object.defineProperty,ws=Object.defineProperties;var hs=Object.getOwnPropertyDescriptors;var Gn=Object.getOwnPropertySymbols;var vo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var Mo=(o,e,t)=>e in o?ks(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,G=(o,e)=>{for(var t in e||(e={}))vo.call(e,t)&&Mo(o,t,e[t]);if(Gn)for(var t of Gn(e))Eo.call(e,t)&&Mo(o,t,e[t]);return o},Z=(o,e)=>ws(o,hs(e));var Rt=(o,e)=>{var t={};for(var n in o)vo.call(o,n)&&e.indexOf(n)<0&&(t[n]=o[n]);if(o!=null&&Gn)for(var n of Gn(o))e.indexOf(n)<0&&Eo.call(o,n)&&(t[n]=o[n]);return t};import{PublicKey as Y,SystemProgram as gs}from"@solana/web3.js";import{createTransferInstruction as Ps,TOKEN_PROGRAM_ID as ue,TOKEN_2022_PROGRAM_ID as Gt,createAssociatedTokenAccountIdempotentInstruction as fn,createSyncNativeInstruction as As,createTransferCheckedInstruction as hc}from"@solana/spl-token";import ce from"bn.js";var en=9e15,vt=1e9,Li="0123456789abcdef",zn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ri={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-en,maxE:en,crypto:!1},Do,ht,$=!0,Qn="[DecimalError] ",Mt=Qn+"Invalid argument: ",qo=Qn+"Precision limit exceeded",Go=Qn+"crypto unavailable",Uo="[object Decimal]",Ue=Math.floor,ve=Math.pow,Bs=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ts=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Is=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Xo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,st=1e7,H=7,xs=9007199254740991,Ss=zn.length-1,Oi=Yn.length-1,N={toStringTag:Uo};N.absoluteValue=N.abs=function(){var o=new this.constructor(this);return o.s<0&&(o.s=1),X(o)};N.ceil=function(){return X(new this.constructor(this),this.e+1,2)};N.clampedTo=N.clamp=function(o,e){var t,n=this,i=n.constructor;if(o=new i(o),e=new i(e),!o.s||!e.s)return new i(NaN);if(o.gt(e))throw Error(Mt+e);return t=n.cmp(o),t<0?o:n.cmp(e)>0?e:new i(n)};N.comparedTo=N.cmp=function(o){var e,t,n,i,r=this,s=r.d,a=(o=new r.constructor(o)).d,c=r.s,u=o.s;if(!s||!a)return!c||!u?NaN:c!==u?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-u:0;if(c!==u)return c;if(r.e!==o.e)return r.e>o.e^c<0?1:-1;for(n=s.length,i=a.length,e=0,t=n<i?n:i;e<t;++e)if(s[e]!==a[e])return s[e]>a[e]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};N.cosine=N.cos=function(){var o,e,t=this,n=t.constructor;return t.d?t.d[0]?(o=n.precision,e=n.rounding,n.precision=o+Math.max(t.e,t.sd())+H,n.rounding=1,t=Ks(n,Zo(n,t)),n.precision=o,n.rounding=e,X(ht==2||ht==3?t.neg():t,o,e,!0)):new n(1):new n(NaN)};N.cubeRoot=N.cbrt=function(){var o,e,t,n,i,r,s,a,c,u,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for($=!1,r=l.s*ve(l.s*l,1/3),!r||Math.abs(r)==1/0?(t=qe(l.d),o=l.e,(r=(o-t.length+1)%3)&&(t+=r==1||r==-2?"0":"00"),r=ve(t,1/3),o=Ue((o+1)/3)-(o%3==(o<0?-1:2)),r==1/0?t="5e"+o:(t=r.toExponential(),t=t.slice(0,t.indexOf("e")+1)+o),n=new p(t),n.s=l.s):n=new p(r.toString()),s=(o=p.precision)+3;;)if(a=n,c=a.times(a).times(a),u=c.plus(l),n=Ae(u.plus(l).times(a),u.plus(c),s+2,1),qe(a.d).slice(0,s)===(t=qe(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(X(a,o+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(X(n,o+1,1),e=!n.times(n).times(n).eq(l));break}return $=!0,X(n,o,p.rounding,e)};N.decimalPlaces=N.dp=function(){var o,e=this.d,t=NaN;if(e){if(o=e.length-1,t=(o-Ue(this.e/H))*H,o=e[o],o)for(;o%10==0;o/=10)t--;t<0&&(t=0)}return t};N.dividedBy=N.div=function(o){return Ae(this,new this.constructor(o))};N.dividedToIntegerBy=N.divToInt=function(o){var e=this,t=e.constructor;return X(Ae(e,new t(o),0,1,1),t.precision,t.rounding)};N.equals=N.eq=function(o){return this.cmp(o)===0};N.floor=function(){return X(new this.constructor(this),this.e+1,3)};N.greaterThan=N.gt=function(o){return this.cmp(o)>0};N.greaterThanOrEqualTo=N.gte=function(o){var e=this.cmp(o);return e==1||e===0};N.hyperbolicCosine=N.cosh=function(){var o,e,t,n,i,r=this,s=r.constructor,a=new s(1);if(!r.isFinite())return new s(r.s?1/0:NaN);if(r.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=r.d.length,i<32?(o=Math.ceil(i/3),e=(1/jn(4,o)).toString()):(o=16,e="2.3283064365386962890625e-10"),r=tn(s,1,r.times(e),new s(1),!0);for(var c,u=o,l=new s(8);u--;)c=r.times(r),r=a.minus(c.times(l.minus(c.times(l))));return X(r,s.precision=t,s.rounding=n,!0)};N.hyperbolicSine=N.sinh=function(){var o,e,t,n,i=this,r=i.constructor;if(!i.isFinite()||i.isZero())return new r(i);if(e=r.precision,t=r.rounding,r.precision=e+Math.max(i.e,i.sd())+4,r.rounding=1,n=i.d.length,n<3)i=tn(r,2,i,i,!0);else{o=1.4*Math.sqrt(n),o=o>16?16:o|0,i=i.times(1/jn(5,o)),i=tn(r,2,i,i,!0);for(var s,a=new r(5),c=new r(16),u=new r(20);o--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(u))))}return r.precision=e,r.rounding=t,X(i,e,t,!0)};N.hyperbolicTangent=N.tanh=function(){var o,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(o=n.precision,e=n.rounding,n.precision=o+7,n.rounding=1,Ae(t.sinh(),t.cosh(),n.precision=o,n.rounding=e)):new n(t.s)};N.inverseCosine=N.acos=function(){var o=this,e=o.constructor,t=o.abs().cmp(1),n=e.precision,i=e.rounding;return t!==-1?t===0?o.isNeg()?mt(e,n,i):new e(0):new e(NaN):o.isZero()?mt(e,n+4,i).times(.5):(e.precision=n+6,e.rounding=1,o=new e(1).minus(o).div(o.plus(1)).sqrt().atan(),e.precision=n,e.rounding=i,o.times(2))};N.inverseHyperbolicCosine=N.acosh=function(){var o,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(o=n.precision,e=n.rounding,n.precision=o+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,$=!1,t=t.times(t).minus(1).sqrt().plus(t),$=!0,n.precision=o,n.rounding=e,t.ln()):new n(t)};N.inverseHyperbolicSine=N.asinh=function(){var o,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(o=n.precision,e=n.rounding,n.precision=o+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,$=!1,t=t.times(t).plus(1).sqrt().plus(t),$=!0,n.precision=o,n.rounding=e,t.ln())};N.inverseHyperbolicTangent=N.atanh=function(){var o,e,t,n,i=this,r=i.constructor;return i.isFinite()?i.e>=0?new r(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(o=r.precision,e=r.rounding,n=i.sd(),Math.max(n,o)<2*-i.e-1?X(new r(i),o,e,!0):(r.precision=t=n-i.e,i=Ae(i.plus(1),new r(1).minus(i),t+o,1),r.precision=o+4,r.rounding=1,i=i.ln(),r.precision=o,r.rounding=e,i.times(.5))):new r(NaN)};N.inverseSine=N.asin=function(){var o,e,t,n,i=this,r=i.constructor;return i.isZero()?new r(i):(e=i.abs().cmp(1),t=r.precision,n=r.rounding,e!==-1?e===0?(o=mt(r,t+4,n).times(.5),o.s=i.s,o):new r(NaN):(r.precision=t+6,r.rounding=1,i=i.div(new r(1).minus(i.times(i)).sqrt().plus(1)).atan(),r.precision=t,r.rounding=n,i.times(2)))};N.inverseTangent=N.atan=function(){var o,e,t,n,i,r,s,a,c,u=this,l=u.constructor,p=l.precision,m=l.rounding;if(u.isFinite()){if(u.isZero())return new l(u);if(u.abs().eq(1)&&p+4<=Oi)return s=mt(l,p+4,m).times(.25),s.s=u.s,s}else{if(!u.s)return new l(NaN);if(p+4<=Oi)return s=mt(l,p+4,m).times(.5),s.s=u.s,s}for(l.precision=a=p+10,l.rounding=1,t=Math.min(28,a/H+2|0),o=t;o;--o)u=u.div(u.times(u).plus(1).sqrt().plus(1));for($=!1,e=Math.ceil(a/H),n=1,c=u.times(u),s=new l(u),i=u;o!==-1;)if(i=i.times(c),r=s.minus(i.div(n+=2)),i=i.times(c),s=r.plus(i.div(n+=2)),s.d[e]!==void 0)for(o=e;s.d[o]===r.d[o]&&o--;);return t&&(s=s.times(2<<t-1)),$=!0,X(s,l.precision=p,l.rounding=m,!0)};N.isFinite=function(){return!!this.d};N.isInteger=N.isInt=function(){return!!this.d&&Ue(this.e/H)>this.d.length-2};N.isNaN=function(){return!this.s};N.isNegative=N.isNeg=function(){return this.s<0};N.isPositive=N.isPos=function(){return this.s>0};N.isZero=function(){return!!this.d&&this.d[0]===0};N.lessThan=N.lt=function(o){return this.cmp(o)<0};N.lessThanOrEqualTo=N.lte=function(o){return this.cmp(o)<1};N.logarithm=N.log=function(o){var e,t,n,i,r,s,a,c,u=this,l=u.constructor,p=l.precision,m=l.rounding,d=5;if(o==null)o=new l(10),e=!0;else{if(o=new l(o),t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new l(NaN);e=o.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new l(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)r=!0;else{for(i=t[0];i%10===0;)i/=10;r=i!==1}if($=!1,a=p+d,s=Ft(u,a),n=e?Hn(l,a+10):Ft(o,a),c=Ae(s,n,a,1),yn(c.d,i=p,m))do if(a+=10,s=Ft(u,a),n=e?Hn(l,a+10):Ft(o,a),c=Ae(s,n,a,1),!r){+qe(c.d).slice(i+1,i+15)+1==1e14&&(c=X(c,p+1,0));break}while(yn(c.d,i+=10,m));return $=!0,X(c,p,m)};N.minus=N.sub=function(o){var e,t,n,i,r,s,a,c,u,l,p,m,d=this,b=d.constructor;if(o=new b(o),!d.d||!o.d)return!d.s||!o.s?o=new b(NaN):d.d?o.s=-o.s:o=new b(o.d||d.s!==o.s?d:NaN),o;if(d.s!=o.s)return o.s=-o.s,d.plus(o);if(u=d.d,m=o.d,a=b.precision,c=b.rounding,!u[0]||!m[0]){if(m[0])o.s=-o.s;else if(u[0])o=new b(d);else return new b(c===3?-0:0);return $?X(o,a,c):o}if(t=Ue(o.e/H),l=Ue(d.e/H),u=u.slice(),r=l-t,r){for(p=r<0,p?(e=u,r=-r,s=m.length):(e=m,t=l,s=u.length),n=Math.max(Math.ceil(a/H),s)+2,r>n&&(r=n,e.length=1),e.reverse(),n=r;n--;)e.push(0);e.reverse()}else{for(n=u.length,s=m.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=m[n]){p=u[n]<m[n];break}r=0}for(p&&(e=u,u=m,m=e,o.s=-o.s),s=u.length,n=m.length-s;n>0;--n)u[s++]=0;for(n=m.length;n>r;){if(u[--n]<m[n]){for(i=n;i&&u[--i]===0;)u[i]=st-1;--u[i],u[n]+=st}u[n]-=m[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--t;return u[0]?(o.d=u,o.e=Zn(u,t),$?X(o,a,c):o):new b(c===3?-0:0)};N.modulo=N.mod=function(o){var e,t=this,n=t.constructor;return o=new n(o),!t.d||!o.s||o.d&&!o.d[0]?new n(NaN):!o.d||t.d&&!t.d[0]?X(new n(t),n.precision,n.rounding):($=!1,n.modulo==9?(e=Ae(t,o.abs(),0,3,1),e.s*=o.s):e=Ae(t,o,0,n.modulo,1),e=e.times(o),$=!0,t.minus(e))};N.naturalExponential=N.exp=function(){return Fi(this)};N.naturalLogarithm=N.ln=function(){return Ft(this)};N.negated=N.neg=function(){var o=new this.constructor(this);return o.s=-o.s,X(o)};N.plus=N.add=function(o){var e,t,n,i,r,s,a,c,u,l,p=this,m=p.constructor;if(o=new m(o),!p.d||!o.d)return!p.s||!o.s?o=new m(NaN):p.d||(o=new m(o.d||p.s===o.s?p:NaN)),o;if(p.s!=o.s)return o.s=-o.s,p.minus(o);if(u=p.d,l=o.d,a=m.precision,c=m.rounding,!u[0]||!l[0])return l[0]||(o=new m(p)),$?X(o,a,c):o;if(r=Ue(p.e/H),n=Ue(o.e/H),u=u.slice(),i=r-n,i){for(i<0?(t=u,i=-i,s=l.length):(t=l,n=r,s=u.length),r=Math.ceil(a/H),s=r>s?r+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=l.length,s-i<0&&(i=s,t=l,l=u,u=t),e=0;i;)e=(u[--i]=u[i]+l[i]+e)/st|0,u[i]%=st;for(e&&(u.unshift(e),++n),s=u.length;u[--s]==0;)u.pop();return o.d=u,o.e=Zn(u,n),$?X(o,a,c):o};N.precision=N.sd=function(o){var e,t=this;if(o!==void 0&&o!==!!o&&o!==1&&o!==0)throw Error(Mt+o);return t.d?(e=zo(t.d),o&&t.e+1>e&&(e=t.e+1)):e=NaN,e};N.round=function(){var o=this,e=o.constructor;return X(new e(o),o.e+1,e.rounding)};N.sine=N.sin=function(){var o,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(o=n.precision,e=n.rounding,n.precision=o+Math.max(t.e,t.sd())+H,n.rounding=1,t=Ns(n,Zo(n,t)),n.precision=o,n.rounding=e,X(ht>2?t.neg():t,o,e,!0)):new n(NaN)};N.squareRoot=N.sqrt=function(){var o,e,t,n,i,r,s=this,a=s.d,c=s.e,u=s.s,l=s.constructor;if(u!==1||!a||!a[0])return new l(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for($=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=qe(a),(e.length+c)%2==0&&(e+="0"),u=Math.sqrt(e),c=Ue((c+1)/2)-(c<0||c%2),u==1/0?e="5e"+c:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+c),n=new l(e)):n=new l(u.toString()),t=(c=l.precision)+3;;)if(r=n,n=r.plus(Ae(s,r,t+2,1)).times(.5),qe(r.d).slice(0,t)===(e=qe(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!i&&e=="4999"){if(!i&&(X(r,c+1,0),r.times(r).eq(s))){n=r;break}t+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(X(n,c+1,1),o=!n.times(n).eq(s));break}return $=!0,X(n,c,l.rounding,o)};N.tangent=N.tan=function(){var o,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(o=n.precision,e=n.rounding,n.precision=o+10,n.rounding=1,t=t.sin(),t.s=1,t=Ae(t,new n(1).minus(t.times(t)).sqrt(),o+10,0),n.precision=o,n.rounding=e,X(ht==2||ht==4?t.neg():t,o,e,!0)):new n(NaN)};N.times=N.mul=function(o){var e,t,n,i,r,s,a,c,u,l=this,p=l.constructor,m=l.d,d=(o=new p(o)).d;if(o.s*=l.s,!m||!m[0]||!d||!d[0])return new p(!o.s||m&&!m[0]&&!d||d&&!d[0]&&!m?NaN:!m||!d?o.s/0:o.s*0);for(t=Ue(l.e/H)+Ue(o.e/H),c=m.length,u=d.length,c<u&&(r=m,m=d,d=r,s=c,c=u,u=s),r=[],s=c+u,n=s;n--;)r.push(0);for(n=u;--n>=0;){for(e=0,i=c+n;i>n;)a=r[i]+d[n]*m[i-n-1]+e,r[i--]=a%st|0,e=a/st|0;r[i]=(r[i]+e)%st|0}for(;!r[--s];)r.pop();return e?++t:r.shift(),o.d=r,o.e=Zn(r,t),$?X(o,p.precision,p.rounding):o};N.toBinary=function(o,e){return Mi(this,2,o,e)};N.toDecimalPlaces=N.toDP=function(o,e){var t=this,n=t.constructor;return t=new n(t),o===void 0?t:(Ye(o,0,vt),e===void 0?e=n.rounding:Ye(e,0,8),X(t,o+t.e+1,e))};N.toExponential=function(o,e){var t,n=this,i=n.constructor;return o===void 0?t=pt(n,!0):(Ye(o,0,vt),e===void 0?e=i.rounding:Ye(e,0,8),n=X(new i(n),o+1,e),t=pt(n,!0,o+1)),n.isNeg()&&!n.isZero()?"-"+t:t};N.toFixed=function(o,e){var t,n,i=this,r=i.constructor;return o===void 0?t=pt(i):(Ye(o,0,vt),e===void 0?e=r.rounding:Ye(e,0,8),n=X(new r(i),o+i.e+1,e),t=pt(n,!1,o+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};N.toFraction=function(o){var e,t,n,i,r,s,a,c,u,l,p,m,d=this,b=d.d,f=d.constructor;if(!b)return new f(d);if(u=t=new f(1),n=c=new f(0),e=new f(n),r=e.e=zo(b)-d.e-1,s=r%H,e.d[0]=ve(10,s<0?H+s:s),o==null)o=r>0?e:u;else{if(a=new f(o),!a.isInt()||a.lt(u))throw Error(Mt+a);o=a.gt(e)?r>0?e:u:a}for($=!1,a=new f(qe(b)),l=f.precision,f.precision=r=b.length*H*2;p=Ae(a,e,0,1,1),i=t.plus(p.times(n)),i.cmp(o)!=1;)t=n,n=i,i=u,u=c.plus(p.times(i)),c=i,i=e,e=a.minus(p.times(i)),a=i;return i=Ae(o.minus(t),n,0,1,1),c=c.plus(i.times(u)),t=t.plus(i.times(n)),c.s=u.s=d.s,m=Ae(u,n,r,1).minus(d).abs().cmp(Ae(c,t,r,1).minus(d).abs())<1?[u,n]:[c,t],f.precision=l,$=!0,m};N.toHexadecimal=N.toHex=function(o,e){return Mi(this,16,o,e)};N.toNearest=function(o,e){var t=this,n=t.constructor;if(t=new n(t),o==null){if(!t.d)return t;o=new n(1),e=n.rounding}else{if(o=new n(o),e===void 0?e=n.rounding:Ye(e,0,8),!t.d)return o.s?t:o;if(!o.d)return o.s&&(o.s=t.s),o}return o.d[0]?($=!1,t=Ae(t,o,0,e,1).times(o),$=!0,X(t)):(o.s=t.s,t=o),t};N.toNumber=function(){return+this};N.toOctal=function(o,e){return Mi(this,8,o,e)};N.toPower=N.pow=function(o){var e,t,n,i,r,s,a=this,c=a.constructor,u=+(o=new c(o));if(!a.d||!o.d||!a.d[0]||!o.d[0])return new c(ve(+a,u));if(a=new c(a),a.eq(1))return a;if(n=c.precision,r=c.rounding,o.eq(1))return X(a,n,r);if(e=Ue(o.e/H),e>=o.d.length-1&&(t=u<0?-u:u)<=xs)return i=Yo(c,a,t,n),o.s<0?new c(1).div(i):X(i,n,r);if(s=a.s,s<0){if(e<o.d.length-1)return new c(NaN);if((o.d[e]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=ve(+a,u),e=t==0||!isFinite(t)?Ue(u*(Math.log("0."+qe(a.d))/Math.LN10+a.e+1)):new c(t+"").e,e>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):($=!1,c.rounding=a.s=1,t=Math.min(12,(e+"").length),i=Fi(o.times(Ft(a,n+t)),n),i.d&&(i=X(i,n+5,1),yn(i.d,n,r)&&(e=n+10,i=X(Fi(o.times(Ft(a,e+t)),e),e+5,1),+qe(i.d).slice(n+1,n+15)+1==1e14&&(i=X(i,n+1,0)))),i.s=s,$=!0,c.rounding=r,X(i,n,r))};N.toPrecision=function(o,e){var t,n=this,i=n.constructor;return o===void 0?t=pt(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Ye(o,1,vt),e===void 0?e=i.rounding:Ye(e,0,8),n=X(new i(n),o,e),t=pt(n,o<=n.e||n.e<=i.toExpNeg,o)),n.isNeg()&&!n.isZero()?"-"+t:t};N.toSignificantDigits=N.toSD=function(o,e){var t=this,n=t.constructor;return o===void 0?(o=n.precision,e=n.rounding):(Ye(o,1,vt),e===void 0?e=n.rounding:Ye(e,0,8)),X(new n(t),o,e)};N.toString=function(){var o=this,e=o.constructor,t=pt(o,o.e<=e.toExpNeg||o.e>=e.toExpPos);return o.isNeg()&&!o.isZero()?"-"+t:t};N.truncated=N.trunc=function(){return X(new this.constructor(this),this.e+1,1)};N.valueOf=N.toJSON=function(){var o=this,e=o.constructor,t=pt(o,o.e<=e.toExpNeg||o.e>=e.toExpPos);return o.isNeg()?"-"+t:t};function qe(o){var e,t,n,i=o.length-1,r="",s=o[0];if(i>0){for(r+=s,e=1;e<i;e++)n=o[e]+"",t=H-n.length,t&&(r+=Ot(t)),r+=n;s=o[e],n=s+"",t=H-n.length,t&&(r+=Ot(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return r+s}function Ye(o,e,t){if(o!==~~o||o<e||o>t)throw Error(Mt+o)}function yn(o,e,t,n){var i,r,s,a;for(r=o[0];r>=10;r/=10)--e;return--e<0?(e+=H,i=0):(i=Math.ceil((e+1)/H),e%=H),r=ve(10,H-e),a=o[i]%r|0,n==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==r||t>3&&a+1==r/2)&&(o[i+1]/r/100|0)==ve(10,e-2)-1||(a==r/2||a==0)&&(o[i+1]/r/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==r||!n&&t>3&&a+1==r/2)&&(o[i+1]/r/1e3|0)==ve(10,e-3)-1,s}function Un(o,e,t){for(var n,i=[0],r,s=0,a=o.length;s<a;){for(r=i.length;r--;)i[r]*=e;for(i[0]+=Li.indexOf(o.charAt(s++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Ks(o,e){var t,n,i;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),i=(1/jn(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),o.precision+=t,e=tn(o,1,e.times(i),new o(1));for(var r=t;r--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return o.precision-=t,e}var Ae=function(){function o(n,i,r){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%r|0,a=s/r|0;return a&&n.unshift(a),n}function e(n,i,r,s){var a,c;if(r!=s)c=r>s?1:-1;else for(a=c=0;a<r;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function t(n,i,r,s){for(var a=0;r--;)n[r]-=a,a=n[r]<i[r]?1:0,n[r]=a*s+n[r]-i[r];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,r,s,a,c){var u,l,p,m,d,b,f,y,g,w,k,B,h,A,T,x,K,I,R,W,L=n.constructor,U=n.s==i.s?1:-1,V=n.d,F=i.d;if(!V||!V[0]||!F||!F[0])return new L(!n.s||!i.s||(V?F&&V[0]==F[0]:!F)?NaN:V&&V[0]==0||!F?U*0:U/0);for(c?(d=1,l=n.e-i.e):(c=st,d=H,l=Ue(n.e/d)-Ue(i.e/d)),R=F.length,K=V.length,g=new L(U),w=g.d=[],p=0;F[p]==(V[p]||0);p++);if(F[p]>(V[p]||0)&&l--,r==null?(A=r=L.precision,s=L.rounding):a?A=r+(n.e-i.e)+1:A=r,A<0)w.push(1),b=!0;else{if(A=A/d+2|0,p=0,R==1){for(m=0,F=F[0],A++;(p<K||m)&&A--;p++)T=m*c+(V[p]||0),w[p]=T/F|0,m=T%F|0;b=m||p<K}else{for(m=c/(F[0]+1)|0,m>1&&(F=o(F,m,c),V=o(V,m,c),R=F.length,K=V.length),x=R,k=V.slice(0,R),B=k.length;B<R;)k[B++]=0;W=F.slice(),W.unshift(0),I=F[0],F[1]>=c/2&&++I;do m=0,u=e(F,k,R,B),u<0?(h=k[0],R!=B&&(h=h*c+(k[1]||0)),m=h/I|0,m>1?(m>=c&&(m=c-1),f=o(F,m,c),y=f.length,B=k.length,u=e(f,k,y,B),u==1&&(m--,t(f,R<y?W:F,y,c))):(m==0&&(u=m=1),f=F.slice()),y=f.length,y<B&&f.unshift(0),t(k,f,B,c),u==-1&&(B=k.length,u=e(F,k,R,B),u<1&&(m++,t(k,R<B?W:F,B,c))),B=k.length):u===0&&(m++,k=[0]),w[p++]=m,u&&k[0]?k[B++]=V[x]||0:(k=[V[x]],B=1);while((x++<K||k[0]!==void 0)&&A--);b=k[0]!==void 0}w[0]||w.shift()}if(d==1)g.e=l,Do=b;else{for(p=1,m=w[0];m>=10;m/=10)p++;g.e=p+l*d-1,X(g,a?r+g.e+1:r,s,b)}return g}}();function X(o,e,t,n){var i,r,s,a,c,u,l,p,m,d=o.constructor;e:if(e!=null){if(p=o.d,!p)return o;for(i=1,a=p[0];a>=10;a/=10)i++;if(r=e-i,r<0)r+=H,s=e,l=p[m=0],c=l/ve(10,i-s-1)%10|0;else if(m=Math.ceil((r+1)/H),a=p.length,m>=a)if(n){for(;a++<=m;)p.push(0);l=c=0,i=1,r%=H,s=r-H+1}else break e;else{for(l=a=p[m],i=1;a>=10;a/=10)i++;r%=H,s=r-H+i,c=s<0?0:l/ve(10,i-s-1)%10|0}if(n=n||e<0||p[m+1]!==void 0||(s<0?l:l%ve(10,i-s-1)),u=t<4?(c||n)&&(t==0||t==(o.s<0?3:2)):c>5||c==5&&(t==4||n||t==6&&(r>0?s>0?l/ve(10,i-s):0:p[m-1])%10&1||t==(o.s<0?8:7)),e<1||!p[0])return p.length=0,u?(e-=o.e+1,p[0]=ve(10,(H-e%H)%H),o.e=-e||0):p[0]=o.e=0,o;if(r==0?(p.length=m,a=1,m--):(p.length=m+1,a=ve(10,H-r),p[m]=s>0?(l/ve(10,i-s)%ve(10,s)|0)*a:0),u)for(;;)if(m==0){for(r=1,s=p[0];s>=10;s/=10)r++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;r!=a&&(o.e++,p[0]==st&&(p[0]=1));break}else{if(p[m]+=a,p[m]!=st)break;p[m--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop()}return $&&(o.e>d.maxE?(o.d=null,o.e=NaN):o.e<d.minE&&(o.e=0,o.d=[0])),o}function pt(o,e,t){if(!o.isFinite())return Qo(o);var n,i=o.e,r=qe(o.d),s=r.length;return e?(t&&(n=t-s)>0?r=r.charAt(0)+"."+r.slice(1)+Ot(n):s>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(o.e<0?"e":"e+")+o.e):i<0?(r="0."+Ot(-i-1)+r,t&&(n=t-s)>0&&(r+=Ot(n))):i>=s?(r+=Ot(i+1-s),t&&(n=t-i-1)>0&&(r=r+"."+Ot(n))):((n=i+1)<s&&(r=r.slice(0,n)+"."+r.slice(n)),t&&(n=t-s)>0&&(i+1===s&&(r+="."),r+=Ot(n))),r}function Zn(o,e){var t=o[0];for(e*=H;t>=10;t/=10)e++;return e}function Hn(o,e,t){if(e>Ss)throw $=!0,t&&(o.precision=t),Error(qo);return X(new o(zn),e,1,!0)}function mt(o,e,t){if(e>Oi)throw Error(qo);return X(new o(Yn),e,t,!0)}function zo(o){var e=o.length-1,t=e*H+1;if(e=o[e],e){for(;e%10==0;e/=10)t--;for(e=o[0];e>=10;e/=10)t++}return t}function Ot(o){for(var e="";o--;)e+="0";return e}function Yo(o,e,t,n){var i,r=new o(1),s=Math.ceil(n/H+4);for($=!1;;){if(t%2&&(r=r.times(e),Vo(r.d,s)&&(i=!0)),t=Ue(t/2),t===0){t=r.d.length-1,i&&r.d[t]===0&&++r.d[t];break}e=e.times(e),Vo(e.d,s)}return $=!0,r}function Wo(o){return o.d[o.d.length-1]&1}function Ho(o,e,t){for(var n,i,r=new o(e[0]),s=0;++s<e.length;){if(i=new o(e[s]),!i.s){r=i;break}n=r.cmp(i),(n===t||n===0&&r.s===t)&&(r=i)}return r}function Fi(o,e){var t,n,i,r,s,a,c,u=0,l=0,p=0,m=o.constructor,d=m.rounding,b=m.precision;if(!o.d||!o.d[0]||o.e>17)return new m(o.d?o.d[0]?o.s<0?0:1/0:1:o.s?o.s<0?0:o:0/0);for(e==null?($=!1,c=b):c=e,a=new m(.03125);o.e>-2;)o=o.times(a),p+=5;for(n=Math.log(ve(2,p))/Math.LN10*2+5|0,c+=n,t=r=s=new m(1),m.precision=c;;){if(r=X(r.times(o),c,1),t=t.times(++l),a=s.plus(Ae(r,t,c,1)),qe(a.d).slice(0,c)===qe(s.d).slice(0,c)){for(i=p;i--;)s=X(s.times(s),c,1);if(e==null)if(u<3&&yn(s.d,c-n,d,u))m.precision=c+=10,t=r=a=new m(1),l=0,u++;else return X(s,m.precision=b,d,$=!0);else return m.precision=b,s}s=a}}function Ft(o,e){var t,n,i,r,s,a,c,u,l,p,m,d=1,b=10,f=o,y=f.d,g=f.constructor,w=g.rounding,k=g.precision;if(f.s<0||!y||!y[0]||!f.e&&y[0]==1&&y.length==1)return new g(y&&!y[0]?-1/0:f.s!=1?NaN:y?0:f);if(e==null?($=!1,l=k):l=e,g.precision=l+=b,t=qe(y),n=t.charAt(0),Math.abs(r=f.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)f=f.times(o),t=qe(f.d),n=t.charAt(0),d++;r=f.e,n>1?(f=new g("0."+t),r++):f=new g(n+"."+t.slice(1))}else return u=Hn(g,l+2,k).times(r+""),f=Ft(new g(n+"."+t.slice(1)),l-b).plus(u),g.precision=k,e==null?X(f,k,w,$=!0):f;for(p=f,c=s=f=Ae(f.minus(1),f.plus(1),l,1),m=X(f.times(f),l,1),i=3;;){if(s=X(s.times(m),l,1),u=c.plus(Ae(s,new g(i),l,1)),qe(u.d).slice(0,l)===qe(c.d).slice(0,l))if(c=c.times(2),r!==0&&(c=c.plus(Hn(g,l+2,k).times(r+""))),c=Ae(c,new g(d),l,1),e==null)if(yn(c.d,l-b,w,a))g.precision=l+=b,u=s=f=Ae(p.minus(1),p.plus(1),l,1),m=X(f.times(f),l,1),i=a=1;else return X(c,g.precision=k,w,$=!0);else return g.precision=k,c;c=u,i+=2}}function Qo(o){return String(o.s*o.s/0)}function Xn(o,e){var t,n,i;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(n,i),e){if(i-=n,o.e=t=t-n-1,o.d=[],n=(t+1)%H,t<0&&(n+=H),n<i){for(n&&o.d.push(+e.slice(0,n)),i-=H;n<i;)o.d.push(+e.slice(n,n+=H));e=e.slice(n),n=H-e.length}else n-=i;for(;n--;)e+="0";o.d.push(+e),$&&(o.e>o.constructor.maxE?(o.d=null,o.e=NaN):o.e<o.constructor.minE&&(o.e=0,o.d=[0]))}else o.e=0,o.d=[0];return o}function Cs(o,e){var t,n,i,r,s,a,c,u,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Xo.test(e))return Xn(o,e)}else if(e==="Infinity"||e==="NaN")return+e||(o.s=NaN),o.e=NaN,o.d=null,o;if(Ts.test(e))t=16,e=e.toLowerCase();else if(Bs.test(e))t=2;else if(Is.test(e))t=8;else throw Error(Mt+e);for(r=e.search(/p/i),r>0?(c=+e.slice(r+1),e=e.substring(2,r)):e=e.slice(2),r=e.indexOf("."),s=r>=0,n=o.constructor,s&&(e=e.replace(".",""),a=e.length,r=a-r,i=Yo(n,new n(t),r,r*2)),u=Un(e,t,st),l=u.length-1,r=l;u[r]===0;--r)u.pop();return r<0?new n(o.s*0):(o.e=Zn(u,l),o.d=u,$=!1,s&&(o=Ae(o,i,a*4)),c&&(o=o.times(Math.abs(c)<54?ve(2,c):gn.pow(2,c))),$=!0,o)}function Ns(o,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:tn(o,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/jn(5,t)),e=tn(o,2,e,e);for(var i,r=new o(5),s=new o(16),a=new o(20);t--;)i=e.times(e),e=e.times(r.plus(i.times(s.times(i).minus(a))));return e}function tn(o,e,t,n,i){var r,s,a,c,u=1,l=o.precision,p=Math.ceil(l/H);for($=!1,c=t.times(t),a=new o(n);;){if(s=Ae(a.times(c),new o(e++*e++),l,1),a=i?n.plus(s):n.minus(s),n=Ae(s.times(c),new o(e++*e++),l,1),s=a.plus(n),s.d[p]!==void 0){for(r=p;s.d[r]===a.d[r]&&r--;);if(r==-1)break}r=a,a=n,n=s,s=r,u++}return $=!0,s.d.length=p+1,s}function jn(o,e){for(var t=o;--e;)t*=o;return t}function Zo(o,e){var t,n=e.s<0,i=mt(o,o.precision,1),r=i.times(.5);if(e=e.abs(),e.lte(r))return ht=n?4:1,e;if(t=e.divToInt(i),t.isZero())ht=n?3:2;else{if(e=e.minus(t.times(i)),e.lte(r))return ht=Wo(t)?n?2:3:n?4:1,e;ht=Wo(t)?n?1:4:n?3:2}return e.minus(i).abs()}function Mi(o,e,t,n){var i,r,s,a,c,u,l,p,m,d=o.constructor,b=t!==void 0;if(b?(Ye(t,1,vt),n===void 0?n=d.rounding:Ye(n,0,8)):(t=d.precision,n=d.rounding),!o.isFinite())l=Qo(o);else{for(l=pt(o),s=l.indexOf("."),b?(i=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):i=e,s>=0&&(l=l.replace(".",""),m=new d(1),m.e=l.length-s,m.d=Un(pt(m),10,i),m.e=m.d.length),p=Un(l,10,i),r=c=p.length;p[--c]==0;)p.pop();if(!p[0])l=b?"0p+0":"0";else{if(s<0?r--:(o=new d(o),o.d=p,o.e=r,o=Ae(o,m,t,n,0,i),p=o.d,r=o.e,u=Do),s=p[t],a=i/2,u=u||p[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(o.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[t-1]&1||n===(o.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++r,p.unshift(1));for(c=p.length;!p[c-1];--c);for(s=0,l="";s<c;s++)l+=Li.charAt(p[s]);if(b){if(c>1)if(e==16||e==8){for(s=e==16?4:3,--c;c%s;c++)l+="0";for(p=Un(l,i,e),c=p.length;!p[c-1];--c);for(s=1,l="1.";s<c;s++)l+=Li.charAt(p[s])}else l=l.charAt(0)+"."+l.slice(1);l=l+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)l="0"+l;l="0."+l}else if(++r>c)for(r-=c;r--;)l+="0";else r<c&&(l=l.slice(0,r)+"."+l.slice(r))}l=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return o.s<0?"-"+l:l}function Vo(o,e){if(o.length>e)return o.length=e,!0}function Ls(o){return new this(o).abs()}function Rs(o){return new this(o).acos()}function Os(o){return new this(o).acosh()}function Fs(o,e){return new this(o).plus(e)}function Ms(o){return new this(o).asin()}function vs(o){return new this(o).asinh()}function Es(o){return new this(o).atan()}function Ws(o){return new this(o).atanh()}function Vs(o,e){o=new this(o),e=new this(e);var t,n=this.precision,i=this.rounding,r=n+4;return!o.s||!e.s?t=new this(NaN):!o.d&&!e.d?(t=mt(this,r,1).times(e.s>0?.25:.75),t.s=o.s):!e.d||o.isZero()?(t=e.s<0?mt(this,n,i):new this(0),t.s=o.s):!o.d||e.isZero()?(t=mt(this,r,1).times(.5),t.s=o.s):e.s<0?(this.precision=r,this.rounding=1,t=this.atan(Ae(o,e,r,1)),e=mt(this,r,1),this.precision=n,this.rounding=i,t=o.s<0?t.minus(e):t.plus(e)):t=this.atan(Ae(o,e,r,1)),t}function _s(o){return new this(o).cbrt()}function Ds(o){return X(o=new this(o),o.e+1,2)}function qs(o,e,t){return new this(o).clamp(e,t)}function Gs(o){if(!o||typeof o!="object")throw Error(Qn+"Object expected");var e,t,n,i=o.defaults===!0,r=["precision",1,vt,"rounding",0,8,"toExpNeg",-en,0,"toExpPos",0,en,"maxE",0,en,"minE",-en,0,"modulo",0,9];for(e=0;e<r.length;e+=3)if(t=r[e],i&&(this[t]=Ri[t]),(n=o[t])!==void 0)if(Ue(n)===n&&n>=r[e+1]&&n<=r[e+2])this[t]=n;else throw Error(Mt+t+": "+n);if(t="crypto",i&&(this[t]=Ri[t]),(n=o[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Go);else this[t]=!1;else throw Error(Mt+t+": "+n);return this}function Us(o){return new this(o).cos()}function Xs(o){return new this(o).cosh()}function jo(o){var e,t,n;function i(r){var s,a,c,u=this;if(!(u instanceof i))return new i(r);if(u.constructor=i,_o(r)){u.s=r.s,$?!r.d||r.e>i.maxE?(u.e=NaN,u.d=null):r.e<i.minE?(u.e=0,u.d=[0]):(u.e=r.e,u.d=r.d.slice()):(u.e=r.e,u.d=r.d?r.d.slice():r.d);return}if(c=typeof r,c==="number"){if(r===0){u.s=1/r<0?-1:1,u.e=0,u.d=[0];return}if(r<0?(r=-r,u.s=-1):u.s=1,r===~~r&&r<1e7){for(s=0,a=r;a>=10;a/=10)s++;$?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[r]):(u.e=s,u.d=[r]);return}if(r*0!==0){r||(u.s=NaN),u.e=NaN,u.d=null;return}return Xn(u,r.toString())}if(c==="string")return(a=r.charCodeAt(0))===45?(r=r.slice(1),u.s=-1):(a===43&&(r=r.slice(1)),u.s=1),Xo.test(r)?Xn(u,r):Cs(u,r);if(c==="bigint")return r<0?(r=-r,u.s=-1):u.s=1,Xn(u,r.toString());throw Error(Mt+r)}if(i.prototype=N,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=Gs,i.clone=jo,i.isDecimal=_o,i.abs=Ls,i.acos=Rs,i.acosh=Os,i.add=Fs,i.asin=Ms,i.asinh=vs,i.atan=Es,i.atanh=Ws,i.atan2=Vs,i.cbrt=_s,i.ceil=Ds,i.clamp=qs,i.cos=Us,i.cosh=Xs,i.div=zs,i.exp=Ys,i.floor=Hs,i.hypot=Qs,i.ln=Zs,i.log=js,i.log10=Js,i.log2=$s,i.max=ea,i.min=ta,i.mod=na,i.mul=ia,i.pow=oa,i.random=ra,i.round=sa,i.sign=aa,i.sin=ua,i.sinh=ca,i.sqrt=la,i.sub=ma,i.sum=pa,i.tan=da,i.tanh=fa,i.trunc=ba,o===void 0&&(o={}),o&&o.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)o.hasOwnProperty(t=n[e++])||(o[t]=this[t]);return i.config(o),i}function zs(o,e){return new this(o).div(e)}function Ys(o){return new this(o).exp()}function Hs(o){return X(o=new this(o),o.e+1,3)}function Qs(){var o,e,t=new this(0);for($=!1,o=0;o<arguments.length;)if(e=new this(arguments[o++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return $=!0,new this(1/0);t=e}return $=!0,t.sqrt()}function _o(o){return o instanceof gn||o&&o.toStringTag===Uo||!1}function Zs(o){return new this(o).ln()}function js(o,e){return new this(o).log(e)}function $s(o){return new this(o).log(2)}function Js(o){return new this(o).log(10)}function ea(){return Ho(this,arguments,-1)}function ta(){return Ho(this,arguments,1)}function na(o,e){return new this(o).mod(e)}function ia(o,e){return new this(o).mul(e)}function oa(o,e){return new this(o).pow(e)}function ra(o){var e,t,n,i,r=0,s=new this(1),a=[];if(o===void 0?o=this.precision:Ye(o,1,vt),n=Math.ceil(o/H),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));r<n;)i=e[r],i>=429e7?e[r]=crypto.getRandomValues(new Uint32Array(1))[0]:a[r++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);r<n;)i=e[r]+(e[r+1]<<8)+(e[r+2]<<16)+((e[r+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(e,r):(a.push(i%1e7),r+=4);r=n/4}else throw Error(Go);else for(;r<n;)a[r++]=Math.random()*1e7|0;for(n=a[--r],o%=H,n&&o&&(i=ve(10,H-o),a[r]=(n/i|0)*i);a[r]===0;r--)a.pop();if(r<0)t=0,a=[0];else{for(t=-1;a[0]===0;t-=H)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<H&&(t-=H-n)}return s.e=t,s.d=a,s}function sa(o){return X(o=new this(o),o.e+1,this.rounding)}function aa(o){return o=new this(o),o.d?o.d[0]?o.s:0*o.s:o.s||NaN}function ua(o){return new this(o).sin()}function ca(o){return new this(o).sinh()}function la(o){return new this(o).sqrt()}function ma(o,e){return new this(o).sub(e)}function pa(){var o=0,e=arguments,t=new this(e[o]);for($=!1;t.s&&++o<e.length;)t=t.plus(e[o]);return $=!0,X(t,this.precision,this.rounding)}function da(o){return new this(o).tan()}function fa(o){return new this(o).tanh()}function ba(o){return X(o=new this(o),o.e+1,1)}N[Symbol.for("nodejs.util.inspect.custom")]=N.toString;N[Symbol.toStringTag]="Decimal";var gn=N.constructor=jo(Ri);zn=new gn(zn);Yn=new gn(Yn);var S=gn;import{PublicKey as er}from"@solana/web3.js";import{get as $o,set as ya}from"lodash";var vi=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let t=e.map(n=>typeof n=="object"?JSON.stringify(n):n).join(", ");throw new Error(t)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},Jo={},ga={};function ke(o){let e=$o(Jo,o);if(!e){let t=$o(ga,o);e=new vi({name:o,logLevel:t}),ya(Jo,o,e)}return e}import{MINT_SIZE as Pa,TOKEN_PROGRAM_ID as Aa,getTransferFeeConfig as ka,unpackMint as wa}from"@solana/spl-token";var Ei=ke("Raydium_accountInfo_util");async function Bt(o,e,t){let{batchRequest:n,commitment:i="confirmed",chunkCount:r=100}=G({batchRequest:!1},t),s=Wi(e,r),a=new Array(s.length).fill([]);if(n){let c=s.map(p=>{let m=o._buildArgs([p.map(d=>d.toBase58())],i,"base64");return{methodName:"getMultipleAccounts",args:m}}),u=Wi(c,10);a=(await(await Promise.all(u.map(async p=>await o._rpcBatchRequest(p)))).flat()).map(p=>(p.error&&Ei.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${p.error.message}`),p.result.value.map(m=>{if(m){let{data:d,executable:b,lamports:f,owner:y,rentEpoch:g}=m;return d.length!==2&&d[1]!=="base64"&&Ei.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(d[0],"base64"),executable:b,lamports:f,owner:new er(y),rentEpoch:g}}return null})))}else try{a=await Promise.all(s.map(c=>o.getMultipleAccountsInfo(c,i)))}catch(c){c instanceof Error&&Ei.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${c.message}`)}return a.flat()}async function Et(o,e,t){let n=await Bt(o,e.map(i=>i.pubkey),t);return e.map((i,r)=>Z(G({},i),{accountInfo:n[r]}))}async function Vi({connection:o,mints:e,config:t}){var r,s,a;if(e.length===0)return{};let n=await Et(o,e.map(c=>({pubkey:dt(c)})),t),i={};for(let c of n){if(!c.accountInfo||c.accountInfo.data.length<Pa){console.log("invalid mint account",c.pubkey.toBase58());continue}let u=wa(c.pubkey,c.accountInfo,(r=c.accountInfo)==null?void 0:r.owner);i[c.pubkey.toString()]=Z(G({},u),{programId:((s=c.accountInfo)==null?void 0:s.owner)||Aa,feeConfig:(a=ka(u))!=null?a:void 0})}return i[er.default.toBase58()]=i[Fe.toBase58()],i}import bt from"bn.js";import Ca from"big.js";import ei from"bn.js";import ha from"toformat";var Ba=ha,Pn=Ba;import Jn from"big.js";import Ia from"bn.js";import xa from"decimal.js-light";import An from"bn.js";var tr=9007199254740991;function we(o){let e=ke("Raydium_parseBigNumberish");if(o instanceof An)return o;if(typeof o=="string"){if(o.match(/^-?[0-9]+$/))return new An(o);e.logWithError(`invalid BigNumberish string: ${o}`)}return typeof o=="number"?(o%1&&e.logWithError(`BigNumberish number underflow: ${o}`),(o>=tr||o<=-tr)&&e.logWithError(`BigNumberish number overflow: ${o}`),new An(String(o))):typeof o=="bigint"?new An(o.toString()):(e.error(`invalid BigNumberish value: ${o}`),new An(0))}var $n=ke("module/fraction"),_i=Pn(Jn),kn=Pn(xa),Sa={[0]:kn.ROUND_DOWN,[1]:kn.ROUND_HALF_UP,[2]:kn.ROUND_UP},Ka={[0]:Jn.roundDown,[1]:Jn.roundHalfUp,[2]:Jn.roundUp},pe=class{constructor(e,t=new Ia(1)){this.numerator=we(e),this.denominator=we(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new pe(this.denominator,this.numerator)}add(e){let t=e instanceof pe?e:new pe(we(e));return this.denominator.eq(t.denominator)?new pe(this.numerator.add(t.numerator),this.denominator):new pe(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof pe?e:new pe(we(e));return this.denominator.eq(t.denominator)?new pe(this.numerator.sub(t.numerator),this.denominator):new pe(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof pe?e:new pe(we(e));return new pe(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof pe?e:new pe(we(e));return new pe(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||$n.logWithError(`${e} is not an integer.`),e<=0&&$n.logWithError(`${e} is not positive.`),kn.set({precision:e+1,rounding:Sa[n]});let i=new kn(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return i.toFormat(i.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||$n.logWithError(`${e} is not an integer.`),e<0&&$n.logWithError(`${e} is negative.`),_i.DP=e,_i.RM=Ka[n]||1,new _i(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var Na=ke("Raydium_amount"),nr=Pn(Ca);function La(o,e){let t="0",n="0";if(o.includes(".")){let i=o.split(".");i.length===2?([t,n]=i,n=n.padEnd(e,"0")):Na.logWithError(`invalid number string, num: ${o}`)}else t=o;return[t,n.slice(0,e)||n]}var Te=class extends pe{constructor(t,n,i=!0,r){let s=new ei(0),a=Di.pow(new ei(t.decimals));if(i)s=we(n);else{let c=new ei(0),u=new ei(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,p]=La(n.toString(),t.decimals);c=we(l),u=we(p)}c=c.mul(a),s=c.add(u)}super(s,a);this.logger=ke(r||"TokenAmount"),this.token=t}get raw(){return this.numerator}isZero(){return this.raw.isZero()}gt(t){return this.token.equals(t.token)||this.logger.logWithError("gt token not equals"),this.raw.gt(t.raw)}lt(t){return this.token.equals(t.token)||this.logger.logWithError("lt token not equals"),this.raw.lt(t.raw)}add(t){return this.token.equals(t.token)||this.logger.logWithError("add token not equals"),new Te(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new Te(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,i=0){return super.toSignificant(t,n,i)}toFixed(t=this.token.decimals,n,i=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,i)}toExact(t={groupSeparator:""}){return nr.DP=this.token.decimals,new nr(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};import{PublicKey as Ra}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as ir}from"@solana/spl-token";var qi={chainId:101,address:Ra.default.toBase58(),programId:ir.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},ft={chainId:101,address:"So11111111111111111111111111111111111111112",programId:ir.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};import{PublicKey as Xi}from"@solana/web3.js";import{PublicKey as Ke,SystemProgram as or,SYSVAR_RENT_PUBKEY as Oa}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as Fa}from"@solana/spl-token";function O({pubkey:o,isSigner:e=!1,isWritable:t=!0}){return{pubkey:o,isWritable:t,isSigner:e}}var ml=[O({pubkey:Fa,isWritable:!1}),O({pubkey:or.programId,isWritable:!1}),O({pubkey:Oa,isWritable:!1})];function Gi({publicKey:o,transformSol:e}){let t=Ui(o.toString());if(t instanceof Ke)return e&&t.equals(wn)?Fe:t;if(e&&t.toString()===wn.toBase58())return Fe;if(typeof t=="string"){if(t===Ke.default.toBase58())return Ke.default;try{return new Ke(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function Ui(o){try{return new Ke(o)}catch{return o}}var ti=new Ke("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),nn=new Ke("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),at=new Ke("SysvarRent111111111111111111111111111111111"),pl=new Ke("SysvarC1ock11111111111111111111111111111111"),Tt=new Ke("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),dl=new Ke("Sysvar1nstructions1111111111111111111111111"),Ma=or.programId,fl=new Ke("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),bl=new Ke("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),yl=new Ke("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),gl=new Ke("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Pl=new Ke("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Al=new Ke("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),kl=new Ke("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),wl=new Ke("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),hl=new Ke("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Bl=new Ke("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Tl=new Ke("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Fe=new Ke("So11111111111111111111111111111111111111112"),wn=Ke.default;function dt(o){return Gi({publicKey:o,transformSol:!0})}var zi=class{constructor({mint:e,decimals:t,symbol:n,name:i,skipMint:r=!1,isToken2022:s=!1}){if(e===wn.toBase58()||e instanceof Xi&&wn.equals(e)){this.decimals=ft.decimals,this.symbol=ft.symbol,this.name=ft.name,this.mint=new Xi(ft.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=i||e.toString().substring(0,6),this.mint=r?Xi.default:Gi({publicKey:e}),this.isToken2022=s}equals(e){return this===e?!0:this.mint.equals(e.mint)}},je=zi;je.WSOL=new zi(Z(G({},ft),{mint:ft.address}));var Yi=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},ni=Yi;ni.SOL=new Yi(qi);import va from"bn.js";var rr=new pe(new va(100)),It=class extends pe{toSignificant(e=5,t,n){return this.mul(rr).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(rr).toFixed(e,t,n)}};var Ea=ke("Raydium_price"),He=class extends pe{constructor(t){let{baseToken:n,quoteToken:i,numerator:r,denominator:s}=t;super(r,s);this.baseToken=n,this.quoteToken=i,this.scalar=new pe(Hi(n.decimals),Hi(i.decimals))}get raw(){return new pe(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new He({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&Ea.logWithError("mul token not equals");let n=super.mul(t);return new He({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,i){return this.adjusted.toSignificant(t,n,i)}toFixed(t=this.quoteToken.decimals,n,i){return this.adjusted.toFixed(t,n,i)}};var sr=new bt(0),Wa=new bt(1),dm=new bt(2),fm=new bt(3),bm=new bt(5),Di=new bt(10),ym=new bt(100),gm=new bt(1e3),Pm=new bt(1e4);function Hi(o){return Di.pow(we(o))}function Qi(o,e,t){return o.mul(e).add(t).sub(new bt(1)).div(t)}function Wi(o,e=1,t=[]){let n=[...o];if(e<=0)return t;for(;n.length;)t.push(n.splice(0,e));return t}import{PublicKey as Xa}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as za}from"@solana/spl-token";import{ComputeBudgetProgram as ar,Keypair as cr,PublicKey as Va,Transaction as lr,TransactionMessage as _a,VersionedTransaction as mr}from"@solana/web3.js";var ie={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",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",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",FarmV4Withdraw:"FarmV4Withdraw",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",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee",TransferTip:"TransferTip"};import{TOKEN_PROGRAM_ID as Da}from"@solana/spl-token";var ur=ke("Raydium_txUtil"),pr=1644;function ii(o){let e=[],t=[];return o.microLamports&&(e.push(ar.setComputeUnitPrice({microLamports:o.microLamports})),t.push(ie.SetComputeUnitPrice)),o.units&&(e.push(ar.setComputeUnitLimit({units:o.units})),t.push(ie.SetComputeUnitLimit)),{instructions:e,instructionTypes:t}}async function on(o,e){var n,i;let t=e!=null?e:"confirmed";return(i=await((n=o.getLatestBlockhash)==null?void 0:n.call(o,{commitment:t})))==null?void 0:i.blockhash}async function oi(o,e){return o.getSignatureStatuses([e]),new Promise((t,n)=>{let i=setTimeout(n,6e4);o.onSignature(e,r=>{if(clearTimeout(i),!r.err){t("");return}n(Object.assign(r.err,{txId:e}))},"confirmed")})}function qa(o,e){o.length<1&&ur.logWithError(`no instructions provided: ${o.toString()}`),e.length<1&&ur.logWithError(`no signers provided:, ${e.toString()}`);let t=new lr;t.recentBlockhash="11111111111111111111111111111111",t.feePayer=e[0],t.add(...o);try{return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64").length<pr}catch{return!1}}function he(o,e){let[t,n]=Va.findProgramAddressSync(o,e);return{publicKey:t,nonce:n}}function hn({instructions:o,payer:e,signers:t}){return qa(o,[e,...t])}function Bn({instructions:o,payer:e,lookupTableAddressAccount:t,recentBlockhash:n=cr.generate().publicKey.toString()}){let r=new _a({payerKey:e,recentBlockhash:n,instructions:o}).compileToV0Message(Object.values(t!=null?t:{}));try{return Buffer.from(new mr(r).serialize()).toString("base64").length<pr}catch{return!1}}var Ga=o=>Buffer.isBuffer(o)?o:o instanceof Uint8Array?Buffer.from(o.buffer,o.byteOffset,o.byteLength):Buffer.from(o),Ua=o=>{let e=o.serialize({requireAllSignatures:!1,verifySignatures:!1});o instanceof mr&&(e=Ga(e));try{return e instanceof Buffer?e.toString("base64"):Buffer.from(e).toString("base64")}catch{return e.toString("base64")}};function Xt(o){let e=[];return o.forEach(t=>{t instanceof lr&&(t.recentBlockhash||(t.recentBlockhash=Da.toBase58()),t.feePayer||(t.feePayer=cr.generate().publicKey)),e.push(Ua(t))}),console.log("simulate tx string:",e),e}function Be(o,e,t){return he([o.toBuffer(),(t!=null?t:za).toBuffer(),e.toBuffer()],new Xa("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}import{PublicKey as z}from"@solana/web3.js";var Vm=new z("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),_m=new z("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),Dm=new z("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),qm=new z("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Gm=new z("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),Um=new z("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Zi=new z("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),dr=new z("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),Xm=new z("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),fr=new z("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),ji=new z("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),Ya=new z("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Ha=new z("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),ri=new z("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),zm=new z("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),Ym=new z("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),Hm=new z("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4r