{"version":3,"file":"index.js","sources":["../../src/HugeiconsIcon.tsx"],"sourcesContent":["import { createElement, forwardRef, ForwardRefExoticComponent, RefAttributes, SVGProps } from 'react';\n\nconst defaultAttributes = {\n  xmlns: 'http://www.w3.org/2000/svg',\n  width: 24,\n  height: 24,\n  viewBox: '0 0 24 24',\n  fill: 'none',\n};\n\nexport type IconSvgElement = readonly (readonly [string, { readonly [key: string]: string | number }])[];\n\nexport type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;\ntype ComponentAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;\n\nexport interface HugeiconsProps extends ComponentAttributes {\n  size?: string | number;\n  strokeWidth?: number;\n  absoluteStrokeWidth?: boolean;\n  altIcon?: IconSvgElement;\n  showAlt?: boolean;\n  icon?: IconSvgElement;\n  primaryColor?: string;\n  secondaryColor?: string;\n  disableSecondaryOpacity?: boolean;\n}\n\nexport interface HugeiconsIconProps extends Omit<HugeiconsProps, 'ref' | 'altIcon'> {\n  icon: IconSvgElement;\n  altIcon?: IconSvgElement;\n}\n\nexport type HugeiconsIcon = ForwardRefExoticComponent<HugeiconsProps>;\n\nexport const HugeiconsIcon = forwardRef<SVGSVGElement, HugeiconsIconProps>(\n  (\n    {\n      color = 'currentColor',\n      size = 24,\n      strokeWidth,\n      absoluteStrokeWidth = false,\n      className = '',\n      altIcon,\n      showAlt = false,\n      icon,\n      primaryColor,\n      secondaryColor,\n      disableSecondaryOpacity = false,\n      ...rest\n    },\n    ref,\n  ) => {\n    const calculatedStrokeWidth = strokeWidth !== undefined\n      ? (absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth)\n      : undefined;\n\n    const strokeProps: { stroke?: string; strokeWidth?: number } = calculatedStrokeWidth !== undefined ? {\n      strokeWidth: calculatedStrokeWidth,\n      stroke: 'currentColor'\n    } : {};\n\n    const elementProps = {\n      ref,\n      ...defaultAttributes,\n      width: size,\n      height: size,\n      color: primaryColor || color,\n      className,\n      ...strokeProps,\n      ...rest,\n    };\n\n    const currentIcon = (showAlt && altIcon) ? altIcon : icon;\n\n    // Create SVG children with color handling for two-tone icons\n    const svgChildren = [...currentIcon]\n      .sort(([, a], [, b]) => {\n        const hasOpacityA = a.opacity !== undefined;\n        const hasOpacityB = b.opacity !== undefined;\n        return hasOpacityB ? 1 : hasOpacityA ? -1 : 0;\n      })\n      .map(([tag, attrs]) => {\n        const isSecondaryPath = attrs.opacity !== undefined;\n        const pathOpacity = isSecondaryPath && !disableSecondaryOpacity ? attrs.opacity : undefined;\n\n        // Handle both stroke and fill properties based on element type\n        const fillProps = secondaryColor ? {\n          ...(attrs.stroke !== undefined ? {\n            stroke: isSecondaryPath ? secondaryColor : (primaryColor || color)\n          } : {\n            fill: isSecondaryPath ? secondaryColor : (primaryColor || color)\n          })\n        } : {};\n\n        return createElement(tag, { \n          ...attrs,\n          ...strokeProps,\n          ...fillProps,\n          opacity: pathOpacity,\n          key: attrs.key \n        });\n      });\n\n    return createElement(\n      'svg',\n      elementProps,\n      svgChildren\n    );\n  },\n);\n\nHugeiconsIcon.displayName = 'HugeiconsIcon';\n\nexport default HugeiconsIcon; "],"names":["defaultAttributes","xmlns","width","height","viewBox","fill","HugeiconsIcon","forwardRef","color","size","strokeWidth","absoluteStrokeWidth","className","altIcon","showAlt","icon","primaryColor","secondaryColor","disableSecondaryOpacity","rest","ref","calculatedStrokeWidth","undefined","Number","strokeProps","stroke","elementProps","svgChildren","sort","a","b","opacity","map","tag","attrs","isSecondaryPath","pathOpacity","fillProps","createElement","key","displayName"],"mappings":"wRAEA,MAAMA,EAAoB,CACxBC,MAAO,6BACPC,MAAO,GACPC,OAAQ,GACRC,QAAS,YACTC,KAAM,QA2BKC,EAAgBC,EAAUA,WACrC,EAEIC,QAAQ,eACRC,OAAO,GACPC,cACAC,uBAAsB,EACtBC,YAAY,GACZC,UACAC,WAAU,EACVC,OACAC,eACAC,iBACAC,2BAA0B,KACvBC,GAELC,KAEA,MAAMC,OAAwCC,IAAhBZ,EACzBC,EAA6C,GAAtBY,OAAOb,GAAqBa,OAAOd,GAAQC,OACnEY,EAEEE,OAAmFF,IAA1BD,EAAsC,CACnGX,YAAaW,EACbI,OAAQ,gBACN,GAEEC,EAAe,CACnBN,SACGpB,EACHE,MAAOO,EACPN,OAAQM,EACRD,MAAOQ,GAAgBR,EACvBI,eACGY,KACAL,GAMCQ,EAAc,IAHCb,GAAWD,EAAWA,EAAUE,GAIlDa,KAAK,EAAI,CAAAC,IAAI,CAAGC,UAEmBR,IAAdQ,EAAEC,QACD,OAFaT,IAAdO,EAAEE,SAEkB,EAAI,GAE7CC,IAAI,EAAEC,EAAKC,MACV,MAAMC,OAAoCb,IAAlBY,EAAMH,QACxBK,EAAcD,IAAoBjB,EAA0BgB,EAAMH,aAAUT,EAG5Ee,EAAYpB,EAAiB,SACZK,IAAjBY,EAAMT,OAAuB,CAC/BA,OAAQU,EAAkBlB,EAAkBD,GAAgBR,GAC1D,CACFH,KAAM8B,EAAkBlB,EAAkBD,GAAgBR,IAE1D,GAEJ,OAAO8B,EAAAA,cAAcL,EAAK,IACrBC,KACAV,KACAa,EACHN,QAASK,EACTG,IAAKL,EAAMK,QAIjB,OAAOD,gBACL,MACAZ,EACAC,KAKNrB,EAAckC,YAAc"}