"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const node_os_1 = require("node:os");
const node_path_1 = require("node:path");
const Local_1 = require("../Local");
const Local_2 = require("../fs/Local");
const connect_1 = require("./connect");
const keybindings_json_1 = __importDefault(require("../keybindings.json"));
async function default_1(path) {
    let config = null;
    try {
        config = JSON.parse(await (0, Local_1.read)(path));
    }
    catch (e) { }
    return {
        home: (0, node_os_1.homedir)(),
        settings: (0, node_path_1.join)((0, node_os_1.homedir)(), '.f5', 'settings.json'),
        connections: (0, node_path_1.join)((0, node_os_1.homedir)(), '.f5', 'connections'),
        keybindings: keybindings_json_1.default,
        mode: config?.mode ?? 'system',
        theme: config?.theme ?? 'black',
        timeFmt: config?.timeFmt ?? 'yyyy-MM-dd HH:mm',
        sizeFmt: config?.sizeFmt ?? '0.0 b',
        local: (0, connect_1.explorerSettings)(Local_2.ATTRIBUTES, config?.local),
        remote: (0, connect_1.explorerSettings)(Local_2.ATTRIBUTES, config?.remote),
        path: config?.path ?? { local: (0, node_os_1.homedir)(), remote: (0, node_os_1.homedir)() },
        sync: config?.sync ?? null
    };
}
