{"version":3,"file":"useMergedComponents.mjs","names":[],"sources":["../../../src/hooks/useMergedComponents.ts"],"sourcesContent":["import { components } from \"@/components\";\nimport type { RemoteComponentsMap } from \"@/lib/types\";\nimport type { RemoteComponentRendererProps } from \"@mittwald/remote-dom-react/host\";\nimport { type ComponentType, useMemo } from \"react\";\nimport { reduce } from \"remeda\";\n\nexport const useMergedComponents = (\n  integrations: RemoteComponentsMap<never>[],\n) =>\n  useMemo(\n    () =>\n      new Map<string, ComponentType<RemoteComponentRendererProps>>(\n        Object.entries(\n          reduce(\n            [...integrations, components],\n            (merged, current) => ({\n              ...merged,\n              ...current,\n            }),\n            {},\n          ),\n        ),\n      ),\n    [...integrations],\n  );\n"],"mappings":";;;;;;AAMA,IAAa,uBACX,iBAEA,cAEI,IAAI,IACF,OAAO,QACL,OACE,CAAC,GAAG,cAAc,UAAU,IAC3B,QAAQ,aAAa;CACpB,GAAG;CACH,GAAG;AACL,IACA,CAAC,CACH,CACF,CACF,GACF,CAAC,GAAG,YAAY,CAClB"}