/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./common"],(function(t,n){"use strict";function r(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function a(t,n,r,a,e){return t[0]=n,t[1]=r,t[2]=a,t[3]=e,t}function e(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[3]=n[3]+r[3],t}function u(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[3]=n[3]-r[3],t}function o(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t[2]=n[2]*r[2],t[3]=n[3]*r[3],t}function s(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t[2]=n[2]/r[2],t[3]=n[3]/r[3],t}function i(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function c(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function M(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1]),t[2]=Math.min(n[2],r[2]),t[3]=Math.min(n[3],r[3]),t}function h(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1]),t[2]=Math.max(n[2],r[2]),t[3]=Math.max(n[3],r[3]),t}function l(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function f(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t}function d(t,n,r,a){return t[0]=n[0]+r[0]*a,t[1]=n[1]+r[1]*a,t[2]=n[2]+r[2]*a,t[3]=n[3]+r[3]*a,t}function m(t,n){const r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2],u=n[3]-t[3];return Math.sqrt(r*r+a*a+e*e+u*u)}function b(t,n){const r=n[0]-t[0],a=n[1]-t[1],e=n[2]-t[2],u=n[3]-t[3];return r*r+a*a+e*e+u*u}function q(t){const n=t[0],r=t[1],a=t[2],e=t[3];return Math.sqrt(n*n+r*r+a*a+e*e)}function x(t){const n=t[0],r=t[1],a=t[2],e=t[3];return n*n+r*r+a*a+e*e}function O(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function p(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function v(t,n){const r=n[0],a=n[1],e=n[2],u=n[3];let o=r*r+a*a+e*e+u*u;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=a*o,t[2]=e*o,t[3]=u*o),t}function g(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function A(t,n,r,a){const e=n[0],u=n[1],o=n[2],s=n[3];return t[0]=e+a*(r[0]-e),t[1]=u+a*(r[1]-u),t[2]=o+a*(r[2]-o),t[3]=s+a*(r[3]-s),t}function D(t,r){let a,e,u,o,s,i;r=r||1;do{a=2*n.RANDOM()-1,e=2*n.RANDOM()-1,s=a*a+e*e}while(s>=1);do{u=2*n.RANDOM()-1,o=2*n.RANDOM()-1,i=u*u+o*o}while(i>=1);const c=Math.sqrt((1-s)/i);return t[0]=r*a,t[1]=r*e,t[2]=r*u*c,t[3]=r*o*c,t}function L(t,n,r){const a=n[0],e=n[1],u=n[2],o=n[3];return t[0]=r[0]*a+r[4]*e+r[8]*u+r[12]*o,t[1]=r[1]*a+r[5]*e+r[9]*u+r[13]*o,t[2]=r[2]*a+r[6]*e+r[10]*u+r[14]*o,t[3]=r[3]*a+r[7]*e+r[11]*u+r[15]*o,t}function N(t,n,r){const a=n[0],e=n[1],u=n[2],o=r[0],s=r[1],i=r[2],c=r[3],M=c*a+s*u-i*e,h=c*e+i*a-o*u,l=c*u+o*e-s*a,f=-o*a-s*e-i*u;return t[0]=M*c+f*-o+h*-i-l*-s,t[1]=h*c+f*-s+l*-o-M*-i,t[2]=l*c+f*-i+M*-s-h*-o,t[3]=n[3],t}function y(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function E(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function S(t,r){const a=t[0],e=t[1],u=t[2],o=t[3],s=r[0],i=r[1],c=r[2],M=r[3];return Math.abs(a-s)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(e-i)<=n.EPSILON*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(u-c)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(c))&&Math.abs(o-M)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))}const P=u,I=o,R=s,_=m,z=b,j=q,w=x,Q=Object.freeze(Object.defineProperty({__proto__:null,copy:r,set:a,add:e,subtract:u,multiply:o,divide:s,ceil:i,floor:c,min:M,max:h,round:l,scale:f,scaleAndAdd:d,distance:m,squaredDistance:b,length:q,squaredLength:x,negate:O,inverse:p,normalize:v,dot:g,lerp:A,random:D,transformMat4:L,transformQuat:N,str:y,exactEquals:E,equals:S,sub:P,mul:I,div:R,dist:_,sqrDist:z,len:j,sqrLen:w},Symbol.toStringTag,{value:"Module"}));t.add=e,t.ceil=i,t.copy=r,t.dist=_,t.distance=m,t.div=R,t.divide=s,t.dot=g,t.equals=S,t.exactEquals=E,t.floor=c,t.inverse=p,t.len=j,t.length=q,t.lerp=A,t.max=h,t.min=M,t.mul=I,t.multiply=o,t.negate=O,t.normalize=v,t.random=D,t.round=l,t.scale=f,t.scaleAndAdd=d,t.set=a,t.sqrDist=z,t.sqrLen=w,t.squaredDistance=b,t.squaredLength=x,t.str=y,t.sub=P,t.subtract=u,t.transformMat4=L,t.transformQuat=N,t.vec4=Q}));
