import { __extends } from '../../../../node_modules/tslib/tslib.es6.js';
import { Link } from '../../link.js';
import { BaseConfig } from '../../BaseConfig.js';

var FooterConfig = /** @class */ (function (_super) {
    __extends(FooterConfig, _super);
    function FooterConfig(_a) {
        var config = _a.config, brand = _a.brand, _b = _a.environment, environment = _b === void 0 ? 'production' : _b, _c = _a.useAbsoluteUrls, useAbsoluteUrls = _c === void 0 ? false : _c, project = _a.project;
        var _this = _super.call(this, { brand: brand, environment: environment, useAbsoluteUrls: useAbsoluteUrls, project: project }) || this;
        _this.config = config;
        return _this;
    }
    FooterConfig.prototype.getMappedConfig = function () {
        if (this.mappedConfig)
            return this.mappedConfig;
        var mappedConfig = {
            sections: this.config.sections.map(this.mapSectionConfig.bind(this)),
            apps: {
                android: this.mapLinkArray(this.config.apps.android),
                apple: this.mapLinkArray(this.config.apps.apple),
            },
            socialMedia: {
                facebook: this.mapLinkArray(this.config.socialMedia.facebook),
                instagram: this.mapLinkArray(this.config.socialMedia.instagram),
                linkedin: this.mapLinkArray(this.config.socialMedia.linkedin),
                youtube: this.mapLinkArray(this.config.socialMedia.youtube),
                // NOTE: The Twitter icon asset is currently not in use but has been retained for potential future integration.
                twitter: this.mapLinkArray(this.config.socialMedia.twitter),
            },
            companies: this.mapLinkArray(this.config.companies),
        };
        this.mappedConfig = mappedConfig;
        return this.mappedConfig;
    };
    FooterConfig.prototype.mapSectionConfig = function (section) {
        return {
            title: this.mapLinkArray(section.title),
            items: this.mapLinkArray(section.items),
        };
    };
    FooterConfig.prototype.mapLinkArray = function (linkConfigArray) {
        var _this = this;
        return linkConfigArray
            .map(function (linkConfig) { return _this.mapLink(linkConfig); })
            .filter(function (item) { return item.isVisible; });
    };
    FooterConfig.prototype.mapLink = function (config) {
        return new Link({
            config: config,
            brand: this.brand,
            environment: this.environment,
            useAbsoluteUrls: this.useAbsoluteUrls,
            project: this.project,
            linkProtocol: this.linkProtocol,
            domains: this.domains,
        });
    };
    return FooterConfig;
}(BaseConfig));

export { FooterConfig };
//# sourceMappingURL=factory.js.map
