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AIJ,WDVIV,GAEP,OAAO,IAAIvI,KAAKxB,GAEpB,IACI,MAAMC,EAAmBD,EAAWE,MAAM,KACpCwK,EAAYzK,EAAiB,GAAGC,MAAM2J,GAAe,GACrDc,EAAU1K,EAAiB,GAAGC,MAAM2J,GAAe,GACnDe,EAAW3K,EAAiB,GAAGC,MAAM2J,GAAe,GACpDgB,EAAW5K,EAAiB,GAAGC,MAAM,KAAK,GAC1C4K,EAAc7K,EAAiB,GAAGC,MAAM,KAAK,GAEnD,GAAIF,EAAWS,SAAS,OAAQ,CAE5B,MAAMD,EAASP,EAAiBA,EAAiBjF,OAAS,GAAGyF,SAAS,OAASR,EAAiBA,EAAiBjF,OAAS,GAAK,GAE/H,OADU,IAAIwG,KAAK,GAAGoJ,EAASG,WAAW,MAAQH,EAAW,KAAKA,OAAcF,KAAaC,KAAWE,KAAYC,QAAkBtK,KAI1I,OAAO,IAAIgB,KACPwJ,SAASJ,EAASG,WAAW,MAAQH,EAAW,KAAKA,IAAY,IACjEI,SAASN,EAAW,IAAM,EAC1BM,SAASL,EAAS,IAClBK,SAASH,EAAU,IACnBG,SAASF,EAAa,IACtB,GAEN,MAAMG,IAGR,OAAO,IAAIzJ,KAAKxB","sources":["webpack://Dobbies.Commerce/./src/dotdigital-extension/PopularityDataService.g.ts?e708","webpack://Dobbies.Commerce/./src/dotdigital-extension/PopularityBannerDataAction.g.ts?334d","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/badges/vsi-product-badges.tsx?c9c2","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/formatDate.ts?ae4d","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/os.ts?f1e0"],"sourcesContent":["// tslint:disable\r\n/* eslint-disable security/detect-object-injection */\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * VSIRestAPIHandler entity interface.\r\n */\r\nexport interface IVSIRestAPIHandler {\r\n Id: number;\r\n result?: {\r\n Status: boolean;\r\n NoOfTransactions: string;\r\n };\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * VSIRestAPIHandler entity class.\r\n */\r\nexport class VSIRestAPIHandlerExtensionClass implements IVSIRestAPIHandler {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public result: Object;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n var newObj = {\r\n Status: odataObject.Status,\r\n NoOfTransactions: odataObject.NoOfTransactions\r\n };\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n // this.result = odataObject.result;\r\n this.result = newObj;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (var i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n var className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './PopularityDataService.g';\r\n\r\n// @ts-ignore\r\nfunction vSIGetAPIResponseQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery('VSIGetRestAPIResponse', 'VSIRestAPIHandler', DataServiceEntities.VSIRestAPIHandlerExtensionClass, key);\r\n}\r\n\r\nexport function createVSIInitiateRestCallInput(ItemID: string, NoOfHours: string, Company: string): IDataServiceRequest {\r\n const query = vSIGetAPIResponseQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'VSI_GetNoOfTransactions',\r\n true,\r\n DataServiceEntities.VSIRestAPIHandlerExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IVSIRestAPIHandler' },\r\n { ItemID: ItemID, NoOfHours: NoOfHours, Company: Company }\r\n );\r\n}\r\n\r\nexport function vSIInitiateRestCallAsync(\r\n context: IContext,\r\n ItemID: string,\r\n NoOfHours: string,\r\n Company: string\r\n): AsyncResult {\r\n const request = createVSIInitiateRestCallInput(ItemID, NoOfHours, Company);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/**\r\n * Copyright (c) 2020 Visionet Systems, Inc\r\n */\r\nimport {\r\n getPriceForSelectedVariant,\r\n getRatingsSummary,\r\n GetRatingsSummaryInput,\r\n getRnrEndpointId,\r\n getRnrPartnerId,\r\n PriceForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IActionContext, IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport * as React from 'react';\r\nimport { IModuleConfig, IVsiProductBadgesProps } from './vsi-product-badges.props';\r\nimport { vSIInitiateRestCallAsync } from '../../../../dotdigital-extension/PopularityBannerDataAction.g';\r\nimport { getDateObjFromString } from '../formatDate';\r\n\r\nexport enum badgePageType {\r\n plp = 'plp',\r\n pdp = 'pdp'\r\n}\r\n\r\nexport interface IVsiProductBadgeState {\r\n rating: number | undefined;\r\n productPrice: ProductPrice;\r\n productAttributes: AttributeValue[];\r\n badgeDisplay: boolean;\r\n imageBadge: boolean;\r\n showPromotionalBanner: boolean;\r\n showBannerStatus: boolean;\r\n totalProdTransaction: string;\r\n}\r\n\r\n/**\r\n *\r\n * VsiProductBadges Component is used to add badges on products\r\n * @extends {React.PureComponent}\r\n */\r\nclass VsiProductBadges extends React.PureComponent {\r\n constructor(props: IVsiProductBadgesProps) {\r\n super(props);\r\n this.state = {\r\n rating: 0,\r\n productPrice: {},\r\n productAttributes: [],\r\n badgeDisplay: false,\r\n imageBadge: false,\r\n showPromotionalBanner: true,\r\n showBannerStatus: false,\r\n totalProdTransaction: '0'\r\n };\r\n }\r\n\r\n public findBannerData = async () => {\r\n if (!this.props.mediaGalleryProduct?.ItemId) return;\r\n try {\r\n const context: IContext = { callerContext: this.props.context.actionContext };\r\n const res = await vSIInitiateRestCallAsync(\r\n context,\r\n this.props.mediaGalleryProduct?.ItemId,\r\n this.props.context.app.config.popularityBannerHours,\r\n this.props.context.app.config.popularityBannerCompany\r\n );\r\n if (res.result) {\r\n this.setState({\r\n showBannerStatus: res.result?.Status,\r\n totalProdTransaction: res.result?.NoOfTransactions\r\n });\r\n } else {\r\n this.setState({\r\n showBannerStatus: false,\r\n totalProdTransaction: '0'\r\n });\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n };\r\n\r\n public componentDidUpdate = async (prevProps: IVsiProductBadgesProps) => {\r\n if (this.props !== prevProps) {\r\n await this.getDataOnUpdate();\r\n }\r\n };\r\n\r\n public componentDidMount = async () => {\r\n if (this.props.mediaGalleryProduct !== undefined || this.props.productComponentProduct !== undefined) {\r\n await this.getDataOnUpdate();\r\n }\r\n this.findBannerData();\r\n };\r\n\r\n public render(): JSX.Element | null {\r\n // badges config from app settings\r\n const appConfig = this.props.context.app.config;\r\n const moduleConfig: IModuleConfig = {\r\n badgeFontColor: appConfig.badgeFontColor,\r\n badgeBackgroundColor: appConfig.badgeBackgroundColor,\r\n badgeFontBold: appConfig.badgeFontBold,\r\n badgeShow: appConfig.badgeShow,\r\n badgeBorderShow: appConfig.badgeBorderShow,\r\n badgeRating: appConfig.badgeRating,\r\n imageBadgeLeftAlign: appConfig.imageBadgeLeftAlign\r\n };\r\n\r\n // return null to if badges are not enabled from config\r\n if (!moduleConfig.badgeShow || (this.props.mediaGalleryProduct === undefined && this.props.productComponentProduct === undefined)) {\r\n return null;\r\n }\r\n\r\n const color = moduleConfig.badgeFontColor || 'black';\r\n const backgroundColor = moduleConfig.badgeBackgroundColor || 'lightgray';\r\n const fontWeight = moduleConfig.badgeFontBold ? 'bold' : 'normal';\r\n const border = moduleConfig.badgeBorderShow ? '1px solid #ababac' : 'none';\r\n const rightfloat = moduleConfig.imageBadgeLeftAlign ? 'right' : 'none';\r\n\r\n const badgeStyle: React.CSSProperties = {\r\n color: color,\r\n backgroundColor: backgroundColor,\r\n border: border,\r\n fontWeight: fontWeight\r\n };\r\n\r\n //Exit Popularity Banner Badge\r\n const exitBadgeStyle: React.CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'flex-end',\r\n justifyContent: 'flex-end',\r\n alignContent: 'flex-end',\r\n marginRight: '10px'\r\n };\r\n\r\n const badgeHeadingStyle: React.CSSProperties = {\r\n display: 'flex',\r\n marginTop: '-10px',\r\n marginLeft: '5px',\r\n fontSize: '12px'\r\n };\r\n\r\n const badgeDescriptionStyle: React.CSSProperties = {\r\n display: 'flex',\r\n marginLeft: '5px',\r\n alignItems: 'flex-start',\r\n justifyContent: 'flex-start',\r\n alignContent: 'flex-start',\r\n marginTop: '5px',\r\n fontSize: '12px',\r\n textAlign: 'left'\r\n };\r\n\r\n const badgeStyleRight: React.CSSProperties = {\r\n color: color,\r\n /* backgroundColor: backgroundColor, */\r\n float: rightfloat\r\n };\r\n\r\n let parentClassName;\r\n const showOutofStock = this._shouldShowOutOfStock();\r\n if (this.state.badgeDisplay && this.state.imageBadge) {\r\n parentClassName = 'both';\r\n } else if (this.state.badgeDisplay && !this.state.imageBadge) {\r\n parentClassName = 'left-badge';\r\n } else if (!this.state.badgeDisplay && this.state.imageBadge) {\r\n parentClassName = 'right-badge';\r\n }\r\n const isImageBadgeInSchedule = this.shouldImageBadgeBeRenderedAsPerSchedule();\r\n const isTextBadgeInSchedule = this.shouldTextBadgeBeRenderedAsPerSchedule();\r\n\r\n return (\r\n
\r\n
\r\n {isTextBadgeInSchedule ? this._renderProductBadge(badgeStyle, showOutofStock) : <>}\r\n
\r\n {this.state.showBannerStatus &&\r\n Number(this.state.totalProdTransaction) >= this.props.context.app.config.popularityBannerThreshold &&\r\n this._renderPromotionalBanner(\r\n badgeStyle,\r\n exitBadgeStyle,\r\n badgeHeadingStyle,\r\n badgeDescriptionStyle,\r\n this.state.showPromotionalBanner,\r\n this.state.totalProdTransaction\r\n )}\r\n {isImageBadgeInSchedule ? this._renderImageBadge(badgeStyleRight, 'BadgeImage') : <>}\r\n
\r\n );\r\n }\r\n private _shouldShowOutOfStock = () => {\r\n const { productAvailableData, moduleType, mediaGalleryProduct, productComponentProduct } = this.props;\r\n //For PDP\r\n if (mediaGalleryProduct || productComponentProduct) {\r\n let recordId: number;\r\n let masterProductId: number | undefined;\r\n let productId: number;\r\n // if request is from Buybox/PDP\r\n if (this.props.moduleType === badgePageType.pdp) {\r\n const product = mediaGalleryProduct;\r\n recordId = product!.RecordId;\r\n masterProductId = product!.MasterProductId;\r\n productId = masterProductId || recordId;\r\n\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n this.getProductAttrbute(this.props.context.actionContext, productId);\r\n const attName = attributes?.find(onlystore => onlystore.Name === 'OnlyInStore');\r\n console.log('name', attName);\r\n\r\n const AttValue = attName?.TextValue?.toLocaleLowerCase();\r\n console.log('attt', AttValue);\r\n if (AttValue === 'no') {\r\n if (productAvailableData) {\r\n const { result } = productAvailableData;\r\n if (result !== undefined && result.length > 0 && !result[0].IsProductAvailable) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n private _renderImageBadge(badgeStyle: React.CSSProperties, attributeName: string): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n if (attributes && attributes.length > 0) {\r\n const attribute = attributes[attributes.findIndex((x: AttributeValue) => x.Name === attributeName)];\r\n if (attribute !== undefined) {\r\n const attributeValue = attribute.TextValue ? attribute.TextValue : undefined;\r\n const baseImageURL = `${this.props.context.request.apiSettings.baseImageUrl}Products/`;\r\n const badgeImage = attributeValue && attributeValue.trim().toLowerCase();\r\n\r\n if (!badgeImage || (attributeValue && attributeValue.trim().toLowerCase() === 'none')) {\r\n return null;\r\n }\r\n const imageUrl = `${baseImageURL}${badgeImage}`;\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: ''\r\n };\r\n\r\n const imageProps = {\r\n gridSettings: this.props.context.request.gridSettings || {},\r\n imageSettings: this.props.imageSettings\r\n };\r\n this.setState({ imageBadge: true });\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private getDateFromDateString = (dateString : string): Date => {\r\n const dateTimeSplitted = dateString.split(' ');\r\n const startDateMonth = dateTimeSplitted[0].split('/')[1];\r\n const startDateDay = dateTimeSplitted[0].split('/')[0];\r\n const startDateYear = dateTimeSplitted[0].split('/')[2];\r\n const startDateHour = dateTimeSplitted[1].split(':')[0];\r\n const startDateMinutes = dateTimeSplitted[1].split(':')[1];\r\n const GMTStr = dateTimeSplitted[dateTimeSplitted.length - 1].includes('GMT') ? dateTimeSplitted[dateTimeSplitted.length - 1] : '';\r\n const badgeDate = getDateObjFromString( `${startDateMonth}-${startDateDay}-${startDateYear} ${startDateHour}:${startDateMinutes}:00 ${GMTStr}`, '-', true)\r\n // new Date(\r\n // `${startDateMonth}-${startDateDay}-${startDateYear} ${startDateHour}:${startDateMinutes}:00 ${GMTStr}`\r\n // );\r\n return badgeDate;\r\n }\r\n\r\n private shouldImageBadgeBeRenderedAsPerSchedule = ():boolean => {\r\n const moduleType = this.props.moduleType;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n \r\n let startDateAttr = attributes?.find(attr => attr.Name?.toLowerCase() === 'badgestartdate1');\r\n let endDateAttr = attributes?.find(attr => attr.Name?.toLowerCase() === 'badgeenddate1');\r\n if(!startDateAttr || !endDateAttr) {\r\n return true;\r\n }\r\n if(!startDateAttr.TextValue) {\r\n return true;\r\n }\r\n if(!endDateAttr.TextValue) {\r\n return true;\r\n }\r\n try {\r\n const startDate = this.getDateFromDateString(startDateAttr.TextValue.trim());//new Date(startDateAttr.TextValue.trim());\r\n const endDate = this.getDateFromDateString(endDateAttr.TextValue.trim());//new Date(endDateAttr.TextValue.trim());\r\n if(!startDate || !endDate) {\r\n return true;\r\n }\r\n const now = new Date();\r\n if((now.getTime() <= endDate.getTime() && now.getTime() >= startDate.getTime())) {\r\n return true;\r\n }\r\n } catch (e) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private shouldTextBadgeBeRenderedAsPerSchedule = ():boolean => {\r\n const moduleType = this.props.moduleType;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n \r\n let startDateAttr = attributes?.find(attr => attr.Name?.toLowerCase() === 'textbadgestartdate');\r\n let endDateAttr = attributes?.find(attr => attr.Name?.toLowerCase() === 'textbadgeenddate');\r\n if(!startDateAttr || !endDateAttr) {\r\n return true;\r\n }\r\n if(!startDateAttr.TextValue) {\r\n return true;\r\n }\r\n if(!endDateAttr.TextValue) {\r\n return true;\r\n }\r\n try {\r\n const startDate = this.getDateFromDateString(startDateAttr.TextValue.trim());//new Date(startDateAttr.TextValue.trim());\r\n const endDate = this.getDateFromDateString(endDateAttr.TextValue.trim());//new Date(endDateAttr.TextValue.trim());\r\n if(!startDate || !endDate) {\r\n return true;\r\n }\r\n const now = new Date();\r\n if((now.getTime() <= endDate.getTime() && now.getTime() >= startDate.getTime())) {\r\n return true;\r\n }\r\n } catch (e) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private _renderDiscountBadgePercentage(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const price = this.state.productPrice;\r\n if (price) {\r\n const { BasePrice, CustomerContextualPrice } = price;\r\n let discount = 0;\r\n if (BasePrice && CustomerContextualPrice && BasePrice > CustomerContextualPrice) {\r\n const actualPercentage = Math.round((CustomerContextualPrice / BasePrice) * 100);\r\n discount = 100 - actualPercentage;\r\n }\r\n\r\n if (discount > 0) {\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`-${discount}%`}\r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _renderRatingBadge(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType, context } = this.props;\r\n const rating = this.state.rating;\r\n const topRating = context.app.config.badgeRating;\r\n if (rating && rating >= topRating) {\r\n this.setState({ badgeDisplay: true });\r\n let badgeRating = context.app.config.badgeRatingText;\r\n if (this.props.context.app.config.textBadgesCharacterLimit && badgeRating && badgeRating.length > this.props.context.app.config.textBadgesCharacterLimit) {\r\n // badgeRating = `${badgeRating.substring(0, this.props.context.app.config.textBadgesCharacterLimit)}`;\r\n return <>;\r\n }\r\n return (\r\n
\r\n {`${badgeRating}`}\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private _renderOutofStockBadge(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`Out of stock`}\r\n
\r\n );\r\n }\r\n\r\n //Render Promotional Badge\r\n private _renderPromotionalBanner(\r\n badgeStyle: React.CSSProperties,\r\n exitBadgeStyle: React.CSSProperties,\r\n badgeHeadingStyle: React.CSSProperties,\r\n badgeDescriptionStyle: React.CSSProperties,\r\n showPromotionalBanner: boolean,\r\n totalProdTransaction: string\r\n ): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const _displayPromotionalBanner = () => {\r\n this.setState({\r\n showPromotionalBanner: false\r\n });\r\n };\r\n\r\n if (moduleType === badgePageType.pdp && showPromotionalBanner) {\r\n return (\r\n
\r\n

\r\n

\r\n

Trending

\r\n

\r\n {totalProdTransaction} people bought this within the past {this.props.context.app.config.popularityBannerHours}{' '}\r\n hours\r\n

\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // Render discountAmount badge\r\n private _renderDiscountBadgeAmount(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const price = this.state.productPrice;\r\n if (price) {\r\n const { BasePrice, CustomerContextualPrice } = price;\r\n let discount = 0;\r\n if (BasePrice && CustomerContextualPrice && BasePrice > CustomerContextualPrice) {\r\n discount = Number((BasePrice - CustomerContextualPrice).toFixed(2));\r\n }\r\n if (discount > 0) {\r\n // format price\r\n const discountWithCurrenceySign = discount && this.props.context.cultureFormatter.formatCurrency(discount.toString(), this.props.context.request.channel?.Currency);\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`${discountWithCurrenceySign} OFF`}\r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // Render custom badge\r\n private _renderCustomAttributeBadge(badgeStyle: React.CSSProperties, attributeName: string): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n if (attributes && attributes.length > 0) {\r\n const attribute = attributes[attributes.findIndex((x: AttributeValue) => x.Name === attributeName)];\r\n if (attribute !== undefined) {\r\n // const brandValue = attrbute && attrbute.TextValue ? attrbute.TextValue : 'SizeNotDefined';\r\n let attributeValue = attribute.TextValue ? attribute.TextValue : '';\r\n if (attributeValue.length > 0) {\r\n this.setState({ badgeDisplay: true });\r\n if (this.props.context.app.config.textBadgesCharacterLimit && attributeValue && attributeValue.length > this.props.context.app.config.textBadgesCharacterLimit) {\r\n //attributeValue = `${attributeValue.substring(0, this.props.context.app.config.textBadgesCharacterLimit)}`;\r\n return <>;\r\n }\r\n return (\r\n
\r\n {attributeValue}\r\n
\r\n );\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private renderDefaultBadge = (badgeStyle: React.CSSProperties) => {\r\n const { moduleType, productComponentProduct } = this.props;\r\n let badgeText = productComponentProduct?.discount;\r\n if (this.props.context.app.config.textBadgesCharacterLimit && badgeText && badgeText.length > this.props.context.app.config.textBadgesCharacterLimit) {\r\n //badgeText = `${badgeText.substring(0, this.props.context.app.config.textBadgesCharacterLimit)}`;\r\n return <>;\r\n }\r\n return (\r\n
\r\n {badgeText}\r\n
\r\n );\r\n };\r\n\r\n private _renderProductBadge(badgeStyle: React.CSSProperties, showOutofStock: boolean): JSX.Element | null {\r\n const { moduleType, context } = this.props;\r\n const badgeShow = context.app.config.badgeShow;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n\r\n let isComingSoon = false;\r\n\r\n const comingSoonCategoryName: string | undefined = this.props.context.app.config.comingSoonCategoryName;\r\n if (comingSoonCategoryName && attributes && attributes.length > 0) {\r\n const comingSoonAttr = attributes.find(attr => attr.Name?.toLowerCase() === comingSoonCategoryName?.toLowerCase());\r\n if (comingSoonAttr && comingSoonAttr.TextValue?.toLowerCase() === 'yes') {\r\n isComingSoon = true;;\r\n }\r\n }\r\n\r\n if (!isComingSoon && showOutofStock && badgeShow) {\r\n return this._renderOutofStockBadge(badgeStyle);\r\n }\r\n if (this.props.productComponentProduct?.discount) {\r\n return this.renderDefaultBadge(badgeStyle);\r\n }\r\n let attributeValue;\r\n if (attributes && attributes.length > 0) {\r\n const attribute =\r\n attributes[\r\n attributes.findIndex((x: AttributeValue) => {\r\n const name = x.Name && x.Name.toLowerCase();\r\n return name === 'badgetype';\r\n })\r\n ];\r\n if (attribute !== undefined) {\r\n attributeValue = attribute.TextValue ? attribute.TextValue : undefined;\r\n const BadgeType = attributeValue;\r\n\r\n if (badgeShow === true && BadgeType !== undefined) {\r\n if (BadgeType === 'DiscountAmount') {\r\n return this._renderDiscountBadgeAmount(badgeStyle);\r\n } else if (BadgeType === 'DiscountPercentage') {\r\n return this._renderDiscountBadgePercentage(badgeStyle);\r\n } else if (BadgeType === 'Rating') {\r\n return this._renderRatingBadge(badgeStyle);\r\n } else if (BadgeType === 'BadgeText' && BadgeType !== undefined) {\r\n return this._renderCustomAttributeBadge(badgeStyle, BadgeType);\r\n } else {\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private getDataOnUpdate = async () => {\r\n const { mediaGalleryProduct, productComponentProduct, context } = this.props;\r\n\r\n if (mediaGalleryProduct || productComponentProduct) {\r\n let recordId: number;\r\n let masterProductId: number | undefined;\r\n let productId: number;\r\n // if request is from Buybox/PDP\r\n if (this.props.moduleType === badgePageType.pdp) {\r\n const product = mediaGalleryProduct;\r\n recordId = product!.RecordId;\r\n masterProductId = product!.MasterProductId;\r\n productId = masterProductId || recordId;\r\n // Get product rating\r\n const ratingInput = new GetRatingsSummaryInput(\r\n productId.toString(),\r\n getRnrPartnerId(context.actionContext),\r\n getRnrEndpointId(context.actionContext)\r\n );\r\n const ratings = await getRatingsSummary(ratingInput, context.actionContext);\r\n const ratingValue = ratings ? ratings.averageRating : 0;\r\n this.setState({ rating: ratingValue });\r\n // Get product pricing\r\n const priceInput = new PriceForSelectedVariantInput(\r\n productId,\r\n context.request.apiSettings.channelId,\r\n product,\r\n context.actionContext.requestContext.user.customerAccountNumber\r\n );\r\n // Run and await the result of the data action\r\n const productPriceResult = await getPriceForSelectedVariant(priceInput, context.actionContext);\r\n const price: ProductPrice = {\r\n // BasePrice value has been set based on higher price value among these ↓.\r\n BasePrice: Math.max(\r\n productPriceResult?.BasePrice || 0,\r\n productPriceResult?.TradeAgreementPrice || 0,\r\n productPriceResult?.AdjustedPrice || 0\r\n ),\r\n AdjustedPrice: product!.Price || 0,\r\n CustomerContextualPrice: productPriceResult!.CustomerContextualPrice || 0\r\n };\r\n this.setState({ productPrice: price });\r\n // tslint:disable-next-line: no-floating-promises\r\n this.getProductAttrbute(context.actionContext, productId);\r\n } else if (this.props.moduleType === badgePageType.plp) {\r\n const product = productComponentProduct;\r\n const price: ProductPrice = {\r\n BasePrice: (product && product.BasePrice) || 0,\r\n AdjustedPrice: (product && product.Price) || 0,\r\n CustomerContextualPrice: (product && product.Price) || 0\r\n };\r\n this.setState({ rating: productComponentProduct ? productComponentProduct.AverageRating : 0 });\r\n this.setState({ productPrice: price });\r\n // tslint:disable-next-line: no-floating-promises\r\n // this.getProductAttrbute(context.actionContext, product!.RecordId);\r\n }\r\n }\r\n };\r\n\r\n private getProductAttrbute = async (callerContext: IActionContext, productId: number) => {\r\n const productAttributeResult = await getAttributeValuesAsync(\r\n { callerContext, queryResultSettings: {} },\r\n productId,\r\n callerContext.requestContext.apiSettings.channelId,\r\n callerContext.requestContext.apiSettings.catalogId\r\n );\r\n this.setState({ productAttributes: productAttributeResult });\r\n };\r\n}\r\n\r\nexport default VsiProductBadges;\r\n","import { getMobileOperatingSystem } from './os';\r\n\r\nexport function setDateFormat(originalDate:string){\r\n if (!originalDate) {\r\n return;\r\n }\r\n var dateComponents = originalDate.split('/');\r\n const day = dateComponents[0];\r\n const month = dateComponents[1];\r\n const year = dateComponents[2].slice(-2);\r\n const formattedDate = `${day}/${month}/${year}`;\r\n \r\n return formattedDate;\r\n }\r\n\r\n export function getDateObjFromString(dateString: string, dateDelimiter: string, hasTime: boolean) {\r\n const os = getMobileOperatingSystem();\r\n if (os !== 'iOS') {\r\n return new Date(dateString);\r\n }\r\n try {\r\n const dateTimeSplitted = dateString.split(' ');\r\n const dateMonth = dateTimeSplitted[0].split(dateDelimiter)[0];\r\n const dateDay = dateTimeSplitted[0].split(dateDelimiter)[1];\r\n const dateYear = dateTimeSplitted[0].split(dateDelimiter)[2];\r\n const dateHour = dateTimeSplitted[1].split(':')[0];\r\n const dateMinutes = dateTimeSplitted[1].split(':')[1];\r\n\r\n if (dateString.includes('GMT')) {\r\n // \"2024/04/01 01:00:00 GMT+1\" iOS supported Format\r\n const GMTStr = dateTimeSplitted[dateTimeSplitted.length - 1].includes('GMT') ? dateTimeSplitted[dateTimeSplitted.length - 1] : '';\r\n const d = new Date(`${dateYear.startsWith('20') ? dateYear : `20${dateYear}`}/${dateMonth}/${dateDay} ${dateHour}:${dateMinutes}:00 ${GMTStr}`);\r\n return d;\r\n }\r\n\r\n return new Date(\r\n parseInt(dateYear.startsWith('20') ? dateYear : `20${dateYear}`, 10),\r\n parseInt(dateMonth, 10) - 1,\r\n parseInt(dateDay, 10),\r\n parseInt(dateHour, 10),\r\n parseInt(dateMinutes, 10),\r\n 0\r\n );\r\n } catch(error) {\r\n \r\n }\r\n return new Date(dateString);\r\n }","import MsDyn365 from '@msdyn365-commerce/core';\r\nexport const getMobileOperatingSystem = (): string => {\r\n\r\n if (!MsDyn365.isBrowser) {\r\n return 'unknown';\r\n }\r\n // Get the user agent string\r\n const userAgent: string = navigator.userAgent || navigator.vendor || (window as any).opera;\r\n\r\n // Check for Windows Phone first because its user agent string may contain \"Android\"\r\n if (/windows phone/i.test(userAgent)) {\r\n return 'Windows Phone';\r\n }\r\n\r\n // Check for Android devices\r\n if (/android/i.test(userAgent)) {\r\n return 'Android';\r\n }\r\n\r\n // Check for iOS devices (iPad, iPhone, iPod)\r\n // The condition !window.MSStream ensures that it's not a Windows device\r\n if ((/iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream) || userAgent.indexOf('Mac OS X') > 0) {\r\n return 'iOS';\r\n }\r\n\r\n // If no matches, return 'unknown'\r\n return 'unknown';\r\n}"],"names":["VSIRestAPIHandlerExtensionClass","constructor","odataObject","this","Id","newObj","Status","NoOfTransactions","result","ExtensionProperties","undefined","i","length","className","substr","lastIndexOf","concat","EntityClasses","createVSIInitiateRestCallInput","ItemID","NoOfHours","Company","id","key","DataServiceQuery","DataServiceEntities","vSIGetAPIResponseQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","badgePageType","VsiProductBadges","React","props","super","findBannerData","async","_this$props$mediaGall","mediaGalleryProduct","ItemId","_this$props$mediaGall2","context","callerContext","actionContext","res","request","callActionOrExecute","vSIInitiateRestCallAsync","app","config","popularityBannerHours","popularityBannerCompany","_res$result","_res$result2","setState","showBannerStatus","totalProdTransaction","err","console","log","componentDidUpdate","prevProps","getDataOnUpdate","componentDidMount","productComponentProduct","_shouldShowOutOfStock","productAvailableData","moduleType","recordId","masterProductId","productId","pdp","_attributes","_attName$TextValue","product","attributes","RecordId","MasterProductId","plp","AttributeValues","state","productAttributes","getProductAttrbute","attName","find","onlystore","Name","AttValue","TextValue","toLocaleLowerCase","IsProductAvailable","getDateFromDateString","dateString","dateTimeSplitted","split","startDateMonth","startDateDay","startDateYear","startDateHour","startDateMinutes","GMTStr","includes","getDateObjFromString","shouldImageBadgeBeRenderedAsPerSchedule","_attributes2","_attributes3","startDateAttr","attr","_attr$Name","toLowerCase","endDateAttr","_attr$Name2","startDate","trim","endDate","now","Date","getTime","e","shouldTextBadgeBeRenderedAsPerSchedule","_attributes4","_attributes5","_attr$Name3","_attr$Name4","renderDefaultBadge","badgeStyle","badgeText","discount","textBadgesCharacterLimit","style","ratingInput","GetRatingsSummaryInput","toString","getRnrPartnerId","getRnrEndpointId","ratings","getRatingsSummary","ratingValue","averageRating","rating","priceInput","PriceForSelectedVariantInput","apiSettings","channelId","requestContext","user","customerAccountNumber","productPriceResult","getPriceForSelectedVariant","price","BasePrice","Math","max","TradeAgreementPrice","AdjustedPrice","Price","CustomerContextualPrice","productPrice","AverageRating","productAttributeResult","getAttributeValuesAsync","queryResultSettings","catalogId","badgeDisplay","imageBadge","showPromotionalBanner","render","appConfig","moduleConfig","badgeFontColor","badgeBackgroundColor","badgeFontBold","badgeShow","badgeBorderShow","badgeRating","imageBadgeLeftAlign","color","backgroundColor","border","fontWeight","badgeStyleRight","float","parentClassName","showOutofStock","isImageBadgeInSchedule","isTextBadgeInSchedule","_renderProductBadge","Number","popularityBannerThreshold","_renderPromotionalBanner","display","alignItems","justifyContent","alignContent","marginRight","marginTop","marginLeft","fontSize","textAlign","_renderImageBadge","attributeName","attribute","findIndex","x","attributeValue","baseImageURL","baseImageUrl","badgeImage","img","src","altText","imageProps","gridSettings","imageSettings","Image","Object","assign","loadFailureBehavior","_renderDiscountBadgePercentage","round","_renderRatingBadge","topRating","badgeRatingText","_renderOutofStockBadge","exitBadgeStyle","badgeHeadingStyle","badgeDescriptionStyle","_displayPromotionalBanner","onClick","_renderDiscountBadgeAmount","toFixed","_this$props$context$r","discountWithCurrenceySign","cultureFormatter","formatCurrency","channel","Currency","_renderCustomAttributeBadge","_this$props$productCo","isComingSoon","comingSoonCategoryName","_comingSoonAttr$TextV","comingSoonAttr","_attr$Name5","BadgeType","setDateFormat","originalDate","dateComponents","slice","dateDelimiter","hasTime","getMobileOperatingSystem","MsDyn365","isBrowser","userAgent","navigator","vendor","window","opera","test","MSStream","indexOf","dateMonth","dateDay","dateYear","dateHour","dateMinutes","startsWith","parseInt","error"],"sourceRoot":""}