import { UMB_MEMBER_TYPE_IMPORT_MODAL } from './modal/member-type-import-modal.token.js';
import { UMB_ACTION_EVENT_CONTEXT } from '../../../../core/action/index.js';
import { UmbEntityActionBase, UmbRequestReloadChildrenOfEntityEvent } from '../../../../core/entity-action/index.js';
import { umbOpenModal } from '../../../../core/modal/index.js';
export class UmbImportMemberTypeEntityAction extends UmbEntityActionBase {
    async execute() {
        await umbOpenModal(this, UMB_MEMBER_TYPE_IMPORT_MODAL, {
            data: { unique: this.args.unique },
        }).catch(() => { });
        const actionEventContext = await this.getContext(UMB_ACTION_EVENT_CONTEXT);
        if (!actionEventContext) {
            throw new Error('Action event context not found.');
        }
        const event = new UmbRequestReloadChildrenOfEntityEvent({
            unique: this.args.unique,
            entityType: this.args.entityType,
        });
        actionEventContext.dispatchEvent(event);
    }
}
export default UmbImportMemberTypeEntityAction;
