/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../chunks/tslib.es6","../../geometry","../../core/Accessor","../../core/jsonMap","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../geometry/support/jsonUtils"],(function(e,t,o,r,s,i,n,c,p,y,a){"use strict";const g=new s.JSONMap({9001:"meters",9002:"feet",9036:"kilometers",9093:"miles",109012:"nautical-miles",109001:"yards"});let l=function(t){function o(e){var o;return(o=t.call(this,e)||this).geometry1=null,o.geometry2=null,o.distanceUnit=null,o.geodesic=null,o}return e._inheritsLoose(o,t),o.prototype.toJSON=function(){const e={},t=this.geometry1;t&&(e.geometry1=JSON.stringify({geometryType:a.getJsonType(t),geometry:t}),e.sr=JSON.stringify(this.geometry1.spatialReference.toJSON()));const o=this.geometry2;return o&&(e.geometry2=JSON.stringify({geometryType:a.getJsonType(o),geometry:o})),this.distanceUnit&&(e.distanceUnit=g.toJSON(this.distanceUnit)),this.geodesic&&(e.geodesic=this.geodesic),e},o}(r);t.__decorate([i.property({types:o.geometryTypes,json:{write:!0}})],l.prototype,"geometry1",void 0),t.__decorate([i.property({types:o.geometryTypes,json:{write:!0}})],l.prototype,"geometry2",void 0),t.__decorate([i.property({type:String,json:{write:!0}})],l.prototype,"distanceUnit",void 0),t.__decorate([i.property({type:Boolean,json:{write:!0}})],l.prototype,"geodesic",void 0),l=t.__decorate([y.subclass("esri.rest.support.DistanceParameters")],l);return l}));
