/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import e from"../Extent.js";import{getExtentForScale as n}from"./scaleUtils.js";async function t(e,n){if(e.hasZ||"2d"===n.type)return e;const t=n.map?.ground;return t?.layers.length?(await t.queryElevation(e,{cache:n.basemapTerrain?.elevationQueryCache})).geometry:e}function r(e,n,t){return a(e.center,n,t)}function a(t,r,a){const i=t.hasZ?t.z:void 0;if(r?.map){return(null!=a?n(r,a):r.extent).clone().centerAt(t).set({zmax:i,zmin:i})}const{x:o,y:u,spatialReference:c}=t;return new e({xmin:o-.25,ymin:u-.25,xmax:o+.25,ymax:u+.25,spatialReference:c,zmin:i,zmax:i})}function i(e,n,t,r){switch(e?.type){case"extent":return e;case"polygon":case"polyline":case"multipoint":return e.extent??void 0;case"point":return a(r.execute(e),n??void 0,t??void 0);default:return}}function o([e,n,t,r],[a,i,o,u]){return e===a&&n===i&&(null==t&&null==o||t===o)&&(null==r&&null==u||r===u)}export{o as comparePoints,a as createExtentFromPoint,i as getExtentFromGeometry,t as getPointWithElevation,r as scaleExtent};
