import { UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE } from '../entity.js';
import { UmbDocumentBlueprintTreeServerDataSource } from './server-data-source/document-blueprint-tree.server.data-source.js';
import { UMB_DOCUMENT_BLUEPRINT_TREE_STORE_CONTEXT } from './document-blueprint-tree.store.context-token.js';
import { UmbLocalizationController } from '../../../../libs/localization-api/index.js';
import { UmbTreeRepositoryBase } from '../../../core/tree/index.js';
export class UmbDocumentBlueprintTreeRepository extends UmbTreeRepositoryBase {
    #localize = new UmbLocalizationController(this);
    constructor(host) {
        super(host, UmbDocumentBlueprintTreeServerDataSource, UMB_DOCUMENT_BLUEPRINT_TREE_STORE_CONTEXT);
    }
    async requestTreeRoot() {
        const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 0 });
        const hasChildren = treeRootData ? treeRootData.total > 0 : false;
        const data = {
            unique: null,
            entityType: UMB_DOCUMENT_BLUEPRINT_ROOT_ENTITY_TYPE,
            name: this.#localize.term('treeHeaders_contentBlueprints'),
            hasChildren,
            isFolder: true,
        };
        return { data };
    }
}
export { UmbDocumentBlueprintTreeRepository as api };
