import{useThemeConfig as p}from"@redocly/theme/core/hooks";import{getPathnameForLocale as t,withPathPrefix as f}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as d}from"../../../constants/common";import{buildLoginUrl as s}from"../../../utils/auth/build-login-url";import{useL10nConfig as c}from"./useL10nConfig";function U(u={}){const m=p(),{auth:o}=m,{defaultLocale:n,locales:e,currentLocale:r}=c(),l=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const i=o.idpsInfo[0];return s(i.idpId,i.type,t("",n,r,e),void 0,u)}return f(t(d,n,r,e))}};return o?.devLogin?f(t(d,n,r,e)):l()}export{U as useLoginUrl};
