/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/arrayUtils","../../../../core/maybe","../EditGeometry"],(function(e,t,i,o){"use strict";let n=function(){function e(e,t){this.editGeometry=e,this.component=t,this.createdEdge=null}var n=e.prototype;return n.apply=function(){let e="redo";if(i.isNone(this.createdEdge)){e="apply";const t=this.component.getFirstVertex(),n=this.component.getLastVertex();if(this.component.isClosed()||this.component.vertices.length<3||i.isNone(t)||i.isNone(n))return;this.createdEdge=new o.Edge(this.component,n,t)}this.createdEdge.leftVertex.rightEdge=this.createdEdge,this.createdEdge.rightVertex.leftEdge=this.createdEdge,this.component.edges.push(this.createdEdge),this.editGeometry.notifyChanges({operation:e})},n.undo=function(){i.isNone(this.createdEdge)||(t.remove(this.component.edges,this.createdEdge),this.createdEdge.leftVertex.rightEdge=null,this.createdEdge.rightVertex.leftEdge=null,this.editGeometry.notifyChanges({operation:"undo"}))},n.accumulate=function(){return!1},e}();e.CloseComponent=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
