/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/vec2","../../../../chunks/vec2f64","../SnappingConstraint","../snappingUtils","./SnappingCandidate","../hints/LineSnappingHint"],(function(n,t,e,i,a,r,s,o){"use strict";let c=function(n){function i({coordinateHelper:t,lineStart:e,lineEnd:i,targetPoint:s,elevationInfo:c}){var p;return(p=n.call(this,t,s,new a.LineConstraint(t,e,i),c)||this).referenceLineHint=new o.LineSnappingHint(r.LineSegmentHintType.REFERENCE_EXTENSION,e,i,c),p}return t._inheritsLoose(i,n),i.prototype._lineEndClosestToTarget=function(){const n=this.constraint.start,t=this.constraint.end;return Math.sign(e.dot(e.subtract(l,t,n),e.subtract(p,this.targetPoint,n)))>0?t:n},t._createClass(i,[{key:"hints",get:function(){return[this.referenceLineHint,new o.LineSnappingHint(r.LineSegmentHintType.TARGET,this._lineEndClosestToTarget(),this.targetPoint,this.elevationInfo)]}}]),i}(s.SnappingCandidate);const p=i.create(),l=i.create();n.LineSnappingCandidate=c,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
