define(["require","exports","../../Validation","./tools"],function(t,e,o,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=(i.prototype.execute=function(t,e){var r=a.featuresToArray(o.validation.exists("features",t.features)),i=o.validation.string("sortAttribute",t.sortAttribute),t=o.validation.boolean("ascending",t.ascending,!0);r=r.sort(function(t,e){return t=t.attributes?t.attributes[i]:void 0,e=e.attributes?e.attributes[i]:void 0,null==t?null==e?0:-1:null==e?1:("string"==typeof t&&"string"==typeof e&&(t=t.toLowerCase(),e=e.toLowerCase()),t<e?-1:e<t?1:0)});return!1===t&&r.reverse(),{features:r}},i.action="gcx:wf:arcgis::SortFeatureSet",i.suite="gcx:wf:builtin",i);function i(){}e.SortFeatureSet=r});