"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasChartsInDashboard = exports.getDefaultChartTileSize = exports.defaultTileSize = exports.isDashboardVersionedFields = exports.isDashboardUnversionedFields = exports.DashboardSummaryTone = exports.isDashboardDataAppTileType = exports.isDashboardHeadingTileType = exports.isDashboardSqlChartTile = exports.isDashboardLoomTileType = exports.isDashboardMarkdownTileType = exports.isDashboardChartTileType = exports.DashboardTileTypes = void 0;
exports.isDuplicateDashboardParams = isDuplicateDashboardParams;
var DashboardTileTypes;
(function (DashboardTileTypes) {
    DashboardTileTypes["SAVED_CHART"] = "saved_chart";
    DashboardTileTypes["SQL_CHART"] = "sql_chart";
    DashboardTileTypes["MARKDOWN"] = "markdown";
    DashboardTileTypes["LOOM"] = "loom";
    DashboardTileTypes["HEADING"] = "heading";
    DashboardTileTypes["DATA_APP"] = "data_app";
})(DashboardTileTypes || (exports.DashboardTileTypes = DashboardTileTypes = {}));
const isDashboardChartTileType = (tile) => tile.type === DashboardTileTypes.SAVED_CHART;
exports.isDashboardChartTileType = isDashboardChartTileType;
const isDashboardMarkdownTileType = (tile) => tile.type === DashboardTileTypes.MARKDOWN;
exports.isDashboardMarkdownTileType = isDashboardMarkdownTileType;
const isDashboardLoomTileType = (tile) => tile.type === DashboardTileTypes.LOOM;
exports.isDashboardLoomTileType = isDashboardLoomTileType;
const isDashboardSqlChartTile = (tile) => tile.type === DashboardTileTypes.SQL_CHART;
exports.isDashboardSqlChartTile = isDashboardSqlChartTile;
const isDashboardHeadingTileType = (tile) => tile.type === DashboardTileTypes.HEADING;
exports.isDashboardHeadingTileType = isDashboardHeadingTileType;
const isDashboardDataAppTileType = (tile) => tile.type === DashboardTileTypes.DATA_APP;
exports.isDashboardDataAppTileType = isDashboardDataAppTileType;
var DashboardSummaryTone;
(function (DashboardSummaryTone) {
    DashboardSummaryTone["FRIENDLY"] = "friendly";
    DashboardSummaryTone["FORMAL"] = "formal";
    DashboardSummaryTone["DIRECT"] = "direct";
    DashboardSummaryTone["ENTHUSIASTIC"] = "enthusiastic";
})(DashboardSummaryTone || (exports.DashboardSummaryTone = DashboardSummaryTone = {}));
const isDashboardUnversionedFields = (data) => ('name' in data && !!data.name) ||
    ('spaceUuid' in data && !!data.spaceUuid);
exports.isDashboardUnversionedFields = isDashboardUnversionedFields;
const isDashboardVersionedFields = (data) => 'tiles' in data && !!data.tiles;
exports.isDashboardVersionedFields = isDashboardVersionedFields;
exports.defaultTileSize = {
    h: 9,
    w: 15,
    x: 0,
    y: 0,
};
const getDefaultChartTileSize = (chartType) => {
    switch (chartType) {
        case 'big_number':
            return {
                h: 6,
                w: 9,
                x: 0,
                y: 0,
            };
        default:
            return exports.defaultTileSize;
    }
};
exports.getDefaultChartTileSize = getDefaultChartTileSize;
const hasChartsInDashboard = (dashboard) => dashboard.tiles.some((tile) => (0, exports.isDashboardChartTileType)(tile) &&
    tile.properties.belongsToDashboard);
exports.hasChartsInDashboard = hasChartsInDashboard;
function isDuplicateDashboardParams(params) {
    return 'dashboardName' in params && 'dashboardDesc' in params;
}
//# sourceMappingURL=dashboard.js.map