{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Img/index.tsx"],"sourcesContent":["'use client';\n\nimport { type ImageProps } from 'antd';\nimport { createElement, type ElementType, type FC, memo, type Ref, use, useMemo } from 'react';\n\nimport { ConfigContext } from '@/ConfigProvider';\nimport { type ImgProps as HtmlImgeProps } from '@/types';\n\nconst createContainer = (as: ElementType) => memo((props: any) => createElement(as, props));\n\ntype ImgProps = HtmlImgeProps & ImageProps & { ref?: Ref<HTMLImageElement>; unoptimized?: boolean };\n\nconst Img: FC<ImgProps> = ({ unoptimized, ...rest }) => {\n  const config = use(ConfigContext);\n  const render = config?.imgAs || 'img';\n\n  const ImgContainer = useMemo(() => createContainer(render), [render]);\n\n  return (\n    <ImgContainer\n      unoptimized={unoptimized === undefined ? config?.imgUnoptimized : unoptimized}\n      {...rest}\n    />\n  );\n};\n\nImg.displayName = 'Img';\n\nexport default Img;\n"],"mappings":";;;;;AAQA,MAAM,mBAAmB,OAAoB,MAAM,UAAe,cAAc,IAAI,MAAM,CAAC;AAI3F,MAAM,OAAqB,EAAE,aAAa,GAAG,WAAW;CACtD,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,SAAS,QAAQ,SAAS;AAIhC,QACE,oBAHmB,cAAc,gBAAgB,OAAO,EAAE,CAAC,OAAO,CAAC,EAGnE;EACE,aAAa,gBAAgB,KAAA,IAAY,QAAQ,iBAAiB;EAClE,GAAI;EACJ,CAAA;;AAIN,IAAI,cAAc"}