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AMU,EAAA,WAAO,+BAAe,OAAAC,KAAA,kCACpC,EACAF,EAAA,CACF,CAEJ,ECPaO,GAAe,IAAM,CAChC,MAAMxC,EAAmB9B,EAA0B,EAE7CuE,EAAcC,EAAmBC,GAAU,CAC/C,OAAQ,CAAE,MAAO3C,GAAkB,OAAO,WAAY,EACvD,EAGDL,mBAAU,IAAM,CACV,IAACK,EAAiB,WAAY,OAE9B,IAAA4C,EAAO,SAAS,cAAc,mBAAmB,EAEjDA,GAAM,OAAS5C,EAAiB,aAC/B4C,IACIA,EAAA,SAAS,cAAc,MAAM,EACpCA,EAAK,IAAM,OACX,SAAS,qBAAqB,MAAM,IAAI,CAAC,GAAG,YAAYA,CAAI,GAG9DA,EAAK,KAAO5C,EAAiB,aAC5B,CAACA,EAAiB,UAAU,CAAC,EAG7BtB,EAAA,IAAAmE,EAAA,CAAS,MAAAT,EACR,SAAAvD,OAACiE,IAAc,YAAAL,EACb,UAAA/D,EAAA,IAACqE,EAAe,QAAQC,GAAoBT,EAAM,CAAG,SACpDU,GAAa,KAChB,CACF,EAEJ,EC3BAC,GAAkB,EAElB,GAAI,MAAMC,GAASC,GAAUC,GAAS,EAAK,EAAG,CACtC,MAAAC,EAAiB,MAAMC,GAAkB,EAEzCC,EAAW,MAAMC,GAAY,EACnC,MAAMnH,GAASgH,EAAgB,CAAE,QAASI,GAAU,EAEpDC,GAAS,WAAW,SAAS,eAAe,MAAM,CAAE,EAAE,OACnDjF,MAAAkF,GAAM,WAAN,CACC,SAAAlF,EAAA,IAACmF,GAAA,CACC,aAAcC,GACd,aAAc,CAAE,qBAAsB,EAAM,EAC5C,SAAAN,EAEA,eAAChB,GAAa,KAElB,EACF,CACF","names":["fallbackLanguage","SUPPORTED_LANGUAGES","overridesMap","enHumanaOverrides","enEsiOverrides","enCareplusOverrides","enPaytientOverrides","esHumanaOverrides","esEsiOverrides","esCareplusOverrides","esPaytientOverrides","initI18n","clientId","vars","i18n","LanguageDetector","initReactI18next","translationEn","translationES","lang","override","getFooterProps","t","provider","website","logoUrl","sponsor","footerLinks","languageOptions","toggleLanguage","currentLanguage","rightsCopy","getYear","language","useCalculatorHelpSheetProps","useTranslation","resolvedLanguage","faqKey","contactInfo","useClientExperienceConfig","faq","useClientFaq","title","contactProps","CalculatorHelpSheet","props","helpBottomSheetProps","jsx","HelpBottomSheet","PaytientCustomFooterContent","jsxs","Flex","Text","MainLayout","navigate","useNavigate","location","useLocation","dispatch","useAppDispatch","isOpen","onOpen","onClose","useDisclosure","useEffect","getConfig","config","useAppSelector","selectConfig","experienceConfig","sponsorUrl","isHomeScreen","useMatch","isCalculatorScreen","isUnmetCriteriaScreen","isIncurredCostsScreen","isResultsScreen","isPaytientClient","getIsPaytientClient","showHelpButton","showBackButton","rightIcon","useMemo","onBackButtonClick","containerVariant","footerProps","Fragment","Container","Control","Icon","Outlet","Footer","ScrollRestoration","ErrorPage","error","useRouteError","addDatadogError","errorMessage","e","isRouteErrorResponse","Box","Heading","calculatorRouter","__vitePreload","n","store","resetEstimatedCosts","redirect","routes","AppContainer","customTheme","mergeThemeOverride","m3pTheme","link","Provider","ThemeProvider","RouterProvider","createBrowserRouter","LanguageSync","deleteHeapCookies","setupApi","API_HOST","OpenAPI","systemProvider","getSystemProvider","ldClient","getLDClient","CDN_HOST","ReactDOM","React","LDProvider","LD_CLIENT_KEY"],"ignoreList":[],"sources":["../../src/i18n/index.ts","../../src/layout/main/helpers.ts","../../src/layout/main/CalculatorHelpSheet.tsx","../../src/layout/main/PaytientCustomFooterContent.tsx","../../src/layout/main/index.tsx","../../src/pages/error-page.tsx","../../src/router/calculator.tsx","../../src/router/index.tsx","../../src/AppContainer.tsx","../../src/main.tsx"],"sourcesContent":["import i18n from \"i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport translationEn from \"./en/resource.json\";\nimport translationES from \"./es/resource.json\";\n\nimport enHumanaOverrides from \"./en/overrides/humana.json\";\nimport esHumanaOverrides from \"./es/overrides/humana.json\";\nimport enEsiOverrides from \"./en/overrides/esi.json\";\nimport esEsiOverrides from \"./es/overrides/esi.json\";\nimport enCareplusOverrides from \"./en/overrides/careplus.json\";\nimport esCareplusOverrides from \"./es/overrides/careplus.json\";\nimport enPaytientOverrides from \"./en/overrides/paytient.json\";\nimport esPaytientOverrides from \"./es/overrides/paytient.json\";\n\nconst fallbackLanguage = \"en\";\nconst SUPPORTED_LANGUAGES = [\"en\", \"es\"];\n\nconst overridesMap = {\n en: {\n humana: enHumanaOverrides,\n esi: enEsiOverrides,\n careplus: enCareplusOverrides,\n paytient: enPaytientOverrides,\n },\n es: {\n humana: esHumanaOverrides,\n esi: esEsiOverrides,\n careplus: esCareplusOverrides,\n paytient: esPaytientOverrides,\n },\n};\n\nexport const initI18n = async (\n clientId: string,\n vars: Record = {},\n) => {\n await i18n\n // detect user language\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(LanguageDetector)\n // pass the i18n instance to react-i18next.\n .use(initReactI18next)\n // init i18next\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n partialBundledLanguages: true,\n debug: false,\n fallbackLng: fallbackLanguage,\n returnNull: false,\n preload: SUPPORTED_LANGUAGES,\n resources: {\n en: {\n translation: translationEn,\n vars,\n },\n es: {\n translation: translationES,\n vars,\n },\n },\n ns: [\"translation\"],\n defaultNS: \"translation\",\n detection: {\n // order and from where user language should be detected\n order: [\"localStorage\", \"navigator\"],\n\n // local storage key\n lookupLocalStorage: \"i18nextLng\",\n\n // cache user language on\n caches: [\"localStorage\", \"cookie\"],\n excludeCacheFor: [\"cimode\"], // languages to not persist (cookie, localStorage)\n },\n });\n\n for (const lang of SUPPORTED_LANGUAGES) {\n const override = overridesMap[lang]?.[clientId];\n if (override) {\n i18n.addResourceBundle(lang, \"translation\", override, true, true);\n }\n }\n};\nexport default i18n;\n","import { TFunction, i18n as i18nType } from \"i18next\";\nimport { getYear } from \"date-fns\";\n\ntype GetFooterPropsInput = {\n t: TFunction;\n i18n: i18nType;\n provider: string;\n website: string;\n logoUrl: string;\n};\n\nexport const getFooterProps = ({\n t,\n i18n,\n provider,\n website,\n logoUrl,\n}: GetFooterPropsInput) => {\n const sponsor = {\n provider,\n website,\n linkAriaLabel: t(\n \"footer.sponsor.link.ariaLabel\",\n \"Link navigates to {{name}} page\",\n {\n name: provider,\n },\n ),\n logoUrl,\n logoAriaLabel: t(\"footer.sponsor.logo.ariaLabel\", \"{{name}} logo\", {\n name: provider,\n }),\n };\n\n const footerLinks = [\n {\n label: t(\"footer.links.terms.text\", \"Terms and Conditions\"),\n href: t(\"footer.links.terms.href\", \"#\"),\n ariaLabel: t(\"footer.links.terms.ariaLabel\", \"Terms and Conditions\"),\n },\n {\n label: t(\"footer.links.m3p.text\", \"Medicare Prescription Payment Plan\"),\n href: \"https://www.medicare.gov/prescription-payment-plan\",\n ariaLabel: t(\n \"footer.links.m3p.ariaLabel\",\n \"Medicare Prescription Payment Plan\",\n ),\n },\n ];\n\n const languageOptions = [\n { value: \"en\", label: t(\"footer.language.english\", \"English\") },\n { value: \"es\", label: t(\"footer.language.spanish\", \"Español\") },\n ];\n const toggleLanguage = (lang: string) => {\n i18n.changeLanguage(lang);\n };\n const currentLanguage = i18n.resolvedLanguage;\n\n const rightsCopy = t(\n \"footer.rights\",\n \"© {{year}} Paytient Technologies, Inc. All Rights Reserved.\",\n {\n year: getYear(new Date()),\n },\n );\n\n const language = {\n label: t(\"footer.language.select\", \"Select language\"),\n current: currentLanguage,\n onToggle: toggleLanguage,\n options: languageOptions,\n };\n\n return {\n sponsor,\n language,\n rightsCopy,\n footerLinks,\n };\n};\n","import { HelpBottomSheet, HelpBottomSheetProps } from \"@paytient/m3p-core/ui\";\nimport { useTranslation } from \"react-i18next\";\nimport { useClientFaq } from \"@paytient/m3p-core/hooks\";\nimport { useClientExperienceConfig } from \"src/hooks/useClientExperienceConfig\";\n\nexport type CalculatorHelpSheetProps = Pick<\n HelpBottomSheetProps,\n \"isOpen\" | \"onClose\"\n>;\n\nconst useCalculatorHelpSheetProps = () => {\n const { t, i18n } = useTranslation();\n const { resolvedLanguage } = i18n;\n const { faqKey, contactInfo } = useClientExperienceConfig();\n const faq = useClientFaq(`${faqKey}-pre-optin`, resolvedLanguage);\n\n // bottom sheet props\n const title = t(\"header.help\", \"Help\");\n const contactProps = {\n contactInfo: {\n message: t(\"home.contactUs.message\"),\n phone: contactInfo.phone,\n },\n buttonProps: {\n label: t(\"home.contactUs.button.text\", \"Call support\"),\n ariaLabel: t(\n \"home.contactUs.button.ariaLabel\",\n \"Button Calls to contact number\",\n ),\n },\n };\n\n return {\n title,\n contactProps,\n faqProps: {\n title: t(\"home.FAQs.title\", \"FAQs\"),\n markdown: faq,\n },\n };\n};\n\nexport function CalculatorHelpSheet(props: CalculatorHelpSheetProps) {\n const helpBottomSheetProps = useCalculatorHelpSheetProps();\n return (\n \n );\n}\n","import { useTranslation } from \"react-i18next\";\nimport { Flex } from \"@chakra-ui/react\";\nimport { Text } from \"@paytient/ui\";\n\nexport const PaytientCustomFooterContent = () => {\n const { t } = useTranslation();\n\n return (\n \n \n {t(\"calculator.footerPaytient.p1.main\")}\n \n \n {t(\"calculator.footerPaytient.p2.note\")}{\" \"}\n {t(\"calculator.footerPaytient.p2.main\")}{\" \"}\n \n {t(\"calculator.footerPaytient.p2.linkText\")}\n \n \n
\n \n {t(\"calculator.footerPaytient.p3.main\")}{\" \"}\n \n {t(\"calculator.footerPaytient.p3.linkText\")}\n \n \n
\n );\n};\n","import { useMemo, useEffect } from \"react\";\nimport {\n Outlet,\n useNavigate,\n useLocation,\n useMatch,\n ScrollRestoration,\n} from \"react-router-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Container, Flex } from \"@chakra-ui/react\";\nimport { useDisclosure } from \"@chakra-ui/hooks\";\nimport { Icon, Text } from \"@paytient/ui\";\nimport { Control, Footer } from \"@paytient/m3p-core/ui\";\nimport { useAppDispatch, useAppSelector } from \"src/redux\";\nimport { getConfig } from \"src/redux/modules/config/thunks/getConfig\";\nimport { selectConfig } from \"src/redux/modules/config/selectors/configSelectors\";\nimport { useClientExperienceConfig } from \"src/hooks/useClientExperienceConfig\";\nimport { getIsPaytientClient } from \"src/lib/getIsPaytientClient\";\nimport { getFooterProps } from \"./helpers\";\nimport { CalculatorHelpSheet } from \"./CalculatorHelpSheet\";\nimport { PaytientCustomFooterContent } from \"./PaytientCustomFooterContent\";\n\nexport const MainLayout = () => {\n const navigate = useNavigate();\n const location = useLocation();\n const dispatch = useAppDispatch();\n const { t, i18n } = useTranslation();\n const { isOpen, onOpen, onClose } = useDisclosure();\n\n useEffect(() => {\n dispatch(getConfig());\n }, [dispatch]);\n\n const config = useAppSelector(selectConfig);\n const experienceConfig = useClientExperienceConfig();\n const { provider } = config;\n const { logoUrl, sponsorUrl } = experienceConfig;\n\n const isHomeScreen = useMatch({\n path: \"/\",\n end: true,\n });\n const isCalculatorScreen = useMatch({\n path: \"/calculator\",\n end: false,\n });\n const isUnmetCriteriaScreen = useMatch({\n path: \"/calculator/unmet-criteria\",\n });\n const isIncurredCostsScreen = useMatch({\n path: \"/calculator/incurred-costs\",\n });\n const isResultsScreen = useMatch({\n path: \"/calculator/results\",\n });\n\n const isPaytientClient = getIsPaytientClient();\n\n const showHelpButton =\n !isPaytientClient &&\n (isHomeScreen || isUnmetCriteriaScreen || isResultsScreen);\n\n const showPaytientBackButton = !isIncurredCostsScreen;\n const showBackButton = isPaytientClient ? showPaytientBackButton : true;\n\n const rightIcon = useMemo(() => {\n if (showHelpButton) {\n return {\n icon: {t(\"header.help\", \"Help\")},\n onClick: onOpen,\n ariaLabel: t(\"header.help\", \"Help\"),\n };\n }\n }, [showHelpButton, onOpen, t]);\n\n const onBackButtonClick = () => {\n if (isHomeScreen) {\n // navigates to sponsor url\n window.location.replace(sponsorUrl);\n } else if (location.key === \"default\") {\n // solves edge case where user navigate to the calculator directly from url\n // and there is not a defined prev route to go back\n navigate(\"/\", { replace: true });\n } else {\n navigate(-1);\n }\n };\n\n const containerVariant = isCalculatorScreen ? \"reduced\" : undefined;\n\n const footerProps = useMemo(() => {\n return getFooterProps({ t, i18n, provider, website: sponsorUrl, logoUrl });\n }, [provider, sponsorUrl, t, i18n, logoUrl]);\n\n return (\n <>\n \n \n \n {showBackButton ? (\n ,\n onClick: onBackButtonClick,\n ariaLabel: t(\"header.back\", \"Back\"),\n }}\n rightIconProps={rightIcon}\n />\n ) : null}\n \n \n \n \n \n \n \n \n {isPaytientClient ? null : (\n \n )}\n \n );\n};\n","import { Box, Flex, Heading, Text } from \"@chakra-ui/react\";\nimport { addDatadogError } from \"@paytient/common\";\nimport { isRouteErrorResponse, useRouteError } from \"react-router-dom\";\n\nexport default function ErrorPage() {\n const error = useRouteError();\n addDatadogError(error);\n\n function errorMessage(e: unknown): string {\n if (isRouteErrorResponse(e)) {\n return `${e.status} ${e.statusText}`;\n } else if (e instanceof Error) {\n return e.message;\n } else if (typeof e === \"string\") {\n return e;\n } else {\n return \"Unknown error\";\n }\n }\n\n return (\n \n \n Oops!\n Sorry, an unexpected error has occurred.\n \n {errorMessage(error)}\n \n \n \n );\n}\n","import { redirect, RouteObject } from \"react-router-dom\";\nimport ErrorPage from \"src/pages/error-page\";\nimport { store } from \"src/redux\";\nimport { resetEstimatedCosts } from \"src/redux/modules/calculator/actions/resetEstimatedCosts\";\n\nexport const calculatorRouter: RouteObject = {\n path: \"/calculator\",\n errorElement: ,\n children: [\n {\n path: \"plan-start\",\n lazy: () => import(\"../pages/calculator/planStart/PlanStartPage\"),\n },\n {\n path: \"incurred-costs\",\n lazy: () => import(\"../pages/calculator/incurredCosts\"),\n },\n {\n path: \"unmet-criteria\",\n lazy: () => import(\"../pages/calculator/unmetCriteria\"),\n },\n {\n path: \"estimated-costs\",\n lazy: () => import(\"../pages/calculator/estimatedCosts\"),\n },\n {\n path: \"results\",\n lazy: () => import(\"../pages/calculator/results\"),\n },\n {\n index: true,\n path: \"*\",\n loader: async () => {\n store.dispatch(resetEstimatedCosts());\n return redirect(`/calculator/plan-start`);\n },\n },\n ],\n};\n","import { MainLayout } from \"src/layout/main\";\nimport ErrorPage from \"src/pages/error-page\";\n\nimport { calculatorRouter } from \"./calculator\";\n\n// Refer to https://reactrouter.com/en/main/route/lazy for adding loaders to routes to pre-fetch data or granular errorElements.\nexport const routes = [\n {\n path: \"/\",\n element: ,\n errorElement: ,\n children: [\n {\n path: \"/\",\n lazy: () => import(\"../pages/home\"),\n },\n calculatorRouter,\n ],\n },\n];\n","import { useEffect } from \"react\";\nimport { createBrowserRouter, RouterProvider } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport { mergeThemeOverride } from \"@chakra-ui/react\";\n\nimport { ThemeProvider } from \"@paytient/ui\";\nimport { LanguageSync, theme as m3pTheme } from \"@paytient/m3p-core/ui\";\n\nimport { routes } from \"./router\";\nimport { useClientExperienceConfig } from \"./hooks/useClientExperienceConfig\";\nimport { store } from \"./redux\";\n\nexport const AppContainer = () => {\n const experienceConfig = useClientExperienceConfig();\n\n const customTheme = mergeThemeOverride(m3pTheme, {\n colors: { brand: experienceConfig?.theme?.brandColors },\n });\n\n // effect to update favicon\n useEffect(() => {\n if (!experienceConfig.faviconUrl) return;\n\n let link = document.querySelector(\"link[rel~='icon']\") as HTMLLinkElement;\n\n if (link?.href === experienceConfig.faviconUrl) return;\n if (!link) {\n link = document.createElement(\"link\");\n link.rel = \"icon\";\n document.getElementsByTagName(\"head\")?.[0]?.appendChild(link);\n }\n\n link.href = experienceConfig.faviconUrl;\n }, [experienceConfig.faviconUrl]);\n\n return (\n \n \n \n \n \n \n );\n};\n","import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport axe from \"@axe-core/react\";\nimport { setupApi, deleteHeapCookies } from \"@paytient/m3p-core/utils\";\nimport { LDProvider } from \"launchdarkly-react-client-sdk\";\nimport { OpenAPI } from \"src/api\";\nimport { API_HOST, CDN_HOST, LD_CLIENT_KEY } from \"src/config\";\nimport { initI18n } from \"./i18n/index\";\nimport { AppContainer } from \"./AppContainer\";\nimport { getSystemProvider } from \"./lib/getSystemProvider\";\nimport { getLDClient } from \"./lib/getLDClient\";\n\nif (process.env.NODE_ENV !== \"production\") {\n axe(React, ReactDOM, 1000);\n}\n\ndeleteHeapCookies();\n\nif (await setupApi(API_HOST, OpenAPI, false)) {\n const systemProvider = await getSystemProvider();\n\n const ldClient = await getLDClient();\n await initI18n(systemProvider, { cdnHost: CDN_HOST });\n\n ReactDOM.createRoot(document.getElementById(\"root\")!).render(\n \n \n \n \n ,\n );\n}\n"],"file":"assets/index-Bo8vLfsw.js"}