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