import { UMB_BLOCK_WORKSPACE_CONTEXT } from '../index.js';
import { UmbConditionBase } from '../../../core/extension-registry/index.js';
export class UmbBlockEntryIsExposedCondition extends UmbConditionBase {
    constructor(host, args) {
        super(host, args);
        this.consumeContext(UMB_BLOCK_WORKSPACE_CONTEXT, (context) => {
            this.observe(context?.exposed, (exposed) => {
                if (exposed !== undefined) {
                    // Check if equal to match, if match not set it defaults to true.
                    this.permitted = exposed === (this.config.match !== undefined ? this.config.match : true);
                }
            }, 'observeHasExpose');
        });
    }
}
export default UmbBlockEntryIsExposedCondition;
