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