/**
 * modules/config/globalConfig.js — appSettings (requireLogin, publicSignup).
 */
(function (g) {
    g.modules = g.modules || {};
    g.modules.config = g.modules.config || {};

    var adapt = function () {
        return g.modules.core.storageAdapter;
    };

    g.modules.config.globalConfig = {
        load: async function () {
            return adapt().getAppSettings();
        },

        save: async function (partial) {
            return adapt().saveAppSettings(partial || {});
        },

        isLoginRequired: async function () {
            var s = await this.load();
            return !!(s && s.requireLogin);
        },

        isPublicSignupEnabled: async function () {
            var s = await this.load();
            return s && s.publicSignup !== false;
        },
    };
})(typeof window !== 'undefined' ? window : this);
