/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{isSome as r}from"../../../core/arrayUtils.js";import{convertToSpatialReferenceUnit as t}from"../../../core/units.js";import{execute as e,executeMany as o}from"../gx/operatorOffset.js";import{getSpatialReference as n,fromGeometry as i,toGeometry as s,fromGeometries as m}from"../support/jsonConverter.js";const u={round:0,bevel:1,miter:2,square:3};function a(r,o,m={}){const{miterLimit:a=10,flattenError:c=0,joins:f="round",unit:p}=m,j=n(r);p&&j&&(o=t(o,p,j));const l=i(r),x=l.getSpatialReference();return s(e(l.getGeometry(),x,o,u[f],a,c),x)}function c(e,i,a={}){const{miterLimit:c=10,flattenError:f=0,joins:p="round",unit:j}=a,l=n(e);j&&l&&(i=t(i,j,l));const[x,d]=m(e);return o(x,d,i,u[p],c,f).map(r=>s(r,d)).filter(r)}export{a as execute,c as executeMany};
