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";let SetViewpoint=class{execute(e,t,i){let o=validation.array("geometry",e.geometry,[]);const r=featuresToArray(e.features);o=[...o,...r.map(t=>t.geometry)];const n=i.create();return inline(n.load(),function(){const t=n.getViewpoint();n.getScale();return n.setViewpoint(o,e.viewpoint).then(function(){return{oldViewpoint:t,newViewpoint:n.getViewpoint()}})})}};SetViewpoint.action="gcx:wf:arcgis::SetViewpoint",SetViewpoint.suite="gcx:wf:builtin",SetViewpoint=__decorate([activate(MapProvider)],SetViewpoint);export{SetViewpoint};