"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getExtra(extraValues, item, totalItems) {
    var _a, _b, _c, _d, _e, _f;
    var key = item.seriesIdentifier.key, defaultExtra = item.defaultExtra, childId = item.childId;
    if (extraValues.size === 0) {
        return _b = (_a = defaultExtra) === null || _a === void 0 ? void 0 : _a.formatted, (_b !== null && _b !== void 0 ? _b : '');
    }
    var itemExtraValues = extraValues.get(key);
    var actionExtra = (_d = (childId && ((_c = itemExtraValues) === null || _c === void 0 ? void 0 : _c.get(childId))), (_d !== null && _d !== void 0 ? _d : null));
    if (extraValues.size !== totalItems) {
        if (actionExtra != null) {
            return actionExtra;
        }
        return '';
    }
    return actionExtra !== null ? actionExtra : (_f = (_e = defaultExtra) === null || _e === void 0 ? void 0 : _e.formatted, (_f !== null && _f !== void 0 ? _f : ''));
}
exports.getExtra = getExtra;
//# sourceMappingURL=utils.js.map