/*
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","../../Graphic","../../core/JSONSupport","../../core/maybe","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/reader","../../core/accessorSupport/decorators/subclass","../../geometry/SpatialReference","./DirectionsFeatureSet","./FeatureSet","./NAMessage","../../geometry/Point","../../geometry/Polyline","../../geometry/Polygon"],(function(e,r,t,o,i,a,n,p,s,c,l,u,y,d,_,f,g,m,B){"use strict";function S(e){return e.features.map((r=>{const t=y.fromJSON(e.spatialReference),i=o.fromJSON(r);return a.isSome(i.geometry)&&(i.geometry.spatialReference=t),i}))}function v(e){return _.fromJSON(e).features.map((e=>e.geometry))}let P=function(r){function t(e){var t;return(t=r.call(this,e)||this).directions=null,t.facilities=null,t.incidents=null,t.messages=null,t.pointBarriers=null,t.polylineBarriers=null,t.polygonBarriers=null,t.routes=null,t}e._inheritsLoose(t,r);var o=t.prototype;return o.readFacilities=function(e){return v(e)},o.readIncidents=function(e){return v(e)},o.readPointBarriers=function(e,r){return v(r.barriers)},o.readPolylineBarriers=function(e){return v(e)},o.readPolygonBarriers=function(e){return v(e)},o.readRoutes=function(e){return S(e)},t}(i.JSONSupport);r.__decorate([n.property({type:[d]})],P.prototype,"directions",void 0),r.__decorate([n.property({type:[g]})],P.prototype,"facilities",void 0),r.__decorate([l.reader("facilities")],P.prototype,"readFacilities",null),r.__decorate([n.property({type:[g]})],P.prototype,"incidents",void 0),r.__decorate([l.reader("incidents")],P.prototype,"readIncidents",null),r.__decorate([n.property({type:[f]})],P.prototype,"messages",void 0),r.__decorate([n.property({type:[g]})],P.prototype,"pointBarriers",void 0),r.__decorate([l.reader("pointBarriers",["barriers"])],P.prototype,"readPointBarriers",null),r.__decorate([n.property({type:[m]})],P.prototype,"polylineBarriers",void 0),r.__decorate([l.reader("polylineBarriers")],P.prototype,"readPolylineBarriers",null),r.__decorate([n.property({type:[B]})],P.prototype,"polygonBarriers",void 0),r.__decorate([l.reader("polygonBarriers")],P.prototype,"readPolygonBarriers",null),r.__decorate([n.property({type:[o]})],P.prototype,"routes",void 0),r.__decorate([l.reader("routes")],P.prototype,"readRoutes",null),P=r.__decorate([u.subclass("esri.rest.support.ClosestFacilitySolveResult")],P);return P}));
