.\n *\n * Generated from LivePerson account/dashboard.\n * Ref: https://knowledge.liveperson.com/getting-started-add-the-liveperson-tag-to-your-website.html\n */\n\nimport React, { useEffect, useState } from 'react';\nimport { useModal, useAppContext } from 'core/hooks';\nimport { LIVE_PERSON_MODAL_FORM, MODAL_ARIA_NAMES } from 'core/constants';\nimport { isStorybook } from 'stories/utils';\nimport * as Typo from 'core/styles/Typography';\n\nimport LPModalForm from './subcomponents/LPModalForm';\nimport LPModalFormConfirm from './subcomponents/LPModalFormConfirm';\nimport { IFields } from './LivePerson.sitecore';\n\nconst LivePerson = ({ fields }: { fields: IFields }) => {\n\tconst [LivePersonModal, toggleLivePersonModal] = useModal(false);\n\tconst [isModalFormLoading, setIsModalFormLoading] = useState(false);\n\tconst [showConfirm, setShowConfirm] = useState(false);\n\tconst [submitedServiceNumber, setSubmitedServiceNumber] = useState('');\n\tconst [isServiceIdError, setIsServiceIdError] = useState(false);\n\n\tconst { isShowLivePersonModal } = useAppContext();\n\n\tuseEffect(() => {\n\t\tif (isShowLivePersonModal || isStorybook()) {\n\t\t\ttoggleLivePersonModal(true);\n\t\t} else {\n\t\t\tsetSubmitedServiceNumber('');\n\t\t\tsetIsModalFormLoading(false);\n\t\t\tsetIsServiceIdError(false);\n\t\t\ttoggleLivePersonModal(false);\n\t\t}\n\t}, [isShowLivePersonModal]);\n\n\tconst onServiceIdSubmit = (serviceId: string) => {\n\t\tsetIsModalFormLoading(true);\n\t\tsetSubmitedServiceNumber(serviceId);\n\t\tif (isStorybook()) {\n\t\t\tsetIsModalFormLoading(false);\n\t\t\tsetShowConfirm(true);\n\t\t} else if (!!window.lpTag.taglets) {\n\t\t\twindow.lpTag.taglets.cobrowse.loadApi(function(visitorApi: any) {\n\t\t\t\tvisitorApi.once('sessionRejected', function() {\n\t\t\t\t\tsetIsServiceIdError(true);\n\t\t\t\t\tsetIsModalFormLoading(false);\n\t\t\t\t\tconst serviceIdInput = document.getElementById(\n\t\t\t\t\t\t'service-number.service-number',\n\t\t\t\t\t) as HTMLElement;\n\t\t\t\t\tserviceIdInput.focus();\n\t\t\t\t\tserviceIdInput.blur();\n\t\t\t\t\tserviceIdInput.onfocus = (_ev: FocusEvent) => {\n\t\t\t\t\t\tsetIsServiceIdError(false);\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\tvisitorApi.once('sessionOffered', function(event: any) {\n\t\t\t\t\tdocument.addEventListener('lpConfirm', (e: any) => {\n\t\t\t\t\t\tif (e.detail.isAccepted) {\n\t\t\t\t\t\t\tvisitorApi.acceptSupportOffer(event);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvisitorApi.cancelSupportOffer(event);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSubmitedServiceNumber('');\n\t\t\t\t\t});\n\t\t\t\t\tsetIsModalFormLoading(false);\n\t\t\t\t\tsetShowConfirm(true);\n\t\t\t\t});\n\n\t\t\t\t//Todo: Remove during clean up phase\n\t\t\t\tfunction sessionReadyCallback(startEvent: any) {\n\t\t\t\t\tif (startEvent) {\n\t\t\t\t\t\tconsole.log('Session is ready and will be started shortly.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvisitorApi.requestSupport({ serviceId }, sessionReadyCallback);\n\t\t\t});\n\t\t}\n\t};\n\n\tconst onConfirm = (isAccepted: boolean) => {\n\t\tconst lpConfirm = new CustomEvent('lpConfirm', { detail: { isAccepted } });\n\t\tdocument.dispatchEvent(lpConfirm);\n\t\t// setIsAccepted(isAccepted);\n\t\tsetShowConfirm(false);\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{fields?.liveAssistHeading?.value ?? LIVE_PERSON_MODAL_FORM.HEADING}\n\t\t\t\t\n\t\t\t\t{showConfirm ? (\n\t\t\t\t\t\n\t\t\t\t) : (\n\t\t\t\t\t\n\t\t\t\t)}\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default LivePerson;\n","import CONTENT from 'jss-components/t01-navigation/Footer/subcomponents/ContactUsBar/ContactUsBar.content';\n\nexport const triggerLivePersonWindow = () => {\n\tif (!window.lpTag) {\n\t\tconsole.warn('-------------------------------');\n\t\tconsole.warn(CONTENT.LP_TAG.DOESNT_EXIST);\n\t\tconsole.warn('-------------------------------');\n\t} else {\n\t\ttry {\n\t\t\tconst engagementId = window.lpTag.events?.hasFired(\n\t\t\t\t'LP_OFFERS',\n\t\t\t\t'OFFER_IMPRESSION',\n\t\t\t\t'OFFER_DISPLAY',\n\t\t\t)[0]?.data?.engagementId;\n\t\t\twindow.lpTag.taglets.rendererStub.click(engagementId);\n\t\t} catch (error) {\n\t\t\tconsole.warn('-------------------------------');\n\t\t\tconsole.warn(CONTENT.LP_TAG.ERROR);\n\t\t\tconsole.warn('-------------------------------');\n\t\t\tconsole.warn(error);\n\t\t\tconsole.warn('-------------------------------');\n\t\t}\n\t}\n};\n","import styled from 'styled-components';\n\nimport { DESKTOP_BP } from 'src/_AppContainer';\nimport * as mx from 'core/styles/mixins';\n\nexport const Wrapper = styled.div`\n\tbackground-color: ${({ theme }) => theme.global.module.color};\n\tpadding: 64px 0 36px;\n`;\n\nexport const LinksContainer = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-bottom: 64px;\n\n\thr {\n\t\tmargin: 64px 0;\n\t}\n\n\t${mx.bp(DESKTOP_BP)`\n\t\tflex-direction: row;\n\n\t\thr {\n\t\t\tdisplay: none;\n\t\t}\n\t`}\n`;\n\nexport const DisclaimerContainer = styled.div`\n\thr {\n\t\tmargin: 0 0 24px;\n\t}\n`;\n\nexport const LinkList = styled.ul`\n\t${mx.listReset}\n\tmin-width: 300px;\n\n\t${mx.bp(DESKTOP_BP)`\n\t\tmargin-right: 60px;\n\t`}\n\n\ta {\n\t\ttext-decoration: none;\n\t\tfont-size: 14px;\n\t\tline-height: 24px;\n\n\t\t&:focus,\n\t\t&:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t}\n`;\n\nexport const LinkListItem = styled.li`\n\tmargin: 0 0 12px;\n\n\t&:last-child {\n\t\tmargin-bottom: 0;\n\t}\n`;\n\nexport const MaintenanceApiContainer = styled.div`\n\tdisplay: none;\n`;\n","import styled, { css } from 'styled-components';\nimport { darken } from 'polished';\n\nimport * as mx from 'core/styles/mixins';\nimport { Icon } from 'core/components/Icon/Icon.style';\nimport { FONT_NAMES, FONT_WEIGHT } from 'core/styles/fonts';\n\nexport const Circle = styled.div<{\n\tbgColor: string;\n}>`\n\t${mx.circle('63px')}\n\tmin-width: 63px;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-right: 16px;\n\ttransition: background-color ${({ theme }) => theme.variables.baseTransition}\n\t\tease;\n\n\t${({ theme, bgColor: colorName }) => css`\n\t\t${theme.css.getBackgroundAndText(colorName)}\n\t`}\n\n\t${Icon} {\n\t\t${mx.alignCentre}\n\t\tmargin: 0;\n\t}\n`;\n\nexport const Content = styled.div<{\n\tisActive?: boolean;\n\tbgColor: string;\n}>`\n\tdisplay: flex;\n\tpadding-right: 20px;\n\n\t${({ theme, isActive = true, bgColor: colorName }) => {\n\t\tconst isDark = theme.core.getCompositionIsDark(colorName);\n\t\tconst color = theme.core.getCompositionColor(colorName);\n\t\tconst lighterBackground = theme.core.getCompositionColor('blue-lighter');\n\n\t\treturn (\n\t\t\tisActive &&\n\t\t\tcss`\n\t\t\t\t&:hover,\n\t\t\t\t&:focus {\n\t\t\t\t\tcursor: pointer;\n\n\t\t\t\t\t${Circle} {\n\t\t\t\t\t\tbackground-color: ${isDark\n\t\t\t\t\t\t\t? lighterBackground\n\t\t\t\t\t\t\t: darken(0.1, color)};\n\t\t\t\t\t}\n\n\t\t\t\t\t.typography--custom__contactUsMethod--title {\n\t\t\t\t\t\ttext-decoration: underline;\n\t\t\t\t\t\tcolor: ${isDark ? lighterBackground : color}!important;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t&:focus {\n\t\t\t\t\t${mx.mimicFocus}\n\t\t\t\t}\n\t\t\t`\n\t\t);\n\t}}\n`;\n\nexport const Title = styled.h4`\n\tfont-size: 16px;\n\tline-height: 24px;\n\tfont-family: ${FONT_NAMES.GOTHAM_ROUNDED_BOOKED};\n\tfont-weight: ${FONT_WEIGHT.SEMI_BOLD};\n`;\n\nexport const Text = styled.p`\n\tfont-size: 14px;\n\tline-height: 20px;\n\tfont-family: ${FONT_NAMES.OPEN_SANS};\n\tfont-weight: ${FONT_WEIGHT.REGULAR};\n`;\n","import React from 'react';\nimport { withTheme } from 'styled-components';\n\nimport { IThemeObject } from 'pods/theme';\nimport { JssTextType } from 'core/utils/sitecore-utils';\nimport { Icon, ICONS } from 'core/components/Icon';\nimport * as Typo from 'core/styles/Typography';\n\nimport * as S from './ContactMethod.style';\n\n// -------------------------\n// Component atoms\n\n/**\n * Displays the circle/icon combo driven by the primary theme.\n */\nconst Circle = ({ bgColor, icon }: { bgColor: string; icon: ICONS }) => (\n\t\n\t\t\n\t\n);\n\n/**\n * Title of `ContactMethod`; accepting either a JSS Text component, or a string.\n * (Depending on whether the ContactMethod is itself wrapped in a link or not)\n */\nexport const Title = ({\n\tchildren,\n\tjssText,\n\tisActive = true,\n\t...typoProps\n}: {\n\tchildren?: React.ReactNode;\n\tjssText?: JssTextType;\n\tisActive?: boolean;\n} & Typo.ITypoProps) => (\n\t\n\t\t{!jssText && children}\n\t\n);\n\n/**\n * Text of `ContactMethod`; accepting either JSS Text component or allowing a custom\n * render method to faciliate LivePerson which needs finer-grain control to conditionally\n * render things like public holiday vs online status vs offline status messages.\n */\nexport const Text = ({ content }: { content: JssTextType }) => (\n\t\n);\n\n// -------------------------\n\ninterface IProps {\n\ticon: ICONS;\n\tisActive?: boolean;\n\tchildren: React.ReactNode;\n\ttheme: IThemeObject;\n}\n\nconst ContactMethod = withTheme(\n\t({ icon, isActive = true, children, theme }: IProps) => {\n\t\tconst bgColor = isActive\n\t\t\t? theme.global.colors.secondary.id\n\t\t\t: theme.global.colors.disabled.id;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t{children}
\n\t\t\t\n\t\t);\n\t},\n);\n\nexport default ContactMethod;\n","import styled from 'styled-components';\n\nimport { DESKTOP_BP } from 'src/_AppContainer';\nimport * as mx from 'core/styles/mixins';\n\nexport const List = styled.ul`\n\t${mx.listReset}\n\tdisplay: flex;\n\tflex-flow: column wrap;\n\n\tli {\n\t\twidth: 100%;\n\t\tmargin: 0 0 20px;\n\n\t\t&:last-of-type {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\ta {\n\t\t\ttext-decoration: none;\n\t\t}\n\t}\n\n\t${mx.bp(DESKTOP_BP)`\n\t\tflex-direction: row;\n\n\t\tli {\n\t\t\twidth: 50%;\n\t\t}\n\t`}\n`;\n\nexport const MessageUsButton = styled.button`\n\t${mx.buttonReset}\n\ttext-align: left;\n`;\n","/* eslint-disable @typescript-eslint/camelcase, react/button-has-type */\n\n/**\n * T01.E03 - Contact Us Bar\n * List of clickable contact methods, including LivePerson click-to-chat.\n *\n * Note that although this is specced as a separate module, it lives\n * within the Footer. As such, it's treated as a 'subcomponent' of the Footer.\n *\n * NOTE:\n * - PhoneUs component uses the Telephone link field which is extended from\n * \t the General link field. in the Sitecore editors,\n * \t - The issue with General link is that it will add a 'http:\\\\' prefix to the\n * url value and result in an incorrect href attribute set for the JSS link,\n * e.g `href=\"http:\\\\tel:XXXX\"`.\n * - Therefore decision had made to use Telephone link field with backend solution\n * \t\t to send `\"url\": \"tel:XXXX\"` as the field value prop to the PhoneUs component.\n * - In addition, a hack to override href attribute with url value is required\n * in the PhoneUs Component.\n */\n\nimport React, { useEffect, useState } from 'react';\nimport { isExperienceEditorActive } from '@sitecore-jss/sitecore-jss-react';\nimport { uid } from 'react-uid';\n\nimport ExperienceEditorContent from 'core/sitecore/experience-editor/ExperienceEditorContent';\nimport ExperienceEditorMessage from 'core/sitecore/experience-editor/ExperienceEditorMessage';\nimport Cta from 'core/components/Cta';\nimport RoutableSitecoreLink from 'core/components/RoutableSitecoreLink';\nimport { useTrackEvent } from 'core/hooks';\nimport { isInSitecorePreviewOrEditMode } from 'core/utils/global-utils';\nimport { triggerLivePersonWindow } from 'jss-components/t25-live-person/LivePerson';\nimport ContactMethod, {\n\tTitle as ContactMethodTitle,\n\tText as ContactMethodText,\n} from './subcomponents/ContactMethod';\nimport { IFields } from '../../Footer.sitecore';\nimport CONTENT from './ContactUsBar.content';\nimport * as S from './ContactUsBar.style';\n\ninterface IProps {\n\tfields: IFields;\n}\n\nconst ContactUsBar = ({ fields }: IProps) => {\n\t// ------------------------------\n\t// ------------------------------\n\t// Message (LivePerson click-to-chat)\n\n\t// State management for the below bind (to listen for when LivePerson\n\t// considers itself 'active') is contained in this component as it's not\n\t// used elsewhere. If it were, this logic ought to be hoisted to _AppContainer\n\t// in the AppContext. Note that core LivePerson logic (and the EmbeddedEngagement\n\t// tag this snipper depends-on/listens-to) is found at `core/vendor/LivePerson`.\n\tconst [isLivePersonOnline, setIsLivePersonOnline] = useState(false);\n\tconst [isLpTagLoaded, setIsLpTagLoaded] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (isExperienceEditorActive() || isInSitecorePreviewOrEditMode()) {\n\t\t\tconsole.warn('-------------------------------');\n\t\t\tconsole.warn(CONTENT.SITECORE.INACTIVE);\n\t\t\tconsole.warn('-------------------------------');\n\t\t} else if (!!window) {\n\t\t\tif (typeof window.lpTag === 'undefined') {\n\t\t\t\tconsole.warn('-------------------------------');\n\t\t\t\tconsole.warn(CONTENT.LP_TAG.DOESNT_EXIST);\n\t\t\t\tconsole.warn('-------------------------------');\n\t\t\t} else {\n\t\t\t\t// Check first if windows and lpTag is available serving the expected purpose\n\t\t\t\tconst lpTagChecking =\n\t\t\t\t\ttypeof window.lpTag === 'object' &&\n\t\t\t\t\ttypeof window.lpTag.events === 'object' &&\n\t\t\t\t\ttypeof window.lpTag.events.hasFired === 'function';\n\n\t\t\t\tlet lpTagHasFired = lpTagChecking\n\t\t\t\t\t? window?.lpTag?.events?.hasFired('OFFER_DISPLAY')?.length\n\t\t\t\t\t: 0;\n\t\t\t\tlet reps = 1;\n\n\t\t\t\tconst fetchLpTagInterval = setInterval(() => {\n\t\t\t\t\tlpTagHasFired = lpTagChecking\n\t\t\t\t\t\t? window?.lpTag?.events?.hasFired('OFFER_DISPLAY')?.length\n\t\t\t\t\t\t: 0;\n\n\t\t\t\t\tif (lpTagHasFired > 0 || reps >= 50) {\n\t\t\t\t\t\tsetIsLpTagLoaded(true);\n\t\t\t\t\t\tclearInterval(fetchLpTagInterval);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsLpTagLoaded(false);\n\t\t\t\t\t}\n\t\t\t\t\treps += 1;\n\t\t\t\t}, 200);\n\t\t\t}\n\t\t}\n\t}, []);\n\n\tconst _enableLiveChat = () => {\n\t\tconst engagementId =\n\t\t\t(typeof window.lpTag.events === 'object' &&\n\t\t\t\twindow?.lpTag?.events?.hasFired('OFFER_DISPLAY')[0]?.data\n\t\t\t\t\t?.engagementId) ||\n\t\t\tundefined;\n\n\t\tif (!!engagementId) {\n\t\t\tsetIsLivePersonOnline(true);\n\t\t} else {\n\t\t\tsetIsLpTagLoaded(false);\n\t\t\tsetIsLivePersonOnline(false);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (isLpTagLoaded) {\n\t\t\t_enableLiveChat();\n\t\t}\n\t}, [isLpTagLoaded]);\n\n\t// ------------------------------\n\n\t/**\n\t * Normalises date/month string values to always have padded zeroes\n\t * where appropriate, so we get exact matches when comapring 'today'\n\t * with values within the content-authorable `publicHolidays` array.\n\t */\n\tconst normaliseDate = (...date: string[]) =>\n\t\tdate.map(ddMm => ddMm.padStart(2, '0')).join('/');\n\n\tconst messageUsLink = fields.messageUsLink; // This is in fact text and NOT a link\n\n\tconst messageUsIcon = fields.messageUsIcon.value;\n\tconst onlineStatusMessage = fields.onlineStatusMessage;\n\tconst offlineStatusMessage = fields.offlineStatusMessage;\n\tconst publicHolidaysMessage = fields.publicHolidaysMessage;\n\tconst publicHolidays = fields.publicHolidays.map(phObj => {\n\t\tconst dd = phObj.fields.date.value;\n\t\tconst mm = phObj.fields.month.value;\n\n\t\treturn normaliseDate(dd, mm);\n\t});\n\n\t// Cannot be done inline lest we get prop-type inference false-positives\n\tconst messageUsLinkText = messageUsLink.value;\n\tconst onlineStatusMessageText = onlineStatusMessage.value;\n\n\tconst date = new Date();\n\tconst today = normaliseDate(\n\t\tdate.getDate().toString(),\n\t\t(date.getMonth() + 1).toString(),\n\t);\n\n\tconst isPublicHoliday = publicHolidays.includes(today);\n\n\t// Analytics spreadsheet:\n\t// - Section: 'Contact Us'\n\tconst { trackEvent } = useTrackEvent(\n\t\t{\n\t\t\tevent_section: 'navigation',\n\t\t\tevent_type: 'contact us',\n\t\t\tevent_title: '', // provided later\n\t\t},\n\t\tfalse,\n\t);\n\n\tconst MessageUs = () => (\n\t\t<>\n\t\t\t {\n\t\t\t\t\ttriggerLivePersonWindow();\n\t\t\t\t\t// Analytics spreadsheet:\n\t\t\t\t\t// - Section: 'Contact Us'\n\t\t\t\t\t// - ID: 1.3.1\n\t\t\t\t\ttrackEvent({\n\t\t\t\t\t\tevent_title: 'message us',\n\t\t\t\t\t\tevent_label: messageUsLinkText,\n\t\t\t\t\t\tevent_message: onlineStatusMessageText,\n\t\t\t\t\t\tevent_trigger: 'click button',\n\t\t\t\t\t});\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{/* Explaining LivePerson won't work in the Experience Editor */}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t{/* Ease of authoring for conditionally hidden JSS text */}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t>\n\t);\n\n\t// ------------------------------\n\t// Phone\n\n\tconst phoneIcon = fields.phoneIcon.value;\n\tconst phoneNumberLink = fields.phoneNumber;\n\tconst openingTimes = fields.openingTimes;\n\n\t// Cannot be done inline lest we get prop-type inference false-positives\n\tconst phoneNumberLinkText = phoneNumberLink.value.text;\n\tconst phoneNumberLinkUrl = phoneNumberLink.value.url;\n\tconst openingTimesText = openingTimes.value;\n\t// Override href attribute with url value, please read top comment to see why\n\tconst phoneNumberLinkProps = {\n\t\t...phoneNumberLink.value,\n\t\thref: phoneNumberLinkUrl,\n\t};\n\n\tconst PhoneUs = () => (\n\t\t {\n\t\t\t\t// Analytics spreadsheet:\n\t\t\t\t// - Section: 'Contact Us'\n\t\t\t\t// - ID: 1.3.3\n\t\t\t\ttrackEvent({\n\t\t\t\t\tevent_title: 'phone us',\n\t\t\t\t\tevent_label: openingTimesText,\n\t\t\t\t\tevent_message: '',\n\t\t\t\t\tevent_trigger: 'click link',\n\t\t\t\t\tevent_url: phoneNumberLinkUrl,\n\t\t\t\t});\n\t\t\t}}\n\t\t>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{isExperienceEditorActive() || isInSitecorePreviewOrEditMode() ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\tphoneNumberLinkText\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n\n\t// ------------------------------\n\t// Email\n\n\tconst emailIcon = fields.emailIcon.value;\n\tconst emailLink = fields.emailLink;\n\tconst emailUsAdditionalText = fields.emailUsAdditionalText;\n\n\t// Cannot be done inline lest we get prop-type inference false-positives\n\tconst emailLinkProps = emailLink.value;\n\tconst emailLinkText = emailLink.value.text;\n\tconst emailLinkHref = emailLink.value.href;\n\tconst emailUsAdditionalTextValue = emailUsAdditionalText.value;\n\n\tconst EmailUs = () => (\n\t\t {\n\t\t\t\t// Analytics spreadsheet:\n\t\t\t\t// - Section: 'Contact Us'\n\t\t\t\t// - ID: 1.3.2\n\t\t\t\ttrackEvent({\n\t\t\t\t\tevent_title: 'email us',\n\t\t\t\t\tevent_label: emailUsAdditionalTextValue,\n\t\t\t\t\tevent_message: '',\n\t\t\t\t\tevent_trigger: 'click link',\n\t\t\t\t\tevent_url: emailLinkHref,\n\t\t\t\t});\n\t\t\t}}\n\t\t>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{isExperienceEditorActive() || isInSitecorePreviewOrEditMode() ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\temailLinkText\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n\n\t// ------------------------------\n\t// Other contact methods\n\n\tconst otherContactMethodsIcon = fields.otherContactMethodsIcon.value;\n\tconst otherContactMethodsLink = fields.otherContactMethodsLink;\n\tconst otherContactMethodsAdditionalText =\n\t\tfields.otherContactMethodsAdditionalText;\n\n\t// Cannot be done inline lest we get prop-type inference false-positives\n\tconst otherContactMethodsLinkProps = otherContactMethodsLink.value;\n\tconst otherContactMethodsLinkText = otherContactMethodsLink.value.text;\n\tconst otherContactMethodsLinkHref = otherContactMethodsLink.value.href;\n\tconst otherContactMethodsAdditionalTextValue =\n\t\totherContactMethodsAdditionalText.value;\n\n\tconst OtherContactMethods = () => (\n\t\t {\n\t\t\t\t// Analytics spreadsheet:\n\t\t\t\t// - Section: 'Contact Us'\n\t\t\t\t// - ID: 1.3.4\n\t\t\t\ttrackEvent({\n\t\t\t\t\tevent_section: 'navigation',\n\t\t\t\t\tevent_type: 'contact us',\n\t\t\t\t\tevent_title: 'contact us',\n\t\t\t\t\tevent_label: otherContactMethodsAdditionalTextValue,\n\t\t\t\t\tevent_message: '',\n\t\t\t\t\tevent_trigger: 'click link',\n\t\t\t\t\tevent_url: otherContactMethodsLinkHref,\n\t\t\t\t});\n\t\t\t}}\n\t\t>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{isExperienceEditorActive() || isInSitecorePreviewOrEditMode() ? (\n\t\t\t\t\t\t\n\t\t\t\t\t) : (\n\t\t\t\t\t\totherContactMethodsLinkText\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t);\n\n\t// ------------------------------\n\n\treturn (\n\t\t\n\t\t\t{[MessageUs, EmailUs, PhoneUs, OtherContactMethods].map(ContactMethod => (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t))}\n\t\t\n\t);\n};\n\nexport default ContactUsBar;\n","/**\n * T01.E02 - Footer\n * The Footer is a module that comprises of a couple of separately\n * specced modules; namely, Footer & ContactUsBar.\n *\n * As such you'll see in this component's folder that it containers\n * `subcomponents` that cleanly make this separation (in addition to\n * further breaking down ContactUsBar into some smaller component atoms).\n *\n * LivePerson (click-to-chat) functionality is also implemented here in\n * the Footer (within ContactUsBar) and is handled in `MessageLivePerson.tsx`.\n */\n\nimport React from 'react';\nimport { compose } from 'recompose';\nimport { template } from 'lodash';\nimport ConditionalWrap from 'conditional-wrap';\n\nimport LayoutPadding from 'core/components/LayoutPadding';\nimport { withExperienceEditorContext } from 'core/sitecore/ExperienceEditorContext';\nimport ExperienceEditorContent from 'core/sitecore/experience-editor/ExperienceEditorContent';\nimport Cta from 'core/components/Cta';\nimport * as Typo from 'core/styles/Typography';\nimport { useAppContext, useTrackEvent } from 'core/hooks';\nimport TrackLinksWithin from 'core/analytics/TrackLinksWithin';\nimport { withMemberContext, isAuthenticated } from 'core/sitecore/member';\nimport { Member } from 'core/api/client/MemberApi';\nimport { LIVE_ASSIST_BUTTON_TEXT } from 'core/constants';\nimport { isInSitecorePreviewOrEditMode } from 'core/utils/global-utils';\n\nimport * as S from './Footer.style';\nimport { IFields } from './Footer.sitecore';\nimport UnauthenticatedFooter from './subcomponents/UnauthenticatedFooter';\nimport ContactUsBar from './subcomponents/ContactUsBar';\nimport { useShowComponentWithDelay } from '../hook';\nimport appView from '../appView';\n\ninterface IProps {\n\tfields: IFields;\n\tisExperienceEditorActive: boolean;\n\tmember: Member;\n}\n\nconst Footer = ({ fields, isExperienceEditorActive, member }: IProps) => {\n\tconst { footerLinks } = fields;\n\n\tif (typeof fields?.footerLinks === 'undefined' || !fields?.footerLinks) {\n\t\tconsole.log('[for monitoring] - auth footer fields: ', fields?.footerLinks);\n\t}\n\n\tconst isMemberAuthenticated = isAuthenticated(member);\n\tconst { isToShow: isToShowAuthenticatedFooter } = useShowComponentWithDelay(\n\t\t'footerHasBeenDelayedOnceKey',\n\t);\n\n\t// Analytics spreadsheet:\n\t// - Section: 'Footer'\n\tconst { trackEvent } = useTrackEvent(\n\t\t{\n\t\t\tevent_section: 'navigation',\n\t\t\tevent_type: 'footer',\n\t\t\tevent_title: 'links',\n\t\t},\n\t\tfalse,\n\t);\n\n\tconst { handleLivePersonModal, sitecoreContext } = useAppContext();\n\tconst maintenanceApiStatus =\n\t\tsitecoreContext?.maintenance?.maintenanceApiStatus ?? '';\n\n\tconst footerYearText = template(fields?.copyrightText?.value)({\n\t\tcurrentYear: new Date().getFullYear(),\n\t});\n\n\treturn (\n\t\t\n\t\t\t{/* 'Authenticated' Footer */}\n\t\t\t{((isMemberAuthenticated && isToShowAuthenticatedFooter) ||\n\t\t\t\tisExperienceEditorActive ||\n\t\t\t\tisInSitecorePreviewOrEditMode()) &&\n\t\t\t\t!appView() && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{footerLinks &&\n\t\t\t\t\t\t\t\t\t\tfooterLinks.map(({ id, fields }) =>\n\t\t\t\t\t\t\t\t\t\t\tfields?.footerLink?.value?.text !== undefined ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t{fields?.footerLink?.value?.text ===\n\t\t\t\t\t\t\t\t\t\t\t\t\tLIVE_ASSIST_BUTTON_TEXT ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleLivePersonModal(true);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{fields?.footerLink?.value?.text}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Analytics spreadsheet:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// - Section: 'Footer'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// - ID: 1.2.1; 1.2.2; 1.2.3; 1.2.4; 1.2.5\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrackEvent({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_section: 'navigation',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_type: 'footer',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_title: 'links',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_label: fields.footerLink.value.text?.toLowerCase(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_trigger: 'click link',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent_url: fields.footerLink.value.href,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`[For monitoring] Footer Auth - linktext value is ${fields?.footerLink?.value?.text}`,\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttrackEvent({\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent_label: text,\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent_trigger: 'click link',\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent_url: link,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{footerYearText}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)}\n\n\t\t\t{/* 'Unauthenticated' Footer */}\n\t\t\t{!isMemberAuthenticated && (\n\t\t\t\t (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\t\t\t{maintenanceApiStatus && (\n\t\t\t\t\n\t\t\t\t\tMaintenanceApiStatus: {maintenanceApiStatus}\n\t\t\t\t\n\t\t\t)}\n\t\t
\n\t);\n};\n\nexport default compose(\n\twithExperienceEditorContext,\n\twithMemberContext,\n)(Footer);\n"],"sourceRoot":""}