"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldFetchData = void 0;
const compose_1 = require("../compose");
const get_family_1 = require("../get-family");
const includes_1 = require("../../utils/includes");
// TODO: need to fetch data for client-side layer views as well
// determine if we should fetch data for an item
/**
 * Determine if we should fetch data(.json or other content) for an item
 * @param item
 * @returns
 */
const shouldFetchData = (item) => {
    const type = (0, compose_1.normalizeItemType)(item);
    const family = (0, get_family_1.getFamily)(type);
    const dataFamilies = ["template", "solution"];
    const dataTypes = [
        // needed for web map/scene definition
        "Web Map",
        "Web Scene",
        // needed for popup template definition
        "Feature Service",
        // other types that require data fetches
        "Discussion",
        "Hub Initiative",
        "Hub Page",
        "Hub Project",
    ];
    return (0, includes_1.includes)(dataFamilies, family) || (0, includes_1.includes)(dataTypes, type);
};
exports.shouldFetchData = shouldFetchData;
//# sourceMappingURL=shouldFetchData.js.map