!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,(function(t){"use strict";const n=11102230246251565e-32,e=134217729,r=(3+8*n)*n;function s(t,n,e,r,s){let o,a,c,f,i=n[0],u=r[0],h=0,b=0;u>i==u>-i?(o=i,i=n[++h]):(o=u,u=r[++b]);let M=0;if(hi==u>-i?(a=i+o,c=o-(a-i),i=n[++h]):(a=u+o,c=o-(a-u),u=r[++b]),o=a,0!==c&&(s[M++]=c);hi==u>-i?(a=o+i,f=a-o,c=o-(a-f)+(i-f),i=n[++h]):(a=o+u,f=a-o,c=o-(a-f)+(u-f),u=r[++b]),o=a,0!==c&&(s[M++]=c);for(;h=bt||-ht>=bt)return ht;if(N=t-_,v=t-(_+N)+(N-x),N=n-rt,D=n-(rt+N)+(N-g),N=a-ct,I=a-(ct+N)+(N-m),N=i-tt,z=i-(tt+N)+(N-x),N=u-st,E=u-(st+N)+(N-g),N=h-ft,J=h-(ft+N)+(N-m),N=b-nt,B=b-(nt+N)+(N-x),N=M-ot,G=M-(ot+N)+(N-g),N=l-it,K=l-(it+N)+(N-m),N=d-et,C=d-(et+N)+(N-x),N=p-at,H=p-(at+N)+(N-g),N=y-ut,L=y-(ut+N)+(N-m),0===v&&0===D&&0===I&&0===z&&0===E&&0===J&&0===B&&0===G&&0===K&&0===C&&0===H&&0===L)return ht;bt=Tt*T+r*Math.abs(ht);const Mt=_*E+st*v-(rt*z+tt*D),lt=tt*G+ot*z-(st*B+nt*E),dt=nt*H+at*B-(ot*C+et*G),pt=et*D+rt*C-(at*v+_*H),yt=_*G+ot*v-(rt*B+nt*D),xt=tt*H+at*z-(st*C+et*E);return ht+=(tt*tt+st*st+ft*ft)*(it*pt+ut*yt+ct*dt+(K*F+L*k+I*A))+(et*et+at*at+ut*ut)*(ct*lt-ft*yt+it*Mt+(I*w-J*k+K*j))-((_*_+rt*rt+ct*ct)*(ft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(0!==T){const t=a(v,rt,T,bt);d=gt(d,s(a(q,et,T,ut),ut,a(t,bt,2*Et,Mt),Mt,dt),dt);const n=a(C,at,T,it);d=gt(d,o(a(n,it,2*Et,ut),ut,a(n,it,T,ht),ht,a(t,bt,T,Mt),Mt,lt,pt),pt)}}return yt[d-1]}(t,n,c,i,u,h,b,M,B)},t.incirclefast=function(t,n,e,r,s,o,a,c){const f=t-a,i=n-c,u=e-a,h=r-c,b=s-a,M=o-c;return(f*f+i*i)*(u*M-b*h)+(u*u+h*h)*(b*i-f*M)+(b*b+M*M)*(f*h-u*i)},t.insphere=function(t,n,e,r,s,o,a,c,f,i,u,h,b,M,l){const d=t-b,p=r-b,y=a-b,x=i-b,g=n-M,m=s-M,T=c-M,j=u-M,w=e-l,A=o-l,F=f-l,k=h-l,q=d*m,v=p*g,z=q-v,B=p*T,C=y*m,D=B-C,E=y*j,G=x*T,H=E-G,I=x*g,J=d*j,K=I-J,L=d*T,N=y*g,O=L-N,P=p*j,Q=x*m,R=P-Q,S=d*d+g*g+w*w,U=p*p+m*m+A*A,V=y*y+T*T+F*F,W=x*x+j*j+k*k,X=V*(k*z+w*R+A*K)-W*(w*D-A*O+F*z)+(S*(A*H-F*R+k*D)-U*(F*K+k*O+w*H)),Y=Math.abs(w),Z=Math.abs(A),$=Math.abs(F),_=Math.abs(k),tt=Math.abs(q)+Math.abs(v),nt=Math.abs(B)+Math.abs(C),et=Math.abs(E)+Math.abs(G),rt=Math.abs(I)+Math.abs(J),st=Math.abs(L)+Math.abs(N),ot=Math.abs(P)+Math.abs(Q),at=(et*Z+ot*$+nt*_)*S+(rt*$+st*_+et*Y)*U+(tt*_+ot*Y+rt*Z)*V+(nt*Y+st*Z+tt*$)*W,ct=17763568394002532e-31*at;return X>ct||-X>ct?X:-xn(t,n,e,r,s,o,a,c,f,i,u,h,b,M,l,at)},t.inspherefast=function(t,n,e,r,s,o,a,c,f,i,u,h,b,M,l){const d=t-b,p=r-b,y=a-b,x=i-b,g=n-M,m=s-M,T=c-M,j=u-M,w=e-l,A=o-l,F=f-l,k=h-l,q=d*m-p*g,v=p*T-y*m,z=y*j-x*T,B=x*g-d*j,C=d*T-y*g,D=p*j-x*m;return(y*y+T*T+F*F)*(k*q+w*D+A*B)-(x*x+j*j+k*k)*(w*v-A*C+F*q)+((d*d+g*g+w*w)*(A*z-F*D+k*v)-(p*p+m*m+A*A)*(F*B+k*C+w*z))},t.orient2d=function(t,n,o,a,c,i){const y=(n-i)*(o-c),x=(t-c)*(a-i),g=y-x,m=Math.abs(y+x);return Math.abs(g)>=33306690738754716e-32*m?g:-function(t,n,o,a,c,i,y){let x,g,m,T,j,w,A,F,k,q,v,z,B,C,D,E,G,H;const I=t-c,J=o-c,K=n-i,L=a-i;C=I*L,w=e*I,A=w-(w-I),F=I-A,w=e*L,k=w-(w-L),q=L-k,D=F*q-(C-A*k-F*k-A*q),E=K*J,w=e*K,A=w-(w-K),F=K-A,w=e*J,k=w-(w-J),q=J-k,G=F*q-(E-A*k-F*k-A*q),v=D-G,j=D-v,b[0]=D-(v+j)+(j-G),z=C+v,j=z-C,B=C-(z-j)+(v-j),v=B-E,j=B-v,b[1]=B-(v+j)+(j-E),H=z+v,j=H-z,b[2]=z-(H-j)+(v-j),b[3]=H;let N=f(4,b),O=u*y;if(N>=O||-N>=O)return N;if(j=t-I,x=t-(I+j)+(j-c),j=o-J,m=o-(J+j)+(j-c),j=n-K,g=n-(K+j)+(j-i),j=a-L,T=a-(L+j)+(j-i),0===x&&0===g&&0===m&&0===T)return N;if(O=h*y+r*Math.abs(N),N+=I*T+L*x-(K*m+J*g),N>=O||-N>=O)return N;C=x*L,w=e*x,A=w-(w-x),F=x-A,w=e*L,k=w-(w-L),q=L-k,D=F*q-(C-A*k-F*k-A*q),E=g*J,w=e*g,A=w-(w-g),F=g-A,w=e*J,k=w-(w-J),q=J-k,G=F*q-(E-A*k-F*k-A*q),v=D-G,j=D-v,p[0]=D-(v+j)+(j-G),z=C+v,j=z-C,B=C-(z-j)+(v-j),v=B-E,j=B-v,p[1]=B-(v+j)+(j-E),H=z+v,j=H-z,p[2]=z-(H-j)+(v-j),p[3]=H;const P=s(4,b,4,p,M);C=I*T,w=e*I,A=w-(w-I),F=I-A,w=e*T,k=w-(w-T),q=T-k,D=F*q-(C-A*k-F*k-A*q),E=K*m,w=e*K,A=w-(w-K),F=K-A,w=e*m,k=w-(w-m),q=m-k,G=F*q-(E-A*k-F*k-A*q),v=D-G,j=D-v,p[0]=D-(v+j)+(j-G),z=C+v,j=z-C,B=C-(z-j)+(v-j),v=B-E,j=B-v,p[1]=B-(v+j)+(j-E),H=z+v,j=H-z,p[2]=z-(H-j)+(v-j),p[3]=H;const Q=s(P,M,4,p,l);C=x*T,w=e*x,A=w-(w-x),F=x-A,w=e*T,k=w-(w-T),q=T-k,D=F*q-(C-A*k-F*k-A*q),E=g*m,w=e*g,A=w-(w-g),F=g-A,w=e*m,k=w-(w-m),q=m-k,G=F*q-(E-A*k-F*k-A*q),v=D-G,j=D-v,p[0]=D-(v+j)+(j-G),z=C+v,j=z-C,B=C-(z-j)+(v-j),v=B-E,j=B-v,p[1]=B-(v+j)+(j-E),H=z+v,j=H-z,p[2]=z-(H-j)+(v-j),p[3]=H;const R=s(Q,l,4,p,d);return d[R-1]}(t,n,o,a,c,i,m)},t.orient2dfast=function(t,n,e,r,s,o){return(n-o)*(e-s)-(t-s)*(r-o)},t.orient3d=function(t,n,o,c,i,u,h,b,M,l,d,p){const C=t-l,J=c-l,O=h-l,P=n-d,Q=i-d,R=b-d,S=o-p,U=u-p,V=M-p,W=J*R,X=O*Q,Y=O*P,Z=C*R,$=C*Q,_=J*P,tt=S*(W-X)+U*(Y-Z)+V*($-_),nt=(Math.abs(W)+Math.abs(X))*Math.abs(S)+(Math.abs(Y)+Math.abs(Z))*Math.abs(U)+(Math.abs($)+Math.abs(_))*Math.abs(V),et=7771561172376103e-31*nt;return tt>et||-tt>et?tt:function(t,n,o,c,i,u,h,b,M,l,d,p,C){let J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&(J=N(J,-O,U,yt,W))),0!==P&&(0!==U&&(J=N(J,P,U,pt,V)),0!==R&&(J=N(J,-P,R,xt,X))),0!==Q&&(0!==R&&(J=N(J,Q,R,yt,W)),0!==S&&(J=N(J,-Q,S,pt,V))),I[J-1]}(t,n,o,c,i,u,h,b,M,l,d,p,nt)},t.orient3dfast=function(t,n,e,r,s,o,a,c,f,i,u,h){const b=n-u,M=s-u,l=c-u,d=e-h,p=o-h,y=f-h;return(t-i)*(M*y-p*l)+(r-i)*(l*d-y*b)+(a-i)*(b*p-d*M)}}));