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ACpBmC,OAAOC,aAAaxB,SAAW,IAC/BD,EAAQC,SAGXuB,OAAOC,aAAavB,YAAWb,EAAAA,EAAA,GAC5BmC,OAAOC,aAAavB,aAAe,IACnCF,EAAQE,aAEY,MAAMwB,EAAiB,GAC9BA,EAAe,yFAA2F,CAClHvB,EAAGA,IAAMC,EAAQ,MACjBuB,GAAI,oDAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcrC,EAAAA,EAAA,GACPmC,OAAOC,aAAaC,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAUhH,cCAjB+G,EAAOC,QAAUC","sources":["webpack://Dobbies.Commerce/./src/modules/dobbies-account-loyalty-tile/components/dobbies-account-loyalty-tile-description.tsx?15dc","webpack://Dobbies.Commerce/./src/modules/dobbies-account-loyalty-tile/components/dobbies-account-loyalty-tile-links.tsx?2088","webpack://Dobbies.Commerce/./src/modules/dobbies-account-loyalty-tile/dobbies-account-loyalty-tile.tsx?59b4","webpack://Dobbies.Commerce/./src/modules/dobbies-account-loyalty-tile/dobbies-account-loyalty-tile.view.tsx?a8c5","webpack://Dobbies.Commerce/./lib/dobbies-account-loyalty-tile/module-registration.js?e75a","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface IAccountLoyaltyTileDescription {\r\n description: string;\r\n}\r\n\r\n// eslint-disable-next-line no-redeclare\r\nconst IAccountLoyaltyTileDescription: React.FC = ({ description }) => (\r\n

{description}

\r\n);\r\n\r\nexport default IAccountLoyaltyTileDescription;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { ILinkData } from '@msdyn365-commerce/core';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ILinksData {\r\n linkText?: string;\r\n linkUrl: ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IAccountLoyaltyTileLinks {\r\n links: ILinksData[];\r\n requestContext: Msdyn365.IRequestContext;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onTextChange?(index: number): (event: Msdyn365.ContentEditableEvent) => void;\r\n}\r\n\r\nconst AccountLoyaltyTileLinks: React.FC = ({ links, telemetryContent, onTextChange, requestContext }) => {\r\n if (links.length === 0) {\r\n return null;\r\n }\r\n const editableLinks = _mapEditableLinks(links, telemetryContent);\r\n return (\r\n
\r\n {editableLinks && editableLinks.length > 0 ? (\r\n \r\n ) : null}\r\n
\r\n );\r\n};\r\nconst _mapEditableLinks = (linkdata: ILinksData[], telemetryContent?: ITelemetryContent): Msdyn365.ILinksData[] | null => {\r\n if (!linkdata || linkdata.length === 0) {\r\n return null;\r\n }\r\n const editableLinks: Msdyn365.ILinksData[] = [];\r\n const payLoad = getPayloadObject('click', telemetryContent!, '');\r\n linkdata.forEach((link, index) => {\r\n payLoad.contentAction.etext = link.linkText;\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const editableLink: Msdyn365.ILinksData = {\r\n ariaLabel: link.ariaLabel,\r\n className: 'ms-account-loyalty-tile__link',\r\n linkText: link.linkText,\r\n linkUrl: link.linkUrl.destinationUrl,\r\n openInNewTab: link.openInNewTab,\r\n role: 'link',\r\n additionalProperties: attributes\r\n };\r\n editableLinks.push(editableLink);\r\n });\r\n\r\n return editableLinks;\r\n};\r\n\r\nexport default AccountLoyaltyTileLinks;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { LoyaltyRewardPoint } from '@msdyn365-commerce/retail-proxy';\r\nimport { format, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IDobbiesAccountLoyaltyTileData } from './dobbies-account-loyalty-tile.data';\r\nimport { IDobbiesAccountLoyaltyTileProps } from './dobbies-account-loyalty-tile.props.autogenerated';\r\nimport DescriptionComponent from './components/dobbies-account-loyalty-tile-description';\r\nimport LinksComponent from './components/dobbies-account-loyalty-tile-links';\r\n\r\nexport interface IAccountLoyaltyTileViewProps extends IDobbiesAccountLoyaltyTileProps {\r\n AccountLoyaltyTile: IModuleProps;\r\n className: string;\r\n heading?: React.ReactNode;\r\n links?: React.ReactNode;\r\n description?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * AccountLoyalty component.\r\n * @extends {React.PureComponent>}\r\n */\r\nclass AccountLoyaltyTile extends React.PureComponent> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n constructor(props: IDobbiesAccountLoyaltyTileProps) {\r\n super(props);\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { config, data, resources, context } = this.props;\r\n const { className, heading, signUpLinkText, signUpLinkAriaLabel, viewLinkText, viewLinkAriaLabel } = config;\r\n const { accountLoyaltySummary, accountLoyaltyMemberSummary } = resources;\r\n const { loyaltyCard } = data;\r\n\r\n let description = accountLoyaltySummary;\r\n let url = Msdyn365.getUrlSync('loyaltyJoin', context.actionContext) || '';\r\n const link = { linkText: signUpLinkText, linkUrl: { destinationUrl: url }, ariaLabel: signUpLinkAriaLabel };\r\n\r\n if (loyaltyCard && loyaltyCard.result && loyaltyCard.result.CardNumber) {\r\n const decimalPrecision = 0;\r\n let points = 0;\r\n\r\n if (loyaltyCard.result.RewardPoints && loyaltyCard.result.RewardPoints.length > 0) {\r\n loyaltyCard.result.RewardPoints.forEach((rewardPoint: LoyaltyRewardPoint) => {\r\n points += rewardPoint.ActivePoints!;\r\n });\r\n }\r\n link.ariaLabel = viewLinkAriaLabel;\r\n link.linkText = viewLinkText;\r\n url = Msdyn365.getUrlSync('loyalty', context.actionContext) || '';\r\n link.linkUrl.destinationUrl = url;\r\n description = format(accountLoyaltyMemberSummary, points.toFixed(decimalPrecision));\r\n }\r\n\r\n const viewProps = {\r\n ...this.props,\r\n className,\r\n AccountLoyaltyTile: {\r\n moduleProps: this.props,\r\n className: classnames('ms-account-loyalty-tile', config.className)\r\n },\r\n heading: heading && (\r\n \r\n ),\r\n links: (\r\n \r\n ),\r\n description: \r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading.text = event.target.value);\r\n\r\n public handleLinkTextChange = (linkIndex: number) => (event: Msdyn365.ContentEditableEvent) => {\r\n if (this.props.config.signUpLinkText && this.props.config.viewLinkText) {\r\n this.props.config.viewLinkText = event.target.value;\r\n }\r\n };\r\n}\r\n\r\nexport default AccountLoyaltyTile;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAccountLoyaltyTileViewProps } from './dobbies-account-loyalty-tile';\r\n\r\nconst AccountLoyaltyTileView: React.FC = props => {\r\n const { AccountLoyaltyTile, heading, description, links } = props;\r\n\r\n return (\r\n \r\n {heading}\r\n {description}\r\n {links}\r\n \r\n );\r\n};\r\n\r\nexport default AccountLoyaltyTileView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['dobbies-account-loyalty-tile'] = {\n c: () => require('partner/modules/dobbies-account-loyalty-tile/dobbies-account-loyalty-tile.tsx'),\n $type: 'contentModule',\n da: [{name:'loyaltyCard', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-loyalty-card', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'dobbies-account-loyalty-tile',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dobbies-account-loyalty-tile'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-loyalty-card';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-loyalty-card');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|dobbies-account-loyalty-tile|dobbies-account-loyalty-tile'] = {\n c: () => require('partner/modules/dobbies-account-loyalty-tile/dobbies-account-loyalty-tile.view.tsx'),\n cn: '__local__-__local__-dobbies-account-loyalty-tile'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["_ref","description","React","className","_mapEditableLinks","linkdata","telemetryContent","length","editableLinks","payLoad","getPayloadObject","forEach","link","index","contentAction","etext","linkText","attributes","getTelemetryAttributes","editableLink","ariaLabel","linkUrl","destinationUrl","openInNewTab","role","additionalProperties","push","links","onTextChange","requestContext","Msdyn365","editProps","AccountLoyaltyTile","constructor","props","super","handleHeadingChange","event","this","config","heading","text","target","value","handleLinkTextChange","linkIndex","signUpLinkText","viewLinkText","getTelemetryObject","context","request","telemetryPageName","friendlyName","telemetry","render","data","resources","signUpLinkAriaLabel","viewLinkAriaLabel","accountLoyaltySummary","accountLoyaltyMemberSummary","loyaltyCard","url","actionContext","result","CardNumber","decimalPrecision","points","RewardPoints","rewardPoint","ActivePoints","format","toFixed","viewProps","_objectSpread","moduleProps","classnames","tag","onEdit","LinksComponent","Object","assign","DescriptionComponent","renderView","Module","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}