import{getLocaleFromPathname as _}from"@redocly/theme/core/utils";import{resolveFrontmatterKeys as m}from"../../resolve-frontmatter-keys.js";async function F(a,e,r){const{frontmatter:s,relativePath:o,lastModified:n}=a,i=await b(s||{},r,o);return{frontmatter:await m(i,r.getGlobalConfig("frontMatterKeysToResolve")||[],o,r,e),seo:await m(i?.seo||{},["image"],o,r,e),lastModified:n}}async function b(a,e,r){const s=e.getGlobalData().l10n;if(!s)return a;const{translations:o,defaultLocale:n,locales:i}=s,u=e.getRouteByFsPath(r),g=u?_(u.slug,n,i):n,K=o[g]?.translation||o[n]?.translation||{};function c(t){if(t&&typeof t=="object"){if(Array.isArray(t))return t.map(c);if(t.__translationKey){const l=t.__translationKey,f=t.__defaultValue;return K[l]||f||l}const y={};for(const[l,f]of Object.entries(t))y[l]=c(f);return y}return t}return c(a)}export{F as staticDataLoader};
