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hooks/usePredictiveSearch.js","webpack://_N_E/./js/config/state.js","webpack://_N_E/./js/helpers/cart.js","webpack://_N_E/./js/utils/filters.js","webpack://_N_E/./js/utils/validators.js","webpack://_N_E/./components/blocks/ServiceCheckForm/index.module.css"],"sourcesContent":["/**\n * @module ServiceCheckForm\n * @description Service Check Form\n */\nimport {\n useState, useRef, useEffect, useContext\n} from 'react';\nimport debounce from 'lodash/debounce';\nimport { usePredictiveSearch } from '@/hooks/usePredictiveSearch';\nimport { isValidAddressInput } from '@/js/utils/validators';\nimport { stringify } from '@/js/utils/filters';\nimport { trackEvent } from '@/js/helpers/tracking';\nimport state from '@/js/config/state';\nimport { v4 as uuidv4 } from 'uuid';\nimport styles from './index.module.css';\nimport { FuelContext } from '@/providers/fuel-provider';\n\nconst formContext = {\n formType: 'SERVICE CHECK - SINGLE LINE',\n formName: 'SERVICE CHECK - SINGLE LINE'\n};\n\n/**\n * @function Component\n * @description\n */\nconst Component = ( { ...props } ) => {\n const { theme, isHero, isGdtCta = false } = props;\n const [ addressValid, setAddressValid ] = useState( false );\n const [ addressError, setAddressError ] = useState( false );\n const [ suggestions, setSuggestions ] = useState( [ ] );\n const [ addressObject, setAddressObject ] = useState( { } );\n const [ formStarted, setFormStarted ] = useState( false );\n const [ addressKey, setAddressKey ] = useState( false );\n const [ placeholderText, setPlaceholderText ] = useState( 'Enter your address.' );\n const id = uuidv4();\n\n const addressField = useRef( null );\n const honeyPotField = useRef( null );\n\n const predictive = usePredictiveSearch( { addressField, honeyPotField }, setSuggestions, formContext );\n\n const { setFormInputted } = useContext( FuelContext );\n\n /**\n * @function setSuggestionValue\n * @description Set suggestion value on address and zip\n */\n const setSuggestionValue = async ( event ) => {\n const { address, addressData } = await predictive.setSuggestionValue( event );\n\n setAddressValid( isValidAddressInput( address ) );\n setAddressError( ! isValidAddressInput( address ) );\n setAddressObject( addressData );\n setAddressKey( true );\n };\n\n /**\n * @function fetchAddress\n * @description Fetch our address suggestions\n */\n const fetchAddress = async ( event ) => {\n if ( ! formStarted ) {\n trackEvent( { action: 'formStarted', data: formContext } );\n setFormStarted( true );\n }\n\n predictive.fetchAddress( event );\n setFormInputted( true );\n };\n\n /**\n * @function handleResize\n * @description Update placeholder text if viewport changes\n */\n const handleResize = () => {\n if ( state.is_desktop ) {\n return setPlaceholderText( 'Enter your address to view plans in your area.' );\n }\n\n setPlaceholderText( 'Enter your address.' );\n };\n\n /**\n * @function useEffect\n * @description Set our placeholder, then attach viewport resize event\n */\n useEffect( () => {\n handleResize();\n document.addEventListener( 'redventures/resize_executed', handleResize );\n }, [] );\n\n return (\n
\n
predictive.handleSubmit( e, isGdtCta ) } data-address-object={ stringify( addressObject ) } data-cypress=\"service-check-form\">\n \n
\n \n \n Invalid Address\n
0 ? styles.component__suggestionsActive : '' }` }>\n { suggestions && suggestions.length > 0 &&\n <>\n
    \n { suggestions.map( ( suggestion, index ) => (\n
  • \n { suggestion.value }\n
  • \n ) ) }\n
\n
\n setSuggestions( [ ] ) }\n >Close address suggestions\n
\n \n }\n
{ /* */ }\n
{ /* */ }\n\n
\n \n \n
{ /* */ }\n\n Check availability\n \n
\n );\n};\n\nexport default Component;\n","/**\n * @module Predictive Search API\n * @description Our zipcode / address API\n */\nimport { useContext } from 'react';\nimport { useGoogleReCaptcha } from 'react-google-recaptcha-v3';\nimport DOMPurify from 'isomorphic-dompurify';\n\nimport { FuelContext } from '@/providers/fuel-provider';\nimport { onlySpaces } from '@/js/utils/filters';\nimport { trackEvent } from '@/js/helpers/tracking';\nimport { setCookie } from '@/js/utils/cookie';\nimport { addPageAction } from '@/js/utils/new-relic';\nimport useCartState from './useCartState';\nimport { persistData } from '@/js/utils/session-storage';\nimport { stripClickThrough } from '@/js/helpers/cart';\n\n/**\n * @function usePredictiveSearch\n * @description\n */\nexport const usePredictiveSearch = ( refs, setSuggestions, formContext ) => {\n const { clickThrough, olVersion, gdtVersion } = useContext( FuelContext );\n const { cartStore, submitDifferentAddress } = useCartState();\n\n /**\n * @function buildAddress\n * @description Build the address\n */\n const buildAddress = ( suggestion ) => {\n let whiteSpace = ' ';\n if ( suggestion.secondary ) {\n if ( suggestion.entries > 1 ) {\n suggestion.secondary += ` (${ suggestion.entries } entries)`;\n }\n whiteSpace = ' ';\n }\n return `${ suggestion.addressLine1 }${ whiteSpace }${ suggestion.addressLine2 } ${ suggestion.city }, ${ suggestion.stateProvince } ${ suggestion.zipCode }`;\n };\n\n /**\n * @function handleInput\n * @description track our events\n */\n const handleInput = ( event ) => {\n const { target } = event;\n const { fieldName, fieldType, fieldValue } = JSON.parse( target.getAttribute( 'data-payload' ) );\n\n const data = {\n formContext,\n fieldName,\n fieldType,\n fieldValue\n };\n\n // need to wait for formstarted to run\n setTimeout( () => {\n trackEvent( { action: 'fieldInputted', data, event } );\n }, 100 );\n };\n\n /**\n * @function handleKeyDown\n * @description Handle a keydown event\n */\n const handleKeyDownEvent = ( event ) => {\n // handle escape key\n if ( event.key === 'Escape' ) {\n setSuggestions( [ ] );\n return refs.addressField.current.removeEventListener( 'keydown', handleKeyDownEvent );\n }\n };\n\n /**\n * @function handleClickEvent\n * @description Handle a keydown event\n */\n const handleClickEvent = ( event ) => {\n const { target } = event;\n\n if ( target.hasAttribute( 'data-address' ) ) {\n return;\n }\n\n setSuggestions( [ ] );\n };\n\n /**\n * @function fetchAddressSuggestions\n * @description Fetch the address\n */\n const fetchAddressSuggestions = async ( value, selected ) => {\n if ( ! value || onlySpaces( value ) ) {\n return;\n }\n\n const url = new URL( `${ process.env.predictiveSearchUrl }/api/${ olVersion }/serviceability/predictive` );\n const params = url.searchParams;\n\n params.set( 'inFootPrint', false );\n params.set( 'serviceAddressRecord', false );\n params.set( 'excludeChildren', false );\n\n if ( selected !== '' ) {\n params.set( 'selected', selected );\n } else if ( params.has( 'selected' ) ) {\n params.delete( 'selected' );\n }\n\n params.set( 'address', value );\n\n const addresses = await fetch( url )\n .then( ( res ) => res.json() )\n .then( ( data ) => {\n if ( ! data ) {\n return [];\n }\n\n const suggestions = [];\n\n if ( ! data.length ) {\n return suggestions;\n }\n\n if ( data === null || typeof data === 'undefined' ) {\n suggestions.push( { } );\n return suggestions;\n }\n\n Object.values( data ).forEach( ( suggestion ) => {\n const address = {\n value: buildAddress( suggestion ),\n addressKey: suggestion.addressKey,\n addressLine1: suggestion.addressLine1,\n addressLine2: suggestion.addressLine2,\n city: suggestion.city,\n stateProvince: suggestion.stateProvince,\n zipCode: suggestion.zipCode,\n zipCode4: suggestion.zipCode4,\n latitude: suggestion.latitude,\n longitude: suggestion.longitude,\n parsedAddress: suggestion.parsedAddress\n };\n\n suggestions.push( address );\n } );\n\n return suggestions;\n } );\n\n return addresses;\n };\n\n /**\n * @function addressAsciiSanitization\n * @description Remove non-ascii characters and replace special characters with their regular counterpart\n */\n const addressAsciiSanitization = ( address ) => address.normalize( 'NFD' ).replace( /\\u00A0/g, ' ' ).replace( /([\\u0300-\\u036f]|[^0-9a-zA-Z\\s])/g, '' );\n\n /**\n * @function fetchAddress\n * @description Fetch our address suggestions\n */\n const fetchAddress = async ( event ) => {\n const { target } = event;\n const { value } = target;\n\n handleInput( event );\n\n if ( ! value || value.length < 3 ) {\n setSuggestions( [ ] );\n return;\n }\n\n const suggestionValues = await fetchAddressSuggestions( addressAsciiSanitization( DOMPurify.sanitize( value ) ), '' );\n\n setSuggestions( suggestionValues || [ ] );\n\n // register keydown listeners once address suggestions populate\n refs.addressField.current.addEventListener( 'keydown', handleKeyDownEvent );\n document.addEventListener( 'click', handleClickEvent );\n };\n\n /**\n * @function setSuggestionValue\n * @description Set suggestion value on address and zip\n */\n const setSuggestionValue = async ( event ) => {\n const { target } = event;\n\n const address = target.getAttribute( 'data-address' );\n const zip = target.getAttribute( 'data-zip' );\n const addressData = JSON.parse( target.getAttribute( 'data-object' ) );\n\n if ( address.includes( 'entries' ) ) {\n const value = address.replace( ' entries', '' );\n const suggestionValues = await fetchAddressSuggestions( address, value );\n\n return setSuggestions( suggestionValues );\n }\n\n refs.addressField.current.value = address.replace( ` ${ zip }`, '' );\n\n if ( refs.zipField ) {\n refs.zipField.current.value = zip;\n\n const { fieldName, fieldType, fieldValue } = JSON.parse( refs.zipField.current.getAttribute( 'data-payload' ) );\n\n const data = {\n formContext,\n fieldName,\n fieldType,\n fieldValue,\n autofilled: true\n };\n trackEvent( { action: 'fieldInputted', data, event } );\n }\n\n setSuggestions( [ ] );\n\n return { address, zip, addressData };\n };\n\n // ReCaptcha\n const { executeRecaptcha } = useGoogleReCaptcha();\n\n /**\n * @function handleSubmit\n * @description Handle submission of form\n */\n const handleSubmit = async ( event, enterGdt = false ) => {\n event.preventDefault();\n\n if ( refs.honeyPotField.current.value !== '' ) {\n return;\n }\n\n const token = await executeRecaptcha();\n\n const addressObject = JSON.parse( event.target.getAttribute( 'data-address-object' ) );\n const userData = {\n address: {\n value: addressObject.value,\n addressKey: addressObject.addressKey,\n addressLine1: addressObject.addressLine1,\n addressLine2: addressObject.addressLine2,\n city: addressObject.city,\n stateProvince: addressObject.stateProvince,\n zipCode: addressObject.zipCode,\n zipCode4: addressObject.zipCode4,\n latitude: addressObject.latitude,\n longitude: addressObject.longitude,\n parsedAddress: addressObject.parsedAddress\n },\n plansDrop: true, // TODO: what do these do?\n showCTA: true, // TODO: what do these do?\n token\n };\n\n trackEvent( { action: 'formSubmitted', data: formContext, event } );\n addPageAction( 'cartEntrance', { method: 'ADDRESS FORM' } );\n\n // Set our cookie and redirect to the cart\n setCookie( 'frontierSiteDetailPredictive', JSON.stringify( userData ), 30 );\n persistData( 'frontierSiteDetailPredictive', JSON.stringify( userData ) );\n setTimeout( () => {\n // Check for persisted cart state and that addresses match\n if ( cartStore?.address?.install?.addressKey && cartStore?.address?.install?.addressKey !== addressObject.addressKey ) {\n submitDifferentAddress();\n return;\n }\n\n if ( enterGdt ) {\n window.location.href = `${ stripClickThrough( clickThrough ) }${ gdtVersion }/`;\n } else {\n window.location.href = clickThrough;\n }\n }, 100 );\n };\n\n return {\n fetchAddress, fetchAddressSuggestions, handleInput, executeRecaptcha, handleSubmit, handleClickEvent, handleKeyDownEvent, setSuggestionValue\n };\n};\n\nexport default usePredictiveSearch;\n","/**\n * @module Viewport State\n * @description Device screen\n */\nexport const state = {\n desktop_initialized: false,\n is_desktop: false,\n is_small_desktop: false,\n is_tablet: false,\n is_mobile: false,\n mobile_initialized: false,\n v_height: 0,\n v_width: 0\n};\n\nexport default state;\n","import { getCookie, setCookie } from '@/js/utils/cookie';\nimport { deleteStored } from '@/js/utils/session-storage';\nimport { v4 as uuid } from 'uuid';\n\n/*\n When beginning cart flow on LPs (ex: Resume Quote), tracking IDs\n need to be generated to ensure proper eventing\n */\nexport const getClientSideTrackingIds = () => {\n // Check if tracking IDs already exist\n const clientSideTrackingIds = getCookie( 'clientSideTrackingIds' );\n if ( clientSideTrackingIds ) return JSON.parse( clientSideTrackingIds );\n\n // Create new IDs if they don't exist\n const clientSessionId = uuid();\n const orderId = uuid();\n const correlationId = uuid();\n\n // Wipe out persisted cart state if starting a new session\n deleteStored( 'persist:fuel' );\n\n const trackingIds = { clientSessionId, orderId, correlationId };\n setCookie( 'clientSideTrackingIds', JSON.stringify( trackingIds ), 60 ); // Cookie expires in 60 minutes\n return trackingIds;\n};\n\n/*\n When user enters LP via cart with persisted serviceability,\n we may need to strip /plan-package off of the clickThrough\n to send them to a different page (ex. /my-custom-quote)\n*/\nexport const stripClickThrough = ( url ) => {\n const stripped = url.replace( '/plan-package', '' );\n return stripped;\n};\n","/**\n * @module Filters\n * @description Some handy filters\n */\n\n/**\n * @function stringify\n * @description Filter for Tagular Payload Object\n */\nexport const stringify = ( str ) => JSON.stringify( str );\n\n/**\n * @function onlySpaces\n * @description Check if string is only spaces\n */\nexport const onlySpaces = ( str ) => str.trim().length === 0;\n\nexport default stringify;\n","/**\n * @module Validators\n * @description Some handy validators\n */\n\n/**\n * @function isValidZipInput\n * @description Check for zip 5 and numeric input, Does not allow for Zip9\n * @param { number } value zip input\n */\nexport const isValidZipInput = ( value ) => value.length === 5 && ! Number.isNaN( value );\n\n/**\n * @function isValidAddressInput\n * @description Check if address contains street name and suffix (street, avenue, etc)\n * Number is optional i.e. 7th Street & 123 7th Street are both acceptable\n * @param { string } value address input\n */\nexport const isValidAddressInput = ( value ) => {\n const regex = /^(?:(\\d+\\s))?[A-z0-9]+\\s[A-z]+/;\n\n if ( ! value ) {\n return false;\n }\n\n return regex.test( value );\n};\n\n/**\n * @function isValidEmail\n * @description Check if email address contains @ and . surrounded by non-whitespace characters\n * @param { string } value email input\n */\nexport const isValidEmail = ( value ) => {\n const regex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n if ( ! value ) {\n return false;\n }\n\n return regex.test( value );\n};\n\n/**\n * @function standardRegex\n * @description\n * Regex strings\n * Base: letter, number, & backspace\n * Name: letter, space, & backspace\n * Email: letter, number, @, period(.), & backspace\n * Date: number only\n * Address: letter, number, space, period(.), and backspace\n */\nexport const standardRegex = {\n base: /^[a-zA-Z0-9\\b]/,\n name: /[a-zA-Z\\s\\b]/,\n email: /[a-zA-Z0-9@.\\b]/,\n date: /[0-9]/,\n address: /^[a-zA-Z0-9\\s.\\b]/\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"u-color-white\":\"ServiceCheckForm_u-color-white__AU6qw\",\"u-color-midnight\":\"ServiceCheckForm_u-color-midnight__WCx5x\",\"u-color-blue\":\"ServiceCheckForm_u-color-blue___6lPE\",\"u-color-red\":\"ServiceCheckForm_u-color-red__M_7Ai\",\"u-text-bold\":\"ServiceCheckForm_u-text-bold__foWfJ\",\"u-textdecoration-color-white\":\"ServiceCheckForm_u-textdecoration-color-white__Cc9Qw\",\"u-textdecoration-color-midnight\":\"ServiceCheckForm_u-textdecoration-color-midnight__vMWk5\",\"u-textdecoration-color-blue\":\"ServiceCheckForm_u-textdecoration-color-blue__kOk_K\",\"u-textdecoration-color-red\":\"ServiceCheckForm_u-textdecoration-color-red__aJr31\",\"u-theme-white\":\"ServiceCheckForm_u-theme-white__FecFr\",\"u-theme-light\":\"ServiceCheckForm_u-theme-light__Er7eI\",\"u-theme-black\":\"ServiceCheckForm_u-theme-black__S_VDO\",\"u-theme-dark\":\"ServiceCheckForm_u-theme-dark__sediG\",\"u-theme-light-blue\":\"ServiceCheckForm_u-theme-light-blue__WLW7x\",\"u-theme-blue\":\"ServiceCheckForm_u-theme-blue__Y87oA\",\"u-theme-red\":\"ServiceCheckForm_u-theme-red__2rgSC\",\"u-theme-holiday\":\"ServiceCheckForm_u-theme-holiday__fGKC5\",\"u-theme-neutral-light\":\"ServiceCheckForm_u-theme-neutral-light__dUWLk\",\"hide-for-small-only\":\"ServiceCheckForm_hide-for-small-only__uSbm0\",\"show-for-small-only\":\"ServiceCheckForm_show-for-small-only__2BFGV\",\"hide-for-medium\":\"ServiceCheckForm_hide-for-medium__lEAKw\",\"show-for-medium\":\"ServiceCheckForm_show-for-medium__hxa0X\",\"hide-for-medium-only\":\"ServiceCheckForm_hide-for-medium-only__e_ytm\",\"show-for-medium-only\":\"ServiceCheckForm_show-for-medium-only__fJJ_v\",\"hide-for-large\":\"ServiceCheckForm_hide-for-large__40ZkS\",\"show-for-large\":\"ServiceCheckForm_show-for-large__Wdaez\",\"hide-for-large-only\":\"ServiceCheckForm_hide-for-large-only__8mw5L\",\"show-for-large-only\":\"ServiceCheckForm_show-for-large-only__wENgW\",\"component\":\"ServiceCheckForm_component__317l8\",\"component__dark\":\"ServiceCheckForm_component__dark___eeQB\",\"component__isHero\":\"ServiceCheckForm_component__isHero__PM2LS\",\"component__form\":\"ServiceCheckForm_component__form__NfQX_\",\"component__icon\":\"ServiceCheckForm_component__icon__dBGDw\",\"component__formField\":\"ServiceCheckForm_component__formField__aU3Fs\",\"component__suggestions\":\"ServiceCheckForm_component__suggestions__XJVN8\",\"component__suggestionsActive\":\"ServiceCheckForm_component__suggestionsActive__mzHc6\",\"component__suggestionsList\":\"ServiceCheckForm_component__suggestionsList__sypy3\",\"component__manual\":\"ServiceCheckForm_component__manual__KrOSD\",\"component__compact-gdt\":\"ServiceCheckForm_component__compact-gdt__0CGyn\"};"],"names":["formContext","formType","formName","__webpack_exports__","Z","props","param","theme","isHero","isGdtCta","addressValid","setAddressValid","useState","addressError","setAddressError","suggestions","setSuggestions","addressObject","setAddressObject","formStarted","setFormStarted","addressKey","setAddressKey","placeholderText","setPlaceholderText","id","uuidv4","addressField","useRef","honeyPotField","predictive","usePredictiveSearch","setFormInputted","useContext","FuelContext","setSuggestionValue","event","address","addressData","isValidAddressInput","fetchAddress","trackEvent","action","data","handleResize","state","is_desktop","useEffect","document","addEventListener","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","div","className","styles","jsxs","form","name","autoComplete","onSubmit","handleSubmit","e","data-address-object","stringify","data-cypress","span","label","htmlFor","input","ref","type","data-test-id","onInput","debounce","placeholder","data-payload","fieldName","fieldType","fieldValue","length","Fragment","ul","map","suggestion","index","li","button","role","data-address","value","data-zip","zipCode","data-object","onClick","data-hidden-input","handleInput","ctaTheme","disabled","aria-disabled","refs","clickThrough","olVersion","gdtVersion","cartStore","submitDifferentAddress","useCartState","buildAddress","whiteSpace","secondary","entries","addressLine1","addressLine2","city","stateProvince","target","JSON","parse","getAttribute","setTimeout","handleKeyDownEvent","key","current","removeEventListener","handleClickEvent","hasAttribute","fetchAddressSuggestions","selected","onlySpaces","url","URL","params","searchParams","set","has","delete","fetch","then","res","json","push","Object","values","forEach","zipCode4","latitude","longitude","parsedAddress","addressAsciiSanitization","normalize","replace","suggestionValues","DOMPurify","zip","includes","zipField","autofilled","executeRecaptcha","useGoogleReCaptcha","enterGdt","preventDefault","token","userData","plansDrop","showCTA","addPageAction","method","setCookie","persistData","install","window","location","href","stripClickThrough","desktop_initialized","is_small_desktop","is_tablet","is_mobile","mobile_initialized","v_height","v_width","getClientSideTrackingIds","clientSideTrackingIds","getCookie","clientSessionId","uuid","orderId","correlationId","deleteStored","trackingIds","str","trim","regex","test","isValidEmail","module","exports"],"sourceRoot":""}