{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "credit-card",
  "title": "Credit Card",
  "author": "@fma-ds/ds",
  "description": "A payment card drawn from its data, to show a saved card or preview one while it's typed.\n\n- **Front**: the chip, the issuer's logo and color, the number padded with `•` and grouped by issuer (Amex 4-6-5), the holder and the expiry.\n- **Back**: the stripe, the signature panel and the security code.\n\n### Props\n\n- **Data**: `number`, `name`, `expiry` (`MM/YY`, `MM/YYYY` or digits only) and `cvc` are plain strings. `*` or `x` in `number` hide digits of a saved card.\n- **`issuer`**: `visa`, `mastercard`, `amex`… — pass it for a saved card; by default it is detected from the number.\n- **`focused`**: `number`, `name`, `expiry` or `cvc` highlights the field being typed, and `cvc` turns the card over (Amex keeps its code on the front). With reduced motion it turns without the 3D spin.\n- **Size**: its width sets its size (`w-72` by default) and the text scales with it.\n- **`labels`**: translates the captions and the accessible name. The card is one `role=\"img\"` (\"Visa card ending in 4242, expires 12/28\").\n\nLogos for Visa, Mastercard, Elo, American Express, Hipercard, Diners Club, Discover and JCB; other issuers show their name on the theme gray.\n\nIssuer detection and the form's validation (number, expiry, security code) live in the `credit-card-validation` lib, usable without the card. Pair the number field with the `credit-card` mask, which follows the issuer too.",
  "dependencies": [
    "cn@^0.5.0"
  ],
  "registryDependencies": [
    "@fma-ds/credit-card-validation"
  ],
  "files": [
    {
      "path": "src/core/credit-card/credit-card.tsx",
      "content": "import { cn } from \"cn\";\nimport type { ComponentProps } from \"react\";\nimport {\n  type CreditCardIssuer,\n  getCreditCardIssuer,\n  getCreditCardIssuerById,\n} from \"@/lib/credit-card-validation\";\n\n/* -------------------------------------------------------------------------- */\n/*                                  Artwork                                   */\n/* -------------------------------------------------------------------------- */\n\n/*\n * The chip and the issuer logos of react-credit-cards-2 (MIT), minified. They\n * render as images, so their gradient ids stay apart.\n */\nconst ARTWORK = {\n  chip: `<svg width=\"100\" height=\"76\" viewBox=\"0 0 100 76\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><defs><linearGradient x1=\"100%\" y1=\"0%\" x2=\"0%\" y2=\"100%\" id=\"a\"><stop stop-color=\"#F3D08F\" offset=\"0%\"/><stop stop-color=\"#FAD766\" offset=\"100%\"/></linearGradient></defs><path d=\"M92.7 75.4h-85.4c-4 0-7.2-3.2-7.2-7.2v-60.9c0-4 3.2-7.2 7.2-7.2h85.4c4 0 7.2 3.2 7.2 7.2v60.9c0 4-3.2 7.2-7.2 7.2\" fill=\"url(#a)\"/><path d=\"M72.1 28.4h27.8v-1.8h-29.6c-.965 0-1.8.601-2.1 1.5-2.2 6.0-2.4 12.5-.438 19.8.455 1.6.435 3.4-.1 5.0-2.0 6.1-7.7 19.9-18.5 19.9-11.0 0-16.0-15.6-17.3-21.9-.155-.784-.122-1.5.107-2.3 1.6-5.6 2.0-10.6-.016-19.5-.205-.87-.182-1.7.048-2.6 4.4-16.7 12.8-20.1 12.9-20.1.356-.132.5-.472.5-.852v-5.4h-1.8v3.7c0 .65-.332 1.2-.884 1.5-2.8 1.7-8.9 6.9-12.5 20.4-.18.6-.781 1.1-1.4 1.1l-28.7-.139v1.8l27.4.133c1.4.007 2.7 1.0 3.0 2.4 1.4 6.7 1.2 11.0.082 15.4-.316 1.2-1.4 2.0-2.6 2.1l-27.8.27v1.8l28.6-.278c.693-.007 1.2.473 1.4 1.1 1.4 7.0 6.8 23.0 19.0 23.0 6.3 0 12.0-4.2 16.4-12.2 2.6-4.8 4.0-9.5 4.5-11.3h29.9v-1.8h-28.0c-1.1 0-2.1-.772-2.4-1.8-1.6-6.1-1.7-11.7-.2-16.9.371-1.2 1.5-2.0 2.8-2.0zm-17.1-21.9c.045.0 4.5 2.3 9.2 10.0.172.2.47.4.776.4.198 0 .399-.064.5-.202.3-.292.4-.837.1-1.2-3.5-5.8-7.0-8.7-8.7-9.9-.43-.299-.68-.792-.68-1.3v-4.3h-1.8v5.7c0 .345.1.659.5.813z\" fill=\"#0C0200\"/></svg>`,\n  visa: `<svg width=\"512px\" height=\"166px\" viewBox=\"0 0 512 166\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\"><g><path d=\"M264.7,112.4 C264.5,89.4 285.3,76.5 301.0,68.9 C317.1,61.1 322.5,56.0 322.4,49.0 C322.3,38.3 309.6,33.6 297.6,33.4 C276.9,33.1 264.8,39.0 255.2,43.5 L247.7,8.4 C257.3,4.0 275.2,0.1 293.7,-1.4e-14 C337.1,-1.4e-14 365.6,21.4 365.7,54.7 C365.9,96.9 307.3,99.2 307.7,118.1 C307.9,123.8 313.3,129.9 325.3,131.4 C331.2,132.2 347.6,132.8 366.1,124.3 L373.3,158.2 C363.4,161.8 350.6,165.3 334.6,165.3 C293.7,165.3 265.0,143.5 264.7,112.4 M443.2,162.4 C435.3,162.4 428.6,157.7 425.6,150.6 L363.6,2.4 L407.0,2.4 L415.6,26.3 L468.7,26.3 L473.7,2.4 L512,2.4 L478.6,162.4 L443.2,162.4 M449.3,119.2 L461.8,59.1 L427.5,59.1 L449.3,119.2 M212.1,162.4 L177.9,2.4 L219.3,2.4 L253.5,162.4 L212.1,162.4 M150.9,162.4 L107.8,53.5 L90.4,146.1 C88.4,156.4 80.3,162.4 71.3,162.4 L0.9,162.4 L0,157.7 C14.4,154.6 30.8,149.5 40.8,144.1 C46.9,140.8 48.6,137.9 50.6,130.1 L83.6,2.4 L127.3,2.4 L194.3,162.4 L150.9,162.4\" fill=\"#FFFFFF\" transform=\"translate(256.0, 82.6) scale(1, -1) translate(-256.0, -82.6) \"></path></g></svg>`,\n  mastercard: `<svg width=\"512\" height=\"397\" viewBox=\"0 0 512 397\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><path d=\"M93.0 396.0v-26.3c0-10.0-6.1-16.6-16.6-16.6-5.2 0-10.9 1.7-14.9 7.4-3.0-4.8-7.4-7.4-14.0-7.4-4.3 0-8.7 1.3-12.2 6.1v-5.2h-9.2v42.1h9.2v-23.2c0-7.4 3.9-10.9 10.0-10.9s9.2 3.9 9.2 10.9v23.2h9.2v-23.2c0-7.4 4.3-10.9 10.0-10.9 6.1 0 9.2 3.9 9.2 10.9v23.2h10.0zm136.5-42.1h-14.9v-12.7h-9.2v12.7h-8.3v8.3h8.3v19.3c0 9.6 3.9 15.3 14.4 15.3 3.9 0 8.3-1.3 11.4-3.0l-2.6-7.9c-2.6 1.7-5.7 2.1-7.9 2.1-4.3 0-6.1-2.6-6.1-7.0v-18.8h14.9v-8.3zm78.1-.878c-5.2 0-8.7 2.6-10.9 6.1v-5.2h-9.2v42.1h9.2v-23.7c0-7.0 3.0-10.9 8.7-10.9 1.7 0 3.9.439 5.7.878l2.6-8.7c-1.7-.439-4.3-.439-6.1-.439zm-118.1 4.3c-4.3-3.0-10.5-4.3-17.1-4.3-10.5 0-17.5 5.2-17.5 13.6 0 7.0 5.2 10.9 14.4 12.2l4.3.439c4.8.878 7.4 2.1 7.4 4.3 0 3.0-3.5 5.2-9.6 5.2s-10.9-2.1-14.0-4.3l-4.3 7.0c4.8 3.5 11.4 5.2 18.0 5.2 12.2 0 19.3-5.7 19.3-13.6 0-7.4-5.7-11.4-14.4-12.7l-4.3-.439c-3.9-.439-7.0-1.3-7.0-3.9 0-3.0 3.0-4.8 7.9-4.8 5.2 0 10.5 2.1 13.1 3.5l3.9-7.4zm244.9-4.3c-5.2 0-8.7 2.6-10.9 6.1v-5.2h-9.2v42.1h9.2v-23.7c0-7.0 3.0-10.9 8.7-10.9 1.7 0 3.9.439 5.7.878l2.6-8.7c-1.7-.439-4.3-.439-6.1-.439zm-117.6 21.9c0 12.7 8.7 21.9 22.3 21.9 6.1 0 10.5-1.3 14.9-4.8l-4.3-7.4c-3.5 2.6-7.0 3.9-10.9 3.9-7.4 0-12.7-5.2-12.7-13.6 0-7.9 5.2-13.1 12.7-13.6 3.9 0 7.4 1.3 10.9 3.9l4.3-7.4c-4.3-3.5-8.7-4.8-14.9-4.8-13.6 0-22.3 9.2-22.3 21.9zm85.1 0v-21.0h-9.2v5.2c-3.0-3.9-7.4-6.1-13.1-6.1-11.8 0-21.0 9.2-21.0 21.9 0 12.7 9.2 21.9 21.0 21.9 6.1 0 10.5-2.1 13.1-6.1v5.2h9.2v-21.0zm-33.8 0c0-7.4 4.8-13.6 12.7-13.6 7.4 0 12.7 5.7 12.7 13.6 0 7.4-5.2 13.6-12.7 13.6-7.9-.439-12.7-6.1-12.7-13.6zm-110.2-21.9c-12.2 0-21.0 8.7-21.0 21.9 0 13.1 8.7 21.9 21.5 21.9 6.1 0 12.2-1.7 17.1-5.7l-4.3-6.5c-3.5 2.6-7.9 4.3-12.2 4.3-5.7 0-11.4-2.6-12.7-10.0h31.1v-3.5c.439-13.6-7.4-22.3-19.3-22.3zm0 7.9c5.7 0 9.6 3.5 10.5 10.0h-21.9c.878-5.7 4.8-10.0 11.4-10.0zm228.7 14.0v-37.7h-9.2v21.9c-3.0-3.9-7.4-6.1-13.1-6.1-11.8 0-21.0 9.2-21.0 21.9 0 12.7 9.2 21.9 21.0 21.9 6.1 0 10.5-2.1 13.1-6.1v5.2h9.2v-21.0zm-33.8 0c0-7.4 4.8-13.6 12.7-13.6 7.4 0 12.7 5.7 12.7 13.6 0 7.4-5.2 13.6-12.7 13.6-7.9-.439-12.7-6.1-12.7-13.6zm-308.2 0v-21.0h-9.2v5.2c-3.0-3.9-7.4-6.1-13.1-6.1-11.8 0-21.0 9.2-21.0 21.9 0 12.7 9.2 21.9 21.0 21.9 6.1 0 10.5-2.1 13.1-6.1v5.2h9.2v-21.0zm-34.2 0c0-7.4 4.8-13.6 12.7-13.6 7.4 0 12.7 5.7 12.7 13.6 0 7.4-5.2 13.6-12.7 13.6-7.9-.439-12.7-6.1-12.7-13.6z\"/><path fill=\"#FF5F00\" d=\"M186.5 33.8h138.3v248.5h-138.3z\"/><path d=\"M195.3 158.0c0-50.4 23.7-95.2 60.1-124.2-26.7-21.0-60.5-33.8-97.4-33.8-87.3 0-158.0 70.6-158.0 158.0s70.6 158.0 158.0 158.0c36.8 0 70.6-12.7 97.4-33.8-36.4-28.5-60.1-73.7-60.1-124.2z\" fill=\"#EB001B\"/><path d=\"M511.4 158.0c0 87.3-70.6 158.0-158.0 158.0-36.8 0-70.6-12.7-97.4-33.8 36.8-28.9 60.1-73.7 60.1-124.2s-23.7-95.2-60.1-124.2c26.7-21.0 60.5-33.8 97.4-33.8 87.3 0 158.0 71.1 158.0 158.0z\" fill=\"#F79E1B\"/></svg>`,\n  elo: `<svg width=\"512\" height=\"512\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><g fill-rule=\"evenodd\"><path d=\"M256 0c141.3 0 256 114.6 256 256 0 141.3-114.6 256-256 256s-256-114.6-256-256c0-141.3 114.6-256 256-256\" fill=\"#0E0E11\"/><path d=\"M180.0 237.5l-78.5 33.8c-.122-1.3-.189-2.7-.189-4.1 0-24.8 20.1-44.9 44.9-44.9 13.4 0 25.4 5.8 33.7 15.2zm-33.7-48.8c37.0 0 68.1 25.6 76.4 60.1l-31.6 13.8-.007-.066-32.4 14.2-77.7 33.9c-8.3-12.4-13.1-27.4-13.1-43.5 0-43.4 35.1-78.6 78.6-78.6zm54.9 134.8c-28.1 26.7-65.3 29.3-98.0 9.4l18.4-28.1c18.6 11.1 37.3 9.3 56.1-5.4l23.5 24.0zm32.0-19.4l-.198-148.6h28.1v144.6c0 1.3.172 2.6 1.9 3.3l24.5 9.5-11.0 28.7-28.7-12.1c-10.8-4.6-14.7-11.2-14.7-25.3z\" fill=\"#fff\"/><path d=\"M339.2 301.5c-10.5-8.2-17.3-21.0-17.3-35.4 0-12.8 5.3-24.3 13.9-32.5l-18.1-29.4c-18.2 14.4-30.0 36.8-30.0 62.0 0 27.0 13.6 51.0 34.4 65.2l17.1-29.8\" fill=\"#2091C3\"/><path d=\"M351.6 223.9c4.7-1.7 9.8-2.6 15.1-2.6 19.2 0 35.5 12.0 41.9 29.0l34.8-2.9c-8.4-34.6-39.6-60.3-76.8-60.3-10.5 0-20.5 2.0-29.7 5.7l14.5 31.0\" fill=\"#FAEC32\"/><path d=\"M411.5 268.3c-1.1 23.7-20.7 42.6-44.8 42.6-3.7 0-7.4-.472-10.9-1.3l-13.6 31.6c7.7 2.5 16.0 3.9 24.5 3.9 42.5 0 77.3-33.6 79.0-75.8l-34.2-1.0\" fill=\"#D0352A\"/></g></svg>`,\n  \"american-express\": `<svg width=\"512\" height=\"512\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><defs><radialGradient cx=\"17.5%\" cy=\"17.4%\" fx=\"17.5%\" fy=\"17.4%\" r=\"91.2%\" id=\"a\"><stop stop-color=\"#65BCF1\" offset=\"0%\"/><stop stop-color=\"#23ADE3\" offset=\"45.4%\"/><stop stop-color=\"#0DA6E0\" offset=\"50%\"/><stop stop-color=\"#0551C3\" offset=\"100%\"/></radialGradient></defs><path fill=\"url(#a)\" d=\"M0 0h512v512h-512z\"/><path d=\"M45.7 220.9l-9.7-23.8-9.7 23.8h19.4zm215.2-9.4c-1.9 1.1-4.2 1.2-7.0 1.2h-17.3v-13.2h17.5c2.4 0 5.0.112 6.7 1.0 1.8.87 2.9 2.7 2.9 5.2 0 2.6-1.0 4.7-2.9 5.6zm123.7 9.4l-9.8-23.8-9.8 23.8h19.7zm-230.6 25.7h-14.6l-.054-46.7-20.7 46.7h-12.5l-20.7-46.8v46.8h-29.0l-5.4-13.3h-29.7l-5.5 13.3h-15.5l25.5-59.7h21.2l24.2 56.5v-56.5h23.3l18.6 40.5 17.1-40.5h23.7v59.7h.002zm58.3 0h-47.6v-59.7h47.6v12.4h-33.4v10.7h32.6v12.2h-32.6v11.9h33.4v12.3zm67.2-43.6c0 9.5-6.3 14.4-10.0 15.9 3.1 1.1 5.7 3.2 7.0 5.0 2.0 2.9 2.3 5.6 2.3 10.9v11.7h-14.4l-.054-7.5c0-3.5.344-8.7-2.2-11.6-2.0-2.1-5.2-2.5-10.4-2.5h-15.3v21.7h-14.2v-59.7h32.8c7.2 0 12.6.193 17.2 2.8 4.5 2.6 7.2 6.5 7.2 13.2zm22.8 43.6h-14.5v-59.7h14.5v59.7zm169.0 0h-20.2l-27.0-44.8v44.8h-29.0l-5.5-13.3h-29.6l-5.3 13.3h-16.7c-6.9 0-15.7-1.5-20.7-6.6-5.0-5.0-7.6-11.9-7.6-22.8 0-8.8 1.5-16.9 7.6-23.3 4.6-4.7 11.8-6.9 21.6-6.9h13.8v12.7h-13.5c-5.2 0-8.1.775-10.9 3.5-2.4 2.5-4.1 7.2-4.1 13.5 0 6.4 1.2 11.0 3.9 14.0 2.1 2.3 6.1 3.0 9.9 3.0h6.4l20.1-46.9h21.3l24.1 56.5v-56.5h21.7l25.0 41.6v-41.6h14.6v59.7zm-471.6 11.7h24.3l5.5-13.2h12.3l5.4 13.2h48v-10.1l4.2 10.1h24.9l4.2-10.3v10.2h119.2l-.056-21.7h2.3c1.6.056 2.0.205 2.0 2.8v18.9h61.6v-5.0c4.9 2.6 12.7 5.0 22.9 5.0h25.9l5.5-13.2h12.3l5.4 13.2h50.0v-12.6l7.5 12.6h40.0v-83.3h-39.6v9.8l-5.5-9.8h-40.7v9.8l-5.1-9.8h-54.9c-9.2 0-17.2 1.2-23.8 4.8v-4.8h-37.9v4.8c-4.1-3.6-9.8-4.8-16.1-4.8h-138.6l-9.3 21.5-9.5-21.5h-43.6v9.8l-4.7-9.8h-37.2l-17.2 39.6v43.7h.002zM512 302.0h-26.0c-2.6 0-4.3.097-5.7 1.0-1.5.968-2.0 2.4-2.0 4.3 0 2.2 1.2 3.7 3.1 4.4 1.5.525 3.1.678 5.5.678l7.7.207c7.8.193 13.0 1.5 16.2 4.8.579.4.927.9 1.3 1.4v-17.0zm0 39.4c-3.4 5.0-10.2 7.6-19.3 7.6h-27.5v-12.8h27.4c2.7 0 4.6-.359 5.7-1.4.995-.925 1.6-2.2 1.6-3.9 0-1.7-.694-3.1-1.7-3.9-1.0-.912-2.5-1.3-5.0-1.3-13.4-.456-30.1.415-30.1-18.5 0-8.6 5.5-17.8 20.4-17.8h28.4v-11.8h-26.4c-7.9 0-13.7 1.9-17.8 4.8v-4.8h-39.1c-6.2 0-13.5 1.5-17.0 4.8v-4.8h-69.8v4.8c-5.5-4.0-14.9-4.8-19.2-4.8h-46.0v4.8c-4.3-4.2-14.1-4.8-20.1-4.8h-51.5l-11.7 12.7-11.0-12.7h-77.0v83.4h75.5l12.1-12.9 11.4 12.9 46.5.041v-19.6h4.5c6.1.096 13.4-.153 19.9-2.9v22.5h38.4v-21.7h1.8c2.3 0 2.5.097 2.5 2.4v19.2h116.7c7.4 0 15.1-1.8 19.4-5.3v5.3h37.0c7.7 0 15.2-1.0 20.9-3.8v-15.5zm-56.9-23.8c2.7 2.8 4.2 6.5 4.2 12.6 0 12.8-8.0 18.8-22.4 18.8h-27.8v-12.8h27.7c2.7 0 4.6-.359 5.8-1.4.983-.925 1.6-2.2 1.6-3.9 0-1.7-.763-3.1-1.7-3.9-1.0-.912-2.6-1.3-5.0-1.3-13.3-.456-30.0.415-30.0-18.5 0-8.6 5.4-17.8 20.4-17.8h28.6v12.7h-26.2c-2.5 0-4.2.097-5.7 1.0-1.5.968-2.1 2.4-2.1 4.3 0 2.2 1.3 3.7 3.1 4.4 1.5.525 3.1.678 5.5.678l7.6.207c7.7.189 13.0 1.5 16.3 4.8zm-128.9-3.6c-1.9 1.1-4.2 1.2-7.0 1.2h-17.3v-13.4h17.5c2.5 0 5.0.054 6.8 1.0 1.8.968 2.9 2.8 2.9 5.3 0 2.5-1.1 4.6-2.9 5.7zm8.6 7.4c3.1 1.1 5.7 3.2 6.9 5.0 2.0 2.9 2.3 5.6 2.3 10.9v11.8h-14.3v-7.4c0-3.5.346-8.9-2.3-11.7-2.0-2.1-5.2-2.6-10.4-2.6h-15.2v21.8h-14.3v-59.7h32.9c7.2 0 12.5.319 17.1 2.8 4.5 2.7 7.3 6.4 7.3 13.2-.002 9.5-6.3 14.4-10.1 15.9zm18.0-32.0h47.6v12.3h-33.4v10.8h32.6v12.1h-32.6v11.8l33.4.054v12.4h-47.6v-59.7zm-96.3 27.5h-18.4v-15.2h18.6c5.1 0 8.7 2.1 8.7 7.3 0 5.1-3.4 7.8-8.9 7.8zm-32.6 26.7l-21.9-24.3 21.9-23.5v47.9zm-56.6-7.0h-35.1v-11.8h31.3v-12.1h-31.3v-10.8h35.8l15.6 17.4-16.3 17.5zm113.5-27.6c0 16.6-12.3 20.0-24.8 20.0h-17.8v20.0h-27.7l-17.5-19.7-18.2 19.7h-56.5v-59.7h57.4l17.5 19.5 18.1-19.5h45.6c11.3 0 24.0 3.1 24.0 19.6z\" fill=\"#fff\"/></svg>`,\n  hipercard: `<svg width=\"512\" height=\"123\" viewBox=\"0 0 512 123\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><path d=\"M374.1 80.8c-6.9 6.7-26.4 8.7-24.4-7.5 1.6-13.4 16.3-16.3 32.2-14.4-1.1 7.3-2.5 16.7-7.8 21.9zm-21.9-52.6c-.663 3.7-1.6 7.0-2.5 10.6 7.9-1.9 32.7-8.1 35.0 2.5.792 3.5-.574 7.2-1.5 10.0-22.3-2.1-40.6 1.5-45.4 17.5-3.2 10.6.36 21.1 7.2 24.1 13.1 5.6 29.2-.822 34.7-9.7-.577 3.0-1.1 6.1-.94 10.0h11.5c.123-11.1 1.7-20.0 3.4-30.0 1.4-8.5 4.1-16.9 3.7-24.4-.995-17.1-29.4-11.1-45.4-10.6zm116.2 57.9c-9.0.195-13.5-5.4-13.7-14.7-.361-16.3 6.7-34.4 21.3-36.0 6.7-.756 11.6.816 16.6 2.5-4.5 18.3-2.9 47.7-24.1 48.2zm30.0-86.1c-1.1 10.1-2.6 19.8-4.6 29.1-33.0-10.4-53.3 13.8-52.9 43.8.072 5.8 1.0 11.5 4.7 15.6 6.2 7.0 24.1 8.7 33.2 2.8 1.7-1.1 3.5-3.2 4.7-4.7.8-1.0 2.2-3.9 2.5-3.1-.474 3.1-1.1 6.1-1.2 9.7h12.2c2.3-33.7 9.6-62.6 15.0-93.3h-13.4zm-344.9 81.1c-7.2 7.6-24.9 7.5-26.3-5.3-.606-5.5 1.4-11.4 2.5-17.2 1.0-5.8 1.7-11.4 2.8-16.6 7.1-8.6 27.9-9.7 30.0 4.7 1.8 12.5-3.1 28.1-9.0 34.4zm10.6-52.9c-11.4-4.2-25.3.83-31.3 5.6.021.2-.144.2-.321.2l.321-.259-.007-.054.9-5.6h-11.5c-4.8 32.1-10.5 63.3-16.6 94.3h13.4c1.9-12.0 3.2-24.7 5.9-36.0 3.0 11.8 23.1 9.5 31.6 5.0 17.4-9.4 30.9-54.4 7.5-63.2zm63.9 22.5h-31.6c1.0-7.2 7.5-15.2 17.8-15.6 9.7-.371 16.6 3.5 13.7 15.6zm-12.8-23.8c-9.7.749-17.9 3.5-23.8 9.7-7.1 7.5-12.9 24.2-11.2 39.4 2.4 21.7 29.4 20.9 51.0 15.6.367-3.8 1.2-7.0 1.8-10.6-8.9 3.3-24.3 7.9-33.5 2.1-6.9-4.3-6.9-15.4-4.7-25.0 14.5-.462 29.6-.374 44.1 0 .923-6.8 3.5-14.2 1.2-20.9-3.0-8.8-13.9-11.1-25.0-10.3zm-118.4 1.2c-.365.0-.341.4-.314.9-2.9 22.2-6.9 43.3-11.2 64.2h13.4c3.2-22.3 6.9-44.2 11.5-65.1h-13.4zm351.5.313c-11.9-5.9-21.8 4.0-25.6 10.0 1.1-3.0 1.1-7.1 2.1-10.3h-11.9c-3.2 22.3-7.0 44.0-11.5 65.1h13.7c.088-8.6 1.7-15.0 3.1-23.5 2.8-18.0 7.1-37.9 28.2-31.9.7-3.0.99-6.5 1.8-9.4zm-151.3 49.5c-1.2-3.2-1.5-8.5-1.2-12.5.697-9.0 3.9-20.0 9.0-25.0 7.0-6.8 20.8-5.7 31.9-1.8.343-3.7 1.0-7.0 1.5-10.6-18.1-2.9-35.3-1.1-44.4 8.4-8.9 9.3-14.7 30.9-10.6 44.4 4.8 15.8 26.5 16.7 44.1 10.6.777-3.1 1.1-6.7 1.8-10.0-9.6 4.9-28.0 7.5-32.2-3.4zm-7.5-49.8c-11.9-4.8-21.3 3.3-25.6 10.9.987-3.3 1.3-7.3 2.1-10.9h-11.9c-2.9 22.5-7.2 43.7-11.2 65.1h13.4c1.8-12.7 2.7-29.8 6.8-41.9 3.3-9.7 12.1-17.9 24.7-13.4.178-3.5 1.2-6.3 1.5-9.7zm-217.1-26.3c-1.9 12.4-4.0 24.7-6.2 36.9-13.9.147-28.2.69-41.6-.314 2.5-11.9 4.3-24.6 6.8-36.6h-15.0c-5.3 30.5-10.2 61.5-16.2 91.4h15.3c2.4-15.3 4.6-30.8 7.8-45.4 13.0-.322 28.7-.885 41.3.314-2.5 15.1-5.7 29.7-8.1 45.1h15.3c4.9-30.9 10.1-61.7 16.2-91.4h-15.6zm38.2 13.7c2.6-1.8 6.1-10.2 2.1-13.7-1.2-1.1-3.3-1.4-6.2-.939-2.7.457-4.2 1.3-5.3 2.8-1.7 2.3-3.2 9.3-.628 11.9 2.5 2.5 8.3 1.1 10.0 0z\" fill=\"#fff\"/></svg>`,\n  \"diners-club\": `<svg width=\"512\" height=\"134\" viewBox=\"0 0 512 134\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><path d=\"M99.2 133.8c36.4.177 69.7-29.6 69.7-65.9 0-39.6-33.2-67.1-69.7-67.1h-31.3c-36.8-.011-67.2 27.4-67.2 67.1 0 36.3 30.3 66.1 67.2 65.9h31.3\" fill=\"#006095\"/><path d=\"M81.9 103.2v-72.0c14.5 5.5 24.8 19.5 24.8 36.0-.024 16.4-10.3 30.4-24.8 36.0m-52.5-36.0c.033-16.4 10.3-30.4 24.8-36.0v72.0c-14.5-5.5-24.7-19.5-24.8-36.0m38.6-60.9c-33.7.011-61.0 27.2-61.0 60.9.008 33.6 27.3 60.8 61.0 60.9 33.7-.01 61.0-27.2 61.0-60.9-.005-33.6-27.3-60.9-61.0-60.9\" fill=\"#fff\"/><path d=\"M190.3 29.4c0-6.2-3.2-5.8-6.4-5.9v-1.8c2.7.133 5.5.133 8.2.133 2.9 0 6.9-.133 12.1-.133 18.1 0 28.0 12.1 28.0 24.4 0 6.9-4.0 24.3-28.8 24.3-3.5 0-6.8-.138-10.1-.138-3.1 0-6.2.067-9.3.138v-1.8c4.2-.421 6.2-.561 6.4-5.3v-33.9zm6.8 32.8c0 5.3 3.8 6.0 7.2 6.0 15.1 0 20.1-11.4 20.1-21.8 0-13.0-8.4-22.5-21.9-22.5-2.8 0-4.2.205-5.4.28v38.0zm37.5 6.4h1.3c1.9 0 3.3 0 3.3-2.3v-18.9c0-3.0-1.0-3.5-3.6-4.8v-1.1c3.2-.985 7.2-2.3 7.5-2.5.493-.28.9-.354 1.2-.354.3 0 .492.4.492.9v26.8c0 2.3 1.5 2.3 3.5 2.3h1.1v1.8c-2.3 0-4.8-.14-7.3-.14-2.5 0-5.0.068-7.6.14v-1.8zm7.5-40.9c-1.8 0-3.4-1.6-3.4-3.4 0-1.7 1.6-3.3 3.4-3.3 1.8 0 3.4 1.4 3.4 3.3 0 1.8-1.5 3.4-3.4 3.4zm14.1 20.0c0-2.5-.775-3.2-4.0-4.6v-1.3c3.0-.978 5.8-1.8 9.2-3.3.208 0 .414.1.414.6v4.5c4.0-2.8 7.4-5.2 12.1-5.2 5.9 0 8.0 4.3 8.0 9.8v18.0c0 2.3 1.5 2.3 3.5 2.3h1.2v1.8c-2.4 0-4.9-.14-7.4-.14-2.5 0-5.0.068-7.5.14v-1.8h1.2c1.9 0 3.3 0 3.3-2.3v-18.1c0-3.9-2.4-5.9-6.4-5.9-2.2 0-5.8 1.8-8.1 3.3v20.7c0 2.3 1.5 2.3 3.5 2.3h1.2v1.8c-2.4 0-4.9-.14-7.4-.14-2.5 0-5.0.068-7.5.14v-1.8h1.2c1.9 0 3.3 0 3.3-2.3v-18.5zm35.9 3.3c-.145.6-.145 1.6 0 4.0.412 6.6 4.7 12.1 10.3 12.1 3.8 0 6.8-2.1 9.4-4.6l.98.9c-3.2 4.2-7.2 7.9-12.9 7.9-11.1 0-13.3-10.7-13.3-15.2 0-13.7 9.2-17.7 14.1-17.7 5.6 0 11.7 3.5 11.8 10.9 0 .426 0 .84-.062 1.2l-.637.4h-19.7zm12.4-2.2c1.7 0 1.9-.912 1.9-1.7 0-3.5-2.1-6.4-6.1-6.4-4.2 0-7.2 3.1-8.0 8.1h12.2zm9.6 19.7h1.8c1.9 0 3.3 0 3.3-2.3v-19.6c0-2.1-2.5-2.5-3.6-3.1v-1.0c5.1-2.1 7.9-3.9 8.5-3.9.412 0 .62.2.62.9v6.2h.15c1.7-2.7 4.6-7.2 8.9-7.2 1.7 0 3.9 1.1 3.9 3.7 0 1.8-1.3 3.5-3.2 3.5-2.1 0-2.1-1.6-4.6-1.6-1.1 0-5.1 1.6-5.1 5.8v16.4c0 2.3 1.3 2.3 3.3 2.3h3.9v1.8c-3.8-.072-6.7-.14-9.8-.14-2.8 0-5.8.068-8.3.14v-1.8zm26.9-7.9c.914 4.6 3.7 8.5 8.8 8.5 4.1 0 5.6-2.5 5.6-4.9 0-8.2-15.2-5.6-15.2-16.8 0-3.9 3.1-8.9 10.8-8.9 2.2 0 5.2.632 7.9 2.0l.495 7.1h-1.6c-.7-4.4-3.1-6.9-7.6-6.9-2.8 0-5.4 1.6-5.4 4.6 0 8.1 16.2 5.6 16.2 16.6 0 4.6-3.7 9.5-12.0 9.5-2.8 0-6.1-.982-8.5-2.3l-.774-8.0 1.2-.353zm83.4-26.4h-1.7c-1.3-8.1-7.1-11.4-15.0-11.4-8.0 0-19.7 5.3-19.7 22.1 0 14.1 10.1 24.2 20.9 24.2 6.9 0 12.6-4.7 14.0-12.1l1.6.419-1.6 10.2c-2.9 1.8-10.8 3.7-15.5 3.7-16.4 0-26.7-10.5-26.7-26.3 0-14.3 12.8-24.6 26.5-24.6 5.6 0 11.1 1.8 16.5 3.7l.7 10.0zm2.5 34.3h1.3c1.9 0 3.3 0 3.3-2.3v-38.9c0-4.5-1.0-4.6-3.7-5.4v-1.1c2.8-.909 5.7-2.1 7.2-3.0.765-.416 1.3-.772 1.5-.772.4 0 .568.4.568.9v48.3c0 2.3 1.5 2.3 3.5 2.3h1.1v1.8c-2.3 0-4.8-.14-7.3-.14-2.5 0-5.0.068-7.6.14v-1.8zm45.0-2.0c0 1.2.769 1.3 1.9 1.3l2.8-.067v1.4c-3.0.278-8.7 1.7-10.1 2.1l-.353-.211v-5.6c-4.2 3.4-7.4 5.8-12.4 5.8-3.7 0-7.7-2.4-7.7-8.3v-17.9c0-1.8-.278-3.5-4.2-3.9v-1.3c2.5-.068 8.1-.488 9.0-.488.7 0 .777.4.777 2.0v18.0c0 2.1 0 8.1 6.0 8.1 2.3 0 5.5-1.8 8.4-4.2v-18.8c0-1.3-3.3-2.1-5.8-2.8v-1.2c6.3-.423 10.2-.98 10.9-.98.5 0 .567.4.567 1.2v25.8zm13.9-23.0c2.8-2.3 6.5-5.0 10.4-5.0 8.1 0 13.0 7.0 13.0 14.6 0 9.1-6.7 18.3-16.7 18.3-5.1 0-7.9-1.6-9.7-2.4l-2.1 1.6-1.4-.767c.62-4.1.979-8.1.979-12.4v-30.0c0-4.5-1.0-4.6-3.7-5.4v-1.1c2.8-.909 5.7-2.1 7.2-3.0.77-.416 1.3-.772 1.5-.772.4 0 .559.4.559.9v25.5zm0 19.0c0 2.6 2.5 7.1 7.2 7.1 7.5 0 10.6-7.3 10.6-13.5 0-7.5-5.7-13.8-11.2-13.8-2.6 0-4.7 1.6-6.6 3.2v17zm-302.5 48.6h.537c1.3 0 2.8-.185 2.8-2.1v-19.9c0-1.9-1.4-2.1-2.8-2.1h-.537v-1.1c1.4 0 3.7.15 5.6.15 1.9 0 4.1-.15 5.9-.15v1.1h-.536c-1.3 0-2.8.189-2.8 2.1v19.9c0 1.9 1.4 2.1 2.8 2.1h.536v1.1c-1.8 0-4.1-.15-6.0-.15-1.8 0-4.1.15-5.6.15v-1.1zm37.8-6.3l.077-.075v-14.2c0-3.1-2.1-3.5-3.3-3.5h-.84v-1.1l5.3.151 4.6-.151v1.1h-.568c-1.6 0-3.4.3-3.4 4.8v17.3c0 1.3.039 2.6.226 3.8h-1.4l-19.6-21.8v15.6c0 3.3.643 4.4 3.5 4.4h.647v1.1l-4.9-.15-5.1.15v-1.1h.534c2.6 0 3.4-1.7 3.4-4.8v-16.0c0-2.1-1.7-3.4-3.4-3.4h-.497v-1.1l4.3.151 3.3-.151 16.9 19.0zm11.6-17.1c-2.8 0-2.9.686-3.5 3.4h-1.1c.148-1.0.342-2.1.458-3.2.155-1.0.228-2.1.228-3.2h.915c.308 1.1 1.2 1.1 2.2 1.1h19.6c1.0 0 1.9-.037 2.0-1.1l.91.1c-.148 1.0-.303 2.0-.419 3.0-.07 1.0-.07 2.0-.07 3.0l-1.1.423c-.078-1.4-.27-3.6-2.8-3.6h-6.2v20.2c0 2.9 1.3 3.2 3.1 3.2h.725v1.1c-1.4 0-4.1-.15-6.2-.15-2.2 0-4.9.15-6.4.15v-1.1h.725c2.1 0 3.1-.187 3.1-3.1v-20.3h-6.2zm23.0 23.5h.536c1.3 0 2.8-.185 2.8-2.1v-19.9c0-1.9-1.4-2.1-2.8-2.1h-.536v-1.1c2.3 0 6.2.15 9.4.15 3.2 0 7.1-.15 9.7-.15-.065 1.6-.028 4.1.083 5.8l-1.1.306c-.184-2.4-.64-4.4-4.6-4.4h-5.2v9.9h4.5c2.2 0 2.7-1.2 3.0-3.3h1.1c-.075 1.4-.114 2.9-.114 4.4 0 1.4.039 2.8.114 4.3l-1.1.226c-.226-2.2-.342-3.7-2.9-3.7h-4.5v8.8c0 2.4 2.2 2.4 4.6 2.4 4.5 0 6.6-.307 7.7-4.6l1.0.262c-.498 2.0-.954 4.0-1.2 6.0-2.4 0-6.8-.15-10.2-.15-3.4 0-7.9.15-10.1.15v-1.1zm26.8-21.4c0-2.7-1.5-2.8-2.7-2.8h-.687v-1.1c1.2 0 3.5.153 5.9.153 2.2 0 4.1-.153 6.1-.153 4.8 0 9.0 1.2 9.0 6.7 0 3.4-2.2 5.5-5.3 6.7l6.5 9.7c1.0 1.6 1.8 2.0 3.7 2.2v1.1l-3.7-.15-3.5.15c-2.9-3.8-5.4-7.9-7.9-12.3h-2.5v8.1c0 2.9 1.3 3.0 3.1 3.0h.689v1.1l-6.5-.15c-1.8 0-3.6.15-5.5.15v-1.1h.687c1.4 0 2.7-.639 2.7-2.0v-19.3zm4.8 8.8h1.8c3.8 0 5.8-1.4 5.8-5.9 0-3.3-2.1-5.5-5.5-5.5-1.1 0-1.6.117-2.1.151v11.3zm43.6 6.2l.068-.075v-14.2c0-3.1-2.1-3.5-3.3-3.5h-.837v-1.1l5.3.151 4.7-.151v1.1h-.577c-1.6 0-3.3.306-3.3 4.8v17.3c0 1.3.036 2.6.225 3.8h-1.4l-19.6-21.8v15.6c0 3.3.647 4.4 3.5 4.4h.648v1.1l-4.9-.15-5.1.15v-1.1h.529c2.6 0 3.4-1.7 3.4-4.8v-16.0c0-2.1-1.7-3.4-3.4-3.4h-.497v-1.1l4.3.151 3.3-.151 16.9 19.0zm12.0 2.0c-.388 1.2-.847 2.2-.847 2.9 0 1.1 1.6 1.3 2.8 1.3h.427v1.1c-1.5-.083-3.0-.148-4.6-.148-1.3 0-2.7.065-4.1.148v-1.1h.231c1.4 0 2.7-.874 3.3-2.4l6.1-17.4c.49-1.4 1.1-3.3 1.4-4.7 1.2-.413 2.7-1.1 3.4-1.6.117-.041.1-.08.3-.08.1 0 .184 0 .27.1.114.3.221.6.345.9l7.0 19.9c.456 1.3.91 2.7 1.4 3.8.463 1.0 1.2 1.5 2.5 1.5h.228v1.1c-1.7-.083-3.4-.148-5.2-.148-1.8 0-3.7.065-5.7.148v-1.1h.423c.873 0 2.3-.148 2.3-1.1 0-.492-.344-1.5-.77-2.7l-1.4-4.4h-8.6l-1.2 3.9zm5.5-16.8h-.078l-3.5 10.7h7.1l-3.5-10.7zm16.4-2.3c-2.8 0-2.9.686-3.5 3.4h-1.1c.15-1.0.344-2.1.463-3.2.151-1.0.223-2.1.223-3.2h.92c.303 1.1 1.2 1.1 2.2 1.1h19.6c1.0 0 1.9-.037 2.0-1.1l.914.1c-.147 1.0-.3 2.0-.414 3.0-.085 1.0-.085 2.0-.085 3.0l-1.1.423c-.07-1.4-.262-3.6-2.8-3.6h-6.2v20.2c0 2.9 1.3 3.2 3.1 3.2h.726v1.1c-1.4 0-4.1-.15-6.2-.15-2.2 0-4.9.15-6.4.15v-1.1h.725c2.1 0 3.1-.187 3.1-3.1v-20.3h-6.2zm23.2 23.5h.534c1.3 0 2.8-.185 2.8-2.1v-19.9c0-1.9-1.4-2.1-2.8-2.1h-.534v-1.1c1.4 0 3.7.15 5.6.15 1.9 0 4.2-.15 5.9-.15v1.1h-.534c-1.3 0-2.8.189-2.8 2.1v19.9c0 1.9 1.4 2.1 2.8 2.1h.534v1.1c-1.8 0-4.1-.15-6.0-.15-1.8 0-4.1.15-5.6.15v-1.1zm26.8-26.0c8.1 0 14.6 5.0 14.6 13.1 0 8.7-6.2 14.5-14.4 14.5-8.0 0-14.2-5.4-14.2-13.6 0-7.9 6.1-14.0 14.0-14.0zm.577 26.0c7.4 0 8.6-6.5 8.6-12.0 0-5.5-3.0-12.3-9.3-12.3-6.6 0-8.6 5.9-8.6 11.0 0 6.8 3.1 13.3 9.3 13.3zm39.7-6.4l.078-.075v-14.2c0-3.1-2.1-3.5-3.3-3.5h-.827v-1.1l5.3.151 4.7-.151v1.1h-.577c-1.5 0-3.3.306-3.3 4.8v17.3c0 1.3.036 2.6.23 3.8h-1.4l-19.6-21.8v15.6c0 3.3.65 4.4 3.5 4.4h.651v1.1l-4.9-.15-5.1.15v-1.1h.539c2.6 0 3.4-1.7 3.4-4.8v-16.0c0-2.1-1.7-3.4-3.4-3.4h-.498v-1.1l4.3.151 3.3-.151 16.9 19.0zm12.0 2.0c-.375 1.2-.837 2.2-.837 2.9 0 1.1 1.6 1.3 2.8 1.3h.427v1.1c-1.5-.083-3.0-.148-4.6-.148-1.3 0-2.7.065-4.1.148v-1.1h.217c1.4 0 2.7-.874 3.3-2.4l6.1-17.4c.493-1.4 1.1-3.3 1.4-4.7 1.2-.413 2.7-1.1 3.4-1.6.109-.041.1-.08.3-.08.1 0 .187 0 .264.1l.349.9 7.0 19.9c.458 1.3.914 2.7 1.4 3.8.458 1.0 1.2 1.5 2.5 1.5h.233v1.1c-1.7-.083-3.4-.148-5.2-.148-1.8 0-3.7.065-5.7.148v-1.1h.422c.871 0 2.3-.148 2.3-1.1 0-.492-.347-1.5-.772-2.7l-1.4-4.4h-8.6l-1.2 3.9zm5.5-16.8h-.077l-3.5 10.7h7.1l-3.5-10.7zm24.3 18.5c0 1.5 1.0 1.9 2.2 2.1 1.5.115 3.2.115 5.0-.078 1.5-.192 2.9-1.1 3.6-2.0.609-.839.9-1.9 1.1-2.7h1.1c-.419 2.1-.954 4.3-1.4 6.4l-10.0-.148-10.0.148v-1.1h.526c1.3 0 2.8-.185 2.8-2.5v-19.5c0-1.9-1.4-2.1-2.8-2.1h-.526v-1.1l6.0.151 5.8-.151v1.1h-.959c-1.4 0-2.5.042-2.5 2.0v19.6z\" fill=\"#1A1918\"/></svg>`,\n  discover: `<svg width=\"512\" height=\"86\" viewBox=\"0 0 512 86\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" preserveAspectRatio=\"xMidYMid\"><defs><linearGradient x1=\"20.4%\" y1=\"10.5%\" x2=\"89.2%\" y2=\"83.5%\" id=\"a\"><stop stop-color=\"#E25429\" offset=\"0%\"/><stop stop-color=\"#F99D3E\" offset=\"100%\"/></linearGradient><path d=\"M270.3.365c-23.9 0-43.4 18.7-43.4 41.8 0 24.5 18.6 42.9 43.4 42.9 24.2 0 43.3-18.6 43.3-42.4 0-23.7-18.9-42.3-43.3-42.3z\" id=\"b\"/><filter x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\" filterUnits=\"objectBoundingBox\" id=\"c\"><feMorphology radius=\"2\" in=\"SourceAlpha\" result=\"shadowSpreadInner1\"/><feGaussianBlur stdDeviation=\"2.5\" in=\"shadowSpreadInner1\" result=\"shadowBlurInner1\"/><feOffset dx=\"2\" dy=\"2\" in=\"shadowBlurInner1\" result=\"shadowOffsetInner1\"/><feComposite in=\"shadowOffsetInner1\" in2=\"SourceAlpha\" operator=\"arithmetic\" k2=\"-1\" k3=\"1\" result=\"shadowInnerInner1\"/><feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0\" in=\"shadowInnerInner1\"/></filter></defs><use fill=\"url(#a)\" fill-rule=\"evenodd\" xlink:href=\"#b\"/><use filter=\"url(#c)\" xlink:href=\"#b\"/><path d=\"M23.7 1.8h-23.3v81.4h23.2c12.3 0 21.2-2.9 29.0-9.3 9.2-7.6 14.7-19.2 14.7-31.2 0-24.0-17.9-40.7-43.7-40.7zm18.5 61.1c-5.0 4.5-11.4 6.4-21.7 6.4h-4.2v-53.8h4.2c10.2 0 16.4 1.8 21.7 6.5 5.4 4.8 8.7 12.4 8.7 20.2 0 7.8-3.2 15.6-8.7 20.5zm32.4 20.2h15.8v-81.4h-15.8v81.4zm54.7-50.2c-9.5-3.5-12.3-5.8-12.3-10.2 0-5.1 4.9-9.0 11.8-9.0 4.7 0 8.6 1.9 12.8 6.5l8.2-10.8c-6.8-5.9-15.0-9.0-23.9-9.0-14.3 0-25.3 10.0-25.3 23.3 0 11.2 5.1 16.9 20.0 22.3 6.2 2.1 9.4 3.6 10.9 4.6 3.1 2.0 4.7 4.9 4.7 8.4 0 6.6-5.2 11.4-12.3 11.4-7.5 0-13.6-3.7-17.3-10.8l-10.2 9.9c7.3 10.7 16.1 15.5 28.2 15.5 16.4 0 28.0-11.0 28.0-26.7 0-12.9-5.3-18.8-23.4-25.4zm28.4 9.5c0 23.9 18.8 42.5 43.0 42.5 6.8 0 12.7-1.3 19.9-4.7v-18.6c-6.3 6.3-11.9 8.9-19.1 8.9-15.9 0-27.3-11.6-27.3-28.1 0-15.6 11.7-27.9 26.6-27.9 7.5 0 13.3 2.6 19.9 9.1v-18.6c-6.9-3.5-12.7-4.9-19.5-4.9-24.0 0-43.3 18.9-43.3 42.6zm191.6 13.9l-21.7-54.7h-17.3l34.5 83.5h8.5l35.1-83.5h-17.2l-22 54.7zm46.4 26.7h45.0v-13.7h-29.1v-22.0h28.0v-13.7h-28.0v-18.0h29.1v-13.7h-45.0v81.4zm107.9-57.4c0-15.2-10.4-24.0-28.8-24.0h-23.5v81.4h15.8v-32.7h2.0l21.9 32.7h19.5l-25.6-34.3c11.9-2.4 18.5-10.6 18.5-23.1zm-31.8 13.4h-4.6v-24.6h4.8c9.9 0 15.2 4.1 15.2 12.0 0 8.1-5.3 12.5-15.5 12.5z\" fill=\"#0B1015\"/></svg>`,\n  jcb: `<svg width=\"512\" height=\"395\" viewBox=\"0 0 512 395\" xmlns=\"http://www.w3.org/2000/svg\" preserveAspectRatio=\"xMidYMid\"><defs><linearGradient x1=\"-57.5%\" y1=\"50.1%\" x2=\"232.3%\" y2=\"50.1%\" id=\"a\"><stop stop-color=\"#007940\" offset=\"0%\"/><stop stop-color=\"#00873F\" offset=\"22.8%\"/><stop stop-color=\"#40A737\" offset=\"74.3%\"/><stop stop-color=\"#5CB531\" offset=\"100%\"/></linearGradient><linearGradient x1=\".183%\" y1=\"49.9%\" x2=\"100.2%\" y2=\"49.9%\" id=\"b\"><stop stop-color=\"#007940\" offset=\"0%\"/><stop stop-color=\"#00873F\" offset=\"22.8%\"/><stop stop-color=\"#40A737\" offset=\"74.3%\"/><stop stop-color=\"#5CB531\" offset=\"100%\"/></linearGradient><linearGradient x1=\"-62.8%\" y1=\"49.8%\" x2=\"253.6%\" y2=\"49.8%\" id=\"c\"><stop stop-color=\"#007940\" offset=\"0%\"/><stop stop-color=\"#00873F\" offset=\"22.8%\"/><stop stop-color=\"#40A737\" offset=\"74.3%\"/><stop stop-color=\"#5CB531\" offset=\"100%\"/></linearGradient><linearGradient x1=\".176%\" y1=\"50.0%\" x2=\"101.8%\" y2=\"50.0%\" id=\"d\"><stop stop-color=\"#1F286F\" offset=\"0%\"/><stop stop-color=\"#004E94\" offset=\"47.5%\"/><stop stop-color=\"#0066B1\" offset=\"82.6%\"/><stop stop-color=\"#006FBC\" offset=\"100%\"/></linearGradient><linearGradient x1=\"-.576%\" y1=\"49.9%\" x2=\"98.1%\" y2=\"49.9%\" id=\"e\"><stop stop-color=\"#6C2C2F\" offset=\"0%\"/><stop stop-color=\"#882730\" offset=\"17.3%\"/><stop stop-color=\"#BE1833\" offset=\"57.3%\"/><stop stop-color=\"#DC0436\" offset=\"85.8%\"/><stop stop-color=\"#E60039\" offset=\"100%\"/></linearGradient></defs><path d=\"M512 314.8c0 43.8-35.6 79.4-79.4 79.4h-432.5v-314.8c0-43.8 35.6-79.4 79.4-79.4h432.5v314.8z\" fill=\"#fff\"/><path d=\"M371.1 234.0h32.8l4.0-.313c6.2-1.2 11.5-6.8 11.5-14.7 0-7.5-5.3-13.1-11.5-14.7-.939-.313-2.8-.313-4.0-.313h-32.8v30.0z\" fill=\"url(#a)\"/><path d=\"M400.2 26.6c-31.2 0-56.9 25.3-56.9 56.9v59.1h80.4c1.8 0 4.0 0 5.6.313 18.1.939 31.6 10.3 31.6 26.6 0 12.8-9.0 23.7-25.9 25.9v.626c18.4 1.2 32.5 11.5 32.5 27.5 0 17.2-15.6 28.4-36.3 28.4h-88.2v115.7h83.5c31.2 0 56.9-25.3 56.9-56.9v-284.4h-83.2z\" fill=\"url(#b)\"/><path d=\"M415.6 173.3c0-7.5-5.3-12.5-11.5-13.4-.626 0-2.1-.313-3.1-.313h-29.7v27.5h29.7c.939 0 2.8 0 3.1-.313 6.2-.939 11.5-5.9 11.5-13.4z\" fill=\"url(#c)\"/><path d=\"M85.4 26.6c-31.2 0-56.9 25.3-56.9 56.9v140.5c15.9 7.8 32.5 12.8 49.1 12.8 19.7 0 30.3-11.8 30.3-28.1v-66.3h48.8v66.0c0 25.6-15.9 46.6-70.1 46.6-32.8 0-58.5-7.1-58.5-7.1v119.8h83.5c31.2 0 56.9-25.3 56.9-56.9v-284.1h-83.2z\" fill=\"url(#d)\"/><path d=\"M242.8 26.6c-31.2 0-56.9 25.3-56.9 56.9v74.4c14.3-12.2 39.4-20.0 79.8-18.1 21.5.939 44.7 6.8 44.7 6.8v24.0c-11.5-5.9-25.3-11.2-43.1-12.5-30.6-2.1-49.1 12.8-49.1 39.1 0 26.6 18.4 41.6 49.1 39.1 17.8-1.2 31.6-6.8 43.1-12.5v24.0s-22.8 5.9-44.7 6.8c-40.3 1.8-65.4-5.9-79.8-18.1v131.4h83.5c31.2 0 56.9-25.3 56.9-56.9v-284.7h-83.5z\" fill=\"url(#e)\"/></svg>`,\n};\n\nfunction svgSource(svg: string) {\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\ntype IssuerLook = {\n  /** The gradient that sweeps over the card once the issuer is known. */\n  background?: string;\n  /** Dark text, on the light Mastercard, Diners and Discover cards. */\n  isLight?: boolean;\n  logo?: keyof typeof ARTWORK;\n  logoClassName?: string;\n};\n\n/*\n * The issuer colors are content, like a file type's brand color: they stay\n * the same in every theme. Issuers without a look of their own take the theme\n * gray and their name as text.\n */\nconst ISSUER_LOOKS: Record<string, IssuerLook> = {\n  \"american-express\": {\n    background: \"bg-[linear-gradient(25deg,#308c67,#a3f2cf)]\",\n    logo: \"american-express\",\n  },\n  \"diners-club\": {\n    background: \"bg-[linear-gradient(25deg,#fff,#eee)]\",\n    isLight: true,\n    logo: \"diners-club\",\n  },\n  discover: {\n    background: \"bg-[linear-gradient(25deg,#fff,#eee)]\",\n    isLight: true,\n    logo: \"discover\",\n  },\n  elo: { background: \"bg-[linear-gradient(25deg,#211c18,#aaa7a2)]\", logo: \"elo\" },\n  hipercard: { background: \"bg-[linear-gradient(25deg,#8b181b,#de1f27)]\", logo: \"hipercard\" },\n  jcb: { logo: \"jcb\" },\n  mastercard: {\n    background: \"bg-[linear-gradient(25deg,#fbfbfb,#e8e9e5)]\",\n    isLight: true,\n    logo: \"mastercard\",\n  },\n  visa: {\n    background: \"bg-[linear-gradient(25deg,#0f509e,#1399cd)]\",\n    logo: \"visa\",\n    logoClassName: \"w-[30%]\",\n  },\n};\n\n/* -------------------------------------------------------------------------- */\n/*                                 Formatting                                 */\n/* -------------------------------------------------------------------------- */\n\nconst PLACEHOLDER = \"•\";\n/** Characters that stand for a hidden digit in a saved card's number. */\nconst HIDDEN_DIGIT = /[*•xX]/;\n\n/**\n * The number padded with `•` to its issuer's length and broken into groups:\n * 4-4-4-4, Amex 4-6-5. Hidden digits (`*`, `x`) show as `•` too.\n */\nfunction formatNumber(number: string, issuer: CreditCardIssuer | null) {\n  const chars = [...number].filter((char) => /\\d/.test(char) || HIDDEN_DIGIT.test(char));\n  const lengths = issuer?.lengths ?? [16, 19];\n  const length = Math.min(\n    lengths.find((candidate) => candidate >= chars.length) ?? Math.max(...lengths),\n    19,\n  );\n  const gaps = issuer?.gaps ?? [4, 8, 12];\n  let text = \"\";\n  for (let index = 0; index < length; index++) {\n    if (gaps.includes(index)) text += \" \";\n    const char = chars[index];\n    text += char && /\\d/.test(char) ? char : PLACEHOLDER;\n  }\n  return { text, length, isFilled: chars.length > 0, digits: chars.slice(0, length).join(\"\") };\n}\n\n/** `MM/YY` from `MM/YY`, `MM/YYYY`, `MMYY` or `MMYYYY`, padded with `•`. */\nfunction formatExpiry(expiry: string) {\n  let [month = \"\", year = \"\"] = expiry.includes(\"/\")\n    ? expiry.split(\"/\")\n    : [expiry.slice(0, 2), expiry.slice(2)];\n  month = month.replace(/\\D/g, \"\").slice(0, 2);\n  year = year.replace(/\\D/g, \"\");\n  if (year.length > 2) year = year.slice(2, 4);\n  return {\n    text: `${month.padEnd(2, PLACEHOLDER)}/${year.padEnd(2, PLACEHOLDER)}`,\n    isComplete: month.length === 2 && year.length === 2,\n    isFilled: month.length > 0,\n  };\n}\n\n/* -------------------------------------------------------------------------- */\n/*                                 Component                                  */\n/* -------------------------------------------------------------------------- */\n\ntype CreditCardField = \"number\" | \"name\" | \"expiry\" | \"cvc\";\n\ntype CreditCardLabels = {\n  /** The caption above the expiry date. */\n  validThru: string;\n  /** Shown while `name` is empty. */\n  namePlaceholder: string;\n  /** The card's accessible name, read in place of the drawing. */\n  card: (card: { issuer?: string; lastDigits?: string; expiry?: string }) => string;\n};\n\nconst defaultCreditCardLabels: CreditCardLabels = {\n  validThru: \"valid thru\",\n  namePlaceholder: \"YOUR NAME HERE\",\n  card: ({ issuer, lastDigits, expiry }) =>\n    `${issuer ?? \"Credit\"} card${lastDigits ? ` ending in ${lastDigits}` : \"\"}${\n      expiry ? `, expires ${expiry}` : \"\"\n    }`,\n};\n\ntype CreditCardProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n  /** The card number, with or without spaces; `*` or `x` hide a digit (`**** **** **** 4242`). */\n  number?: string;\n  /** The holder's name, shown in capitals. */\n  name?: string;\n  /** `MM/YY`, `MM/YYYY`, `MMYY` or `MMYYYY`. */\n  expiry?: string;\n  /** The security code, on the back (on the front for Amex). */\n  cvc?: string;\n  /**\n   * The field being typed, highlighted on the card; `cvc` turns it to the back.\n   * Wire it to the form's focus.\n   */\n  focused?: CreditCardField | null;\n  /**\n   * The issuer id (`visa`, `mastercard`, `amex`…), for a saved card whose\n   * number is hidden. By default it comes from the number.\n   */\n  issuer?: string;\n  labels?: Partial<CreditCardLabels>;\n};\n\n/** The look of a field: dim while empty, brighter once filled, bold while typed. */\nconst FIELD =\n  \"opacity-50 transition-opacity duration-300 data-filled:opacity-80 data-focused:font-bold data-focused:opacity-100\";\n\n/**\n * A payment card drawn from its data, front and back: chip, issuer logo and\n * color, number, holder and expiry, and the security code. Shows a saved card\n * or previews one being typed. Sized by its width (`w-72` by default); the\n * text scales with it.\n */\nfunction CreditCard({\n  number = \"\",\n  name = \"\",\n  expiry = \"\",\n  cvc = \"\",\n  focused,\n  issuer: issuerProp,\n  labels: labelsProp,\n  className,\n  ...props\n}: CreditCardProps) {\n  const labels = { ...defaultCreditCardLabels, ...labelsProp };\n  const issuer = issuerProp ? getCreditCardIssuerById(issuerProp) : getCreditCardIssuer(number);\n  const look = (issuer && ISSUER_LOOKS[issuer.type]) || {};\n  const isAmex = issuer?.type === \"american-express\";\n  const isFlipped = focused === \"cvc\" && !isAmex;\n\n  const cardNumber = formatNumber(number, issuer);\n  const cardExpiry = formatExpiry(expiry);\n  const lastDigits = /\\d{4}$/.test(cardNumber.digits) ? cardNumber.digits.slice(-4) : undefined;\n\n  const face = cn(\n    \"absolute inset-0 overflow-hidden rounded-[5cqw] bg-muted-foreground backface-hidden\",\n    look.background\n      ? cn(\"shadow-lg\", look.isLight ? \"text-[#555]\" : \"text-white\")\n      : \"text-background\",\n  );\n  const sweep = (\n    <div\n      aria-hidden\n      className={cn(\n        \"absolute top-[-60%] h-[200%] w-[150%] rotate-25 transition-[left] duration-500 ease-out motion-reduce:transition-none\",\n        look.background ? cn(\"left-[-22%]\", look.background) : \"left-[-170%]\",\n      )}\n    />\n  );\n  const logo = (className?: string) =>\n    look.logo ? (\n      <img\n        alt=\"\"\n        src={svgSource(ARTWORK[look.logo])}\n        className={cn(\"absolute h-[23%] w-[40%] object-contain\", className, look.logoClassName)}\n      />\n    ) : issuer ? (\n      <span className={cn(\"absolute text-[5cqw] font-semibold italic\", className)}>\n        {issuer.niceType}\n      </span>\n    ) : null;\n\n  return (\n    <div\n      data-slot=\"credit-card\"\n      role=\"img\"\n      aria-label={labels.card({\n        issuer: issuer?.niceType,\n        lastDigits,\n        expiry: cardExpiry.isComplete ? cardExpiry.text : undefined,\n      })}\n      data-issuer={issuer?.type ?? \"unknown\"}\n      className={cn(\n        \"@container block w-72 shrink-0 font-mono leading-none perspective-[1000px] select-none\",\n        className,\n      )}\n      {...props}\n    >\n      <div\n        aria-hidden\n        data-flipped={isFlipped || undefined}\n        className=\"relative aspect-[1.5858] transition-transform duration-400 ease-linear transform-3d motion-reduce:transition-none data-flipped:rotate-y-180\"\n      >\n        <div data-slot=\"credit-card-front\" className={face}>\n          {sweep}\n          <img\n            alt=\"\"\n            src={svgSource(ARTWORK.chip)}\n            className=\"absolute top-[10%] left-[10%] h-[9.1cqw] w-[14.3cqw] object-contain\"\n          />\n          {logo(\"top-[10%] right-[10%] object-right-top text-right\")}\n          {isAmex && (\n            <div\n              data-focused={focused === \"cvc\" || undefined}\n              className={cn(\"absolute top-[38%] right-[10%] text-[4.1cqw]\", FIELD)}\n            >\n              {cvc}\n            </div>\n          )}\n          <div\n            data-focused={focused === \"number\" || undefined}\n            data-filled={cardNumber.isFilled || undefined}\n            className={cn(\n              \"absolute top-[45%] left-[10%] whitespace-pre\",\n              cardNumber.length > 16 ? \"text-[5.9cqw]\" : \"text-[6.9cqw]\",\n              FIELD,\n            )}\n          >\n            {cardNumber.text}\n          </div>\n          <div\n            data-focused={focused === \"name\" || undefined}\n            data-filled={name ? true : undefined}\n            className={cn(\n              \"absolute bottom-[15%] left-[10%] w-[60%] truncate text-[5.9cqw] uppercase\",\n              FIELD,\n            )}\n          >\n            {name || labels.namePlaceholder}\n          </div>\n          <div\n            data-focused={focused === \"expiry\" || undefined}\n            data-filled={cardExpiry.isFilled || undefined}\n            className={cn(\"absolute right-[10%] bottom-[15%]\", FIELD)}\n          >\n            <div className=\"mb-[1.7cqw] font-sans text-[3.4cqw]\">{labels.validThru}</div>\n            <div className=\"text-[5.5cqw]\">{cardExpiry.text}</div>\n          </div>\n        </div>\n        <div data-slot=\"credit-card-back\" className={cn(face, \"rotate-y-180\")}>\n          {sweep}\n          <div className=\"absolute top-[9%] h-[22%] w-full bg-[#2a1d16]\" />\n          <div className=\"absolute top-[35%] left-[5%] h-[18%] w-[75%] bg-[repeating-linear-gradient(0.1deg,#fff_20%,#fff_40%,#fea_40%,#fea_44%,#fff_44%)]\" />\n          <div\n            data-focused={focused === \"cvc\" || undefined}\n            data-filled={cvc ? true : undefined}\n            className={cn(\"absolute top-[42%] left-[67%] text-[4.8cqw] text-[#222]\", FIELD)}\n          >\n            {cvc}\n          </div>\n          {logo(\"bottom-[5%] left-1/2 -translate-x-1/2 object-bottom text-center opacity-60\")}\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport type { CreditCardField, CreditCardLabels, CreditCardProps };\nexport { CreditCard };\n",
      "type": "registry:component",
      "target": "components/fma-ds/credit-card.tsx"
    }
  ],
  "meta": {
    "status": "stable",
    "source": "third-party",
    "license": "MIT",
    "origin": "react-credit-cards-2 (https://github.com/felquis/react-credit-cards-2, MIT), ported to Tailwind",
    "tags": [
      "payment",
      "credit-card",
      "data-display",
      "form"
    ],
    "contentHash": "793d900d3ab2"
  },
  "categories": [
    "data-display"
  ],
  "type": "registry:ui"
}