{"version":3,"file":"index-mIk16cND.js","sources":["../../../app/javascript/src/explore/scenes/Newsletter/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport cls from 'classnames';\n\nimport { ContainerXXL } from 'src/explore/elements/ContainerXXL';\nimport { LazyImgix } from 'src/explore/elements/LazyImgix';\nimport { Routes } from 'src/explore/services/Routes';\nimport api from 'src/explore/services/api';\n\nimport styles from './index.module.sass';\n\nconst Newsletter = () => {\n const [ email, setEmail ] = React.useState( '' );\n const [ submitted, setSubmitted ] = React.useState( false );\n\n return (\n <div\n className={cls(\n styles.wrapper,\n 'spec__footer-newsletter position-relative px-4 px-sm-8 pb-8 pt-0 p-md-0'\n )}\n >\n <ContainerXXL\n className={cls( styles.container, 'row justify-content-center align-content-around' )}\n >\n <div className={styles['image-wrapper']}>\n {/* I had to force the format on this image to make this work in Firefox. */}\n <LazyImgix\n src={Routes.image.consumer( 'footer/Newsletter_Walking_Mouth.gif' )}\n alt=\"Image of an open mouth with its tongue out, carrying a mail bag, and delivering letters from Goldbelly\"\n className={cls( styles.image, 'd-block mx-auto mt-md-0' )}\n imgixParams={{ ar: '1:1', fm: 'webp', auto: null }}\n sizes=\"(min-width: 992px) 25rem, (min-width: 768px) 20rem, (min-width: 576px) 50vw, 70vw\"\n />\n </div>\n\n <div className=\"my-auto\">\n <div className={cls( styles.callout, 'text-center' )}>\n <div className={cls( styles['pre-title'], 'mt-2 mb-4 text-lowercase' )}>\n Join 5 million subscribers on\n </div>\n <div className={cls( styles.title, 'text-uppercase' )}>\n the food world’s\n <br />\n favorite newsletter\n </div>\n </div>\n\n <div className={cls( styles['form-wrapper'], 'position-relative mt-6 mx-auto' )}>\n <form\n className={cls(\n styles.form,\n { [styles.submitted]: submitted },\n 'd-flex flex-wrap align-items-center justify-content-center'\n )}\n onSubmit={( e ) => {\n e.preventDefault();\n\n if ( email ) {\n api\n .post( '/list_emails', { email }, { baseURL: '/api' })\n .then(() => setSubmitted( true ))\n .catch(() => {\n // swallow?\n });\n }\n }}\n >\n <input\n aria-label=\"Newsletter Email\"\n className=\"border-0 col f-5 p-3 mr-4 rounded\"\n placeholder=\"Enter Your Email\"\n type=\"email\"\n name=\"spec__newsletter-email\"\n value={email}\n onChange={( e ) => setEmail( e.target.value )}\n />\n\n <button\n aria-label=\"Sign Up\"\n className={cls( styles.button, 'btn btn-white rounded-pill text-lowercase' )}\n type=\"submit\"\n >\n Sign Up Now\n </button>\n </form>\n\n <div\n className={cls(\n styles.success,\n { [styles.submitted]: submitted },\n 'position-absolute fs-6 fs-sm-8 w-100 h-100 text-center border-dark border rounded-pill'\n )}\n >\n Got it! I see yummy emails in your future…\n </div>\n </div>\n </div>\n </ContainerXXL>\n </div>\n );\n};\n\nexport default Newsletter;\n"],"names":["Newsletter","email","setEmail","React.useState","submitted","setSubmitted","React.createElement","cls","styles","ContainerXXL","LazyImgix","Routes","e","api"],"mappings":"2rEAUMA,GAAa,IAAM,CACvB,KAAM,CAAEC,EAAOC,CAAS,EAAIC,EAAAA,SAAgB,EAAG,EACzC,CAAEC,EAAWC,CAAa,EAAIF,EAAAA,SAAgB,EAAM,EAGxD,OAAAG,EAAA,cAAC,MAAA,CACC,UAAWC,EACTC,EAAO,QACP,yEAAA,CACF,EAEAF,EAAA,cAACG,EAAA,CACC,UAAWF,EAAKC,EAAO,UAAW,iDAAkD,CAAA,EAEnFF,EAAA,cAAA,MAAA,CAAI,UAAWE,EAAO,eAAe,CAEpC,EAAAF,EAAA,cAACI,EAAA,CACC,IAAKC,EAAO,MAAM,SAAU,qCAAsC,EAClE,IAAI,yGACJ,UAAWJ,EAAKC,EAAO,MAAO,yBAA0B,EACxD,YAAa,CAAE,GAAI,MAAO,GAAI,OAAQ,KAAM,IAAK,EACjD,MAAM,mFAAA,CAAA,CAEV,EAEAF,EAAAA,cAAC,OAAI,UAAU,SAAA,kBACZ,MAAI,CAAA,UAAWC,EAAKC,EAAO,QAAS,aAAc,CACjD,EAAAF,EAAA,cAAC,OAAI,UAAWC,EAAKC,EAAO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