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vC,0BACuChK,IAAhDuM,EAAMvC,oBAAoBkB,mBAC1BqB,EAAMvC,oBAAoBkB,mBAAqB6xB,IAKjDZ,EAAuB5vB,IAA4C,MACjC,EAApC,aAAIA,EAAMI,KAAK5C,eAAf,OAAI,EAAoB2N,aACpB,UAAInL,EAAMI,KAAK5C,QAAQ2N,kBAAvB,OAAI,EAA+B2B,MAAKxN,KAAeA,EAAU8L,gBAAkB9L,EAAU8L,eAAerZ,UAGxG,OAAO,EAKf,SAAKiO,EAAMwD,YAAcxD,EAAMkC,sBAO7B2sB,EAAkB,CAAC7uB,EAAiCnF,KAClDmF,EAAM8G,OACN9G,EAAM8G,MAAMjM,IAIdszB,EAAiB,CAACnuB,EAAiCnF,KACjDmF,EAAM+E,SACN/E,EAAM+E,QAAQlK,IAIT2J,EAAwEisB,EAAAA,GAAAA,wBAGnF,iXAHmF,EAGpEC,UAAW5B,GAAclC,IAE1C","sources":["webpack://mattressfirm/./src/Utilities/get-utag-product-category.ts?a69d","webpack://mattressfirm/./src/Utilities/get-utag-variant-id.ts?ea12","webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/Utilities/get-zipcode.ts?4f03","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/actions/TryInStoreDataServiceEntities.g.ts?ea57","webpack://mattressfirm/./src/actions/TryInStoreDataActionExtension.g.ts?c8db","webpack://mattressfirm/./src/actions/get-try-in-store-info.action.ts?dff9","webpack://mattressfirm/./src/data-actions/buybox-get-all-variants-list.ts?6ad4","webpack://mattressfirm/./src/Utilities/get-eyebrow-message.tsx?2bcd","webpack://mattressfirm/./src/modules/mfrm-buybox/common/utilities/error-utilities.ts?bd84","webpack://mattressfirm/./src/modules/mfrm-buybox/common/buybox-components.tsx?bf31","webpack://mattressfirm/./src/modules/mfrm-buybox/components/mfrm-buybox-find-in-store.tsx?97b6","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.tsx?cc50","webpack://mattressfirm/./src/modules/mfrm-store-selector/components/store-selector-location-line-item/date-time-helpers.ts?8535","webpack://mattressfirm/./src/themes/mattressfirm/views/components/addtocart/addtocart.component.tsx?5783"],"sourcesContent":["import { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\r\nexport const getUtagProductCategory = async (actionContext: IActionContext, channelId: number, catalogId: number = 0, RecordId: number) => {\r\n //context, channelId, catalogId, categoryPathLookups\r\n const categoryPathResults = await getCategoryPathsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n channelId,\r\n catalogId,\r\n [{ ProductId: RecordId }]\r\n );\r\n const categoryPath = categoryPathResults[0]?.CategoryPath?.[0] && categoryPathResults[0].CategoryPath[0];\r\n if (!categoryPath?.Segments?.length) {\r\n return [];\r\n }\r\n return [categoryPath.Segments[categoryPath.Segments.length - 1].CategoryName!];\r\n};\r\n","import { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport getAllProductVariants, { BuyboxGetDimensionVariantAvailabilityInput } from '../data-actions/buybox-get-all-variants-list';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal';\r\n\r\nexport const getUtagVariantId = async (\r\n MasterProductId: number,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n RecordId: number,\r\n ItemId: string\r\n) => {\r\n if (MasterProductId && MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(MasterProductId, channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n return [ePropsVariant[eIter].Value?.StringValue];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const variantofId = `V000${ItemId}`;\r\n return [variantofId?.slice(0, -1)];\r\n};\r\n\r\nexport const getUtagRetailVariantIdAndRecId = async (\r\n MasterProductId: number,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n RecordId: number,\r\n ItemId: string\r\n) => {\r\n if (MasterProductId && MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(MasterProductId, channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0; variantIter < variantsResp.length; variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0; eIter < ePropsVariant?.length; eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n return { 'retailVariantId': ePropsVariant[eIter].Value?.StringValue, 'recordId': RecordId };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const variantofId = `V000${ItemId}`;\r\n return { 'retailVariantId': variantofId?.slice(0, -1), 'recordId': RecordId };\r\n};\r\n","import MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst _getViewPort = (context: ICoreContext): GridSize => {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n return 'xs';\r\n};\r\n\r\nexport default _getViewPort;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport const getZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const geolocationZipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n const cookie = new Cookies();\r\n const zipcode = cookie.get('zip_code') ? cookie.get('zip_code') : geolocationZipCode;\r\n return zipcode ?? undefined;\r\n};\r\nexport const getGeoLocationZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const zipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n return zipCode ?? null;\r\n};\r\n","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links and product links, which end in .c or .p. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') && !linkBase.endsWith('.p') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","// tslint:disable\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 * MFITryInStore entity interface.\r\n */\r\nexport interface IMFITryInStore {\r\n ZipCode?: string;\r\n StoreId: string;\r\n Products?: string;\r\n Limit: number;\r\n Radius: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity interface.\r\n */\r\nexport interface IMFITryInStoreInfoResponse {\r\n Status?: string;\r\n Message?: string;\r\n StoreId?: string;\r\n Inventory?: string[];\r\n}\r\n\r\n/**\r\n * MFITryInStore entity class.\r\n */\r\nexport class MFITryInStoreExtensionClass implements IMFITryInStore {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ZipCode: string;\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 StoreId: string;\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 Products: string;\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 Limit: 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 Radius: 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 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.ZipCode = odataObject.ZipCode;\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.StoreId = odataObject.StoreId;\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.Products = odataObject.Products;\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.Limit = odataObject.Limit;\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.Radius = odataObject.Radius;\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 (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let 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/**\r\n * MFITryInStoreInfoResponse entity class.\r\n */\r\nexport class MFITryInStoreInfoResponseExtensionClass implements IMFITryInStoreInfoResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\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 Message: string;\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 StoreId: string;\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 Inventory: string[];\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.Status = odataObject.Status;\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.Message = odataObject.Message;\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.StoreId = odataObject.StoreId;\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.Inventory = undefined;\r\n if (odataObject.Inventory) {\r\n this.Inventory = [];\r\n for (let i = 0; i < odataObject.Inventory.length; i++) {\r\n if (odataObject.Inventory[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = odataObject.Inventory[i];\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.Inventory[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 './TryInStoreDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction tryInStoresQuery(storeId?: string): DataServiceQuery {\r\n const key = storeId ? { StoreId: storeId } : null;\r\n return new DataServiceQuery('TryInStores', 'MFITryInStore', DataServiceEntities.MFITryInStoreExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetTryInStoreInfoInput(tryInStoreProductIDs: DataServiceEntities.IMFITryInStore): IDataServiceRequest {\r\n const query = tryInStoresQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetTryInStoreInfo',\r\n true,\r\n DataServiceEntities.MFITryInStoreInfoResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFITryInStoreInfoResponse' },\r\n { tryInStoreProductIDs: tryInStoreProductIDs }\r\n );\r\n}\r\n\r\nexport function mFIGetTryInStoreInfoAsync(\r\n context: IContext,\r\n tryInStoreProductIDs: DataServiceEntities.IMFITryInStore\r\n): AsyncResult {\r\n const request = createMFIGetTryInStoreInfoInput(tryInStoreProductIDs);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIGetTryInStoreInfoAsync } from './TryInStoreDataActionExtension.g';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from './TryInStoreDataServiceEntities.g';\r\n\r\n/**\r\n * GetTryInStoreInfo Input Action\r\n */\r\n\r\nexport class GetTryInStoreInfoInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFITryInStore;\r\n constructor(input: IMFITryInStore) {\r\n this.input = input;\r\n }\r\n\r\n // Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () =>\r\n `Try-In-Store${this.input.StoreId}-${this.input.ZipCode}-${this.input.Radius}-${this.input.Limit}-${this.input.Products}`;\r\n public getCacheObjectType = () => 'GetTryInStoreInfo';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\r\n// };\r\n\r\n/**\r\n * Use this function to call your action and process the results as needed\r\n */\r\nasync function getTryInStoreAction(\r\n request: GetTryInStoreInfoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIGetTryInStoreInfoAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTryInStoreAction,\r\n // Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\r\n // input: createInput\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionVariantAvailabilityInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `AllMFRMProductVariantIDs-${this.productId}`;\r\n public getCacheObjectType = () => 'AllMFRMProductVariantIDs';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionVariantAvailabilityActionData {\r\n variantID: number;\r\n dimensionRecordID: number;\r\n itemID: string;\r\n sizeValue: string;\r\n isAvailable: boolean;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nexport async function getAllVariantsForProduct(\r\n input: BuyboxGetDimensionVariantAvailabilityInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const productResponse = await getByIdAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } },\r\n input.productId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n try {\r\n return await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n );\r\n } catch (error) {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n }\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllVariantsForProduct,\r\n input: createInput\r\n});\r\n","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IMFIAvailablePromotionDescription, IMFIItem } from '../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getEyebrowAction, { GetEyebrowMessageInput } from '../actions/get-eyebrow-message.action';\r\n\r\nconst _getEyebrowMessage = async (products: IMFIItem[], context: ICoreContext>, isCached?: boolean, pageType?: string) => {\r\n const priceGroupForAPICall = context.app && context.app.config.priceGroup;\r\n if (products?.length > 0 && priceGroupForAPICall) {\r\n const items: IMFIItem[] | undefined = [];\r\n products.map((item) => {\r\n const singleItem: IMFIItem = {\r\n ItemId: item.ItemId,\r\n DistinctProductVariant: item.DistinctProductVariant\r\n };\r\n items.push(singleItem);\r\n });\r\n\r\n const requestBody: IMFIAvailablePromotionDescription = {\r\n PriceGroup: priceGroupForAPICall,\r\n Items: items\r\n };\r\n const getEyebrowMessageInput = new GetEyebrowMessageInput(requestBody, pageType, isCached);\r\n try {\r\n const result = await getEyebrowAction(getEyebrowMessageInput, context.actionContext);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n};\r\n\r\nexport default _getEyebrowMessage;\r\n","import { IBuyboxCommonResources } from '@msdyn365-commerce-modules/buybox';\r\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { OrgUnitLocation, ProductAvailableQuantity, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport function getQuantityError(stockLeft: number | undefined, resources: IBuyboxCommonResources): string | undefined {\r\n if (!stockLeft || stockLeft <= 0) {\r\n return resources.errorMessageOutOfStock;\r\n } else if (stockLeft === 1) {\r\n return resources.errorMessageOutOfRangeOneLeft;\r\n } else {\r\n return resources.errorMessageOutOfRangeFormat.replace('{numLeft}', stockLeft.toString());\r\n }\r\n}\r\n\r\n// tslint:disable-next-line:cyclomatic-complexity\r\nexport function getGenericError(\r\n result: IAddToCartFailureResult,\r\n cart: ICartState | undefined,\r\n resources: IBuyboxCommonResources,\r\n context: ICoreContext>,\r\n product: SimpleProduct | undefined,\r\n productAvailability: ProductAvailableQuantity | undefined,\r\n location: OrgUnitLocation | undefined)\r\n : string | undefined {\r\n if (result.failureReason === 'EMPTYINPUT') {\r\n return resources.addedToCartFailureMessage;\r\n } else if (result.failureReason === 'CARTACTIONFAILED') {\r\n if (result.cartActionResult && result.cartActionResult.substatus === 'MAXQUANTITY') {\r\n // get the quantity of the product in cart\r\n let elementFoundAt: number = -1;\r\n const productIdToFind = product?.RecordId;\r\n\r\n for (let i = 0; i < cart!.cart.CartLines!.length; i++) {\r\n if (cart!.cart.CartLines![i].ProductId === productIdToFind &&\r\n (cart!.cart.CartLines![i].DeliveryMode || '') === (location && context.actionContext.requestContext.channel?.PickupDeliveryModeCode || '') &&\r\n (cart!.cart.CartLines![i].FulfillmentStoreId || '') === (location?.OrgUnitNumber || '')) {\r\n elementFoundAt = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n let curQuantity: number = 0;\r\n\r\n if (elementFoundAt !== -1) {\r\n const cartLineToUpdate = { ...cart!.cart.CartLines![elementFoundAt] };\r\n curQuantity = cartLineToUpdate.Quantity || 0;\r\n }\r\n\r\n // get the quantity limit for the product\r\n const maxQuantityForCartLineItem = context.app.config.maxQuantityForCartLineItem;\r\n const availableQty = productAvailability?.AvailableQuantity;\r\n\r\n let quantityLimit: number;\r\n\r\n if (maxQuantityForCartLineItem === undefined && availableQty === undefined) {\r\n quantityLimit = 10;\r\n } else if (availableQty === undefined) {\r\n quantityLimit = maxQuantityForCartLineItem;\r\n } else if (maxQuantityForCartLineItem === undefined) {\r\n quantityLimit = availableQty;\r\n } else {\r\n quantityLimit = Math.min(maxQuantityForCartLineItem, availableQty);\r\n }\r\n\r\n return resources.maxQuantityLimitText.replace('{curQuantity}', curQuantity.toString()).replace('{maxQuantity}', quantityLimit.toString());\r\n } else if (result.cartActionResult && (result.cartActionResult.substatus === 'QUANTITYLIMITS' || result.cartActionResult.substatus === 'INVOICEINCART')) {\r\n return result.cartActionResult?.errorDetails?.LocalizedMessage;\r\n }\r\n\r\n return resources.addedToCartFailureMessage;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport function getConfigureErrors(result: ProductDimension[] | undefined, resources: IBuyboxCommonResources, isGiftCard?: Boolean): { [configureId: string]: string | undefined } {\r\n if (!result) {\r\n return {};\r\n }\r\n\r\n const dimensions: { [configureId: string]: string | undefined } = {};\r\n\r\n result.forEach(dimension => {\r\n dimensions[dimension.DimensionTypeValue] = getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\r\n });\r\n\r\n return dimensions;\r\n}\r\n\r\nexport function getDimensionErrorString(dimensionTypeValue: number, resources: IBuyboxCommonResources, isGiftCard?: Boolean): string {\r\n switch (dimensionTypeValue) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColorErrorMessage;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfigurationErrorMessage;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSizeErrorMessage;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmountErrorMessage : resources.productDimensionTypeStyleErrorMessage;\r\n default:\r\n return '';\r\n }\r\n}","import { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, Button, format, getPayloadObject, getTelemetryAttributes, getTelemetryObject, Heading, ITelemetryContent, Node, Quantity, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n AddToCartComponent, AddToOrderTemplateComponent, AddToWishlistComponent, IAddToCartFailureResult, IAddToCartResources, IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources, IItemAddedToOrderTemplateDialogResources, IOrderTemplateActionErrorResult, IOrderTemplateNameDialogResources, IWishlistActionErrorResult,\r\n PriceComponent, RatingComponent\r\n} from '@msdyn365-commerce/components';\r\nimport MSDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport * as React from 'react';\r\nimport { getConfigureErrors, getGenericError, getQuantityError } from './utilities/error-utilities';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps, IBuyboxAddToOrderTemplateViewProps, IBuyboxAddToWishlistViewProps, IBuyboxCallbacks, IBuyboxCommonData, IBuyboxCommonResources,\r\n IBuyboxErrorBlockProps, IBuyboxExtentedProps, IBuyboxKeyInPriceViewProps, IBuyboxProductQuantityViewProps, IBuyboxShopSimilarLookViewProps, IBuyboxState,\r\n IProductDetails, ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport function getBuyBoxInventoryLabel(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ? props.data.productAvailableQuantity?.result : productDetails?.productAvailableQuantity!;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n if (!productAvailableQuantity || !productAvailableQuantity.length) {\r\n return undefined;\r\n }\r\n if (productAvailableQuantity &&\r\n productAvailableQuantity.length &&\r\n productAvailableQuantity[0].StockLevelLabel) {\r\n const inventoryClassName = productAvailableQuantity[0].StockLevelCode ?\r\n `${className}__inventory-label ${className}__inventory-code-${productAvailableQuantity[0].StockLevelCode.toLowerCase()}` :\r\n `${className}__inventory-label`;\r\n return (
{productAvailableQuantity[0].StockLevelLabel}
);\r\n }\r\n\r\n return undefined;\r\n\r\n}\r\n\r\nexport function getBuyboxProductTitle(props: IBuyboxExtentedProps, productDetails?: IProductDetails, brandName?: string): React.ReactElement | undefined {\r\n const {\r\n config: { titleHeadingTag = 'h1' },\r\n typeName\r\n } = props;\r\n const className = typeName && _getClassNamePrefix(typeName);\r\n\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product!;\r\n const title = brandName ? `${brandName} ${product.Name}` : product.Name;\r\n return product && (\r\n \r\n );\r\n}\r\n\r\nexport function getBuyboxProductDescription(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n const className = _getClassNamePrefix(typeName);\r\n const product = props.data.product?.result ? props.data.product?.result : productDetails?.product!;\r\n\r\n return product && (\r\n

{product.Description}

\r\n );\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport function getBuyboxAddToCart(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks,\r\n defaultMinimumKeyInPrice: number, defaultMaximumKeyInPrice: number, productDetails?: IProductDetails): IBuyboxAddToCartViewProps {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n config: { minimumKeyInPrice, maximumKeyInPrice }\r\n } = props;\r\n\r\n const product = props.data?.product?.result ? props.data.product.result : productDetails?.product!;\r\n const cart = props.data?.cart?.result ? props.data.cart.result : productDetails?.cart!;\r\n const productAvailableQuantity = props.data?.productAvailableQuantity?.result ? props.data.productAvailableQuantity.result : productDetails?.productAvailableQuantity!;\r\n\r\n const {\r\n quantity,\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem,\r\n keyInPriceAmount\r\n } = state;\r\n\r\n const productAvailability = state.productAvailableQuantity ?\r\n state.productAvailableQuantity.ProductAvailableQuantity :\r\n productAvailableQuantity && productAvailableQuantity.length ?\r\n productAvailableQuantity[0].ProductAvailableQuantity : undefined;\r\n\r\n const onAddToCartFailed = (result: IAddToCartFailureResult) => {\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n let otherErrorForState: string | undefined = getGenericError(result, cart, resources, context, product, productAvailability, undefined);\r\n\r\n if (result?.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, resources) : undefined;\r\n } else if (result && result.failureReason === 'CARTACTIONFAILED'\r\n && result.cartActionResult\r\n && (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult?.substatus === 'QUANTITYLIMITS')) {\r\n quantityErrorForState = getGenericError(result, cart, resources, context, product, productAvailability, undefined);\r\n otherErrorForState = undefined; // prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result?.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (keyInPriceAmount === undefined || keyInPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter?.formatCurrency(minimumKeyInPrice || defaultMinimumKeyInPrice);\r\n customAmountErrorForState = resources.invalidSmallCustomAmountText?.replace('{minAmount}', formatedAmountLimit);\r\n } else if (keyInPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter?.formatCurrency(maximumKeyInPrice || defaultMaximumKeyInPrice);\r\n customAmountErrorForState = resources.invalidLargeCustomAmountText?.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors: result?.failureReason === 'MISSINGDIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n };\r\n\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText,\r\n closeNotificationLabel: resources.closeNotificationLabel\r\n };\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const isLoading = typeName !== 'quickview' && props.data.productAvailableQuantity?.status === 'LOADING';\r\n if (isLoading) {\r\n callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && callbacks.changeUpdatingDeliveryOptions) {\r\n callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = props.data.deliveryOptions?.result;\r\n const isEmailDelivery = ArrayExtensions.hasElements(deliveryOptions?.DeliveryOptions) && deliveryOptions!.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n const onItemAddedToCart = (result: ICartActionResult) => {\r\n if (typeName === 'quickview') {\r\n callbacks.changeModalOpen(false);\r\n }\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-cart-container`\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductPrice(props: IBuyboxExtentedProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources\r\n } = props;\r\n\r\n return state.productPrice && (\r\n \r\n );\r\n}\r\n\r\nexport function getBuyboxProductRating(props: IBuyboxExtentedProps, productDetails?: IProductDetails): React.ReactElement | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n resources\r\n } = props;\r\n\r\n const ratingsSummary = props.data.ratingsSummary?.result ? props.data.ratingsSummary?.result : productDetails?.ratingsSummary!;\r\n\r\n const ratingComponent = ratingsSummary?.averageRating && (\r\n \r\n ) || undefined;\r\n\r\n return ratingsSummary && ratingComponent && (\r\n ratingComponent\r\n );\r\n}\r\n\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\nexport function getBuyboxProductAddToOrderTemplate(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxAddToOrderTemplateViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n quantity\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-orderTemplate is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n const className = _getClassNamePrefix(typeName);\r\n const onAddToOrderTemplateFailed = (result: IOrderTemplateActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors: result?.status === 'MISSING_DIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-order-template-container`\r\n },\r\n button: product && orderTemplates && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductAddToWishlist(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks, productDetails?: IProductDetails): IBuyboxAddToWishlistViewProps | undefined {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n wishlists: { result: wishlists }\r\n },\r\n resources\r\n } = props;\r\n\r\n const product = props.data.product?.result ? props.data.product?.result : productDetails?.product!;\r\n\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n customAmountError,\r\n otherError,\r\n errorHost\r\n },\r\n selectedProduct\r\n } = state;\r\n\r\n // If custom amount is selected, add-to-wishlist is disabled\r\n if (state.isCustomPriceSelected) {\r\n return undefined;\r\n }\r\n\r\n const onAddToWishlistFailed = (result: IWishlistActionErrorResult) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors: result?.status === 'MISSINGDIMENSION' ? getConfigureErrors(result?.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n };\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__add-to-wishlist-container`\r\n },\r\n button: product && (\r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxProductQuantity(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxProductQuantityViewProps {\r\n const {\r\n resources,\r\n typeName\r\n } = props;\r\n\r\n const\r\n {\r\n quantity,\r\n max,\r\n errorState: {\r\n quantityError\r\n }\r\n } = state;\r\n\r\n const onChange = (newValue: number) => {\r\n if (callbacks.updateQuantity) {\r\n callbacks.updateQuantity(newValue);\r\n }\r\n };\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__quantity`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__product-quantity-label`,\r\n htmlFor: `${className}__product-quantity-input`\r\n },\r\n heading: (\r\n
{resources.productQuantityHeading}
\r\n ),\r\n errors: quantityError && (\r\n \r\n \r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxShopSimilarButton(props: IBuyboxExtentedProps, buttonType: ShopSimiliarButtonType): IBuyboxShopSimilarLookViewProps {\r\n const {\r\n resources,\r\n context,\r\n data: {\r\n product: { result: product }\r\n },\r\n typeName\r\n } = props;\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n const navigationUrl = (shopSimiliarButtonType: ShopSimiliarButtonType) => () => {\r\n const searchURL = getUrlSync('search', context?.actionContext);\r\n const separator = searchURL!.includes('?') ? '&' : '?';\r\n if (MSDyn365.isBrowser) {\r\n document.location.href = `${searchURL}${separator}productId=${product?.RecordId}&recommendation=${shopSimiliarButtonType}`;\r\n }\r\n };\r\n const telemetryText = buttonType === ShopSimiliarButtonType.Looks ? TelemetryConstant.ShopSimliarLooks : TelemetryConstant.ShopSimliarDescription;\r\n const payLoad = getPayloadObject('click', telemetryContent, telemetryText);\r\n const attribute = getTelemetryAttributes(telemetryContent, payLoad);\r\n const text = buttonType === ShopSimiliarButtonType.Looks ? resources.shopSimilarLooksText : resources.shopSimilarDescriptionText;\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__shopsimilar${buttonType}`\r\n },\r\n input: (\r\n \r\n {text}\r\n \r\n )\r\n };\r\n}\r\n\r\nexport function getBuyboxKeyInPrice(props: IBuyboxExtentedProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxKeyInPriceViewProps {\r\n const {\r\n config,\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n errorState: { }\r\n } = state;\r\n\r\n const className = _getClassNamePrefix(props.typeName);\r\n const onChange = (e: React.ChangeEvent) => {\r\n const value = e.currentTarget.value;\r\n callbacks.updateKeyInPrice(value.length ? Number(value) : parseFloat(value));\r\n };\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__key_in_price`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${className}__key_in_price-label`,\r\n htmlFor: `${className}__key_in_price`\r\n },\r\n heading: (\r\n
{resources.buyboxKeyInPriceLabelHeading}
\r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n\r\n}\r\n\r\nexport const BuyboxErrorBlock: React.FC = ({ showError, configureErrors, quantityError, customAmountError, otherError, resources }) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0} color='danger' assertive={true} aria-label={resources.buyboxErrorMessageHeader} >\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
{message}
\r\n );\r\n })}\r\n
\r\n );\r\n};\r\n\r\nexport function getQuantityLimitsMessages(props: IBuyboxExtentedProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const {\r\n resources\r\n } = props;\r\n\r\n const\r\n {\r\n min,\r\n max\r\n } = state;\r\n\r\n if (!_isOrderQuantityLimitsFeatureEnabled(props)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n \r\n {_renderMaxLabel(max, resources.maxQuantityText)}\r\n {_renderMinLabel(min, resources.minQuantityText)}\r\n \r\n );\r\n}\r\n\r\nexport const RetailDefaultOrderQuantityLimitsFeatureName: string = 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature';\r\n\r\nconst _renderMaxLabel = (max: number | undefined, maxQuantityText: string, typeName?: string): React.ReactElement | undefined => {\r\n const className = _getClassNamePrefix(typeName ? typeName : '');\r\n if (max && max !== 0 && max !== Number.MAX_VALUE) {\r\n return (\r\n

\r\n {maxQuantityText?.replace('{max}', max.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _renderMinLabel = (min: number | undefined, minQuantityText: string, typeName?: string): JSX.Element | undefined => {\r\n const className = _getClassNamePrefix(typeName ? typeName : '');\r\n if (min && min > 1) {\r\n return (\r\n

\r\n {minQuantityText?.replace('{min}', min.toString())}\r\n

\r\n );\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst _isOrderQuantityLimitsFeatureEnabled = (props: IBuyboxExtentedProps): boolean | undefined => {\r\n const defaultOrderQuantityLimitsFeatureConfig = props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n\r\n const customerInfo = props.data.customerInformation.result;\r\n return customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string | undefined): string => {\r\n return typeName?.toLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport { AddToCartBehavior, IAddToCartFailureResult, IAddToCartResources, ItemSuccessfullyAddedToCartNotification, PriceComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { DeliveryOption, OrgUnitLocation, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { IMfrmBuyboxData } from '../mfrm-buybox.data';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\n\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport function getBuyboxFindInStore(props: IMfrmBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: {\r\n storeSelector\r\n },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n findInStoreDescriptionText,\r\n findInStoreLinkText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText\r\n /*descriptionTextToShowAllPickupOptions*/\r\n },\r\n context: {\r\n request: {\r\n channel: {\r\n PickupDeliveryModeCode\r\n } = { PickupDeliveryModeCode: undefined }\r\n }\r\n }\r\n } = props;\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const storeSelectorStateManager = data?.storeSelectorStateManager?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const\r\n {\r\n errorState: {\r\n configureErrors,\r\n quantityError,\r\n otherError,\r\n errorHost\r\n },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const onClick = () => findInStoreOnClick(props, state, callbacks);\r\n\r\n if (!product || !storeSelectorStateManager || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (!deliveryOptions ||\r\n !deliveryOptions.DeliveryOptions ||\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText: originalPriceText,\r\n currentPriceText: currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n ) : '';\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings: dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent: priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen: modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClick,\r\n\r\n heading: (\r\n \r\n ),\r\n\r\n description: (\r\n

\r\n {findInStoreDescriptionText}\r\n

\r\n ),\r\n productPickupOptionList: null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {findInStoreLinkText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nasync function findInStoreOnClick(props: IMfrmBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const {\r\n selectedProduct,\r\n quantity\r\n } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions = product.Dimensions && product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState(\r\n {\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n }\r\n );\r\n }\r\n } else {\r\n storeSelectorStateManager.openDialog({\r\n product,\r\n id: storeSelectorId,\r\n deliveryOptions: undefined,\r\n onLocationSelected: (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart.addProductToCart({ product: product, count: quantity, location: orgUnitLocation, deliveryMode: deliveryMode })\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n\r\n const productAvailability = state.productAvailableQuantity ?\r\n state.productAvailableQuantity.ProductAvailableQuantity :\r\n productAvailableQuantity && productAvailableQuantity.length ?\r\n productAvailableQuantity[0].ProductAvailableQuantity : undefined;\r\n\r\n const failureResult: IAddToCartFailureResult = { failureReason: 'CARTACTIONFAILED', cartActionResult: { status: result.status, substatus: result.substatus } };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(failureResult, cart, resources, context, product, productAvailability, orgUnitLocation)\r\n });\r\n } else {\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if ((behavior === undefined || behavior === AddToCartBehavior.goToCart)) {\r\n if (result.status === 'SUCCESS' && navigationUrl && MsDyn365.isBrowser) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText,\r\n closeNotificationLabel: resources.closeNotificationLabel\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n return;\r\n });\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n return;\r\n });\r\n }\r\n\r\n return;\r\n}","import {\r\n getBuyboxProductConfigure,\r\n getBuyboxProductDescription,\r\n getBuyboxShopSimilarButton,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getPriceForSelectedVariant,\r\n getProductPageUrlSync,\r\n getProductAvailabilitiesForSelectedVariant,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { format } from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport { RatingComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, ICoreContext, RichTextComponent, Text } from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult,\r\n CommerceProperty,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductPrice,\r\n SimpleProduct,\r\n OrgUnitContact\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync, getDimensionValuesAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { AttributeValue, OrgUnitLocation, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\r\nimport { Popper, Tooltip, Rating } from 'mfcl';\r\nimport Info from 'mfcl/Icons/Info';\r\nimport dayjs from 'dayjs';\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport { addThrottledEvent } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IMFIATPInventoryEntity,\r\n IMFIATPInventoryStatusEntity,\r\n IMFIATPInventoryStatusResponse,\r\n IMFICartLine,\r\n IMFICLDeliveryScheduleParameters\r\n} from '../../actions/CoreProductDataServiceEntities.g';\r\nimport { IMFIItem, IMFIPromotion } from '../../actions/EyebrowMessageDataServiceEntities.g';\r\nimport getTryInStoreAction, { GetTryInStoreInfoInput } from '../../actions/get-try-in-store-info.action';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from '../../actions/TryInStoreDataServiceEntities.g';\r\nimport getAllProductVariants, { BuyboxGetDimensionVariantAvailabilityInput } from '../../data-actions/buybox-get-all-variants-list';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../data-actions/buybox-get-dimension-pricing-action';\r\nimport { IStoreSelectorState } from '../../data-actions/store-selector-state';\r\nimport { fireAnalyticsLink } from '../../Utilities/analytics/clickTrack';\r\nimport { getBVAttributeValues } from '../../Utilities/get-bv-attributes';\r\nimport _getDeliveryByMessage from '../../Utilities/get-delivery-by-message';\r\nimport _getEyebrowMessage from '../../Utilities/get-eyebrow-message';\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport { buildProductBadge, parseBadgeData } from '../../Utilities/get-product-badge';\r\nimport { _coreProductATPCallForInventoryStatusForAllVariants, _getActivePrices } from '../../Utilities/mfrm-buybox-utils';\r\nimport { _getSoonestDeliveryDate } from '../../Utilities/product-search-result-utils';\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductPrice,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getQuantityLimitsMessages\r\n} from './common/buybox-components';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/mfrm-buybox-find-in-store';\r\nimport { IMfrmBuyboxData } from './mfrm-buybox.data';\r\nimport { IMfrmBuyboxProps, IMfrmBuyboxResources } from './mfrm-buybox.props.autogenerated';\r\nimport { IVariantStockInfo } from './mfrm-buybox.view';\r\nimport { getTimeZoneAbbr, secondsToTime } from './../mfrm-store-selector/components/store-selector-location-line-item/date-time-helpers';\r\nimport { parseBrandName } from '../../Utilities/get-product-brand';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\nimport { getZipCode } from '../../Utilities/get-zipcode';\r\nimport { BVRatingSummary } from '../../Utilities/components/BVRatingSummary';\r\nexport interface IBuyboxViewProps extends IMfrmBuyboxProps {\r\n state: IMFRMBuyBoxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n viewCartLink: string | undefined;\r\n showViewCartLink: boolean;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n storeSelectorState?: AsyncResult;\r\n updateDimension?: boolean;\r\n promotionalMessage?: string | undefined;\r\n adjustableItemset?: SimpleProduct;\r\n pillow?: SimpleProduct;\r\n protector?: SimpleProduct;\r\n isEyeBrowLoading?: boolean;\r\n isStoreLoading?: boolean;\r\n updateSuccessfulATC?(): void;\r\n getProductType(shippingInformation: string | undefined): string;\r\n setAllProductVariantsResult(result: IBuyboxGetDimensionVariantAvailabilityActionData[]): void;\r\n}\r\nexport interface IMFRMExtendCommonData extends IBuyboxCommonData {\r\n storeSelectorState?: AsyncResult;\r\n}\r\n// VSI Customization\r\nexport interface IMFRMBuyBoxState extends IBuyboxState {\r\n smallParcelATCallMade: boolean;\r\n StatusATPCall: boolean;\r\n ATPCall: boolean;\r\n recordId?: number;\r\n itemId?: string | undefined;\r\n masterProductId?: number | undefined;\r\n extensionProps: CommerceProperty[];\r\n eyebrowMessageResultState: IMFIPromotion[] | null;\r\n tryInStoresResults?: IMFITryInStoreInfoResponse | {};\r\n OrgUnitNumber?: string | undefined;\r\n deliveryMessage?: string;\r\n deliveryMessageATPResultState: IMFIATPInventoryEntity[] | null;\r\n inventoryStatusATPResultState: IMFIATPInventoryStatusEntity | null;\r\n successfulATC: boolean;\r\n currentProduct: SimpleProduct | undefined;\r\n currentProductDimensions: ProductDimensionFull[] | undefined;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n variantAvailibilityUpdating: boolean;\r\n batchedAtpInventoryStatusData: IMFIATPInventoryStatusResponseEx | null;\r\n variantIdForTracking: string;\r\n ecomAllVairantStockInfoConcatenated: string[];\r\n showViewCartLink: boolean;\r\n isStoreDetailsOpen: boolean;\r\n isDesktop: boolean;\r\n zipCode: string;\r\n isEyeBrowLoading: boolean;\r\n isStoreLoading: boolean;\r\n preferredStore: any;\r\n tealiumRecordIdFor: any;\r\n}\r\nexport interface IMFRMNetworkCallsState {\r\n smallParcelATCallMade: boolean;\r\n StatusATPCall: boolean;\r\n ATPCall: boolean;\r\n setSmallParcelATPCallMade(atpCallMade: boolean): void;\r\n setStatusATPCall(atpCallMade: boolean): void;\r\n setZipCode(zipCode: string): void;\r\n setATPCall(atpCallMade: boolean): void;\r\n}\r\n\r\nexport interface IMFIATPInventoryStatusResponseEx extends IMFIATPInventoryStatusResponse {\r\n zipCode?: string | undefined\r\n}\r\n\r\nexport interface IMFRMProductMExtensionPropsInfo {\r\n extensionProps?: CommerceProperty[];\r\n productBadges?: React.ReactNode | undefined;\r\n ratingComponent?: React.ReactNode | undefined;\r\n _renderTryInStore?: JSX.Element | null;\r\n _renderTryInStoreRedesign?: JSX.Element | null;\r\n eyeBrowMessage?: JSX.Element | null;\r\n deliveryMessage?: string;\r\n ATPDataFromBusiness?: IMFIATPInventoryEntity[] | null;\r\n ATPDataInventoryStausBusiness?: IMFIATPInventoryStatusEntity | null;\r\n ecomAllVairantStockInfoConcatenated: string[];\r\n customerSatisfactionScore?: JSX.Element;\r\n adjustableItem?: SimpleProduct;\r\n pillow?: SimpleProduct;\r\n protector?: SimpleProduct;\r\n}\r\n\r\nexport interface IExtendedSimpleProduct extends SimpleProduct {\r\n priceAfterDiscount?: number;\r\n price?: number;\r\n discount?: number;\r\n productSizeName?: string;\r\n}\r\n\r\nexport const getProductURLForUtag = (product: SimpleProduct | undefined, context: ICoreContext): string => {\r\n const productUrl = getProductPageUrlSync(product?.Name || '', product?.RecordId || 0, context?.actionContext, undefined);\r\n return `${context.request.url.requestUrl.origin}${productUrl}?variantid=${product?.RecordId}`;\r\n};\r\n\r\nexport const getProductSizeForUTag = (product: SimpleProduct | undefined): string | undefined => {\r\n //TODO remove magic numbers like 3 and use constant like DIMENSION_SIZE_TYPE\r\n return product?.Dimensions?.find(item => item.DimensionTypeValue === 3)?.DimensionValue?.Value?.toLowerCase();\r\n};\r\n\r\n\r\n/**\r\n * Buybox Module\r\n */\r\nclass Buybox extends React.PureComponent, IMFRMBuyBoxState> {\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n //Constructor\r\n constructor(props: IMfrmBuyboxProps) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n smallParcelATCallMade: false,\r\n StatusATPCall: false,\r\n ATPCall: false,\r\n recordId: this.props.data.product.result?.RecordId,\r\n itemId: this.props.data.product.result?.ItemId,\r\n masterProductId: this.props.data.product.result?.MasterProductId,\r\n extensionProps: [],\r\n eyebrowMessageResultState: null,\r\n deliveryMessage: '',\r\n deliveryMessageATPResultState: null,\r\n inventoryStatusATPResultState: null,\r\n successfulATC: false,\r\n currentProduct: undefined,\r\n currentProductDimensions: undefined,\r\n variantAvailibilityList: [],\r\n variantAvailibilityUpdating: false,\r\n batchedAtpInventoryStatusData: null,\r\n variantIdForTracking: '',\r\n ecomAllVairantStockInfoConcatenated: [],\r\n showViewCartLink: false,\r\n isStoreDetailsOpen: false,\r\n isDesktop: false,\r\n zipCode: '',\r\n isEyeBrowLoading: true,\r\n isStoreLoading: true,\r\n preferredStore: {},\r\n tealiumRecordIdFor: ''\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n this.updateSuccessfulATC = this.updateSuccessfulATC.bind(this);\r\n this._setAllProductVariantsResult = this._setAllProductVariantsResult.bind(this);\r\n this.timer = null;\r\n this.wrapperRef = React.createRef();\r\n this.handleClickOutside = this.handleClickOutside.bind(this);\r\n this._updateUtagDataOnInitialLoad().catch(e=>{\r\n throw e;\r\n });\r\n }\r\n //React Lifecycle methods\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice,\r\n cart: { result: cart }\r\n },\r\n context: {\r\n request: { }\r\n }\r\n } = this.props;\r\n if (MsDyn365.isBrowser) {\r\n this.updateViewPort(this.props.context);\r\n }\r\n document.addEventListener(\"mousedown\", this.handleClickOutside);\r\n // set availability list for all variants\r\n if (this.props.data.productSpecificationData.result?.length) {\r\n this.props.data.allVariants.result &&\r\n this._updateAvailbilityForVariantsUpdated(\r\n this.props.data.allVariants.result,\r\n this.props,\r\n this.props.data.productSpecificationData.result\r\n );\r\n }\r\n this._updatePrice(await productPrice);\r\n if (product) {\r\n // check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n\r\n if (product.ItemTypeValue === PRODUCTASSERVICE) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n // VSI - Customization Start 48959\r\n if (product.MasterProductId) {\r\n await this._eyeBrowMessageAsyncFunc(true);\r\n }\r\n // VSI - Customization End 48959\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n !canTryInStores && this.setState({ isStoreLoading: false });\r\n canTryInStores && (await this._tryInStoreAsyncCall());\r\n }\r\n if (\r\n this.props.data.product.result?.RecordId !== this.state.recordId ||\r\n this.props.data.product.result?.ItemId !== this.state.itemId\r\n ) {\r\n this.setState({\r\n recordId: this.props.data.product.result!.RecordId,\r\n masterProductId: this.props.data.product.result!.MasterProductId,\r\n itemId: this.props.data.product.result!.ItemId\r\n });\r\n }\r\n if (this.state.recordId && this.state.masterProductId && this.state.itemId) {\r\n this._setRecentlyViewProducts(this.state.recordId, this.state.masterProductId);\r\n }\r\n const newCartTotalItems = cart && cart.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n if (newCartTotalItems && newCartTotalItems > 0) {\r\n this.setState({\r\n showViewCartLink: true\r\n });\r\n }\r\n else {\r\n this.setState({\r\n showViewCartLink: false\r\n });\r\n\r\n }\r\n const zipCode = getZipCode(this.props.context.actionContext);\r\n zipCode && this.setState({ zipCode: zipCode });\r\n\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n const preferredStore = isSociEnabled ? this._getSociPreferredStore() : this._getPreferredStore();\r\n (!preferredStore || Object.keys(preferredStore).length === 0) && this.setState({ isStoreLoading: false });\r\n preferredStore && this.setState({ preferredStore: preferredStore });\r\n }\r\n\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n public async componentDidUpdate(prevProps: IMfrmBuyboxProps, prevState: IMFRMBuyBoxState): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n cart: { result: cart }\r\n }\r\n } = this.props;\r\n if (MsDyn365.isBrowser) {\r\n this.resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => this.updateViewPort(this.props.context));\r\n }\r\n prevState.selectedProduct?.then(selProd => {\r\n this.state.selectedProduct?.then(async currSelProd => {\r\n if (selProd?.RecordId !== currSelProd?.RecordId) {\r\n this.setState({ smallParcelATCallMade: false });\r\n }\r\n });\r\n });\r\n\r\n if (\r\n this.props.data.product.result?.RecordId !== this.state.recordId ||\r\n this.props.data.product.result?.ItemId !== this.state.itemId\r\n ) {\r\n this.setState(\r\n {\r\n currentProduct: this.props.data.product.result,\r\n recordId: this.props.data.product.result!.RecordId,\r\n masterProductId: this.props.data.product.result!.MasterProductId,\r\n itemId: this.props.data.product.result!.ItemId,\r\n StatusATPCall: false,\r\n ATPCall: false\r\n },\r\n async () => {\r\n this.state.recordId && this._setRecentlyViewProducts(this.state.recordId, this.state.masterProductId);\r\n // VSI - Customization Start 48959\r\n const allVariants = this.props?.data?.allVariants?.result ? this.props?.data?.allVariants?.result : [];\r\n await this.setDefaultOOSVariant(allVariants);\r\n await this._eyeBrowMessageAsyncFunc(true);\r\n // VSI - Customization End 48959\r\n }\r\n );\r\n }\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n if (canTryInStores) {\r\n if (isSociEnabled) {\r\n await this._tryInStoreAsyncCall();\r\n } else {\r\n const preferredStore = this._getPreferredStore();\r\n if (preferredStore?.OrgUnitNumber && this.state.OrgUnitNumber && this.state.OrgUnitNumber !== preferredStore.OrgUnitNumber) {\r\n await this._tryInStoreAsyncCall();\r\n }\r\n }\r\n }\r\n\r\n if (this.state.extensionProps.length <= 0 && this.props.data.product.result) {\r\n if (this.props.data.product?.result?.ExtensionProperties && this.props.data.product?.result?.ExtensionProperties.length >= 1) {\r\n this.setState({ extensionProps: this.props.data.product.result.ExtensionProperties });\r\n }\r\n }\r\n const newCartTotalItems = cart && cart.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n if (newCartTotalItems && newCartTotalItems > 0) {\r\n this.setState({\r\n showViewCartLink: true\r\n });\r\n }\r\n else {\r\n this.setState({\r\n showViewCartLink: false\r\n });\r\n }\r\n\r\n if (this.state.tealiumRecordIdFor === '' || (this.props.data.product.result?.RecordId !== this.state.recordId)) {\r\n for (const element of this.state.ecomAllVairantStockInfoConcatenated) {\r\n const [recordId, isInStock] = element && element.split('|');\r\n if (product?.RecordId.toString() === recordId && isInStock === '0') {\r\n // product found that is in stock then no need to loop through other values\r\n await this._sendProductDataToTealium(this.props, product);\r\n break;\r\n } else if (product?.RecordId.toString() === recordId && isInStock === '1') {\r\n break;\r\n }\r\n }\r\n }\r\n const zipCode = getZipCode(this.props.context.actionContext);\r\n zipCode && zipCode !== this.state.zipCode && this.setState({ zipCode: zipCode });\r\n\r\n if (this.state.zipCode !== prevState.zipCode) {\r\n this.props.data.allVariants.result && this.props.data.productSpecificationData.result?.length &&\r\n this._updateAvailbilityForVariantsUpdated(\r\n this.props.data.allVariants.result,\r\n this.props,\r\n this.props.data.productSpecificationData.result\r\n );\r\n }\r\n }\r\n\r\n public async componentWillUnmount(): Promise {\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n document.removeEventListener(\"mousedown\", this.handleClickOutside);\r\n MsDyn365.isBrowser && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n }\r\n\r\n private updateViewPort = (context: ICoreContext): void => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'lg' || viewport === 'xl') {\r\n this.setState({\r\n isDesktop: true\r\n });\r\n } else {\r\n this.setState({\r\n isDesktop: false\r\n });\r\n }\r\n };\r\n\r\n //Public methods\r\n public updateSuccessfulATC = (): void => {\r\n this.setState({ successfulATC: true });\r\n this.timer = setTimeout(() => {\r\n this.setState({ successfulATC: false });\r\n }, 4500);\r\n };\r\n\r\n public extendAllProductVariants(\r\n allProductVariants: SimpleProduct[] | undefined,\r\n prices: IBuyboxGetDimensionPricingActionData[]\r\n ): IExtendedSimpleProduct[] | undefined {\r\n let extendedAllProductVariants: IExtendedSimpleProduct[] | undefined =\r\n allProductVariants &&\r\n allProductVariants?.map(variant => {\r\n let extendedObj: IExtendedSimpleProduct = { ...variant };\r\n variant.Dimensions?.forEach(dimension => {\r\n if (dimension.DimensionTypeValue === 3) {\r\n extendedObj = { productSizeName: dimension.DimensionValue?.Value, ...variant };\r\n }\r\n });\r\n return extendedObj;\r\n });\r\n extendedAllProductVariants =\r\n extendedAllProductVariants &&\r\n extendedAllProductVariants.map(variant => {\r\n let extendedObj: IExtendedSimpleProduct = { ...variant };\r\n prices?.forEach(dimensionPrice => {\r\n if (dimensionPrice?.discountAmount && dimensionPrice?.name === variant?.productSizeName) {\r\n const priceAfterDiscount = Math.round(dimensionPrice?.price - dimensionPrice?.discountAmount);\r\n extendedObj = {\r\n discount: dimensionPrice?.discountAmount,\r\n price: dimensionPrice?.price,\r\n priceAfterDiscount: priceAfterDiscount,\r\n ...variant\r\n };\r\n }\r\n });\r\n return extendedObj;\r\n });\r\n return extendedAllProductVariants;\r\n }\r\n\r\n public handleClickOutside(event: any): void {\r\n if (this.wrapperRef && !this.wrapperRef.current?.contains(event.target)) {\r\n this.setState({ isStoreDetailsOpen: false });\r\n }\r\n\r\n }\r\n\r\n //Public async methods\r\n public async getNextInventoryProduct(\r\n product: SimpleProduct | undefined,\r\n productSpecificationData: AttributeValue[] | undefined,\r\n allProductVariants: IExtendedSimpleProduct[] | undefined,\r\n context: ICoreContext<{\r\n [x: string]: any;\r\n }>,\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[]\r\n ): Promise {\r\n const {\r\n app: {\r\n config: { smallParcelAttributeKey }\r\n }\r\n } = context;\r\n\r\n const smallParcelVariantsListObj = {};\r\n variantAvailibilityList?.forEach(obj => {\r\n const key = obj?.variantID;\r\n smallParcelVariantsListObj[key] = obj;\r\n });\r\n\r\n const shippingInformation = productSpecificationData\r\n ?.find(attr => attr.Name?.trim() === smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n const productType = this._getProductType(shippingInformation).toLowerCase();\r\n let isProductFound = false;\r\n let inStockLowestPriceVariant;\r\n\r\n // to check that if current loaded variant is OOS or not\r\n for (const element of this.state.ecomAllVairantStockInfoConcatenated) {\r\n const [recordId, isInStock] = element && element.split('|');\r\n if (product?.RecordId.toString() === recordId && isInStock === '0') {\r\n // product found that is in stock then no need to loop through other values\r\n inStockLowestPriceVariant = product;\r\n isProductFound = true;\r\n break;\r\n } else if (product?.RecordId.toString() === recordId && isInStock === '1') {\r\n break;\r\n }\r\n }\r\n\r\n // if current loaded variant is OOS then check the others\r\n !isProductFound &&\r\n allProductVariants?.filter(variantObj => {\r\n if (!isProductFound) {\r\n for (const element of this.state.ecomAllVairantStockInfoConcatenated) {\r\n const [recordId, isInStock] = element && element.split('|');\r\n if (variantObj?.RecordId.toString() === recordId && isInStock === '0') {\r\n // product found that is in stock then no need to loop through other values\r\n const smallParcelProduct = smallParcelVariantsListObj[variantObj?.RecordId];\r\n if (productType === 'small parcel') {\r\n if (smallParcelProduct?.isAvailable === true &&\r\n variantObj?.RecordId === smallParcelProduct?.variantID) {\r\n inStockLowestPriceVariant = variantObj;\r\n isProductFound = true;\r\n break;\r\n }\r\n } else {\r\n inStockLowestPriceVariant = variantObj;\r\n isProductFound = true;\r\n break;\r\n }\r\n } else if (variantObj.RecordId.toString() === recordId) {\r\n // isInStock is 0 but record id is matched then no need to loop through other values\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n return inStockLowestPriceVariant;\r\n }\r\n\r\n public async makeCoreProductDeliveryMessage(str: string): Promise {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData }\r\n },\r\n context: {\r\n app: {\r\n config: { smallParcelAttributeKey }\r\n }\r\n }\r\n } = this.props;\r\n const outOfStock = productSpecificationData?.find(\r\n attr => attr.Name?.trim().toLowerCase() === this.props.context.app.config.outOfStockProductKey?.trim().toLowerCase()\r\n )?.BooleanValue;\r\n const shippingInformation = productSpecificationData\r\n ?.find(attr => attr.Name?.trim() === smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n\r\n if (this._getProductType(shippingInformation).toLowerCase() === 'core' && !this.state.ATPCall && !outOfStock) {\r\n this.setState({ ATPCall: true });\r\n await this.getDeliverySlotFromATP(true);\r\n } else if (this._getProductType(shippingInformation).toLowerCase() === 'small parcel' && !outOfStock) {\r\n this.setState({ StatusATPCall: true });\r\n // await this.getInventoryStatusCall(true);\r\n const inventoryStatusData = this.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n ? this.state.batchedAtpInventoryStatusData?.ATPInventoryStatusData\r\n : null;\r\n let selectedObj = inventoryStatusData\r\n ? inventoryStatusData?.find(item => item.VariantRecordId?.toString() === this.state.currentProduct?.RecordId?.toString())\r\n : null;\r\n selectedObj = selectedObj ? { ...selectedObj, zipCode: inventoryStatusData![0]?.zipCode } : null;\r\n this.setState({ inventoryStatusATPResultState: selectedObj });\r\n }\r\n }\r\n\r\n public async getVariantID(updatedProduct?: SimpleProduct | undefined): Promise {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: { actionContext, request }\r\n } = this.props;\r\n const { RecordId, ItemId } = updatedProduct && updatedProduct !== undefined ? updatedProduct : product || {};\r\n let variantId: string | undefined;\r\n if (product?.MasterProductId && product?.MasterProductId > 0) {\r\n const input = new BuyboxGetDimensionVariantAvailabilityInput(product.MasterProductId, request.apiSettings.channelId);\r\n const variantsResp: SimpleProduct[] = await getAllProductVariants(input, actionContext);\r\n for (let variantIter = 0;variantIter < variantsResp.length;variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0;eIter < ePropsVariant?.length;eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n variantId = ePropsVariant[eIter].Value?.StringValue;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n const variantofId = `V000${ItemId}`;\r\n variantId = variantofId?.slice(0, -1);\r\n }\r\n\r\n return variantId;\r\n }\r\n\r\n //Private methods\r\n private dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n private dimensions: { [id: number]: string } = {};\r\n private telemetryContent: ITelemetryContent;\r\n private timer: NodeJS.Timeout | null;\r\n private wrapperRef: React.RefObject;\r\n\r\n private buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n if (this.state.quantity !== newQuantity) {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventCategory: 'PDP Card Action',\r\n eventAction: 'Change Quantity',\r\n eventLabel: 'Change Quantity PDP',\r\n eventNoninteraction: 'false',\r\n generalConfig: { enhanced_action: 'change_quantity' }\r\n });\r\n }\r\n\r\n this.setState({ quantity: newQuantity, errorState: errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n return this.dimensionUpdateQueue\r\n .enqueue(() => {\r\n return this._updateDimensions();\r\n })\r\n .catch((reason: any) => {\r\n // tslint:disable-line:no-any\r\n // Ignore discarded processes.\r\n if (reason !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw reason;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: IMfrmBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension: isUpdatingDimension });\r\n },\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState: errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private _updateURLWithoutReloading(product: SimpleProduct | undefined) {\r\n if (this.props.context.app.config.queryBasedVariantSelection) {\r\n try {\r\n if (MsDyn365.isBrowser) {\r\n const queryParamValue = variantQueryStringName;\r\n const masterId = product?.MasterProductId;\r\n const currUrl = window.location.href;\r\n const urlWithIgnoredCase = new URL(currUrl.toString().toLocaleLowerCase());\r\n if (masterId && currUrl.indexOf(`${masterId}.p`) !== -1) {\r\n if (urlWithIgnoredCase.searchParams.has(queryParamValue)) {\r\n if (urlWithIgnoredCase.searchParams.get(queryParamValue) === product?.RecordId?.toString()) {\r\n return;\r\n }\r\n }\r\n urlWithIgnoredCase.searchParams.set(queryParamValue, product?.RecordId.toString() || '');\r\n window.history.replaceState(window.history.state, '', urlWithIgnoredCase.toString().replace(urlWithIgnoredCase.host, window.location.host));\r\n } else if (masterId && currUrl.indexOf(`${masterId}.p`) === -1) {\r\n const productUrl = getProductPageUrlSync(\r\n product?.Name || '',\r\n masterId || 0,\r\n this.props.context && this.props.context.actionContext,\r\n undefined\r\n );\r\n if (urlWithIgnoredCase.searchParams.has(queryParamValue)) {\r\n if (urlWithIgnoredCase.searchParams.get(queryParamValue) === product?.RecordId?.toString()) {\r\n //pushstate only in this case, as here we need to update url with masterid\r\n window.history.pushState({}, '', urlWithIgnoredCase.search ? `${productUrl}${urlWithIgnoredCase.search}` : productUrl);\r\n return;\r\n }\r\n }\r\n urlWithIgnoredCase.searchParams.set(queryParamValue, product?.RecordId.toString() || '');\r\n window.history.pushState({}, '', urlWithIgnoredCase.search ? `${productUrl}${urlWithIgnoredCase.search}` : productUrl);\r\n }\r\n }\r\n } catch (error) {\r\n console.log('Error [_updateURLWithoutReloading]', error);\r\n }\r\n } else {\r\n const currUrl = window.location.href;\r\n let queryParams = '';\r\n if (currUrl.indexOf('?') !== -1) {\r\n queryParams = currUrl.split('?')[1];\r\n }\r\n const productUrl = getProductPageUrlSync(\r\n product?.Name || '',\r\n product?.RecordId || 0,\r\n this.props.context && this.props.context.actionContext,\r\n undefined\r\n );\r\n if (MsDyn365.isBrowser) {\r\n window.history.pushState({}, '', queryParams ? `${productUrl}?${queryParams}` : productUrl);\r\n }\r\n }\r\n }\r\n\r\n private _updateQueryParamVariantId = (variantId: Number | undefined) => {\r\n if (MsDyn365.isBrowser) {\r\n const currUrl = window.location.href;\r\n const urlWithIgnoredCase = new URL(currUrl.toString().toLocaleLowerCase());\r\n if (urlWithIgnoredCase.searchParams.has(variantQueryStringName)) {\r\n if (urlWithIgnoredCase.searchParams.get(variantQueryStringName) === variantId?.toString()) {\r\n return;\r\n }\r\n }\r\n // url is containing variantId\r\n urlWithIgnoredCase.searchParams.set(variantQueryStringName, variantId?.toString() || '');\r\n window.history.replaceState(window.history.state, '', urlWithIgnoredCase.toString().replace(urlWithIgnoredCase.host, window.location.host));\r\n // window.history.pushState({}, '', urlWithIgnoredCase.href);\r\n }\r\n };\r\n private _setAllProductVariantsResult(result: IBuyboxGetDimensionVariantAvailabilityActionData[]) {\r\n this.setState({ variantAvailibilityList: result });\r\n }\r\n\r\n /** Method for setting cookies for recently viewed products */\r\n private _setRecentlyViewProducts = (recordId: number, masterProductId: number | undefined): void => {\r\n const cookies = new Cookies();\r\n const date = new Date(); // Now\r\n date.setDate(date.getDate() + 30); // Set now + 30 days as the new date\r\n\r\n const product = {\r\n masterProductId: masterProductId,\r\n recordId: recordId,\r\n expiry: date\r\n };\r\n\r\n interface IRecentlyViewedProducts {\r\n masterProductId: number;\r\n recordId: number;\r\n expiry: number;\r\n }\r\n let inserted = false;\r\n\r\n let recentlyViewedProductsStored = cookies.get(`RecentlyViewedProducts`);\r\n if (masterProductId !== undefined) {\r\n if (recentlyViewedProductsStored === undefined || recentlyViewedProductsStored.length === 0) {\r\n const recentlyViewedProducts = [];\r\n recentlyViewedProducts.push(product);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProducts, { path: '/' });\r\n } else {\r\n recentlyViewedProductsStored?.map((item: IRecentlyViewedProducts, index: number) => {\r\n if (item.masterProductId === masterProductId) {\r\n recentlyViewedProductsStored?.splice(index, 1);\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n inserted = true;\r\n }\r\n });\r\n\r\n if (!inserted) {\r\n if (recentlyViewedProductsStored.length >= 6) {\r\n recentlyViewedProductsStored?.splice(0, 1);\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n } else {\r\n recentlyViewedProductsStored = [product]?.concat(recentlyViewedProductsStored);\r\n cookies.set(`RecentlyViewedProducts`, recentlyViewedProductsStored, { path: '/' });\r\n }\r\n inserted = false;\r\n }\r\n }\r\n }\r\n };\r\n private _setSmallParcelATPCallMade = (atpCallMade: boolean) => {\r\n this.setState({ smallParcelATCallMade: atpCallMade });\r\n };\r\n private _setStatusATPCall = (atpCallMade: boolean) => {\r\n this.setState({ StatusATPCall: atpCallMade });\r\n };\r\n private _setZipCode = (zipCode: string) => {\r\n this.setState({ zipCode: zipCode });\r\n };\r\n private _setATPCall = (atpCallMade: boolean) => {\r\n this.setState({ ATPCall: atpCallMade });\r\n };\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n this._updateUtagData(this.props.data?.product?.result, newPrice?.CustomerContextualPrice).catch(e => {\r\n throw e;\r\n });\r\n }\r\n\r\n private _updateDimensionValue = (\r\n productDimensionFull: ProductDimensionFull,\r\n newValueId: string | undefined\r\n ): ProductDimensionValue | undefined => {\r\n if (newValueId && productDimensionFull.DimensionValues) {\r\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n private _getDropdownName = (dimensionType: number, resources: IMfrmBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private _scrollToBVHosted = () => {\r\n if (MsDyn365.isBrowser) {\r\n const ratingSection = document?.getElementById('writeFirstReview');\r\n const isRatingReviewsLoaded = ratingSection?.getElementsByTagName('div')[0]?.getAttribute(\"data-bv-ready\");\r\n isRatingReviewsLoaded && ratingSection?.scrollIntoView({ behavior: 'smooth' });\r\n }\r\n };\r\n\r\n private _onHandleToggleAvailableStoreDetails = () => {\r\n this.setState({ isStoreDetailsOpen: !this.state.isStoreDetailsOpen });\r\n };\r\n\r\n private _getPreferredStore = (): OrgUnitLocation | undefined => {\r\n const props = this.props as IBuyboxExtentedProps & IBuyboxViewProps;\r\n const { storeSelectorState } = props;\r\n let preferredStore = (storeSelectorState && storeSelectorState.result && storeSelectorState.result.prefferedStore) || {};\r\n if (\r\n MsDyn365.isBrowser &&\r\n (!preferredStore.OrgUnitNumber || !preferredStore.Zip) &&\r\n localStorage.getItem('_mfrm__prefferedStore_')\r\n ) {\r\n preferredStore = JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '');\r\n }\r\n return preferredStore || undefined;\r\n };\r\n private _getSociPreferredStore = (): any => {\r\n let preferredStore = {};\r\n if (MsDyn365.isBrowser && localStorage.getItem('_mfrm__prefferedStore_')) {\r\n preferredStore = JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '');\r\n } else {\r\n preferredStore = {};\r\n }\r\n return preferredStore;\r\n };\r\n\r\n private _getProductSpecificationAttributeByKeyName = (attrName: string): boolean | undefined => {\r\n return (\r\n this.props.data.productSpecificationData &&\r\n this.props.data.productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === attrName.trim().toLowerCase())\r\n ?.BooleanValue\r\n );\r\n };\r\n\r\n private _getProductType = (shippingInformation: string | undefined): string => {\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'delivery') {\r\n return 'Core';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'parcel') {\r\n return 'Small Parcel';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'drop ship') {\r\n return 'Drop Ship';\r\n }\r\n return '';\r\n };\r\n\r\n private _updateUtagDataOnInitialLoad = async () => {\r\n const productprice = await this.props.data.productPrice;\r\n const product = await this.props.data.product;\r\n const category = await this.props.data.categoryPaths;\r\n const allCategoriesArr = category;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n const fallBackBrandAttribute = 'BRAND';\r\n const attribute = this.props.context.app.config.brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n let productBrandName =\r\n (await this.props.data.productSpecificationData).find(\r\n currAttribute =>\r\n currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const productSize = product?.Dimensions?.find(item => item.DimensionTypeValue === 3)?.DimensionValue?.Value?.toLowerCase();\r\n const item = await this.props.data.listPageStateBuyBox;\r\n item.itemId = product.ItemId;\r\n item.variantId = this._getVariantIDOnLoad();\r\n item.name = product.Name;\r\n item.categoryName = categoryName;\r\n item.productBrandName = productBrandName;\r\n item.price = productprice.CustomerContextualPrice ? productprice.CustomerContextualPrice.toString() : product.BasePrice.toString();\r\n item.productUrl = getProductURLForUtag(product, this.props.context);\r\n item.productImageUrl = `${product?.PrimaryImageUrl}`;\r\n item.productSize = productSize;\r\n };\r\n\r\n private _getVariantIDOnLoad = (): string | undefined => {\r\n const {\r\n data: {\r\n product: { result: product }\r\n }\r\n } = this.props;\r\n const { RecordId, ItemId } = product || {};\r\n let variantId: string | undefined;\r\n const variantsResp: SimpleProduct[] | undefined = this.props.data.allProductVariants?.result;\r\n if (variantsResp) {\r\n for (let variantIter = 0;variantIter < variantsResp.length;variantIter++) {\r\n if (variantsResp[variantIter].RecordId === RecordId) {\r\n const ePropsVariant = variantsResp[variantIter].ExtensionProperties!;\r\n if (ePropsVariant?.length > 0) {\r\n for (let eIter = 0;eIter < ePropsVariant?.length;eIter++) {\r\n if (ePropsVariant[eIter].Key === 'RetailVariantId') {\r\n variantId = ePropsVariant[eIter].Value?.StringValue;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n const variantofId = `V000${ItemId}`;\r\n variantId = variantofId?.slice(0, -1);\r\n }\r\n return variantId;\r\n };\r\n\r\n private _getProductAttributeUpdated = (productSpecificationData: AttributeValue[], props: IMfrmBuyboxProps) => {\r\n // shippingInformation product attribute value\r\n const shippingInformationSmall = productSpecificationData\r\n .find(attr => attr.Name?.trim() === props.context.app.config.smallParcelAttributeKey)\r\n ?.TextValue?.toLowerCase();\r\n\r\n return this._getProductType(shippingInformationSmall);\r\n };\r\n\r\n //private async methods\r\n // tslint:disable-next-line: max-line-length\r\n private _updateAvailbilityForVariantsUpdated = async (\r\n allVariants: IBuyboxGetDimensionVariantAvailabilityActionData[],\r\n props: IMfrmBuyboxProps,\r\n productSpecificationData: AttributeValue[]\r\n ) => {\r\n const variantsResult: IBuyboxGetDimensionVariantAvailabilityActionData[] = allVariants;\r\n const availableVariantIDs: number[] = [];\r\n const itemId = props?.data?.product?.result?.ItemId;\r\n const {\r\n context: {\r\n app: {\r\n config: {\r\n eComAllVariantsOOSMultiAttr,\r\n ecomAllVairantStockInfoKey,\r\n ecomAllVairantStockInfoKey1,\r\n ecomAllVairantStockInfoKey2,\r\n ecomAllVairantStockInfoKey3\r\n }\r\n }\r\n }\r\n } = this.props;\r\n let count = 0;\r\n if (this.state.masterProductId) {\r\n //calling this to get masterProductAttribute data when PDP is loading from variantId\r\n productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n this.state.masterProductId,\r\n props.context.request.apiSettings.channelId,\r\n 0\r\n );\r\n }\r\n let ecomAllVairantStockInfoConcatenated: any[] = [];\r\n // for backward compatiblity\r\n if (!eComAllVariantsOOSMultiAttr || eComAllVariantsOOSMultiAttr === undefined) {\r\n try {\r\n const eComJsonData = productSpecificationData.find(attr => attr.Name?.trim() === ecomAllVairantStockInfoKey)?.TextValue;\r\n const newAllVariantStockInfo = eComJsonData && JSON.parse(eComJsonData);\r\n ecomAllVairantStockInfoConcatenated = [\r\n ...ecomAllVairantStockInfoConcatenated,\r\n ...newAllVariantStockInfo.VariantList.map(\r\n (item: IVariantStockInfo) => `${item.VariantRecID}|${item.OutOfStock ? '1' : '0'}`\r\n )\r\n ];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey`);\r\n }\r\n } else {\r\n const ecomVairantStockInfoKey1 = ecomAllVairantStockInfoKey1 ? ecomAllVairantStockInfoKey1 : 'EcomAllVariantOOSInfo1';\r\n const ecomVairantStockInfoKey2 = ecomAllVairantStockInfoKey2 ? ecomAllVairantStockInfoKey2 : 'EcomAllVariantOOSInfo2';\r\n const ecomVairantStockInfoKey3 = ecomAllVairantStockInfoKey3 ? ecomAllVairantStockInfoKey3 : 'EcomAllVariantOOSInfo3';\r\n const ecomAllVairantStockInfo1 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey1)\r\n ?.TextValue;\r\n const ecomAllVairantStockInfo2 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey2)\r\n ?.TextValue;\r\n const ecomAllVairantStockInfo3 = productSpecificationData.find(attr => attr.Name?.trim() === ecomVairantStockInfoKey3)\r\n ?.TextValue;\r\n\r\n if (ecomAllVairantStockInfo1) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo1)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey1`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey1`);\r\n }\r\n }\r\n if (ecomAllVairantStockInfo2) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo2)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey2`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey2`);\r\n }\r\n }\r\n if (ecomAllVairantStockInfo3) {\r\n try {\r\n ecomAllVairantStockInfoConcatenated = [...ecomAllVairantStockInfoConcatenated, ...JSON.parse(ecomAllVairantStockInfo3)];\r\n } catch (error) {\r\n this.telemetryContent.telemetry?.error(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey3`);\r\n console.log(`Error ${error} [OOS Checking] ecomAllVairantStockInfoKey3`);\r\n }\r\n }\r\n }\r\n this.setState({ ecomAllVairantStockInfoConcatenated });\r\n variantsResult &&\r\n variantsResult.forEach(async variant => {\r\n // get specfication data for each variant\r\n count++;\r\n if (!productSpecificationData) {\r\n return;\r\n }\r\n let outOfStockBoolean = null;\r\n for (let i = 0;i < ecomAllVairantStockInfoConcatenated.length;i++) {\r\n if (\r\n ecomAllVairantStockInfoConcatenated &&\r\n ecomAllVairantStockInfoConcatenated[i].split('|')[0] === variant.variantID.toString()\r\n ) {\r\n outOfStockBoolean = !!Number(ecomAllVairantStockInfoConcatenated[i].split('|')[1]);\r\n break;\r\n }\r\n }\r\n outOfStockBoolean ? (variant.isAvailable = false) : (variant.isAvailable = true);\r\n if (outOfStockBoolean === null || outOfStockBoolean === undefined) {\r\n variant.isAvailable = false;\r\n }\r\n // get product type for each\r\n const productType = this._getProductAttributeUpdated(productSpecificationData, props);\r\n // set availability for each\r\n if (productType === 'Core') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n variant.isAvailable = true;\r\n }\r\n } else if (productType === 'Small Parcel') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n availableVariantIDs.push(variant.variantID);\r\n variant.isAvailable = false;\r\n }\r\n }\r\n else if (productType === 'Drop Ship') {\r\n if (outOfStockBoolean) {\r\n variant.isAvailable = false;\r\n } else {\r\n variant.isAvailable = true;\r\n }\r\n }\r\n // update the state\r\n if (availableVariantIDs.length > 0 && count === variantsResult.length) {\r\n const batchedAtp = await _coreProductATPCallForInventoryStatusForAllVariants(\r\n props,\r\n availableVariantIDs,\r\n itemId,\r\n variantsResult\r\n );\r\n this.setState({ batchedAtpInventoryStatusData: batchedAtp });\r\n await this.setDefaultOOSVariant(variantsResult);\r\n } else if (count === variantsResult.length) {\r\n await this.setDefaultOOSVariant(variantsResult);\r\n }\r\n\r\n this.setState({ variantAvailibilityList: variantsResult });\r\n });\r\n };\r\n\r\n private _updateUtagData = async (updatedProduct: SimpleProduct | undefined, updatedPrice?: number) => {\r\n const variantId = await this.getVariantID(updatedProduct);\r\n const price = await this.props.data.productPrice;\r\n const finalPrice = updatedPrice ? updatedPrice : price?.CustomerContextualPrice;\r\n try {\r\n // @ts-ignore\r\n if (utag.data) {\r\n // @ts-ignore\r\n utag.data = {\r\n // @ts-ignore\r\n ...utag.data,\r\n product_price: [`${finalPrice}`],\r\n product_variant: [`${variantId}`],\r\n product_url: [getProductURLForUtag(updatedProduct, this.props.context)],\r\n product_image_url: [`${updatedProduct?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(updatedProduct)]\r\n };\r\n }\r\n // @ts-ignore\r\n if (utag_data) {\r\n // @ts-ignore\r\n utag_data = {\r\n // @ts-ignore\r\n ...utag_data,\r\n product_price: [`${finalPrice}`],\r\n product_variant: [`${variantId}`],\r\n product_url: [getProductURLForUtag(updatedProduct, this.props.context)],\r\n product_image_url: [`${updatedProduct?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(updatedProduct)]\r\n };\r\n }\r\n } catch (error) {\r\n console.log(error, '[utag_data not found]');\r\n }\r\n };\r\n\r\n private _sendProductDataToTealium = async (props: IMfrmBuyboxProps, product: SimpleProduct | undefined) => {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData },\r\n productPrice,\r\n categoryPaths\r\n },\r\n context: {\r\n request: { }\r\n },\r\n app: {\r\n config: { brandBackofficeAttributePdp }\r\n }\r\n } = props;\r\n this.setState({ tealiumRecordIdFor: product?.RecordId.toString() });\r\n const allCategoriesArr = categoryPaths?.result;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n const fallBackBrandAttribute = 'VENDOR BRAND';\r\n const attribute = brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n let productBrandName =\r\n productSpecificationData &&\r\n productSpecificationData?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const variantsResp = await this.getVariantID();\r\n // @ts-ignore\r\n if (utag) {\r\n const { ItemId, Name } = product || {};\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'product-detail-view',\r\n event_category: 'ecommerce',\r\n event_action: 'product detail view',\r\n enhanced_action: 'detail',\r\n event_label: `${ItemId}:${Name}`,\r\n event_noninteraction: 'true',\r\n product_id: [`${ItemId}`],\r\n product_name: [`${Name}`],\r\n product_category: [categoryName],\r\n product_brand: [productBrandName],\r\n product_variant: [variantsResp],\r\n product_price: [`${(await productPrice)?.CustomerContextualPrice}`],\r\n product_url: [getProductURLForUtag(product, this.props.context)],\r\n product_image_url: [`${product?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(product)]\r\n });\r\n }\r\n // VSI - Customization Start - 47480\r\n this.setState({ variantIdForTracking: variantsResp ? variantsResp : '' });\r\n // VSI - Customization End - 47480\r\n };\r\n\r\n private async setDefaultOOSVariant(\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[],\r\n updatedProductSpecificationData?: AttributeValue[] | undefined\r\n ) {\r\n if (variantAvailibilityList?.length > 0) {\r\n const {\r\n data: {\r\n product: { result: product },\r\n allProductVariants: { result: allProductVariants },\r\n productSpecificationData: { result: productSpecificationData },\r\n productDimensions: { result: productDimensions },\r\n dimensionPrices: { result: dimensionPrices }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n const prodSpecficationData = updatedProductSpecificationData ? updatedProductSpecificationData : productSpecificationData;\r\n\r\n // VSI - Customization Start 42852\r\n const prices: IBuyboxGetDimensionPricingActionData[] | undefined =\r\n dimensionPrices && (await _getActivePrices(dimensionPrices, actionContext));\r\n let extendedAllProductVariants: IExtendedSimpleProduct[] | undefined =\r\n prices && prices[0].discountAmount ? this.extendAllProductVariants(allProductVariants, prices) : allProductVariants;\r\n extendedAllProductVariants =\r\n extendedAllProductVariants &&\r\n extendedAllProductVariants.sort(\r\n (a, b) =>\r\n (a?.priceAfterDiscount ? a?.priceAfterDiscount : a?.Price) -\r\n (b?.priceAfterDiscount ? b?.priceAfterDiscount : b?.Price)\r\n );\r\n const updatedProduct = await this.getNextInventoryProduct(\r\n product,\r\n prodSpecficationData,\r\n extendedAllProductVariants,\r\n this.props.context,\r\n this.state.variantAvailibilityList ?? variantAvailibilityList\r\n );\r\n if (updatedProduct && updatedProduct.Dimensions && updatedProduct.Dimensions.length > 0) {\r\n const dimensions: ProductDimensionFull[] = [];\r\n for (const dimension of updatedProduct.Dimensions) {\r\n const dimensionValues = await getDimensionValuesAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n updatedProduct.MasterProductId ? updatedProduct.MasterProductId : updatedProduct.RecordId,\r\n channelId,\r\n dimension.DimensionTypeValue,\r\n [],\r\n null\r\n );\r\n const fullDimension = {\r\n ...dimension,\r\n DimensionValues: dimensionValues\r\n };\r\n dimensions.push(fullDimension);\r\n }\r\n this.setState({\r\n currentProduct: updatedProduct,\r\n currentProductDimensions: dimensions\r\n });\r\n // updated Product is a different product than product in props\r\n if (product?.RecordId !== updatedProduct?.RecordId) {\r\n await this._updateDimensions(updatedProduct, dimensions);\r\n await this._updateUtagData(updatedProduct);\r\n } else {\r\n this._updateURLWithoutReloading(updatedProduct);\r\n }\r\n } else {\r\n console.log('updated product doesnt have dimesions=>');\r\n this.setState({\r\n currentProduct: product,\r\n currentProductDimensions: productDimensions\r\n });\r\n this._updateURLWithoutReloading(product);\r\n await this._sendProductDataToTealium(this.props, product);\r\n }\r\n }\r\n }\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n // this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n if (isOrderQuantityLimitsFeatureEnabled && product) {\r\n this.setState({\r\n quantity: product.Behavior?.DefaultQuantity || 1,\r\n min: product.Behavior?.MinimumQuantity || 1,\r\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\r\n max:\r\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\r\n ? product.Behavior?.MaximumQuantity\r\n : this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n }\r\n }\r\n\r\n private async _updateVariantIDForTracking(): Promise {\r\n const variantId = await this.getVariantID();\r\n this.setState({ variantIdForTracking: variantId ? variantId : '' });\r\n }\r\n\r\n private _eyeBrowMessageAsyncFunc = async (isCached: boolean): Promise => {\r\n const {\r\n context,\r\n data: {\r\n product: { result }\r\n }\r\n } = this.props;\r\n const priceGroupForAPICall = context.app.config.priceGroup;\r\n if (priceGroupForAPICall) {\r\n const productIdsArray: IMFIItem[] | undefined = [];\r\n const eyebrowMessageObj: IMFIItem = {\r\n ItemId: result?.ItemId === undefined ? '' : result?.ItemId,\r\n DistinctProductVariant: result?.RecordId?.toString()\r\n };\r\n productIdsArray.push(eyebrowMessageObj);\r\n if (productIdsArray && productIdsArray.length > 0) {\r\n const eyebrowMessageResult = _getEyebrowMessage(productIdsArray, context, isCached, 'pdp');\r\n eyebrowMessageResult\r\n ?.then((data: IMFIPromotion[] | null) => {\r\n this.setState({ eyebrowMessageResultState: data, isEyeBrowLoading: false });\r\n })\r\n .catch(e => {\r\n this.setState({ isEyeBrowLoading: false });\r\n console.log('Error', e);\r\n });\r\n }\r\n } else {\r\n this.setState({ isEyeBrowLoading: false });\r\n }\r\n };\r\n\r\n private getDeliverySlotFromATP = async (isCached: boolean): Promise => {\r\n const itemLinesArray = [];\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n app: {\r\n config: { weeksPDPforATPCall }\r\n }\r\n }\r\n } = this.props;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n if (product) {\r\n const itemLines: IMFICartLine = {\r\n ItemId: product.ItemId,\r\n Quantity: 1,\r\n VariantRecordId: product.RecordId.toString()\r\n };\r\n itemLinesArray.push(itemLines);\r\n const currentDate = Date.now();\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: 'Delivery',\r\n Weeks: weeksPDPforATPCall,\r\n StoreId: '',\r\n Page: 'pdp',\r\n RequestedDate: dayjs(currentDate).format('MM/DD/YYYY'),\r\n ZipCode: zipcode,\r\n ItemLines: itemLinesArray\r\n };\r\n _getDeliveryByMessage(requestBody, this.props.context, isCached)\r\n .then(result => {\r\n if (result !== undefined && result?.ATPInventoryData) {\r\n // setCoreProductATPData(result?.ATPInventoryData);\r\n this.setState({\r\n deliveryMessageATPResultState: result?.ATPInventoryData\r\n });\r\n }\r\n })\r\n .catch(e => {\r\n console.log('Error', e);\r\n });\r\n }\r\n };\r\n\r\n private _tryInStoreAsyncCall = async () => {\r\n const {\r\n context: { actionContext, app },\r\n data: {\r\n product: { result: product }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const isSociEnabled = this.props.app.config.enableSociLocations || false;\r\n const preferredStore = this.state.preferredStore;\r\n\r\n // Todo: Zip code is being modified as we are not getting proper zip code.. It will be reverted back as it get modified/validate from backoffice\r\n const zipCodeModified = preferredStore && (!isSociEnabled ? preferredStore.Zip?.split('-')[0] : preferredStore?.Zip);\r\n const projectMetaSoci = isSociEnabled && preferredStore?.project_meta ? JSON.parse(preferredStore?.project_meta) : '';\r\n const sociStore = projectMetaSoci ? projectMetaSoci['Corporate ID'] : '';\r\n const sociStoreID = sociStore && (sociStore?.length > 6 ? sociStore : `000000${sociStore}`?.slice(-6));\r\n const StoreId = isSociEnabled ? sociStoreID : preferredStore?.OrgUnitNumber!;\r\n if (StoreId && zipCodeModified && product?.ItemId?.toString()) {\r\n const tryInStoreProductIDs: IMFITryInStore = {\r\n ZipCode: zipCodeModified,\r\n StoreId: isSociEnabled ? sociStoreID : preferredStore?.OrgUnitNumber!,\r\n Products: product?.ItemId?.toString(),\r\n Limit: app.config.tryInStoreLimit || 10,\r\n Radius: app.config.tryInStoreLookupRadius || 50\r\n };\r\n const getTryInStoreInfoInput = new GetTryInStoreInfoInput(tryInStoreProductIDs);\r\n try {\r\n const response = await getTryInStoreAction(getTryInStoreInfoInput, actionContext);\r\n this.setState({\r\n tryInStoresResults: response,\r\n OrgUnitNumber: isSociEnabled ? sociStoreID : preferredStore && preferredStore.OrgUnitNumber ? preferredStore.OrgUnitNumber : '0',\r\n isStoreLoading: false\r\n });\r\n } catch (error) {\r\n this.setState({ isStoreLoading: false });\r\n console.log(error);\r\n }\r\n }\r\n };\r\n // tslint:disable-next-line:max-func-body-length\r\n private _updateDimensions = async (updatedProduct?: SimpleProduct, dimensions?: ProductDimensionFull[] | undefined): Promise => {\r\n const {\r\n data: {\r\n product: { result: prevProduct },\r\n productDimensions: { result: dimensionsArr }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n const product = updatedProduct ? updatedProduct : prevProduct;\r\n const productDimensions = dimensions ? dimensions : dimensionsArr;\r\n if (!product || !productDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n // this._setSmallParcelATPCallMade(true);\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n const errorState = { ...this.state.errorState };\r\n errorState.configureErrors[key] = undefined;\r\n\r\n this.setState({ errorState: errorState });\r\n }\r\n }\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const nextProductDimensions: ProductDimensionFull[] = [];\r\n const mappedDimensions =\r\n productDimensions?.length > 0\r\n ? productDimensions\r\n ?.map(dimension => {\r\n const obj = dimension && {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) ??\r\n dimension.DimensionValue ?? product.Dimensions?.find(dim => dim.DimensionTypeValue === dimension.DimensionTypeValue)?.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties,\r\n DimensionValues: dimension.DimensionValues\r\n };\r\n nextProductDimensions.push(obj);\r\n return (\r\n dimension && {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) ??\r\n dimension.DimensionValue ?? product.Dimensions?.find(dim => dim.DimensionTypeValue === dimension.DimensionTypeValue)?.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n }\r\n );\r\n })\r\n .filter(dimension => {\r\n return dimension?.DimensionValue;\r\n })\r\n : [];\r\n const variants = getVariantsByDimensionValuesAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n product.MasterProductId ? product.MasterProductId : product.RecordId,\r\n channelId,\r\n mappedDimensions\r\n );\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProduct = await variants;\r\n this.props.context.app.config.queryBasedVariantSelection && this._updateQueryParamVariantId(selectedProduct[0]?.RecordId);\r\n\r\n this.setState({ selectedProduct: variants[0] });\r\n const variantProduct = selectedProduct[0];\r\n\r\n if (variantProduct) {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n const isCustompriceSelected =\r\n variantProduct &&\r\n variantProduct.Dimensions &&\r\n variantProduct.Dimensions.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value === 'Custom'\r\n );\r\n if (isCustompriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n // Remove custom amount error when unselect the custom amount\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isCustomPriceSelected: false, isPriceKeyedIn: false, errorState: errorState });\r\n }\r\n\r\n if (newAvailableQuantity?.length) {\r\n this.setState({ productAvailableQuantity: newAvailableQuantity[0] });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n\r\n // const RetailMulitplePickupMFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature');\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n variantProduct.RecordId,\r\n channelId,\r\n undefined,\r\n undefined\r\n // RetailMulitplePickupMFeatureState?.IsEnabled\r\n ),\r\n actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n this.setState({\r\n currentProduct: variantProduct,\r\n currentProductDimensions: nextProductDimensions\r\n });\r\n await this._updateQuantitiesInState(variantProduct);\r\n await this.makeCoreProductDeliveryMessage('ATP update dimnesions');\r\n // VSI - Customization Start - 47480\r\n await this._updateVariantIDForTracking();\r\n // VSI - Customization End - 47480\r\n // VSI - Customization Start - 27818\r\n // VSI - Customization End - 27818\r\n // VSI - Customization Start - 42674\r\n this._updateURLWithoutReloading(variantProduct);\r\n // VSI - Customization End - 42674\r\n }\r\n };\r\n // Render()\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery },\r\n data: {\r\n product: { result: product },\r\n productSpecificationData: { result: productSpecificationData },\r\n selectedFoundation: { result: adjustableItem },\r\n completeYourBedPillow: { result: pillow },\r\n completeYourBedProtector: { result: protector }\r\n },\r\n config: { className = '' },\r\n app: { config: { brandBackofficeAttributePdp } }\r\n } = this.props;\r\n const { max } = this.state;\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n const props = (this.props as unknown) as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n const brandName = parseBrandName(productSpecificationData, brandBackofficeAttributePdp) || '';\r\n const viewProps: IBuyboxViewProps & IMFRMNetworkCallsState & IMFRMProductMExtensionPropsInfo = {\r\n ...(this.props as IMfrmBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery?.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(props, undefined, brandName),\r\n description: getBuyboxProductDescription(props),\r\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(props, this.state),\r\n addToCart: getBuyboxAddToCart(props, this.state, this.buyboxCallbacks, defaultMinimumKeyInPrice, defaultMaximumKeyInPrice),\r\n viewCartLink: getUrlSync('cart', props.context.actionContext),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: undefined,\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max: max,\r\n smallParcelATCallMade: this.state.smallParcelATCallMade,\r\n setSmallParcelATPCallMade: this._setSmallParcelATPCallMade,\r\n StatusATPCall: this.state.StatusATPCall,\r\n setStatusATPCall: this._setStatusATPCall,\r\n setZipCode: this._setZipCode,\r\n ATPCall: this.state.ATPCall,\r\n setATPCall: this._setATPCall,\r\n extensionProps: this.state.extensionProps,\r\n productBadges:\r\n props.app.config.productBadgeAttribute &&\r\n this.props.data.productSpecificationData?.result?.length &&\r\n this._getProductBadges(),\r\n ratingComponent: !props.context.app.config?.hideRating && (this.props.config.showBVRatings ? : this._getBuyboxProductRating()),\r\n _renderTryInStoreRedesign: this._renderTryInStoreRedesign(),\r\n _renderTryInStore: this._renderTryInStore(),\r\n eyeBrowMessage: product && this._renderEyeBrowMessage(),\r\n promotionalMessage: this.state?.eyebrowMessageResultState?.[0]?.EyeBrows?.[0].Description?.split(\"|\")[1],\r\n deliveryMessage: this.state.deliveryMessage,\r\n ATPDataFromBusiness: this.state.deliveryMessageATPResultState,\r\n updateDimension: this.state.isUpdatingDimension,\r\n showViewCartLink: this.state.showViewCartLink,\r\n updateSuccessfulATC: this.updateSuccessfulATC,\r\n getProductType: this._getProductType,\r\n setAllProductVariantsResult: this._setAllProductVariantsResult,\r\n ecomAllVairantStockInfoConcatenated: this.state.ecomAllVairantStockInfoConcatenated,\r\n customerSatisfactionScore: this._renderCSATScore(),\r\n adjustableItem,\r\n pillow,\r\n protector\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n //other methods that return JSX.Element\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n private _getBuyboxProductRating = (): React.ReactElement | undefined => {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n productSpecificationData: { result: productSpecification }\r\n },\r\n resources\r\n } = this.props;\r\n const averageRating = getBVAttributeValues(productSpecification, 'BVAverageOverallRating');\r\n const reviewsCount = getBVAttributeValues(productSpecification, 'BVTotalReviewCount');\r\n const ratingComponent = (\r\n \r\n {productSpecification && (averageRating || reviewsCount) ? (\r\n \r\n ) : (\r\n <>\r\n \r\n Write the first review\r\n \r\n )}\r\n \r\n );\r\n return productSpecification && ratingComponent && ratingComponent;\r\n };\r\n\r\n private _renderTryInStore = (): JSX.Element | null => {\r\n const {\r\n resources: { availableInStoresText, notAvailableInStoresText, onlineOnlyProductsText },\r\n context: {\r\n app: { config }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const preferredStore = this._getPreferredStore();\r\n // VSI Customization - END\r\n const isOnlineOnly = this._getProductSpecificationAttributeByKeyName(config?.onlineOnlyBackOfficeAttribute);\r\n const storeName: string | undefined =\r\n (preferredStore && preferredStore.ExtensionProperties?.find(x => x.Key === 'Yext_Store_Name')?.Value?.StringValue) ||\r\n (preferredStore && preferredStore.OrgUnitName);\r\n const storeNameWithState = `${storeName}, ${preferredStore?.State}`;\r\n const availableStoreText = storeName && availableInStoresText.replace('{storeName}', `${storeNameWithState}`);\r\n const notAvailableStoreText = storeName && notAvailableInStoresText.replace('{storeName}', `${storeNameWithState}`);\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const onHandleFindPreferredStore = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n modules\r\n } = this.props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.mfrmStoreSelector && modules.mfrmStoreSelector.length > 0) {\r\n storeSelectorId = modules.mfrmStoreSelector[0].id;\r\n }\r\n MsDyn365.isBrowser && document.body.classList.add('modal-store-locator-toggle-pdp');\r\n storeSelectorStateManager\r\n ?.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: () => {\r\n return Promise.resolve();\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (this.props.telemetry) {\r\n this.props.telemetry.error(error.message);\r\n this.props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n };\r\n\r\n const { Inventory, Status } = { ...this.state.tryInStoresResults };\r\n if (Status === 'Success' && canTryInStores) {\r\n return (\r\n \r\n {Inventory?.length !== 0 && }\r\n {Inventory?.length === 0 && }\r\n \r\n );\r\n } else if (!canTryInStores && isOnlineOnly) {\r\n return (\r\n \r\n {}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _renderStoreHours = (location: OrgUnitLocation): JSX.Element | null => {\r\n const isClosedToday = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_IsClosed')?.Value?.BooleanValue;\r\n const isClosed = location.ExtensionProperties?.find(x => x.Key === 'Yext_Is_Store_Closed')?.Value?.BooleanValue;\r\n const startTime = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_OpenFrom')?.Value?.IntegerValue;\r\n const endTime = location.ExtensionProperties?.find(x => x.Key === 'Yext_Today_OpenTo')?.Value?.IntegerValue;\r\n const timeZone = location.ExtensionProperties?.find(x => x.Key === 'Channel_TimeZone_InfoId')?.Value?.StringValue;\r\n const timeZoneAbbr = getTimeZoneAbbr(timeZone);\r\n const { storeHoursClosedText, storeCloseAtHours, storeOpenAtHours } = this.props.resources;\r\n if (isClosedToday && isClosedToday !== null) {\r\n return (\r\n Today: {storeHoursClosedText}\r\n );\r\n } else if (startTime !== null || endTime !== null) {\r\n return (\r\n \r\n Today: {!isClosed\r\n ? `${storeCloseAtHours} ${secondsToTime(endTime)} ${timeZoneAbbr}`\r\n : `${storeOpenAtHours} ${secondsToTime(startTime)} ${timeZoneAbbr}`}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _renderTryInStoreRedesign = (): JSX.Element | null => {\r\n const {\r\n resources: { availableInStoresTextV2, notAvailableInStoresTextV2, viewStoreDetailsText, changeStoreText },\r\n context: {\r\n app: { config }\r\n }\r\n } = this.props;\r\n // VSI Customization - Start\r\n const isSociEnabled = this.props.app.config.enableSociLocations;\r\n const preferredStore = this._getPreferredStore();\r\n const sociPrefferedStore = this._getSociPreferredStore();\r\n\r\n // VSI Customization - END\r\n const isOnlineOnly = this._getProductSpecificationAttributeByKeyName(config?.onlineOnlyBackOfficeAttribute);\r\n // eslint-disable-next-line\r\n const sociStoreName = isSociEnabled && sociPrefferedStore?.name || '';\r\n const storeName: string | undefined = preferredStore && ((preferredStore.ExtensionProperties?.find(x => x.Key === 'Yext_Store_Name')?.Value?.StringValue) || preferredStore?.OrgUnitName);\r\n const storeNameWithState = isSociEnabled ? `${sociStoreName}, ${sociPrefferedStore?.state}` : `${storeName}, ${preferredStore?.State}`;\r\n const canTryInStores = this._getProductSpecificationAttributeByKeyName('try in store');\r\n const onHandleFindPreferredStore = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n modules\r\n } = this.props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.mfrmStoreSelector && modules.mfrmStoreSelector.length > 0) {\r\n storeSelectorId = modules.mfrmStoreSelector[0].id;\r\n }\r\n MsDyn365.isBrowser && document.body.classList.add('modal-store-locator-toggle-pdp');\r\n this.setState({ isStoreDetailsOpen: false });\r\n storeSelectorStateManager\r\n ?.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: () => {\r\n return Promise.resolve();\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (this.props.telemetry) {\r\n this.props.telemetry.error(error.message);\r\n this.props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n };\r\n\r\n const { Inventory, Status } = { ...this.state.tryInStoresResults };\r\n if (Status === 'Success' && canTryInStores && Inventory?.length !== 0) {\r\n const { isStoreDetailsOpen } = this.state;\r\n const storeLocatorContext = preferredStore && preferredStore.Contacts ? preferredStore.Contacts.find(url => url.ContactTypeValue === 3) : undefined;\r\n const extractPhoneNumber = (contacts: OrgUnitContact[] | undefined): string | undefined => {\r\n if (!contacts) {\r\n return undefined;\r\n }\r\n const allPhoneContacts = contacts.filter(contact => contact.ContactTypeValue === 1 && !contact.IsPrivate);\r\n if (allPhoneContacts && allPhoneContacts.length > 0) {\r\n const primaryPhoneContact = allPhoneContacts.find(contact => contact.IsPrimary);\r\n if (primaryPhoneContact) {\r\n return primaryPhoneContact.Locator;\r\n }\r\n return allPhoneContacts[0].Locator;\r\n }\r\n return undefined;\r\n };\r\n const storeLocatorUrl: string | undefined = storeLocatorContext\r\n ? storeLocatorContext.Locator\r\n : `https://bing.com/maps/default.aspx?where1=${preferredStore?.Address}`;\r\n const sociStoreLocatorUrl: string | undefined = sociPrefferedStore?.website_url || '';\r\n const storeAddressLine1: string | undefined = isSociEnabled && sociPrefferedStore ? sociPrefferedStore.address1 : preferredStore?.Street;\r\n const storeAddressLine2: string | undefined = isSociEnabled && sociPrefferedStore ? sociPrefferedStore.address2 : `${preferredStore?.City}, ${preferredStore?.State} ${preferredStore?.Zip}`;\r\n\r\n // VSI Customization - ends\r\n const phoneNumber: string | undefined = isSociEnabled ? sociPrefferedStore?.phone : extractPhoneNumber(preferredStore?.Contacts);\r\n if (!isStoreDetailsOpen) {\r\n return (\r\n \r\n \r\n \r\n {availableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n \r\n {availableInStoresTextV2}\r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n {isSociEnabled && sociPrefferedStore ? \r\n {storeAddressLine1}\r\n {storeAddressLine2}\r\n {sociPrefferedStore && {`${sociPrefferedStore.city}, ${sociPrefferedStore.state} ${sociPrefferedStore.postalcode}`}}\r\n :\r\n \r\n {storeAddressLine1}\r\n {storeAddressLine2}\r\n \r\n }\r\n {phoneNumber && {phoneNumber}}\r\n {!isSociEnabled && this._renderStoreHours(preferredStore!)}\r\n \r\n {viewStoreDetailsText}\r\n {changeStoreText}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n } else if (Status === 'Success' && canTryInStores && Inventory?.length === 0) {\r\n return (\r\n \r\n \r\n \r\n {notAvailableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n );\r\n } else if (storeName && !canTryInStores && isOnlineOnly) {\r\n // displaying not available to Try-In store as per ADO #64278\r\n return (\r\n \r\n \r\n \r\n {notAvailableInStoresTextV2}\r\n \r\n {storeNameWithState}\r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n private _getProductBadges = (): JSX.Element | undefined => {\r\n // find the configured backend attribute\r\n const {\r\n context: { request },\r\n data: { productSpecificationData },\r\n app: {\r\n config: { productBadgeAttribute: attribute }\r\n }\r\n } = this.props;\r\n const badgeData =\r\n attribute &&\r\n productSpecificationData.result?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!badgeData) {\r\n return;\r\n }\r\n\r\n // split badge data into its separate badges\r\n const badges = badgeData?.split(',');\r\n\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges?.map((badge: string) => parseBadgeData(badge, request));\r\n\r\n // build product badge image components\r\n // tslint:disable-next-line: no-any\r\n const finalizedBadges =\r\n parsedBadges && parsedBadges.map((parsedBadge: any) => parsedBadge && buildProductBadge(parsedBadge, request));\r\n return finalizedBadges && <>{finalizedBadges};\r\n };\r\n\r\n // tslint:disable-next-line: cyclomatic-complexity\r\n private _renderEyeBrowMessage = (): JSX.Element | undefined => {\r\n const {\r\n config: { targetAudienceGroup }\r\n } = this.props;\r\n // VSI Customization - START - 24659\r\n const trackingEyebrow = (message: string): void => {\r\n // @ts-ignore\r\n if (utag) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({ 'event': 'pdp-eyebrow-messages', 'event_category': 'pdp eyebrow message', 'event_action': 'eyebrow message click', 'event_label': `${message}`, 'event_noninteraction': 'false' });\r\n }\r\n };\r\n // VSI Customization - END - 24659\r\n /* VSI-Customization -- START Eyebrow message will render based on targetAudienceGroup config */\r\n const { eyebrowMessageResultState } = { ...this.state };\r\n let eyebrowMessage: string = '';\r\n if (eyebrowMessageResultState && eyebrowMessageResultState.length > 0) {\r\n if (\r\n eyebrowMessageResultState[0].EyeBrows &&\r\n eyebrowMessageResultState[0].EyeBrows.length &&\r\n eyebrowMessageResultState[0].EyeBrows.length > 0\r\n ) {\r\n // if value configured then match the audeinece group and return that message\r\n // if targetAudienceGroup not found return empty string (default 902 line #)\r\n if (targetAudienceGroup) {\r\n for (const eyebrow of eyebrowMessageResultState[0].EyeBrows) {\r\n const description = eyebrow.Description?.split('|')[2]?.toLowerCase();\r\n if (description === targetAudienceGroup.toLowerCase()) {\r\n eyebrowMessage = eyebrow?.Description!;\r\n break;\r\n }\r\n }\r\n // If no value configured then show the first EyebrowMessage without audienceGroup\r\n } else {\r\n for (const eyebrow of eyebrowMessageResultState[0].EyeBrows) {\r\n if (eyebrow.Description?.split('|').length === 2) {\r\n eyebrowMessage = eyebrow?.Description;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /* VSI-Customization -- END */\r\n let splitMessage: string[] = [];\r\n let emptyClassName;\r\n let emptyClassNameButton;\r\n if (eyebrowMessage !== '') {\r\n splitMessage = eyebrowMessage?.split('|');\r\n if (splitMessage[1] === '' || splitMessage[1] === undefined) {\r\n emptyClassName = 'mfrm-eyebrow--empty';\r\n emptyClassNameButton = 'no-click';\r\n }\r\n }\r\n if (!eyebrowMessage) {\r\n return;\r\n }\r\n return (\r\n <>\r\n {/* // VSI Customization - START - 24659 */}\r\n {splitMessage && splitMessage?.length > 0 && (\r\n trackingEyebrow(splitMessage[1] ? splitMessage[1] : '')}\r\n role='button'\r\n >\r\n {/* // VSI Customization - END - 24659 */}\r\n }\r\n triggerClass={`mfrm-eyebrow__button ${emptyClassNameButton}`}\r\n contentClass={`mfrm-eyebrow__content ${emptyClassName}`}\r\n position={'bottom-end'}\r\n offsetY={10}\r\n outline='shadow'\r\n // @ts-ignore\r\n tooltipContent={splitMessage[1] && splitMessage[1] !== '' && }\r\n />\r\n \r\n )}\r\n \r\n );\r\n };\r\n\r\n private _renderCSATScore = (): JSX.Element => {\r\n const {\r\n data: { productSpecificationData },\r\n config\r\n } = this.props;\r\n const isDesktop = this.state.isDesktop;\r\n let unitsReturned: string | number | undefined = productSpecificationData?.result?.find(attr => attr.Name?.toLowerCase() === 'units_returned')?.TextValue;\r\n let unitsSold: string | number | undefined = productSpecificationData?.result?.find(attr => attr.Name?.toLowerCase() === 'units_sold')?.TextValue;\r\n if (!unitsSold || unitsSold === \"0\" || Number.isNaN(unitsSold)) { return <>; }\r\n unitsReturned = Number(unitsReturned);\r\n unitsReturned = Number.isNaN(unitsReturned) ? 0 : unitsReturned;\r\n unitsSold = Number(unitsSold);\r\n const unitsNotReturend = unitsSold - unitsReturned;\r\n const avgRating = (unitsNotReturend * 5) / unitsSold;\r\n const perNotReturned: number = Math.round(100 - (Number(unitsReturned) / Number(unitsSold)) * 100);\r\n return (\r\n \r\n {config.cSatRatingHeadingText && config.cSatRatingHeadingText.replace('{perNotReturned}', `${perNotReturned}%`)}\r\n }\r\n position=\"bottom-left\"\r\n hover={isDesktop}\r\n >\r\n
\r\n \r\n {config.cSatRatingPopoverText && config.cSatRatingPopoverText.replace('{unitsNotReturend}', unitsNotReturend.toLocaleString()).replace('{unitsSold}', unitsSold.toLocaleString())}\r\n \r\n \r\n \r\n
\r\n {`${perNotReturned}%`}\r\n {`(${(unitsNotReturend).toLocaleString()})`}\r\n
\r\n
\r\n
\r\n \r\n
\r\n );\r\n };\r\n\r\n}\r\n\r\nexport default Buybox;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { RegularStoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport get from 'lodash/get';\r\nimport { IStoreSelectorLocationLineItemResources } from '.';\r\n\r\nexport interface IHoursDisplayInfo {\r\n startDayShort: string;\r\n startDayFull: string;\r\n endDayShort?: string;\r\n endDayFull?: string;\r\n timeRange: string;\r\n}\r\n\r\nexport interface IHoursInfo {\r\n isClosed: boolean;\r\n openTime?: number;\r\n closeTime?: number;\r\n}\r\n\r\ntype DayType = 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN';\r\n\r\nexport const secondsToTime = (seconds: number | undefined): string | undefined => {\r\n if (seconds === undefined) {\r\n return undefined;\r\n } else {\r\n let hours = Math.floor(seconds / (60 * 60));\r\n const ampm = hours >= 12 ? 'pm' : 'am';\r\n hours = hours % 12;\r\n hours = hours ? hours : 12;\r\n const divisorForMinutes = seconds % (60 * 60);\r\n const minutes =\r\n Math.floor(divisorForMinutes / 60) < 10 ? `0${Math.floor(divisorForMinutes / 60)}` : Math.floor(divisorForMinutes / 60);\r\n return `${hours}:${minutes} ${ampm}`;\r\n }\r\n};\r\n\r\nexport const getTimeZoneAbbr = (timeZone: string | undefined): string | undefined => {\r\n switch (timeZone) {\r\n case 'EASTERN STANDARD TIME':\r\n return 'EST';\r\n case 'EASTERN DAYLIGHT TIME':\r\n return 'EDT';\r\n case 'CENTRAL STANDARD TIME':\r\n return 'CST';\r\n case 'CENTRAL DAYLIGHT TIME':\r\n return 'CDT';\r\n case 'MOUNTAIN STANDARD TIME':\r\n return 'MST';\r\n case 'MOUNTAIN DAYLIGHT TIME':\r\n return 'MDT';\r\n case 'PACIFIC STANDARD TIME':\r\n return 'PST';\r\n case 'PACIFIC DAYLIGHT TIME':\r\n return 'PDT';\r\n default: // any other than USA TimeZone:\r\n return timeZone;\r\n }\r\n};\r\nconst getShortTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\r\n switch (day) {\r\n case 'MON':\r\n return resources.days.monday;\r\n case 'TUE':\r\n return resources.days.tuesday;\r\n case 'WED':\r\n return resources.days.wednesday;\r\n case 'THU':\r\n return resources.days.thursday;\r\n case 'FRI':\r\n return resources.days.friday;\r\n case 'SAT':\r\n return resources.days.saturday;\r\n default: // case 'SUN':\r\n return resources.days.sunday;\r\n }\r\n};\r\n\r\nconst getFullTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\r\n switch (day) {\r\n case 'MON':\r\n return resources.days.mondayFull;\r\n case 'TUE':\r\n return resources.days.tuesdayFull;\r\n case 'WED':\r\n return resources.days.wednesdayFull;\r\n case 'THU':\r\n return resources.days.thursdayFull;\r\n case 'FRI':\r\n return resources.days.fridayFull;\r\n case 'SAT':\r\n return resources.days.saturdayFull;\r\n default: // case 'SUN':\r\n return resources.days.sundayFull;\r\n }\r\n};\r\n\r\nconst buildHoursDisplayInfo = (startDay: DayType, endDay: DayType, hoursInfo: string, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo => {\r\n return {\r\n startDayShort: getShortTimeString(startDay, resources),\r\n startDayFull: getFullTimeString(startDay, resources),\r\n endDayShort: startDay !== endDay ? getShortTimeString(endDay, resources) : undefined,\r\n endDayFull: startDay !== endDay ? getFullTimeString(endDay, resources) : undefined,\r\n timeRange: hoursInfo\r\n };\r\n};\r\n\r\nconst shouldMergeLines = (firstLine: IHoursInfo, secondLine: IHoursInfo): boolean => {\r\n if (firstLine.isClosed && secondLine.isClosed) {\r\n return true;\r\n }\r\n\r\n if (!firstLine.isClosed && !secondLine.isClosed) {\r\n return firstLine.openTime === secondLine.openTime && firstLine.closeTime === secondLine.closeTime;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const getStoreHoursData = (storeHours: RegularStoreHours, dateForLookup: string): IHoursInfo => {\r\n return {\r\n isClosed: get(storeHours, `IsClosedOn${dateForLookup}`, false),\r\n openTime: get(storeHours, `${dateForLookup}OpenTime`, undefined),\r\n closeTime: get(storeHours, `${dateForLookup}CloseTime`, undefined)\r\n };\r\n};\r\n\r\nconst buildStoreHoursString = (hoursInfo: IHoursInfo, resources: IStoreSelectorLocationLineItemResources): string => {\r\n if (hoursInfo.isClosed) {\r\n return resources.closedText;\r\n } else {\r\n const openFrom: string | undefined = secondsToTime(hoursInfo.openTime);\r\n const openTo: string | undefined = secondsToTime(hoursInfo.closeTime);\r\n\r\n return `${openFrom}–${openTo}`;\r\n }\r\n};\r\n\r\nexport const buildStoreHours = (storeHours: RegularStoreHours, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo[] => {\r\n const storeHoursList: IHoursDisplayInfo[] = [];\r\n\r\n const mondayHours = getStoreHoursData(storeHours, 'Monday');\r\n const tuesdayHours = getStoreHoursData(storeHours, 'Tuesday');\r\n const wednesdayHours = getStoreHoursData(storeHours, 'Wednesday');\r\n const thursdayHours = getStoreHoursData(storeHours, 'Thursday');\r\n const fridayHours = getStoreHoursData(storeHours, 'Friday');\r\n const saturdayHours = getStoreHoursData(storeHours, 'Saturday');\r\n const sundayHours = getStoreHoursData(storeHours, 'Sunday');\r\n\r\n let periodStart: DayType = 'MON';\r\n let periodEnd: DayType = 'MON';\r\n\r\n if (!shouldMergeLines(mondayHours, tuesdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(mondayHours, resources), resources));\r\n\r\n periodStart = 'TUE';\r\n }\r\n periodEnd = 'TUE';\r\n\r\n if (!shouldMergeLines(tuesdayHours, wednesdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(tuesdayHours, resources), resources));\r\n\r\n periodStart = 'WED';\r\n }\r\n periodEnd = 'WED';\r\n\r\n if (!shouldMergeLines(wednesdayHours, thursdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(wednesdayHours, resources), resources));\r\n\r\n periodStart = 'THU';\r\n }\r\n periodEnd = 'THU';\r\n\r\n if (!shouldMergeLines(thursdayHours, fridayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(thursdayHours, resources), resources));\r\n\r\n periodStart = 'FRI';\r\n }\r\n periodEnd = 'FRI';\r\n\r\n if (!shouldMergeLines(fridayHours, saturdayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(fridayHours, resources), resources));\r\n\r\n periodStart = 'SAT';\r\n }\r\n periodEnd = 'SAT';\r\n\r\n if (!shouldMergeLines(saturdayHours, sundayHours)) {\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(saturdayHours, resources), resources));\r\n\r\n periodStart = 'SUN';\r\n }\r\n periodEnd = 'SUN';\r\n\r\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(sundayHours, resources), resources));\r\n\r\n return storeHoursList;\r\n};\r\n","import classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n IPopupProps,\r\n ITelemetryContent,\r\n Popup,\r\n onTelemetryClick,\r\n getTelemetryObject\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, {\r\n IComponent,\r\n IComponentProps,\r\n IGridSettings,\r\n IImageSettings,\r\n msdyn365Commerce,\r\n TelemetryEvent\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState, ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { CommerceProperty, ProductAvailableQuantity, ProductDimension, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { navLinkKeywordRemoval } from '../../../../../Utilities/plp-url-utils';\r\nimport { getProductURLForUtag, getProductSizeForUTag } from '../../../../../modules/mfrm-buybox/mfrm-buybox';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getUtagProductCategory } from '../../../../../Utilities/get-utag-product-category';\r\nimport { getUtagVariantId } from '../../../../../Utilities/get-utag-variant-id';\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice }> {\r\n className?: string;\r\n addToCartText: string;\r\n addToCartProductsText: string;\r\n outOfStockText: string;\r\n disabled?: boolean;\r\n quantity?: number;\r\n navigationUrl?: string;\r\n productAvailability?: ProductAvailableQuantity;\r\n getSelectedProduct?: Promise;\r\n imageSettings?: IImageSettings;\r\n gridSettings?: IGridSettings;\r\n isLoading?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isLoadingDeliveryOptions?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPriceAmount?: number;\r\n isOrderQuantityLimitsFeatureEnabled?: boolean;\r\n productIdPrefix?: string;\r\n dialogStrings?: {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n };\r\n telemetryContent?: ITelemetryContent;\r\n\r\n isCustomPriceSelected?: boolean;\r\n maximumKeyInPrice?: number;\r\n minimumKeyInPrice?: number;\r\n defaultMaximumKeyInPrice?: number;\r\n defaultMinimumKeyInPrice?: number;\r\n /** VSI Customization - Start */\r\n outOfStockBooleanValue?: boolean;\r\n outOfStockSmallParcel?: boolean;\r\n mfrmOutOfStockCustomText?: string;\r\n mfrmContinueShoppingText?: string;\r\n mfrmOutOfStockSmallParcell?: boolean;\r\n mfrmAddToCartDisableByState?: boolean;\r\n mfrmContinueShoppingLink?: IMfrmCategoryPath;\r\n itemOutOfMarket?: boolean;\r\n variantOutOfStock?: boolean;\r\n extensionProps?: CommerceProperty[];\r\n allProductVariants?: SimpleProduct[];\r\n productCategoryName?: string | undefined;\r\n productBrand?: string | undefined;\r\n successfulATC?: boolean;\r\n variantIdForTracking?: string;\r\n adjustableItem?: any;\r\n pillow?: any;\r\n protector?: any;\r\n updateSuccessfulATC?(): void;\r\n /** VSI Customization - End */\r\n onAdd?(result: ICartActionResult): void;\r\n onError?(result: IAddToCartFailureResult): void;\r\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n allVariantOOS: boolean;\r\n}\r\n\r\n/** VSI Customization - Start */\r\nexport interface IMfrmCategoryPath {\r\n Name?: string;\r\n Url?: string;\r\n}\r\n\r\nexport interface IMfrmAtpObject {\r\n itemId: string;\r\n recordId: string;\r\n date: string;\r\n zipCode: string;\r\n weeks: number;\r\n}\r\n/** VSI Customization - End */\r\n\r\nexport declare type ICartActionFailureReason =\r\n | 'EMPTYINPUT'\r\n | 'MISSINGDIMENSION'\r\n | 'OUTOFSTOCK'\r\n | 'CARTACTIONFAILED'\r\n | 'INVALIDCUSTOMAMOUNT';\r\nexport interface IAddToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n\r\n stockLeft?: number;\r\n cartActionResult?: ICartActionResult;\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\nexport interface IAddtoCartComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\r\n}\r\n\r\nexport interface UTAGAdjBaseAddToCart {\r\n event: string;\r\n enhanced_action: string;\r\n event_category: string;\r\n event_action: string;\r\n event_label: string;\r\n event_noninteraction: string;\r\n product_id: string[];\r\n product_name: string[];\r\n product_price: string[]\r\n product_quantity: string[];\r\n product_url: string[];\r\n product_image_url: string[];\r\n product_size: (string | undefined)[];\r\n product_list_name: string[];\r\n product_list_position: string[];\r\n product_brand?: string[];\r\n product_category?: string[];\r\n product_variant?: (string | undefined)[];\r\n}\r\nexport interface UTAGCompleteYourBedPillowAddToCart {\r\n event: string;\r\n enhanced_action: string;\r\n event_category: string;\r\n event_action: string;\r\n event_label: string;\r\n event_noninteraction: string;\r\n product_id: string[];\r\n product_name: string[];\r\n product_price: string[]\r\n product_quantity: string[];\r\n product_url: string[];\r\n product_image_url: string[];\r\n product_size: (string | undefined)[];\r\n product_brand?: string[];\r\n product_category?: string[];\r\n product_variant?: (string | undefined)[];\r\n}\r\n// tslint:disable: no-any\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void,\r\n setSuccess: () => void\r\n): Promise => {\r\n const telemetryContent = getTelemetryObject('Product Details Page', props.telemetryContent?.moduleName!, props.telemetryContent?.telemetry!);\r\n const payLoad = getPayloadObject('click', telemetryContent, 'Add to Cart', '');\r\n onTelemetryClick(telemetryContent, payLoad, 'Add to Cart')();\r\n const cartError = addToCartError(props);\r\n let productToAdd = props.data.product;\r\n const productBrand = `${props.productBrand}`;\r\n const productPrice = props.data.price;\r\n const productCategory = `${props.productCategoryName}`;\r\n // @ts-ignore\r\n if (utag) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${productToAdd?.ItemId}: ${productToAdd?.Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${productToAdd?.ItemId}`],\r\n product_name: [`${productToAdd?.Name}`],\r\n product_category: [productCategory],\r\n product_brand: [productBrand],\r\n product_variant: [`${props?.variantIdForTracking}`],\r\n product_price: [`${productPrice?.CustomerContextualPrice}`],\r\n product_quantity: [`${props.quantity}`],\r\n product_url: [`${getProductURLForUtag(productToAdd, props.context)}`],\r\n product_image_url: [`${productToAdd?.PrimaryImageUrl}`],\r\n product_size: [getProductSizeForUTag(productToAdd)]\r\n });\r\n if (props?.adjustableItem?.foundation) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.adjustableItem.foundation;\r\n const listPosition = props.adjustableItem.listPosition;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n\r\n\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n\r\n const utag_obj: UTAGAdjBaseAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.adjustableItem.foundation, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_list_name: ['PDP Add Base/Foundation'],\r\n product_list_position: [`${listPosition}`],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n\r\n\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n if (props?.pillow?.pillow) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.pillow.pillow;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n const utag_obj: UTAGCompleteYourBedPillowAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.pillow.pillow, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n if (props?.protector?.protector) {\r\n const { ItemId, Name, CustomerContextualPrice, PrimaryImageUrl, Dimensions, RecordId, MasterProductId } = props.protector.protector;\r\n const productSpecificationData = await getAttributeValuesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n RecordId,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId || 0\r\n );\r\n const dimension = Dimensions?.find((Dimension: { DimensionTypeValue: number }) => Dimension.DimensionTypeValue === 3);\r\n const product_size = dimension?.DimensionValue?.Value;\r\n const utag_obj: UTAGCompleteYourBedPillowAddToCart = {\r\n event: 'add-to-cart',\r\n enhanced_action: 'add',\r\n event_category: 'ecommerce',\r\n event_action: 'add to cart',\r\n event_label: `${ItemId}: ${Name}`,\r\n event_noninteraction: 'false',\r\n product_id: [`${ItemId}`],\r\n product_category: await getUtagProductCategory(\r\n props.context.actionContext,\r\n props.context.request.apiSettings.channelId,\r\n props.context.request.apiSettings.catalogId,\r\n RecordId\r\n ),\r\n product_name: [`${Name}`],\r\n product_price: [`${CustomerContextualPrice}`],\r\n product_quantity: ['1'],\r\n product_url: [getProductURLForUtag(props.protector.protector, props.context)],\r\n product_image_url: [`${PrimaryImageUrl}`],\r\n product_size: [\r\n product_size\r\n ],\r\n product_variant: (MasterProductId && ItemId) ? await getUtagVariantId(MasterProductId, props.context.request.apiSettings.channelId, props.context.actionContext, RecordId, ItemId) : undefined\r\n };\r\n const brand = productSpecificationData.find(e => e.Name === 'Brand')?.TextValue;\r\n if (brand) {\r\n utag_obj.product_brand = [brand];\r\n }\r\n // @ts-ignore\r\n utag.link(utag_obj);\r\n }\r\n\r\n }\r\n if (cartError) {\r\n propagateError(props, cartError);\r\n return;\r\n }\r\n if (!(props.getSelectedProduct === undefined)) {\r\n productToAdd = (await props.getSelectedProduct) || props.data.product;\r\n // if props.getSelectedProduct has master product, than take it from data.product\r\n if (!productToAdd?.MasterProductId) {\r\n productToAdd = props.data.product;\r\n }\r\n }\r\n\r\n const productsToAdd: any = [\r\n {\r\n product: productToAdd,\r\n count: props.quantity,\r\n availableQuantity: props.productAvailability?.AvailableQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n isPriceKeyedIn: props.isPriceKeyedIn,\r\n customPrice: props.customPriceAmount,\r\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart\r\n }, ...(props.adjustableItem?.foundation ? [{\r\n product: props.adjustableItem?.foundation,\r\n count: props.quantity\r\n }] : []), ...(props.pillow?.pillow ? [{\r\n product: props.pillow?.pillow,\r\n count: props.quantity\r\n }] : []), ...(props.protector?.protector ? [{\r\n product: props.protector?.protector,\r\n count: props.quantity\r\n }] : [])\r\n ];\r\n const cartState = await getCartState(props.context.actionContext);\r\n // VSI CUSTOMIZATION - starts\r\n // Add product separately clear and the delivery information on retail server, so GetDeliveryOptions charge calculation works correctly\r\n const cart = cartState.cart;\r\n await cartState.clearCartLinesDeliveryInformation({ cart });\r\n // VSI CUSTOMIZATION - ends\r\n await cartState\r\n .addProductsToCart(productsToAdd)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n if (props.dialogStrings && props.context.app.config.addToCartBehavior === 'showModal') {\r\n setDisabled(false);\r\n openModal(true);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n (props.context.app.config.addToCartBehavior === undefined || props.context.app.config.addToCartBehavior === 'goToCart')\r\n ) {\r\n // MsDyn365.isBrowser && window.location.assign(props.navigationUrl);\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = props.navigationUrl;\r\n }\r\n // VSI CUSTOMIZATION - starts\r\n setDisabled(true);\r\n // VSI CUSTOMIZATION - ends\r\n }\r\n propagateResult(props, result);\r\n setSuccess();\r\n } else {\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: result });\r\n setDisabled(false);\r\n }\r\n })\r\n .catch(error => console.log('error[addProductToCart]', error));\r\n};\r\n\r\nconst AddToCartComponentActions = {\r\n onClick: onClick\r\n};\r\n\r\n// tslint:disable: cyclomatic-complexity\r\n// tslint:disable: max-func-body-length\r\n// tslint:disable: react-no-dangerous-html\r\nconst AddToCart: React.FC = (props: IAddToCartComponentProps) => {\r\n const [disabled, setDisabled] = useState(false);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n const setSuccess = props.updateSuccessfulATC ? props.updateSuccessfulATC : () => null;\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setSuccess);\r\n };\r\n\r\n const priceComponent = props.data.price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'msc-add-to-cart',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product, price: props.data.price },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request?.gridSettings,\r\n productQuantity: props.quantity !== undefined ? props.quantity : 1,\r\n priceComponent: priceComponent,\r\n navigationUrl: props.navigationUrl,\r\n modalOpen: modalOpen,\r\n setModalOpen: setModalOpen,\r\n telemetryContent: props.telemetryContent\r\n };\r\n\r\n const renderModalPopup = ;\r\n const label = getLinkText(props);\r\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n\r\n // Todo: bug#22002 - Will be resolved later on - temp fix\r\n // const classToApply = props.mfrmOutOfStockSmallParcell ? 'out-of-stock msc-add-to-cart' : 'msc-add-to-cart';\r\n const classToApply = 'msc-add-to-cart';\r\n const OOMClass = props.itemOutOfMarket || props.variantOutOfStock || props.mfrmOutOfStockSmallParcell || props.allVariantOOS ? 'out-of-market disabled' : '';\r\n let disabledSmallParcel = false;\r\n // tslint:disable-next-line: max-line-length\r\n\r\n if (\r\n (props.disabled !== undefined ? props.disabled : false) ||\r\n disabled ||\r\n isIntermediateState(props) ||\r\n shouldShowOutOfStock(props, false) ||\r\n (props.mfrmAddToCartDisableByState !== undefined ? props.mfrmAddToCartDisableByState : false) ||\r\n props.itemOutOfMarket ||\r\n props.variantOutOfStock\r\n ) {\r\n disabledSmallParcel = true;\r\n }\r\n\r\n return (\r\n
\r\n {renderModalPopup}\r\n \r\n {props.mfrmOutOfStockSmallParcell || props.allVariantOOS ? props.mfrmOutOfStockCustomText : label}\r\n \r\n {props.mfrmOutOfStockSmallParcell && (\r\n \r\n {props.mfrmContinueShoppingText}\r\n \r\n )}\r\n {/** VSI Customization - End */}\r\n
\r\n );\r\n};\r\n\r\n// Set default props\r\nAddToCart.defaultProps = {\r\n quantity: 1\r\n};\r\n\r\nexport const getLinkText = (props: IAddToCartComponentProps): string => {\r\n if (props.itemOutOfMarket || props.variantOutOfStock) {\r\n return 'Item not available';\r\n }\r\n let productToAdd = props.data.product;\r\n if (!(props.getSelectedProduct === undefined)) {\r\n props.getSelectedProduct.\r\n then((product) => {\r\n productToAdd = product || props.data.product;\r\n }).\r\n catch((err) => console.log(err));\r\n // if props.getSelectedProduct has master product, than take it from data.product\r\n if (!productToAdd?.MasterProductId) {\r\n productToAdd = props.data.product;\r\n }\r\n }\r\n const getCount = [productToAdd, ...(props.adjustableItem.foundation ? [props.adjustableItem.foundation] : []), ...(props.pillow?.pillow ? [props.pillow.pillow] : []), ...(props.protector?.protector ? [props.protector.protector] : [])].length;\r\n return shouldShowOutOfStock(props, false) ? props.outOfStockText : (getCount > 1 ? props.addToCartProductsText?.replace('{itemcount}', getCount.toString()) : props.addToCartText);\r\n};\r\n\r\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\r\n const {\r\n data,\r\n productAvailability,\r\n isCustomPriceSelected,\r\n customPriceAmount,\r\n maximumKeyInPrice,\r\n minimumKeyInPrice,\r\n defaultMaximumKeyInPrice = 100,\r\n defaultMinimumKeyInPrice = 10\r\n } = props;\r\n\r\n if (!data || !data.product.RecordId) {\r\n // No product exists, won't be able to add to cart\r\n return { failureReason: 'EMPTYINPUT' };\r\n }\r\n\r\n if (data.product?.Dimensions) {\r\n const missingDimensions = data.product.Dimensions.filter(\r\n dimension => !(dimension.DimensionValue && dimension.DimensionValue?.Value)\r\n );\r\n\r\n if (missingDimensions?.length > 0) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n return { failureReason: 'MISSINGDIMENSION', missingDimensions: missingDimensions };\r\n }\r\n }\r\n\r\n if (shouldShowOutOfStock(props, true)) {\r\n const availableQuantity = (productAvailability && productAvailability.AvailableQuantity) || 0;\r\n const stockLeft = Math.max(availableQuantity, 0);\r\n\r\n return { failureReason: 'OUTOFSTOCK', stockLeft: stockLeft };\r\n }\r\n\r\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\r\n if (\r\n isCustomPriceSelected &&\r\n (!customPriceAmount ||\r\n customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\r\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))\r\n ) {\r\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\r\n }\r\n\r\n // Only allow adding to cart if not showing out of stock\r\n return undefined;\r\n};\r\n\r\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\r\n if (\r\n props.context.app.config.enableStockCheck === undefined ||\r\n props.context.app.config.enableStockCheck === false ||\r\n props.isLoading ||\r\n props.isUpdatingDimension ||\r\n props.isAddServiceItemToCart\r\n ) {\r\n // Out of stock turn off, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (!props.data || !props.data.product.RecordId) {\r\n // No product exists, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (props.data.product?.Dimensions) {\r\n if (props.data.product.Dimensions?.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also don't show out of stock\r\n return false;\r\n }\r\n }\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : 1;\r\n\r\n return props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\r\n ? false\r\n : true;\r\n};\r\n\r\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\r\n if (props.data.product?.Dimensions) {\r\n if (props.data.product.Dimensions?.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also not in intermediate state\r\n /** VSI Customization - Start */\r\n return true;\r\n /** VSI Customization - End */\r\n }\r\n }\r\n\r\n if (!props.isLoading && !props.isUpdatingDimension) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\r\n if (props.onAdd) {\r\n props.onAdd(result);\r\n }\r\n};\r\n\r\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\r\n if (props.onError) {\r\n props.onError(result);\r\n }\r\n};\r\n\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n // @ts-ignore\r\n IAddtoCartComponent\r\n>('AddToCart', { component: AddToCart, ...AddToCartComponentActions });\r\n\r\nexport default AddToCartComponent;\r\n"],"names":["getUtagProductCategory","async","actionContext","channelId","catalogId","RecordId","categoryPathResults","getCategoryPathsAsync","callerContext","queryResultSettings","ProductId","categoryPath","CategoryPath","Segments","length","CategoryName","getUtagVariantId","MasterProductId","ItemId","input","BuyboxGetDimensionVariantAvailabilityInput","variantsResp","getAllProductVariants","variantIter","ePropsVariant","ExtensionProperties","eIter","Key","Value","StringValue","variantofId","slice","context","MsDyn365","window","innerWidth","gridSettings","request","xs","w","sm","md","lg","getZipCode","ctx","geolocationZipCode","requestContext","geoLocation","zipCode","res","cookie","Cookies","zipcode","get","undefined","getGeoLocationZipCode","canonicalURL","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","MFITryInStoreExtensionClass","constructor","odataObject","this","ZipCode","StoreId","Products","Limit","Radius","i","className","substr","lastIndexOf","concat","EntityClasses","MFITryInStoreInfoResponseExtensionClass","Status","Message","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","key","DataServiceQuery","DataServiceEntities","tryInStoresQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","GetTryInStoreInfoInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","result","callActionOrExecute","mFIGetTryInStoreInfoAsync","error","console","log","id","productId","getAllVariantsForProduct","productResponse","getByIdAsync","Paging","Top","baseProduct","Array","isArray","getVariantsByDimensionValuesAsync","telemetry","exception","Error","createObservableDataAction","inputData","query","apiSettings","itemId","products","isCached","pageType","priceGroupForAPICall","priceGroup","items","item","singleItem","DistinctProductVariant","requestBody","PriceGroup","Items","getEyebrowMessageInput","GetEyebrowMessageInput","getEyebrowAction","getGenericError","cart","resources","product","productAvailability","location","failureReason","addedToCartFailureMessage","cartActionResult","substatus","elementFoundAt","productIdToFind","CartLines","DeliveryMode","channel","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","curQuantity","Quantity","maxQuantityForCartLineItem","availableQty","AvailableQuantity","quantityLimit","Math","min","maxQuantityLimitText","toString","errorDetails","LocalizedMessage","getConfigureErrors","isGiftCard","dimensions","dimension","DimensionTypeValue","dimensionTypeValue","productDimensionTypeColorErrorMessage","productDimensionTypeConfigurationErrorMessage","productDimensionTypeSizeErrorMessage","productDimensionTypeAmountErrorMessage","productDimensionTypeStyleErrorMessage","getDimensionErrorString","getBuyBoxInventoryLabel","props","productDetails","typeName","productAvailableQuantity","data","_getClassNamePrefix","StockLevelLabel","inventoryClassName","StockLevelCode","React","getBuyboxProductTitle","brandName","titleHeadingTag","title","Name","Heading","headingTag","text","telemetryContent","getBuyboxAddToCart","state","callbacks","defaultMinimumKeyInPrice","defaultMaximumKeyInPrice","minimumKeyInPrice","maximumKeyInPrice","quantity","errorState","configureErrors","quantityError","customAmountError","otherError","errorHost","selectedProduct","isUpdatingDimension","isUpdatingDeliveryOptions","isServiceItem","keyInPriceAmount","ProductAvailableQuantity","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","closeNotificationLabel","isLoading","status","changeUpdatingDimension","isLoadingDeliveryOptions","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","emailDeliveryModeCode","EmailDeliveryModeCode","isEmailDelivery","ArrayExtensions","DeliveryOptions","Code","ContainerProps","button","AddToCartComponent","addToCartText","outOfStockText","navigationUrl","getUrlSync","price","productPrice","onError","quantityErrorForState","customAmountErrorForState","otherErrorForState","stockLeft","errorMessageOutOfStock","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","getQuantityError","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","invalidLargeCustomAmountText","updateErrorState","missingDimensions","IsGiftCard","getSelectedProduct","imageSettings","viewports","q","h","xl","lazyload","isAddServiceItemToCart","isPriceKeyedIn","customPriceAmount","isCustomPriceSelected","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isAddEmailDeliveryItemToCart","onAdd","changeModalOpen","isNavigationToCartPageDisabled","errorBlock","BuyboxErrorBlock","showError","getBuyboxProductPrice","PriceComponent","getBuyboxProductRating","ratingsSummary","ratingComponent","averageRating","RatingComponent","avgRating","readOnly","ariaLabel","format","averageRatingAriaLabel","ratingCount","reviewsCount","getBuyboxKeyInPrice","LabelContainerProps","tag","htmlFor","heading","buyboxKeyInPriceLabelHeading","type","onChange","e","value","currentTarget","updateKeyInPrice","Number","parseFloat","max","errorMessages","Object","values","message","Alert","isOpen","color","assertive","buyboxErrorMessageHeader","index","getQuantityLimitsMessages","Node","_renderMaxLabel","maxQuantityText","_renderMinLabel","minQuantityText","MAX_VALUE","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","IsB2b","getBuyboxFindInStore","slots","storeSelector","findInStoreHeaderText","findInStoreDescriptionText","findInStoreLinkText","storeSelectorStateManager","modalOpen","onClick","modules","dataProduct","Dimensions","DimensionValue","storeSelectorId","keys","openDialog","onLocationSelected","orgUnitLocation","deliveryMode","Promise","resolve","behavior","addToCartBehavior","addProductToCart","count","then","failureResult","AddToCartBehavior","assign","defaultImageSettings","friendlyName","notification","ItemSuccessfullyAddedToCartNotification","NotificationsManager","addNotification","catch","debug","findInStoreOnClick","find","option","priceComponent","popupProps","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","description","productPickupOptionList","errors","disabled","modal","getProductURLForUtag","productUrl","getProductPageUrlSync","getProductSizeForUTag","Buybox","super","updateViewPort","viewport","_getViewPort","setState","isDesktop","updateSuccessfulATC","successfulATC","timer","setTimeout","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","updateQuantity","newQuantity","fireAnalyticsLink","eventName","eventCategory","eventAction","eventLabel","eventNoninteraction","generalConfig","enhanced_action","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","reason","FinitePromiseQueueError","getDropdownName","dimensionType","_getDropdownName","isModalOpen","customPrice","_updateQueryParamVariantId","variantId","currUrl","href","urlWithIgnoredCase","URL","toLocaleLowerCase","searchParams","has","variantQueryStringName","set","history","replaceState","host","_setRecentlyViewProducts","masterProductId","cookies","date","Date","setDate","getDate","expiry","inserted","recentlyViewedProductsStored","recentlyViewedProducts","_setSmallParcelATPCallMade","atpCallMade","smallParcelATCallMade","_setStatusATPCall","StatusATPCall","_setZipCode","_setATPCall","ATPCall","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","_scrollToBVHosted","ratingSection","document","getElementById","getElementsByTagName","getAttribute","scrollIntoView","_onHandleToggleAvailableStoreDetails","isStoreDetailsOpen","_getPreferredStore","storeSelectorState","preferredStore","prefferedStore","Zip","localStorage","getItem","JSON","parse","_getSociPreferredStore","_getProductSpecificationAttributeByKeyName","attrName","productSpecificationData","attr","BooleanValue","_getProductType","shippingInformation","_updateUtagDataOnInitialLoad","productprice","allCategoriesArr","categoryPaths","categoryObj","categoryName","attribute","brandBackofficeAttributePdp","productBrandName","currAttribute","TextValue","productSize","listPageStateBuyBox","_getVariantIDOnLoad","name","CustomerContextualPrice","BasePrice","productImageUrl","PrimaryImageUrl","allProductVariants","_getProductAttributeUpdated","shippingInformationSmall","smallParcelAttributeKey","_updateAvailbilityForVariantsUpdated","allVariants","variantsResult","availableVariantIDs","eComAllVariantsOOSMultiAttr","ecomAllVairantStockInfoKey","ecomAllVairantStockInfoKey1","ecomAllVairantStockInfoKey2","ecomAllVairantStockInfoKey3","getAttributeValuesAsync","ecomAllVairantStockInfoConcatenated","ecomVairantStockInfoKey1","ecomVairantStockInfoKey2","ecomVairantStockInfoKey3","ecomAllVairantStockInfo1","ecomAllVairantStockInfo2","ecomAllVairantStockInfo3","eComJsonData","newAllVariantStockInfo","VariantList","VariantRecID","OutOfStock","outOfStockBoolean","variant","variantID","isAvailable","productType","batchedAtp","_coreProductATPCallForInventoryStatusForAllVariants","batchedAtpInventoryStatusData","setDefaultOOSVariant","variantAvailibilityList","_updateUtagData","updatedProduct","updatedPrice","getVariantID","finalPrice","utag","product_price","product_variant","product_url","product_image_url","product_size","utag_data","_sendProductDataToTealium","tealiumRecordIdFor","event","event_category","event_action","event_label","event_noninteraction","product_id","product_name","product_category","product_brand","variantIdForTracking","_eyeBrowMessageAsyncFunc","productIdsArray","eyebrowMessageObj","eyebrowMessageResult","_getEyebrowMessage","eyebrowMessageResultState","isEyeBrowLoading","getDeliverySlotFromATP","itemLinesArray","weeksPDPforATPCall","itemLines","VariantRecordId","currentDate","now","InventoryType","Weeks","Page","RequestedDate","dayjs","ItemLines","_getDeliveryByMessage","ATPInventoryData","deliveryMessageATPResultState","_tryInStoreAsyncCall","isSociEnabled","enableSociLocations","zipCodeModified","projectMetaSoci","project_meta","sociStore","sociStoreID","tryInStoreLimit","tryInStoreLookupRadius","getTryInStoreInfoInput","response","getTryInStoreAction","tryInStoresResults","isStoreLoading","prevProduct","productDimensions","dimensionsArr","dimensionsToUpdate","clearErrorState","nextProductDimensions","mappedDimensions","obj","dim","variants","queryBasedVariantSelection","variantProduct","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","getPriceForSelectedVariant","PriceForSelectedVariantInput","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","currentProduct","currentProductDimensions","_updateQuantitiesInState","makeCoreProductDeliveryMessage","_updateVariantIDForTracking","_updateURLWithoutReloading","_getBuyboxProductRating","productSpecification","getBVAttributeValues","role","_renderTryInStore","availableInStoresText","notAvailableInStoresText","onlineOnlyProductsText","isOnlineOnly","onlineOnlyBackOfficeAttribute","storeName","x","OrgUnitName","storeNameWithState","State","availableStoreText","notAvailableStoreText","canTryInStores","onHandleFindPreferredStore","mfrmStoreSelector","body","classList","add","showMapViewLink","Text","_renderStoreHours","isClosedToday","isClosed","startTime","IntegerValue","endTime","timeZone","timeZoneAbbr","getTimeZoneAbbr","storeHoursClosedText","storeCloseAtHours","storeOpenAtHours","secondsToTime","_renderTryInStoreRedesign","availableInStoresTextV2","notAvailableInStoresTextV2","viewStoreDetailsText","changeStoreText","sociPrefferedStore","sociStoreName","storeLocatorContext","Contacts","ContactTypeValue","extractPhoneNumber","contacts","allPhoneContacts","contact","IsPrivate","primaryPhoneContact","IsPrimary","Locator","storeLocatorUrl","Address","sociStoreLocatorUrl","website_url","storeAddressLine1","address1","Street","storeAddressLine2","address2","City","phoneNumber","phone","ref","wrapperRef","tabIndex","city","postalcode","target","_getProductBadges","productBadgeAttribute","badgeData","badges","parsedBadges","badge","parseBadgeData","finalizedBadges","parsedBadge","buildProductBadge","_renderEyeBrowMessage","targetAudienceGroup","eyebrowMessage","EyeBrows","eyebrow","Description","emptyClassName","emptyClassNameButton","splitMessage","trackingEyebrow","Popper","trigger","RichTextComponent","triggerClass","contentClass","position","offsetY","outline","tooltipContent","_renderCSATScore","unitsReturned","unitsSold","isNaN","unitsNotReturend","perNotReturned","round","cSatRatingHeadingText","Tooltip","Info","height","width","hover","cSatRatingPopoverText","toLocaleString","Rating","defaultValue","precision","extensionProps","deliveryMessage","inventoryStatusATPResultState","variantAvailibilityUpdating","showViewCartLink","bind","_setAllProductVariantsResult","handleClickOutside","addEventListener","PRODUCTASSERVICE","ItemTypeValue","newCartTotalItems","totalItemsInCart","prevProps","prevState","resizeThrottledEventHandler","addThrottledEvent","selProd","currSelProd","element","isInStock","clearTimeout","removeEventListener","extendAllProductVariants","prices","extendedAllProductVariants","extendedObj","productSizeName","dimensionPrice","discountAmount","priceAfterDiscount","discount","current","contains","smallParcelVariantsListObj","inStockLowestPriceVariant","isProductFound","variantObj","smallParcelProduct","str","outOfStock","outOfStockProductKey","inventoryStatusData","ATPInventoryStatusData","selectedObj","queryParamValue","masterId","pushState","search","queryParams","updatedProductSpecificationData","dimensionPrices","prodSpecficationData","_getActivePrices","Price","getNextInventoryProduct","dimensionValues","getDimensionValuesAsync","fullDimension","Behavior","DefaultQuantity","MinimumQuantity","MaximumQuantity","render","mediaGallery","selectedFoundation","adjustableItem","completeYourBedPillow","pillow","completeYourBedProtector","protector","parseBrandName","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductDescription","configure","getBuyboxProductConfigure","findInStore","addToCart","viewCartLink","rating","hideRating","inventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","quantityLimitsMessages","setSmallParcelATPCallMade","setStatusATPCall","setZipCode","setATPCall","productBadges","showBVRatings","BVRatingSummary","eyeBrowMessage","promotionalMessage","ATPDataFromBusiness","updateDimension","getProductType","setAllProductVariantsResult","customerSatisfactionScore","renderView","seconds","hours","floor","ampm","divisorForMinutes","minutes","AddToCartComponentActions","_event","setDisabled","openModal","setSuccess","moduleName","payLoad","getPayloadObject","onTelemetryClick","cartError","addToCartError","productToAdd","productBrand","productCategory","productCategoryName","product_quantity","foundation","listPosition","Dimension","utag_obj","product_list_name","product_list_position","brand","propagateError","productsToAdd","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","enableStockCheck","cartState","getCartState","clearCartLinesDeliveryInformation","addProductsToCart","propagateResult","AddToCart","useState","label","getLinkText","payload","TelemetryEvent","attributes","getTelemetryAttributes","OOMClass","itemOutOfMarket","variantOutOfStock","mfrmOutOfStockSmallParcell","allVariantOOS","disabledSmallParcel","isIntermediateState","shouldShowOutOfStock","mfrmAddToCartDisableByState","mfrmOutOfStockCustomText","mfrmContinueShoppingLink","Url","mfrmContinueShoppingText","defaultProps","err","getCount","addToCartProductsText","includeCurrentQuantity","includedQuantityNumber","msdyn365Commerce","component"],"sourceRoot":""}