{"version":3,"file":"index-D-5eZakZ.js","sources":["../../../app/javascript/src/explore/elements/Rating/index.tsx","../../../app/javascript/src/explore/elements/Merchant/index.tsx","../../../app/javascript/src/explore/compositions/MerchantGrid/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport cls from 'classnames';\n\nimport { RatingStars } from 'src/explore/elements/RatingStars';\n\nimport styles from './index.module.sass';\n\ninterface Props {\n className?: string;\n link: string;\n score: number;\n}\n\nexport const Rating: React.FC<Props> = ({ className, link, score }) => (\n <div className={cls( className )}>\n <a className=\"d-inline-block text-dark\" href={link}>\n <strong className={`${styles.rating} mr-1`}>{`(${score})`}</strong>\n <RatingStars className=\"ml-1 text-secondary fs-3\" max={5} value={score} />\n </a>\n </div>\n);\n","import * as React from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faHatChef } from '@fortawesome/pro-regular-svg-icons';\n\nimport { LazyImgix } from 'src/explore/elements/LazyImgix';\nimport { Rating } from 'src/explore/elements/Rating';\nimport { StatusOverlay } from 'src/explore/elements/StatusOverlay';\nimport { SvgUse } from 'src/shoppe/elements/SvgUse';\nimport { IMerchant as IShoppeMerchant } from 'src/explore/types/shoppe';\nimport { useRoutes } from 'src/explore/hooks/useRoutes';\nimport { useShopConfig } from 'src/explore/hooks/useShopConfig';\n\nimport styles from './index.module.sass';\n\nexport type IMerchant = Pick<\n IShoppeMerchant,\n | 'id'\n | 'customerRating'\n | 'foodMakerImageUrl'\n | 'isShippingIncluded'\n | 'isSoldOut'\n | 'location'\n | 'mainImageUrl'\n | 'name'\n | 'permalink'\n | 'statePermalink'\n | 'tagline'\n>;\ninterface Props {\n merchant: IMerchant;\n}\n\nexport const Merchant: React.FC<Props> = ({\n merchant: {\n customerRating,\n foodMakerImageUrl,\n isShippingIncluded,\n isSoldOut,\n location,\n mainImageUrl,\n name,\n permalink,\n statePermalink,\n tagline,\n },\n}) => {\n const config = useShopConfig();\n const routes = useRoutes();\n\n return (\n <div className=\"fs-4 overflow-hidden spec__merchant-card\">\n <a\n className={`${styles.image} position-relative d-block mb-5 text-dark fs-0 overflow-hidden`}\n title={name}\n href={routes.merchant( permalink )}\n >\n {mainImageUrl && (\n <LazyImgix\n alt={name}\n className=\"position-absolute w-100 h-auto\"\n sizes=\"(min-width: 768px) 50vw, 100vw\"\n src={mainImageUrl}\n width={1124}\n height={520}\n />\n )}\n {isShippingIncluded && (\n <SvgUse\n ariaLabel=\"Free Shipping\"\n className={`${styles.freeShipping} position-absolute`}\n name=\"free-shipping-badge\"\n />\n )}\n {isSoldOut && (\n <StatusOverlay\n className=\"fs-10 spec__sold-out-overlay\"\n text={config.ui?.sold_out_label || 'Sold Out'}\n />\n )}\n </a>\n <div\n className={`${styles.text} position-relative d-flex flex-column justify-content-center pr-md-2`}\n >\n <a\n className={`${styles.title} d-block text-dark`}\n title={name}\n href={routes.merchant( permalink )}\n >\n <div\n className={`${styles.name} position-relative mb-1 ff-futura-bold fs-5 fs-sm-8 fs-md-5 fs-lg-8 text-uppercase spec__merchant-name`}\n >\n {name}\n </div>\n {tagline && <div className=\"mb-2\">{tagline}</div>}\n {foodMakerImageUrl ? (\n <figure\n className={`${styles.foodMaker} position-absolute pr-4 pr-sm-8 pr-md-5 pr-lg-6`}\n >\n <LazyImgix\n alt={name}\n className=\"w-100 h-auto rounded-circle\"\n imgixParams={{ ar: '1:1' }}\n sizes=\"(min-width: 992px) 15vw, (min-width: 768px) 20vw, 45vw\"\n src={foodMakerImageUrl}\n />\n </figure>\n ) : (\n <div className={`${styles.foodMaker} position-absolute pr-4 pr-sm-8 pr-md-5 pr-lg-6`}>\n <figure className=\"d-flex justify-content-center align-items-center w-100 h-100 rounded-circle bg-light\">\n <FontAwesomeIcon className=\"fs-9 fs-sm-10 fs-lg-12\" icon={faHatChef} />\n </figure>\n </div>\n )}\n </a>\n {location && (\n <div className=\"mb-2\">\n <a className=\"text-dark\" href={statePermalink}>\n {location}\n </a>\n </div>\n )}\n {customerRating && <Rating link={`${permalink}#merchant-reviews`} score={customerRating} />}\n </div>\n </div>\n );\n};\n","import * as React from 'react';\nimport cls from 'classnames';\n\nimport { Merchant } from 'src/explore/elements/Merchant';\nimport type { IMerchant } from 'src/explore/elements/Merchant';\n\nexport type { IMerchant };\n\ninterface Props {\n className?: string;\n merchants: IMerchant[];\n}\n\nexport const MerchantGrid: React.FC<Props> = ({ className, merchants }) => {\n if ( merchants?.length > 0 ) {\n return (\n <ul className={cls( 'row spec__merchants', className )}>\n {merchants.map(( merchant ) => (\n <li\n key={merchant.id}\n className=\"col-12 col-md-6 align-top pt-5 px-md-1 pb-5 pb-md-9 mb-md-3 spec__merchant\"\n >\n <Merchant merchant={merchant} />\n </li>\n ))}\n </ul>\n );\n }\n\n return null;\n};\n"],"names":["Rating","className","link","score","React.createElement","cls","styles","RatingStars","Merchant","customerRating","foodMakerImageUrl","isShippingIncluded","isSoldOut","location","mainImageUrl","name","permalink","statePermalink","tagline","config","useShopConfig","routes","useRoutes","LazyImgix","SvgUse","StatusOverlay","_a","FontAwesomeIcon","faHatChef","MerchantGrid","merchants","merchant"],"mappings":"wXAaaA,EAA0B,CAAC,CAAE,UAAAC,EAAW,KAAAC,EAAM,MAAAC,KACzDC,EAAA,cAAC,MAAI,CAAA,UAAWC,EAAKJ,CAAU,CAAA,kBAC5B,IAAE,CAAA,UAAU,2BAA2B,KAAMC,CAAA,EAC3CE,gBAAA,SAAA,CAAO,UAAW,GAAGE,EAAO,MAAM,OAAU,EAAA,IAAIH,CAAK,GAAI,EACzDC,EAAAA,cAAAG,EAAA,CAAY,UAAU,2BAA2B,IAAK,EAAG,MAAOJ,CAAO,CAAA,CAC1E,CACF,8LCaWK,EAA4B,CAAC,CACxC,SAAU,CACR,eAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,KAAAC,EACA,UAAAC,EACA,eAAAC,EACA,QAAAC,CAAA,CAEJ,IAAM,OACJ,MAAMC,EAASC,EAAc,EACvBC,EAASC,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