// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../../core/arrayUtils ../../../core/compilerUtils ../../../core/Evented ../../../geometry/Polygon ../../../geometry/Polyline ../coordinateHelper ./unnormalizationHelper".split(" "),function(n,y,z,A,B,C,D,v){function w(a,c,b){const e=a.coordinateHelper;b=new q(c.spatialReference,b);b.index=0;const h=new r(b);h.index=0;h.pos=e.pointToVector(c);b.vertices.push(h);a.components.push(b)}class r{constructor(a){this.component=a;this.rightEdge=this.leftEdge=null;this.type="vertex";this.index= null}get pos(){return this._pos}set pos(a){this._pos=a;this.component.unnormalizeVertexPositions()}}class t{constructor(a,c,b){this.component=a;this.leftVertex=c;this.rightVertex=b;this.type="edge";c.rightEdge=this;b.leftEdge=this}}class q{constructor(a,c){this._spatialReference=a;this._viewingMode=c;this.vertices=[];this.edges=[];this.index=null}unnormalizeVertexPositions(){1>=this.vertices.length||v.unnormalize(this.vertices,v.getUnnormalizationInfo(this._spatialReference,this._viewingMode))}updateVertexIndex(a, c){if(0!==this.vertices.length){var b=this.vertices[0],e=null;do e=a,e.index=c++,a=e.rightEdge?e.rightEdge.rightVertex:null;while(null!=a&&a!==b);e.leftEdge&&e!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(e),this.vertices.length-1)}}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return 2b.vertices.length)continue;const e=[];let h=b.vertices.find(f=>null==f.leftEdge);const g=h;do e.push(c(h.pos)),h=h.rightEdge?h.rightEdge.rightVertex:null;while(h&&h!==g);a.push(e)}return new C({paths:a,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const a=[],c=this.coordinateHelper.vectorToArray;for(const b of this.components){if(1>b.vertices.length)continue; const e=[],h=b.vertices[0];let g=h;const f=g;do e.push(c(g.pos)),g=null!=g.rightEdge?g.rightEdge.rightVertex:null;while(g&&g!==f);b.isClosed()&&e.push(c(h.pos));a.push(e)}return new B({rings:a,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(a,c){var b=D.createCoordinateHelper(a.hasZ,a.hasM,a.spatialReference);b=new x(a.type,b);switch(a.type){case "polygon":var e=a.spatialReference,h=b.coordinateHelper;a=a.rings;for(var g= 0;g