/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import e from"../../request.js";import r from"../../geometry/Polygon.js";import{srToRESTValue as t}from"../../geometry/support/spatialReferenceUtils.js";import{parseUrl as o,asValidOptions as s}from"../utils.js";import{encodeGeometries as i}from"./utils.js";async function n(n,m,p,a){const f=m[0].spatialReference,g=o(n),l={...g.query,f:"json",sr:t(f),polygons:JSON.stringify(i(m).geometries),polylines:JSON.stringify(i(p).geometries)},y=s(l,a);return e(g.path+"/autoComplete",y).then(({data:e})=>(e.geometries||[]).map(({rings:e})=>new r({spatialReference:f,rings:e})))}export{n as autoComplete};
