{"version":3,"sources":["components/Form/Form.module.scss","components/shared/Icon/Icon.js","components/Introduction/Introduction.js","helpers/URLSearchParams.js","globalState/FormDataContext.js","components/shared/Errors/GenericError.js","components/shared/Button/Button.js","components/Form/useStepLogic.js","components/shared/FormElements/Input/textarea.js","components/shared/SectionStepInfo/SectionStepInfo.js","components/Form/Shared/Enquiry/Enquiry.js","components/shared/FormElements/Input/Input.js","components/Form/Shared/Contact/Contact.js","components/Form/Shared/Name/Fieldset/Name.js","components/Form/SubmitConfirmation/Success.js","components/Form/SubmitConfirmation/Error.js","components/Form/useSubmitForm.js","components/shared/Table/Table.js","components/shared/Table/Table-2-col.js","components/shared/FormElements/Input/InputCheckbox.js","components/Form/StepConfirm/General/StepConsentForm.js","components/Form/StepConfirm/General/StepSummarySection.js","components/Form/StepConfirm/General/StepConfirm.js","components/Form/useTrackFormAbandonment.js","components/Form/Form.js","App.js","serviceWorker.js","index.js"],"names":["module","exports","Icon","_ref","className","iconName","_jsx","children","xlinkHref","concat","href","defaultProps","Intro","setIsFormStarted","_jsxs","type","onClick","url","URL","window","location","getSearchParam","name","searchParams","get","FormDataContext","createContext","FormDataProvider","props","FirstName","LastName","UrlName","decodeURI","_decodeURI$split","split","_decodeURI$split2","_slicedToArray","initialState","currentStep","length","formData","Firstname","hasReachedConfirmation","_useReducer","useReducer","state","action","_objectSpread","payload","_useReducer2","formState","formDispatch","Provider","value","GenericError","Button","btnClass","disabled","iconLeft","iconRight","isActive","isFetching","text","title","iconClass","role","useStepLogic","formRef","_useFormContext","useFormContext","register","errors","trigger","getValues","_useContext","useContext","_useContext2","formDataState","formDataDispatch","_useState","useState","_useState2","isContinuePressed","setIsContinuePressed","setStep","step","handleSubmit","_asyncToGenerator","_regeneratorRuntime","mark","_callee","event","result","file","PhotoName","PhotoExtension","reader","wrap","_context","prev","next","preventDefault","sent","Object","keys","includes","UploadInvitation","FileReader","readAsDataURL","onloadend","PhotoBase64","replace","scrollTo","current","offsetTop","stop","_x","apply","arguments","showGenericError","continueButton","sanitize","dompurify","Textarea","fieldValidation","inputmode","label","spellcheck","APIerrors","input","_Fragment","defaultValue","id","inputMode","ref","spellCheck","htmlFor","dangerouslySetInnerHTML","__html","message","SectionStepInfo","section","description","Enquiry","useRef","_useStepLogic","summary","onSubmit","autoComplete","Input","required","autocomplete","Contact","emailLabel","emailValidation","pattern","toLowerCase","emailInputSrc","Name","fNameLabel","lNameLabel","Success","Error","isRecoverLinkPressed","target","useSubmitForm","setFormSubmitStatus","dataToSend","setIsFetching","_useState3","_useState4","APIErrorMessage","setAPIErrorMessage","_formDataState$formDa","ContactEmail","Email","axios","method","process","data","JSON","stringify","to","body","from","subject","files","displayName","headers","then","response","status","config","dataLayer","push","eventCategory","eventAction","eventLabel","Message","statusText","catch","error","errMsg","console","errorMessage","Table","caption","values","classes","cellClasses","noHeadersClass","lenght","map","index","scope","line","lineIndex","col","InputCheckbox","labelValue","handleChange","labelElement","defaultChecked","onChange","StepConsentForm","policyCheckBoxLabel","rel","polictCheckboxValidation","validate","shouldBeTrue","val","StepSummarySection","Phone","setStepInContext","st","dataLine1","dataLine2","dataLine3","enquiry","Table2","ConsentForm","StepConfirm","_useSubmitForm","useEffect","SummarySection","EmailAlert","ExistingUser","Step9ConsentForm","useTrackFormAbandonment","formSubmitStatus","fieldsChanged","setFieldsChanged","form","document","querySelector","lastChangedEle","e","_toConsumableArray","addEventListener","removeEventListener","formAbandoned","join","Form","scrollToTopOfSummary","useCallback","page","getElementsByClassName","pageOffset","scrollTop","formOffset","methods","useForm","mode","stepToGoTo","FormProvider","s","formWrapper","SharedName","SharedContact","SharedEnquiry","GeneralConfirmation","SubmitSuccess","SubmitError","App","isFormStarted","setIsRecoverLinkPressed","_useState5","_useState6","Boolean","hostname","match","ReactDOM","render","React","StrictMode","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"+HACAA,EAAOC,QAAU,CAAC,YAAc,0BAA0B,YAAc,0B,4GCKlEC,EAAO,SAAHC,GAAiC,IAA3BC,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R,GAAG,MAEN9B,SAAS0C,eAAe,SDmHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB7G,MAAK,SAAC8G,GACLA,EAAaC,YACf,IACCpG,OAAM,SAACC,GACNE,QAAQF,MAAMA,EAAM9D,QACtB,G","file":"static/js/main.b562dfbc.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"formWrapper\":\"Form_formWrapper__1i880\",\"wmcadsMlxxl\":\"Form_wmcadsMlxxl__2mPgI\"};","import React from 'react';\nimport PropTypes from 'prop-types';\n\n// Due to weird Protocol errors with external SVGs the svg use doesn't work well with production builds\n// So we Ajax the SVG in with a snippet at the bottom of public/index.html\n\nconst Icon = ({ className, iconName }) => {\n return (\n \n \n \n );\n};\n\nIcon.propTypes = {\n iconName: PropTypes.string.isRequired,\n className: PropTypes.string,\n};\n\nIcon.defaultProps = {\n className: null,\n};\n\nexport default Icon;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\n// Import components\nimport Icon from '../shared/Icon/Icon';\n\nconst Intro = ({ setIsFormStarted }) => {\n const handleClick = () => {\n setIsFormStarted(true);\n };\n\n return (\n
\n

Contact us

\n

\n You’ll need to contact Transport for West Midlands if your enquiry is about information,\n journey planning and transport disruptions.\n

\n

\n You’ll need to contact your local council if your enquiry is about general council services.\n For example, bin collections and council tax.\n

\n\n

Find who you need to contact

\n

\n Answer questions and we'll direct you to the right team so we can respond to your query\n faster.\n

\n\n \n Start now\n \n \n
\n );\n};\nIntro.propTypes = {\n setIsFormStarted: PropTypes.func.isRequired,\n};\nexport default Intro;\n","const url = new URL(typeof window !== 'undefined' ? window.location.href : ''); // Set URL to current if browser window is detected\n\n// Function for getting the value of a search param in the URL\nconst getSearchParam = (name) => {\n return url.searchParams.get(name); // Get the search param value for name passed in, and return back\n};\n\n// Function for setting the value of a search param in the URL\nconst setSearchParam = (name, val) => {\n url.searchParams.set(name, val); // Set the search param with the name provided to the value provided\n window.history.pushState({}, '', url.href); // Then push the updated search params back to the URL\n};\n\n// Function for deleting a search param in the URL\nconst delSearchParam = (name) => {\n url.searchParams.delete(name); // Delete the search param for the name provided\n window.history.pushState({}, '', url.href); // Then push the updated search params back to the URL\n};\n\nexport { getSearchParam, setSearchParam, delSearchParam }; // Return functions, so they can be called independently\n","import React, { useReducer, createContext } from 'react';\nimport { getSearchParam } from 'helpers/URLSearchParams';\n\nexport const FormDataContext = createContext();\n\nexport const FormDataProvider = (props) => {\n const { children } = props || {};\n\n let FirstName = null;\n let LastName = null;\n const UrlName = getSearchParam('name');\n\n if (UrlName && decodeURI(UrlName)) {\n [FirstName, LastName] = decodeURI(UrlName).split(' ');\n }\n\n // Set intial state of when\n const initialState = {\n currentStep: getSearchParam('email') && getSearchParam('email').length > 0 ? 3 : 1,\n formData: {\n Firstname: FirstName,\n LastName,\n },\n hasReachedConfirmation: false,\n };\n\n // Set up a reducer so we can change state based on centralised logic here\n const reducer = (state, action) => {\n // Update the point to chosen\n switch (action.type) {\n // Remove the waypoint by the id\n case 'UPDATE_FORM_DATA': {\n return {\n ...state,\n formData: { ...state.formData, ...action.payload },\n };\n }\n\n // Remove the waypoint by the id\n case 'UPDATE_STEP': {\n return {\n ...state,\n currentStep: action.payload,\n };\n }\n\n case 'REACHED_CONFIRMATION': {\n return {\n ...state,\n hasReachedConfirmation: action.payload,\n };\n }\n\n // Default should return intial state if error\n default:\n return initialState;\n }\n };\n\n // Set up reducer using reducer logic and initialState by default\n const [formState, formDispatch] = useReducer(reducer, initialState);\n\n // Pass state and dispatch in context and make accessible to children it wraps\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\n// import Icon from '../Icon/Icon';\n\nconst GenericError = () => {\n return (\n
\n
\n {/* */}\n

There is a problem

\n
\n\n
Please check your answers again.
\n
\n );\n};\n\nexport default GenericError;\n","// Import packages\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from 'components/shared/Icon/Icon';\n\nconst Button = ({\n btnClass,\n disabled,\n iconLeft,\n iconRight,\n isActive,\n isFetching,\n onClick,\n text,\n title,\n type,\n}) => {\n return (\n // eslint-disable-next-line react/button-has-type\n \n {/* If icon left is set then call icon component and inject correct svg */}\n {iconLeft ? : null}\n\n {/* button text will go here, if any */}\n {text}\n\n {/* If API is fetching show spinner on button */}\n {isFetching ? (\n \n

Content is loading...

\n \n ) : (\n /* If icon right is set then call icon component and inject correct svg */\n iconRight && \n )}\n \n );\n};\n\n// Set props\nButton.propTypes = {\n btnClass: PropTypes.string, // Set custom button classes, will default to ds-btn (primary btn)\n disabled: PropTypes.bool, // Sets if the button is disabled or not\n iconLeft: PropTypes.string, // Set icon left on button\n iconRight: PropTypes.string, // Set icon right on button\n isActive: PropTypes.bool, // If button is active, add active class\n isFetching: PropTypes.bool,\n onClick: PropTypes.func, // Set an onclick event\n text: PropTypes.string, // text inside button\n type: PropTypes.string, // button type, by default it is type=\"button\"\n title: PropTypes.string, // title on the button\n};\n\nButton.defaultProps = {\n btnClass: '',\n disabled: false,\n iconLeft: null,\n iconRight: null,\n isActive: false,\n isFetching: false,\n onClick: null,\n text: '',\n title: null,\n type: 'button',\n};\n\nexport default Button;\n","import React, { useState, useContext } from 'react';\nimport { useFormContext } from 'react-hook-form';\n// Import contexts\nimport { FormDataContext } from 'globalState/FormDataContext';\n// Import components\nimport GenericError from 'components/shared/Errors/GenericError';\nimport Button from 'components/shared/Button/Button';\n\nconst useStepLogic = (formRef) => {\n const { register, errors, trigger, getValues } = useFormContext(); // Get useForm methods\n const [formDataState, formDataDispatch] = useContext(FormDataContext); // Get the state/dispatch of form data from FormDataContext\n const [isContinuePressed, setIsContinuePressed] = useState(false); // State for tracking if continue has been pressed\n\n // Function for setting the step of the form\n const setStep = (step) => {\n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: step,\n });\n };\n\n // Update the current step to the correct one depending on users selection\n const handleSubmit = async (event) => {\n event.preventDefault();\n const result = await trigger();\n setIsContinuePressed(true);\n // if no errors\n if (result) {\n setStep(formDataState.hasReachedConfirmation ? 4 : formDataState.currentStep + 1);\n\n if (Object.keys(getValues()).includes('UploadInvitation')) {\n const payload = getValues();\n\n // upload ticket key is no longer needed\n delete payload.UploadInvitation;\n\n const file = getValues('UploadInvitation')[0];\n\n const PhotoName = file.name;\n\n const PhotoExtension = file.type.split('/')[1]; // => image/png (split at '/' and grab second part 'png')\n // Start base64'n our uploaded image\n const reader = new FileReader(); // Start new file reader\n reader.readAsDataURL(file); // Read file as dataURL\n\n // When loaded\n reader.onloadend = () => {\n // Since it contains the Data URI, we should remove the prefix and keep only Base64 string\n const PhotoBase64 = reader.result.replace(/^data:.+;base64,/, '');\n\n // Update our formData with the base64Extension and Base64 photo\n formDataDispatch({\n type: 'UPDATE_FORM_DATA',\n payload: { ...payload, PhotoName, PhotoExtension, PhotoBase64 },\n });\n };\n }\n\n formDataDispatch({ type: 'UPDATE_FORM_DATA', payload: getValues() });\n }\n // else, errors are true...\n else {\n window.scrollTo(0, formRef.current.offsetTop); // Scroll to top of form\n }\n };\n\n // Continue button\n const continueButton = (isFetching) => (\n \n );\n\n // If errors object has any keys and continue button is pressed then we should show generic error component\n const showGenericError = Object.keys(errors).length > 0 && isContinuePressed && ;\n\n return {\n setStep,\n register,\n handleSubmit,\n showGenericError,\n continueButton,\n formDataState,\n formDataDispatch,\n };\n};\n\nexport default useStepLogic;\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport dompurify from 'dompurify';\n// Import contexts\nimport { useFormContext } from 'react-hook-form';\nimport { FormDataContext } from 'globalState/FormDataContext';\n\nconst { sanitize } = dompurify;\n\nconst Textarea = ({\n className,\n fieldValidation,\n inputmode,\n label,\n name,\n spellcheck,\n type,\n APIerrors,\n}) => {\n const [formDataState] = useContext(FormDataContext); // Get the state of form data from FormDataContext\n const { errors } = useFormContext();\n // Set input to render below\n const input = (\n <>\n \n \n );\n\n return (\n
\n {label && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n \n )}\n {/* If there is an API error, show here */}\n {APIerrors}\n\n {/* If there is an error (and error is a string) show here */}\n {errors[name] && typeof errors[name].message === 'string' && (\n \n )}\n {/* If there is an error (and error is a react element) show here */}\n {errors[name] && typeof errors[name].message !== 'string' && errors[name].message}\n\n {/* If className then wrap just input with the className else, just show input as usual */}\n {className ?
{input}
: input}\n
\n );\n};\n\nTextarea.propTypes = {\n className: PropTypes.string,\n fieldValidation: PropTypes.func,\n inputmode: PropTypes.string,\n label: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n spellcheck: PropTypes.bool,\n type: PropTypes.string,\n APIerrors: PropTypes.element,\n};\n\nTextarea.defaultProps = {\n className: '',\n fieldValidation: null,\n inputmode: 'text',\n spellcheck: false,\n type: 'text',\n APIerrors: null,\n};\n\nexport default Textarea;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction SectionStepInfo(props) {\n const { section, description } = props;\n return (\n
\n {section}\n

{description}

\n
\n );\n}\n\nSectionStepInfo.propTypes = {\n section: PropTypes.string.isRequired,\n description: PropTypes.string,\n};\n\nSectionStepInfo.defaultProps = {\n description: null,\n};\n\nexport default SectionStepInfo;\n","import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\n// Import custom hooks\nimport useStepLogic from 'components/Form/useStepLogic';\n// Import components\nimport Input from 'components/shared/FormElements/Input/textarea';\nimport SectionStepInfo from 'components/shared/SectionStepInfo/SectionStepInfo';\n// import useFormData from '../../useFormData';\n\nconst Enquiry = (props) => {\n const formRef = useRef(); // Used so we can keep track of the form DOM element\n const { register, handleSubmit, showGenericError, continueButton } = useStepLogic(formRef); // Custom hook for handling continue button (validation, errors etc)\n const { summary } = props;\n\n // Check it we are facing an existing user\n // const { ExistingUser } = useFormData();\n\n // Labels used on inputs and for validation\n const label = 'Your enquiry';\n\n // Logic used to validate fields\n const fieldValidation = (name) => {\n return register({ required: `${name} is required` });\n };\n\n return (\n
\n {/* Subsection */}\n \n\n {/* Show generic error message */}\n {showGenericError}\n\n
\n \n {/*

{legend}

*/}\n

{summary}

\n
\n\n \n
\n {/* Continue button */}\n {continueButton()}\n \n );\n};\n\nEnquiry.propTypes = {\n summary: PropTypes.string,\n};\n\nEnquiry.defaultProps = {\n summary: '',\n};\n\nexport default Enquiry;\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport dompurify from 'dompurify';\n// Import contexts\nimport { useFormContext } from 'react-hook-form';\nimport { FormDataContext } from 'globalState/FormDataContext';\n\nconst { sanitize } = dompurify;\n\nconst Input = ({\n autocomplete,\n className,\n fieldValidation,\n inputmode,\n label,\n name,\n spellcheck,\n type,\n APIerrors,\n}) => {\n const [formDataState] = useContext(FormDataContext); // Get the state of form data from FormDataContext\n const { errors } = useFormContext();\n // Set input to render below\n const input = (\n <>\n \n \n );\n\n return (\n
\n {label && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n \n )}\n {/* If there is an API error, show here */}\n {APIerrors}\n\n {/* If there is an error (and error is a string) show here */}\n {errors[name] && typeof errors[name].message === 'string' && (\n \n )}\n {/* If there is an error (and error is a react element) show here */}\n {errors[name] && typeof errors[name].message !== 'string' && errors[name].message}\n\n {/* If className then wrap just input with the className else, just show input as usual */}\n {className ?
{input}
: input}\n
\n );\n};\n\nInput.propTypes = {\n autocomplete: PropTypes.string,\n className: PropTypes.string,\n fieldValidation: PropTypes.func,\n inputmode: PropTypes.string,\n label: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n spellcheck: PropTypes.bool,\n type: PropTypes.string,\n APIerrors: PropTypes.element,\n};\n\nInput.defaultProps = {\n autocomplete: null,\n className: '',\n fieldValidation: null,\n inputmode: 'text',\n spellcheck: false,\n type: 'text',\n APIerrors: null,\n};\n\nexport default Input;\n","import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\n// Import components\nimport Input from 'components/shared/FormElements/Input/Input';\nimport SectionStepInfo from 'components/shared/SectionStepInfo/SectionStepInfo';\n// Import custom hooks\nimport useStepLogic from 'components/Form/useStepLogic';\n\nconst Contact = (props) => {\n const formRef = useRef(); // Used so we can keep track of the form DOM element\n const { register, handleSubmit, showGenericError, continueButton } = useStepLogic(formRef); // Custom hook for handling continue button (validation, errors etc)\n const { summary } = props;\n\n // Labels used on inputs and for validation\n const emailLabel = 'Email address';\n // Logic used to validate the email field\n const emailRegex =\n /^[\\w!#$%&'*+\\-/=?^_`{|}~]+(\\.[\\w!#$%&'*+\\-/=?^_`{|}~]+)*@((([-\\w]+\\.)+[a-zA-Z]{2,4})|(([0-9]{1,3}\\.){3}[0-9]{1,3}))$/; // Matches email regex on server\n\n // email validation\n const emailValidation = register({\n required: `${emailLabel} is required`,\n pattern: {\n value: emailRegex,\n message: `Enter an ${emailLabel.toLowerCase()} in the correct format`,\n },\n });\n\n // email input src\n const emailInputSrc = (\n For example, name@example.com\"\n autocomplete=\"given-name\"\n fieldValidation={emailValidation}\n />\n );\n\n return (\n
\n {/* Subsection */}\n \n\n {/* Show generic error message */}\n {showGenericError}\n\n
\n
\n

What is your Email Address?

\n

{summary}

\n
\n {emailInputSrc}\n
\n\n {/* Continue button */}\n {continueButton()}\n \n );\n};\n\nContact.propTypes = {\n summary: PropTypes.string,\n};\n\nContact.defaultProps = {\n summary: '',\n};\n\nexport default Contact;\n","/* eslint-disable jsx-a11y/label-has-associated-control */\nimport React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\n// Import custom hooks\nimport useStepLogic from 'components/Form/useStepLogic';\n// Import components\nimport Input from 'components/shared/FormElements/Input/Input';\nimport SectionStepInfo from 'components/shared/SectionStepInfo/SectionStepInfo';\n\nconst Name = (props) => {\n const formRef = useRef(); // Used so we can keep track of the form DOM element\n const { register, handleSubmit, showGenericError, continueButton } = useStepLogic(formRef); // Custom hook for handling continue button (validation, errors etc)\n const { summary } = props;\n\n // Labels used on inputs and for validation\n const fNameLabel = 'First name';\n const lNameLabel = 'Last name';\n\n // Logic used to validate fields\n const fieldValidation = (name) => {\n return register({ required: `${name} is required` });\n };\n\n return (\n
\n {/* Subsection */}\n \n\n {/* Show generic error message */}\n {showGenericError}\n\n
\n \n

What is your name?

\n

{summary}

\n
\n\n \n \n
\n\n {/* Continue button */}\n {continueButton()}\n \n );\n};\n\nName.propTypes = {\n summary: PropTypes.string,\n};\n\nName.defaultProps = {\n summary: '',\n};\n\nexport default Name;\n","import React from 'react';\n\nfunction Success() {\n // eslint-disable-next-line no-unused-vars\n\n const title = 'We’ve received your enquiry';\n\n return (\n
\n
\n
\n

{title}

\n
\n\n
\n

What happens next

\n

Thank you for contacting Midlands Connect.

\n

We will acknowledge your query and keep you updated on progress.

\n
\n
\n
\n );\n}\n\nexport default Success;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction Error({ isRecoverLinkPressed }) {\n const title = isRecoverLinkPressed\n ? 'Request a link to manage your disruption alerts'\n : 'Contact us form';\n return (\n
\n
\n
\n

{title}

\n
\n
\n {/* Error message */}\n

Sorry, there is a problem with this service

\n

Try again later.

\n

\n We have not saved your answers. When the service is available, you will have to start\n again.\n

\n

\n Contact the{' '}\n \n Customer Services team\n {' '}\n if you continue to have problems.\n

\n
\n
\n
\n );\n}\n\nError.propTypes = {\n isRecoverLinkPressed: PropTypes.bool.isRequired,\n};\n\nexport default Error;\n","import { useState, useContext } from 'react';\nimport axios from 'axios';\nimport { useFormContext } from 'react-hook-form';\n// Import contexts\nimport { FormDataContext } from 'globalState/FormDataContext';\n\nconst useSubmitForm = (setFormSubmitStatus) => {\n const [formDataState] = useContext(FormDataContext); // Get the state/dispatch of form data from FormDataContext\n const { trigger } = useFormContext(); // Get useForm methods\n const [isFetching, setIsFetching] = useState(false);\n const [APIErrorMessage, setAPIErrorMessage] = useState(null);\n\n // Destructure values from our formDataState (get all users values)\n const { ContactEmail, Firstname, LastName, Enquiry } = formDataState.formData;\n\n // Map all destructured vals above to an object we will send to API\n let dataToSend = {};\n const file = [];\n\n dataToSend = {\n 'First Name': Firstname,\n 'Last Name': LastName,\n Email: ContactEmail,\n Enquiry,\n };\n\n const handleSubmit = async (event) => {\n event.preventDefault(); // Prevent default form submission method\n // Validation\n const result = await trigger();\n // if no errors\n if (result) {\n // Start submitting API\n setIsFetching(true); // Set this so we can put loading state on button\n\n // Go hit the API with the data\n axios({\n method: 'post',\n url: `${process.env.REACT_APP_API_HOST}/emails/api/email`,\n data: JSON.stringify({\n to: 18,\n body: JSON.stringify(dataToSend),\n from: `${ContactEmail}`,\n subject: `Midlands Connect Contact Form`,\n files: file,\n displayName: `${Firstname} ${LastName}`,\n }),\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then((response) => {\n // If the response is successful(200: OK) or error with validation message(400)\n if (response.status === 200 || response.status === 400) {\n const payload = response.config.data;\n\n // Log event to analytics/tag manager\n window.dataLayer.push({\n event: 'formAbandonment',\n eventCategory: 'ds-contact-us',\n eventAction: 'form submitted: success',\n eventLabel: 'success',\n });\n setIsFetching(false); // set to false as we are done fetching now\n if (payload.Message) {\n setAPIErrorMessage(payload.Message);\n } else {\n setFormSubmitStatus(true); // Set form status to success\n window.scrollTo(0, 0); // Scroll to top of page\n // set success page\n }\n return true;\n }\n throw new Error(response.statusText, response.Message); // Else throw error and go to our catch below\n })\n\n // If formsubmission errors\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error({ error });\n let errMsg;\n\n if (error.text) {\n error.text().then((errorMessage) => {\n errMsg = errorMessage;\n });\n } else {\n errMsg = error;\n }\n\n // Log event to analytics/tag manager\n window.dataLayer.push({\n event: 'formAbandonment',\n eventCategory: 'ds-contact-us',\n eventAction: 'form submitted: error',\n eventLabel: errMsg,\n });\n setIsFetching(false); // set to false as we are done fetching now\n setFormSubmitStatus(false); // Set form status to error\n window.scrollTo(0, 0); // Scroll to top of page\n // set error message\n });\n }\n };\n\n // Return handleSubmit and isFetching so it can be used by form\n return {\n handleSubmit,\n isFetching,\n APIErrorMessage,\n };\n};\n\nexport default useSubmitForm;\n","/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport PropTypes, { arrayOf } from 'prop-types';\n\nfunction Table({ title, caption, headers, values, classes, cellClasses }) {\n const noHeadersClass = headers && headers.lenght > 0 ? '' : 'ds-table--without-header';\n\n return (\n <>\n {title &&

{title}

}\n \n {caption && }\n {headers && headers.lenght > 0 && (\n \n \n {headers.map((value, index) => {\n return (\n \n );\n })}\n \n \n )}\n\n {values && (\n \n {values.map((line, lineIndex) => {\n return (\n \n {line.map((col, index) => {\n if (index === 0)\n return (\n \n {col}\n \n );\n return (\n \n );\n })}\n \n );\n })}\n \n )}\n
{caption}
\n {value}\n
\n {col}\n
\n \n );\n}\n\nTable.propTypes = {\n title: PropTypes.string,\n caption: PropTypes.string,\n headers: PropTypes.arrayOf(PropTypes.element),\n values: PropTypes.arrayOf(arrayOf(PropTypes.element)),\n classes: PropTypes.string,\n cellClasses: PropTypes.arrayOf(PropTypes.string),\n};\nTable.defaultProps = {\n headers: [],\n values: [[]],\n title: null,\n caption: null,\n classes: null,\n cellClasses: null,\n};\n\nexport default Table;\n","/* eslint-disable react/no-array-index-key */\nimport React from 'react';\nimport PropTypes, { arrayOf } from 'prop-types';\n\nfunction Table({ title, caption, headers, values, classes, cellClasses }) {\n const noHeadersClass = headers && headers.lenght > 0 ? '' : 'ds-table--without-header';\n\n return (\n <>\n {title &&

{title}

}\n \n {caption && }\n {headers && headers.lenght > 0 && (\n \n \n {headers.map((value, index) => {\n return (\n \n );\n })}\n \n \n )}\n\n {values && (\n \n {values.map((line, lineIndex) => {\n return (\n \n {line.map((col, index) => {\n if (index === 0)\n return (\n \n {col}\n \n );\n return (\n \n );\n })}\n \n );\n })}\n \n )}\n
{caption}
\n {value}\n
\n {col}\n
\n \n );\n}\n\nTable.propTypes = {\n title: PropTypes.string,\n caption: PropTypes.string,\n headers: PropTypes.arrayOf(PropTypes.element),\n values: PropTypes.arrayOf(arrayOf(PropTypes.element)),\n classes: PropTypes.string,\n cellClasses: PropTypes.arrayOf(PropTypes.string),\n};\nTable.defaultProps = {\n headers: [],\n values: [[]],\n title: null,\n caption: null,\n classes: null,\n cellClasses: null,\n};\n\nexport default Table;\n","/* eslint-disable jsx-a11y/label-has-associated-control */\nimport React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport dompurify from 'dompurify';\n\n// Import contexts\nimport { useFormContext } from 'react-hook-form';\nimport { FormDataContext } from 'globalState/FormDataContext';\n\nimport Icon from '../../Icon/Icon';\n\nconst { sanitize } = dompurify;\n\nconst InputCheckbox = ({\n fieldValidation,\n name,\n labelValue,\n handleChange,\n labelElement,\n classes,\n}) => {\n const [formDataState] = useContext(FormDataContext); // Get the state of form data from FormDataContext\n const { errors } = useFormContext();\n // Set input to render below\n\n return (\n
\n {errors[name] && (\n \n )}\n\n \n
\n );\n};\n\nInputCheckbox.propTypes = {\n labelValue: PropTypes.string,\n fieldValidation: PropTypes.func,\n handleChange: PropTypes.func,\n name: PropTypes.string.isRequired,\n classes: PropTypes.string,\n labelElement: PropTypes.element,\n};\n\nInputCheckbox.defaultProps = {\n labelValue: null,\n labelElement: null,\n handleChange: null,\n fieldValidation: null,\n classes: null,\n};\n\nexport default InputCheckbox;\n","import React, { useRef } from 'react';\n// Import custom hooks\nimport useStepLogic from 'components/Form/useStepLogic';\n// Import components\nimport InputCheckbox from '../../../shared/FormElements/Input/InputCheckbox';\n\nconst StepConsentForm = () => {\n const formRef = useRef(); // Used so we can keep track of the form DOM element\n const { register } = useStepLogic(formRef); // Custom hook for handling continue button (validation, errors etc)\n\n // Labels used on inputs and for validation\n // const checkBoxLabel = (\n // <>\n // Agree to the  \n // \n // terms and conditions\n // \n //  \n // \n // );\n const policyCheckBoxLabel = (\n <>\n Agree to the  \n \n privacy policy\n \n  \n \n );\n\n // Logic used to validate the terms field\n // const checkboxValidation = register({\n // required: 'Agree to terms and conditions before continue',\n // validate: {\n // shouldBeTrue: (val) => val === true || 'Agree to terms and conditions before continue',\n // },\n // });\n // Logic used to validate the policy field\n const polictCheckboxValidation = register({\n required: 'Agree to privacy policy before continue',\n validate: {\n shouldBeTrue: (val) => val === true || 'Agree to privacy policy before continue',\n },\n });\n\n return (\n
\n {/* */}\n \n
\n );\n};\n\nexport default StepConsentForm;\n","import React, { useContext } from 'react';\n// Hooks\n\n// Context\nimport { FormDataContext } from 'globalState/FormDataContext';\n// Components\nimport Table from 'components/shared/Table/Table';\nimport Table2 from 'components/shared/Table/Table-2-col';\nimport ConsentForm from './StepConsentForm';\n\nfunction StepSummarySection() {\n const [formDataState, formDataDispatch] = useContext(FormDataContext);\n const { Firstname, LastName, Enquiry, ContactEmail, Phone } = formDataState.formData;\n\n const setStepInContext = (st) => {\n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: st,\n });\n };\n\n const title = 'Check your answers';\n\n /* Table Data */\n\n // enquiry\n const dataLine1 = [];\n if (Enquiry) {\n dataLine1.push({Enquiry});\n dataLine1.push(\n {\n setStepInContext(3);\n }}\n >\n Change\n \n );\n }\n\n // name\n const dataLine2 = [];\n dataLine2.push(Name);\n dataLine2.push({`${Firstname} ${LastName}`});\n dataLine2.push(\n {\n setStepInContext(1);\n }}\n >\n Change\n \n );\n\n // contact information\n const dataLine3 = [];\n dataLine3.push(What is your Email Address?);\n if (ContactEmail !== null) {\n dataLine3.push({ContactEmail});\n }\n\n dataLine3.push(\n {\n setStepInContext(2);\n }}\n >\n Change\n \n );\n\n /* End of Table Data */\n\n const enquiry = [dataLine1];\n const data = [dataLine2, dataLine3];\n\n if (Phone) {\n data.push(dataLine3);\n }\n\n return (\n <>\n
\n

{title}

\n \n\n \n\n

Now send your enquiry

\n

\n By submitting this enquiry you are confirming that, to the best of your knowledge, the\n details you are providing are correct.\n

\n \n
\n \n );\n}\n\nexport default StepSummarySection;\n","/* eslint-disable jsx-a11y/label-has-associated-control */\nimport React, { useEffect, useContext } from 'react';\nimport PropTypes from 'prop-types';\n// Import custom hooks\nimport useSubmitForm from '../../useSubmitForm';\nimport SummarySection from './StepSummarySection';\nimport Step9ConsentForm from './StepConsentForm';\nimport { FormDataContext } from '../../../../globalState/FormDataContext';\nimport Button from '../../../shared/Button/Button';\n\nfunction StepConfirm({ setFormSubmitStatus }) {\n const [formDataState, formDataDispatch] = useContext(FormDataContext);\n // Get handleSubmit fn and isFetching from custom hook which handles submitting data to API (this is used in the last step[4])\n const { handleSubmit, isFetching, APIErrorMessage } = useSubmitForm(setFormSubmitStatus);\n useEffect(() => {\n if (formDataState.currentStep === 4) {\n formDataDispatch({\n type: 'REACHED_CONFIRMATION',\n payload: true,\n });\n }\n }, [formDataDispatch, formDataState.currentStep]);\n\n return (\n
\n {/* If we get any errors back from the server, show here */}\n {APIErrorMessage && {APIErrorMessage}}\n \n\n
\n {formDataState.formData.EmailAlert === 'yes' && !formDataState.formData.ExistingUser && (\n \n )}\n \n
\n \n );\n}\n\nStepConfirm.propTypes = {\n setFormSubmitStatus: PropTypes.func.isRequired,\n};\n\nexport default StepConfirm;\n","// Form abandonment tracking (https://www.simoahava.com/analytics/track-form-abandonment-with-google-tag-manager/)\nimport { useEffect, useState } from 'react';\n// Import contexts\n\nconst useTrackFormAbandonment = (currentStep, formSubmitStatus) => {\n const [fieldsChanged, setFieldsChanged] = useState([]); // Track fields the user has touched/changed\n\n window.dataLayer = window.dataLayer || []; // Set datalayer (GA thing)\n\n // This useEffect is used to track form changes and update the fieldsChanged state as the user progresses\n useEffect(() => {\n const form = document.querySelector('form'); // Get DOM node of form\n // Function to work out last changed element in form\n const lastChangedEle = (e) => {\n // Update fields changed array with step number and last changed field name i.e. Step1: CustomerType > Step3: CardNumber\n setFieldsChanged([...fieldsChanged, `Step${currentStep}: ${e.target.name}`]);\n };\n // Listen to changes in form and run above function\n if (form) form.addEventListener('change', lastChangedEle);\n // On unmount, remove listener\n return () => {\n if (form) form.removeEventListener('change', lastChangedEle);\n };\n }, [currentStep, fieldsChanged]);\n\n // Used to update Google Tag Manager\n useEffect(() => {\n // Function for updating datalayer with correct data\n const formAbandoned = () => {\n // If there is a current step and no form submit status then it means the user is still in progress of filling in the form, so we can log that as a true abandonment\n if (currentStep && !formSubmitStatus) {\n // Push abandoned event to GA/Tag Manager\n window.dataLayer.push({\n event: 'formAbandonment',\n eventCategory: 'ds-contact-us',\n eventAction: 'form abandonded',\n eventLabel: fieldsChanged\n ? fieldsChanged.join(' > ')\n : 'Clicked start, but abandoned straight away.', // If fieldsChanged (set in first useEffect) is available then use that and join with ' > ' so it logs as 'Step1: ... > Step2: ... >' ELSE the user must of abandoned without updating the form in step 1 so log message\n });\n }\n };\n\n window.addEventListener('beforeunload', formAbandoned); // Run above function only when the user is leaving the page\n\n // On unmount, remove listener\n return () => {\n window.removeEventListener('beforeunload', formAbandoned);\n };\n }, [currentStep, fieldsChanged, formSubmitStatus]);\n\n // Sends a form started to analytics\n useEffect(() => {\n if (currentStep) {\n window.dataLayer.push({\n event: 'formAbandonment',\n eventCategory: 'ds-contact-us',\n eventAction: 'form started',\n eventLabel: true,\n });\n }\n }, [currentStep]);\n};\n\nexport default useTrackFormAbandonment;\n","import React, { useContext, useEffect, useRef, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { useForm, FormProvider } from 'react-hook-form';\n// Import contexts\nimport { FormDataContext } from 'globalState/FormDataContext';\n\n// Import components\nimport SharedEnquiry from './Shared/Enquiry/Enquiry';\nimport SharedContact from './Shared/Contact/Contact';\nimport SharedName from './Shared/Name/Fieldset/Name';\nimport SubmitSuccess from './SubmitConfirmation/Success';\nimport SubmitError from './SubmitConfirmation/Error';\nimport GeneralConfirmation from './StepConfirm/General/StepConfirm';\n\n// Custom Hooks\nimport useTrackFormAbandonment from './useTrackFormAbandonment';\n\n// Import styling\nimport s from './Form.module.scss';\n\nconst Form = ({ formSubmitStatus, setFormSubmitStatus, isRecoverLinkPressed }) => {\n // Handle scrolling to the top of the summary page\n const formRef = useRef();\n const scrollToTopOfSummary = useCallback(() => {\n const page = document.getElementsByClassName('ds-html')[0];\n const pageOffset = page.scrollTop;\n const formOffset = formRef.current.offsetTop;\n if (formOffset >= pageOffset) return;\n page.scrollTo(0, formOffset - 20);\n }, []);\n\n const [formDataState, formDataDispatch] = useContext(FormDataContext); // Get the state/dispatch of form data from FormDataContext\n const { currentStep } = formDataState; // Destructure step from state\n // const { EnquiryType, StrategyEnquiry, MayorEnquiry, OtherEnquiry } = formDataState.formData;\n const methods = useForm({\n mode: 'onBlur',\n }); // Trigger validation onBlur events (config for react hook form lib)\n\n useEffect(() => {\n if (currentStep === 9) scrollToTopOfSummary();\n }, [currentStep, scrollToTopOfSummary]);\n\n useEffect(() => {\n if (isRecoverLinkPressed) {\n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: 0,\n });\n }\n }, [formDataDispatch, isRecoverLinkPressed]);\n\n useTrackFormAbandonment(currentStep, formSubmitStatus);\n\n // Show debug options for below (this should be deleted on release)\n const debugStepOptions = [0, 1, 2, 3, 4, 5, 6];\n\n let stepToGoTo;\n\n if (currentStep > 1 && currentStep < 6) {\n stepToGoTo = currentStep - 1;\n }\n\n return (\n <>\n {/* pass all methods into the context */}\n {/* eslint-disable-next-line react/jsx-props-no-spreading */}\n \n
\n {stepToGoTo && (\n
\n \n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: stepToGoTo,\n })\n }\n >\n < Back\n \n
\n )}\n\n \n {/* Start of form */}\n {currentStep === 1 && }\n {currentStep === 2 && }\n {currentStep === 3 && }\n {currentStep === 4 && }\n\n {/* for testing only */}\n {currentStep === 5 && }\n {currentStep === 6 && }\n
\n \n {/* If in development based on envs then show form debugging */}\n {process.env.NODE_ENV !== 'production' && (\n \n
{JSON.stringify(formDataState, null, 2)}
\n
\n
\n Select step: {}\n \n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: +e.target.value,\n })\n }\n onBlur={(e) =>\n formDataDispatch({\n type: 'UPDATE_STEP',\n payload: +e.target.value,\n })\n }\n value={currentStep}\n >\n {debugStepOptions.map((option) => (\n \n ))}\n \n
\n \n )}\n
\n \n );\n};\n\nForm.propTypes = {\n formSubmitStatus: PropTypes.bool,\n setFormSubmitStatus: PropTypes.func.isRequired,\n setIsFormStarted: PropTypes.func.isRequired,\n isRecoverLinkPressed: PropTypes.bool,\n setIsRecoverLinkPressed: PropTypes.func.isRequired,\n};\n\nForm.defaultProps = {\n formSubmitStatus: null,\n isRecoverLinkPressed: false,\n};\n\nexport default Form;\n","import React, { useState } from 'react';\n// import HeaderAndBreadcrumb from './components/HeaderAndBreadCrumb';\nimport Intro from './components/Introduction/Introduction';\nimport Form from './components/Form/Form';\n// Import contexts\nimport { FormDataProvider } from './globalState/FormDataContext';\n\nimport SubmitSuccess from './components/Form/SubmitConfirmation/Success';\n\nfunction App() {\n const [isFormStarted, setIsFormStarted] = useState(true);\n const [isRecoverLinkPressed, setIsRecoverLinkPressed] = useState(false);\n const [formSubmitStatus, setFormSubmitStatus] = useState(null);\n\n return (\n <>\n {/* */}\n
\n {!isFormStarted ? (\n \n ) : (\n \n {isFormStarted && formSubmitStatus === null && (\n \n )}\n\n {formSubmitStatus && }\n \n )}\n
\n \n );\n}\n\nexport default App;\n","/* eslint-disable no-console */\n\n// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log('No internet connection found. App is running in offline mode.');\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","// IE 11 support\nimport 'react-app-polyfill/ie11';\nimport 'react-app-polyfill/stable';\n// React\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n// Components\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}