/* BrandIcons.jsx — ported directly from handoff. Mount under window.BrandIcon. */

const MV_BRAND_SVG = {
  target: {
    vb: '0 0 55.07 57',
    inner:
      '<g><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="28.02" cy="28.98" r="22.19"/><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="28.02" cy="28.98" r="10.61"/><line fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="28.02" y1="1" x2="28.02" y2="56"/><line fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="54.07" y1="28.98" x2="1" y2="28.98"/></g>',
  },
  cat: {
    vb: '0 0 57 46.15',
    inner:
      '<g><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M46,1a4.29,4.29,0,0,0-4.14,3.77l-.27-.17a25.59,25.59,0,0,0-26.11,0l-.28.16a4.29,4.29,0,0,0-4.77-3.73A4.35,4.35,0,0,0,8.21,2a24.78,24.78,0,0,0-6.73,8.09,4.21,4.21,0,0,0,1.86,5.72,4.35,4.35,0,0,0,2.38.45,22.56,22.56,0,0,0,4.82,23.49,5.11,5.11,0,0,1,1.31,2.57,3.39,3.39,0,0,0,6.06,1.35c.21-.3.42-.59.62-.89a22,22,0,0,0,20,0c.2.3.41.59.63.88a3.4,3.4,0,0,0,4.7.75,3.3,3.3,0,0,0,1.34-2.11,5.07,5.07,0,0,1,1.31-2.57,22.56,22.56,0,0,0,4.76-23.51A4.28,4.28,0,0,0,56,12.35,4.17,4.17,0,0,0,55.52,10a24.93,24.93,0,0,0-6.75-8.08A4.38,4.38,0,0,0,46,1ZM18.4,42.76a35.22,35.22,0,0,0,3.29-7.29,7.14,7.14,0,0,1,13.68,0,35.76,35.76,0,0,0,3.33,7.28"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M18.73,15a2.83,2.83,0,0,0,2,3.49,2.89,2.89,0,0,0,2.44-.43"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M14.08,13.51A1,1,0,0,0,15.36,13a3.06,3.06,0,0,1,4-1.51,3,3,0,0,1,1.69,2,3.28,3.28,0,0,0,6.31,0"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M25.35,34.57a13.28,13.28,0,0,1,6.36,0"/><path fill="currentColor" stroke="none" d="M28.64,23.08a6.85,6.85,0,0,1,3.25.88,1,1,0,0,1,.4,1.43,1.06,1.06,0,0,1-.92.53h-5.7a1.05,1.05,0,0,1-1.06-1.05,1,1,0,0,1,.53-.91A6.84,6.84,0,0,1,28.64,23.08Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M39.7,26.08h0a14.39,14.39,0,0,0-20-2.28,14.21,14.21,0,0,0-2.34,2.31"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M33.83,18.07h0a2.92,2.92,0,0,0,4-.67A2.8,2.8,0,0,0,38.28,15"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M29.64,13.51a3.28,3.28,0,0,0,6.31,0,3.05,3.05,0,0,1,5.7-.47"/></g>',
  },
  user: {
    vb: '0 0 48 40',
    inner:
      '<g><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="13" cy="10" r="9"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M25,39c0-.33,0-.66,0-1,0-8.84-5.37-16-12-16S1,29.16,1,38c0,.34,0,.67,0,1Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M25.94,19a7.18,7.18,0,0,0,1.62.18A7.78,7.78,0,1,0,25.94,3.75"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M31.87,35.27H37c0-.24,0-.48,0-.73,0-6.44-3.92-11.66-8.75-11.66A6.44,6.44,0,0,0,27,23"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M38.15,19.16a6.26,6.26,0,0,0,1.23.12,6.47,6.47,0,0,0,0-12.93,6.26,6.26,0,0,0-1.23.12"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M43.09,32.4H47c0-.19,0-.38,0-.58,0-5-3.07-9.13-6.85-9.13a5.27,5.27,0,0,0-.89.09"/></g>',
  },
  reverb: {
    vb: '0 0 57 56.08',
    inner:
      '<g><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="28.5" cy="28.5" r="8.25"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M48.57,47.29a27.5,27.5,0,1,0-40.14,0"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M39.47,55.08c0-.3,0-.6,0-.91,0-8.1-4.92-14.67-11-14.67s-11,6.57-11,14.67c0,.31,0,.61,0,.91Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M40.33,41.25a17.42,17.42,0,1,0-23.66,0"/></g>',
  },
  group: {
    vb: '0 0 57 40.16',
    inner:
      '<g><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="28" cy="10.04" r="9.04"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M40,39.16c0-.33,0-.66,0-1,0-8.88-5.4-16.07-12-16.07S16,29.28,16,38.16c0,.34,0,.67,0,1Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M39.5,19.74a7.91,7.91,0,1,0,5.07-14A8.18,8.18,0,0,0,42.7,6"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M44.33,26.4A7.3,7.3,0,0,1,46.7,26c5.13,0,9.3,5.56,9.3,12.41,0,.26,0,.52,0,.77H46.08"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M13.36,5.83a7.26,7.26,0,0,0-.93-.06A7.91,7.91,0,1,0,17,20.17"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M11.65,26.13A6.73,6.73,0,0,0,10.3,26C5.17,26,1,31.54,1,38.39c0,.26,0,.52,0,.77H9.92"/></g>',
  },
  diamond: {
    vb: '0 0 68 68',
    inner:
      '<g><line fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="67" y1="21.48" x2="1" y2="21.48"/><polygon fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="34 67 1 21.48 15.79 1 52.21 1 67 21.48 34 67"/><polygon fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="21.48 21.48 34 1 46.52 21.48 34 67 21.48 21.48"/><line fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="15.79" y1="1" x2="21.48" y2="21.48"/><line fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="52.21" y1="1" x2="46.52" y2="21.48"/></g>',
  },
  deess: {
    vb: '0 0 31.61 40.62',
    inner:
      '<g><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M3.57,4.47A3,3,0,0,0,1,7.38C1,9.91,4.34,10,4.31,12.06S1.74,15.4,1.74,15.4"/><circle fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="18.83" cy="10.11" r="9.11"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M30.56,39.61c0-.33,0-.67.05-1,.11-8.94-5.23-16.26-11.94-16.35s-12.24,7.1-12.35,16c0,.34,0,.67,0,1Z"/></g>',
  },
  mic: {
    vb: '0 0 39.3 56',
    inner:
      '<g fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M34.57,29c0,7.45-7.13,14-14.92,14S4.74,36.42,4.74,29V14.86C4.74,6.59,11.7,1,19.49,1S34.57,7.53,34.57,14.86Z"/><path d="M1,24.26V29a18.17,18.17,0,0,0,18.48,18.8A18.64,18.64,0,0,0,38.3,29V24.31"/><line x1="19.65" y1="47.77" x2="19.65" y2="56"/><line x1="19.65" y1="1" x2="19.65" y2="7.53"/><line x1="25.25" y1="2.18" x2="25.25" y2="7.53"/><line x1="14.06" y1="1.93" x2="14.06" y2="7.53"/><line x1="1.01" y1="28.97" x2="38.3" y2="28.97"/><line x1="4.76" y1="14.05" x2="14.79" y2="14.05"/><line x1="4.74" y1="19.64" x2="14.79" y2="19.64"/><line x1="34.54" y1="14.05" x2="24.19" y2="14.05"/><line x1="34.57" y1="19.64" x2="24.19" y2="19.64"/><line x1="4.74" y1="25.24" x2="14.79" y2="25.24"/><line x1="34.57" y1="25.24" x2="24.19" y2="25.24"/></g>',
  },
  output: {
    vb: '0 0 50.89 57',
    inner:
      '<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="1.09" y1="56" x2="14.33" y2="56"/><line x1="1.09" y1="49.89" x2="14.33" y2="49.89"/><line x1="1.09" y1="43.78" x2="14.33" y2="43.78"/><line x1="1.09" y1="37.67" x2="14.33" y2="37.67"/><line x1="1" y1="31.56" x2="14.24" y2="31.56"/><line x1="19.33" y1="56" x2="31.56" y2="56"/><line x1="19.33" y1="49.89" x2="31.56" y2="49.89"/><line x1="19.33" y1="43.78" x2="31.56" y2="43.78"/><line x1="19.33" y1="37.67" x2="31.56" y2="37.67"/><line x1="19.33" y1="31.56" x2="31.56" y2="31.56"/><line x1="19.33" y1="25.44" x2="31.56" y2="25.44"/><line x1="19.33" y1="19.33" x2="31.56" y2="19.33"/><line x1="19.33" y1="13.22" x2="31.56" y2="13.22"/><line x1="19.33" y1="7.11" x2="31.56" y2="7.11"/><line x1="19.33" y1="1" x2="31.56" y2="1"/><line x1="36.65" y1="56" x2="49.89" y2="56"/><line x1="36.65" y1="49.89" x2="49.89" y2="49.89"/><line x1="36.65" y1="43.78" x2="49.89" y2="43.78"/></g>',
  },
  bars: {
    vb: '0 0 53.21 57',
    inner:
      '<g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="1" y1="44.62" x2="1" y2="12.38"/><line x1="6.69" y1="50.31" x2="6.69" y2="6.69"/><line x1="12.38" y1="47.47" x2="12.38" y2="9.53"/><line x1="18.07" y1="52.21" x2="18.07" y2="4.79"/><line x1="23.76" y1="48.41" x2="23.76" y2="8.59"/><line x1="29.45" y1="54.1" x2="29.45" y2="2.9"/><line x1="35.14" y1="56" x2="35.14" y2="1"/><line x1="40.83" y1="50.31" x2="40.83" y2="6.69"/><line x1="46.52" y1="47.47" x2="46.52" y2="9.53"/><line x1="52.21" y1="41.78" x2="52.21" y2="15.22"/></g>',
  },
  userMas: {
    vb: '0 0 49.77 57',
    inner:
      '<g><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M13.83,7.33a21.37,21.37,0,0,0,15.39,6.54,21.39,21.39,0,0,0,8.46-1.74"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M24.88,26.76A12.88,12.88,0,1,0,12,13.88,12.88,12.88,0,0,0,24.88,26.76Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M48.77,56A23.89,23.89,0,0,0,1,56"/></g>',
  },
  userFem: {
    vb: '0 0 51.51 57',
    inner:
      '<g><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M48.77,56A25.6,25.6,0,0,0,2.49,56"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M25.63,12.05A12.83,12.83,0,0,1,12.81,24.87a12.82,12.82,0,0,0,25.64,0A12.82,12.82,0,0,1,25.63,12.05Z"/><path fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M40.05,45.75a36,36,0,0,0,8.3-2.47,3.67,3.67,0,0,0,1.87-4.8l-3.38-7.86A11.14,11.14,0,0,1,46,26.29V21.44a20.2,20.2,0,1,0-40.4-.24v5.09a11,11,0,0,1-.89,4.33L1.3,38.48a3.67,3.67,0,0,0,1.87,4.8,35.74,35.74,0,0,0,8.3,2.47"/></g>',
  },
};

const BrandIcon = ({ name }) => {
  const d = MV_BRAND_SVG[name] || MV_BRAND_SVG.target;
  return (
    <svg viewBox={d.vb} className="mv-brand-icon" aria-hidden="true"
         dangerouslySetInnerHTML={{ __html: d.inner }} />
  );
};

/* Chrome icons (outline glyphs — transport, caret, power, etc.) */
const CHROME_PATHS = {
  power:   <><path d="M12 4v8M7 7a7 7 0 1 0 10 0"/></>,
  powerOff:<><path d="M12 4v8M7 7a7 7 0 1 0 10 0"/><line x1="5" y1="5" x2="19" y2="19"/></>,
  save:    <><path d="M5 5h11l3 3v11H5z"/><path d="M8 5v5h7V5"/><rect x="8" y="13" width="8" height="6"/></>,
  prev:    <><polyline points="14,6 8,12 14,18"/></>,
  next:    <><polyline points="10,6 16,12 10,18"/></>,
  caret:   <><polyline points="6,9 12,15 18,9"/></>,
  headphones: <><path d="M4 14v-2a8 8 0 0 1 16 0v2"/><rect x="3" y="13" width="4" height="7" rx="1.5"/><rect x="17" y="13" width="4" height="7" rx="1.5"/></>,
  wave:    <><path d="M3 12h2l2-6 3 12 3-8 3 6 2-4h3"/></>,
};

const Icon = ({ name }) => {
  if (MV_BRAND_SVG[name]) return <BrandIcon name={name} />;
  return <svg viewBox="0 0 24 24"><g>{CHROME_PATHS[name]}</g></svg>;
};

Object.assign(window, { BrandIcon, Icon, MV_BRAND_SVG });
