/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{markAsTarget as e,fromValues as t}from"../../sketch/normalizedPoint.js";import{DrapedEdgeSnappingCandidate as n}from"../candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as d}from"../candidates/EdgeSnappingCandidate.js";import{VertexSnappingCandidate as r}from"../candidates/VertexSnappingCandidate.js";function a({x:e,y:n,z:d}){return t(e,n,d??0)}function o(t,o){switch(t.type){case"edge":return t.draped?new n({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,getGroundElevation:o}):new d({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1});case"vertex":return new r({targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1})}}function i(e,t){return"3d"===e?.type?(n,d)=>e.elevationProvider.getElevation(n,d,0,t,"ground"):()=>null}export{o as convertSnappingCandidate,i as makeGetGroundElevation};
