/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{P as e,A as t,a as r,b as n}from"./Envelope.js";import{P as s,a as o,M as a}from"./MultiPathImpl.js";function i({type:s,vertexCount:o,vertexXY:i,vertexZ:f,vertexM:u,partCount:p,partOffsets:l,partFlags:c,segmentFlags:y,segmentIndices:A,segmentParams:g,segmentCountArc:w,segmentCountBezier:C}){const v=new m[s];if(v instanceof e)return v.setXYCoords(i[0],i[1]),f&&v.setZ(f[0]),u&&v.setM(u[0]),v;const z=new t({fromArray:i});if(v.setAttributeStreamRef(0,z),f){const e=new t({fromArray:f});v.setAttributeStreamRef(1,e)}if(u){const e=new t({fromArray:u});v.setAttributeStreamRef(2,e)}if(v instanceof a)return v.resizeNoInit(o),v;{const e=p+1,t=new r({fromArray:l,size:e}),s=new n({fromArray:c,size:e});v.setPathStreamRef(t),v.setPathFlagsStreamRef(s)}if(null==y)return v.resizeImpl(o),v;const P=new n({fromArray:y}),S=new r({fromArray:A}),x=new t({fromArray:g});return v.setSegmentData(S,x,P,g.length),v.incCurveType(4,w),v.incCurveType(2,C),v.modifyCurveCounter(w+C),v.resizeImpl(o),v}const m={point:e,multipoint:a,polyline:o,polygon:s};export{i as constructFromFlatGeometry};
