text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.11/esri/copyright.txt for details.
  //>>built
  define("require exports ../../core/lang ../../core/wgs84Constants ../SpatialReference ./spatialReferenceUtils".split(" "),function(y,l,n,x,p,e){function q(a,b,c,m,d){var f;if("x"in a&&"x"in d)b=b(a.x,a.y,t,m),d.x=b[0],d.y=b[1];else if("xmin"in a&&"xmin"in d)f=b(a.xmin,a.ymin,t,m),d.xmin=f[0],d.ymin=f[1],b=b(a.xmax,a.ymax,t,m),d.xmax=b[0],d.ymax=b[1];else if("paths"in a&&"paths"in d||"rings"in a&&"rings"in d){f="paths"in a?a.paths:a.rings;var g=[],k=void 0;for(a=0;a<f.length;a++){var e=f[a],k=[];g.push(k);
  for(var h=0;h<e.length;h++)k.push(b(e[h][0],e[h][1],[0,0],m)),2<e[h].length&&k[h].push(e[h][2]),3<e[h].length&&k[h].push(e[h][3])}"paths"in d?d.paths=g:d.rings=g}else if("points"in a&&"points"in d){f=a.points;g=[];for(a=0;a<f.length;a++)g[a]=b(f[a][0],f[a][1],[0,0],m),2<f[a].length&&g[a].push(f[a][2]),3<f[a].length&&g[a].push(f[a][3]);d.points=g}else if("type"in a&&"mesh"===a.type&&"type"in d&&"mesh"===d.type&&(f=a.vertexAttributes&&a.vertexAttributes.position,g=d.vertexAttributes&&d.vertexAttributes.position,
  f))for(k=[0,0],a=0;a<f.length;a+=3)b(f[a],f[a+1],k,m),g[a]=k[0],g[a+1]=k[1];d.spatialReference=c;return d}function w(a,b){a=a&&(null!=a.wkid||null!=a.wkt?a:a.spatialReference);b=b&&(null!=b.wkid||null!=b.wkt?b:b.spatialReference);return a&&b?e.equals(b,a)?!0:e.isWebMercator(b)&&e.isWGS84(a)||e.isWebMercator(a)&&e.isWGS84(b):!1}function u(a,b,c){void 0===c&&(c=[0,0]);89.99999<b?b=89.99999:-89.99999>b&&(b=-89.99999);b*=.017453292519943;c[0]=.017453292519943*a*r;c[1]=.5*r*Math.log((1+Math.sin(b))/(1-
  Math.sin(b)));return c}function v(a,b,c,e){void 0===c&&(c=[0,0]);void 0===e&&(e=!1);a=a/r*57.29577951308232;c[0]=e?a:a-360*Math.floor((a+180)/360);c[1]=57.29577951308232*(Math.PI/2-2*Math.atan(Math.exp(-1*b/r)));return c}Object.defineProperty(l,"__esModule",{value:!0});var r=x.wgs84Radius,t=[0,0];l.canProject=w;l.project=function(a,b){var c=a&&a.spatialReference;b=b&&(null!=b.wkid||null!=b.wkt?b:b.spatialReference);return w(c,b)?e.equals(c,b)?n.clone(a):e.isWebMercator(b)?q(a,u,p.WebMercator,!1,n.clone(a)):
  e.isWGS84(b)?q(a,v,p.WGS84,!1,n.clone(a)):null:null};l.lngLatToXY=u;l.xyToLngLat=v;l.geographicToWebMercator=function(a,b,c){void 0===b&&(b=!1);void 0===c&&(c=n.clone(a));return q(a,u,p.WebMercator,b,c)};l.webMercatorToGeographic=function(a,b,c){void 0===b&&(b=!1);void 0===c&&(c=n.clone(a));return q(a,v,p.WGS84,b,c)}});