import { UMB_BLOCK_SINGLE_MANAGER_CONTEXT } from './block-single-manager.context-token.js';
import { UMB_BLOCK_SINGLE_ENTRIES_CONTEXT } from './block-single-entries.context-token.js';
import { UmbBlockEntryContext } from '../../block/index.js';
import { UmbBooleanState, mergeObservables } from '../../../../libs/observable-api/index.js';
export class UmbBlockSingleEntryContext extends UmbBlockEntryContext {
    #inlineEditingMode;
    constructor(host) {
        super(host, UMB_BLOCK_SINGLE_MANAGER_CONTEXT, UMB_BLOCK_SINGLE_ENTRIES_CONTEXT);
        this.#inlineEditingMode = new UmbBooleanState(undefined);
        this.inlineEditingMode = this.#inlineEditingMode.asObservable();
        this.forceHideContentEditorInOverlay = this._blockType.asObservablePart((x) => x ? (x.forceHideContentEditorInOverlay ?? false) : undefined);
        this.showContentEdit = mergeObservables([this._contentStructureHasProperties, this.forceHideContentEditorInOverlay, this.inlineEditingMode], ([a, b, c]) => {
            return a === true && b === false && c === false;
        });
    }
    _gotManager() {
        this.observe(this._manager?.inlineEditingMode, (inlineEditingMode) => {
            this.#inlineEditingMode.setValue(inlineEditingMode);
        }, 'observeInlineEditingMode');
    }
    _gotEntries() { }
    _gotContentType() { }
}
