/* Ícones do Marketing. Simple Icons (marcas) e Lucide (interface), via Iconify, sempre a currentColor.
   <window.MktIcon name="simple-icons:meta" size={16} />
   <window.MktIcon name="lucide:mail" size={16} />
   As marcas em uso estão em js/vendor/mkt-icon-core.js. O Lucide completo carrega de js/vendor/iconify/lucide.json. */
const MktIcon = ({ name, size = 16, style, title }) => {
  const [, setTick] = React.useState(0);
  React.useEffect(() => {
    if (!name || (window.mktIconGet && window.mktIconGet(name))) return undefined;
    let live = true;
    if (window.mktIconEnsure) window.mktIconEnsure(name).then(() => { if (live) setTick(t => t + 1); });
    return () => { live = false; };
  }, [name]);
  const icon = name && window.mktIconGet ? window.mktIconGet(name) : null;
  if (!icon) return null;
  return (
    <svg
      width={size}
      height={size}
      viewBox={`0 0 ${icon.width} ${icon.height}`}
      aria-hidden={title ? undefined : 'true'}
      role={title ? 'img' : undefined}
      style={{ display: 'block', color: 'currentColor', flexShrink: 0, ...style }}
      dangerouslySetInnerHTML={{ __html: icon.body }}
    />
  );
};
window.MktIcon = MktIcon;

if (window.requestIdleCallback) window.requestIdleCallback(() => window.mktIconEnsure && window.mktIconEnsure('lucide:mail'));
else setTimeout(() => { if (window.mktIconEnsure) window.mktIconEnsure('lucide:mail'); }, 1200);
