/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{sameStartEndPoint as t}from"./support/shapeUtils.js";import{isPolygon as s,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";import r from"../../../../geometry/Polyline.js";import{getPaths as i,cloneCurve as a,pathHasCurves as p}from"../../../../geometry/support/curves/curveUtils.js";function n({templatePart:n,shape:l,edits:c,relationships:m,mode:f,xyTolerance:h,associationFeaturesByTemplate:u}){if(!s(l))return;const d=l.clone(),g=[];for(const e of i(d)){const s=e.slice();t(e)||s.push(a(s[0])),g.push(s)}if(g.length>0)for(const t of g){if("digitizing"===f&&c.length>o)break;const s=new r({...p(t)?{curvePaths:[t]}:{paths:[t]},spatialReference:d.spatialReference,hasZ:d.hasZ,hasM:d.hasM});e({templatePart:n,shape:s,edits:c,relationships:m,mode:f,associationFeaturesByTemplate:u})}}const l=!1;export{n as execute,l as isAsync};
