/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{getMetersPerUnitForSR as e}from"../../../core/units.js";import t from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as n}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as o}from"../constants.js";function r(o,r){const{x:s,y:i,spatialReference:f}=o,a=r*n(i,f)/e(f);return new t({xmin:s-a,xmax:s+a,ymin:i-a,ymax:i+a,spatialReference:o.spatialReference})}function s(e,t=1){const n=e=>e?o.reduce((t,n)=>e[n]?t+1:t,0):0,r=new Set,s=[{node:e,depth:0}];for(;s.length;){const{node:e,depth:i}=s.shift();if(e&&!r.has(e)){if(r.add(e),n(e)<2)return!0;if(i<t)for(const t of o){const n=e[t];n&&!r.has(n)&&s.push({node:n,depth:i+1})}}}return!1}export{r as createExtentAroundPoint,s as shouldQueryAndNavigate};
