"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
const removeMagicComments = async (absoluteFilePath) => {
    const removeDevMagicComment = (source) => source.replace(/\s+(\/\/ @core-development-only-start)(.*?)(\/\/ @core-development-only-end)/sg, '');
    const fileContent = fs_1.default.readFileSync(absoluteFilePath, { encoding: 'utf8' });
    return fs_1.default.writeFileSync(absoluteFilePath, removeDevMagicComment(fileContent));
};
const uncommentProjectOnly = async (absoluteFilePath) => {
    const uncommentProjectOnly = (source) => source.replace(/\s+(\/\* project-only-start)(.*?)\s+(project-only-end \*\/)/sg, (_, commentStart, partToUncomment) => partToUncomment);
    const fileContent = fs_1.default.readFileSync(absoluteFilePath, { encoding: 'utf8' });
    return fs_1.default.writeFileSync(absoluteFilePath, uncommentProjectOnly(fileContent));
};
exports.default = async (nuxtConfigPath) => {
    await removeMagicComments(nuxtConfigPath);
    await uncommentProjectOnly(nuxtConfigPath);
};
//# sourceMappingURL=processMagicComments.js.map