/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{create as t,markAsTarget as e,fromValues as n}from"../../sketch/normalizedPoint.js";import{DrapedEdgeSnappingCandidate as r}from"../candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as a}from"../candidates/EdgeSnappingCandidate.js";import{VertexSnappingCandidate as d}from"../candidates/VertexSnappingCandidate.js";function o(t,e){const{x:r,y:a}=t,d="3d"===e&&null!=t.z?t.z:0;return n(r,a,d)}function i(n,i,g){switch(n.type){case"edge":return n.draped?new r({edgeStart:o(n.start,i),edgeEnd:o(n.end,i),targetPoint:e(o(n.target,i)),objectId:n.objectId,getGroundElevation:g}):new a({edgeStart:o(n.start,i),edgeEnd:o(n.end,i),targetPoint:e(o(n.target,i)),objectId:n.objectId,isDraped:!1});case"vertex":return new d({targetPoint:e(o(n.target,i)),objectId:n.objectId,isDraped:!1,originalTargetPoint:t(n.target.x,n.target.y,n.target.z)})}}function g(t,e){return"3d"===t?.type?(n,r)=>t.elevationProvider.getElevation(n,r,0,e,"ground"):()=>null}export{i as convertSnappingCandidate,g as makeGetGroundElevation};
