/*
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 a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function u(t,n,a,r,u,o,e){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=o,t[5]=e,t}function o(t,n){const a=n[0],r=n[1],u=n[2],o=n[3],e=n[4],s=n[5];let c=a*o-r*u;return c?(c=1/c,t[0]=o*c,t[1]=-r*c,t[2]=-u*c,t[3]=a*c,t[4]=(u*s-o*e)*c,t[5]=(r*e-a*s)*c,t):null}function e(t){return t[0]*t[3]-t[1]*t[2]}function s(t,n,a){const r=n[0],u=n[1],o=n[2],e=n[3],s=n[4],c=n[5],i=a[0],l=a[1],f=a[2],M=a[3],h=a[4],b=a[5];return t[0]=r*i+o*l,t[1]=u*i+e*l,t[2]=r*f+o*M,t[3]=u*f+e*M,t[4]=r*h+o*b+s,t[5]=u*h+e*b+c,t}function c(t,n,a){const r=n[0],u=n[1],o=n[2],e=n[3],s=n[4],c=n[5],i=Math.sin(a),l=Math.cos(a);return t[0]=r*l+o*i,t[1]=u*l+e*i,t[2]=r*-i+o*l,t[3]=u*-i+e*l,t[4]=s,t[5]=c,t}function i(t,n,a){const r=n[0],u=n[1],o=n[2],e=n[3],s=n[4],c=n[5],i=a[0],l=a[1];return t[0]=r*i,t[1]=u*i,t[2]=o*l,t[3]=e*l,t[4]=s,t[5]=c,t}function l(t,n,a){const r=n[0],u=n[1],o=n[2],e=n[3],s=n[4],c=n[5],i=a[0],l=a[1];return t[0]=r,t[1]=u,t[2]=o,t[3]=e,t[4]=r*i+o*l+s,t[5]=u*i+e*l+c,t}function f(t,n){const a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t[4]=0,t[5]=0,t}function M(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t}function h(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function m(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function d(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t}function S(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t}function y(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t}function p(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t}function x(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]}function E(t,a){const r=t[0],u=t[1],o=t[2],e=t[3],s=t[4],c=t[5],i=a[0],l=a[1],f=a[2],M=a[3],h=a[4],b=a[5];return Math.abs(r-i)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-l)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(l))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(e-M)<=n.EPSILON*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(s-h)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))}const O=s,P=S,I=Object.freeze(Object.defineProperty({__proto__:null,copy:a,identity:r,set:u,invert:o,determinant:e,multiply:s,rotate:c,scale:i,translate:l,fromRotation:f,fromScaling:M,fromTranslation:h,str:b,frob:m,add:d,subtract:S,multiplyScalar:y,multiplyScalarAndAdd:p,exactEquals:x,equals:E,mul:O,sub:P},Symbol.toStringTag,{value:"Module"}));t.add=d,t.copy=a,t.determinant=e,t.equals=E,t.exactEquals=x,t.frob=m,t.fromRotation=f,t.fromScaling=M,t.fromTranslation=h,t.identity=r,t.invert=o,t.mat2d=I,t.mul=O,t.multiply=s,t.multiplyScalar=y,t.multiplyScalarAndAdd=p,t.rotate=c,t.scale=i,t.set=u,t.str=b,t.sub=P,t.subtract=S,t.translate=l}));
