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-app/./src/shared/parser/parseDetailList.ts","webpack://data-library-mf-app/./src/shared/parser/parseRiskReturnMetrics.ts","webpack://data-library-mf-app/./src/shared/parser/parseAllocations.ts","webpack://data-library-mf-app/./src/pages/Detail/Detail.tsx","webpack://data-library-mf-app/./src/shared/parser/parseDetailHeader.tsx","webpack://data-library-mf-app/./src/shared/parser/parseDetailAnnualizedReturn.ts"],"sourcesContent":["import { isEmpty, get } from 'lodash';\nimport { parseValueFromField } from 'shared/utils/helper.util';\nimport { parseValueType } from 'shared/utils/format.util';\nimport {countSymbols} from \"../utils/string.utils\";\n\nconst parseDetailList = (source: any, type: string, configData: any, appConfig?: any) => {\n if (isEmpty(source)) return;\n // console.log(\n // '>>>>>>>>>>>> ',\n // type,\n // configData,\n // ':::: ',\n // get(source, 'ProductOverview.ProductType')\n // );\n const productType = get(source, 'ProductOverview.ProductType');\n const isAI = productType === 'AI';\n const newConfig = isAI\n ? configData.filter((item: any) => item.accessor !== 'FundDocument.Prospectus.EN_SG.External')\n : configData.filter((item: any) => item.accessor !== 'FundDocument.Memorandum.EN_SG.External');\n\n return Array.from([...newConfig]).map((item: any) => {\n const inputValue = get(source, item.accessor);\n\n let finalValue = parseValueType(\n item.type,\n inputValue,\n get(source, item.otherAccessor),\n '',\n source,\n appConfig,\n parseValueFromField(item, 'label'),\n true\n );\n if (item.type == 'compositeBenchmark') {\n const countRs = countSymbols(get(source, item.accessor), ' + ', '%');\n const tooLong = countRs[' + '] >= 2 && countRs['%'] >= 3;\n finalValue = parseValueType(\n item.type,\n tooLong ? `Composite benchmark___${inputValue}` : inputValue,\n get(source, item.otherAccessor),\n '',\n source,\n appConfig,\n parseValueFromField(item, 'label'),\n true\n );\n }\n return {\n key: parseValueFromField(item, 'label'),\n // finalValue: item.finalValue(parseValueFromField(data, item.id)),\n value: finalValue,\n isTranslate: item.isTranslate,\n };\n });\n};\n\nexport default parseDetailList;\n","import { get } from 'lodash';\nimport { formatNumber, formatDateToYearMonthDay } from 'shared/utils/format.util';\n\nconst parseRiskReturnMetrics = (data: any, detailConfig: any) => {\n const riskConfig = get(detailConfig, 'riskReturnMetrics');\n const parsedData = Array.from(riskConfig).map((item: any) => ({\n id: item.id,\n riskVsCategoryScore: get(data, item.riskVsCategoryScore),\n returnVsCategoryScore: get(data, item.returnVsCategoryScore),\n benchmarkName: get(data, item.benchmarkName, ''),\n calculationBenchmarkName: get(data, item.calculationBenchmarkName, ''),\n benchmarkDate: formatDateToYearMonthDay(get(data, item.benchmarkDate, '')),\n benchmarkCurrency: get(data, item.benchmarkCurrency, ''),\n categoryName: get(data, item.categoryName, ''),\n categoryDate: formatDateToYearMonthDay(get(data, item.categoryDate, '')),\n categoryCurrency: get(data, item.categoryCurrency, ''),\n ranking: get(data, item.ranking, 0),\n data: Array.from(item.data).map((dItem: any) => ({\n trailing: dItem.trailing,\n fund: get(data, dItem.fund) ? formatNumber(get(data, dItem.fund)) : '-',\n category: get(data, dItem.category) ? formatNumber(get(data, dItem.category)) : '-',\n })),\n }));\n return parsedData;\n};\n\nexport default parseRiskReturnMetrics;\n","import type { IAllocation } from 'components/common/Allocations/Allocations';\nimport { parseValueFromField } from 'shared/utils/helper.util';\nimport { formatPercentage } from 'shared/utils/format.util';\nimport { get } from 'lodash';\n\nexport interface IPortfolios {\n AssetAllocation?: IAllocation;\n GeographicalAllocation?: IAllocation;\n SectorAllocation?: IAllocation;\n TopHolding?: IAllocation;\n}\n\nconst parseAllocations = (portfolios: IPortfolios | undefined) => {\n const defaultVal = { data: [], updateDate: '', id: '' };\n const assetAllocation = get(portfolios, 'AssetAllocation', defaultVal);\n assetAllocation.data = assetAllocation?.data.map((entry) => ({\n ...entry,\n value: Number(entry.value),\n type: 'asset',\n }));\n assetAllocation.id = 'asset';\n\n const geographicAllocation = get(portfolios, 'GeographicalAllocation', defaultVal);\n geographicAllocation.data = geographicAllocation?.data.map((entry) => ({\n ...entry,\n value: Number(entry.value),\n type: 'geographical',\n }));\n geographicAllocation.id = 'geographical';\n\n const sectorAllocation = get(portfolios, 'SectorAllocation', defaultVal);\n sectorAllocation.data = sectorAllocation?.data.map((entry) => ({\n ...entry,\n value: Number(entry.value),\n type: 'sector',\n }));\n sectorAllocation.id = 'sector';\n\n const topHoldings = get(portfolios, 'TopHolding', defaultVal);\n topHoldings.id = 'topHoldings';\n\n return Array.from([assetAllocation, geographicAllocation, sectorAllocation, topHoldings]);\n};\n\nexport default parseAllocations;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useLayoutEffect, useEffect, memo, useState, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useIntl } from 'react-intl';\nimport ScrollSpy from 'react-ui-scrollspy';\nimport { get, isEmpty } from 'lodash';\n// import { setRestClientToken } from 'shared/services/rest.svc';\nimport { LayoutDetail } from 'layouts';\nimport { ISharedProps } from 'shared/interfaces';\n// import { State } from 'shared/context/types/stateTypes';\nimport { useWindowSize } from 'shared/customHooks';\nimport { icons } from 'shared/constant';\nimport {\n ScrollSpyNav,\n ErrorDisplay,\n PageLoader,\n PerformanceChart,\n Disclaimer,\n Allocations,\n SectionHeader,\n ErrorBoundary,\n} from 'components/common';\nimport {\n FundHeader,\n AnnualisedReturns,\n DetailList,\n Dividend,\n AdvancedRiskReturnMetrics,\n} from 'components/details';\n// import { IDetailListProps } from 'components/details/DetailList/DetailList';\nimport { useDetail, useQuery as useQueryString } from 'shared/customHooks';\nimport { useContextSelector, useContext as useContextFl } from 'use-context-selector';\nimport {\n // getTemporaryUID,\n getAuthToken,\n getTimeseries,\n getTimeseriesNAV,\n} from 'shared/context/selectors';\nimport { FlContext } from 'shared/context';\nimport {\n initLanguage,\n // storeIsTokenValid,\n // onGetUserPreferences,\n // onSavedRecentView,\n // validateTokenAccess,\n saveIsComingFromOtherPage,\n initializeDetailPerformanceTS,\n initDefaultDetailTimeseries,\n} from 'shared/context/actions';\n// import { IRecentView, IUserPreference } from 'shared/interfaces';\nimport { ThemeContext } from '@newwealth/component-library';\nimport {\n parseDetailHeader,\n parseDetailAnnualizedReturn,\n // parseDetailFundFacts,\n // parseDetailFees,\n parseDetailList,\n parseRiskReturnMetrics,\n} from 'shared/parser';\nimport { formatDateToYearMonthDay } from 'shared/utils/format.util';\nimport parseAllocations from 'shared/parser/parseAllocations';\nimport type { IDividendProps } from 'components/details/Dividend/Dividend';\nimport PerformanceTableModal from 'components/common/PerformanceTableModal';\n// import './Detail.scss';\n// import { themeConfig } from 'shared/constant/themeConfig';\n\nfunction Detail({ userId, detailConfig, appInitConfig, ...props }: ISharedProps) {\n const intl = useIntl();\n const queryString = useQueryString();\n const themeConfig = React.useContext(ThemeContext);\n const pageQuery = queryString.get('page');\n // const accessToken = queryString.get('token');\n const navigate = useNavigate();\n const getId: string = queryString.get('id') || '';\n const preview: string = queryString.get('preview') || 'false';\n const detailEndpoint = get(appInitConfig, 'detailUrl');\n const tsEndpoint = get(appInitConfig, 'timeseriesUrl');\n const identifier = get(appInitConfig, 'identifier');\n const { status, data, error, isFetching } = useDetail(detailEndpoint, getId, preview);\n const { state, dispatch } = useContextFl(FlContext);\n // const tempUID = useContextSelector(FlContext, (state: any) => getTemporaryUID(state));\n const generatedAuthToken = useContextSelector(FlContext, (state: any) => getAuthToken(state));\n const timeseries = useContextSelector(FlContext, (state: any) => getTimeseries(state));\n const timeseriesNAV = useContextSelector(FlContext, (state: any) => getTimeseriesNAV(state));\n\n const [activeSpyLink, setActiveSpyLink] = useState(null);\n\n // const userPreferences = useContextSelector(FlContext, (state: any) => getUserPreferences(state));\n // console.log('detailConfig:: ', detailConfig);\n // const isAccessTokenValid = get(state.commonReducer, 'isAuthenticated', false);\n const windowSize = useWindowSize();\n const [wrapperSize, setWrapperSize] = useState('');\n const [currentGraph, setCurrentGraph] = useState('returns');\n const isReturnGraph = currentGraph === 'returns';\n\n const manageBackLink = pageQuery ? `/?page=${pageQuery}` : '/';\n\n // main tab list\n const navList = useMemo(() => {\n const defaultList = [\n {\n to: 'performance',\n label: intl.formatMessage({ id: 'scrollSpy.performance' }),\n offset: -80,\n },\n {\n to: 'allocations',\n label: intl.formatMessage({ id: 'scrollSpy.allocations' }),\n offset: -66,\n },\n {\n to: 'adv-risk-returns',\n label: intl.formatMessage({ id: 'scrollSpy.riskReturn' }),\n offset: -66,\n },\n ];\n const navArr = [...detailConfig.data_list].map((item: any) => ({\n to: item.id,\n label: item.isTranslate ? intl.formatMessage({ id: item.title }) : item.title,\n offset: -140,\n }));\n return [...defaultList, ...navArr];\n }, []);\n\n useEffect(() => {\n const title = data?.ProductOverview?.LegalName?.EN_SG;\n if (title !== undefined) {\n document.title = `${title} | ILP Fund Center`;\n }\n }, [data?.ProductOverview?.LegalName?.EN_SG]);\n\n useEffect(() => {\n saveIsComingFromOtherPage(true)(dispatch);\n // if (!isEmpty(generatedAuthToken)) {\n // setRestClientToken();\n // }\n }, [generatedAuthToken]);\n\n // Listen to window height changes then update wrapper size for responsive height\n useLayoutEffect(() => {\n const mainWrapperElement = document.getElementById('main-detail');\n setWrapperSize(`${mainWrapperElement?.clientHeight}px`);\n }, [windowSize.height]);\n\n // initialise language & auth\n useEffect(() => {\n if (props?.language) {\n initLanguage(props?.language)(dispatch);\n }\n // if (!props?.includeRouterRoot) {\n // // if for linx platform, dispatch isAuth prop\n // storeIsTokenValid(props?.isAuthenticated)(dispatch);\n // } else if (accessToken) {\n // // if for demo, get access token in the search query then validate\n // validateTokenAccess(accessToken)(dispatch);\n // } else {\n // // otherwise, dispatch false to isAuth to restrict user\n // storeIsTokenValid(false)(dispatch);\n // }\n }, [props?.language, props?.isAuthenticated, props?.includeRouterRoot]);\n\n // Get User Preference from the API\n // const invokeGetUserPref = async (id: string) => {\n // try {\n // const res: IUserPreference | any = await onGetUserPreferences(id)(dispatch);\n // if (status === 'success') {\n // const isin = get(data, 'ProductOverview.ISIN');\n // if (\n // get(res, 'recentViews', []).findIndex((item: IRecentView) => item.isin === isin) !== 0\n // ) {\n // const fundHouse = get(data, 'ProductOverview.BrandingCompanyName.FR_FR');\n // const fundName = get(data, 'ProductOverview.MfexFundName.FR_FR');\n // const readyToTrade = get(data, 'ProductOverview.ReadyToTrade') === 'True' ? true : false;\n // const rebateEligibility =\n // get(data, 'ProductOverview.RebateEligibility') === 'True' ? true : false;\n // // const isDistribution = get(data, 'Performance.DividendType') === 'CASH' ? true : false;\n // const isDistribution = false; // @todo map to correct field\n // const fundData: IRecentView = {\n // isin,\n // fundHouse,\n // fundName,\n // readyToTrade,\n // rebateEligibility,\n // isDistribution,\n // };\n // await onSavedRecentView(id, fundData)(res, dispatch);\n // }\n // }\n // } catch (err) {\n // // we don't need to notify user that tracking recelty view is not working\n // console.error('error getting the user preferences', err);\n // }\n // };\n\n // Get user preferences if user/tempuid it exist\n // useEffect(() => {\n // if (userId === undefined && !props.includeRouterRoot) console.log('missing userId', userId);\n // if (userId && generatedAuthToken && isAccessTokenValid && status === 'success') {\n // invokeGetUserPref(userId as string);\n // }\n // if (\n // props.includeRouterRoot &&\n // tempUID &&\n // generatedAuthToken &&\n // isAccessTokenValid &&\n // status === 'success'\n // ) {\n // invokeGetUserPref(tempUID);\n // }\n // }, [userId, props.includeRouterRoot, tempUID, generatedAuthToken, status]);\n\n // Get timeseries (returns & NAV)\n useEffect(() => {\n if (data !== undefined && get(data, `ProductOverview.${identifier}`) === getId) {\n const payload = {\n accessor: getId || get(data, `ProductOverview.${identifier}`),\n inceptionDate: formatDateToYearMonthDay(get(data, 'ProductOverview.InceptionDate')),\n navDate: formatDateToYearMonthDay(get(data, 'Price.NAV.Date')),\n currency: get(data, 'Price.NAV.Currency'),\n };\n const endpointUrl = tsEndpoint;\n\n // init Returns TS\n initializeDetailPerformanceTS({\n ...payload,\n keyLine: 'Performance',\n isTsNAV: false,\n endpointUrl,\n })(timeseries, dispatch);\n\n // init NAV TS\n initializeDetailPerformanceTS({ ...payload, keyLine: 'NAV', isTsNAV: true, endpointUrl })(\n timeseriesNAV,\n dispatch\n );\n }\n\n // on unmount, reset timeseries to defaults\n return () => {\n initDefaultDetailTimeseries()(dispatch);\n };\n }, [data, getId]);\n\n // Dividend Data\n const dividendData = useMemo(() => {\n const dividendType = get(data, 'DividendYield.IncomeDistribution', '');\n const distFreq = get(data, 'DividendYield.DividendDistributionFrequency', '');\n const yield12Mo = get(data, 'DividendYield.YieldM12', '');\n const exDivDate = get(data, 'DividendYield.LastExDate', '');\n return {\n dividendType,\n distFreq,\n yield12Mo,\n exDivDate,\n } as IDividendProps;\n }, [data]);\n\n const onSelectGraph = (name: string) => {\n setCurrentGraph(name);\n };\n\n if (error) return