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IL,GAAIH,EAAYQ,QAAQ,CAACL,GAAY,CACnCL,EAAoBE,EAAYS,OAAO,CAACN,GAAa,GACrD,MACF,CAIAF,EADsB,CAACE,KAAc,IAAItD,IAAImD,GAAa,EAE1DF,EAAoBE,EAAYhC,MAAM,CAAG,GAC3C,EAAG,CACD3F,EACA0H,EACAC,EACAH,EACAC,EACD,EACM,GAAAtI,EAAAC,GAAA,EAACiJ,MAAAA,UAAKb,GACf,iFClBAc,CAAAA,EAAAC,CAAA,CAhBc,OAAC,CAAEjJ,KAAAA,CAAI,CAAEC,MAAAA,CAAK,CAAEiJ,SAAAA,CAAQ,CAAE,CAAA5H,EACtC,MACE,GAAAzB,EAAAC,GAAA,EAAAD,EAAAc,QAAA,WACGX,GACC,GAAAH,EAAAC,GAAA,EAACI,MAAAA,CACCiJ,GAAG,iBACHhJ,UAAWC,IAAAA,cAAAA,CACXG,QAAS,IAAMN,aAEf,GAAAJ,EAAAC,GAAA,EAACI,MAAAA,CAAIK,QAAS,GAAO8G,EAAE+B,eAAe,YAAKF,OAKrD,oBChBAG,EAAAC,OAAA,EAAkB,mtBCAlBD,EAAAC,OAAA,EAAkB,isDCAlBD,EAAAC,OAAA,EAAkB","sources":["webpack://_N_E/./src/components/base/v1/Inactivity Modal/index.js","webpack://_N_E/./src/components/shared/AddressFormBrand/index.js","webpack://_N_E/./src/components/shared/LegalAnnotation/index.js","webpack://_N_E/./src/components/shared/Modal/index.js","webpack://_N_E/./src/components/base/v1/Inactivity Modal/Modal.module.scss","webpack://_N_E/./src/components/shared/AddressFormBrand/AddressForm.module.scss","webpack://_N_E/./src/components/shared/Modal/Modal.module.scss"],"sourcesContent":["import { useState, useContext, useRef, useEffect } from 'react';\nimport Modal from '~/components/shared/Modal';\nimport Button from '~/components/shared/Button';\nimport styles from './Modal.module.scss';\nimport AddressForm from '~/components/shared/AddressFormBrand';\nimport { CallCenterContext } from '~/providers/CallCenterProvider';\nimport { XCircle } from '~/components/icons';\nimport { useMedia } from '~/helpers/hooks';\nimport LegalAnnotation from '~/components/shared/LegalAnnotation';\nimport { useMonarchSlotContext } from '@redventures/cohesion-utils-react';\n\nexport default function InactivityModal() {\n const BASE_DATA = {\n promoHeadline1: 'Shop plans with faster speeds and unlimited data!',\n promoHeadlineLegal1: 'data-limit',\n promoHeadlineLegal1Toggle: true,\n promoHeadline2:\n 'Order now to receive a $100 prepaid Mastercard via Rebate. Offer ends 7/15/24',\n promoHeadline2Toggle: false,\n promoHeadlineLegal2: 'data-limit',\n promoHeadlineLegal2Toggle: true,\n callCTACopy: 'Call now',\n addressDisclaimer:\n 'Fusion plans available only in select areas. Speeds based on coverage and clear satellite access',\n timer: 1,\n mobileOnly: false,\n addressCTACopy: 'Shop Plans',\n addressLabelColor: '#333',\n };\n const { data: monarchData } = useMonarchSlotContext();\n const data = { ...BASE_DATA, ...monarchData };\n const callCenterOpen = useContext(CallCenterContext);\n const isMedia = useMedia();\n const {\n promoHeadline1,\n promoHeadlineLegal1,\n promoHeadlineLegal1Toggle,\n promoHeadline2,\n promoHeadline2Toggle,\n promoHeadlineLegal2,\n promoHeadlineLegal2Toggle,\n callCTACopy,\n timer,\n addressDisclaimer,\n mobileOnly,\n addressCTACopy,\n addressLabelColor,\n } = data;\n\n const minuteTimer = timer * 60000;\n const minuteTimerString = minuteTimer?.toString();\n const inactivityTimerRef = useRef(null);\n const [visible, setVisible] = useState(false);\n const [triggered, setTriggered] = useState(false);\n\n const resetInactivityTimer = () => {\n //reset timer if event listener is triggered\n clearTimeout(inactivityTimerRef.current);\n inactivityTimerRef.current = setTimeout(() => {\n // User is inactive, therefore setVisible to true\n setVisible(true);\n setTriggered(true);\n }, minuteTimerString);\n };\n\n useEffect(() => {\n if (!triggered) {\n resetInactivityTimer();\n // Set up event listeners\n window.addEventListener('mousemove', resetInactivityTimer);\n window.addEventListener('keydown', resetInactivityTimer);\n window.addEventListener('scroll', resetInactivityTimer);\n }\n return () => {\n // Clean up event listeners and clear the inactivity timer\n window.removeEventListener('mousemove', resetInactivityTimer);\n window.removeEventListener('keydown', resetInactivityTimer);\n window.removeEventListener('scroll', resetInactivityTimer);\n clearTimeout(inactivityTimerRef.current);\n };\n }, [triggered]);\n\n const handleClose = () => {\n tagular('beam', 'ElementClicked', {\n '@type': 'redventures.usertracking.v3.ElementClicked',\n webElement: {\n location: 'Hero Modal',\n position: 'Hero Modal',\n elementType: 'Modal',\n text: 'Close Modal',\n },\n });\n setVisible(false);\n };\n if (mobileOnly && !isMedia.mobile) return null;\n if (!mobileOnly && isMedia.mobile) return null;\n return (\n \n
\n
\n \n \n \n
\n
\n {promoHeadline1}\n {promoHeadlineLegal1Toggle && (\n \n )}{' '}\n {promoHeadline2Toggle && (\n <>\n {promoHeadline2}\n {promoHeadlineLegal2Toggle && (\n \n )}\n \n )}\n
\n
\n
\n \n
\n {callCenterOpen && (\n \n {callCTACopy}\n \n )}\n
\n \n {addressDisclaimer}\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/smartyStreets';\nimport { ERRORS } from '@constants/errors';\nimport SuggestionItems from '@components/shared/AddressForm/SuggestionList';\nimport Typography from '@components/shared/Typography';\nimport { noticeError, addPageAction } from '@helpers/utils/newRelic';\nimport { MapPin } from '@components/icons/MapPin';\nimport { useMedia } from '@helpers/hooks';\nimport {\n fetchAddressSuggestions,\n handleSuggestionClick,\n} from '@helpers/utils/smartyStreets';\nimport {\n linkedToOrderOnline,\n passedThroughToProductSelection,\n} from '@constants/newRelicActions';\nimport { createKeyboardNavigationHandler } from '@helpers/utils/keyboardNavigation';\nimport { setTimedCookie } from '@helpers/utils/setCookie';\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 const [showNoApartmentSuggestions, setShowNoApartmentSuggestions] =\n useState(false);\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 } = 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 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 setTimedCookie('address', JSON.stringify(userData), 30);\n addPageAction(passedThroughToProductSelection);\n\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 addPageAction(linkedToOrderOnline);\n window.location.href = '/order-online/';\n }\n };\n\n /**\n * Fetch suggestions from Smarty Streets API\n */\n const fetchSuggestions = async (query) => {\n setShowNoApartmentSuggestions(false);\n\n const addressSuggestions = await fetchAddressSuggestions(query);\n\n if (addressSuggestions) {\n setSuggestions(addressSuggestions);\n return addressSuggestions;\n } else {\n setSuggestions([]);\n return [];\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 try {\n fetchSuggestions(searchQuery);\n\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 } catch (error) {\n noticeError(error, {\n type: ERRORS.SMARTY_STREETS.type,\n message: ERRORS.SMARTY_STREETS.message,\n });\n }\n }\n };\n\n /**\n * Handle suggestion click\n * @param {Object} item - The suggestion item\n */\n const onSuggestionClick = async (item) => {\n const tagularObj = {\n position: 'ADDRESS AUTOFILL',\n htmlId: '',\n elementType: 'DROP DOWN',\n text: 'Used Suggestion',\n actionOutcome: 'Internallink',\n };\n\n await handleSuggestionClick(\n item,\n API_KEY,\n location,\n fetchSuggestions,\n setAddress,\n setFinalAddress,\n setZipCode,\n setSuggestions,\n setShowSuggestions,\n setShowNoApartmentSuggestions,\n checkFormButton,\n tagularObj\n );\n };\n\n /**\n * Handle keyboard navigation\n */\n const handleAddressKeyDown = createKeyboardNavigationHandler({\n onEscape: () => {\n setShowSuggestions(false);\n },\n onArrowDown: () => {\n if (activeIdx >= suggestions.length) {\n setActiveIdx(0);\n } else {\n setActiveIdx(activeIdx + 1);\n }\n },\n onArrowUp: () => {\n if (activeIdx > 0) {\n setActiveIdx(activeIdx - 1);\n }\n },\n onEnter: () => {\n const address = suggestions[activeIdx];\n onSuggestionClick(address);\n },\n afterKeyHandler: () => {\n checkFormButton();\n },\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 setSuggestions([]);\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 {showNoApartmentSuggestions && (\n {\n setAddress('');\n setShowNoApartmentSuggestions(false);\n onCloseClick();\n }}\n >\n \n Sorry, no secondary apartment suggestions found for this\n address.\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","import React, { useEffect, useState, useContext } from 'react';\nimport { LegalContext } from '~/providers/LegalProvider';\n\nexport default function LegalAnnotation({ annotation }) {\n const [annotationNumber, setAnnotationNumber] = useState('');\n const { disclosures, activeLegal, setActiveLegal } = useContext(LegalContext);\n\n useEffect(() => {\n setActiveLegal([]);\n }, []);\n\n useEffect(() => {\n const legalText = disclosures.find(\n (disclosure) => disclosure.handle === annotation\n )?.statement;\n\n if (!legalText) {\n return;\n }\n\n if (activeLegal.includes(legalText)) {\n setAnnotationNumber(activeLegal.indexOf(legalText) + 1);\n return;\n }\n\n // Using Set to get rid of duplicates\n const filteredArray = [legalText, ...new Set(activeLegal)];\n setActiveLegal(filteredArray);\n setAnnotationNumber(activeLegal.length + 1);\n }, [\n annotation,\n disclosures,\n activeLegal,\n annotationNumber,\n setAnnotationNumber,\n ]);\n return {annotationNumber};\n}\n","import React from 'react';\nimport styles from './Modal.module.scss';\n\nconst Modal = ({ show, close, children }) => {\n return (\n <>\n {show && (\n close()}\n >\n
e.stopPropagation()}>{children}
\n \n )}\n \n );\n};\n\nexport default Modal;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tippy-touch\":\"Modal_tippy-touch__LrAKW\",\"tooltip-btn\":\"Modal_tooltip-btn__YQhzB\",\"tooltip-icon\":\"Modal_tooltip-icon__cyyhG\",\"tooltip-content--legal\":\"Modal_tooltip-content--legal__D0Ol_\",\"tippy-box\":\"Modal_tippy-box__EV9Rl\",\"tippy-arrow\":\"Modal_tippy-arrow__lAoAy\",\"custom-dots\":\"Modal_custom-dots__UzpbA\",\"custom-dot\":\"Modal_custom-dot__Lj_mT\",\"slick-active\":\"Modal_slick-active__HFBBq\",\"inactivityModal\":\"Modal_inactivityModal__x2lCn\",\"promoWrapper\":\"Modal_promoWrapper__xzERG\",\"promoContent\":\"Modal_promoContent__ibFGb\",\"promo\":\"Modal_promo__5sQyl\",\"subPromo\":\"Modal_subPromo__Kr75D\",\"close\":\"Modal_close__rkmOb\",\"btn\":\"Modal_btn__USQ4K\",\"addressDisclaimer\":\"Modal_addressDisclaimer__PtVR_\",\"ring\":\"Modal_ring__88Otp\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tippy-touch\":\"AddressForm_tippy-touch____VER\",\"tooltip-btn\":\"AddressForm_tooltip-btn__glljL\",\"tooltip-icon\":\"AddressForm_tooltip-icon__nD_rf\",\"tooltip-content--legal\":\"AddressForm_tooltip-content--legal__9RhOm\",\"tippy-box\":\"AddressForm_tippy-box__Qeao_\",\"tippy-arrow\":\"AddressForm_tippy-arrow__o6gQQ\",\"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\",\"suggestionListNoApartments\":\"AddressForm_suggestionListNoApartments__UWHK4\",\"suggestionsListCloseCopy\":\"AddressForm_suggestionsListCloseCopy__uwsYi\",\"isNavContainer\":\"AddressForm_isNavContainer__OUTWe\",\"nonHeroContainer\":\"AddressForm_nonHeroContainer__NBYfL\",\"isModalContainer\":\"AddressForm_isModalContainer__FRrpg\",\"ring\":\"AddressForm_ring__b8DAY\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tippy-touch\":\"Modal_tippy-touch__SNMZl\",\"tooltip-btn\":\"Modal_tooltip-btn__jDyn0\",\"tooltip-icon\":\"Modal_tooltip-icon__CKgQZ\",\"tooltip-content--legal\":\"Modal_tooltip-content--legal__grOD0\",\"tippy-box\":\"Modal_tippy-box__Sef_T\",\"tippy-arrow\":\"Modal_tippy-arrow__X6oUs\",\"custom-dots\":\"Modal_custom-dots__wwhke\",\"custom-dot\":\"Modal_custom-dot__IO_mA\",\"slick-active\":\"Modal_slick-active__E_cWt\",\"modalContainer\":\"Modal_modalContainer__63yns\",\"ring\":\"Modal_ring__o5e3H\"};"],"names":["InactivityModal","data","monarchData","useMonarchSlotContext","promoHeadline1","promoHeadlineLegal1","promoHeadlineLegal1Toggle","promoHeadline2","promoHeadline2Toggle","promoHeadlineLegal2","promoHeadlineLegal2Toggle","callCTACopy","addressDisclaimer","timer","mobileOnly","addressCTACopy","addressLabelColor","callCenterOpen","useContext","CallCenterContext","isMedia","useMedia","minuteTimer","minuteTimerString","toString","inactivityTimerRef","useRef","visible","setVisible","useState","triggered","setTriggered","resetInactivityTimer","clearTimeout","current","setTimeout","useEffect","window","addEventListener","removeEventListener","handleClose","tagular","webElement","location","position","elementType","text","mobile","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Modal","show","close","div","className","styles","jsxs","a","onClick","XCircle","LegalAnnotation","annotation","Fragment","AddressForm","metadata","isModal","isUppercase","isHero","Button","tracking","actionOutcome","fuse","span","param","componentLocation","isNav","mapPinIconColor","addressPlaceHolderCopy","addressLabelCopy","mobileAddressCTACopy","zipCode","setZipCode","address","setAddress","finalAddress","setFinalAddress","showNoApartmentSuggestions","setShowNoApartmentSuggestions","suggestions","setSuggestions","disableButton","setDisableButton","showSuggestions","setShowSuggestions","activeIdx","setActiveIdx","API_KEY","SMARTY_STREETS","checkFormButton","useCallback","onFormSubmit","event","preventDefault","userData","street_line","city","state","zip","zipcode","isUnit","entries","unitValue","secondary","setTimedCookie","JSON","stringify","addPageAction","passedThroughToProductSelection","formContext","formType","formName","concat","formId","href","linkedToOrderOnline","fetchSuggestions","query","addressSuggestions","fetchAddressSuggestions","onAddressChange","value","searchQuery","uniqueSet","Set","uniqueAddress","map","has","item","add","push","error","noticeError","type","ERRORS","message","onSuggestionClick","handleSuggestionClick","htmlId","handleAddressKeyDown","createKeyboardNavigationHandler","onEscape","onArrowDown","length","onArrowUp","onEnter","afterKeyHandler","onCloseClick","form","onSubmit","autoComplete","Typography","variant","style","color","fieldset","MapPin","input","onChange","e","target","name","onKeyDown","placeholder","data-private","ul","SuggestionItems","items","handleKeyDown","suggestion","keyCode","isDisabled","annotationNumber","setAnnotationNumber","disclosures","activeLegal","setActiveLegal","LegalContext","legalText","find","disclosure","handle","statement","includes","indexOf","sup","__webpack_exports__","Z","children","id","stopPropagation","module","exports"],"sourceRoot":""}