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