{"version":3,"file":"shell-translation-api-context-BxZ1W6Eb.cjs","names":["createTranslationContext"],"sources":["../../core/src/shell-translation-api-context.ts"],"sourcesContent":["import { type Context, type Provider, use } from \"react\";\nimport { createTranslationContext } from \"@fluid-app/i18n/translation-api-context-factory\";\nimport type { TranslationApi } from \"@fluid-app/i18n/translation-api\";\nimport type { ShellDict } from \"./shell-translation-dictionary\";\n\nconst {\n  Context: Ctx,\n  Provider: Prov,\n  useTranslation,\n} = createTranslationContext<ShellDict>(\"Shell\");\n\nexport const ShellTranslationContext: Context<TranslationApi<ShellDict> | null> =\n  Ctx;\nexport const ShellTranslationProvider: Provider<TranslationApi<ShellDict> | null> =\n  Prov;\nexport const useShellTranslation = useTranslation;\n\n/**\n * Access the shell translation API without throwing.\n * Returns null when no ShellTranslationProvider ancestor exists.\n * Use in contexts where the full provider stack may not be wired\n * (e.g., data-source transformers called from hooks).\n */\nexport function useShellTranslationOptional(): TranslationApi<ShellDict> | null {\n  return use(Ctx);\n}\n"],"mappings":";;;;AAKA,MAAM,EACJ,SAAS,KACT,UAAU,MACV,mBACEA,wCAAAA,yBAAoC,QAAQ;AAEhD,MAAa,0BACX;AACF,MAAa,2BACX;AACF,MAAa,sBAAsB;;;;;;;AAQnC,SAAgB,8BAAgE;AAC9E,SAAA,GAAA,MAAA,KAAW,IAAI"}