/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{WorkerHandle as e}from"../../core/workers/WorkerHandle.js";import t from"../../geometry/Point.js";class o extends e{constructor(){super("MeasurementWorker","geodesicArea",{},void 0,{strategy:"distributed"})}async geodesicArea(e,o,r){const n=e.toJSON(),{area:i,centroid:a,length:s}=await this.invokeMethod("geodesicArea",{geometryJSON:n,options:{...o,stagedPoint:o?.stagedPoint?.toJSON()}},r);return{area:i,centroid:a?t.fromJSON(a):void 0,length:s}}preloadGeodesic(){this.broadcast(void 0,"preloadGeodesic")}geodesicLength(e,t,o){const r=e.toJSON();return this.invokeMethod("geodesicLength",{geometryJSON:r,options:{...t,stagedPoint:t?.stagedPoint?.toJSON()}},o)}async area2D(e,o,r){const n=e.toJSON(),{area:i,centroid:a,length:s}=await this.invokeMethod("area2D",{geometryJSON:n,options:{...o,stagedPoint:o?.stagedPoint?.toJSON()}},r);return{area:i,centroid:a?t.fromJSON(a):void 0,length:s}}length2D(e,t,o){const r=e.toJSON();return this.invokeMethod("length2D",{geometryJSON:r,options:{...t,stagedPoint:t?.stagedPoint?.toJSON()}},o)}async areaHorizontal(e,o,r){const n=e.toJSON(),{area:i,centroid:a,length:s}=await this.invokeMethod("areaHorizontal",{geometryJSON:n,options:{...o,stagedPoint:o?.stagedPoint?.toJSON()}},r);return{area:i,centroid:a?t.fromJSON(a):void 0,length:s}}}export{o as MeasurementWorkerHandle};
