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AA,EAAAA,MACAuC,SAASC,iBAAiB,oBAf1B,WAA4B,IAAD,OACzB,IAAMC,GAAY,YAAGF,SAASG,iBAAiB,uBAEJ,IAA3C,QACA,IAAK,IAAIC,GAAC,YAAG,GAAGA,EAAIF,EAAaG,SAAUD,EAAI,IAAD,QAC5CnB,EAAe,CAAEC,KAAMgB,EAAaE,QAiCvC3C,IAAAA,EAAAA,MAEDuC,SAASC,iBAAiB,sBAd1B,SAAiC9E,GAAI,IAAD,OAClC,OAAgCsC,IAAAA,EAAAA,MAAGtC,EAAEmF,QAA7BpB,EAAR,EAAQA,KAAMC,EAAd,EAAcA,UAAWzD,EAAzB,EAAyBA,MACzB,GAD4C+B,IAAAA,EAAAA,OACvCyB,EACH,OADU,IAAD,2BAEV,cAED,IAAMqB,GAAa,YAAGrB,EAAKmB,QAAM5C,IAAAA,EAAAA,GAAAA,KAAGyB,EAAK,KAAEzB,IAAAA,EAAAA,GAAAA,KAAGyB,IAC9C,GADmDzB,IAAAA,EAAAA,OAC9C8C,EACH,OADmB,IAAD,2BAEnB,0BAEDtB,EAAe,CAAEC,KAAMqB,EAAepB,UAAAA,EAAWzD,MAAAA,OAKnD+B,IAAAA,EAAAA,MAMAuC,SAASC,iBAAiB,sBAAuB9E,SAAAA,GAAO,IAAD,mBACrD0E,EAAAA,uBAAgC1E,EAAEmF,OAAOpB,SAG3C,KAAiBsB,SA9GjB,SAAkBC,GAAa,IAAD,mBAO5BzB,EAAoB,iBAAQA,EAAyByB,IAuG5BxB,eAAAA","sources":["webpack://StravaModern/./app/javascript/components/shared/FormattedHTMLMessage/index.js","webpack://StravaModern/./app/javascript/utils/I18n.js","webpack://StravaModern/./app/javascript/utils/react-component-mounter.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst FormattedHTMLMessage = ({ tagName, message, className, onLinkClick }) => {\n const handleLinkClick = (e) => {\n if (e.target.nodeName === 'A' && !!onLinkClick) {\n onLinkClick(e);\n }\n };\n\n return React.createElement(tagName, {\n className,\n dangerouslySetInnerHTML: {\n __html: message\n },\n onClick: handleLinkClick\n });\n};\n\nFormattedHTMLMessage.propTypes = {\n message: PropTypes.string.isRequired,\n tagName: PropTypes.string,\n className: PropTypes.string,\n onLinkClick: PropTypes.func\n};\n\nFormattedHTMLMessage.defaultProps = {\n tagName: 'span',\n className: null,\n onLinkClick: null\n};\n\nexport default FormattedHTMLMessage;\n","import React from 'react';\n\nimport FormattedHTMLMessage from '../components/shared/FormattedHTMLMessage';\n\nfunction t(key, props = {}) {\n return window.Strava.I18n.Locale.t(key, props);\n}\n\nfunction elevationFormatter(unitSystem) {\n return new window.Strava.I18n.ElevationFormatter(unitSystem);\n}\n\nfunction elevationLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelElevationFormatter(unitSystem);\n}\n\nfunction distanceFormatter(unitSystem) {\n return new window.Strava.I18n.DistanceFormatter(unitSystem);\n}\n\nfunction distanceLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelDistanceFormatter(unitSystem);\n}\n\nfunction distancePerTimeFormatter(unitSystem) {\n return new window.Strava.I18n.DistancePerTimeFormatter(unitSystem);\n}\n\nfunction distancePerTimeLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelDistancePerTimeFormatter(unitSystem);\n}\n\nfunction percentFormatter() {\n return new window.Strava.I18n.PercentFormatter();\n}\n\nfunction timespanFormatter() {\n return new window.Strava.I18n.TimespanFormatter();\n}\n\nexport default {\n t,\n t_html(key, props = {}, options = {}) {\n return ;\n },\n elevationFormatter,\n elevationLabelFormatter,\n distanceFormatter,\n distanceLabelFormatter,\n distancePerTimeFormatter,\n distancePerTimeLabelFormatter,\n percentFormatter,\n timespanFormatter,\n language() {\n return window.Strava.I18n.Locales.LANGUAGE_CODE;\n },\n measurementUnits() {\n return window.Strava.I18n.UnitSystem.get();\n }\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ContainerContext from '@strava/container-context';\nimport {\n logError,\n logMessage,\n setTag,\n setTags,\n setContext,\n withScope\n} from './sentry';\nimport I18n from '../utils/I18n';\n\nconst {\n AnalyticsContext,\n ErrorLoggingContext,\n TranslationContext\n} = ContainerContext;\n\nconst { Provider: AnalyticsProvider } = AnalyticsContext;\nconst { Provider: TranslationProvider } = TranslationContext;\nconst { Provider: ErrorLoggingProvider } = ErrorLoggingContext;\n\nconst analyticsContext = {\n track: (data) => window.Strava.ExternalAnalytics.trackV2(data)\n};\n\nconst translationContext = {\n t: (key, props = {}) => I18n.t(key, props),\n getLanguage: () => I18n.language()\n};\n\nconst errorLoggingContext = {\n logError,\n logMessage,\n setContext,\n setTag,\n setTags,\n withScope\n};\n\n// Object that stores references to all the registered components\nlet registeredComponents = {};\n\n// Track a single component that should be mounted after the DOM content has loaded\nfunction register(components) {\n // Registered components are passed in as Hash keys (as opposed to individual arguments)\n // in order to preserve their names during JavaScript minification.\n //\n // For example:\n // ReactComponentMounter.register({ Hello });\n\n registeredComponents = { ...registeredComponents, ...components };\n}\n\nfunction mountComponent({ node, component, props }) {\n const className = component || node.getAttribute('data-react-class');\n const reactComponent = registeredComponents[className];\n\n if (!reactComponent) {\n logMessage(`Cannot find a component registered with the name ${className}`);\n return;\n }\n\n const propsJson = node.getAttribute('data-react-props');\n try {\n const reactProps = {\n ...(propsJson && JSON.parse(propsJson)),\n ...props\n };\n\n let reactElement = React.createElement(reactComponent, reactProps);\n\n // react-components imported from published `web` packages\n // these packages are developed locally using MFEs so they need\n // providers from @strava-container-context\n const isPublished = node.getAttribute('data-is-published') === 'true';\n if (isPublished) {\n reactElement = (\n \n \n \n {reactElement}\n \n \n \n );\n }\n\n ReactDOM.render(reactElement, node);\n } catch (e) {\n logError(e);\n }\n}\n\n// Allows a page to mount a component right away rather than\n// wait for the DOMContentLoaded event\nfunction inlineMount(node, component) {\n mountComponent({ node, component });\n}\n\n// Search the DOM for all react components to be mounted,\n// and mount them into the DOM\nfunction mountComponents() {\n const nodesToMount = document.querySelectorAll('[data-react-class]');\n // IE does not support NodeList.forEach, so we need to do it the old fashion way\n /* eslint-disable-next-line no-plusplus */\n for (let i = 0; i < nodesToMount.length; ++i) {\n mountComponent({ node: nodesToMount[i] });\n }\n}\n\n// Ensure pages can mount components more specifically\nif (window.stravaInlineMount === undefined) {\n window.stravaInlineMount = inlineMount;\n}\n\n// Add this listener only once, when the module is first imported\ndocument.addEventListener('DOMContentLoaded', mountComponents);\n\n/**\n * Also added once, this listener can be used to render react components\n * that were created after the DOM was loaded via the ruby `react_component` helper\n *\n * example usage:\n *\n * document.dispatchEvent(new CustomEvent('JSCreatedReactNode', {detail: {node: $('#my-react-component')}}))\n * document.dispatchEvent(new CustomEvent('JSCreatedReactNode', {detail: {node: $('#my-react-component')[index]}}))\n */\nfunction mountJSCreatedComponent(e) {\n const { node, component, props } = e.detail;\n if (!node) {\n return;\n }\n\n const unwrappedNode = node.length ? node[0] : node;\n if (!unwrappedNode) {\n return;\n }\n\n mountComponent({ node: unwrappedNode, component, props });\n}\n\ndocument.addEventListener('JSCreatedReactNode', mountJSCreatedComponent);\n\n/**\n * Components mounted using certain erb - jquery setup do not go through their whole\n * lifecyle so they are left unmounted as the athlete interacts on the page.\n *\n * For examples, see interval.js.rb, graph_data_range.js.rb and interval_type.js.rb\n */\ndocument.addEventListener('JSUnmountReactNode', (e) => {\n ReactDOM.unmountComponentAtNode(e.detail.node);\n});\n\nexport default { register, mountComponent };\n"],"names":["cov_26k0eqz9ch","FormattedHTMLMessage","_ref","tagName","message","className","onLinkClick","React","dangerouslySetInnerHTML","__html","onClick","e","target","nodeName","defaultProps","cov_2r1tokpcg7","t","key","props","window","Strava","I18n","Locale","t_html","options","_extends","elevationFormatter","unitSystem","ElevationFormatter","elevationLabelFormatter","ChartLabelElevationFormatter","distanceFormatter","DistanceFormatter","distanceLabelFormatter","ChartLabelDistanceFormatter","distancePerTimeFormatter","DistancePerTimeFormatter","distancePerTimeLabelFormatter","ChartLabelDistancePerTimeFormatter","percentFormatter","PercentFormatter","timespanFormatter","TimespanFormatter","language","Locales","LANGUAGE_CODE","measurementUnits","UnitSystem","get","cov_nd2f96vxg","ContainerContext","AnalyticsContext","ErrorLoggingContext","TranslationContext","AnalyticsProvider","Provider","TranslationProvider","ErrorLoggingProvider","analyticsContext","track","data","ExternalAnalytics","trackV2","translationContext","getLanguage","errorLoggingContext","logError","logMessage","setContext","setTag","setTags","withScope","registeredComponents","mountComponent","node","component","getAttribute","reactComponent","propsJson","reactProps","JSON","parse","reactElement","isPublished","value","ReactDOM","undefined","stravaInlineMount","document","addEventListener","nodesToMount","querySelectorAll","i","length","detail","unwrappedNode","register","components"],"sourceRoot":""}