"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ts = require("typescript");
// @ts-ignore
var common_1 = require("../../common/common");
exports.engineTransformer = function (context) {
    return function (rootNode) {
        function visit(node) {
            if (node.kind === ts.SyntaxKind.TaggedTemplateExpression) {
                var _a = node.getChildren(), tag = _a[0], template = _a[1];
                if (tag.getText() === 'MACRO_GL_COMPRESS') {
                    var text = template.getText().slice(1, -1);
                    text = common_1.stringAsClearedArray(text).map(function (it) { return it.trim(); }).filter(function (it) { return !!it; }).join('\n');
                    return ts.createLiteral(text);
                }
            }
            return ts.visitEachChild(node, visit, context);
        }
        return ts.visitNode(rootNode, visit);
    };
};
