import{__decorate}from"tslib";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{inline}from"./tools.js";let GetLayerDefinitionExpression=class{execute(i,e,n){const o=validation.id("layerId",i.layerId,validation.never),r=validation.id("sublayerId",i.sublayerId,void 0),t=n.create();return inline(t.load(),function(){const e=t.findLayer(o);return void 0!==e&&null!==e?inline(e.load(),function(){if(void 0===r)return{expression:e.getDefinitionExpression()};const i=t.findLayer(r,e.layer);return void 0!==i&&null!==i?{expression:i.getDefinitionExpression()}:{}}):{}})}};GetLayerDefinitionExpression.action="gcx:wf:arcgis::GetLayerDefinitionExpression",GetLayerDefinitionExpression.suite="gcx:wf:builtin",GetLayerDefinitionExpression=__decorate([activate(MapProvider)],GetLayerDefinitionExpression);export{GetLayerDefinitionExpression};