/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{areaUnitFromSpatialReference as e,convertUnit as r,getMetersPerUnitForSR as t}from"../core/units.js";import{fromGeometry as o,getSpatialReference as a}from"../geometry/operators/support/apiConverter.js";function n(n,s={}){const{unit:u}=s;let i=o(n).calculateArea2D();if(i&&u){const o=a(n);if(o.isGeographic)throw new Error("Unable to convert from an angular area unit to a linear area unit.");const s=e(o);s!==u&&(s?i=r(i,s,u):(i=Math.sqrt(i),i*=t(o),i**=2,i=r(i,"square-meters",u)))}return i}const s=!0,u=Object.freeze(Object.defineProperty({__proto__:null,execute:n,supportsCurves:s},Symbol.toStringTag,{value:"Module"}));export{u as a,n as e,s};
