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rand/index.js","webpack://_N_E/./src/components/base/v1/Final EPQ/FinalEpq.module.scss","webpack://_N_E/./src/components/shared/AddressFormBrand/AddressForm.module.scss"],"sourcesContent":["import React, { useRef } from 'react';\nimport styles from './FinalEpq.module.scss';\nimport AddressForm from '~/components/shared/AddressFormBrand';\nimport Typography from '~/components/shared/Typography';\nimport useIntersectionObserver from '~/helpers/hooks/useIntersectionObserver';\nimport { fireElementViewedEvent } from '~/helpers/utils/fireTagular';\nimport { useMonarchSlotContext } from '@redventures/cohesion-utils-react';\nimport { WhiteHughesnetLogo } from '~/components/icons';\nimport Button from '~/components/shared/Button';\n\nconst BASE_DATA = {\n addressCTACopy: 'Shop plans',\n addressLabelCopy: 'Enter your address to check available plans',\n addressPlaceHolderCopy: 'Enter your address',\n backgroundImage: 'final-epq-banner-hills',\n headline: 'Find out what NEW Hughesnet plan could be right for you',\n headlineTextColor: 'white',\n mapPinIconColor: '#154B8E',\n subhead:\n 'Our plans service across the nation so you can stay connected from wherever you live.',\n subheadTextColor: 'white',\n backgroundColor: '#005dac',\n isEpq: true,\n hasImage: false,\n secondaryCTACopy: 'Learn More',\n epqCopy: 'Shop Plans',\n};\n\nexport default function FinalEpq() {\n const { data: monarchData } = useMonarchSlotContext();\n const data = { ...BASE_DATA, ...monarchData };\n const {\n headlineTextColor,\n subheadTextColor,\n headline,\n subhead,\n backgroundImage,\n hasImage,\n backgroundColor,\n isEpq,\n epqCopy,\n secondaryCTACopy,\n } = data;\n\n //Refs used for eventing & animation\n const finalEpqSection = useRef();\n\n useIntersectionObserver(\n [finalEpqSection],\n () =>\n fireElementViewedEvent(\n 'final epq rebrand',\n 'final epq rebrand section',\n 'final epq rebrand',\n headline\n ),\n undefined,\n { threshold: 0.75 }\n );\n\n const bgImage = backgroundImage\n ? `/images/section/${backgroundImage}.jpg`\n : `/images/section/final-epq-banner.jpg`;\n\n const isPositionRight = backgroundImage == 'final-epq-banner-hills';\n\n return (\n \n {backgroundImage !== 'none' && (\n \n )}\n
\n
\n {hasImage && }\n \n \n \n \n \n \n
\n {isEpq ? (\n
\n \n
\n ) : (\n
\n \n {epqCopy}\n \n \n {secondaryCTACopy}\n \n
\n )}\n
\n \n );\n}\n","import React, { useState, useEffect, useCallback } from 'react';\nimport styles from './AddressForm.module.scss';\nimport Button from '~/components/shared/Button';\nimport { SMARTY_STREETS } from '~/constants/smarty-streets';\nimport SuggestionItems from '~/components/shared/AddressForm/SuggestionList';\nimport Typography from '~/components/shared/Typography';\nimport { addPageAction } from '~/helpers/utils';\nimport { MapPin } from '~/components/icons/MapPin';\nimport { useMedia } from '~/helpers/hooks';\n\nexport default function AddressForm({\n componentLocation,\n metadata = {},\n isHero = false,\n isNav = false,\n isModal = false,\n isUppercase = true,\n}) {\n const {\n mapPinIconColor,\n addressPlaceHolderCopy,\n addressCTACopy,\n addressLabelCopy,\n addressLabelColor,\n mobileAddressCTACopy,\n } = metadata;\n const isMedia = useMedia();\n const [zipCode, setZipCode] = useState('');\n const [address, setAddress] = useState('');\n const [finalAddress, setFinalAddress] = useState({});\n\n const [suggestions, setSuggestions] = useState([]);\n const [disableButton, setDisableButton] = useState(false);\n const [showSuggestions, setShowSuggestions] = useState(false);\n const [activeIdx, setActiveIdx] = useState(0);\n const location = componentLocation ? componentLocation : 'Homepage';\n const position = isHero\n ? 'Hero'\n : isNav\n ? 'Nav'\n : isModal\n ? 'Modal'\n : 'FinalEpq';\n\n const { API_KEY, AUTOCOMPLETE_URL } = SMARTY_STREETS;\n\n const checkFormButton = useCallback(() => {\n if (address && zipCode) {\n setDisableButton(false);\n } else {\n setDisableButton(true);\n }\n });\n\n useEffect(() => {\n checkFormButton();\n }, [zipCode, address, checkFormButton]);\n\n const setCookie = (name, value, exmins) => {\n const d = new Date();\n d.setTime(d.getTime() + exmins * 60 * 1000);\n const expires = `expires=${d.toUTCString()}`;\n document.cookie = `${name}=${value};${expires};path=/`;\n };\n\n const onFormSubmit = async (event) => {\n event.preventDefault();\n if (finalAddress) {\n const userData = {\n street_line: finalAddress.street_line,\n city: finalAddress.city,\n state: finalAddress.state,\n zip: finalAddress.zipcode,\n isUnit: finalAddress.entries > 0,\n unitValue: finalAddress.secondary,\n };\n setCookie('address', JSON.stringify(userData), 30);\n // Tagular track form submitted\n window.tagular('beam', 'FormSubmitted', {\n '@type': 'redventures.usertracking.v3.FormSubmitted',\n formContext: {\n formType: 'Cart CTA',\n formName: `${position}`,\n formId: 'Homepage',\n },\n });\n window.location.href = '/order-online/product-selection/';\n } else {\n //Navigate to order online page\n window.location.href = '/order-online/';\n }\n };\n\n const fetchSuggestions = (query) => {\n fetch(`${AUTOCOMPLETE_URL}${query}`)\n .then((res) => res.json())\n .then((body) => {\n const newSuggestions = body.suggestions.filter(\n (suggestion) => suggestion.state !== 'PR'\n );\n setSuggestions(newSuggestions);\n })\n .catch((error) => {\n addPageAction('addressFormFetchSuggestionsFailed', { error });\n });\n };\n\n const onAddressChange = async (value) => {\n setAddress(value);\n if (!value) {\n setDisableButton(false);\n setAddress('');\n setZipCode('');\n setSuggestions([]);\n setShowSuggestions(false);\n setActiveIdx(0);\n } else {\n const searchQuery = `?auth-id=${API_KEY}&search=${value}&prefer_geolocation=city`;\n\n fetchSuggestions(searchQuery);\n if (suggestions) {\n const uniqueSet = new Set();\n const uniqueAddress = [];\n\n suggestions.map((item) => {\n if (!uniqueSet.has(item.street_line)) {\n uniqueSet.add(item.street_line);\n uniqueAddress.push(item);\n }\n return null;\n });\n setSuggestions(uniqueAddress);\n setShowSuggestions(true);\n setActiveIdx(0);\n } else {\n setShowSuggestions(false);\n }\n }\n };\n\n const onSuggestionClick = async (item) => {\n const selected = `${item.street_line} ${item.secondary} (${item.entries}) ${item.city} ${item.state} ${item.zipcode}`;\n if (item.secondary && item.entries > 1) {\n const searchQuery = `?auth-id=${API_KEY}&search=${item.street_line}&selected=${selected}`;\n\n const suggestions = await fetchSuggestions(searchQuery);\n if (suggestions) {\n setSuggestions(suggestions);\n }\n } else {\n if (item.secondary) {\n setAddress(\n `${item.street_line}, ${item.secondary} - ${item.city}, ${item.state} ${item.zipcode}`\n );\n } else {\n setAddress(\n `${item.street_line} - ${item.city}, ${item.state} ${item.zipcode}`\n );\n }\n setFinalAddress(item);\n setZipCode(item.zipcode);\n setShowSuggestions(false);\n\n // Tagular track suggestion clicked\n window.tagular('beam', 'ElementClicked', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n webElement: {\n location: location,\n position: 'ADDRESS AUTOFILL',\n htmlId: '',\n elementType: 'DROP DOWN',\n text: 'Used Suggestion',\n },\n actionOutcome: 'Internallink',\n });\n\n checkFormButton();\n }\n };\n\n const handleAddressKeyDown = (event) => {\n if (event.keyCode === 27) {\n // handle escape key\n setShowSuggestions(false);\n } else if (event.keyCode === 40) {\n // handle down arrow\n if (activeIdx >= suggestions.length) {\n setActiveIdx(0);\n } else {\n setActiveIdx(activeIdx + 1);\n }\n } else if (event.keyCode === 38) {\n // handle up arrow\n if (activeIdx > 0) {\n setActiveIdx(activeIdx - 1);\n }\n } else if (event.keyCode === 13) {\n // handle enter\n event.preventDefault();\n const address = suggestions[activeIdx];\n onSuggestionClick(address);\n }\n\n checkFormButton();\n };\n\n const onInputClick = () => {\n // handle address input field on click (means form started)\n window.tagular('beam', 'FormStarted', {\n '@type': 'redventures.usertracking.v3.FormStarted',\n formContext: {\n formType: 'ADDRESS CHECK FORM',\n formName: `ADDRESS INPUT FIELD ${location}`,\n formId: '',\n },\n });\n };\n\n const onSuggestionKeyDown = (event, suggestion) => {\n if (event.keyCode === 13) {\n event.preventDefault();\n onSuggestionClick(suggestion);\n }\n };\n\n const onCloseClick = () => {\n // Tagular track 'close suggestions' button clicked\n window.tagular('beam', 'ElementClicked', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n webElement: {\n location: location,\n position: 'ADDRESS AUTOFILL',\n htmlId: '',\n elementType: 'DROP DOWN',\n text: 'Closed suggestions',\n },\n actionOutcome: '',\n });\n\n setShowSuggestions(false);\n };\n\n return (\n \n \n \n \n {addressLabelCopy || 'Find special offers in your area'}\n \n \n \n \n
\n \n
\n onAddressChange(e.target.value)}\n name='address'\n className={`${styles.textInput} ${styles.textInputColor}`}\n onKeyDown={(e) => handleAddressKeyDown(e)}\n onClick={onInputClick}\n placeholder={addressPlaceHolderCopy || 'Enter your address'}\n data-private='lipsum'\n />\n {showSuggestions && (\n
\n
    \n \n
\n \n \n Close address suggestions\n \n
\n \n )}\n \n \n {isNav && isMedia.mobile ? mobileAddressCTACopy : addressCTACopy}\n \n \n \n \n );\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"custom-dots\":\"FinalEpq_custom-dots__nfU5G\",\"custom-dot\":\"FinalEpq_custom-dot__Y1DeD\",\"slick-active\":\"FinalEpq_slick-active__gyX8t\",\"container\":\"FinalEpq_container__WQCdK\",\"headers\":\"FinalEpq_headers__SSv8a\",\"heading\":\"FinalEpq_heading__n8JsQ\",\"subheading\":\"FinalEpq_subheading__ftW1R\",\"content\":\"FinalEpq_content__xlFWb\",\"addressContainer\":\"FinalEpq_addressContainer__VJJVI\",\"addressLabel\":\"FinalEpq_addressLabel___W7_T\",\"marginTop\":\"FinalEpq_marginTop__MTaMy\",\"backgroundImage\":\"FinalEpq_backgroundImage__VtnQV\",\"backgroundPositionCenter\":\"FinalEpq_backgroundPositionCenter__pQgeD\",\"backgroundPositionRight\":\"FinalEpq_backgroundPositionRight__1Dm1m\",\"buttons\":\"FinalEpq_buttons__ledmL\",\"btn\":\"FinalEpq_btn__x7ud6\",\"epqBtn\":\"FinalEpq_epqBtn__ks7DS\",\"callNowCta\":\"FinalEpq_callNowCta__ZMFku\",\"ring\":\"FinalEpq_ring__wyMGF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"custom-dots\":\"AddressForm_custom-dots__AgyN2\",\"custom-dot\":\"AddressForm_custom-dot__drBXp\",\"slick-active\":\"AddressForm_slick-active__mPp8V\",\"addressForm\":\"AddressForm_addressForm__Wvgg2\",\"addressHeadline\":\"AddressForm_addressHeadline__kLBlf\",\"heroAddressHeadline\":\"AddressForm_heroAddressHeadline__XWZzV\",\"fieldset\":\"AddressForm_fieldset__2N3jc\",\"isNavFieldSet\":\"AddressForm_isNavFieldSet__xWd0N\",\"nonHeroFieldset\":\"AddressForm_nonHeroFieldset__BnKk7\",\"inputWrapper\":\"AddressForm_inputWrapper__e_h18\",\"isNavInputWrapper\":\"AddressForm_isNavInputWrapper__RCY0q\",\"nonHeroInputWrapper\":\"AddressForm_nonHeroInputWrapper__FDvLy\",\"mapPin\":\"AddressForm_mapPin__D9Hhk\",\"textInput\":\"AddressForm_textInput__CGu_j\",\"textInputColor\":\"AddressForm_textInputColor__QmKBL\",\"btn\":\"AddressForm_btn__GF6sD\",\"uppercaseBtn\":\"AddressForm_uppercaseBtn__LQQkU\",\"nonHeroBtn\":\"AddressForm_nonHeroBtn__7huB6\",\"isNavBtn\":\"AddressForm_isNavBtn__RgRxP\",\"suggestionsList\":\"AddressForm_suggestionsList__Cz8kL\",\"suggestionsListItems\":\"AddressForm_suggestionsListItems__R_SaO\",\"suggestionsListClose\":\"AddressForm_suggestionsListClose__RkK60\",\"suggestionsListCloseCopy\":\"AddressForm_suggestionsListCloseCopy__uwsYi\",\"isNavContainer\":\"AddressForm_isNavContainer__OUTWe\",\"nonHeroContainer\":\"AddressForm_nonHeroContainer__NBYfL\",\"isModalContainer\":\"AddressForm_isModalContainer__FRrpg\",\"ring\":\"AddressForm_ring__b8DAY\"};"],"names":["BASE_DATA","addressCTACopy","addressLabelCopy","addressPlaceHolderCopy","backgroundImage","headline","headlineTextColor","mapPinIconColor","subhead","subheadTextColor","backgroundColor","isEpq","hasImage","secondaryCTACopy","epqCopy","FinalEpq","data","monarchData","useMonarchSlotContext","finalEpqSection","useRef","useIntersectionObserver","fireElementViewedEvent","undefined","threshold","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","div","ref","className","concat","styles","style","jsx","img","isPositionRight","src","alt","WhiteHughesnetLogo","Typography","variant","span","dangerouslySetInnerHTML","__html","color","AddressForm","metadata","isFinalEpq","Button","href","tracking","position","location","elementType","text","actionOutcome","fuse","param","componentLocation","isHero","isNav","isModal","isUppercase","addressLabelColor","mobileAddressCTACopy","isMedia","useMedia","zipCode","setZipCode","useState","address","setAddress","finalAddress","setFinalAddress","suggestions","setSuggestions","disableButton","setDisableButton","showSuggestions","setShowSuggestions","activeIdx","setActiveIdx","API_KEY","AUTOCOMPLETE_URL","SMARTY_STREETS","checkFormButton","useCallback","useEffect","setCookie","name","value","exmins","d","Date","setTime","getTime","expires","toUTCString","document","cookie","onFormSubmit","event","preventDefault","JSON","stringify","street_line","city","state","zip","zipcode","isUnit","entries","unitValue","secondary","window","tagular","formContext","formType","formName","formId","fetchSuggestions","fetch","query","then","res","json","body","filter","suggestion","catch","addPageAction","error","onAddressChange","uniqueSet","Set","uniqueAddress","map","has","item","add","push","onSuggestionClick","selected","searchQuery","webElement","htmlId","handleAddressKeyDown","keyCode","length","form","onSubmit","autoComplete","fieldset","MapPin","input","onChange","e","target","onKeyDown","onClick","placeholder","data-private","ul","SuggestionItems","items","handleKeyDown","isDisabled","mobile","module","exports"],"sourceRoot":""}