/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{bezierCurveLength as r}from"./bezierCurveUtils.js";import{circularCurveLength as i}from"./circleUtils.js";import{deriveCircleFromCircularArc as t}from"./circularArcUtils.js";import{isBezierCurve as s,isCircularArc as o,isEllipticArc4 as l}from"./curveUtils.js";import{deriveCircleFromEllipticArc4 as m}from"./ellipticArc4Utils.js";import{ellipticArcLength as c}from"./ellipticArc7Utils.js";import{distance2 as e}from"./mathUtils.js";function f(f,n,p=1){if(s(n))return r(f,n,p);if(o(n)){const r=t(f,n);return r.isInvalid?Math.sqrt(e(f,n.c[0])):i(r)}if(l(n)){const r=m(f,n);return r.isInvalid?Math.sqrt(e(f,n.a[0])):i(r)}return c(f,n,p)}export{f as curveLength};
