/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{getMetersPerUnitForSR as n}from"../../../core/units.js";import t from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as e}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as r}from"../constants.js";function o(r,o){const{x:i,y:s,spatialReference:f}=r,u=o*e(s,f)/n(f);return new t({xmin:i-u,xmax:i+u,ymin:s-u,ymax:s+u,spatialReference:r.spatialReference})}function i(n){return!n||null===n.previous||null===n.next}function s(n,t,e=1){if(null==n[t])return!0;const o=n=>n?r.reduce((t,e)=>n[e]?t+1:t,0):0,i=new Set,s=[{node:n,depth:0}];for(;s.length;){const{node:n,depth:t}=s.shift();if(n&&!i.has(n)){if(i.add(n),o(n)<2)return!0;if(t<e)for(const e of r){const r=n[e];r&&!i.has(r)&&s.push({node:r,depth:t+1})}}}return!1}function f(n,t){if(!n&&!t)return 0;const e=Number(n),r=Number(t);if(!isNaN(e)&&!isNaN(r))return e-r;const o=String(n),i=String(t);return o<i?-1:o>i?1:0}export{o as createExtentAroundPoint,s as shouldQueryAndNavigate,i as shouldQueryAndNavigateSequentially,f as sortStringOrNumber};
