"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var transformValueIsEssentiallyInt_1 = require("../helpers/transformValueIsEssentiallyInt");
var Layout3D_1 = require("../Layout3D");
var TRANSFORM_SUFFIX = ')';
var TRANSFORM_ZERO = '0';
var TRANSFORM_COMMA = ',';
var TRANSFORM_ZILCH = TRANSFORM_ZERO + TRANSFORM_COMMA;
function formatTransform(transform, format) {
    var prefix;
    var last;
    if (format === Layout3D_1.default.FORMATS.TWO) {
        transform = [
            transform[0],
            transform[1],
            transform[4],
            transform[5],
            transform[12],
            transform[13],
        ];
        prefix = 'matrix(';
        last = 5;
    }
    else {
        prefix = 'matrix3d(';
        last = 15;
    }
    for (var i = 0; i < last; i += 1) {
        prefix += transformValueIsEssentiallyInt_1.transformValueIsEssentiallyInt(transform[i], 0) ? TRANSFORM_ZILCH : transform[i] + TRANSFORM_COMMA;
    }
    prefix += transform[last] + TRANSFORM_SUFFIX;
    return prefix;
}
exports.default = formatTransform;
//# sourceMappingURL=formatTransform.js.map