@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
1 lines • 165 kB
JavaScript
var Er=Object.create;var Ct=Object.defineProperty,vr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptor,Wr=Object.getOwnPropertyDescriptors,Vr=Object.getOwnPropertyNames,li=Object.getOwnPropertySymbols,_r=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable;var mi=(i,e,t)=>e in i?Ct(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,J=(i,e)=>{for(var t in e||(e={}))pi.call(e,t)&&mi(i,t,e[t]);if(li)for(var t of li(e))Dr.call(e,t)&&mi(i,t,e[t]);return i},re=(i,e)=>vr(i,Wr(e));var qr=(i,e)=>{for(var t in e)Ct(i,t,{get:e[t],enumerable:!0})},di=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Vr(e))!pi.call(i,r)&&r!==t&&Ct(i,r,{get:()=>e[r],enumerable:!(n=Fr(e,r))||n.enumerable});return i};var te=(i,e,t)=>(t=i!=null?Er(_r(i)):{},di(e||!i||!i.__esModule?Ct(t,"default",{value:i,enumerable:!0}):t,i)),Gr=i=>di(Ct({},"__esModule",{value:!0}),i);var da={};qr(da,{makeSwapInstruction:()=>Mr,route1Instruction:()=>ua,route2Instruction:()=>ca,routeInstruction:()=>Rr,swapBaseInAutoAccount:()=>la,swapBaseOutAutoAccount:()=>ma});module.exports=Gr(da);var pa=require("@solana/web3.js"),ui=require("@solana/spl-token"),Or=te(require("bn.js"));var At=9e15,lt=1e9,An="0123456789abcdef",Zt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",jt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",wn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-At,maxE:At,crypto:!1},gi,et,X=!0,Jt="[DecimalError] ",ct=Jt+"Invalid argument: ",Pi=Jt+"Precision limit exceeded",ki=Jt+"crypto unavailable",Ai="[object Decimal]",Ce=Math.floor,Ae=Math.pow,Ur=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Xr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,zr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wi=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Xe=1e7,_=7,Qr=9007199254740991,Hr=Zt.length-1,Tn=jt.length-1,T={toStringTag:Ai};T.absoluteValue=T.abs=function(){var i=new this.constructor(this);return i.s<0&&(i.s=1),W(i)};T.ceil=function(){return W(new this.constructor(this),this.e+1,2)};T.clampedTo=T.clamp=function(i,e){var t,n=this,r=n.constructor;if(i=new r(i),e=new r(e),!i.s||!e.s)return new r(NaN);if(i.gt(e))throw Error(ct+e);return t=n.cmp(i),t<0?i:n.cmp(e)>0?e:new r(n)};T.comparedTo=T.cmp=function(i){var e,t,n,r,o=this,a=o.d,s=(i=new o.constructor(i)).d,u=o.s,c=i.s;if(!a||!s)return!u||!c?NaN:u!==c?u:a===s?0:!a^u<0?1:-1;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==i.e)return o.e>i.e^u<0?1:-1;for(n=a.length,r=s.length,e=0,t=n<r?n:r;e<t;++e)if(a[e]!==s[e])return a[e]>s[e]^u<0?1:-1;return n===r?0:n>r^u<0?1:-1};T.cosine=T.cos=function(){var i,e,t=this,n=t.constructor;return t.d?t.d[0]?(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+_,n.rounding=1,t=Zr(n,xi(n,t)),n.precision=i,n.rounding=e,W(et==2||et==3?t.neg():t,i,e,!0)):new n(1):new n(NaN)};T.cubeRoot=T.cbrt=function(){var i,e,t,n,r,o,a,s,u,c,l=this,m=l.constructor;if(!l.isFinite()||l.isZero())return new m(l);for(X=!1,o=l.s*Ae(l.s*l,1/3),!o||Math.abs(o)==1/0?(t=xe(l.d),i=l.e,(o=(i-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Ae(t,1/3),i=Ce((i+1)/3)-(i%3==(i<0?-1:2)),o==1/0?t="5e"+i:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+i),n=new m(t),n.s=l.s):n=new m(o.toString()),a=(i=m.precision)+3;;)if(s=n,u=s.times(s).times(s),c=u.plus(l),n=ae(c.plus(l).times(s),c.plus(u),a+2,1),xe(s.d).slice(0,a)===(t=xe(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!r&&t=="4999"){if(!r&&(W(s,i+1,0),s.times(s).times(s).eq(l))){n=s;break}a+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(W(n,i+1,1),e=!n.times(n).times(n).eq(l));break}return X=!0,W(n,i,m.rounding,e)};T.decimalPlaces=T.dp=function(){var i,e=this.d,t=NaN;if(e){if(i=e.length-1,t=(i-Ce(this.e/_))*_,i=e[i],i)for(;i%10==0;i/=10)t--;t<0&&(t=0)}return t};T.dividedBy=T.div=function(i){return ae(this,new this.constructor(i))};T.dividedToIntegerBy=T.divToInt=function(i){var e=this,t=e.constructor;return W(ae(e,new t(i),0,1,1),t.precision,t.rounding)};T.equals=T.eq=function(i){return this.cmp(i)===0};T.floor=function(){return W(new this.constructor(this),this.e+1,3)};T.greaterThan=T.gt=function(i){return this.cmp(i)>0};T.greaterThanOrEqualTo=T.gte=function(i){var e=this.cmp(i);return e==1||e===0};T.hyperbolicCosine=T.cosh=function(){var i,e,t,n,r,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;t=a.precision,n=a.rounding,a.precision=t+Math.max(o.e,o.sd())+4,a.rounding=1,r=o.d.length,r<32?(i=Math.ceil(r/3),e=(1/en(4,i)).toString()):(i=16,e="2.3283064365386962890625e-10"),o=wt(a,1,o.times(e),new a(1),!0);for(var u,c=i,l=new a(8);c--;)u=o.times(o),o=s.minus(u.times(l.minus(u.times(l))));return W(o,a.precision=t,a.rounding=n,!0)};T.hyperbolicSine=T.sinh=function(){var i,e,t,n,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,t=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,n=r.d.length,n<3)r=wt(o,2,r,r,!0);else{i=1.4*Math.sqrt(n),i=i>16?16:i|0,r=r.times(1/en(5,i)),r=wt(o,2,r,r,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);i--;)a=r.times(r),r=r.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=e,o.rounding=t,W(r,e,t,!0)};T.hyperbolicTangent=T.tanh=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+7,n.rounding=1,ae(t.sinh(),t.cosh(),n.precision=i,n.rounding=e)):new n(t.s)};T.inverseCosine=T.acos=function(){var i,e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,o=t.rounding;return n!==-1?n===0?e.isNeg()?Ue(t,r,o):new t(0):new t(NaN):e.isZero()?Ue(t,r+4,o).times(.5):(t.precision=r+6,t.rounding=1,e=e.asin(),i=Ue(t,r+4,o).times(.5),t.precision=r,t.rounding=o,i.minus(e))};T.inverseHyperbolicCosine=T.acosh=function(){var i,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(i=n.precision,e=n.rounding,n.precision=i+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,X=!1,t=t.times(t).minus(1).sqrt().plus(t),X=!0,n.precision=i,n.rounding=e,t.ln()):new n(t)};T.inverseHyperbolicSine=T.asinh=function(){var i,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,X=!1,t=t.times(t).plus(1).sqrt().plus(t),X=!0,n.precision=i,n.rounding=e,t.ln())};T.inverseHyperbolicTangent=T.atanh=function(){var i,e,t,n,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(i=o.precision,e=o.rounding,n=r.sd(),Math.max(n,i)<2*-r.e-1?W(new o(r),i,e,!0):(o.precision=t=n-r.e,r=ae(r.plus(1),new o(1).minus(r),t+i,1),o.precision=i+4,o.rounding=1,r=r.ln(),o.precision=i,o.rounding=e,r.times(.5))):new o(NaN)};T.inverseSine=T.asin=function(){var i,e,t,n,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),t=o.precision,n=o.rounding,e!==-1?e===0?(i=Ue(o,t+4,n).times(.5),i.s=r.s,i):new o(NaN):(o.precision=t+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,r.times(2)))};T.inverseTangent=T.atan=function(){var i,e,t,n,r,o,a,s,u,c=this,l=c.constructor,m=l.precision,d=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&m+4<=Tn)return a=Ue(l,m+4,d).times(.25),a.s=c.s,a}else{if(!c.s)return new l(NaN);if(m+4<=Tn)return a=Ue(l,m+4,d).times(.5),a.s=c.s,a}for(l.precision=s=m+10,l.rounding=1,t=Math.min(28,s/_+2|0),i=t;i;--i)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(X=!1,e=Math.ceil(s/_),n=1,u=c.times(c),a=new l(c),r=c;i!==-1;)if(r=r.times(u),o=a.minus(r.div(n+=2)),r=r.times(u),a=o.plus(r.div(n+=2)),a.d[e]!==void 0)for(i=e;a.d[i]===o.d[i]&&i--;);return t&&(a=a.times(2<<t-1)),X=!0,W(a,l.precision=m,l.rounding=d,!0)};T.isFinite=function(){return!!this.d};T.isInteger=T.isInt=function(){return!!this.d&&Ce(this.e/_)>this.d.length-2};T.isNaN=function(){return!this.s};T.isNegative=T.isNeg=function(){return this.s<0};T.isPositive=T.isPos=function(){return this.s>0};T.isZero=function(){return!!this.d&&this.d[0]===0};T.lessThan=T.lt=function(i){return this.cmp(i)<0};T.lessThanOrEqualTo=T.lte=function(i){return this.cmp(i)<1};T.logarithm=T.log=function(i){var e,t,n,r,o,a,s,u,c=this,l=c.constructor,m=l.precision,d=l.rounding,p=5;if(i==null)i=new l(10),e=!0;else{if(i=new l(i),t=i.d,i.s<0||!t||!t[0]||i.eq(1))return new l(NaN);e=i.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new l(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)o=!0;else{for(r=t[0];r%10===0;)r/=10;o=r!==1}if(X=!1,s=m+p,a=ut(c,s),n=e?Yt(l,s+10):ut(i,s),u=ae(a,n,s,1),Nt(u.d,r=m,d))do if(s+=10,a=ut(c,s),n=e?Yt(l,s+10):ut(i,s),u=ae(a,n,s,1),!o){+xe(u.d).slice(r+1,r+15)+1==1e14&&(u=W(u,m+1,0));break}while(Nt(u.d,r+=10,d));return X=!0,W(u,m,d)};T.minus=T.sub=function(i){var e,t,n,r,o,a,s,u,c,l,m,d,p=this,g=p.constructor;if(i=new g(i),!p.d||!i.d)return!p.s||!i.s?i=new g(NaN):p.d?i.s=-i.s:i=new g(i.d||p.s!==i.s?p:NaN),i;if(p.s!=i.s)return i.s=-i.s,p.plus(i);if(c=p.d,d=i.d,s=g.precision,u=g.rounding,!c[0]||!d[0]){if(d[0])i.s=-i.s;else if(c[0])i=new g(p);else return new g(u===3?-0:0);return X?W(i,s,u):i}if(t=Ce(i.e/_),l=Ce(p.e/_),c=c.slice(),o=l-t,o){for(m=o<0,m?(e=c,o=-o,a=d.length):(e=d,t=l,a=c.length),n=Math.max(Math.ceil(s/_),a)+2,o>n&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for(n=c.length,a=d.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(c[n]!=d[n]){m=c[n]<d[n];break}o=0}for(m&&(e=c,c=d,d=e,i.s=-i.s),a=c.length,n=d.length-a;n>0;--n)c[a++]=0;for(n=d.length;n>o;){if(c[--n]<d[n]){for(r=n;r&&c[--r]===0;)c[r]=Xe-1;--c[r],c[n]+=Xe}c[n]-=d[n]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(i.d=c,i.e=$t(c,t),X?W(i,s,u):i):new g(u===3?-0:0)};T.modulo=T.mod=function(i){var e,t=this,n=t.constructor;return i=new n(i),!t.d||!i.s||i.d&&!i.d[0]?new n(NaN):!i.d||t.d&&!t.d[0]?W(new n(t),n.precision,n.rounding):(X=!1,n.modulo==9?(e=ae(t,i.abs(),0,3,1),e.s*=i.s):e=ae(t,i,0,n.modulo,1),e=e.times(i),X=!0,t.minus(e))};T.naturalExponential=T.exp=function(){return hn(this)};T.naturalLogarithm=T.ln=function(){return ut(this)};T.negated=T.neg=function(){var i=new this.constructor(this);return i.s=-i.s,W(i)};T.plus=T.add=function(i){var e,t,n,r,o,a,s,u,c,l,m=this,d=m.constructor;if(i=new d(i),!m.d||!i.d)return!m.s||!i.s?i=new d(NaN):m.d||(i=new d(i.d||m.s===i.s?m:NaN)),i;if(m.s!=i.s)return i.s=-i.s,m.minus(i);if(c=m.d,l=i.d,s=d.precision,u=d.rounding,!c[0]||!l[0])return l[0]||(i=new d(m)),X?W(i,s,u):i;if(o=Ce(m.e/_),n=Ce(i.e/_),c=c.slice(),r=o-n,r){for(r<0?(t=c,r=-r,a=l.length):(t=l,n=o,a=c.length),o=Math.ceil(s/_),a=o>a?o+1:a+1,r>a&&(r=a,t.length=1),t.reverse();r--;)t.push(0);t.reverse()}for(a=c.length,r=l.length,a-r<0&&(r=a,t=l,l=c,c=t),e=0;r;)e=(c[--r]=c[r]+l[r]+e)/Xe|0,c[r]%=Xe;for(e&&(c.unshift(e),++n),a=c.length;c[--a]==0;)c.pop();return i.d=c,i.e=$t(c,n),X?W(i,s,u):i};T.precision=T.sd=function(i){var e,t=this;if(i!==void 0&&i!==!!i&&i!==1&&i!==0)throw Error(ct+i);return t.d?(e=Ti(t.d),i&&t.e+1>e&&(e=t.e+1)):e=NaN,e};T.round=function(){var i=this,e=i.constructor;return W(new e(i),i.e+1,e.rounding)};T.sine=T.sin=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+Math.max(t.e,t.sd())+_,n.rounding=1,t=Yr(n,xi(n,t)),n.precision=i,n.rounding=e,W(et>2?t.neg():t,i,e,!0)):new n(NaN)};T.squareRoot=T.sqrt=function(){var i,e,t,n,r,o,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(c!==1||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(X=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=xe(s),(e.length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=Ce((u+1)/2)-(u<0||u%2),c==1/0?e="5e"+u:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+u),n=new l(e)):n=new l(c.toString()),t=(u=l.precision)+3;;)if(o=n,n=o.plus(ae(a,o,t+2,1)).times(.5),xe(o.d).slice(0,t)===(e=xe(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!r&&e=="4999"){if(!r&&(W(o,u+1,0),o.times(o).eq(a))){n=o;break}t+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(W(n,u+1,1),i=!n.times(n).eq(a));break}return X=!0,W(n,u,l.rounding,i)};T.tangent=T.tan=function(){var i,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(i=n.precision,e=n.rounding,n.precision=i+10,n.rounding=1,t=t.sin(),t.s=1,t=ae(t,new n(1).minus(t.times(t)).sqrt(),i+10,0),n.precision=i,n.rounding=e,W(et==2||et==4?t.neg():t,i,e,!0)):new n(NaN)};T.times=T.mul=function(i){var e,t,n,r,o,a,s,u,c,l=this,m=l.constructor,d=l.d,p=(i=new m(i)).d;if(i.s*=l.s,!d||!d[0]||!p||!p[0])return new m(!i.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:!d||!p?i.s/0:i.s*0);for(t=Ce(l.e/_)+Ce(i.e/_),u=d.length,c=p.length,u<c&&(o=d,d=p,p=o,a=u,u=c,c=a),o=[],a=u+c,n=a;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,r=u+n;r>n;)s=o[r]+p[n]*d[r-n-1]+e,o[r--]=s%Xe|0,e=s/Xe|0;o[r]=(o[r]+e)%Xe|0}for(;!o[--a];)o.pop();return e?++t:o.shift(),i.d=o,i.e=$t(o,t),X?W(i,m.precision,m.rounding):i};T.toBinary=function(i,e){return Bn(this,2,i,e)};T.toDecimalPlaces=T.toDP=function(i,e){var t=this,n=t.constructor;return t=new n(t),i===void 0?t:(Me(i,0,lt),e===void 0?e=n.rounding:Me(e,0,8),W(t,i+t.e+1,e))};T.toExponential=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=Ze(n,!0):(Me(i,0,lt),e===void 0?e=r.rounding:Me(e,0,8),n=W(new r(n),i+1,e),t=Ze(n,!0,i+1)),n.isNeg()&&!n.isZero()?"-"+t:t};T.toFixed=function(i,e){var t,n,r=this,o=r.constructor;return i===void 0?t=Ze(r):(Me(i,0,lt),e===void 0?e=o.rounding:Me(e,0,8),n=W(new o(r),i+r.e+1,e),t=Ze(n,!1,i+n.e+1)),r.isNeg()&&!r.isZero()?"-"+t:t};T.toFraction=function(i){var e,t,n,r,o,a,s,u,c,l,m,d,p=this,g=p.d,f=p.constructor;if(!g)return new f(p);if(c=t=new f(1),n=u=new f(0),e=new f(n),o=e.e=Ti(g)-p.e-1,a=o%_,e.d[0]=Ae(10,a<0?_+a:a),i==null)i=o>0?e:c;else{if(s=new f(i),!s.isInt()||s.lt(c))throw Error(ct+s);i=s.gt(e)?o>0?e:c:s}for(X=!1,s=new f(xe(g)),l=f.precision,f.precision=o=g.length*_*2;m=ae(s,e,0,1,1),r=t.plus(m.times(n)),r.cmp(i)!=1;)t=n,n=r,r=c,c=u.plus(m.times(r)),u=r,r=e,e=s.minus(m.times(r)),s=r;return r=ae(i.minus(t),n,0,1,1),u=u.plus(r.times(c)),t=t.plus(r.times(n)),u.s=c.s=p.s,d=ae(c,n,o,1).minus(p).abs().cmp(ae(u,t,o,1).minus(p).abs())<1?[c,n]:[u,t],f.precision=l,X=!0,d};T.toHexadecimal=T.toHex=function(i,e){return Bn(this,16,i,e)};T.toNearest=function(i,e){var t=this,n=t.constructor;if(t=new n(t),i==null){if(!t.d)return t;i=new n(1),e=n.rounding}else{if(i=new n(i),e===void 0?e=n.rounding:Me(e,0,8),!t.d)return i.s?t:i;if(!i.d)return i.s&&(i.s=t.s),i}return i.d[0]?(X=!1,t=ae(t,i,0,e,1).times(i),X=!0,W(t)):(i.s=t.s,t=i),t};T.toNumber=function(){return+this};T.toOctal=function(i,e){return Bn(this,8,i,e)};T.toPower=T.pow=function(i){var e,t,n,r,o,a,s=this,u=s.constructor,c=+(i=new u(i));if(!s.d||!i.d||!s.d[0]||!i.d[0])return new u(Ae(+s,c));if(s=new u(s),s.eq(1))return s;if(n=u.precision,o=u.rounding,i.eq(1))return W(s,n,o);if(e=Ce(i.e/_),e>=i.d.length-1&&(t=c<0?-c:c)<=Qr)return r=hi(u,s,t,n),i.s<0?new u(1).div(r):W(r,n,o);if(a=s.s,a<0){if(e<i.d.length-1)return new u(NaN);if((i.d[e]&1)==0&&(a=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=a,s}return t=Ae(+s,c),e=t==0||!isFinite(t)?Ce(c*(Math.log("0."+xe(s.d))/Math.LN10+s.e+1)):new u(t+"").e,e>u.maxE+1||e<u.minE-1?new u(e>0?a/0:0):(X=!1,u.rounding=s.s=1,t=Math.min(12,(e+"").length),r=hn(i.times(ut(s,n+t)),n),r.d&&(r=W(r,n+5,1),Nt(r.d,n,o)&&(e=n+10,r=W(hn(i.times(ut(s,e+t)),e),e+5,1),+xe(r.d).slice(n+1,n+15)+1==1e14&&(r=W(r,n+1,0)))),r.s=a,X=!0,u.rounding=o,W(r,n,o))};T.toPrecision=function(i,e){var t,n=this,r=n.constructor;return i===void 0?t=Ze(n,n.e<=r.toExpNeg||n.e>=r.toExpPos):(Me(i,1,lt),e===void 0?e=r.rounding:Me(e,0,8),n=W(new r(n),i,e),t=Ze(n,i<=n.e||n.e<=r.toExpNeg,i)),n.isNeg()&&!n.isZero()?"-"+t:t};T.toSignificantDigits=T.toSD=function(i,e){var t=this,n=t.constructor;return i===void 0?(i=n.precision,e=n.rounding):(Me(i,1,lt),e===void 0?e=n.rounding:Me(e,0,8)),W(new n(t),i,e)};T.toString=function(){var i=this,e=i.constructor,t=Ze(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()&&!i.isZero()?"-"+t:t};T.truncated=T.trunc=function(){return W(new this.constructor(this),this.e+1,1)};T.valueOf=T.toJSON=function(){var i=this,e=i.constructor,t=Ze(i,i.e<=e.toExpNeg||i.e>=e.toExpPos);return i.isNeg()?"-"+t:t};function xe(i){var e,t,n,r=i.length-1,o="",a=i[0];if(r>0){for(o+=a,e=1;e<r;e++)n=i[e]+"",t=_-n.length,t&&(o+=at(t)),o+=n;a=i[e],n=a+"",t=_-n.length,t&&(o+=at(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}function Me(i,e,t){if(i!==~~i||i<e||i>t)throw Error(ct+i)}function Nt(i,e,t,n){var r,o,a,s;for(o=i[0];o>=10;o/=10)--e;return--e<0?(e+=_,r=0):(r=Math.ceil((e+1)/_),e%=_),o=Ae(10,_-e),s=i[r]%o|0,n==null?e<3?(e==0?s=s/100|0:e==1&&(s=s/10|0),a=t<4&&s==99999||t>3&&s==49999||s==5e4||s==0):a=(t<4&&s+1==o||t>3&&s+1==o/2)&&(i[r+1]/o/100|0)==Ae(10,e-2)-1||(s==o/2||s==0)&&(i[r+1]/o/100|0)==0:e<4?(e==0?s=s/1e3|0:e==1?s=s/100|0:e==2&&(s=s/10|0),a=(n||t<4)&&s==9999||!n&&t>3&&s==4999):a=((n||t<4)&&s+1==o||!n&&t>3&&s+1==o/2)&&(i[r+1]/o/1e3|0)==Ae(10,e-3)-1,a}function Ht(i,e,t){for(var n,r=[0],o,a=0,s=i.length;a<s;){for(o=r.length;o--;)r[o]*=e;for(r[0]+=An.indexOf(i.charAt(a++)),n=0;n<r.length;n++)r[n]>t-1&&(r[n+1]===void 0&&(r[n+1]=0),r[n+1]+=r[n]/t|0,r[n]%=t)}return r.reverse()}function Zr(i,e){var t,n,r;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),r=(1/en(4,t)).toString()):(t=16,r="2.3283064365386962890625e-10"),i.precision+=t,e=wt(i,1,e.times(r),new i(1));for(var o=t;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return i.precision-=t,e}var ae=function(){function i(n,r,o){var a,s=0,u=n.length;for(n=n.slice();u--;)a=n[u]*r+s,n[u]=a%o|0,s=a/o|0;return s&&n.unshift(s),n}function e(n,r,o,a){var s,u;if(o!=a)u=o>a?1:-1;else for(s=u=0;s<o;s++)if(n[s]!=r[s]){u=n[s]>r[s]?1:-1;break}return u}function t(n,r,o,a){for(var s=0;o--;)n[o]-=s,s=n[o]<r[o]?1:0,n[o]=s*a+n[o]-r[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,r,o,a,s,u){var c,l,m,d,p,g,f,b,y,I,h,C,v,B,N,L,q,x,F,ye,ue=n.constructor,he=n.s==r.s?1:-1,fe=n.d,ie=r.d;if(!fe||!fe[0]||!ie||!ie[0])return new ue(!n.s||!r.s||(fe?ie&&fe[0]==ie[0]:!ie)?NaN:fe&&fe[0]==0||!ie?he*0:he/0);for(u?(p=1,l=n.e-r.e):(u=Xe,p=_,l=Ce(n.e/p)-Ce(r.e/p)),F=ie.length,q=fe.length,y=new ue(he),I=y.d=[],m=0;ie[m]==(fe[m]||0);m++);if(ie[m]>(fe[m]||0)&&l--,o==null?(B=o=ue.precision,a=ue.rounding):s?B=o+(n.e-r.e)+1:B=o,B<0)I.push(1),g=!0;else{if(B=B/p+2|0,m=0,F==1){for(d=0,ie=ie[0],B++;(m<q||d)&&B--;m++)N=d*u+(fe[m]||0),I[m]=N/ie|0,d=N%ie|0;g=d||m<q}else{for(d=u/(ie[0]+1)|0,d>1&&(ie=i(ie,d,u),fe=i(fe,d,u),F=ie.length,q=fe.length),L=F,h=fe.slice(0,F),C=h.length;C<F;)h[C++]=0;ye=ie.slice(),ye.unshift(0),x=ie[0],ie[1]>=u/2&&++x;do d=0,c=e(ie,h,F,C),c<0?(v=h[0],F!=C&&(v=v*u+(h[1]||0)),d=v/x|0,d>1?(d>=u&&(d=u-1),f=i(ie,d,u),b=f.length,C=h.length,c=e(f,h,b,C),c==1&&(d--,t(f,F<b?ye:ie,b,u))):(d==0&&(c=d=1),f=ie.slice()),b=f.length,b<C&&f.unshift(0),t(h,f,C,u),c==-1&&(C=h.length,c=e(ie,h,F,C),c<1&&(d++,t(h,F<C?ye:ie,C,u))),C=h.length):c===0&&(d++,h=[0]),I[m++]=d,c&&h[0]?h[C++]=fe[L]||0:(h=[fe[L]],C=1);while((L++<q||h[0]!==void 0)&&B--);g=h[0]!==void 0}I[0]||I.shift()}if(p==1)y.e=l,gi=g;else{for(m=1,d=I[0];d>=10;d/=10)m++;y.e=m+l*p-1,W(y,s?o+y.e+1:o,a,g)}return y}}();function W(i,e,t,n){var r,o,a,s,u,c,l,m,d,p=i.constructor;e:if(e!=null){if(m=i.d,!m)return i;for(r=1,s=m[0];s>=10;s/=10)r++;if(o=e-r,o<0)o+=_,a=e,l=m[d=0],u=l/Ae(10,r-a-1)%10|0;else if(d=Math.ceil((o+1)/_),s=m.length,d>=s)if(n){for(;s++<=d;)m.push(0);l=u=0,r=1,o%=_,a=o-_+1}else break e;else{for(l=s=m[d],r=1;s>=10;s/=10)r++;o%=_,a=o-_+r,u=a<0?0:l/Ae(10,r-a-1)%10|0}if(n=n||e<0||m[d+1]!==void 0||(a<0?l:l%Ae(10,r-a-1)),c=t<4?(u||n)&&(t==0||t==(i.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(o>0?a>0?l/Ae(10,r-a):0:m[d-1])%10&1||t==(i.s<0?8:7)),e<1||!m[0])return m.length=0,c?(e-=i.e+1,m[0]=Ae(10,(_-e%_)%_),i.e=-e||0):m[0]=i.e=0,i;if(o==0?(m.length=d,s=1,d--):(m.length=d+1,s=Ae(10,_-o),m[d]=a>0?(l/Ae(10,r-a)%Ae(10,a)|0)*s:0),c)for(;;)if(d==0){for(o=1,a=m[0];a>=10;a/=10)o++;for(a=m[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(i.e++,m[0]==Xe&&(m[0]=1));break}else{if(m[d]+=s,m[d]!=Xe)break;m[d--]=0,s=1}for(o=m.length;m[--o]===0;)m.pop()}return X&&(i.e>p.maxE?(i.d=null,i.e=NaN):i.e<p.minE&&(i.e=0,i.d=[0])),i}function Ze(i,e,t){if(!i.isFinite())return Bi(i);var n,r=i.e,o=xe(i.d),a=o.length;return e?(t&&(n=t-a)>0?o=o.charAt(0)+"."+o.slice(1)+at(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i.e<0?"e":"e+")+i.e):r<0?(o="0."+at(-r-1)+o,t&&(n=t-a)>0&&(o+=at(n))):r>=a?(o+=at(r+1-a),t&&(n=t-r-1)>0&&(o=o+"."+at(n))):((n=r+1)<a&&(o=o.slice(0,n)+"."+o.slice(n)),t&&(n=t-a)>0&&(r+1===a&&(o+="."),o+=at(n))),o}function $t(i,e){var t=i[0];for(e*=_;t>=10;t/=10)e++;return e}function Yt(i,e,t){if(e>Hr)throw X=!0,t&&(i.precision=t),Error(Pi);return W(new i(Zt),e,1,!0)}function Ue(i,e,t){if(e>Tn)throw Error(Pi);return W(new i(jt),e,t,!0)}function Ti(i){var e=i.length-1,t=e*_+1;if(e=i[e],e){for(;e%10==0;e/=10)t--;for(e=i[0];e>=10;e/=10)t++}return t}function at(i){for(var e="";i--;)e+="0";return e}function hi(i,e,t,n){var r,o=new i(1),a=Math.ceil(n/_+4);for(X=!1;;){if(t%2&&(o=o.times(e),bi(o.d,a)&&(r=!0)),t=Ce(t/2),t===0){t=o.d.length-1,r&&o.d[t]===0&&++o.d[t];break}e=e.times(e),bi(e.d,a)}return X=!0,o}function fi(i){return i.d[i.d.length-1]&1}function Ii(i,e,t){for(var n,r=new i(e[0]),o=0;++o<e.length;)if(n=new i(e[o]),n.s)r[t](n)&&(r=n);else{r=n;break}return r}function hn(i,e){var t,n,r,o,a,s,u,c=0,l=0,m=0,d=i.constructor,p=d.rounding,g=d.precision;if(!i.d||!i.d[0]||i.e>17)return new d(i.d?i.d[0]?i.s<0?0:1/0:1:i.s?i.s<0?0:i:0/0);for(e==null?(X=!1,u=g):u=e,s=new d(.03125);i.e>-2;)i=i.times(s),m+=5;for(n=Math.log(Ae(2,m))/Math.LN10*2+5|0,u+=n,t=o=a=new d(1),d.precision=u;;){if(o=W(o.times(i),u,1),t=t.times(++l),s=a.plus(ae(o,t,u,1)),xe(s.d).slice(0,u)===xe(a.d).slice(0,u)){for(r=m;r--;)a=W(a.times(a),u,1);if(e==null)if(c<3&&Nt(a.d,u-n,p,c))d.precision=u+=10,t=o=s=new d(1),l=0,c++;else return W(a,d.precision=g,p,X=!0);else return d.precision=g,a}a=s}}function ut(i,e){var t,n,r,o,a,s,u,c,l,m,d,p=1,g=10,f=i,b=f.d,y=f.constructor,I=y.rounding,h=y.precision;if(f.s<0||!b||!b[0]||!f.e&&b[0]==1&&b.length==1)return new y(b&&!b[0]?-1/0:f.s!=1?NaN:b?0:f);if(e==null?(X=!1,l=h):l=e,y.precision=l+=g,t=xe(b),n=t.charAt(0),Math.abs(o=f.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)f=f.times(i),t=xe(f.d),n=t.charAt(0),p++;o=f.e,n>1?(f=new y("0."+t),o++):f=new y(n+"."+t.slice(1))}else return c=Yt(y,l+2,h).times(o+""),f=ut(new y(n+"."+t.slice(1)),l-g).plus(c),y.precision=h,e==null?W(f,h,I,X=!0):f;for(m=f,u=a=f=ae(f.minus(1),f.plus(1),l,1),d=W(f.times(f),l,1),r=3;;){if(a=W(a.times(d),l,1),c=u.plus(ae(a,new y(r),l,1)),xe(c.d).slice(0,l)===xe(u.d).slice(0,l))if(u=u.times(2),o!==0&&(u=u.plus(Yt(y,l+2,h).times(o+""))),u=ae(u,new y(p),l,1),e==null)if(Nt(u.d,l-g,I,s))y.precision=l+=g,c=a=f=ae(m.minus(1),m.plus(1),l,1),d=W(f.times(f),l,1),r=s=1;else return W(u,y.precision=h,I,X=!0);else return y.precision=h,u;u=c,r+=2}}function Bi(i){return String(i.s*i.s/0)}function In(i,e){var t,n,r;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(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(n,r),e){if(r-=n,i.e=t=t-n-1,i.d=[],n=(t+1)%_,t<0&&(n+=_),n<r){for(n&&i.d.push(+e.slice(0,n)),r-=_;n<r;)i.d.push(+e.slice(n,n+=_));e=e.slice(n),n=_-e.length}else n-=r;for(;n--;)e+="0";i.d.push(+e),X&&(i.e>i.constructor.maxE?(i.d=null,i.e=NaN):i.e<i.constructor.minE&&(i.e=0,i.d=[0]))}else i.e=0,i.d=[0];return i}function jr(i,e){var t,n,r,o,a,s,u,c,l;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),wi.test(e))return In(i,e)}else if(e==="Infinity"||e==="NaN")return+e||(i.s=NaN),i.e=NaN,i.d=null,i;if(Xr.test(e))t=16,e=e.toLowerCase();else if(Ur.test(e))t=2;else if(zr.test(e))t=8;else throw Error(ct+e);for(o=e.search(/p/i),o>0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),a=o>=0,n=i.constructor,a&&(e=e.replace(".",""),s=e.length,o=s-o,r=hi(n,new n(t),o,o*2)),c=Ht(e,t,Xe),l=c.length-1,o=l;c[o]===0;--o)c.pop();return o<0?new n(i.s*0):(i.e=$t(c,l),i.d=c,X=!1,a&&(i=ae(i,r,s*4)),u&&(i=i.times(Math.abs(u)<54?Ae(2,u):Lt.pow(2,u))),X=!0,i)}function Yr(i,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:wt(i,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/en(5,t)),e=wt(i,2,e,e);for(var r,o=new i(5),a=new i(16),s=new i(20);t--;)r=e.times(e),e=e.times(o.plus(r.times(a.times(r).minus(s))));return e}function wt(i,e,t,n,r){var o,a,s,u,c=1,l=i.precision,m=Math.ceil(l/_);for(X=!1,u=t.times(t),s=new i(n);;){if(a=ae(s.times(u),new i(e++*e++),l,1),s=r?n.plus(a):n.minus(a),n=ae(a.times(u),new i(e++*e++),l,1),a=s.plus(n),a.d[m]!==void 0){for(o=m;a.d[o]===s.d[o]&&o--;);if(o==-1)break}o=s,s=n,n=a,a=o,c++}return X=!0,a.d.length=m+1,a}function en(i,e){for(var t=i;--e;)t*=i;return t}function xi(i,e){var t,n=e.s<0,r=Ue(i,i.precision,1),o=r.times(.5);if(e=e.abs(),e.lte(o))return et=n?4:1,e;if(t=e.divToInt(r),t.isZero())et=n?3:2;else{if(e=e.minus(t.times(r)),e.lte(o))return et=fi(t)?n?2:3:n?4:1,e;et=fi(t)?n?1:4:n?3:2}return e.minus(r).abs()}function Bn(i,e,t,n){var r,o,a,s,u,c,l,m,d,p=i.constructor,g=t!==void 0;if(g?(Me(t,1,lt),n===void 0?n=p.rounding:Me(n,0,8)):(t=p.precision,n=p.rounding),!i.isFinite())l=Bi(i);else{for(l=Ze(i),a=l.indexOf("."),g?(r=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):r=e,a>=0&&(l=l.replace(".",""),d=new p(1),d.e=l.length-a,d.d=Ht(Ze(d),10,r),d.e=d.d.length),m=Ht(l,10,r),o=u=m.length;m[--u]==0;)m.pop();if(!m[0])l=g?"0p+0":"0";else{if(a<0?o--:(i=new p(i),i.d=m,i.e=o,i=ae(i,d,t,n,0,r),m=i.d,o=i.e,c=gi),a=m[t],s=r/2,c=c||m[t+1]!==void 0,c=n<4?(a!==void 0||c)&&(n===0||n===(i.s<0?3:2)):a>s||a===s&&(n===4||c||n===6&&m[t-1]&1||n===(i.s<0?8:7)),m.length=t,c)for(;++m[--t]>r-1;)m[t]=0,t||(++o,m.unshift(1));for(u=m.length;!m[u-1];--u);for(a=0,l="";a<u;a++)l+=An.charAt(m[a]);if(g){if(u>1)if(e==16||e==8){for(a=e==16?4:3,--u;u%a;u++)l+="0";for(m=Ht(l,r,e),u=m.length;!m[u-1];--u);for(a=1,l="1.";a<u;a++)l+=An.charAt(m[a])}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=(e==16?"0x":e==2?"0b":e==8?"0o":"")+l}return i.s<0?"-"+l:l}function bi(i,e){if(i.length>e)return i.length=e,!0}function Jr(i){return new this(i).abs()}function $r(i){return new this(i).acos()}function eo(i){return new this(i).acosh()}function to(i,e){return new this(i).plus(e)}function no(i){return new this(i).asin()}function io(i){return new this(i).asinh()}function ro(i){return new this(i).atan()}function oo(i){return new this(i).atanh()}function so(i,e){i=new this(i),e=new this(e);var t,n=this.precision,r=this.rounding,o=n+4;return!i.s||!e.s?t=new this(NaN):!i.d&&!e.d?(t=Ue(this,o,1).times(e.s>0?.25:.75),t.s=i.s):!e.d||i.isZero()?(t=e.s<0?Ue(this,n,r):new this(0),t.s=i.s):!i.d||e.isZero()?(t=Ue(this,o,1).times(.5),t.s=i.s):e.s<0?(this.precision=o,this.rounding=1,t=this.atan(ae(i,e,o,1)),e=Ue(this,o,1),this.precision=n,this.rounding=r,t=i.s<0?t.minus(e):t.plus(e)):t=this.atan(ae(i,e,o,1)),t}function ao(i){return new this(i).cbrt()}function uo(i){return W(i=new this(i),i.e+1,2)}function co(i,e,t){return new this(i).clamp(e,t)}function lo(i){if(!i||typeof i!="object")throw Error(Jt+"Object expected");var e,t,n,r=i.defaults===!0,o=["precision",1,lt,"rounding",0,8,"toExpNeg",-At,0,"toExpPos",0,At,"maxE",0,At,"minE",-At,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(t=o[e],r&&(this[t]=wn[t]),(n=i[t])!==void 0)if(Ce(n)===n&&n>=o[e+1]&&n<=o[e+2])this[t]=n;else throw Error(ct+t+": "+n);if(t="crypto",r&&(this[t]=wn[t]),(n=i[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(ki);else this[t]=!1;else throw Error(ct+t+": "+n);return this}function mo(i){return new this(i).cos()}function po(i){return new this(i).cosh()}function Si(i){var e,t,n;function r(o){var a,s,u,c=this;if(!(c instanceof r))return new r(o);if(c.constructor=r,yi(o)){c.s=o.s,X?!o.d||o.e>r.maxE?(c.e=NaN,c.d=null):o.e<r.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(a=0,s=o;s>=10;s/=10)a++;X?a>r.maxE?(c.e=NaN,c.d=null):a<r.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[o]):(c.e=a,c.d=[o]);return}else if(o*0!==0){o||(c.s=NaN),c.e=NaN,c.d=null;return}return In(c,o.toString())}else if(u!=="string")throw Error(ct+o);return(s=o.charCodeAt(0))===45?(o=o.slice(1),c.s=-1):(s===43&&(o=o.slice(1)),c.s=1),wi.test(o)?In(c,o):jr(c,o)}if(r.prototype=T,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=lo,r.clone=Si,r.isDecimal=yi,r.abs=Jr,r.acos=$r,r.acosh=eo,r.add=to,r.asin=no,r.asinh=io,r.atan=ro,r.atanh=oo,r.atan2=so,r.cbrt=ao,r.ceil=uo,r.clamp=co,r.cos=mo,r.cosh=po,r.div=fo,r.exp=bo,r.floor=yo,r.hypot=go,r.ln=Po,r.log=ko,r.log10=wo,r.log2=Ao,r.max=To,r.min=ho,r.mod=Io,r.mul=Bo,r.pow=xo,r.random=So,r.round=Ko,r.sign=Co,r.sin=No,r.sinh=Lo,r.sqrt=Ro,r.sub=Mo,r.sum=Oo,r.tan=Eo,r.tanh=vo,r.trunc=Fo,i===void 0&&(i={}),i&&i.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)i.hasOwnProperty(t=n[e++])||(i[t]=this[t]);return r.config(i),r}function fo(i,e){return new this(i).div(e)}function bo(i){return new this(i).exp()}function yo(i){return W(i=new this(i),i.e+1,3)}function go(){var i,e,t=new this(0);for(X=!1,i=0;i<arguments.length;)if(e=new this(arguments[i++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return X=!0,new this(1/0);t=e}return X=!0,t.sqrt()}function yi(i){return i instanceof Lt||i&&i.toStringTag===Ai||!1}function Po(i){return new this(i).ln()}function ko(i,e){return new this(i).log(e)}function Ao(i){return new this(i).log(2)}function wo(i){return new this(i).log(10)}function To(){return Ii(this,arguments,"lt")}function ho(){return Ii(this,arguments,"gt")}function Io(i,e){return new this(i).mod(e)}function Bo(i,e){return new this(i).mul(e)}function xo(i,e){return new this(i).pow(e)}function So(i){var e,t,n,r,o=0,a=new this(1),s=[];if(i===void 0?i=this.precision:Me(i,1,lt),n=Math.ceil(i/_),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));o<n;)r=e[o],r>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);o<n;)r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(e,o):(s.push(r%1e7),o+=4);o=n/4}else throw Error(ki);else for(;o<n;)s[o++]=Math.random()*1e7|0;for(n=s[--o],i%=_,n&&i&&(r=Ae(10,_-i),s[o]=(n/r|0)*r);s[o]===0;o--)s.pop();if(o<0)t=0,s=[0];else{for(t=-1;s[0]===0;t-=_)s.shift();for(n=1,r=s[0];r>=10;r/=10)n++;n<_&&(t-=_-n)}return a.e=t,a.d=s,a}function Ko(i){return W(i=new this(i),i.e+1,this.rounding)}function Co(i){return i=new this(i),i.d?i.d[0]?i.s:0*i.s:i.s||NaN}function No(i){return new this(i).sin()}function Lo(i){return new this(i).sinh()}function Ro(i){return new this(i).sqrt()}function Mo(i,e){return new this(i).sub(e)}function Oo(){var i=0,e=arguments,t=new this(e[i]);for(X=!1;t.s&&++i<e.length;)t=t.plus(e[i]);return X=!0,W(t,this.precision,this.rounding)}function Eo(i){return new this(i).tan()}function vo(i){return new this(i).tanh()}function Fo(i){return W(i=new this(i),i.e+1,1)}T[Symbol.for("nodejs.util.inspect.custom")]=T.toString;T[Symbol.toStringTag]="Decimal";var Lt=T.constructor=Si(wn);Zt=new Lt(Zt);jt=new Lt(jt);var M=Lt;var Ci=require("@solana/web3.js");var Rt=require("lodash");var xn=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}},Ki={},Wo={};function ce(i){let e=(0,Rt.get)(Ki,i);if(!e){let t=(0,Rt.get)(Wo,i);e=new xn({name:i,logLevel:t}),(0,Rt.set)(Ki,i,e)}return e}var tn=require("@solana/spl-token"),Sn=ce("Raydium_accountInfo_util");async function mt(i,e,t){let{batchRequest:n,commitment:r="confirmed",chunkCount:o=100}=J({batchRequest:!1},t),a=Kn(e,o),s=new Array(a.length).fill([]);if(n){let u=a.map(m=>{let d=i._buildArgs([m.map(p=>p.toBase58())],r,"base64");return{methodName:"getMultipleAccounts",args:d}}),c=Kn(u,10);s=(await(await Promise.all(c.map(async m=>await i._rpcBatchRequest(m)))).flat()).map(m=>(m.error&&Sn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${m.error.message}`),m.result.value.map(d=>{if(d){let{data:p,executable:g,lamports:f,owner:b,rentEpoch:y}=d;return p.length!==2&&p[1]!=="base64"&&Sn.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(p[0],"base64"),executable:g,lamports:f,owner:new Ci.PublicKey(b),rentEpoch:y}}return null})))}else try{s=await Promise.all(a.map(u=>i.getMultipleAccountsInfo(u,r)))}catch(u){u instanceof Error&&Sn.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${u.message}`)}return s.flat()}async function Mt(i,e,t){let n=await mt(i,e.map(r=>r.pubkey),t);return e.map((r,o)=>re(J({},r),{accountInfo:n[o]}))}var Ye=te(require("bn.js"));var Ei=te(require("big.js")),Wt=te(require("bn.js"));var Ni=te(require("toformat")),Vo=Ni.default,Et=Vo;var vt=te(require("big.js")),Ri=te(require("bn.js")),Mi=te(require("decimal.js-light"));var ht=te(require("bn.js"));var Li=9007199254740991;function me(i){let e=ce("Raydium_parseBigNumberish");if(i instanceof ht.default)return i;if(typeof i=="string"){if(i.match(/^-?[0-9]+$/))return new ht.default(i);e.logWithError(`invalid BigNumberish string: ${i}`)}return typeof i=="number"?(i%1&&e.logWithError(`BigNumberish number underflow: ${i}`),(i>=Li||i<=-Li)&&e.logWithError(`BigNumberish number overflow: ${i}`),new ht.default(String(i))):typeof i=="bigint"?new ht.default(i.toString()):(e.error(`invalid BigNumberish value: ${i}`),new ht.default(0))}var nn=ce("module/fraction"),Cn=Et(vt.default),Ft=Et(Mi.default),Do={[0]:Ft.ROUND_DOWN,[1]:Ft.ROUND_HALF_UP,[2]:Ft.ROUND_UP},qo={[0]:vt.default.roundDown,[1]:vt.default.roundHalfUp,[2]:vt.default.roundUp},$=class{constructor(e,t=new Ri.default(1)){this.numerator=me(e),this.denominator=me(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new $(this.denominator,this.numerator)}add(e){let t=e instanceof $?e:new $(me(e));return this.denominator.eq(t.denominator)?new $(this.numerator.add(t.numerator),this.denominator):new $(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof $?e:new $(me(e));return this.denominator.eq(t.denominator)?new $(this.numerator.sub(t.numerator),this.denominator):new $(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof $?e:new $(me(e));return new $(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof $?e:new $(me(e));return new $(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},n=1){Number.isInteger(e)||nn.logWithError(`${e} is not an integer.`),e<=0&&nn.logWithError(`${e} is not positive.`),Ft.set({precision:e+1,rounding:Do[n]});let r=new Ft(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return r.toFormat(r.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},n=1){return Number.isInteger(e)||nn.logWithError(`${e} is not an integer.`),e<0&&nn.logWithError(`${e} is negative.`),Cn.DP=e,Cn.RM=qo[n]||1,new Cn(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var Go=ce("Raydium_amount"),Oi=Et(Ei.default);function Uo(i,e){let t="0",n="0";if(i.includes(".")){let r=i.split(".");r.length===2?([t,n]=r,n=n.padEnd(e,"0")):Go.logWithError(`invalid number string, num: ${i}`)}else t=i;return[t,n.slice(0,e)||n]}var we=class extends ${constructor(t,n,r=!0,o){let a=new Wt.default(0),s=Nn.pow(new Wt.default(t.decimals));if(r)a=me(n);else{let u=new Wt.default(0),c=new Wt.default(0);if(typeof n=="string"||typeof n=="number"||typeof n=="bigint"){let[l,m]=Uo(n.toString(),t.decimals);u=me(l),c=me(m)}u=u.mul(s),a=u.add(c)}super(a,s);this.logger=ce(o||"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 we(this.token,this.raw.add(t.raw))}subtract(t){return this.token.equals(t.token)||this.logger.logWithError("sub token not equals"),new we(this.token,this.raw.sub(t.raw))}toSignificant(t=this.token.decimals,n,r=0){return super.toSignificant(t,n,r)}toFixed(t=this.token.decimals,n,r=0){return t>this.token.decimals&&this.logger.logWithError("decimals overflow"),super.toFixed(t,n,r)}toExact(t={groupSeparator:""}){return Oi.DP=this.token.decimals,new Oi(this.numerator.toString()).div(this.denominator.toString()).toFormat(t)}};var vi=require("@solana/web3.js"),Ln=require("@solana/spl-token"),Rn={chainId:101,address:vi.PublicKey.default.toBase58(),programId:Ln.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},tt={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Ln.TOKEN_PROGRAM_ID.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"}};var on=require("@solana/web3.js");var ne=require("@solana/web3.js"),Fi=require("@solana/spl-token");function P({pubkey:i,isSigner:e=!1,isWritable:t=!0}){return{pubkey:i,isWritable:t,isSigner:e}}var qa=[P({pubkey:Fi.TOKEN_PROGRAM_ID,isWritable:!1}),P({pubkey:ne.SystemProgram.programId,isWritable:!1}),P({pubkey:ne.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Mn({publicKey:i,transformSol:e}){let t=On(i.toString());if(t instanceof ne.PublicKey)return e&&t.equals(Vt)?Ot:t;if(e&&t.toString()===Vt.toBase58())return Ot;if(typeof t=="string"){if(t===ne.PublicKey.default.toBase58())return ne.PublicKey.default;try{return new ne.PublicKey(t)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function On(i){try{return new ne.PublicKey(i)}catch{return i}}var rn=new ne.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),pt=new ne.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),je=new ne.PublicKey("SysvarRent111111111111111111111111111111111"),Ga=new ne.PublicKey("SysvarC1ock11111111111111111111111111111111"),dt=new ne.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Ua=new ne.PublicKey("Sysvar1nstructions1111111111111111111111111"),Xo=ne.SystemProgram.programId,Xa=new ne.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),za=new ne.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Qa=new ne.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Ha=new ne.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),Za=new ne.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),ja=new ne.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Ya=new ne.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Ja=new ne.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),$a=new ne.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),eu=new ne.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),tu=new ne.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Ot=new ne.PublicKey("So11111111111111111111111111111111111111112"),Vt=ne.PublicKey.default;function Tt(i){return Mn({publicKey:i,transformSol:!0})}var En=class{constructor({mint:e,decimals:t,symbol:n,name:r,skipMint:o=!1,isToken2022:a=!1}){if(e===Vt.toBase58()||e instanceof on.PublicKey&&Vt.equals(e)){this.decimals=tt.decimals,this.symbol=tt.symbol,this.name=tt.name,this.mint=new on.PublicKey(tt.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=n||e.toString().substring(0,6),this.name=r||e.toString().substring(0,6),this.mint=o?on.PublicKey.default:Mn({publicKey:e}),this.isToken2022=a}equals(e){return this===e?!0:this.mint.equals(e.mint)}},ze=En;ze.WSOL=new En(re(J({},tt),{mint:tt.address}));var vn=class{constructor({decimals:e,symbol:t="UNKNOWN",name:n="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=n}equals(e){return this===e}},sn=vn;sn.SOL=new vn(Rn);var Vi=te(require("bn.js"));var Wi=new $(new Vi.default(100)),nt=class extends ${toSignificant(e=5,t,n){return this.mul(Wi).toSignificant(e,t,n)}toFixed(e=2,t,n){return this.mul(Wi).toFixed(e,t,n)}};var zo=ce("Raydium_price"),ve=class extends ${constructor(t){let{baseToken:n,quoteToken:r,numerator:o,denominator:a}=t;super(o,a);this.baseToken=n,this.quoteToken=r,this.scalar=new $(Fn(n.decimals),Fn(r.decimals))}get raw(){return new $(this.numerator,this.denominator)}get adjusted(){return super.mul(this.scalar)}invert(){return new ve({baseToken:this.quoteToken,quoteToken:this.baseToken,denominator:this.numerator,numerator:this.denominator})}mul(t){this.quoteToken!==t.baseToken&&zo.logWithError("mul token not equals");let n=super.mul(t);return new ve({baseToken:this.baseToken,quoteToken:t.quoteToken,denominator:n.denominator,numerator:n.numerator})}toSignificant(t=this.quoteToken.decimals,n,r){return this.adjusted.toSignificant(t,n,r)}toFixed(t=this.quoteToken.decimals,n,r){return this.adjusted.toFixed(t,n,r)}};var Di=require("@solana/web3.js"),qi=te(require("bn.js"));function Gi(i){return typeof i=="object"&&i!==null&&![ze,we,Di.PublicKey,$,qi.default,ve,nt].some(e=>typeof e=="object"&&i instanceof e)}function Fe(i){return typeof i=="string"?On(i):Array.isArray(i)?i.map(e=>Fe(e)):Gi(i)?Object.fromEntries(Object.entries(i).map(([e,t])=>[e,Fe(t)])):i}var _i=new Ye.default(0),Qo=new Ye.default(1),Xu=new Ye.default(2),zu=new Ye.default(3),Qu=new Ye.default(5),Nn=new Ye.default(10),Hu=new Ye.default(100),Zu=new Ye.default(1e3),ju=new Ye.default(1e4);function Fn(i){return Nn.pow(me(i))}function Kn(i,e=1,t=[]){let n=[...i];if(e<=0)return t;for(;n.length;)t.push(n.splice(0,e));return t}var Ui=require("@solana/web3.js"),Xi=require("@solana/spl-token");var ft=require("@solana/web3.js");var oe={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"};var Ho=require("@solana/spl-token"),cc=ce("Raydium_txUtil");function Se(i,e){let[t,n]=ft.PublicKey.findProgramAddressSync(i,e);return{publicKey:t,nonce:n}}function se(i,e,t){return Se([i.toBuffer(),(t!=null?t:Xi.TOKEN_PROGRAM_ID).toBuffer(),e.toBuffer()],new Ui.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}var U=require("@solana/web3.js"),Zo=new U.PublicKey("EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q"),dc=new U.PublicKey("CBuCnLe26faBpcBP2fktp4rp8abpcAnTWft6ZrP5Q4T"),jo=new U.PublicKey("9KEPoZmtHUrBbhWN1v1KWLMkkvwY6WLtAVUCPRtRjP4z"),Yo=new U.PublicKey("FarmqiPv5eAj3j1GMdMCMUGXqPUvmquZtMy86QH6rzhG"),Jo=new U.PublicKey("CLaimxFqjHzgTJtAGHU47NPhg6qrc5sCnpC4tBLyABQS"),$o=new U.PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),Wn=new U.PublicKey("9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"),zi=new U.PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),es=new U.PublicKey("5quBtoiQqxF9Jv6KYKctB59NT3gtJD2Y65kdnB1Uev3h"),an=new U.PublicKey("CDSr3ssLcRB6XYPJwAfFt18MZvEZp4LjHcvzBVZ45duo"),Vn=new U.PublicKey("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"),Qi=new U.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),Hi=new U.PublicKey("kN1kEznaF5Xbd8LYuqtEFcxzWSBk5Fv6ygX6SqEGJVy"),ts=new U.PublicKey("routeUGWgWzqBWFcrCfv8tritsqukccJPu3q5GPP3xS"),fc=new U.PublicKey("7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"),bc=new U.PublicKey("6FJon3QE27qgPVggARueB22hLvoh22VzJpXv4rBEoSLF"),yc=new U.PublicKey("CC12se5To1CdEuw7fDS27B7Geo5jJyL7t5UK2B44NgiH"),gc=new U.PublicKey("9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC"),Pc=new U.PublicKey("DropEU8AvevN3UrXWXTMuz3rqnMczQVNjq3kcSdW2SQi"),_n=new U.PublicKey("CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"),Zi=new U.PublicKey("GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL"),ns=new U.PublicKey("DNXgeM9EiiaAbaWvwjHj9fQQLAX5ZsfHyvmYUNRAdNC8"),is=new U.PublicKey("CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"),rs=new U.PublicKey("7rQ1QFNosMkUCuh7Z7fPbTHvh73b68sQYdirycEzJVuw"),os=new U.PublicKey("G11FKBRaAkHAKuLCgLM6K6NUc9rTjPAznRCjZifrTQe2"),ss=new U.PublicKey("LockrWmn6K5twhz3y9w1dQERbmgSaRkfnTeTKbpofwE"),as=new U.PublicKey("DLockwT7X7sxtLmGH9g5kmfcjaBtncdbUmi738m5bvQC"),us=new U.PublicKey("3f7GcQFG397GAaEnv51zR6tsTVihYRydnydDD1cXekxH"),cs=new U.PublicKey("7AFUeLVRjBfzqK3tTGw8hN48KLQWSk6DTE8xprWdPqix"),ls=new U.PublicKey("LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"),ms=new U.PublicKey("WLHv2UAZm6z4KyaaELi5pjdbJh6RESMva1Rnn8pJVVh"),ps=new U.PublicKey("7soRSLviCKHCKzCbRuVpZDif76NWLVqFtbjt8LpyxWSq"),ds=new U.PublicKey("DG6kZFFCqxdtWXw53Zc28hLs3MTr28Efkm2FrsNERNSQ");var Le={AMM_V4:zi,AMM_STABLE:es,CLMM_PROGRAM_ID:Vn,CLMM_LOCK_PROGRAM_ID:Qi,CLMM_LOCK_AUTH_ID:Hi,FARM_PROGRAM_ID_V3:Zo,FARM_PROGRAM_ID_V5:jo,FARM_PROGRAM_ID_V6:Yo,OPEN_BOOK_PROGRAM:$o,SERUM_PROGRAM_ID_V3:Wn,UTIL1216:Jo,Router:ts,CREATE_CPMM_POOL_PROGRAM:_n,CREATE_CPMM_POOL_AUTH:Zi,CREATE_CPMM_POOL_FEE_ACC:ns,LOCK_CPMM_PROGRAM:ss,LOCK_CPMM_AUTH:us,LAUNCHPAD_PROGRAM:ls,LAUNCHPAD_AUTH:ms},kc={SERUM_MARKET:U.PublicKey.default,OPENBOOK_MARKET: