!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","../../Validation","./shared","./tools","./ArcGisApiVersion","../../Errors"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var v=e("../../Validation"),y=e("./shared"),h=e("./tools"),g=e("./ArcGisApiVersion"),m=e("../../Errors"),e=(i.prototype.execute=function(e,t){for(var i=v.validation.urlOrLayer(e,g.isArcGisApiVersion3x),i=h.addToPath(i,"applyEdits"),o=v.validation.boolean("useGlobalIds",e.useGlobalIds,!1),r=v.validation.string("objectIdField",e.objectIdField,o?"GlobalID":"OBJECTID"),s=v.validation.string("gdbVersion",e.gdbVersion),n=v.validation.number("timeout",e.timeout),a=[],l=[],u=0,d=v.validation.array("features",e.features,v.validation.never);u<d.length;u++){var c=d[u];if("number"==typeof c)a.push(c);else if("string"==typeof c)o?l.push(c):(f=parseInt(c),isNaN(f)||a.push(f));else{var p=c.attributes;if("object"==typeof p){if(!p.hasOwnProperty(r))throw new m.GenericActivityError('Error running the "Delete Features" activity. Feature does not have a "'+r+'" property. NOTE: The "Id Field" input is case-sensitive.');var f=c.attributes[r];(o?l:a).push(f)}}}e=o?y.combineGlobalIds(l):a.toString(),n=h.post(i,{deletes:e,gdbVersion:s,useGlobalIds:o},n,t.cancellationToken.signal);h.schedulePromiseCancellation(t,n);var b=this;return h.inline(n,function(e){b.onApplyEditsComplete(e);var t=e.deleteResults&&e.deleteResults.every(function(e){return e.success});return{results:e.deleteResults,success:t}})},i.prototype.onApplyEditsComplete=function(e){},i.action="gcx:wf:arcgis::DeleteFeatures",i.suite="gcx:wf:builtin",i);function i(){}t.DeleteFeatures=e});