// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../../core/Collection ../../../geometry/support/spatialReferenceUtils ../../../layers/support/layerUtils ../../ViewingMode ./NeighborIndex ./TerrainData ../../../chunks/terrainUtilsPlanar ../../../chunks/terrainUtilsSpherical".split(" "),function(b,C,v,D,l,c,h,m,n){function p(a){return"imagery-tile"===a?.type||"wcs"===a?.type}function k(a){return"imagery-tile-3d"===a?.type}function q(a){return"tile-3d"===a?.type}function r(a){return"vector-tile-3d"===a?.type}function t(a){return"wmts-3d"=== a?.type}function w(a){return"elevation-3d"===a?.type}function x(a){return a&&(q(a)||k(a)||r(a)||t(a))}function y(a){return h.isVectorTile(a?.data)}function u(a,d,g,e,f){return E[e].checkIfTileInfoSupportedForViewSR(a,g,d,f)}function z(a,d,g){a=D.getTileMaxtrixSetFromActiveLayer(a);if(null!=a)if(C.isCollection(a)){if(a=a.find(e=>null==u(e.tileInfo,e.fullExtent,d,g)))return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent};return{tileInfo:null,fullExtent:null}} function A(a){return a.isWGS84||a.isWebMercator||v.isCGCS2000(a)||!v.isEarth(a)}const E={[l.ViewingMode.Global]:n.terrainUtilsSpherical,[l.ViewingMode.Local]:m.terrainUtilsPlanar};b.enableTerrainInternalChecks=!1;b.enableWaterproofTests=!1;const B={force512VTL:!1};m=[c.NeighborIndex.NORTH,c.NeighborIndex.EAST,c.NeighborIndex.SOUTH,c.NeighborIndex.WEST];n=[c.NeighborIndex.NORTH_EAST,c.NeighborIndex.SOUTH_EAST,c.NeighborIndex.SOUTH_WEST,c.NeighborIndex.NORTH_WEST];b.almostEquals=function(a,d,g=1E-5){return Math.abs(a- d)