/*
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/maybe","../../../core/unitUtils"],(function(e,t,n){"use strict";function i(e,i){if(t.isNone(e)||t.isNone(i))return null;const{samples:o,spatialReference:l}=e,{distance:r,elevation:v}=i,c=n.getMetersPerUnitForSR(l),u=n.getMetersPerVerticalUnitForSR(l),g=o.length,m=new Array(g);for(let t=0;t<g;++t){const e=o[t],n=e.sampledZ,i=e.coordinate;m[t]={x:i[0],y:i[1],z:n,distance:a(e.distance,c,r),elevation:s(n,u,v)}}return m}function o(e,i){if(t.isNone(e)||t.isNone(i)||t.isNone(e.statistics)||t.isNone(e.spatialReference))return null;const{distance:o,elevation:l}=i,{statistics:r,spatialReference:v}=e,c=n.getMetersPerUnitForSR(v),u=n.getMetersPerVerticalUnitForSR(v);return{maxDistance:a(r.maxDistance,c,o),minElevation:s(r.minElevation,u,l),maxElevation:s(r.maxElevation,u,l),avgElevation:s(r.avgElevation,u,l),elevationGain:s(r.elevationGain,u,l),elevationLoss:s(r.elevationLoss,u,l),maxPositiveSlope:r.maxPositiveSlope,maxNegativeSlope:r.maxNegativeSlope,avgPositiveSlope:r.avgPositiveSlope,avgNegativeSlope:r.avgNegativeSlope}}function a(e,t,i){return null==e?null:n.convertUnit(e*t,"meters",i)}function s(e,t,i){return null==e?null:n.convertUnit(e*t,"meters",i)}e.convertSamples=i,e.convertStatistics=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
