const expandCollapseUtils = {
    expandAll: function expandAll() {
        log('expandAll: enter');

        const lensDTOs = lensUtils.getLensDTOsToDisplay();
        // get DTOs for all the displayed lenses

        const theCount = lensDTOs.length;

        for (var zIndex = 0; zIndex < theCount; zIndex++) {
            var dto = lensDTOs[zIndex];

            var lensId = dto.LensId;

            var expanded = tabsCardExpStorageUtils.isCardExpanded(lensId);

            if (!expanded) {
                moreLessClickUtils.handleMoreClick_Tabs(lensId);
                // expand the lens card
                // NOTE: we assume the lens card has tabs
            }
        }

        log('expandAll: leave');
    },

    collapseAll: function collapseAll() {
        log('collapseAll: enter');

        const lensDTOs = lensUtils.getLensDTOsToDisplay();
        // get DTOs for all the displayed lenses

        const theCount = lensDTOs.length;

        for (var zIndex = 0; zIndex < theCount; zIndex++) {
            var dto = lensDTOs[zIndex];

            var lensId = dto.LensId;

            var expanded = tabsCardExpStorageUtils.isCardExpanded(lensId);

            if (expanded) {
                moreLessClickUtils.handleLessClick_Tabs(lensId);
                // collapse the lens card
                // NOTE: we assume the lens card has tabs
            }
        }

        log('collapseAll: leave');
    }
};