import{validation}from"../../Validation.js";import{inline}from"./tools.js";import{buffer,geodesicBuffer}from"@arcgis/core/geometry/geometryEngineAsync";class BufferEngineTask{executeUsing(e,i,n,r,a){return(e?geodesicBuffer:buffer)(i,n,r,a)}execute(e){var i=validation.array("geometry",e.geometry,validation.never),n=validation.array("distance",e.distance,validation.never),r=validation.boolean("geodesic",e.geodesic,!1),a=validation.boolean("union",e.union,!1),a=this.executeUsing(r,i,n,e.unit,a);return inline(a,function(e){e=Array.isArray(e)?e:[e];return{geometry:e[0],results:e}})}}BufferEngineTask.action="gcx:wf:arcgis::BufferEngineTask",BufferEngineTask.suite="gcx:wf:builtin";export{BufferEngineTask};