/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import r from"../../request.js";import{urlToObject as t}from"../../core/urlUtils.js";import{getJsonType as e}from"../../geometry/support/jsonTypeUtils.js";import{srToRESTValue as s}from"../../geometry/support/spatialReferenceUtils.js";import{encodeGeometries as o,decodeGeometries as i}from"./utils.js";async function p(p,m,f){const n="string"==typeof p?t(p):p,a=m[0].spatialReference,u=e(m[0]),y={...f,query:{...n.query,f:"json",sr:s(a),geometries:JSON.stringify(o(m))}},{data:l}=await r(n.path+"/simplify",y);return i(l.geometries,u,a)}export{p as simplify};
