{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "react-email/header-with-logo-and-menu",
  "title": "Header With Logo And Menu",
  "description": "Marketing headers variant for email templates",
  "dependencies": [
    "react-email"
  ],
  "registryDependencies": [
    "https://emailcn.run/r/react-email/default-fonts.json",
    "https://emailcn.run/r/react-email/theme-default.json"
  ],
  "files": [
    {
      "path": "registry/bases/react-email/components/marketing/headers/header-with-logo-and-menu.tsx",
      "content": "import { Fragment } from \"react\";\nimport {\n  Body,\n  Head as EmailHead,\n  Html,\n  Preview,\n  Link,\n  Section,\n  Row,\n  Column,\n  Img,\n  Tailwind,\n} from \"react-email\";\n\nimport { DefaultFonts } from \"@/components/email/font-default\";\nimport { createEmailTailwindConfig } from \"@/components/email/email-theme\";\nimport type { EmailTheme } from \"@/components/email/email-theme\";\nimport { emailAsset } from \"@/components/email/email-assets\";\nimport { defaultTheme } from \"@/components/email/theme-default\";\n\nexport type HeaderWithLogoAndMenuVariant =\n  | \"menu-right\"\n  | \"menu-left\"\n  | \"menu-around\"\n  | \"stacked-left\"\n  | \"stacked-center\"\n  | \"stacked-right\";\n\nexport interface HeaderMenuLink {\n  href: string;\n  label: string;\n}\n\nexport interface HeaderWithLogoAndMenuProps {\n  theme?: EmailTheme;\n  logoSrc?: string;\n  logoAlt?: string;\n  logoHref?: string;\n  links?: HeaderMenuLink[];\n  pageBackgroundColor?: string;\n  backgroundColor?: string;\n  textColor?: string;\n  variant?: HeaderWithLogoAndMenuVariant;\n}\n\nconst fontFamily =\n  'Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif';\n\nconst responsiveStyles = [\n  \"@media only screen and (max-width: 599px) {\",\n  \"  .header-menu-stack { display: block !important; width: 100% !important; }\",\n  \"  .header-menu-right-links { padding: 24px 0 0 !important; text-align: left !important; }\",\n  \"  .header-menu-right-link { margin-left: 0 !important; margin-right: 24px !important; }\",\n  \"  .header-menu-left-row { display: table !important; width: 100% !important; }\",\n  \"  .header-menu-left-links { display: table-footer-group !important; text-align: right !important; }\",\n  \"  .header-menu-left-logo { display: table-header-group !important; text-align: right !important; }\",\n  \"  .header-menu-left-links-inner { padding-top: 24px !important; }\",\n  \"  .header-menu-around-row { display: table !important; width: 100% !important; }\",\n  \"  .header-menu-around-desktop { display: none !important; }\",\n  \"  .header-menu-around-logo { display: table-header-group !important; width: 100% !important; }\",\n  \"  .header-menu-around-mobile { display: block !important; padding-top: 24px !important; width: 100% !important; }\",\n  \"}\",\n].join(\"\\n\");\n\nconst defaultLinks: HeaderMenuLink[] = [\n  { href: \"https://example.com\", label: \"Home\" },\n  { href: \"https://example.com/about\", label: \"About us\" },\n  { href: \"https://example.com/shop\", label: \"Shop\" },\n  { href: \"https://example.com/faq\", label: \"FAQs\" },\n  { href: \"https://example.com/returns\", label: \"Returns\" },\n  { href: \"https://example.com/contact\", label: \"Contact us\" },\n];\n\nconst defaults = {\n  backgroundColor: \"#fffffe\",\n  links: defaultLinks,\n  logoAlt: \"Maizzle\",\n  logoHref: \"https://example.com\",\n  logoSrc: emailAsset(\"maizzle-insignia.png\"),\n  pageBackgroundColor: \"#f1f5f9\",\n  textColor: \"#6b7280\",\n};\n\ntype SectionProps = Omit<HeaderWithLogoAndMenuProps, \"theme\">;\n\ntype ResolvedProps = typeof defaults & SectionProps;\n\nconst Logo = ({ props }: { props: ResolvedProps }) => (\n  <Link href={props.logoHref}>\n    <Img\n      alt={props.logoAlt}\n      src={props.logoSrc}\n      style={{ maxWidth: \"100%\", verticalAlign: \"middle\" }}\n      width={55}\n    />\n  </Link>\n);\n\nconst MenuLinks = ({\n  links,\n  margin,\n  props,\n  responsiveClassName,\n}: {\n  links: HeaderMenuLink[];\n  margin: \"left\" | \"right\" | \"around\";\n  props: ResolvedProps;\n  responsiveClassName?: string;\n}) => (\n  <>\n    {links.map((link, index) => {\n      let marginLeft: string | undefined;\n      let marginRight: string | undefined;\n      if (margin === \"left\" && index > 0) {\n        marginLeft = \"24px\";\n      }\n      if (margin === \"right\") {\n        marginRight = \"24px\";\n      }\n      if (margin === \"around\") {\n        marginLeft = \"12px\";\n        marginRight = \"12px\";\n      }\n      return (\n        <Link\n          className={responsiveClassName}\n          href={link.href}\n          key={link.href + link.label}\n          style={{\n            color: props.textColor,\n            display: \"inline-block\",\n            fontFamily,\n            fontSize: \"14px\",\n            fontWeight: 500,\n            lineHeight: \"32px\",\n            marginLeft,\n            marginRight,\n            textDecoration: \"none\",\n          }}\n        >\n          {link.label}\n        </Link>\n      );\n    })}\n  </>\n);\n\nconst MenuRight = ({ props }: { props: ResolvedProps }) => (\n  <Section width=\"100%\">\n    <Fragment>\n      <Row>\n        <Column className=\"header-menu-stack\" style={{ width: \"55px\" }}>\n          <Logo props={props} />\n        </Column>\n        <Column\n          className=\"header-menu-stack header-menu-right-links\"\n          style={{\n            fontSize: 0,\n            paddingLeft: \"24px\",\n            textAlign: \"right\",\n          }}\n        >\n          <MenuLinks\n            links={props.links}\n            margin=\"left\"\n            props={props}\n            responsiveClassName=\"header-menu-right-link\"\n          />\n        </Column>\n      </Row>\n    </Fragment>\n  </Section>\n);\n\nconst MenuLeft = ({ props }: { props: ResolvedProps }) => (\n  <Section className=\"header-menu-left-row\" width=\"100%\">\n    <Fragment>\n      <Row>\n        <Column\n          className=\"header-menu-left-links\"\n          style={{ paddingRight: \"24px\", textAlign: \"left\" }}\n        >\n          <Section\n            className=\"header-menu-left-links-inner\"\n            style={{ fontSize: 0 }}\n          >\n            <MenuLinks links={props.links} margin=\"left\" props={props} />\n          </Section>\n        </Column>\n        <Column\n          className=\"header-menu-left-logo\"\n          style={{ textAlign: \"right\", width: \"55px\" }}\n        >\n          <Logo props={props} />\n        </Column>\n      </Row>\n    </Fragment>\n  </Section>\n);\n\nconst MenuAround = ({ props }: { props: ResolvedProps }) => (\n  <Section className=\"header-menu-around-row\" width=\"100%\">\n    <Fragment>\n      <Row>\n        <Column\n          className=\"header-menu-around-desktop\"\n          style={{ fontSize: 0, textAlign: \"left\" }}\n        >\n          <MenuLinks\n            links={props.links.slice(0, 3)}\n            margin=\"left\"\n            props={props}\n          />\n        </Column>\n        <Column\n          className=\"header-menu-around-logo\"\n          style={{ textAlign: \"center\", width: \"55px\" }}\n        >\n          <Logo props={props} />\n        </Column>\n        <Column\n          className=\"header-menu-around-mobile\"\n          style={{ display: \"none\", fontSize: 0, textAlign: \"center\" }}\n        >\n          <MenuLinks links={props.links} margin=\"around\" props={props} />\n        </Column>\n        <Column\n          className=\"header-menu-around-desktop\"\n          style={{ fontSize: 0, textAlign: \"right\" }}\n        >\n          <MenuLinks\n            links={props.links.slice(3, 6)}\n            margin=\"left\"\n            props={props}\n          />\n        </Column>\n      </Row>\n    </Fragment>\n  </Section>\n);\n\nconst StackedMenu = ({\n  alignment,\n  props,\n}: {\n  alignment: \"left\" | \"center\" | \"right\";\n  props: ResolvedProps;\n}) => {\n  let margin: \"left\" | \"right\" | \"around\" = \"left\";\n  if (alignment === \"left\") {\n    margin = \"right\";\n  } else if (alignment === \"center\") {\n    margin = \"around\";\n  }\n  return (\n    <Section width=\"100%\">\n      <Fragment>\n        <Row>\n          <Column style={{ textAlign: alignment }}>\n            <Section>\n              <Logo props={props} />\n            </Section>\n            <Section style={{ lineHeight: \"24px\" }}>&zwj;</Section>\n            <Section style={{ fontSize: 0 }}>\n              <MenuLinks links={props.links} margin={margin} props={props} />\n            </Section>\n          </Column>\n        </Row>\n      </Fragment>\n    </Section>\n  );\n};\n\nexport const HeaderWithLogoAndMenuSection = (props: SectionProps) => {\n  const variant = props.variant ?? \"menu-right\";\n  const resolved = { ...defaults, ...props } as ResolvedProps;\n  let content;\n  if (variant === \"menu-left\") {\n    content = <MenuLeft props={resolved} />;\n  } else if (variant === \"menu-around\") {\n    content = <MenuAround props={resolved} />;\n  } else if (variant.startsWith(\"stacked-\")) {\n    content = (\n      <StackedMenu\n        alignment={\n          variant.replace(\"stacked-\", \"\") as \"left\" | \"center\" | \"right\"\n        }\n        props={resolved}\n      />\n    );\n  } else {\n    content = <MenuRight props={resolved} />;\n  }\n  return (\n    <Section\n      style={{ backgroundColor: resolved.pageBackgroundColor }}\n      width=\"100%\"\n    >\n      <Fragment>\n        <Row>\n          <Column>&zwj;</Column>\n          <Column style={{ maxWidth: \"100%\", width: \"600px\" }}>\n            <Section width=\"100%\">\n              <Fragment>\n                <Row>\n                  <Column\n                    style={{\n                      backgroundColor: resolved.backgroundColor,\n                      padding: \"24px\",\n                    }}\n                  >\n                    {content}\n                  </Column>\n                </Row>\n              </Fragment>\n            </Section>\n          </Column>\n          <Column>&zwj;</Column>\n        </Row>\n      </Fragment>\n    </Section>\n  );\n};\n\nexport const HeaderWithLogoAndMenu = ({\n  pageBackgroundColor = \"#f1f5f9\",\n  theme = defaultTheme,\n  variant = \"menu-right\",\n  ...props\n}: HeaderWithLogoAndMenuProps) => (\n  <Html>\n    <EmailHead>\n      <DefaultFonts />\n      <style dangerouslySetInnerHTML={{ __html: responsiveStyles }} />\n    </EmailHead>\n    <Preview>Home About us Shop FAQs Returns Contact us</Preview>\n    <Tailwind config={createEmailTailwindConfig(theme)}>\n      <Body\n        style={{ backgroundColor: pageBackgroundColor, fontFamily }}\n        className=\"m-0\"\n      >\n        <HeaderWithLogoAndMenuSection\n          {...props}\n          pageBackgroundColor={pageBackgroundColor}\n          variant={variant}\n        />\n      </Body>\n    </Tailwind>\n  </Html>\n);\n\nHeaderWithLogoAndMenu.PreviewProps = {\n  theme: defaultTheme,\n  variant: \"menu-right\",\n} satisfies HeaderWithLogoAndMenuProps;\n",
      "type": "registry:component",
      "target": "components/email/header-with-logo-and-menu.tsx"
    },
    {
      "path": "registry/email-assets.ts",
      "content": "const ASSET_ORIGIN = \"https://www.emailcn.run\";\nconst ICONS8_ORIGIN = \"https://img.icons8.com\";\nconst UNSPLASH_ORIGIN = \"https://images.unsplash.com\";\n\nconst portraitIds = [\n  \"photo-1500648767791-00dcc994a43e\",\n  \"photo-1507003211169-0a1dd7228f2d\",\n  \"photo-1494790108377-be9c29b29330\",\n  \"photo-1438761681033-6461ffad8d80\",\n  \"photo-1534528741775-53994a69daeb\",\n  \"photo-1506794778202-cad84cf45f1c\",\n] as const;\n\nconst productIds = [\n  \"photo-1521572163474-6864f9cf17ab\",\n  \"photo-1503341504253-dff4815485f1\",\n  \"photo-1576566588028-4147f3842f27\",\n  \"photo-1562157873-818bc0726f68\",\n] as const;\n\ntype Dimensions = readonly [width: number, height: number];\n\nconst dimensionRules = [\n  [/^bento-grids\\/1-bento-(?:1|4)\\./i, [336, 272]],\n  [/^bento-grids\\/1-bento-(?:2|3)\\./i, [720, 272]],\n  [/^bento-grids\\/2-bento-1\\./i, [336, 232]],\n  [/^bento-grids\\/2-bento-(?:2|7)\\./i, [720, 352]],\n  [/^bento-grids\\/2-bento-3\\./i, [720, 344]],\n  [/^bento-grids\\/2-bento-4\\./i, [336, 224]],\n  [/^bento-grids\\/2-bento-(?:5|6)\\./i, [336, 408]],\n  [/^bento-grids\\/3-bento-lg-\\d-pad\\./i, [304, 576]],\n  [/^bento-grids\\/3-bento-lg-\\d\\./i, [336, 576]],\n  [/^bento-grids\\/3-bento-sm-\\d\\./i, [336, 336]],\n  [/^bento-grids\\/4-bento-lg-(?:1|2)\\./i, [496, 440]],\n  [/^bento-grids\\/4-bento-lg-3\\./i, [688, 242]],\n  [/^bento-grids\\/4-bento-lg-4\\./i, [656, 242]],\n  [/^bento-grids\\/4-bento-sm-[1-4]\\./i, [456, 363]],\n  [/^bento-grids\\/4-bento-sm-5\\./i, [408, 363]],\n  [/^bento-grids\\/bento-1\\./i, [720, 376]],\n  [/^bento-grids\\/bento-[2-5]\\./i, [528, 376]],\n  [/^category-previews\\/landscape-/i, [508, 376]],\n  [/^category-previews\\/portrait-/i, [376, 377]],\n  [/^coupons\\/(?:bg-image-[1-3]|pattern)\\./i, [800, 500]],\n  [/^coupons\\/bg-image-[4-6]\\./i, [1200, 1200]],\n  [/^cta\\/cta-bg-1\\./i, [1200, 772]],\n  [/^cta\\/cta-bg-2\\./i, [1200, 760]],\n  [/^cta\\/cta-bg-3\\./i, [1104, 696]],\n  [/^cta\\/cta-bg-glow\\./i, [1200, 840]],\n  [/^cta\\/cta-collage-(?:1|4)\\./i, [248, 456]],\n  [/^cta\\/(?:cta-collage-(?:2|3)|cta-outwear-\\d)\\./i, [280, 456]],\n  [/^cta\\/cta-split-avatars-\\d\\./i, [280, 338]],\n  [/^cta\\/cta-with-image-\\d\\./i, [944, 606]],\n  [/^cta\\/strip-cut-\\d\\./i, [232, 163]],\n  [/^cta\\/strip-\\d\\./i, [232, 232]],\n  [/^feature\\/feature-1\\./i, [564, 564]],\n  [/^feature\\/feature-2-/i, [432, 432]],\n  [/^feature\\/feature-3-lg-/i, [646, 818]],\n  [/^feature\\/feature-3-sm-/i, [615, 615]],\n  [/^feature\\/stripes-bg-(?:1|2)\\./i, [1035, 1227]],\n  [/^feature\\/stripes-bg-3\\./i, [449, 1227]],\n  [/^feature\\/stripes-bg-(?:4|5)\\./i, [449, 840]],\n  [/^footers\\/bg-image-(?:1|2)\\./i, [1200, 881]],\n  [/^footers\\/bg-image-3\\./i, [1104, 881]],\n  [/^hero\\/aligned-overlay-bg-\\d\\./i, [702, 1200]],\n  [/^hero\\/block-overlay-bg\\./i, [2000, 3000]],\n  [/^hero\\/block-with-bleed-bg\\./i, [2000, 2922]],\n  [/^hero\\/mosaic-\\d\\./i, [240, 240]],\n  [/^hero\\/overlapped-content-bg-(?:1|3)\\./i, [1200, 1258]],\n  [/^hero\\/overlapped-content-bg-2\\./i, [1200, 1374]],\n  [/^hero\\/overlapped-content-bg-4\\./i, [1200, 1410]],\n  [/^hero\\/overlapped-image-\\d-bg\\./i, [2000, 3000]],\n  [/^hero\\/overlapped-image-bg\\./i, [2000, 2995]],\n  [/^hero\\/overlapped-image-2\\./i, [911, 610]],\n  [/^hero\\/overlapped-image-3\\./i, [911, 606]],\n  [/^hero\\/overlapped-image\\./i, [911, 657]],\n  [/^hero\\/(?:overlay-gradient-bg|overlayed-split-bg)\\./i, [2000, 3000]],\n  [/^hero\\/overlayed\\/hero-overlayed-bg\\./i, [1200, 1490]],\n  [/^hero\\/split-contained-bg\\./i, [488, 1104]],\n  [/^hero\\/split-contained-landscape-/i, [488, 376]],\n  [/^hero\\/split-contained-portrait-/i, [488, 680]],\n  [/^hero\\/split-contained-square-/i, [488, 550]],\n  [/^hero\\/split-full-bleed-bg\\./i, [2000, 2666]],\n  [/^hero\\/split-slanted-bg\\./i, [2002, 2534]],\n  [/^image-grids\\/2-col-landscape/i, [528, 372]],\n  [/^image-grids\\/2-col-portrait/i, [528, 792]],\n  [/^image-grids\\/2-col-square/i, [528, 528]],\n  [/^image-grids\\/3-col-masonry-stack/i, [503, 558]],\n  [/^image-grids\\/3-col-masonry/i, [720, 792]],\n  [/^image-grids\\/3-col-portrait/i, [504, 753]],\n  [/^image-grids\\/3-col-square/i, [504, 504]],\n  [/^image-grids\\/full-width\\./i, [1104, 720]],\n  [/^image-grids\\/full-width-\\d\\./i, [1104, 792]],\n  [/^product-detail\\/stacked-\\d\\./i, [508, 358]],\n  [/^product-detail\\/rating-below\\./i, [508, 508]],\n  [/^product-detail\\/single-landscape\\./i, [1104, 776]],\n  [/^product-detail\\/single-portrait\\./i, [508, 764]],\n  [/^product-detail\\/single-portrait-bleed\\./i, [532, 764]],\n  [/^product-detail\\/two-images-\\d\\./i, [528, 776]],\n  [/^product-detail\\/three-images-1\\./i, [528, 776]],\n  [/^product-detail\\/three-images-(?:2|3)\\./i, [528, 364]],\n  [/^product-detail\\/four-images-(?:1|4)\\./i, [528, 488]],\n  [/^product-detail\\/four-images-(?:2|3)\\./i, [528, 240]],\n  [/^stats\\/overlay-1\\./i, [1572, 2268]],\n  [/^stats\\/overlay-2\\./i, [1572, 2716]],\n  [/^stats\\/overlay-(?:3|4)\\./i, [1572, 3256]],\n  [/^stats\\/single-stat\\./i, [1035, 1032]],\n  [/^teams\\/hero\\./i, [1104, 776]],\n  [/^teams\\/member-\\d+-lg\\./i, [528, 376]],\n  [/^teams\\/member-\\d+-md\\./i, [328, 328]],\n  [/^teams\\/member-\\d+\\./i, [256, 256]],\n  [/^timelines\\/cards\\./i, [1072, 600]],\n  [/^testimonials\\/quote\\./i, [72, 62]],\n  [/^testimonials\\/user-\\d+\\./i, [256, 256]],\n  [/^feature\\/logo-north-face\\./i, [278, 128]],\n  [/^feature\\/logo-stripes-1\\./i, [390, 84]],\n  [/^feature\\/logo-stripes-2\\./i, [423, 72]],\n  [/^(?:reviews|testimonials)\\/logo-accentic(?:-light)?\\./i, [423, 72]],\n  [/^reviews\\/logo-amada\\./i, [411, 84]],\n  [/^(?:reviews|testimonials)\\/logo-monarch\\./i, [290, 64]],\n  [/^logos\\/logo-apple-pay\\./i, [180, 72]],\n  [/^logos\\/logo-google-pay\\./i, [177, 72]],\n  [/^logos\\/logo-klarna\\./i, [210, 48]],\n  [/^logos\\/logo-mastercard\\./i, [120, 72]],\n  [/^logos\\/logo-mock-1\\./i, [334, 72]],\n  [/^logos\\/logo-mock-2\\./i, [213, 36]],\n  [/^logos\\/logo-mock-3\\./i, [234, 48]],\n  [/^logos\\/logo-stripe\\./i, [171, 72]],\n  [/^logos\\/logo-visa\\./i, [150, 48]],\n  [/^order-summary\\/logo-fedex\\./i, [156, 48]],\n  [/^emailcn-logo(?:-light)?\\./i, [331, 48]],\n  [/^emailcn-insignia-mono(?:-light)?\\./i, [131, 96]],\n  [/^maizzle-insignia(?:-light)?-lg\\./i, [395, 289]],\n  [/^maizzle-insignia(?:-light)?\\./i, [176, 129]],\n] satisfies readonly (readonly [RegExp, Dimensions])[];\n\nconst socialIconSlugs = {\n  discord: \"discord-logo\",\n  facebook: \"facebook-new\",\n  github: \"github\",\n  instagram: \"instagram-new\",\n  linkedin: \"linkedin\",\n  slack: \"slack-new\",\n  x: \"twitterx--v1\",\n  youtube: \"youtube-play\",\n} as const;\n\nconst brandIconSlugs = [\n  [/(?:btc|bitcoin)/i, \"bitcoin--v1\"],\n  [/(?:eth|ethereum)/i, \"ethereum\"],\n] as const;\n\nconst hashString = (value: string) => {\n  let hash = 7;\n\n  for (const character of value) {\n    hash = (hash * 31 + (character.codePointAt(0) ?? 0)) % 2_147_483_647;\n  }\n\n  return hash;\n};\n\nconst getDimensions = (path: string) => {\n  const matchedRule = dimensionRules.find(([pattern]) => pattern.test(path));\n  if (matchedRule) {\n    return matchedRule[1];\n  }\n  if (/(?:avatar|user|headshot)/i.test(path)) {\n    return [160, 160] as const;\n  }\n  if (/(?:logo|insignia)/i.test(path)) {\n    return [320, 96] as const;\n  }\n  if (/(?:badge-app|badge-google)/i.test(path)) {\n    return [260, 80] as const;\n  }\n  if (/(?:icon|btc|eth)/i.test(path)) {\n    return [64, 64] as const;\n  }\n  if (/(?:portrait|member|team)/i.test(path)) {\n    return [600, 800] as const;\n  }\n  if (/(?:square|product|shopping-cart)/i.test(path)) {\n    return [700, 700] as const;\n  }\n  if (/(?:hero|footer|background|bg-|overlay|full-width)/i.test(path)) {\n    return [1200, 700] as const;\n  }\n  if (/(?:strip|landscape|bento|category-preview)/i.test(path)) {\n    return [800, 520] as const;\n  }\n\n  return [800, 600] as const;\n};\n\nconst getLabel = (path: string) => {\n  if (/insignia/i.test(path)) {\n    return \"EC\";\n  }\n  if (/(?:emailcn|maizzle)/i.test(path)) {\n    return \"emailcn\";\n  }\n\n  const fileName = path.split(\"/\").at(-1) ?? \"emailcn\";\n\n  return fileName\n    .replace(/\\.[^.]+$/, \"\")\n    .replace(/^(?:logo|badge|icon)-/, \"\")\n    .replaceAll(\"-\", \" \")\n    .replaceAll(/\\b\\w/g, (character) => character.toUpperCase());\n};\n\nconst getSeed = (path: string) =>\n  `emailcn-${path\n    .replace(/\\.[^.]+$/, \"\")\n    .replaceAll(/[^a-z0-9]+/gi, \"-\")\n    .replaceAll(/^-|-$/g, \"\")\n    .toLowerCase()}`;\n\nconst getIndexedAsset = (path: string, assets: readonly string[]) => {\n  const explicitIndex = path.match(\n    /(?:member|avatar|product-list|shopping-cart)-(\\d+)/i\n  )?.[1];\n  const index = explicitIndex\n    ? Number.parseInt(explicitIndex, 10) - 1\n    : hashString(path);\n\n  return assets[((index % assets.length) + assets.length) % assets.length];\n};\n\nconst getUnsplashAsset = (id: string, width: number, height: number) =>\n  `${UNSPLASH_ORIGIN}/${id}?auto=format&fit=crop&w=${width}&h=${height}&q=80`;\n\nconst getIcons8Asset = (\n  slug: string,\n  {\n    color,\n    style = \"ios-filled\",\n  }: {\n    color?: string;\n    style?: \"color\" | \"ios\" | \"ios-filled\";\n  } = {}\n) =>\n  color\n    ? `${ICONS8_ORIGIN}/${style}/50/${color}/${slug}.png`\n    : `${ICONS8_ORIGIN}/${style}/50/${slug}.png`;\n\nconst getStoreBadgeAsset = (path: string) => {\n  if (/badge-app-store/i.test(path)) {\n    return \"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg\";\n  }\n  if (/badge-google-play/i.test(path)) {\n    return \"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png\";\n  }\n};\n\nconst getSocialIconAsset = (path: string) => {\n  const isLight = /(?:-light|check-white)/i.test(path);\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  for (const [name, slug] of Object.entries(socialIconSlugs)) {\n    if (new RegExp(`(?:^|[-/])${name}(?:[-.]|$)`, \"i\").test(path)) {\n      return getIcons8Asset(slug, { color: foreground });\n    }\n  }\n};\n\nconst getUtilityIconAsset = (path: string) => {\n  const isLight = /(?:-light|check-white)/i.test(path);\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  if (/star-half/i.test(path)) {\n    return getIcons8Asset(\"star-half-empty\", { color: \"374151\" });\n  }\n  if (/star-solid/i.test(path)) {\n    return getIcons8Asset(\"star--v1\", { color: \"374151\" });\n  }\n  if (/edit/i.test(path)) {\n    return getIcons8Asset(\"edit--v1\", {\n      color: \"4F46E5\",\n      style: \"ios\",\n    });\n  }\n  if (/arrow-right/i.test(path)) {\n    const color = /(?:brand|indigo)/i.test(path) ? \"4F46E5\" : \"FFFFFF\";\n\n    return getIcons8Asset(\"long-arrow-right--v1\", {\n      color,\n      style: \"ios\",\n    });\n  }\n  if (/chevron-right/i.test(path)) {\n    return getIcons8Asset(\"chevron-right\", {\n      color: \"4F46E5\",\n      style: \"ios\",\n    });\n  }\n  if (/check/i.test(path)) {\n    return getIcons8Asset(\"checkmark--v1\", { color: foreground });\n  }\n};\n\nconst getBrandIconAsset = (path: string) => {\n  const match = brandIconSlugs.find(([pattern]) => pattern.test(path));\n\n  return match\n    ? getIcons8Asset(match[1], {\n        style: \"color\",\n      })\n    : undefined;\n};\n\nconst getWordmarkAsset = (path: string, [width, height]: Dimensions) => {\n  const isLight = /light/i.test(path);\n  const background = isLight ? \"030712\" : \"FFFFFF\";\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  return `https://placehold.co/${width}x${height}/${background}/${foreground}.png?text=${encodeURIComponent(\n    getLabel(path)\n  )}`;\n};\n\nconst getIconAsset = (path: string) =>\n  getStoreBadgeAsset(path) ??\n  getSocialIconAsset(path) ??\n  getUtilityIconAsset(path) ??\n  getBrandIconAsset(path);\n\nexport const emailAsset = (path: string) => {\n  const normalizedPath = path.replace(/^\\/+/, \"\");\n\n  if (\n    normalizedPath === \"bento-grids/trend.png\" ||\n    normalizedPath === \"bento-grids/trend-sm.png\"\n  ) {\n    return `${ASSET_ORIGIN}/email-assets/${normalizedPath}`;\n  }\n\n  const iconAsset = getIconAsset(normalizedPath);\n  if (iconAsset) {\n    return iconAsset;\n  }\n\n  const seed = getSeed(normalizedPath);\n  const [width, height] = getDimensions(normalizedPath);\n\n  if (/teams\\/hero/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1521737711867-e3b97375f902\", width, height);\n  }\n\n  if (/(?:avatar|user|headshot|member|team)/i.test(normalizedPath)) {\n    return getUnsplashAsset(\n      getIndexedAsset(normalizedPath, portraitIds),\n      width,\n      height\n    );\n  }\n\n  if (/products\\/shoe/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1542291026-7eec264c27ff\", width, height);\n  }\n\n  if (/products\\/phone/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1511707171634-5f897ff02aa9\", width, height);\n  }\n\n  if (\n    /(?:category-previews|product-detail|product-lists|products\\/product|shopping-cart)/i.test(\n      normalizedPath\n    )\n  ) {\n    return getUnsplashAsset(\n      getIndexedAsset(normalizedPath, productIds),\n      width,\n      height\n    );\n  }\n\n  if (/(?:trend|chart)/i.test(normalizedPath)) {\n    return `${ASSET_ORIGIN}/email-assets/bento-grids/trend.png`;\n  }\n\n  if (/(?:emailcn|maizzle|logo|insignia)/i.test(normalizedPath)) {\n    return getWordmarkAsset(normalizedPath, [width, height]);\n  }\n\n  return `https://picsum.photos/seed/${encodeURIComponent(\n    seed\n  )}/${width}/${height}.jpg`;\n};\n",
      "type": "registry:file",
      "target": "components/email/email-assets.ts"
    }
  ],
  "categories": [
    "email-component"
  ],
  "type": "registry:component"
}