"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatter = void 0;
const platform_1 = require("../utils/platform.js");
const const_1 = require("./const.js");
class ShortCutFormatter {
    #map = new Map();
    set(name, defs) {
        if (Array.isArray(defs)) {
            this.#map.set(name, defs);
        }
        else {
            const platformedDefs = defs[(0, platform_1.isMac)() ? 'mac' : 'pc'];
            if (platformedDefs) {
                this.#map.set(name, platformedDefs);
            }
        }
        return this;
    }
    toPM(name) {
        const defs = this.#map.get(name);
        if (!defs)
            return null;
        return defs.join('-');
    }
    toCM(name) {
        const defs = this.#map.get(name);
        if (!defs)
            return null;
        return defs.sort((a) => (a === const_1.ModKey.Shift ? -1 : 0)).join('-');
    }
    toView(name) {
        const defs = this.#map.get(name);
        return defs?.join('+');
    }
}
exports.formatter = new ShortCutFormatter();
//# sourceMappingURL=formatter.js.map
