import{__decorate}from"tslib";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{inline,featuresToArray}from"./tools.js";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";let RemoveGraphics=class{execute(e,i,r){const o=validation.id("layerId",e.layerId,void 0),a=r.create(),s=featuresToArray(validation.exists("features",e.features));return inline(a.load(),function(){if(o){const e=a.findLayer(o);return inline(e&&e.load(),function(){return e.removeFeatures(s),{}})}if(isArcGisApiVersion3x)for(const i of s)a.map.graphics.remove(i);else a.view.graphics.removeMany(s)})}};RemoveGraphics.action="gcx:wf:arcgis::RemoveGraphics",RemoveGraphics.suite="gcx:wf:builtin",RemoveGraphics=__decorate([activate(MapProvider)],RemoveGraphics);export{RemoveGraphics};