@roomstay/core 0.1.33-3 → 0.1.33-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -0
- package/dist/node.js +2 -1
- package/dist/node.js.LICENSE.txt +7 -0
- package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +0 -0
- package/dist/types/Booking/IBookingPayment.type.d.ts +0 -0
- package/dist/types/Booking/IBookingQuote.type.d.ts +0 -0
- package/dist/types/Booking/IBookingStatus.type.d.ts +0 -0
- package/dist/types/Booking/IPrice.type.d.ts +0 -0
- package/dist/types/Company/ECompanyProvider.enum.d.ts +0 -0
- package/dist/types/Company/IAdminCompany.type.d.ts +0 -0
- package/dist/types/Company/IAdminCompanyUser.type.d.ts +0 -0
- package/dist/types/Events/IRoomstayEvent.type.d.ts +0 -0
- package/dist/types/General/HttpMethod.enum.d.ts +0 -0
- package/dist/types/General/IJsonString.type.d.ts +6 -0
- package/dist/types/Hotel/EHotelPriceModel.enum.d.ts +0 -0
- package/dist/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +0 -0
- package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +1 -1
- package/dist/types/Hotel/IHotelColorScheme.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelOverrides.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelReplica.type.d.ts +0 -0
- package/dist/types/Hotel/IHotelService.type.d.ts +0 -0
- package/dist/types/Image/IRoomstayImage.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayCognitoMember.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMember.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBooking.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingAddress.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingItem.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberBookingProfile.type.d.ts +0 -0
- package/dist/types/Member/IRoomstayMemberCards.type.d.ts +0 -0
- package/dist/types/Member/ISession.type.d.ts +0 -0
- package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -0
- package/dist/types/RMS/ERMSDiscountType.enum.d.ts +0 -0
- package/dist/types/RMS/IRMSPropertyDiscount.type.d.ts +0 -0
- package/dist/types/RMS/IRMSRequirement.type.d.ts +0 -0
- package/dist/types/Room/IRoomGroup.type.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/utils/bookingTotal.d.ts +0 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/nameof.d.ts +2 -0
- package/dist/utils/roomstayImageResize.d.ts +0 -0
- package/dist/utils/roundMoney.d.ts +10 -0
- package/dist/utils/uppercaseString.d.ts +0 -0
- package/dist/web.js +2 -1
- package/dist/web.js.LICENSE.txt +7 -0
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/node.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! For license information please see node.js.LICENSE.txt */
|
|
2
|
+
(()=>{"use strict";var n={d:(e,i)=>{for(var t in i)n.o(i,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},o:(n,e)=>Object.prototype.hasOwnProperty.call(n,e),r:n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},e={};let i,t,r,o,s,u,c,a,f,d,l,h,g,p;function m(n){return n.toUpperCase()}n.r(e),n.d(e,{EBookingPaymentMethod:()=>t,ECompanyProvider:()=>s,EDistanceUnitType:()=>u,EGuarantyPolicyPrepaymentType:()=>g,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>c,EHotelStateFieldConfiguration:()=>a,EHotelWeekdayStartsOn:()=>f,EIntegration:()=>d,EPlanpayBookingStatus:()=>o,ERMSDiscountType:()=>l,ERoomstayImageSize:()=>h,HttpMethod:()=>p,IBookingStatus:()=>i,calculateTotalForMemberBooking:()=>w,nameof:()=>N,resizeRoomstayImageUrl:()=>v,roundMoney:()=>oe,subset:()=>y,uppercaseString:()=>m}),function(n){n.Pending="Pending",n.Committed="Committed",n.Cancelled="Cancelled"}(i||(i={})),function(n){n.Card="Card",n.SavedCard="SavedCard",n.Planpay="Planpay",n.Adyen="Adyen"}(t||(t={})),function(n){n.Passthrough="Passthrough",n.Adyen="Adyen",n.Till="Till",n.RMSPay="RMSPay"}(r||(r={})),function(n){n.Unknown="unknown",n.Unpaid="unpaid",n.Accepted="accepted",n.Cancelled="cancelled",n.Refunded="refunded",n.Rejected="rejected"}(o||(o={})),function(n){n.Synxis="Synxis",n.Availpro="Availpro",n.RMS="RMS",n.Siteminder="Siteminder",n.Roomstay="Roomstay"}(s||(s={})),function(n){n.Metric="metric",n.Imperial="imperial"}(u||(u={})),function(n){n.PerPerson="PerPerson",n.PerDay="PerDay",n.PerOccupancy="PerOccupancy"}(c||(c={})),function(n){n.NotIncluded="NotIncluded",n.Optional="Optional",n.Required="Required"}(a||(a={})),function(n){n.Monday="monday",n.Sunday="sunday"}(f||(f={})),function(n){n.Big4="Big4",n.Top10="Top10",n.Gday="Gday",n.Salesforce="Salesforce"}(d||(d={})),function(n){n.Percentage="Percentage",n.Amount="Amount",n.Bogo="BOGO",n.NightlyRateOverride="NightlyRateOverride"}(l||(l={})),function(n){n[n.Icon=128]="Icon",n[n.Tiny=256]="Tiny",n[n.Small=512]="Small",n[n.Medium=768]="Medium",n[n.Large=1024]="Large",n[n.ExtraLarge=1600]="ExtraLarge"}(h||(h={})),function(n){n.FixedAmount="fixed",n.Percentage="percentage",n.Nights="nights"}(g||(g={})),function(n){n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n.PATCH="PATCH",n.OPTIONS="OPTIONS",n.HEAD="HEAD"}(p||(p={}));const w=n=>{let e=0;const i=Object.values(n.itinerary);for(const n of i){const i=Object.keys(n.nights);for(const t of i)e+=n.nights[t].total}return e},v=(n,e)=>n.includes("cdn.app.roomstay.io")?n+"?w="+e:n,N=n=>n,y=(n,e)=>{const i={};return e.forEach((e=>{e in n&&(i[e]=n[e])})),i};var E,b,x=9e15,P=1e9,M="0123456789abcdef",O="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",S="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",T={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-x,maxE:x,crypto:!1},A=!0,q="[DecimalError] ",R=q+"Invalid argument: ",D=q+"Precision limit exceeded",F=q+"crypto unavailable",C="[object Decimal]",I=Math.floor,k=Math.pow,U=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Z=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,L=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,H=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,B=O.length-1,j=S.length-1,G={toStringTag:C};function V(n){var e,i,t,r=n.length-1,o="",s=n[0];if(r>0){for(o+=s,e=1;e<r;e++)(i=7-(t=n[e]+"").length)&&(o+=tn(i)),o+=t;(i=7-(t=(s=n[e])+"").length)&&(o+=tn(i))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function $(n,e,i){if(n!==~~n||n<e||n>i)throw Error(R+n)}function W(n,e,i,t){var r,o,s,u;for(o=n[0];o>=10;o/=10)--e;return--e<0?(e+=7,r=0):(r=Math.ceil((e+1)/7),e%=7),o=k(10,7-e),u=n[r]%o|0,null==t?e<3?(0==e?u=u/100|0:1==e&&(u=u/10|0),s=i<4&&99999==u||i>3&&49999==u||5e4==u||0==u):s=(i<4&&u+1==o||i>3&&u+1==o/2)&&(n[r+1]/o/100|0)==k(10,e-2)-1||(u==o/2||0==u)&&0==(n[r+1]/o/100|0):e<4?(0==e?u=u/1e3|0:1==e?u=u/100|0:2==e&&(u=u/10|0),s=(t||i<4)&&9999==u||!t&&i>3&&4999==u):s=((t||i<4)&&u+1==o||!t&&i>3&&u+1==o/2)&&(n[r+1]/o/1e3|0)==k(10,e-3)-1,s}function z(n,e,i){for(var t,r,o=[0],s=0,u=n.length;s<u;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=M.indexOf(n.charAt(s++)),t=0;t<o.length;t++)o[t]>i-1&&(void 0===o[t+1]&&(o[t+1]=0),o[t+1]+=o[t]/i|0,o[t]%=i)}return o.reverse()}G.absoluteValue=G.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),K(n)},G.ceil=function(){return K(new this.constructor(this),this.e+1,2)},G.clampedTo=G.clamp=function(n,e){var i=this,t=i.constructor;if(n=new t(n),e=new t(e),!n.s||!e.s)return new t(NaN);if(n.gt(e))throw Error(R+e);return i.cmp(n)<0?n:i.cmp(e)>0?e:new t(i)},G.comparedTo=G.cmp=function(n){var e,i,t,r,o=this,s=o.d,u=(n=new o.constructor(n)).d,c=o.s,a=n.s;if(!s||!u)return c&&a?c!==a?c:s===u?0:!s^c<0?1:-1:NaN;if(!s[0]||!u[0])return s[0]?c:u[0]?-a:0;if(c!==a)return c;if(o.e!==n.e)return o.e>n.e^c<0?1:-1;for(e=0,i=(t=s.length)<(r=u.length)?t:r;e<i;++e)if(s[e]!==u[e])return s[e]>u[e]^c<0?1:-1;return t===r?0:t>r^c<0?1:-1},G.cosine=G.cos=function(){var n,e,i=this,t=i.constructor;return i.d?i.d[0]?(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+7,t.rounding=1,i=function(n,e){var i,t,r;if(e.isZero())return e;(t=e.d.length)<32?r=(1/hn(4,i=Math.ceil(t/3))).toString():(i=16,r="2.3283064365386962890625e-10"),n.precision+=i,e=ln(n,1,e.times(r),new n(1));for(var o=i;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return n.precision-=i,e}(t,gn(t,i)),t.precision=n,t.rounding=e,K(2==b||3==b?i.neg():i,n,e,!0)):new t(1):new t(NaN)},G.cubeRoot=G.cbrt=function(){var n,e,i,t,r,o,s,u,c,a,f=this,d=f.constructor;if(!f.isFinite()||f.isZero())return new d(f);for(A=!1,(o=f.s*k(f.s*f,1/3))&&Math.abs(o)!=1/0?t=new d(o.toString()):(i=V(f.d),(o=((n=f.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=k(i,1/3),n=I((n+1)/3)-(n%3==(n<0?-1:2)),(t=new d(i=o==1/0?"5e"+n:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+n)).s=f.s),s=(n=d.precision)+3;;)if(a=(c=(u=t).times(u).times(u)).plus(f),t=J(a.plus(f).times(u),a.plus(c),s+2,1),V(u.d).slice(0,s)===(i=V(t.d)).slice(0,s)){if("9999"!=(i=i.slice(s-3,s+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(K(t,n+1,1),e=!t.times(t).times(t).eq(f));break}if(!r&&(K(u,n+1,0),u.times(u).times(u).eq(f))){t=u;break}s+=4,r=1}return A=!0,K(t,n,d.rounding,e)},G.decimalPlaces=G.dp=function(){var n,e=this.d,i=NaN;if(e){if(i=7*((n=e.length-1)-I(this.e/7)),n=e[n])for(;n%10==0;n/=10)i--;i<0&&(i=0)}return i},G.dividedBy=G.div=function(n){return J(this,new this.constructor(n))},G.dividedToIntegerBy=G.divToInt=function(n){var e=this.constructor;return K(J(this,new e(n),0,1,1),e.precision,e.rounding)},G.equals=G.eq=function(n){return 0===this.cmp(n)},G.floor=function(){return K(new this.constructor(this),this.e+1,3)},G.greaterThan=G.gt=function(n){return this.cmp(n)>0},G.greaterThanOrEqualTo=G.gte=function(n){var e=this.cmp(n);return 1==e||0===e},G.hyperbolicCosine=G.cosh=function(){var n,e,i,t,r,o=this,s=o.constructor,u=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return u;i=s.precision,t=s.rounding,s.precision=i+Math.max(o.e,o.sd())+4,s.rounding=1,(r=o.d.length)<32?e=(1/hn(4,n=Math.ceil(r/3))).toString():(n=16,e="2.3283064365386962890625e-10"),o=ln(s,1,o.times(e),new s(1),!0);for(var c,a=n,f=new s(8);a--;)c=o.times(o),o=u.minus(c.times(f.minus(c.times(f))));return K(o,s.precision=i,s.rounding=t,!0)},G.hyperbolicSine=G.sinh=function(){var n,e,i,t,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,i=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,(t=r.d.length)<3)r=ln(o,2,r,r,!0);else{n=(n=1.4*Math.sqrt(t))>16?16:0|n,r=ln(o,2,r=r.times(1/hn(5,n)),r,!0);for(var s,u=new o(5),c=new o(16),a=new o(20);n--;)s=r.times(r),r=r.times(u.plus(s.times(c.times(s).plus(a))))}return o.precision=e,o.rounding=i,K(r,e,i,!0)},G.hyperbolicTangent=G.tanh=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+7,t.rounding=1,J(i.sinh(),i.cosh(),t.precision=n,t.rounding=e)):new t(i.s)},G.inverseCosine=G.acos=function(){var n,e=this,i=e.constructor,t=e.abs().cmp(1),r=i.precision,o=i.rounding;return-1!==t?0===t?e.isNeg()?nn(i,r,o):new i(0):new i(NaN):e.isZero()?nn(i,r+4,o).times(.5):(i.precision=r+6,i.rounding=1,e=e.asin(),n=nn(i,r+4,o).times(.5),i.precision=r,i.rounding=o,n.minus(e))},G.inverseHyperbolicCosine=G.acosh=function(){var n,e,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(n=t.precision,e=t.rounding,t.precision=n+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,A=!1,i=i.times(i).minus(1).sqrt().plus(i),A=!0,t.precision=n,t.rounding=e,i.ln()):new t(i)},G.inverseHyperbolicSine=G.asinh=function(){var n,e,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,A=!1,i=i.times(i).plus(1).sqrt().plus(i),A=!0,t.precision=n,t.rounding=e,i.ln())},G.inverseHyperbolicTangent=G.atanh=function(){var n,e,i,t,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=o.precision,e=o.rounding,t=r.sd(),Math.max(t,n)<2*-r.e-1?K(new o(r),n,e,!0):(o.precision=i=t-r.e,r=J(r.plus(1),new o(1).minus(r),i+n,1),o.precision=n+4,o.rounding=1,r=r.ln(),o.precision=n,o.rounding=e,r.times(.5))):new o(NaN)},G.inverseSine=G.asin=function(){var n,e,i,t,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,t=o.rounding,-1!==e?0===e?((n=nn(o,i+4,t).times(.5)).s=r.s,n):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=t,r.times(2)))},G.inverseTangent=G.atan=function(){var n,e,i,t,r,o,s,u,c,a=this,f=a.constructor,d=f.precision,l=f.rounding;if(a.isFinite()){if(a.isZero())return new f(a);if(a.abs().eq(1)&&d+4<=j)return(s=nn(f,d+4,l).times(.25)).s=a.s,s}else{if(!a.s)return new f(NaN);if(d+4<=j)return(s=nn(f,d+4,l).times(.5)).s=a.s,s}for(f.precision=u=d+10,f.rounding=1,n=i=Math.min(28,u/7+2|0);n;--n)a=a.div(a.times(a).plus(1).sqrt().plus(1));for(A=!1,e=Math.ceil(u/7),t=1,c=a.times(a),s=new f(a),r=a;-1!==n;)if(r=r.times(c),o=s.minus(r.div(t+=2)),r=r.times(c),void 0!==(s=o.plus(r.div(t+=2))).d[e])for(n=e;s.d[n]===o.d[n]&&n--;);return i&&(s=s.times(2<<i-1)),A=!0,K(s,f.precision=d,f.rounding=l,!0)},G.isFinite=function(){return!!this.d},G.isInteger=G.isInt=function(){return!!this.d&&I(this.e/7)>this.d.length-2},G.isNaN=function(){return!this.s},G.isNegative=G.isNeg=function(){return this.s<0},G.isPositive=G.isPos=function(){return this.s>0},G.isZero=function(){return!!this.d&&0===this.d[0]},G.lessThan=G.lt=function(n){return this.cmp(n)<0},G.lessThanOrEqualTo=G.lte=function(n){return this.cmp(n)<1},G.logarithm=G.log=function(n){var e,i,t,r,o,s,u,c,a=this,f=a.constructor,d=f.precision,l=f.rounding;if(null==n)n=new f(10),e=!0;else{if(i=(n=new f(n)).d,n.s<0||!i||!i[0]||n.eq(1))return new f(NaN);e=n.eq(10)}if(i=a.d,a.s<0||!i||!i[0]||a.eq(1))return new f(i&&!i[0]?-1/0:1!=a.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(A=!1,s=cn(a,u=d+5),t=e?Y(f,u+10):cn(n,u),W((c=J(s,t,u,1)).d,r=d,l))do{if(s=cn(a,u+=10),t=e?Y(f,u+10):cn(n,u),c=J(s,t,u,1),!o){+V(c.d).slice(r+1,r+15)+1==1e14&&(c=K(c,d+1,0));break}}while(W(c.d,r+=10,l));return A=!0,K(c,d,l)},G.minus=G.sub=function(n){var e,i,t,r,o,s,u,c,a,f,d,l,h=this,g=h.constructor;if(n=new g(n),!h.d||!n.d)return h.s&&n.s?h.d?n.s=-n.s:n=new g(n.d||h.s!==n.s?h:NaN):n=new g(NaN),n;if(h.s!=n.s)return n.s=-n.s,h.plus(n);if(a=h.d,l=n.d,u=g.precision,c=g.rounding,!a[0]||!l[0]){if(l[0])n.s=-n.s;else{if(!a[0])return new g(3===c?-0:0);n=new g(h)}return A?K(n,u,c):n}if(i=I(n.e/7),f=I(h.e/7),a=a.slice(),o=f-i){for((d=o<0)?(e=a,o=-o,s=l.length):(e=l,i=f,s=a.length),o>(t=Math.max(Math.ceil(u/7),s)+2)&&(o=t,e.length=1),e.reverse(),t=o;t--;)e.push(0);e.reverse()}else{for((d=(t=a.length)<(s=l.length))&&(s=t),t=0;t<s;t++)if(a[t]!=l[t]){d=a[t]<l[t];break}o=0}for(d&&(e=a,a=l,l=e,n.s=-n.s),s=a.length,t=l.length-s;t>0;--t)a[s++]=0;for(t=l.length;t>o;){if(a[--t]<l[t]){for(r=t;r&&0===a[--r];)a[r]=_-1;--a[r],a[t]+=_}a[t]-=l[t]}for(;0===a[--s];)a.pop();for(;0===a[0];a.shift())--i;return a[0]?(n.d=a,n.e=X(a,i),A?K(n,u,c):n):new g(3===c?-0:0)},G.modulo=G.mod=function(n){var e,i=this,t=i.constructor;return n=new t(n),!i.d||!n.s||n.d&&!n.d[0]?new t(NaN):!n.d||i.d&&!i.d[0]?K(new t(i),t.precision,t.rounding):(A=!1,9==t.modulo?(e=J(i,n.abs(),0,3,1)).s*=n.s:e=J(i,n,0,t.modulo,1),e=e.times(n),A=!0,i.minus(e))},G.naturalExponential=G.exp=function(){return un(this)},G.naturalLogarithm=G.ln=function(){return cn(this)},G.negated=G.neg=function(){var n=new this.constructor(this);return n.s=-n.s,K(n)},G.plus=G.add=function(n){var e,i,t,r,o,s,u,c,a,f,d=this,l=d.constructor;if(n=new l(n),!d.d||!n.d)return d.s&&n.s?d.d||(n=new l(n.d||d.s===n.s?d:NaN)):n=new l(NaN),n;if(d.s!=n.s)return n.s=-n.s,d.minus(n);if(a=d.d,f=n.d,u=l.precision,c=l.rounding,!a[0]||!f[0])return f[0]||(n=new l(d)),A?K(n,u,c):n;if(o=I(d.e/7),t=I(n.e/7),a=a.slice(),r=o-t){for(r<0?(i=a,r=-r,s=f.length):(i=f,t=o,s=a.length),r>(s=(o=Math.ceil(u/7))>s?o+1:s+1)&&(r=s,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((s=a.length)-(r=f.length)<0&&(r=s,i=f,f=a,a=i),e=0;r;)e=(a[--r]=a[r]+f[r]+e)/_|0,a[r]%=_;for(e&&(a.unshift(e),++t),s=a.length;0==a[--s];)a.pop();return n.d=a,n.e=X(a,t),A?K(n,u,c):n},G.precision=G.sd=function(n){var e,i=this;if(void 0!==n&&n!==!!n&&1!==n&&0!==n)throw Error(R+n);return i.d?(e=en(i.d),n&&i.e+1>e&&(e=i.e+1)):e=NaN,e},G.round=function(){var n=this,e=n.constructor;return K(new e(n),n.e+1,e.rounding)},G.sine=G.sin=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+7,t.rounding=1,i=function(n,e){var i,t=e.d.length;if(t<3)return e.isZero()?e:ln(n,2,e,e);i=(i=1.4*Math.sqrt(t))>16?16:0|i,e=ln(n,2,e=e.times(1/hn(5,i)),e);for(var r,o=new n(5),s=new n(16),u=new n(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(u))));return e}(t,gn(t,i)),t.precision=n,t.rounding=e,K(b>2?i.neg():i,n,e,!0)):new t(NaN)},G.squareRoot=G.sqrt=function(){var n,e,i,t,r,o,s=this,u=s.d,c=s.e,a=s.s,f=s.constructor;if(1!==a||!u||!u[0])return new f(!a||a<0&&(!u||u[0])?NaN:u?s:1/0);for(A=!1,0==(a=Math.sqrt(+s))||a==1/0?(((e=V(u)).length+c)%2==0&&(e+="0"),a=Math.sqrt(e),c=I((c+1)/2)-(c<0||c%2),t=new f(e=a==1/0?"5e"+c:(e=a.toExponential()).slice(0,e.indexOf("e")+1)+c)):t=new f(a.toString()),i=(c=f.precision)+3;;)if(t=(o=t).plus(J(s,o,i+2,1)).times(.5),V(o.d).slice(0,i)===(e=V(t.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(t,c+1,1),n=!t.times(t).eq(s));break}if(!r&&(K(o,c+1,0),o.times(o).eq(s))){t=o;break}i+=4,r=1}return A=!0,K(t,c,f.rounding,n)},G.tangent=G.tan=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+10,t.rounding=1,(i=i.sin()).s=1,i=J(i,new t(1).minus(i.times(i)).sqrt(),n+10,0),t.precision=n,t.rounding=e,K(2==b||4==b?i.neg():i,n,e,!0)):new t(NaN)},G.times=G.mul=function(n){var e,i,t,r,o,s,u,c,a,f=this,d=f.constructor,l=f.d,h=(n=new d(n)).d;if(n.s*=f.s,!(l&&l[0]&&h&&h[0]))return new d(!n.s||l&&!l[0]&&!h||h&&!h[0]&&!l?NaN:l&&h?0*n.s:n.s/0);for(i=I(f.e/7)+I(n.e/7),(c=l.length)<(a=h.length)&&(o=l,l=h,h=o,s=c,c=a,a=s),o=[],t=s=c+a;t--;)o.push(0);for(t=a;--t>=0;){for(e=0,r=c+t;r>t;)u=o[r]+h[t]*l[r-t-1]+e,o[r--]=u%_|0,e=u/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--s];)o.pop();return e?++i:o.shift(),n.d=o,n.e=X(o,i),A?K(n,d.precision,d.rounding):n},G.toBinary=function(n,e){return pn(this,2,n,e)},G.toDecimalPlaces=G.toDP=function(n,e){var i=this,t=i.constructor;return i=new t(i),void 0===n?i:($(n,0,P),void 0===e?e=t.rounding:$(e,0,8),K(i,n+i.e+1,e))},G.toExponential=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=Q(t,!0):($(n,0,P),void 0===e?e=r.rounding:$(e,0,8),i=Q(t=K(new r(t),n+1,e),!0,n+1)),t.isNeg()&&!t.isZero()?"-"+i:i},G.toFixed=function(n,e){var i,t,r=this,o=r.constructor;return void 0===n?i=Q(r):($(n,0,P),void 0===e?e=o.rounding:$(e,0,8),i=Q(t=K(new o(r),n+r.e+1,e),!1,n+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},G.toFraction=function(n){var e,i,t,r,o,s,u,c,a,f,d,l,h=this,g=h.d,p=h.constructor;if(!g)return new p(h);if(a=i=new p(1),t=c=new p(0),s=(o=(e=new p(t)).e=en(g)-h.e-1)%7,e.d[0]=k(10,s<0?7+s:s),null==n)n=o>0?e:a;else{if(!(u=new p(n)).isInt()||u.lt(a))throw Error(R+u);n=u.gt(e)?o>0?e:a:u}for(A=!1,u=new p(V(g)),f=p.precision,p.precision=o=7*g.length*2;d=J(u,e,0,1,1),1!=(r=i.plus(d.times(t))).cmp(n);)i=t,t=r,r=a,a=c.plus(d.times(r)),c=r,r=e,e=u.minus(d.times(r)),u=r;return r=J(n.minus(i),t,0,1,1),c=c.plus(r.times(a)),i=i.plus(r.times(t)),c.s=a.s=h.s,l=J(a,t,o,1).minus(h).abs().cmp(J(c,i,o,1).minus(h).abs())<1?[a,t]:[c,i],p.precision=f,A=!0,l},G.toHexadecimal=G.toHex=function(n,e){return pn(this,16,n,e)},G.toNearest=function(n,e){var i=this,t=i.constructor;if(i=new t(i),null==n){if(!i.d)return i;n=new t(1),e=t.rounding}else{if(n=new t(n),void 0===e?e=t.rounding:$(e,0,8),!i.d)return n.s?i:n;if(!n.d)return n.s&&(n.s=i.s),n}return n.d[0]?(A=!1,i=J(i,n,0,e,1).times(n),A=!0,K(i)):(n.s=i.s,i=n),i},G.toNumber=function(){return+this},G.toOctal=function(n,e){return pn(this,8,n,e)},G.toPower=G.pow=function(n){var e,i,t,r,o,s,u=this,c=u.constructor,a=+(n=new c(n));if(!(u.d&&n.d&&u.d[0]&&n.d[0]))return new c(k(+u,a));if((u=new c(u)).eq(1))return u;if(t=c.precision,o=c.rounding,n.eq(1))return K(u,t,o);if((e=I(n.e/7))>=n.d.length-1&&(i=a<0?-a:a)<=9007199254740991)return r=rn(c,u,i,t),n.s<0?new c(1).div(r):K(r,t,o);if((s=u.s)<0){if(e<n.d.length-1)return new c(NaN);if(0==(1&n.d[e])&&(s=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=s,u}return(e=0!=(i=k(+u,a))&&isFinite(i)?new c(i+"").e:I(a*(Math.log("0."+V(u.d))/Math.LN10+u.e+1)))>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):(A=!1,c.rounding=u.s=1,i=Math.min(12,(e+"").length),(r=un(n.times(cn(u,t+i)),t)).d&&W((r=K(r,t+5,1)).d,t,o)&&(e=t+10,+V((r=K(un(n.times(cn(u,e+i)),e),e+5,1)).d).slice(t+1,t+15)+1==1e14&&(r=K(r,t+1,0))),r.s=s,A=!0,c.rounding=o,K(r,t,o))},G.toPrecision=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=Q(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):($(n,1,P),void 0===e?e=r.rounding:$(e,0,8),i=Q(t=K(new r(t),n,e),n<=t.e||t.e<=r.toExpNeg,n)),t.isNeg()&&!t.isZero()?"-"+i:i},G.toSignificantDigits=G.toSD=function(n,e){var i=this.constructor;return void 0===n?(n=i.precision,e=i.rounding):($(n,1,P),void 0===e?e=i.rounding:$(e,0,8)),K(new i(this),n,e)},G.toString=function(){var n=this,e=n.constructor,i=Q(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+i:i},G.truncated=G.trunc=function(){return K(new this.constructor(this),this.e+1,1)},G.valueOf=G.toJSON=function(){var n=this,e=n.constructor,i=Q(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+i:i};var J=function(){function n(n,e,i){var t,r=0,o=n.length;for(n=n.slice();o--;)t=n[o]*e+r,n[o]=t%i|0,r=t/i|0;return r&&n.unshift(r),n}function e(n,e,i,t){var r,o;if(i!=t)o=i>t?1:-1;else for(r=o=0;r<i;r++)if(n[r]!=e[r]){o=n[r]>e[r]?1:-1;break}return o}function i(n,e,i,t){for(var r=0;i--;)n[i]-=r,r=n[i]<e[i]?1:0,n[i]=r*t+n[i]-e[i];for(;!n[0]&&n.length>1;)n.shift()}return function(t,r,o,s,u,c){var a,f,d,l,h,g,p,m,w,v,N,y,b,x,P,M,O,S,T,A,q=t.constructor,R=t.s==r.s?1:-1,D=t.d,F=r.d;if(!(D&&D[0]&&F&&F[0]))return new q(t.s&&r.s&&(D?!F||D[0]!=F[0]:F)?D&&0==D[0]||!F?0*R:R/0:NaN);for(c?(h=1,f=t.e-r.e):(c=_,h=7,f=I(t.e/h)-I(r.e/h)),T=F.length,O=D.length,v=(w=new q(R)).d=[],d=0;F[d]==(D[d]||0);d++);if(F[d]>(D[d]||0)&&f--,null==o?(x=o=q.precision,s=q.rounding):x=u?o+(t.e-r.e)+1:o,x<0)v.push(1),g=!0;else{if(x=x/h+2|0,d=0,1==T){for(l=0,F=F[0],x++;(d<O||l)&&x--;d++)P=l*c+(D[d]||0),v[d]=P/F|0,l=P%F|0;g=l||d<O}else{for((l=c/(F[0]+1)|0)>1&&(F=n(F,l,c),D=n(D,l,c),T=F.length,O=D.length),M=T,y=(N=D.slice(0,T)).length;y<T;)N[y++]=0;(A=F.slice()).unshift(0),S=F[0],F[1]>=c/2&&++S;do{l=0,(a=e(F,N,T,y))<0?(b=N[0],T!=y&&(b=b*c+(N[1]||0)),(l=b/S|0)>1?(l>=c&&(l=c-1),1==(a=e(p=n(F,l,c),N,m=p.length,y=N.length))&&(l--,i(p,T<m?A:F,m,c))):(0==l&&(a=l=1),p=F.slice()),(m=p.length)<y&&p.unshift(0),i(N,p,y,c),-1==a&&(a=e(F,N,T,y=N.length))<1&&(l++,i(N,T<y?A:F,y,c)),y=N.length):0===a&&(l++,N=[0]),v[d++]=l,a&&N[0]?N[y++]=D[M]||0:(N=[D[M]],y=1)}while((M++<O||void 0!==N[0])&&x--);g=void 0!==N[0]}v[0]||v.shift()}if(1==h)w.e=f,E=g;else{for(d=1,l=v[0];l>=10;l/=10)d++;w.e=d+f*h-1,K(w,u?o+w.e+1:o,s,g)}return w}}();function K(n,e,i,t){var r,o,s,u,c,a,f,d,l,h=n.constructor;n:if(null!=e){if(!(d=n.d))return n;for(r=1,u=d[0];u>=10;u/=10)r++;if((o=e-r)<0)o+=7,s=e,c=(f=d[l=0])/k(10,r-s-1)%10|0;else if((l=Math.ceil((o+1)/7))>=(u=d.length)){if(!t)break n;for(;u++<=l;)d.push(0);f=c=0,r=1,s=(o%=7)-7+1}else{for(f=u=d[l],r=1;u>=10;u/=10)r++;c=(s=(o%=7)-7+r)<0?0:f/k(10,r-s-1)%10|0}if(t=t||e<0||void 0!==d[l+1]||(s<0?f:f%k(10,r-s-1)),a=i<4?(c||t)&&(0==i||i==(n.s<0?3:2)):c>5||5==c&&(4==i||t||6==i&&(o>0?s>0?f/k(10,r-s):0:d[l-1])%10&1||i==(n.s<0?8:7)),e<1||!d[0])return d.length=0,a?(e-=n.e+1,d[0]=k(10,(7-e%7)%7),n.e=-e||0):d[0]=n.e=0,n;if(0==o?(d.length=l,u=1,l--):(d.length=l+1,u=k(10,7-o),d[l]=s>0?(f/k(10,r-s)%k(10,s)|0)*u:0),a)for(;;){if(0==l){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=u,u=1;s>=10;s/=10)u++;o!=u&&(n.e++,d[0]==_&&(d[0]=1));break}if(d[l]+=u,d[l]!=_)break;d[l--]=0,u=1}for(o=d.length;0===d[--o];)d.pop()}return A&&(n.e>h.maxE?(n.d=null,n.e=NaN):n.e<h.minE&&(n.e=0,n.d=[0])),n}function Q(n,e,i){if(!n.isFinite())return an(n);var t,r=n.e,o=V(n.d),s=o.length;return e?(i&&(t=i-s)>0?o=o.charAt(0)+"."+o.slice(1)+tn(t):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):r<0?(o="0."+tn(-r-1)+o,i&&(t=i-s)>0&&(o+=tn(t))):r>=s?(o+=tn(r+1-s),i&&(t=i-r-1)>0&&(o=o+"."+tn(t))):((t=r+1)<s&&(o=o.slice(0,t)+"."+o.slice(t)),i&&(t=i-s)>0&&(r+1===s&&(o+="."),o+=tn(t))),o}function X(n,e){var i=n[0];for(e*=7;i>=10;i/=10)e++;return e}function Y(n,e,i){if(e>B)throw A=!0,i&&(n.precision=i),Error(D);return K(new n(O),e,1,!0)}function nn(n,e,i){if(e>j)throw Error(D);return K(new n(S),e,i,!0)}function en(n){var e=n.length-1,i=7*e+1;if(e=n[e]){for(;e%10==0;e/=10)i--;for(e=n[0];e>=10;e/=10)i++}return i}function tn(n){for(var e="";n--;)e+="0";return e}function rn(n,e,i,t){var r,o=new n(1),s=Math.ceil(t/7+4);for(A=!1;;){if(i%2&&mn((o=o.times(e)).d,s)&&(r=!0),0===(i=I(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}mn((e=e.times(e)).d,s)}return A=!0,o}function on(n){return 1&n.d[n.d.length-1]}function sn(n,e,i){for(var t,r=new n(e[0]),o=0;++o<e.length;){if(!(t=new n(e[o])).s){r=t;break}r[i](t)&&(r=t)}return r}function un(n,e){var i,t,r,o,s,u,c,a=0,f=0,d=0,l=n.constructor,h=l.rounding,g=l.precision;if(!n.d||!n.d[0]||n.e>17)return new l(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:NaN);for(null==e?(A=!1,c=g):c=e,u=new l(.03125);n.e>-2;)n=n.times(u),d+=5;for(c+=t=Math.log(k(2,d))/Math.LN10*2+5|0,i=o=s=new l(1),l.precision=c;;){if(o=K(o.times(n),c,1),i=i.times(++f),V((u=s.plus(J(o,i,c,1))).d).slice(0,c)===V(s.d).slice(0,c)){for(r=d;r--;)s=K(s.times(s),c,1);if(null!=e)return l.precision=g,s;if(!(a<3&&W(s.d,c-t,h,a)))return K(s,l.precision=g,h,A=!0);l.precision=c+=10,i=o=u=new l(1),f=0,a++}s=u}}function cn(n,e){var i,t,r,o,s,u,c,a,f,d,l,h=1,g=n,p=g.d,m=g.constructor,w=m.rounding,v=m.precision;if(g.s<0||!p||!p[0]||!g.e&&1==p[0]&&1==p.length)return new m(p&&!p[0]?-1/0:1!=g.s?NaN:p?0:g);if(null==e?(A=!1,f=v):f=e,m.precision=f+=10,t=(i=V(p)).charAt(0),!(Math.abs(o=g.e)<15e14))return a=Y(m,f+2,v).times(o+""),g=cn(new m(t+"."+i.slice(1)),f-10).plus(a),m.precision=v,null==e?K(g,v,w,A=!0):g;for(;t<7&&1!=t||1==t&&i.charAt(1)>3;)t=(i=V((g=g.times(n)).d)).charAt(0),h++;for(o=g.e,t>1?(g=new m("0."+i),o++):g=new m(t+"."+i.slice(1)),d=g,c=s=g=J(g.minus(1),g.plus(1),f,1),l=K(g.times(g),f,1),r=3;;){if(s=K(s.times(l),f,1),V((a=c.plus(J(s,new m(r),f,1))).d).slice(0,f)===V(c.d).slice(0,f)){if(c=c.times(2),0!==o&&(c=c.plus(Y(m,f+2,v).times(o+""))),c=J(c,new m(h),f,1),null!=e)return m.precision=v,c;if(!W(c.d,f-10,w,u))return K(c,m.precision=v,w,A=!0);m.precision=f+=10,a=s=g=J(d.minus(1),d.plus(1),f,1),l=K(g.times(g),f,1),r=u=1}c=a,r+=2}}function an(n){return String(n.s*n.s/0)}function fn(n,e){var i,t,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(t=e.search(/e/i))>0?(i<0&&(i=t),i+=+e.slice(t+1),e=e.substring(0,t)):i<0&&(i=e.length),t=0;48===e.charCodeAt(t);t++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(t,r)){if(r-=t,n.e=i=i-t-1,n.d=[],t=(i+1)%7,i<0&&(t+=7),t<r){for(t&&n.d.push(+e.slice(0,t)),r-=7;t<r;)n.d.push(+e.slice(t,t+=7));t=7-(e=e.slice(t)).length}else t-=r;for(;t--;)e+="0";n.d.push(+e),A&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function dn(n,e){var i,t,r,o,s,u,c,a,f;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),H.test(e))return fn(n,e)}else if("Infinity"===e||"NaN"===e)return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(Z.test(e))i=16,e=e.toLowerCase();else if(U.test(e))i=2;else{if(!L.test(e))throw Error(R+e);i=8}for((o=e.search(/p/i))>0?(c=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),s=(o=e.indexOf("."))>=0,t=n.constructor,s&&(o=(u=(e=e.replace(".","")).length)-o,r=rn(t,new t(i),o,2*o)),o=f=(a=z(e,i,_)).length-1;0===a[o];--o)a.pop();return o<0?new t(0*n.s):(n.e=X(a,f),n.d=a,A=!1,s&&(n=J(n,r,4*u)),c&&(n=n.times(Math.abs(c)<54?k(2,c):te.pow(2,c))),A=!0,n)}function ln(n,e,i,t,r){var o,s,u,c,a=n.precision,f=Math.ceil(a/7);for(A=!1,c=i.times(i),u=new n(t);;){if(s=J(u.times(c),new n(e++*e++),a,1),u=r?t.plus(s):t.minus(s),t=J(s.times(c),new n(e++*e++),a,1),void 0!==(s=u.plus(t)).d[f]){for(o=f;s.d[o]===u.d[o]&&o--;);if(-1==o)break}o=u,u=t,t=s,s=o}return A=!0,s.d.length=f+1,s}function hn(n,e){for(var i=n;--e;)i*=n;return i}function gn(n,e){var i,t=e.s<0,r=nn(n,n.precision,1),o=r.times(.5);if((e=e.abs()).lte(o))return b=t?4:1,e;if((i=e.divToInt(r)).isZero())b=t?3:2;else{if((e=e.minus(i.times(r))).lte(o))return b=on(i)?t?2:3:t?4:1,e;b=on(i)?t?1:4:t?3:2}return e.minus(r).abs()}function pn(n,e,i,t){var r,o,s,u,c,a,f,d,l,h=n.constructor,g=void 0!==i;if(g?($(i,1,P),void 0===t?t=h.rounding:$(t,0,8)):(i=h.precision,t=h.rounding),n.isFinite()){for(g?(r=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):r=e,(s=(f=Q(n)).indexOf("."))>=0&&(f=f.replace(".",""),(l=new h(1)).e=f.length-s,l.d=z(Q(l),10,r),l.e=l.d.length),o=c=(d=z(f,10,r)).length;0==d[--c];)d.pop();if(d[0]){if(s<0?o--:((n=new h(n)).d=d,n.e=o,d=(n=J(n,l,i,t,0,r)).d,o=n.e,a=E),s=d[i],u=r/2,a=a||void 0!==d[i+1],a=t<4?(void 0!==s||a)&&(0===t||t===(n.s<0?3:2)):s>u||s===u&&(4===t||a||6===t&&1&d[i-1]||t===(n.s<0?8:7)),d.length=i,a)for(;++d[--i]>r-1;)d[i]=0,i||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,f="";s<c;s++)f+=M.charAt(d[s]);if(g){if(c>1)if(16==e||8==e){for(s=16==e?4:3,--c;c%s;c++)f+="0";for(c=(d=z(f,r,e)).length;!d[c-1];--c);for(s=1,f="1.";s<c;s++)f+=M.charAt(d[s])}else f=f.charAt(0)+"."+f.slice(1);f=f+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)f="0"+f;f="0."+f}else if(++o>c)for(o-=c;o--;)f+="0";else o<c&&(f=f.slice(0,o)+"."+f.slice(o))}else f=g?"0p+0":"0";f=(16==e?"0x":2==e?"0b":8==e?"0o":"")+f}else f=an(n);return n.s<0?"-"+f:f}function mn(n,e){if(n.length>e)return n.length=e,!0}function wn(n){return new this(n).abs()}function vn(n){return new this(n).acos()}function Nn(n){return new this(n).acosh()}function yn(n,e){return new this(n).plus(e)}function En(n){return new this(n).asin()}function bn(n){return new this(n).asinh()}function xn(n){return new this(n).atan()}function Pn(n){return new this(n).atanh()}function Mn(n,e){n=new this(n),e=new this(e);var i,t=this.precision,r=this.rounding,o=t+4;return n.s&&e.s?n.d||e.d?!e.d||n.isZero()?(i=e.s<0?nn(this,t,r):new this(0)).s=n.s:!n.d||e.isZero()?(i=nn(this,o,1).times(.5)).s=n.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(J(n,e,o,1)),e=nn(this,o,1),this.precision=t,this.rounding=r,i=n.s<0?i.minus(e):i.plus(e)):i=this.atan(J(n,e,o,1)):(i=nn(this,o,1).times(e.s>0?.25:.75)).s=n.s:i=new this(NaN),i}function On(n){return new this(n).cbrt()}function Sn(n){return K(n=new this(n),n.e+1,2)}function Tn(n,e,i){return new this(n).clamp(e,i)}function An(n){if(!n||"object"!=typeof n)throw Error(q+"Object expected");var e,i,t,r=!0===n.defaults,o=["precision",1,P,"rounding",0,8,"toExpNeg",-x,0,"toExpPos",0,x,"maxE",0,x,"minE",-x,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(i=o[e],r&&(this[i]=T[i]),void 0!==(t=n[i])){if(!(I(t)===t&&t>=o[e+1]&&t<=o[e+2]))throw Error(R+i+": "+t);this[i]=t}if(i="crypto",r&&(this[i]=T[i]),void 0!==(t=n[i])){if(!0!==t&&!1!==t&&0!==t&&1!==t)throw Error(R+i+": "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(F);this[i]=!0}else this[i]=!1}return this}function qn(n){return new this(n).cos()}function Rn(n){return new this(n).cosh()}function Dn(n,e){return new this(n).div(e)}function Fn(n){return new this(n).exp()}function Cn(n){return K(n=new this(n),n.e+1,3)}function In(){var n,e,i=new this(0);for(A=!1,n=0;n<arguments.length;)if((e=new this(arguments[n++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return A=!0,new this(1/0);i=e}return A=!0,i.sqrt()}function kn(n){return n instanceof te||n&&n.toStringTag===C||!1}function Un(n){return new this(n).ln()}function Zn(n,e){return new this(n).log(e)}function Ln(n){return new this(n).log(2)}function Hn(n){return new this(n).log(10)}function _n(){return sn(this,arguments,"lt")}function Bn(){return sn(this,arguments,"gt")}function jn(n,e){return new this(n).mod(e)}function Gn(n,e){return new this(n).mul(e)}function Vn(n,e){return new this(n).pow(e)}function $n(n){var e,i,t,r,o=0,s=new this(1),u=[];if(void 0===n?n=this.precision:$(n,1,P),t=Math.ceil(n/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(t));o<t;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(F);for(e=crypto.randomBytes(t*=4);o<t;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(u.push(r%1e7),o+=4);o=t/4}else for(;o<t;)u[o++]=1e7*Math.random()|0;for(n%=7,(t=u[--o])&&n&&(r=k(10,7-n),u[o]=(t/r|0)*r);0===u[o];o--)u.pop();if(o<0)i=0,u=[0];else{for(i=-1;0===u[0];i-=7)u.shift();for(t=1,r=u[0];r>=10;r/=10)t++;t<7&&(i-=7-t)}return s.e=i,s.d=u,s}function Wn(n){return K(n=new this(n),n.e+1,this.rounding)}function zn(n){return(n=new this(n)).d?n.d[0]?n.s:0*n.s:n.s||NaN}function Jn(n){return new this(n).sin()}function Kn(n){return new this(n).sinh()}function Qn(n){return new this(n).sqrt()}function Xn(n,e){return new this(n).sub(e)}function Yn(){var n=0,e=arguments,i=new this(e[n]);for(A=!1;i.s&&++n<e.length;)i=i.plus(e[n]);return A=!0,K(i,this.precision,this.rounding)}function ne(n){return new this(n).tan()}function ee(n){return new this(n).tanh()}function ie(n){return K(n=new this(n),n.e+1,1)}G[Symbol.for("nodejs.util.inspect.custom")]=G.toString,G[Symbol.toStringTag]="Decimal";var te=G.constructor=function n(e){var i,t,r;function o(n){var e,i,t,r=this;if(!(r instanceof o))return new o(n);if(r.constructor=o,kn(n))return r.s=n.s,void(A?!n.d||n.e>o.maxE?(r.e=NaN,r.d=null):n.e<o.minE?(r.e=0,r.d=[0]):(r.e=n.e,r.d=n.d.slice()):(r.e=n.e,r.d=n.d?n.d.slice():n.d));if("number"==(t=typeof n)){if(0===n)return r.s=1/n<0?-1:1,r.e=0,void(r.d=[0]);if(n<0?(n=-n,r.s=-1):r.s=1,n===~~n&&n<1e7){for(e=0,i=n;i>=10;i/=10)e++;return void(A?e>o.maxE?(r.e=NaN,r.d=null):e<o.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[n]):(r.e=e,r.d=[n]))}return 0*n!=0?(n||(r.s=NaN),r.e=NaN,void(r.d=null)):fn(r,n.toString())}if("string"!==t)throw Error(R+n);return 45===(i=n.charCodeAt(0))?(n=n.slice(1),r.s=-1):(43===i&&(n=n.slice(1)),r.s=1),H.test(n)?fn(r,n):dn(r,n)}if(o.prototype=G,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=An,o.clone=n,o.isDecimal=kn,o.abs=wn,o.acos=vn,o.acosh=Nn,o.add=yn,o.asin=En,o.asinh=bn,o.atan=xn,o.atanh=Pn,o.atan2=Mn,o.cbrt=On,o.ceil=Sn,o.clamp=Tn,o.cos=qn,o.cosh=Rn,o.div=Dn,o.exp=Fn,o.floor=Cn,o.hypot=In,o.ln=Un,o.log=Zn,o.log10=Hn,o.log2=Ln,o.max=_n,o.min=Bn,o.mod=jn,o.mul=Gn,o.pow=Vn,o.random=$n,o.round=Wn,o.sign=zn,o.sin=Jn,o.sinh=Kn,o.sqrt=Qn,o.sub=Xn,o.sum=Yn,o.tan=ne,o.tanh=ee,o.trunc=ie,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(t=r[i++])||(e[t]=this[t]);return o.config(e),o}(T);O=new te(O),S=new te(S);const re=te,oe=n=>new re(n).toDecimalPlaces(2).toNumber();module.exports=e})();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ export type IAuxiliaryFilter = {
|
|
|
13
13
|
requireInput?: boolean;
|
|
14
14
|
/** If set to true, and user decides to filter by 3rd entry, 1st & 2nd also works */
|
|
15
15
|
includeAllAbove: boolean;
|
|
16
|
-
options:
|
|
16
|
+
options: {
|
|
17
17
|
value: string | number;
|
|
18
18
|
label: string;
|
|
19
19
|
}[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/utils/index.d.ts
CHANGED
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rounds a monetary amount to two decimal places.
|
|
3
|
+
*
|
|
4
|
+
* This is used to avoid issues with floating point arithmetic, which can lead to integration problems
|
|
5
|
+
* with some systems, such as RMS.
|
|
6
|
+
*
|
|
7
|
+
* @param amount a string or number to be rounded
|
|
8
|
+
* @returns the rounded amount as a number
|
|
9
|
+
*/
|
|
10
|
+
export declare const roundMoney: (amount: string | number) => number;
|
|
File without changes
|
package/dist/web.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/*! For license information please see web.js.LICENSE.txt */
|
|
2
|
+
define("@roomstay/core",[],(()=>(()=>{"use strict";var n={d:(e,i)=>{for(var t in i)n.o(i,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:i[t]})},o:(n,e)=>Object.prototype.hasOwnProperty.call(n,e),r:n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},e={};let i,t,r,o,s,u,c,a,f,d,l,h,g,p;function m(n){return n.toUpperCase()}n.r(e),n.d(e,{EBookingPaymentMethod:()=>t,ECompanyProvider:()=>s,EDistanceUnitType:()=>u,EGuarantyPolicyPrepaymentType:()=>g,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>c,EHotelStateFieldConfiguration:()=>a,EHotelWeekdayStartsOn:()=>f,EIntegration:()=>d,EPlanpayBookingStatus:()=>o,ERMSDiscountType:()=>l,ERoomstayImageSize:()=>h,HttpMethod:()=>p,IBookingStatus:()=>i,calculateTotalForMemberBooking:()=>w,nameof:()=>N,resizeRoomstayImageUrl:()=>v,roundMoney:()=>oe,subset:()=>y,uppercaseString:()=>m}),function(n){n.Pending="Pending",n.Committed="Committed",n.Cancelled="Cancelled"}(i||(i={})),function(n){n.Card="Card",n.SavedCard="SavedCard",n.Planpay="Planpay",n.Adyen="Adyen"}(t||(t={})),function(n){n.Passthrough="Passthrough",n.Adyen="Adyen",n.Till="Till",n.RMSPay="RMSPay"}(r||(r={})),function(n){n.Unknown="unknown",n.Unpaid="unpaid",n.Accepted="accepted",n.Cancelled="cancelled",n.Refunded="refunded",n.Rejected="rejected"}(o||(o={})),function(n){n.Synxis="Synxis",n.Availpro="Availpro",n.RMS="RMS",n.Siteminder="Siteminder",n.Roomstay="Roomstay"}(s||(s={})),function(n){n.Metric="metric",n.Imperial="imperial"}(u||(u={})),function(n){n.PerPerson="PerPerson",n.PerDay="PerDay",n.PerOccupancy="PerOccupancy"}(c||(c={})),function(n){n.NotIncluded="NotIncluded",n.Optional="Optional",n.Required="Required"}(a||(a={})),function(n){n.Monday="monday",n.Sunday="sunday"}(f||(f={})),function(n){n.Big4="Big4",n.Top10="Top10",n.Gday="Gday",n.Salesforce="Salesforce"}(d||(d={})),function(n){n.Percentage="Percentage",n.Amount="Amount",n.Bogo="BOGO",n.NightlyRateOverride="NightlyRateOverride"}(l||(l={})),function(n){n[n.Icon=128]="Icon",n[n.Tiny=256]="Tiny",n[n.Small=512]="Small",n[n.Medium=768]="Medium",n[n.Large=1024]="Large",n[n.ExtraLarge=1600]="ExtraLarge"}(h||(h={})),function(n){n.FixedAmount="fixed",n.Percentage="percentage",n.Nights="nights"}(g||(g={})),function(n){n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n.PATCH="PATCH",n.OPTIONS="OPTIONS",n.HEAD="HEAD"}(p||(p={}));const w=n=>{let e=0;const i=Object.values(n.itinerary);for(const n of i){const i=Object.keys(n.nights);for(const t of i)e+=n.nights[t].total}return e},v=(n,e)=>n.includes("cdn.app.roomstay.io")?n+"?w="+e:n,N=n=>n,y=(n,e)=>{const i={};return e.forEach((e=>{e in n&&(i[e]=n[e])})),i};var E,b,x=9e15,P=1e9,M="0123456789abcdef",O="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",S="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",T={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-x,maxE:x,crypto:!1},A=!0,q="[DecimalError] ",R=q+"Invalid argument: ",D=q+"Precision limit exceeded",F=q+"crypto unavailable",C="[object Decimal]",I=Math.floor,k=Math.pow,U=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Z=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,L=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,H=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,B=O.length-1,j=S.length-1,G={toStringTag:C};function V(n){var e,i,t,r=n.length-1,o="",s=n[0];if(r>0){for(o+=s,e=1;e<r;e++)(i=7-(t=n[e]+"").length)&&(o+=tn(i)),o+=t;(i=7-(t=(s=n[e])+"").length)&&(o+=tn(i))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function $(n,e,i){if(n!==~~n||n<e||n>i)throw Error(R+n)}function W(n,e,i,t){var r,o,s,u;for(o=n[0];o>=10;o/=10)--e;return--e<0?(e+=7,r=0):(r=Math.ceil((e+1)/7),e%=7),o=k(10,7-e),u=n[r]%o|0,null==t?e<3?(0==e?u=u/100|0:1==e&&(u=u/10|0),s=i<4&&99999==u||i>3&&49999==u||5e4==u||0==u):s=(i<4&&u+1==o||i>3&&u+1==o/2)&&(n[r+1]/o/100|0)==k(10,e-2)-1||(u==o/2||0==u)&&0==(n[r+1]/o/100|0):e<4?(0==e?u=u/1e3|0:1==e?u=u/100|0:2==e&&(u=u/10|0),s=(t||i<4)&&9999==u||!t&&i>3&&4999==u):s=((t||i<4)&&u+1==o||!t&&i>3&&u+1==o/2)&&(n[r+1]/o/1e3|0)==k(10,e-3)-1,s}function z(n,e,i){for(var t,r,o=[0],s=0,u=n.length;s<u;){for(r=o.length;r--;)o[r]*=e;for(o[0]+=M.indexOf(n.charAt(s++)),t=0;t<o.length;t++)o[t]>i-1&&(void 0===o[t+1]&&(o[t+1]=0),o[t+1]+=o[t]/i|0,o[t]%=i)}return o.reverse()}G.absoluteValue=G.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),K(n)},G.ceil=function(){return K(new this.constructor(this),this.e+1,2)},G.clampedTo=G.clamp=function(n,e){var i=this,t=i.constructor;if(n=new t(n),e=new t(e),!n.s||!e.s)return new t(NaN);if(n.gt(e))throw Error(R+e);return i.cmp(n)<0?n:i.cmp(e)>0?e:new t(i)},G.comparedTo=G.cmp=function(n){var e,i,t,r,o=this,s=o.d,u=(n=new o.constructor(n)).d,c=o.s,a=n.s;if(!s||!u)return c&&a?c!==a?c:s===u?0:!s^c<0?1:-1:NaN;if(!s[0]||!u[0])return s[0]?c:u[0]?-a:0;if(c!==a)return c;if(o.e!==n.e)return o.e>n.e^c<0?1:-1;for(e=0,i=(t=s.length)<(r=u.length)?t:r;e<i;++e)if(s[e]!==u[e])return s[e]>u[e]^c<0?1:-1;return t===r?0:t>r^c<0?1:-1},G.cosine=G.cos=function(){var n,e,i=this,t=i.constructor;return i.d?i.d[0]?(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+7,t.rounding=1,i=function(n,e){var i,t,r;if(e.isZero())return e;(t=e.d.length)<32?r=(1/hn(4,i=Math.ceil(t/3))).toString():(i=16,r="2.3283064365386962890625e-10"),n.precision+=i,e=ln(n,1,e.times(r),new n(1));for(var o=i;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return n.precision-=i,e}(t,gn(t,i)),t.precision=n,t.rounding=e,K(2==b||3==b?i.neg():i,n,e,!0)):new t(1):new t(NaN)},G.cubeRoot=G.cbrt=function(){var n,e,i,t,r,o,s,u,c,a,f=this,d=f.constructor;if(!f.isFinite()||f.isZero())return new d(f);for(A=!1,(o=f.s*k(f.s*f,1/3))&&Math.abs(o)!=1/0?t=new d(o.toString()):(i=V(f.d),(o=((n=f.e)-i.length+1)%3)&&(i+=1==o||-2==o?"0":"00"),o=k(i,1/3),n=I((n+1)/3)-(n%3==(n<0?-1:2)),(t=new d(i=o==1/0?"5e"+n:(i=o.toExponential()).slice(0,i.indexOf("e")+1)+n)).s=f.s),s=(n=d.precision)+3;;)if(a=(c=(u=t).times(u).times(u)).plus(f),t=J(a.plus(f).times(u),a.plus(c),s+2,1),V(u.d).slice(0,s)===(i=V(t.d)).slice(0,s)){if("9999"!=(i=i.slice(s-3,s+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(K(t,n+1,1),e=!t.times(t).times(t).eq(f));break}if(!r&&(K(u,n+1,0),u.times(u).times(u).eq(f))){t=u;break}s+=4,r=1}return A=!0,K(t,n,d.rounding,e)},G.decimalPlaces=G.dp=function(){var n,e=this.d,i=NaN;if(e){if(i=7*((n=e.length-1)-I(this.e/7)),n=e[n])for(;n%10==0;n/=10)i--;i<0&&(i=0)}return i},G.dividedBy=G.div=function(n){return J(this,new this.constructor(n))},G.dividedToIntegerBy=G.divToInt=function(n){var e=this.constructor;return K(J(this,new e(n),0,1,1),e.precision,e.rounding)},G.equals=G.eq=function(n){return 0===this.cmp(n)},G.floor=function(){return K(new this.constructor(this),this.e+1,3)},G.greaterThan=G.gt=function(n){return this.cmp(n)>0},G.greaterThanOrEqualTo=G.gte=function(n){var e=this.cmp(n);return 1==e||0===e},G.hyperbolicCosine=G.cosh=function(){var n,e,i,t,r,o=this,s=o.constructor,u=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return u;i=s.precision,t=s.rounding,s.precision=i+Math.max(o.e,o.sd())+4,s.rounding=1,(r=o.d.length)<32?e=(1/hn(4,n=Math.ceil(r/3))).toString():(n=16,e="2.3283064365386962890625e-10"),o=ln(s,1,o.times(e),new s(1),!0);for(var c,a=n,f=new s(8);a--;)c=o.times(o),o=u.minus(c.times(f.minus(c.times(f))));return K(o,s.precision=i,s.rounding=t,!0)},G.hyperbolicSine=G.sinh=function(){var n,e,i,t,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,i=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,(t=r.d.length)<3)r=ln(o,2,r,r,!0);else{n=(n=1.4*Math.sqrt(t))>16?16:0|n,r=ln(o,2,r=r.times(1/hn(5,n)),r,!0);for(var s,u=new o(5),c=new o(16),a=new o(20);n--;)s=r.times(r),r=r.times(u.plus(s.times(c.times(s).plus(a))))}return o.precision=e,o.rounding=i,K(r,e,i,!0)},G.hyperbolicTangent=G.tanh=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+7,t.rounding=1,J(i.sinh(),i.cosh(),t.precision=n,t.rounding=e)):new t(i.s)},G.inverseCosine=G.acos=function(){var n,e=this,i=e.constructor,t=e.abs().cmp(1),r=i.precision,o=i.rounding;return-1!==t?0===t?e.isNeg()?nn(i,r,o):new i(0):new i(NaN):e.isZero()?nn(i,r+4,o).times(.5):(i.precision=r+6,i.rounding=1,e=e.asin(),n=nn(i,r+4,o).times(.5),i.precision=r,i.rounding=o,n.minus(e))},G.inverseHyperbolicCosine=G.acosh=function(){var n,e,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(n=t.precision,e=t.rounding,t.precision=n+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,A=!1,i=i.times(i).minus(1).sqrt().plus(i),A=!0,t.precision=n,t.rounding=e,i.ln()):new t(i)},G.inverseHyperbolicSine=G.asinh=function(){var n,e,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,A=!1,i=i.times(i).plus(1).sqrt().plus(i),A=!0,t.precision=n,t.rounding=e,i.ln())},G.inverseHyperbolicTangent=G.atanh=function(){var n,e,i,t,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=o.precision,e=o.rounding,t=r.sd(),Math.max(t,n)<2*-r.e-1?K(new o(r),n,e,!0):(o.precision=i=t-r.e,r=J(r.plus(1),new o(1).minus(r),i+n,1),o.precision=n+4,o.rounding=1,r=r.ln(),o.precision=n,o.rounding=e,r.times(.5))):new o(NaN)},G.inverseSine=G.asin=function(){var n,e,i,t,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),i=o.precision,t=o.rounding,-1!==e?0===e?((n=nn(o,i+4,t).times(.5)).s=r.s,n):new o(NaN):(o.precision=i+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=i,o.rounding=t,r.times(2)))},G.inverseTangent=G.atan=function(){var n,e,i,t,r,o,s,u,c,a=this,f=a.constructor,d=f.precision,l=f.rounding;if(a.isFinite()){if(a.isZero())return new f(a);if(a.abs().eq(1)&&d+4<=j)return(s=nn(f,d+4,l).times(.25)).s=a.s,s}else{if(!a.s)return new f(NaN);if(d+4<=j)return(s=nn(f,d+4,l).times(.5)).s=a.s,s}for(f.precision=u=d+10,f.rounding=1,n=i=Math.min(28,u/7+2|0);n;--n)a=a.div(a.times(a).plus(1).sqrt().plus(1));for(A=!1,e=Math.ceil(u/7),t=1,c=a.times(a),s=new f(a),r=a;-1!==n;)if(r=r.times(c),o=s.minus(r.div(t+=2)),r=r.times(c),void 0!==(s=o.plus(r.div(t+=2))).d[e])for(n=e;s.d[n]===o.d[n]&&n--;);return i&&(s=s.times(2<<i-1)),A=!0,K(s,f.precision=d,f.rounding=l,!0)},G.isFinite=function(){return!!this.d},G.isInteger=G.isInt=function(){return!!this.d&&I(this.e/7)>this.d.length-2},G.isNaN=function(){return!this.s},G.isNegative=G.isNeg=function(){return this.s<0},G.isPositive=G.isPos=function(){return this.s>0},G.isZero=function(){return!!this.d&&0===this.d[0]},G.lessThan=G.lt=function(n){return this.cmp(n)<0},G.lessThanOrEqualTo=G.lte=function(n){return this.cmp(n)<1},G.logarithm=G.log=function(n){var e,i,t,r,o,s,u,c,a=this,f=a.constructor,d=f.precision,l=f.rounding;if(null==n)n=new f(10),e=!0;else{if(i=(n=new f(n)).d,n.s<0||!i||!i[0]||n.eq(1))return new f(NaN);e=n.eq(10)}if(i=a.d,a.s<0||!i||!i[0]||a.eq(1))return new f(i&&!i[0]?-1/0:1!=a.s?NaN:i?0:1/0);if(e)if(i.length>1)o=!0;else{for(r=i[0];r%10==0;)r/=10;o=1!==r}if(A=!1,s=cn(a,u=d+5),t=e?Y(f,u+10):cn(n,u),W((c=J(s,t,u,1)).d,r=d,l))do{if(s=cn(a,u+=10),t=e?Y(f,u+10):cn(n,u),c=J(s,t,u,1),!o){+V(c.d).slice(r+1,r+15)+1==1e14&&(c=K(c,d+1,0));break}}while(W(c.d,r+=10,l));return A=!0,K(c,d,l)},G.minus=G.sub=function(n){var e,i,t,r,o,s,u,c,a,f,d,l,h=this,g=h.constructor;if(n=new g(n),!h.d||!n.d)return h.s&&n.s?h.d?n.s=-n.s:n=new g(n.d||h.s!==n.s?h:NaN):n=new g(NaN),n;if(h.s!=n.s)return n.s=-n.s,h.plus(n);if(a=h.d,l=n.d,u=g.precision,c=g.rounding,!a[0]||!l[0]){if(l[0])n.s=-n.s;else{if(!a[0])return new g(3===c?-0:0);n=new g(h)}return A?K(n,u,c):n}if(i=I(n.e/7),f=I(h.e/7),a=a.slice(),o=f-i){for((d=o<0)?(e=a,o=-o,s=l.length):(e=l,i=f,s=a.length),o>(t=Math.max(Math.ceil(u/7),s)+2)&&(o=t,e.length=1),e.reverse(),t=o;t--;)e.push(0);e.reverse()}else{for((d=(t=a.length)<(s=l.length))&&(s=t),t=0;t<s;t++)if(a[t]!=l[t]){d=a[t]<l[t];break}o=0}for(d&&(e=a,a=l,l=e,n.s=-n.s),s=a.length,t=l.length-s;t>0;--t)a[s++]=0;for(t=l.length;t>o;){if(a[--t]<l[t]){for(r=t;r&&0===a[--r];)a[r]=_-1;--a[r],a[t]+=_}a[t]-=l[t]}for(;0===a[--s];)a.pop();for(;0===a[0];a.shift())--i;return a[0]?(n.d=a,n.e=X(a,i),A?K(n,u,c):n):new g(3===c?-0:0)},G.modulo=G.mod=function(n){var e,i=this,t=i.constructor;return n=new t(n),!i.d||!n.s||n.d&&!n.d[0]?new t(NaN):!n.d||i.d&&!i.d[0]?K(new t(i),t.precision,t.rounding):(A=!1,9==t.modulo?(e=J(i,n.abs(),0,3,1)).s*=n.s:e=J(i,n,0,t.modulo,1),e=e.times(n),A=!0,i.minus(e))},G.naturalExponential=G.exp=function(){return un(this)},G.naturalLogarithm=G.ln=function(){return cn(this)},G.negated=G.neg=function(){var n=new this.constructor(this);return n.s=-n.s,K(n)},G.plus=G.add=function(n){var e,i,t,r,o,s,u,c,a,f,d=this,l=d.constructor;if(n=new l(n),!d.d||!n.d)return d.s&&n.s?d.d||(n=new l(n.d||d.s===n.s?d:NaN)):n=new l(NaN),n;if(d.s!=n.s)return n.s=-n.s,d.minus(n);if(a=d.d,f=n.d,u=l.precision,c=l.rounding,!a[0]||!f[0])return f[0]||(n=new l(d)),A?K(n,u,c):n;if(o=I(d.e/7),t=I(n.e/7),a=a.slice(),r=o-t){for(r<0?(i=a,r=-r,s=f.length):(i=f,t=o,s=a.length),r>(s=(o=Math.ceil(u/7))>s?o+1:s+1)&&(r=s,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((s=a.length)-(r=f.length)<0&&(r=s,i=f,f=a,a=i),e=0;r;)e=(a[--r]=a[r]+f[r]+e)/_|0,a[r]%=_;for(e&&(a.unshift(e),++t),s=a.length;0==a[--s];)a.pop();return n.d=a,n.e=X(a,t),A?K(n,u,c):n},G.precision=G.sd=function(n){var e,i=this;if(void 0!==n&&n!==!!n&&1!==n&&0!==n)throw Error(R+n);return i.d?(e=en(i.d),n&&i.e+1>e&&(e=i.e+1)):e=NaN,e},G.round=function(){var n=this,e=n.constructor;return K(new e(n),n.e+1,e.rounding)},G.sine=G.sin=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+Math.max(i.e,i.sd())+7,t.rounding=1,i=function(n,e){var i,t=e.d.length;if(t<3)return e.isZero()?e:ln(n,2,e,e);i=(i=1.4*Math.sqrt(t))>16?16:0|i,e=ln(n,2,e=e.times(1/hn(5,i)),e);for(var r,o=new n(5),s=new n(16),u=new n(20);i--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(u))));return e}(t,gn(t,i)),t.precision=n,t.rounding=e,K(b>2?i.neg():i,n,e,!0)):new t(NaN)},G.squareRoot=G.sqrt=function(){var n,e,i,t,r,o,s=this,u=s.d,c=s.e,a=s.s,f=s.constructor;if(1!==a||!u||!u[0])return new f(!a||a<0&&(!u||u[0])?NaN:u?s:1/0);for(A=!1,0==(a=Math.sqrt(+s))||a==1/0?(((e=V(u)).length+c)%2==0&&(e+="0"),a=Math.sqrt(e),c=I((c+1)/2)-(c<0||c%2),t=new f(e=a==1/0?"5e"+c:(e=a.toExponential()).slice(0,e.indexOf("e")+1)+c)):t=new f(a.toString()),i=(c=f.precision)+3;;)if(t=(o=t).plus(J(s,o,i+2,1)).times(.5),V(o.d).slice(0,i)===(e=V(t.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(K(t,c+1,1),n=!t.times(t).eq(s));break}if(!r&&(K(o,c+1,0),o.times(o).eq(s))){t=o;break}i+=4,r=1}return A=!0,K(t,c,f.rounding,n)},G.tangent=G.tan=function(){var n,e,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(n=t.precision,e=t.rounding,t.precision=n+10,t.rounding=1,(i=i.sin()).s=1,i=J(i,new t(1).minus(i.times(i)).sqrt(),n+10,0),t.precision=n,t.rounding=e,K(2==b||4==b?i.neg():i,n,e,!0)):new t(NaN)},G.times=G.mul=function(n){var e,i,t,r,o,s,u,c,a,f=this,d=f.constructor,l=f.d,h=(n=new d(n)).d;if(n.s*=f.s,!(l&&l[0]&&h&&h[0]))return new d(!n.s||l&&!l[0]&&!h||h&&!h[0]&&!l?NaN:l&&h?0*n.s:n.s/0);for(i=I(f.e/7)+I(n.e/7),(c=l.length)<(a=h.length)&&(o=l,l=h,h=o,s=c,c=a,a=s),o=[],t=s=c+a;t--;)o.push(0);for(t=a;--t>=0;){for(e=0,r=c+t;r>t;)u=o[r]+h[t]*l[r-t-1]+e,o[r--]=u%_|0,e=u/_|0;o[r]=(o[r]+e)%_|0}for(;!o[--s];)o.pop();return e?++i:o.shift(),n.d=o,n.e=X(o,i),A?K(n,d.precision,d.rounding):n},G.toBinary=function(n,e){return pn(this,2,n,e)},G.toDecimalPlaces=G.toDP=function(n,e){var i=this,t=i.constructor;return i=new t(i),void 0===n?i:($(n,0,P),void 0===e?e=t.rounding:$(e,0,8),K(i,n+i.e+1,e))},G.toExponential=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=Q(t,!0):($(n,0,P),void 0===e?e=r.rounding:$(e,0,8),i=Q(t=K(new r(t),n+1,e),!0,n+1)),t.isNeg()&&!t.isZero()?"-"+i:i},G.toFixed=function(n,e){var i,t,r=this,o=r.constructor;return void 0===n?i=Q(r):($(n,0,P),void 0===e?e=o.rounding:$(e,0,8),i=Q(t=K(new o(r),n+r.e+1,e),!1,n+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},G.toFraction=function(n){var e,i,t,r,o,s,u,c,a,f,d,l,h=this,g=h.d,p=h.constructor;if(!g)return new p(h);if(a=i=new p(1),t=c=new p(0),s=(o=(e=new p(t)).e=en(g)-h.e-1)%7,e.d[0]=k(10,s<0?7+s:s),null==n)n=o>0?e:a;else{if(!(u=new p(n)).isInt()||u.lt(a))throw Error(R+u);n=u.gt(e)?o>0?e:a:u}for(A=!1,u=new p(V(g)),f=p.precision,p.precision=o=7*g.length*2;d=J(u,e,0,1,1),1!=(r=i.plus(d.times(t))).cmp(n);)i=t,t=r,r=a,a=c.plus(d.times(r)),c=r,r=e,e=u.minus(d.times(r)),u=r;return r=J(n.minus(i),t,0,1,1),c=c.plus(r.times(a)),i=i.plus(r.times(t)),c.s=a.s=h.s,l=J(a,t,o,1).minus(h).abs().cmp(J(c,i,o,1).minus(h).abs())<1?[a,t]:[c,i],p.precision=f,A=!0,l},G.toHexadecimal=G.toHex=function(n,e){return pn(this,16,n,e)},G.toNearest=function(n,e){var i=this,t=i.constructor;if(i=new t(i),null==n){if(!i.d)return i;n=new t(1),e=t.rounding}else{if(n=new t(n),void 0===e?e=t.rounding:$(e,0,8),!i.d)return n.s?i:n;if(!n.d)return n.s&&(n.s=i.s),n}return n.d[0]?(A=!1,i=J(i,n,0,e,1).times(n),A=!0,K(i)):(n.s=i.s,i=n),i},G.toNumber=function(){return+this},G.toOctal=function(n,e){return pn(this,8,n,e)},G.toPower=G.pow=function(n){var e,i,t,r,o,s,u=this,c=u.constructor,a=+(n=new c(n));if(!(u.d&&n.d&&u.d[0]&&n.d[0]))return new c(k(+u,a));if((u=new c(u)).eq(1))return u;if(t=c.precision,o=c.rounding,n.eq(1))return K(u,t,o);if((e=I(n.e/7))>=n.d.length-1&&(i=a<0?-a:a)<=9007199254740991)return r=rn(c,u,i,t),n.s<0?new c(1).div(r):K(r,t,o);if((s=u.s)<0){if(e<n.d.length-1)return new c(NaN);if(0==(1&n.d[e])&&(s=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=s,u}return(e=0!=(i=k(+u,a))&&isFinite(i)?new c(i+"").e:I(a*(Math.log("0."+V(u.d))/Math.LN10+u.e+1)))>c.maxE+1||e<c.minE-1?new c(e>0?s/0:0):(A=!1,c.rounding=u.s=1,i=Math.min(12,(e+"").length),(r=un(n.times(cn(u,t+i)),t)).d&&W((r=K(r,t+5,1)).d,t,o)&&(e=t+10,+V((r=K(un(n.times(cn(u,e+i)),e),e+5,1)).d).slice(t+1,t+15)+1==1e14&&(r=K(r,t+1,0))),r.s=s,A=!0,c.rounding=o,K(r,t,o))},G.toPrecision=function(n,e){var i,t=this,r=t.constructor;return void 0===n?i=Q(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):($(n,1,P),void 0===e?e=r.rounding:$(e,0,8),i=Q(t=K(new r(t),n,e),n<=t.e||t.e<=r.toExpNeg,n)),t.isNeg()&&!t.isZero()?"-"+i:i},G.toSignificantDigits=G.toSD=function(n,e){var i=this.constructor;return void 0===n?(n=i.precision,e=i.rounding):($(n,1,P),void 0===e?e=i.rounding:$(e,0,8)),K(new i(this),n,e)},G.toString=function(){var n=this,e=n.constructor,i=Q(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+i:i},G.truncated=G.trunc=function(){return K(new this.constructor(this),this.e+1,1)},G.valueOf=G.toJSON=function(){var n=this,e=n.constructor,i=Q(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+i:i};var J=function(){function n(n,e,i){var t,r=0,o=n.length;for(n=n.slice();o--;)t=n[o]*e+r,n[o]=t%i|0,r=t/i|0;return r&&n.unshift(r),n}function e(n,e,i,t){var r,o;if(i!=t)o=i>t?1:-1;else for(r=o=0;r<i;r++)if(n[r]!=e[r]){o=n[r]>e[r]?1:-1;break}return o}function i(n,e,i,t){for(var r=0;i--;)n[i]-=r,r=n[i]<e[i]?1:0,n[i]=r*t+n[i]-e[i];for(;!n[0]&&n.length>1;)n.shift()}return function(t,r,o,s,u,c){var a,f,d,l,h,g,p,m,w,v,N,y,b,x,P,M,O,S,T,A,q=t.constructor,R=t.s==r.s?1:-1,D=t.d,F=r.d;if(!(D&&D[0]&&F&&F[0]))return new q(t.s&&r.s&&(D?!F||D[0]!=F[0]:F)?D&&0==D[0]||!F?0*R:R/0:NaN);for(c?(h=1,f=t.e-r.e):(c=_,h=7,f=I(t.e/h)-I(r.e/h)),T=F.length,O=D.length,v=(w=new q(R)).d=[],d=0;F[d]==(D[d]||0);d++);if(F[d]>(D[d]||0)&&f--,null==o?(x=o=q.precision,s=q.rounding):x=u?o+(t.e-r.e)+1:o,x<0)v.push(1),g=!0;else{if(x=x/h+2|0,d=0,1==T){for(l=0,F=F[0],x++;(d<O||l)&&x--;d++)P=l*c+(D[d]||0),v[d]=P/F|0,l=P%F|0;g=l||d<O}else{for((l=c/(F[0]+1)|0)>1&&(F=n(F,l,c),D=n(D,l,c),T=F.length,O=D.length),M=T,y=(N=D.slice(0,T)).length;y<T;)N[y++]=0;(A=F.slice()).unshift(0),S=F[0],F[1]>=c/2&&++S;do{l=0,(a=e(F,N,T,y))<0?(b=N[0],T!=y&&(b=b*c+(N[1]||0)),(l=b/S|0)>1?(l>=c&&(l=c-1),1==(a=e(p=n(F,l,c),N,m=p.length,y=N.length))&&(l--,i(p,T<m?A:F,m,c))):(0==l&&(a=l=1),p=F.slice()),(m=p.length)<y&&p.unshift(0),i(N,p,y,c),-1==a&&(a=e(F,N,T,y=N.length))<1&&(l++,i(N,T<y?A:F,y,c)),y=N.length):0===a&&(l++,N=[0]),v[d++]=l,a&&N[0]?N[y++]=D[M]||0:(N=[D[M]],y=1)}while((M++<O||void 0!==N[0])&&x--);g=void 0!==N[0]}v[0]||v.shift()}if(1==h)w.e=f,E=g;else{for(d=1,l=v[0];l>=10;l/=10)d++;w.e=d+f*h-1,K(w,u?o+w.e+1:o,s,g)}return w}}();function K(n,e,i,t){var r,o,s,u,c,a,f,d,l,h=n.constructor;n:if(null!=e){if(!(d=n.d))return n;for(r=1,u=d[0];u>=10;u/=10)r++;if((o=e-r)<0)o+=7,s=e,c=(f=d[l=0])/k(10,r-s-1)%10|0;else if((l=Math.ceil((o+1)/7))>=(u=d.length)){if(!t)break n;for(;u++<=l;)d.push(0);f=c=0,r=1,s=(o%=7)-7+1}else{for(f=u=d[l],r=1;u>=10;u/=10)r++;c=(s=(o%=7)-7+r)<0?0:f/k(10,r-s-1)%10|0}if(t=t||e<0||void 0!==d[l+1]||(s<0?f:f%k(10,r-s-1)),a=i<4?(c||t)&&(0==i||i==(n.s<0?3:2)):c>5||5==c&&(4==i||t||6==i&&(o>0?s>0?f/k(10,r-s):0:d[l-1])%10&1||i==(n.s<0?8:7)),e<1||!d[0])return d.length=0,a?(e-=n.e+1,d[0]=k(10,(7-e%7)%7),n.e=-e||0):d[0]=n.e=0,n;if(0==o?(d.length=l,u=1,l--):(d.length=l+1,u=k(10,7-o),d[l]=s>0?(f/k(10,r-s)%k(10,s)|0)*u:0),a)for(;;){if(0==l){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=u,u=1;s>=10;s/=10)u++;o!=u&&(n.e++,d[0]==_&&(d[0]=1));break}if(d[l]+=u,d[l]!=_)break;d[l--]=0,u=1}for(o=d.length;0===d[--o];)d.pop()}return A&&(n.e>h.maxE?(n.d=null,n.e=NaN):n.e<h.minE&&(n.e=0,n.d=[0])),n}function Q(n,e,i){if(!n.isFinite())return an(n);var t,r=n.e,o=V(n.d),s=o.length;return e?(i&&(t=i-s)>0?o=o.charAt(0)+"."+o.slice(1)+tn(t):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):r<0?(o="0."+tn(-r-1)+o,i&&(t=i-s)>0&&(o+=tn(t))):r>=s?(o+=tn(r+1-s),i&&(t=i-r-1)>0&&(o=o+"."+tn(t))):((t=r+1)<s&&(o=o.slice(0,t)+"."+o.slice(t)),i&&(t=i-s)>0&&(r+1===s&&(o+="."),o+=tn(t))),o}function X(n,e){var i=n[0];for(e*=7;i>=10;i/=10)e++;return e}function Y(n,e,i){if(e>B)throw A=!0,i&&(n.precision=i),Error(D);return K(new n(O),e,1,!0)}function nn(n,e,i){if(e>j)throw Error(D);return K(new n(S),e,i,!0)}function en(n){var e=n.length-1,i=7*e+1;if(e=n[e]){for(;e%10==0;e/=10)i--;for(e=n[0];e>=10;e/=10)i++}return i}function tn(n){for(var e="";n--;)e+="0";return e}function rn(n,e,i,t){var r,o=new n(1),s=Math.ceil(t/7+4);for(A=!1;;){if(i%2&&mn((o=o.times(e)).d,s)&&(r=!0),0===(i=I(i/2))){i=o.d.length-1,r&&0===o.d[i]&&++o.d[i];break}mn((e=e.times(e)).d,s)}return A=!0,o}function on(n){return 1&n.d[n.d.length-1]}function sn(n,e,i){for(var t,r=new n(e[0]),o=0;++o<e.length;){if(!(t=new n(e[o])).s){r=t;break}r[i](t)&&(r=t)}return r}function un(n,e){var i,t,r,o,s,u,c,a=0,f=0,d=0,l=n.constructor,h=l.rounding,g=l.precision;if(!n.d||!n.d[0]||n.e>17)return new l(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:NaN);for(null==e?(A=!1,c=g):c=e,u=new l(.03125);n.e>-2;)n=n.times(u),d+=5;for(c+=t=Math.log(k(2,d))/Math.LN10*2+5|0,i=o=s=new l(1),l.precision=c;;){if(o=K(o.times(n),c,1),i=i.times(++f),V((u=s.plus(J(o,i,c,1))).d).slice(0,c)===V(s.d).slice(0,c)){for(r=d;r--;)s=K(s.times(s),c,1);if(null!=e)return l.precision=g,s;if(!(a<3&&W(s.d,c-t,h,a)))return K(s,l.precision=g,h,A=!0);l.precision=c+=10,i=o=u=new l(1),f=0,a++}s=u}}function cn(n,e){var i,t,r,o,s,u,c,a,f,d,l,h=1,g=n,p=g.d,m=g.constructor,w=m.rounding,v=m.precision;if(g.s<0||!p||!p[0]||!g.e&&1==p[0]&&1==p.length)return new m(p&&!p[0]?-1/0:1!=g.s?NaN:p?0:g);if(null==e?(A=!1,f=v):f=e,m.precision=f+=10,t=(i=V(p)).charAt(0),!(Math.abs(o=g.e)<15e14))return a=Y(m,f+2,v).times(o+""),g=cn(new m(t+"."+i.slice(1)),f-10).plus(a),m.precision=v,null==e?K(g,v,w,A=!0):g;for(;t<7&&1!=t||1==t&&i.charAt(1)>3;)t=(i=V((g=g.times(n)).d)).charAt(0),h++;for(o=g.e,t>1?(g=new m("0."+i),o++):g=new m(t+"."+i.slice(1)),d=g,c=s=g=J(g.minus(1),g.plus(1),f,1),l=K(g.times(g),f,1),r=3;;){if(s=K(s.times(l),f,1),V((a=c.plus(J(s,new m(r),f,1))).d).slice(0,f)===V(c.d).slice(0,f)){if(c=c.times(2),0!==o&&(c=c.plus(Y(m,f+2,v).times(o+""))),c=J(c,new m(h),f,1),null!=e)return m.precision=v,c;if(!W(c.d,f-10,w,u))return K(c,m.precision=v,w,A=!0);m.precision=f+=10,a=s=g=J(d.minus(1),d.plus(1),f,1),l=K(g.times(g),f,1),r=u=1}c=a,r+=2}}function an(n){return String(n.s*n.s/0)}function fn(n,e){var i,t,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(t=e.search(/e/i))>0?(i<0&&(i=t),i+=+e.slice(t+1),e=e.substring(0,t)):i<0&&(i=e.length),t=0;48===e.charCodeAt(t);t++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(t,r)){if(r-=t,n.e=i=i-t-1,n.d=[],t=(i+1)%7,i<0&&(t+=7),t<r){for(t&&n.d.push(+e.slice(0,t)),r-=7;t<r;)n.d.push(+e.slice(t,t+=7));t=7-(e=e.slice(t)).length}else t-=r;for(;t--;)e+="0";n.d.push(+e),A&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function dn(n,e){var i,t,r,o,s,u,c,a,f;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),H.test(e))return fn(n,e)}else if("Infinity"===e||"NaN"===e)return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(Z.test(e))i=16,e=e.toLowerCase();else if(U.test(e))i=2;else{if(!L.test(e))throw Error(R+e);i=8}for((o=e.search(/p/i))>0?(c=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),s=(o=e.indexOf("."))>=0,t=n.constructor,s&&(o=(u=(e=e.replace(".","")).length)-o,r=rn(t,new t(i),o,2*o)),o=f=(a=z(e,i,_)).length-1;0===a[o];--o)a.pop();return o<0?new t(0*n.s):(n.e=X(a,f),n.d=a,A=!1,s&&(n=J(n,r,4*u)),c&&(n=n.times(Math.abs(c)<54?k(2,c):te.pow(2,c))),A=!0,n)}function ln(n,e,i,t,r){var o,s,u,c,a=n.precision,f=Math.ceil(a/7);for(A=!1,c=i.times(i),u=new n(t);;){if(s=J(u.times(c),new n(e++*e++),a,1),u=r?t.plus(s):t.minus(s),t=J(s.times(c),new n(e++*e++),a,1),void 0!==(s=u.plus(t)).d[f]){for(o=f;s.d[o]===u.d[o]&&o--;);if(-1==o)break}o=u,u=t,t=s,s=o}return A=!0,s.d.length=f+1,s}function hn(n,e){for(var i=n;--e;)i*=n;return i}function gn(n,e){var i,t=e.s<0,r=nn(n,n.precision,1),o=r.times(.5);if((e=e.abs()).lte(o))return b=t?4:1,e;if((i=e.divToInt(r)).isZero())b=t?3:2;else{if((e=e.minus(i.times(r))).lte(o))return b=on(i)?t?2:3:t?4:1,e;b=on(i)?t?1:4:t?3:2}return e.minus(r).abs()}function pn(n,e,i,t){var r,o,s,u,c,a,f,d,l,h=n.constructor,g=void 0!==i;if(g?($(i,1,P),void 0===t?t=h.rounding:$(t,0,8)):(i=h.precision,t=h.rounding),n.isFinite()){for(g?(r=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):r=e,(s=(f=Q(n)).indexOf("."))>=0&&(f=f.replace(".",""),(l=new h(1)).e=f.length-s,l.d=z(Q(l),10,r),l.e=l.d.length),o=c=(d=z(f,10,r)).length;0==d[--c];)d.pop();if(d[0]){if(s<0?o--:((n=new h(n)).d=d,n.e=o,d=(n=J(n,l,i,t,0,r)).d,o=n.e,a=E),s=d[i],u=r/2,a=a||void 0!==d[i+1],a=t<4?(void 0!==s||a)&&(0===t||t===(n.s<0?3:2)):s>u||s===u&&(4===t||a||6===t&&1&d[i-1]||t===(n.s<0?8:7)),d.length=i,a)for(;++d[--i]>r-1;)d[i]=0,i||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,f="";s<c;s++)f+=M.charAt(d[s]);if(g){if(c>1)if(16==e||8==e){for(s=16==e?4:3,--c;c%s;c++)f+="0";for(c=(d=z(f,r,e)).length;!d[c-1];--c);for(s=1,f="1.";s<c;s++)f+=M.charAt(d[s])}else f=f.charAt(0)+"."+f.slice(1);f=f+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)f="0"+f;f="0."+f}else if(++o>c)for(o-=c;o--;)f+="0";else o<c&&(f=f.slice(0,o)+"."+f.slice(o))}else f=g?"0p+0":"0";f=(16==e?"0x":2==e?"0b":8==e?"0o":"")+f}else f=an(n);return n.s<0?"-"+f:f}function mn(n,e){if(n.length>e)return n.length=e,!0}function wn(n){return new this(n).abs()}function vn(n){return new this(n).acos()}function Nn(n){return new this(n).acosh()}function yn(n,e){return new this(n).plus(e)}function En(n){return new this(n).asin()}function bn(n){return new this(n).asinh()}function xn(n){return new this(n).atan()}function Pn(n){return new this(n).atanh()}function Mn(n,e){n=new this(n),e=new this(e);var i,t=this.precision,r=this.rounding,o=t+4;return n.s&&e.s?n.d||e.d?!e.d||n.isZero()?(i=e.s<0?nn(this,t,r):new this(0)).s=n.s:!n.d||e.isZero()?(i=nn(this,o,1).times(.5)).s=n.s:e.s<0?(this.precision=o,this.rounding=1,i=this.atan(J(n,e,o,1)),e=nn(this,o,1),this.precision=t,this.rounding=r,i=n.s<0?i.minus(e):i.plus(e)):i=this.atan(J(n,e,o,1)):(i=nn(this,o,1).times(e.s>0?.25:.75)).s=n.s:i=new this(NaN),i}function On(n){return new this(n).cbrt()}function Sn(n){return K(n=new this(n),n.e+1,2)}function Tn(n,e,i){return new this(n).clamp(e,i)}function An(n){if(!n||"object"!=typeof n)throw Error(q+"Object expected");var e,i,t,r=!0===n.defaults,o=["precision",1,P,"rounding",0,8,"toExpNeg",-x,0,"toExpPos",0,x,"maxE",0,x,"minE",-x,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(i=o[e],r&&(this[i]=T[i]),void 0!==(t=n[i])){if(!(I(t)===t&&t>=o[e+1]&&t<=o[e+2]))throw Error(R+i+": "+t);this[i]=t}if(i="crypto",r&&(this[i]=T[i]),void 0!==(t=n[i])){if(!0!==t&&!1!==t&&0!==t&&1!==t)throw Error(R+i+": "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(F);this[i]=!0}else this[i]=!1}return this}function qn(n){return new this(n).cos()}function Rn(n){return new this(n).cosh()}function Dn(n,e){return new this(n).div(e)}function Fn(n){return new this(n).exp()}function Cn(n){return K(n=new this(n),n.e+1,3)}function In(){var n,e,i=new this(0);for(A=!1,n=0;n<arguments.length;)if((e=new this(arguments[n++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return A=!0,new this(1/0);i=e}return A=!0,i.sqrt()}function kn(n){return n instanceof te||n&&n.toStringTag===C||!1}function Un(n){return new this(n).ln()}function Zn(n,e){return new this(n).log(e)}function Ln(n){return new this(n).log(2)}function Hn(n){return new this(n).log(10)}function _n(){return sn(this,arguments,"lt")}function Bn(){return sn(this,arguments,"gt")}function jn(n,e){return new this(n).mod(e)}function Gn(n,e){return new this(n).mul(e)}function Vn(n,e){return new this(n).pow(e)}function $n(n){var e,i,t,r,o=0,s=new this(1),u=[];if(void 0===n?n=this.precision:$(n,1,P),t=Math.ceil(n/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(t));o<t;)(r=e[o])>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=r%1e7;else{if(!crypto.randomBytes)throw Error(F);for(e=crypto.randomBytes(t*=4);o<t;)(r=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,o):(u.push(r%1e7),o+=4);o=t/4}else for(;o<t;)u[o++]=1e7*Math.random()|0;for(n%=7,(t=u[--o])&&n&&(r=k(10,7-n),u[o]=(t/r|0)*r);0===u[o];o--)u.pop();if(o<0)i=0,u=[0];else{for(i=-1;0===u[0];i-=7)u.shift();for(t=1,r=u[0];r>=10;r/=10)t++;t<7&&(i-=7-t)}return s.e=i,s.d=u,s}function Wn(n){return K(n=new this(n),n.e+1,this.rounding)}function zn(n){return(n=new this(n)).d?n.d[0]?n.s:0*n.s:n.s||NaN}function Jn(n){return new this(n).sin()}function Kn(n){return new this(n).sinh()}function Qn(n){return new this(n).sqrt()}function Xn(n,e){return new this(n).sub(e)}function Yn(){var n=0,e=arguments,i=new this(e[n]);for(A=!1;i.s&&++n<e.length;)i=i.plus(e[n]);return A=!0,K(i,this.precision,this.rounding)}function ne(n){return new this(n).tan()}function ee(n){return new this(n).tanh()}function ie(n){return K(n=new this(n),n.e+1,1)}G[Symbol.for("nodejs.util.inspect.custom")]=G.toString,G[Symbol.toStringTag]="Decimal";var te=G.constructor=function n(e){var i,t,r;function o(n){var e,i,t,r=this;if(!(r instanceof o))return new o(n);if(r.constructor=o,kn(n))return r.s=n.s,void(A?!n.d||n.e>o.maxE?(r.e=NaN,r.d=null):n.e<o.minE?(r.e=0,r.d=[0]):(r.e=n.e,r.d=n.d.slice()):(r.e=n.e,r.d=n.d?n.d.slice():n.d));if("number"==(t=typeof n)){if(0===n)return r.s=1/n<0?-1:1,r.e=0,void(r.d=[0]);if(n<0?(n=-n,r.s=-1):r.s=1,n===~~n&&n<1e7){for(e=0,i=n;i>=10;i/=10)e++;return void(A?e>o.maxE?(r.e=NaN,r.d=null):e<o.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[n]):(r.e=e,r.d=[n]))}return 0*n!=0?(n||(r.s=NaN),r.e=NaN,void(r.d=null)):fn(r,n.toString())}if("string"!==t)throw Error(R+n);return 45===(i=n.charCodeAt(0))?(n=n.slice(1),r.s=-1):(43===i&&(n=n.slice(1)),r.s=1),H.test(n)?fn(r,n):dn(r,n)}if(o.prototype=G,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=An,o.clone=n,o.isDecimal=kn,o.abs=wn,o.acos=vn,o.acosh=Nn,o.add=yn,o.asin=En,o.asinh=bn,o.atan=xn,o.atanh=Pn,o.atan2=Mn,o.cbrt=On,o.ceil=Sn,o.clamp=Tn,o.cos=qn,o.cosh=Rn,o.div=Dn,o.exp=Fn,o.floor=Cn,o.hypot=In,o.ln=Un,o.log=Zn,o.log10=Hn,o.log2=Ln,o.max=_n,o.min=Bn,o.mod=jn,o.mul=Gn,o.pow=Vn,o.random=$n,o.round=Wn,o.sign=zn,o.sin=Jn,o.sinh=Kn,o.sqrt=Qn,o.sub=Xn,o.sum=Yn,o.tan=ne,o.tanh=ee,o.trunc=ie,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(t=r[i++])||(e[t]=this[t]);return o.config(e),o}(T);O=new te(O),S=new te(S);const re=te,oe=n=>new re(n).toDecimalPlaces(2).toNumber();return e})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomstay/core",
|
|
3
|
-
"version": "0.1.33-
|
|
3
|
+
"version": "0.1.33-4",
|
|
4
4
|
"description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -37,12 +37,13 @@
|
|
|
37
37
|
"babel-loader": "^8.1.0",
|
|
38
38
|
"np": "^7.6.3",
|
|
39
39
|
"resolve-tspaths": "^0.8.3",
|
|
40
|
+
"shx": "^0.3.4",
|
|
40
41
|
"ts-loader": "^9.4.1",
|
|
41
42
|
"typescript": "^4.9.3",
|
|
42
43
|
"webpack": "^5.75.0",
|
|
43
44
|
"webpack-cli": "^5.0.0"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"
|
|
47
|
+
"decimal.js": "^10.4.3"
|
|
47
48
|
}
|
|
48
49
|
}
|