import {
  setBootstrapper
} from "./chunk-GCQUTWZ2.mjs";
import {
  __name
} from "./chunk-PAWJFY3S.mjs";

// src/client/config.ts
var _clientConfig = null;
function configureJsonApi(config) {
  _clientConfig = config;
  if (config.bootstrapper) {
    setBootstrapper(config.bootstrapper);
    config.bootstrapper();
  }
}
__name(configureJsonApi, "configureJsonApi");
function configureClientConfig(config) {
  _clientConfig = config;
}
__name(configureClientConfig, "configureClientConfig");
function getApiUrl() {
  if (_clientConfig?.apiUrl) {
    return _clientConfig.apiUrl;
  }
  if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_API_URL) {
    return process.env.NEXT_PUBLIC_API_URL;
  }
  return "";
}
__name(getApiUrl, "getApiUrl");
function getAppUrl() {
  if (_clientConfig?.appUrl) {
    return _clientConfig.appUrl;
  }
  if (typeof process !== "undefined" && process.env?.NEXT_PUBLIC_APP_URL) {
    return process.env.NEXT_PUBLIC_APP_URL;
  }
  if (typeof window !== "undefined") {
    return window.location.origin;
  }
  return "";
}
__name(getAppUrl, "getAppUrl");
function getTrackablePages() {
  return _clientConfig?.trackablePages ?? [];
}
__name(getTrackablePages, "getTrackablePages");
function getStripePublishableKey() {
  return _clientConfig?.stripePublishableKey;
}
__name(getStripePublishableKey, "getStripePublishableKey");

// src/i18n/config.ts
var _config = null;
function configureI18n(config) {
  _config = config;
}
__name(configureI18n, "configureI18n");
function useI18nRouter() {
  if (!_config?.useRouter) {
    throw new Error("i18n not configured. Call configureI18n() at app startup.");
  }
  return _config.useRouter();
}
__name(useI18nRouter, "useI18nRouter");
function useI18nTranslations(namespace) {
  if (!_config?.useTranslations) {
    return (key) => key;
  }
  return _config.useTranslations(namespace);
}
__name(useI18nTranslations, "useI18nTranslations");
function getI18nLink() {
  if (!_config?.Link) {
    throw new Error("i18n not configured. Call configureI18n() at app startup.");
  }
  return _config.Link;
}
__name(getI18nLink, "getI18nLink");
function useI18nLocale() {
  if (_config?.useLocale) {
    return _config.useLocale();
  }
  return "en";
}
__name(useI18nLocale, "useI18nLocale");
function useI18nDateFnsLocale() {
  if (_config?.useDateFnsLocale) {
    return _config.useDateFnsLocale();
  }
  return void 0;
}
__name(useI18nDateFnsLocale, "useI18nDateFnsLocale");

// src/login/config.ts
var _useDiscordAuth = false;
var _useGoogleAuth = false;
var _useInternalAuth = true;
var _allowRegistration = true;
var _registrationMode = "open";
function configureLogin(params) {
  _useDiscordAuth = !!params.discordClientId;
  _useGoogleAuth = !!params.googleClientId;
  _useInternalAuth = params.useInternalAuth ?? true;
  _allowRegistration = params.allowRegistration ?? true;
  _registrationMode = params.registrationMode ?? "open";
}
__name(configureLogin, "configureLogin");
function isDiscordAuthEnabled() {
  return _useDiscordAuth;
}
__name(isDiscordAuthEnabled, "isDiscordAuthEnabled");
function isGoogleAuthEnabled() {
  return _useGoogleAuth;
}
__name(isGoogleAuthEnabled, "isGoogleAuthEnabled");
function isInternalAuthEnabled() {
  return _useInternalAuth;
}
__name(isInternalAuthEnabled, "isInternalAuthEnabled");
function isRegistrationAllowed() {
  return _allowRegistration;
}
__name(isRegistrationAllowed, "isRegistrationAllowed");
function getRegistrationMode() {
  return _registrationMode;
}
__name(getRegistrationMode, "getRegistrationMode");

// src/roles/config.ts
var _roleId = null;
function configureRoles(roleId) {
  _roleId = roleId;
}
__name(configureRoles, "configureRoles");
function getRoleId() {
  if (!_roleId) {
    throw new Error("Roles not configured. Call configureRoles() at app startup.");
  }
  return _roleId;
}
__name(getRoleId, "getRoleId");
function isRolesConfigured() {
  return _roleId !== null;
}
__name(isRolesConfigured, "isRolesConfigured");

// src/features/waitlist/config/waitlist.config.ts
var _waitlistConfig = {};
function configureWaitlist(config) {
  _waitlistConfig = config;
}
__name(configureWaitlist, "configureWaitlist");
function getWaitlistConfig() {
  return _waitlistConfig;
}
__name(getWaitlistConfig, "getWaitlistConfig");

// src/features/referral/config.ts
var DEFAULT_REFERRAL_CONFIG = {
  enabled: false,
  cookieName: "referral_code",
  cookieDays: 30,
  urlParamName: "ref",
  referralUrlBase: "",
  referralPath: "/"
};
var _referralConfig = { ...DEFAULT_REFERRAL_CONFIG };
function configureReferral(config) {
  _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };
}
__name(configureReferral, "configureReferral");
function getReferralConfig() {
  return _referralConfig;
}
__name(getReferralConfig, "getReferralConfig");
function isReferralEnabled() {
  return _referralConfig.enabled;
}
__name(isReferralEnabled, "isReferralEnabled");

export {
  configureJsonApi,
  configureClientConfig,
  getApiUrl,
  getAppUrl,
  getTrackablePages,
  getStripePublishableKey,
  configureI18n,
  useI18nRouter,
  useI18nTranslations,
  getI18nLink,
  useI18nLocale,
  useI18nDateFnsLocale,
  configureLogin,
  isDiscordAuthEnabled,
  isGoogleAuthEnabled,
  isInternalAuthEnabled,
  isRegistrationAllowed,
  getRegistrationMode,
  configureRoles,
  getRoleId,
  isRolesConfigured,
  configureWaitlist,
  getWaitlistConfig,
  configureReferral,
  getReferralConfig,
  isReferralEnabled
};
//# sourceMappingURL=chunk-4HMQNMP6.mjs.map