import { APP_CONFIG_MERGED } from "./config-sync.js";
async function loadApplicationConfig() {
  return {
    ...APP_CONFIG_MERGED,
    // Add placeholder properties to satisfy ApplicationConfig interface (unused)
    i18n: {
      ...APP_CONFIG_MERGED.i18n,
      detectionStrategy: ["user_database", "cookie", "header", "default"],
      performance: {
        ...APP_CONFIG_MERGED.i18n.performance,
        lazyLoadNamespaces: false,
        enableFallbackChaining: true
      }
    },
    app: {
      ...APP_CONFIG_MERGED.app,
      description: "",
      contact: {
        email: "",
        website: "",
        documentation: ""
      }
    },
    features: {
      enableAnalytics: false,
      enableNotifications: false,
      enableBilling: false,
      enableTeamFeatures: false,
      enableAdvancedSecurity: false,
      enableAPIAccess: false
    },
    ui: {
      theme: {
        defaultMode: "system",
        allowUserToggle: true
      },
      notifications: {
        position: "top-right",
        maxVisible: 5,
        autoHideDuration: 5e3
      }
    },
    environments: {
      development: {
        enableDebugLogs: true,
        enableTranslationDebugging: true,
        strictTypeChecking: true,
        enablePerformanceMonitoring: false
      },
      production: {
        enableDebugLogs: false,
        enableTranslationDebugging: false,
        strictTypeChecking: true,
        enablePerformanceMonitoring: true
      }
    }
  };
}
function getMinimalFallbackConfig() {
  return {
    i18n: {
      supportedLocales: ["en"],
      defaultLocale: "en",
      detectionStrategy: ["default"],
      cookie: {
        name: "locale",
        maxAge: 365 * 24 * 60 * 60 * 1e3,
        httpOnly: false,
        secure: "auto",
        sameSite: "lax",
        path: "/"
      },
      namespaces: ["common"],
      performance: {
        lazyLoadNamespaces: false,
        preloadCriticalNamespaces: ["common"],
        enableFallbackChaining: true
      }
    },
    app: {
      name: "Application",
      version: "1.0.0",
      description: "Application",
      contact: {
        email: "support@example.com",
        website: "https://example.com",
        documentation: "https://docs.example.com"
      }
    },
    userRoles: {
      defaultRole: "member",
      availableRoles: ["member", "admin"],
      hierarchy: {
        admin: 0,
        member: 1
      },
      displayNames: {
        member: "common.userRoles.member",
        admin: "common.userRoles.admin"
      }
    },
    features: {
      enableAnalytics: false,
      enableNotifications: true,
      enableBilling: false,
      enableTeamFeatures: false,
      enableAdvancedSecurity: false,
      enableAPIAccess: true
    },
    api: {
      cors: {
        allowedOrigins: {
          development: ["http://localhost:3000"],
          production: []
        },
        allowAllOrigins: {
          development: true,
          production: false
        }
      }
    },
    ui: {
      theme: {
        defaultMode: "system",
        allowUserToggle: true
      },
      notifications: {
        position: "top-right",
        maxVisible: 5,
        autoHideDuration: 5e3
      }
    },
    environments: {
      development: {
        enableDebugLogs: true,
        enableTranslationDebugging: true,
        strictTypeChecking: true,
        enablePerformanceMonitoring: false
      },
      production: {
        enableDebugLogs: false,
        enableTranslationDebugging: false,
        strictTypeChecking: true,
        enablePerformanceMonitoring: true
      }
    }
  };
}
let cachedConfig = null;
async function getApplicationConfig() {
  if (cachedConfig) {
    return cachedConfig;
  }
  cachedConfig = await loadApplicationConfig();
  return cachedConfig;
}
function clearConfigCache() {
  cachedConfig = null;
}
export {
  clearConfigCache,
  getApplicationConfig,
  loadApplicationConfig
};
