import { UmbDefaultTreeItemContext } from '../../../../core/tree/index.js';
import { UmbIsTrashedEntityContext } from '../../../../core/recycle-bin/index.js';
import { UmbEntityContentTypeEntityContext } from '../../../../content/content-type/index.js';
import { UMB_MEDIA_TYPE_ENTITY_TYPE } from '../../../media-types/index.js';
export class UmbMediaTreeItemContext extends UmbDefaultTreeItemContext {
    #isTrashedContext;
    #entityContentTypeContext;
    constructor(host) {
        super(host);
        this.#isTrashedContext = new UmbIsTrashedEntityContext(this);
        this.#entityContentTypeContext = new UmbEntityContentTypeEntityContext(this);
        this.noAccess = this._treeItem.asObservablePart((item) => item?.noAccess ?? false);
        this.observe(this.treeItem, (item) => {
            this.#isTrashedContext.setIsTrashed(item?.isTrashed || false);
            const mediaTypeUnique = item?.mediaType.unique;
            this.#entityContentTypeContext.setEntityType(mediaTypeUnique ? UMB_MEDIA_TYPE_ENTITY_TYPE : undefined);
            this.#entityContentTypeContext.setUnique(mediaTypeUnique ?? undefined);
        });
    }
}
export { UmbMediaTreeItemContext as api };
