import { __awaiter } from "tslib";
/**
 * Extracts dynamic relations node from component relations node
 */
export const componentRelationsNodeExtractor = (module, logger) => __awaiter(void 0, void 0, void 0, function* () {
    const localModule = module;
    logger === null || logger === void 0 ? void 0 : logger.debug('componentRelationsNodeExtractor: trying to extract dynamic node');
    if (!localModule) {
        return null;
    }
    const nodeMeta = localModule.default;
    if (!nodeMeta) {
        return null;
    }
    const metadata = yield nodeMeta.relationsEditorMetadata;
    if (!metadata) {
        return null;
    }
    return {
        data: metadata.nodeDefinition,
        metaInfo: metadata.metaInfo,
        singleton: true,
        displayName: localModule.displayName,
        scope: localModule.scope,
        name: localModule.name,
        package: localModule.package,
    };
});
//# sourceMappingURL=componentRelationsNode.extractor.js.map