import { get, post } from "./serviceHelper";
let systemStatusInFlight = null;
export function getSystemStatus(options) {
    const force = options?.force === true;
    const url = force ? "/parhelia/status?refresh=1" : "/parhelia/status";
    if (!force && systemStatusInFlight) {
        return systemStatusInFlight;
    }
    const requestPromise = get(url)
        .finally(() => {
        if (systemStatusInFlight === requestPromise) {
            systemStatusInFlight = null;
        }
    });
    systemStatusInFlight = requestPromise;
    return requestPromise;
}
export function getEditorSettings() {
    return get("/parhelia/settings");
}
export function getSamplePrompts() {
    return get("/parhelia/sampleprompts");
}
export function getHomeQuickActions() {
    return get("/parhelia/homequickactions");
}
export function getAiTextEditPrompts() {
    return get("/parhelia/aitexteditprompts");
}
export function saveUserPreferences(preferences) {
    return post("/parhelia/savepreferences", preferences);
}
//# sourceMappingURL=systemService.js.map