'use strict';
'use client';
import { jsx } from 'react/jsx-runtime';
import { LoginForm } from '../../../fd-app-toolbox/auth-forms/login-form/LoginForm.js';
import { GoogleOAuthProvider } from '@react-oauth/google';
import { getGoogleOAuthConfig } from '../../../fd-app-toolbox/auth-forms/login-form/google-login.js';
import { getMicrosoftOAuthConfig } from '../../../fd-app-toolbox/auth-forms/login-form/microsoft-login.js';
import { getFacebookOAuthConfig } from '../../../fd-app-toolbox/auth-forms/login-form/facebook-login.js';
import { authEnvSettingKeys } from '../../../../fd-toolbox/constants/internal-auth-constants.js';
import { getStringEnvSetting } from '../../../../fd-toolbox/infra/env-functions.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function SignInPage() {
  const googleClientId = getStringEnvSetting(authEnvSettingKeys.googleClientId);
  const oAuthLoginConfigs = [];
  if (googleClientId && getStringEnvSetting(authEnvSettingKeys.googleClientSecret)) {
    oAuthLoginConfigs.push(getGoogleOAuthConfig());
  }
  if (getStringEnvSetting(authEnvSettingKeys.microsoftClientId)) {
    oAuthLoginConfigs.push(getMicrosoftOAuthConfig());
  }
  if (getStringEnvSetting(authEnvSettingKeys.facebookClientId) && getStringEnvSetting(authEnvSettingKeys.facebookClientSecret)) {
    oAuthLoginConfigs.push(getFacebookOAuthConfig());
  }
  const loginForm = /* @__PURE__ */jsx(LoginForm, {
    oAuthLoginConfigs,
    hideSignUpLink: true
  });
  if (!googleClientId) {
    return /* @__PURE__ */jsx("div", {
      children: loginForm
    });
  }
  return /* @__PURE__ */jsx(GoogleOAuthProvider, {
    clientId: googleClientId,
    children: loginForm
  });
}
__name(SignInPage, "SignInPage");
SignInPage.displayName = "SignInPage";

export { SignInPage as default };
