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AEgJ,SAASvF,EAAEmC,MAAMnC,EAAEwF,UAAUxF,EAAEyF,MAAMzF,GAAG,OAAOE,EAAEwF,eAAezF,EAAEC,EAAEyF,UAAUzF,EAAEA,CAAC,CAAC,EAAE,SAAS3D,EAAEyD,EAAEE,GAAG3D,EAAEwD,QAAQG,EAAE,EAAFA,EAAM,EAAE,SAAS3D,EAAEyD,GAAG,aAAa,IAAIE,EAAE,+CAA+C3D,EAAEwD,QAAQG,CAAC,EAAE,SAASF,EAAEE,GAAGF,EAAED,QAAQxD,CAAC,I","sources":["webpack://gatsby-starter-default/./src/pages/contact.js","webpack://gatsby-starter-default/./node_modules/react-recaptcha/dist/react-recaptcha.js"],"sourcesContent":["import React, { useState, useContext, useEffect } from \"react\"\nimport { FirebaseContext } from \"../components/Firebase\"\nimport SEO from \"../components/seo\"\nimport Link from \"../link\"\nimport Recaptcha from \"react-recaptcha\"\nimport { FormattedMessage, useIntl } from \"react-intl\"\n\nconst ContactForm = props => {\n const { firebase, user } = useContext(FirebaseContext)\n const [submitted, setSubmitted] = useState(false)\n const [success, setSuccess] = useState(false)\n const [messageCharsRemaining, setMessageCharsRemaining] = useState(1000)\n const [errors, setErrors] = useState({})\n const [recaptchaValidated, setRecaptchaValidated] = useState(false)\n const [formValues, setFormValues] = useState({\n firstName: \"\",\n lastName: \"\",\n email: \"\",\n details: \"\",\n })\n const { formatMessage, locale } = useIntl()\n\n const inputMaxLength = 100\n\n useEffect(() => {\n if (user) {\n setFormValues({\n ...formValues,\n email: user.email,\n })\n }\n }, [user])\n\n function handleInputChange(e) {\n e.persist()\n\n setFormValues(currentValues => ({\n ...currentValues,\n [e.target.name]: e.target.value,\n }))\n\n // message field\n if (e.target.name === \"details\") {\n const length = e.target.value.length\n const maxLength = e.target.maxLength\n setMessageCharsRemaining(maxLength - length)\n }\n }\n\n function validates() {\n const validations = {}\n if (formValues.firstName.length < 2) {\n validations.firstName =\n \"First name is required and must be at least 2 characters\"\n }\n\n if (formValues.firstName.length > inputMaxLength) {\n validations.firstName = `A maximum length of ${inputMaxLength} is allowed`\n }\n\n if (formValues.lastName.length < 2) {\n validations.lastName =\n \"Last name is required and must be at least 2 characters\"\n }\n\n if (formValues.lastName.length > inputMaxLength) {\n validations.lastName = `A maximum length of ${inputMaxLength} is allowed`\n }\n\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(formValues.email)) {\n validations.email = \"A valid email address is required\"\n }\n\n if (formValues.details.length > 1000) {\n validations.details =\n \"Please shorten your message to less than 1,000 characters\"\n }\n\n if (formValues.details.length < 5) {\n validations.details = \"Please provide more detail\"\n }\n\n setErrors(validations)\n\n return JSON.stringify(validations) === \"{}\"\n }\n\n const verifyCallback = function (response) {\n if (response) {\n setRecaptchaValidated(true)\n }\n }\n\n function handleSubmit(e) {\n e.preventDefault()\n\n if (!validates()) {\n return\n }\n\n if (!recaptchaValidated) {\n alert(\"Please confirm that you're not a robot.\")\n return\n }\n\n sendEmail(formValues)\n\n setSubmitted(true)\n\n try {\n firebase\n .storeContactFormSubmission(formValues)\n .then(() => {\n setSuccess(true)\n })\n .catch(e => {\n console.error(e.message, \"there was an error\")\n })\n } catch (e) {\n console.error(\"There was a problem with the form submission: \", e.message)\n }\n }\n\n function sendEmail(data) {\n let info = {\n path: \"contact\",\n subject: \"Support from \" + data.firstName + \" \" + data.lastName,\n from: \"support@wingspans.com\",\n to: \"support@wingspans.com\",\n text: data.details,\n user: data,\n }\n\n firebase.sendEmail(info)\n }\n\n return (\n \n \n\n \n
\n
\n \n
\n
\n \n\n \n
\n {!!submitted && (\n <>\n {!success && (\n \n
Saving...
\n \n )}\n {!!success && (\n \n
Thank you! Your message has been received.
\n
\n Go to home page\n
\n \n )}\n >\n )}\n\n {!submitted && (\n \n )}\n
\n \n \n )\n}\n\nexport default ContactForm\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\")):\"function\"==typeof define&&define.amd?define([\"react\"],t):\"object\"==typeof exports?exports.ReactRecaptcha=t(require(\"react\")):e.ReactRecaptcha=t(e.React)}(this,function(e){return function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var a={};return t.m=e,t.c=a,t.p=\"\",t(0)}([function(e,t,a){\"use strict\";function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function o(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function i(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0});var l=function(){function e(e,t){for(var a=0;a