import { jsx, jsxs } from "react/jsx-runtime";
import { Divider, Box, Flex, Typography } from "@strapi/design-system";
import { useFetchClient } from "@strapi/helper-plugin";
import { useIntl } from "react-intl";
import { useQuery } from "react-query";
import styled from "styled-components";
import { L as Login } from "./index-466b22f5.mjs";
import { S as SSOProviders } from "./SSOProviders-62bfad92.mjs";
import "react-dom/client";
import "invariant";
import "lodash/isFunction";
import "lodash/merge";
import "lodash/pick";
import "react-helmet";
import "react-router-dom";
import "react";
import "react-redux";
import "@radix-ui/react-context";
import "@strapi/design-system/v2";
import "@strapi/icons";
import "formik";
import "lodash/camelCase";
import "yup";
import "lodash/defaultsDeep";
import "lodash/omit";
import "qs";
import "immer";
import "lodash/get";
import "lodash/set";
import "@reduxjs/toolkit";
const DividerFull = styled(Divider)`
  flex: 1;
`;
const LoginEE = (loginProps) => {
  const { formatMessage } = useIntl();
  const { get } = useFetchClient();
  const { isLoading, data: providers = [] } = useQuery(
    ["ee", "providers"],
    async () => {
      const { data } = await get("/admin/providers");
      return data;
    },
    {
      enabled: window.strapi.features.isEnabled(window.strapi.features.SSO)
    }
  );
  if (!window.strapi.features.isEnabled(window.strapi.features.SSO) || !isLoading && providers.length === 0) {
    return /* @__PURE__ */ jsx(Login, { ...loginProps });
  }
  return /* @__PURE__ */ jsx(Login, { ...loginProps, children: /* @__PURE__ */ jsx(Box, { paddingTop: 7, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 7, children: [
    /* @__PURE__ */ jsxs(Flex, { children: [
      /* @__PURE__ */ jsx(DividerFull, {}),
      /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", children: formatMessage({ id: "Auth.login.sso.divider" }) }) }),
      /* @__PURE__ */ jsx(DividerFull, {})
    ] }),
    /* @__PURE__ */ jsx(SSOProviders, { providers, displayAllProviders: false })
  ] }) }) });
};
export {
  LoginEE
};
//# sourceMappingURL=Login-4325ffcc.mjs.map
