{"version":3,"file":"useDictionaryAsync.cjs","names":["useDictionaryAsyncBase","getFallbackLocale"],"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n  DeclaredLocales,\n  LocalesValues,\n  StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useDictionaryAsync as useDictionaryAsyncBase } from 'react-intlayer/server';\nimport { getFallbackLocale } from './ambientLocale';\n\n/**\n * On the server side, hook that transforms a dictionary and returns the content\n *\n * If the locale is not provided, it will use the locale from the server\n * context, falling back to the locale carried by the request.\n */\nexport const useDictionaryAsync = async <\n  const T extends Dictionary,\n  const L extends LocalesValues = DeclaredLocales,\n>(\n  dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n  locale?: L\n): ReturnType<typeof useDictionaryAsyncBase<T, L>> =>\n  useDictionaryAsyncBase<T, L>(\n    dictionaryPromise,\n    locale,\n    (await getFallbackLocale(locale)) as DeclaredLocales | undefined\n  );\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,qBAAqB,OAIhC,mBACA,eAEAA,0CACE,mBACA,QACC,MAAMC,+CAAkB,MAAM,CACjC"}