{"version":3,"file":"FooterBrand.cjs","sources":["../../../src/components/Footer/FooterBrand.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentProps } from \"react\";\nimport { get } from \"../../helpers/get\";\nimport { resolveProps } from \"../../helpers/resolve-props\";\nimport { useResolveTheme } from \"../../helpers/resolve-theme\";\nimport { twMerge } from \"../../helpers/tailwind-merge\";\nimport { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { footerTheme } from \"./theme\";\n\nexport interface FooterBrandTheme {\n  base: string;\n  img: string;\n  span: string;\n}\n\ntype GenericLinkImageProps = ComponentProps<\"a\"> & ComponentProps<\"img\">;\n\nexport interface FooterBrandProps extends GenericLinkImageProps, ThemingProps<FooterBrandTheme> {\n  name?: string;\n  src: string;\n}\n\nexport const FooterBrand = forwardRef<HTMLDivElement, FooterBrandProps>((props, ref) => {\n  const provider = useThemeProvider();\n  const theme = useResolveTheme(\n    [footerTheme.brand, provider.theme?.footer?.brand, props.theme],\n    [get(provider.clearTheme, \"footer.brand\"), props.clearTheme],\n    [get(provider.applyTheme, \"footer.brand\"), props.applyTheme],\n  );\n\n  const { alt, className, children, href, name, src, ...restProps } = resolveProps(props, provider.props?.footerBrand);\n\n  return (\n    <div ref={ref}>\n      {href ? (\n        <a data-testid=\"flowbite-footer-brand\" href={href} className={twMerge(theme.base, className)} {...restProps}>\n          <img alt={alt} src={src} className={theme.img} />\n          <span data-testid=\"flowbite-footer-brand-span\" className={theme.span}>\n            {name}\n          </span>\n          {children}\n        </a>\n      ) : (\n        <img\n          alt={alt}\n          data-testid=\"flowbite-footer-brand\"\n          src={src}\n          className={twMerge(theme.img, className)}\n          {...restProps}\n        />\n      )}\n    </div>\n  );\n});\n\nFooterBrand.displayName = \"FooterBrand\";\n"],"names":["forwardRef","provider","useThemeProvider","theme","useResolveTheme","footerTheme","get","resolveProps","jsx","jsxs","twMerge"],"mappings":";;;;;;;;;;;AAUY,MAAC,WAAW,GAAGA,gBAAU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