import{__exports as r}from"../../../_virtual/es.math.sum-precise.mjs";import{__require as e}from"../internals/export.mjs";import{__require as t}from"../internals/function-uncurry-this.mjs";import{__require as n}from"../internals/iterate.mjs";var i;function a(){if(i)return r;i=1;var a=e(),o=t(),u=n(),s=RangeError,f=TypeError,m=1/0,h=Math.abs,l=Math.pow,c=o([].push),p=l(2,1023),_=l(2,53)-1,v=Number.MAX_VALUE,w=l(2,971),g={},x={},M={},b={},d={},j=function(r,e){var t=r+e;return{hi:t,lo:e-(t-r)}};return a({target:"Math",stat:!0},{sumPrecise:function(r){var e=[],t=0,n=b;switch(u(r,function(r){if(++t>=_)throw new s("Maximum allowed index exceeded");if("number"!=typeof r)throw new f("Value is not a number");n!==g&&(r!=r?n=g:r===m?n=n===x?g:M:r===-1/0?n=n===M?g:x:0===r&&1/r!==m||n!==b&&n!==d||(n=d,c(e,r)))}),n){case g:return NaN;case x:return-1/0;case M:return m;case b:return-0}for(var i,a,o,l,q,y,E=[],N=0,A=0;A<e.length;A++){i=e[A];for(var V=0,L=0;L<E.length;L++){if(a=E[L],h(i)<h(a)&&(y=i,i=a,a=y),l=(o=j(i,a)).hi,q=o.lo,h(l)===m){var P=l===m?1:-1;N+=P,h(i=i-P*p-P*p)<h(a)&&(y=i,i=a,a=y),l=(o=j(i,a)).hi,q=o.lo}0!==q&&(E[V++]=q),i=l}E.length=V,0!==i&&c(E,i)}var R=E.length-1;if(l=0,q=0,0!==N){var T=R>=0?E[R]:0;if(R--,h(N)>1||N>0&&T>0||N<0&&T<0)return N>0?m:-1/0;if(l=(o=j(N*p,T/2)).hi,q=o.lo,q*=2,h(2*l)===m)return l>0?l===p&&q===-w/2&&R>=0&&E[R]<0?v:m:l===-p&&q===w/2&&R>=0&&E[R]>0?-v:-1/0;0!==q&&(E[++R]=q,q=0),l*=2}for(;R>=0&&(l=(o=j(l,E[R--])).hi,0===(q=o.lo)););return R>=0&&(q<0&&E[R]<0||q>0&&E[R]>0)&&(a=2*q)===(i=l+a)-l&&(l=i),l}}),r}export{a as __require};