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P,EAASiP,GAAQ,WACnB,IAAIW,EAAiBb,EAAUQ,EAAEG,SAC7BG,EAAS,GACTC,EAAU,EACVC,EAAY,EAChBb,EAAQI,GAAU,SAAUU,GAC1B,IAAI7W,EAAQ2W,IACRG,GAAgB,EACpBF,IACAjB,EAAKc,EAAgBL,EAAGS,GAASE,MAAK,SAAU5Z,GAC1C2Z,IACJA,GAAgB,EAChBJ,EAAO1W,GAAS,CAAEgX,OAAQ,YAAa7Z,MAAOA,KAC5CyZ,GAAaL,EAAQG,OACtB,SAAUvc,GACP2c,IACJA,GAAgB,EAChBJ,EAAO1W,GAAS,CAAEgX,OAAQ,WAAYC,OAAQ9c,KAC5Cyc,GAAaL,EAAQG,YAGzBE,GAAaL,EAAQG,MAGzB,OADI7P,EAAO1M,OAAOqc,EAAO3P,EAAO1J,OACzBkZ,EAAWQ,0BCvCtB,EAAQ,YCFRK,EAAOC,QAAUrqB,cCAjBoqB,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/allRegex.ts?9889","webpack://mattressfirm/./src/Utilities/components/BVRatingSummary.tsx?6e2e","webpack://mattressfirm/./src/Utilities/fallbackImageUrl.ts?ace7","webpack://mattressfirm/./src/Utilities/get-core-delivery-batch.ts?5a2b","webpack://mattressfirm/./src/Utilities/get-product-badge.tsx?635b","webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/Utilities/getAttributeUtils.ts?f2d8","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/fetch-core-delivery-list.action.ts?41e3","webpack://mattressfirm/./src/data-actions/get-comfort-type.action.ts?e535","webpack://mattressfirm/./src/data-actions/get-product-benefits-data.action.ts?1d43","webpack://mattressfirm/./src/data-actions/get-selected-variant.override.action.ts?02a3","webpack://mattressfirm/./src/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action.ts?e1f9","webpack://mattressfirm/./src/modules/mfrm-products-compare/components/product-mattribute.tsx?5c13","webpack://mattressfirm/./src/modules/mfrm-products-compare/components/product-compare-carousel-item.tsx?5085","webpack://mattressfirm/./src/Utilities/get-delivery-message-batch.ts?dcce","webpack://mattressfirm/./src/modules/mfrm-products-compare/mfrm-products-compare.tsx?d723","webpack://mattressfirm/./src/modules/mfrm-products-compare/mfrm-products-compare.view.tsx?d21c","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./lib/mfrm-products-compare/module-registration.js?e7eb","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.promise.all-settled.js?ad9a","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/esnext.promise.all-settled.js?b32a","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { ICoreContext } from '@msdyn365-commerce/core';\r\nexport const emailRegex = (emailValue: string) => {\r\n // eslint-disable-next-line security/detect-unsafe-regex\r\n const validationEmail = /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(?:\\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-z0-9]+(?:-+[a-z0-9]+)*\\.)+(?:xn--[a-z0-9]+|[a-z]{2,16})$/i;\r\n\r\n return validationEmail.test(emailValue);\r\n};\r\n\r\n/**\r\n * Method to remove special characters for product name from product URL\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialChars = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n return str?.replace(/[^a-zA-Z0-9- ]/g, '');\r\n }\r\n return str;\r\n};\r\n\r\n\r\n/**\r\n * Method to remove special characters for product URL's path\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialCharsFromURLPath = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n const urlPath = decodeURIComponent(str.split('.p')[0])?.replace(/[^a-zA-Z0-9-/ ]/g, '');\r\n return `${urlPath}.p`;\r\n }\r\n return str;\r\n};\r\n\r\n// Following phone format is used on customer info section at checkout page\r\nexport const customerInfoPhoneRegex = /^\\(?([2-9][0-8][0-9])\\)?[ . ]?([2-9][0-9]{2})[\\-\\. ]?([0-9]{4})(\\s*x[0-9]+)?$/; // Valid USA number in format (xxx) xxx-xxxx\r\n\r\n/*\r\nThis regex object has 2 patterns:\r\n'nameRegex' matches names with letters, spaces, apostrophes, periods, and dashes.\r\n'addressInputRegex' matches alphanumeric characters and printable ASCII symbols.\r\n*/\r\nexport const inputRegexObj = {\r\n nameRegex: /^[\\p{L}\\s.'-]+$/u,\r\n addressInputRegex: /^[a-zA-Z0-9\\x20-\\x7E]*$/,\r\n phoneNumerRegex: customerInfoPhoneRegex\r\n};\r\n\r\n// This regex allows us to effectively validate and extract delivery messages\r\nexport const cartDeliveryMsgRegex = /[A-Za-z]{3} \\d{1,2}(?: - [A-Za-z]{3} \\d{1,2})?/;","import React, { useState, useEffect, useRef } from 'react';\r\n\r\nexport const BVRatingSummary = ({\r\n itemId,\r\n onClick,\r\n variantId,\r\n hideReadReviewsButton\r\n}: {\r\n itemId: string | undefined;\r\n onClick?: () => void;\r\n variantId?: number | undefined;\r\n hideReadReviewsButton?: boolean\r\n}) => {\r\n const [dataBvProductIdAttr, setDataBvProductIdAttr] = useState(itemId);\r\n const wrapper = useRef(null);\r\n const interval = useRef(-1);\r\n const [numReviews, setNumReviews] = useState();\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr(itemId);\r\n }, [itemId]);\r\n\r\n useEffect(() => {\r\n setDataBvProductIdAttr('bv-refresh');\r\n }, [variantId]);\r\n\r\n useEffect(() => {\r\n if (dataBvProductIdAttr === 'bv-refresh') {\r\n setDataBvProductIdAttr(itemId);\r\n }\r\n }, [dataBvProductIdAttr]);\r\n useEffect(() => {\r\n const pollInterval = window.setInterval(() => {\r\n const numReviewsHTML = wrapper.current?.querySelector('.bv_numReviews_text')?.innerHTML.match(/\\(([^)]+)\\)/)?.[1];\r\n if (numReviewsHTML) {\r\n setNumReviews(numReviewsHTML);\r\n clearInterval(pollInterval);\r\n }\r\n }, 0);\r\n });\r\n useEffect(() => {\r\n if (wrapper.current) {\r\n numReviews === '0' ? wrapper.current.style.display = 'none' : wrapper.current.style.display = 'flex';\r\n }\r\n }, [numReviews]);\r\n\r\n return (\r\n {\r\n if (hideReadReviewsButton) {\r\n interval.current = window.setInterval(() => {\r\n const button: Element | undefined = Array.from(document.querySelectorAll('.bv_button_buttonFull')).find((button) => {\r\n return button?.innerHTML === `Read ${numReviews} Reviews`;\r\n });\r\n if (button) {\r\n button.outerHTML = '';\r\n }\r\n });\r\n }\r\n }}\r\n onMouseLeave={() => {\r\n if (hideReadReviewsButton) {\r\n clearInterval(interval.current);\r\n }\r\n }}\r\n data-bv-show='rating_summary'\r\n data-bv-product-id={dataBvProductIdAttr}\r\n onClick={onClick}\r\n ref={wrapper}\r\n />\r\n );\r\n};\r\n","import { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { getFallbackImageUrl } from '../data-actions/utilities/utils';\r\n\r\nexport const urlFallBackImage = (imageUrl: string, itemId: string | undefined, apiSettings: IRequestContext) => {\r\n let fallbackImageUrl = getFallbackImageUrl(itemId, apiSettings?.apiSettings);\r\n if (imageUrl && fallbackImageUrl) {\r\n fallbackImageUrl = `${fallbackImageUrl},${imageUrl}`;\r\n }\r\n return fallbackImageUrl;\r\n};","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport { IMFIATPInventoryEntityPLP, IMFIATPInventoryPLPResponse, IMFICartLine } from '../actions/BatchCoreProductDataServiceEntities.g';\r\nimport fetchCoreDeliveryListAction, { FetchCoreDeliveryListInput } from \"../actions/fetch-core-delivery-list.action\";\r\n\r\nexport interface IMFIATPInventoryEntityPLPEx extends IMFIATPInventoryEntityPLP {\r\n deliveryMessage: string | undefined;\r\n}\r\n\r\nasync function getListOfCoreDeliveryMessage(ctx: Msdyn365.IActionContext, cartLines: IMFICartLine[], zipCode?: string): Promise {\r\n const data: IMFIATPInventoryPLPResponse = await fetchCoreDeliveryListAction(new FetchCoreDeliveryListInput(cartLines, zipCode), ctx);\r\n const updatedResponse: IMFIATPInventoryEntityPLPEx[] | undefined = data?.ATPInventoryPLPData?.map((deliveryItem: IMFIATPInventoryEntityPLP, i: number) => {\r\n let deliveryMessage = '';\r\n if (deliveryItem.Available === 'YES' && deliveryItem.ATPQuantity !== undefined && parseInt(deliveryItem.ATPQuantity, 10) > 0) {\r\n const date = new Date();\r\n const today = dayjs(Date.now()).format('D M YY');\r\n const deliveryDate = dayjs(deliveryItem.SlotDate).format('D M YY');\r\n if (today === deliveryDate) {\r\n deliveryMessage = `Delivery by Today ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n } else if (deliveryDate === dayjs(date.setDate(date.getDate() + 1)).format('D M YY')) {\r\n deliveryMessage = `Delivery by Tomorrow ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n } else {\r\n deliveryMessage = `Delivery by ${dayjs(deliveryItem.SlotDate).format('MMM D')}`;\r\n }\r\n } else {\r\n deliveryMessage = ctx.requestContext.app.config.defaultDeliveryMessage ? ctx.requestContext.app.config.defaultDeliveryMessage : '';\r\n }\r\n return { ...deliveryItem, deliveryMessage };\r\n });\r\n return updatedResponse;\r\n}\r\n\r\nexport default getListOfCoreDeliveryMessage;","import { IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport dayjs from 'dayjs';\r\nimport tz from 'dayjs/plugin/timezone';\r\nimport utc from 'dayjs/plugin/utc';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\ndayjs.extend(tz);\r\ndayjs.extend(utc);\r\ndayjs.extend(isBetween);\r\nimport React from 'react';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nconst format = 'M/D/YYYY H:m:s';\r\n\r\nexport interface IBadgeData {\r\n src: string;\r\n alt: string;\r\n start: dayjs.Dayjs;\r\n end: dayjs.Dayjs;\r\n}\r\n\r\nconst defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `m=6`, w: 0, h: 0 }\r\n },\r\n disableLazyLoad: true\r\n};\r\n\r\nexport const parseBadgeData = (badgeData: string, requestContext: IRequestContext): IBadgeData | undefined => {\r\n let dataSegments;\r\n let scheduleStart;\r\n let scheduleEnd;\r\n let badgeType;\r\n let parsedScheduleStart;\r\n let startDate;\r\n let startTime;\r\n let parsedScheduleEnd;\r\n let endDate;\r\n let endTime;\r\n\r\n try {\r\n // split the data into its segments\r\n dataSegments = badgeData.split('#');\r\n scheduleStart = dataSegments[0];\r\n scheduleEnd = dataSegments[1];\r\n badgeType = dataSegments[2];\r\n\r\n // parse schedule start\r\n parsedScheduleStart = scheduleStart.split('_');\r\n startDate = parsedScheduleStart[0];\r\n startTime = parsedScheduleStart[1];\r\n\r\n // parse schedule end\r\n parsedScheduleEnd = scheduleEnd.split('_');\r\n endDate = parsedScheduleEnd[0];\r\n endTime = parsedScheduleEnd[1];\r\n } catch (e) {\r\n return;\r\n }\r\n\r\n const startMoment = `${startDate} ${startTime?.replace(/-/g, \":\")}`;\r\n const endMoment = `${endDate} ${endTime?.replace(/-/g, \":\")}`;\r\n\r\n const startMomentFormatted = dayjs(startMoment?.replace(/-/g, \"/\"));\r\n const endMomentFormatted = dayjs(endMoment?.replace(/-/g, \"/\"));\r\n\r\n // check if schedule is valid\r\n if (!(startMomentFormatted.isValid() && endMomentFormatted.isValid())) {\r\n return;\r\n }\r\n\r\n // parse badge type and create image src\r\n const baseUrl = requestContext.apiSettings.baseImageUrl.substring(0, requestContext.apiSettings.baseImageUrl.length - 1);\r\n if (badgeType) {\r\n const removed$ = badgeType.substring(1, badgeType.length - 1);\r\n const parsedBadgeType = removed$?.replace(' ', '-').toLowerCase();\r\n\r\n // remove page name portion\r\n const altText = removed$.split('-')[0];\r\n\r\n const src = `${baseUrl}${parsedBadgeType}.png`;\r\n return {\r\n src: src,\r\n alt: altText,\r\n start: convertTimeZone(startMomentFormatted),\r\n end: convertTimeZone(endMomentFormatted)\r\n };\r\n } else {\r\n return;\r\n }\r\n};\r\n\r\n// convert given time to Central Time (CT)\r\nconst convertTimeZone = (time: dayjs.Dayjs): dayjs.Dayjs => {\r\n return dayjs(time.format(format), format).tz('America/Chicago').local();\r\n};\r\n\r\nexport const buildProductBadge = (parsedBadgeData: IBadgeData, requestContext: IRequestContext): JSX.Element | undefined => {\r\n // only build image if it is scheduled\r\n const isScheduled = dayjs().isBetween(parsedBadgeData.start, parsedBadgeData.end);\r\n\r\n if (isScheduled) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const renderProductBadge = (\r\n attributeName: string | undefined,\r\n requestContext: IRequestContext\r\n): JSX.Element | undefined => {\r\n const badgeData = attributeName;\r\n if (!badgeData) {\r\n return;\r\n }\r\n // split badge data into its separate badges\r\n const badges = badgeData.split(',');\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges.map(badge => parseBadgeData(badge, requestContext));\r\n\r\n // build product badge image components\r\n const finalizedBadges = parsedBadges.map(parsedBadge => parsedBadge && buildProductBadge(parsedBadge, requestContext));\r\n\r\n return finalizedBadges ? <>{finalizedBadges} : <>;\r\n};\r\n\r\nexport const renderProductBadgeByFilteringAttributes = (\r\n attributeName: string | undefined,\r\n attributes: AttributeValue[] | undefined,\r\n requestContext: IRequestContext\r\n): JSX.Element | undefined => {\r\n const badgeData =\r\n attributeName &&\r\n attributes?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attributeName.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 => parseBadgeData(badge, requestContext));\r\n // build product badge image components\r\n const finalizedBadges = parsedBadges.map(parsedBadge => parsedBadge && buildProductBadge(parsedBadge, requestContext));\r\n\r\n return finalizedBadges && <>{finalizedBadges};\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 { AttributeValue } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport const getAttributeByName = (attributeValues: AttributeValue[] | undefined, keyValue: string): AttributeValue | undefined => {\r\n return attributeValues && attributeValues.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === keyValue.toLowerCase().trim());\r\n};\r\nexport const getAttributeValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeArrayValueByNameUnbxd = (list: any[] | undefined, keyValue: string | undefined): string[] | undefined => {\r\n return keyValue && list && list[keyValue];\r\n};\r\nexport const getAttributeTextValue = (attribute: AttributeValue | undefined): string | undefined => {\r\n return attribute && attribute.TextValue;\r\n};\r\nexport const getunbxdAttributeNameByCRTName = (crtName: string | undefined, mapList: any): string | undefined => {\r\n return mapList && Array.isArray(mapList) && mapList?.find((attr: any) => crtName && attr?.CRTName.toLowerCase().trim() === crtName.toLowerCase().trim())?.UnbxdName;\r\n};","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\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 = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n splitVariantReqIdList: string[];\r\n}\r\n\r\nexport interface foo {\r\n database: AsyncResult;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchChooseYourFoundationDatabaseInput(args?.requestContext.app.config.jsonSrc!);\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 action(input: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // Give your data action a unique id\r\n id: 'FetchChooseYourFoundationDatabase',\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.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getZipCode } from '../Utilities/get-zipcode';\r\nimport dayjs from 'dayjs';\r\nimport { mFIATPInventoryPLPAsync } from './BatchCoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryPLPResponse, IMFICartLine, IMFIDeliveryScheduleParameters } from './BatchCoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * FetchCoreDeliveryList Input Action\r\n */\r\nexport class FetchCoreDeliveryListInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public cartLines: IMFICartLine[];\r\n public zipCode?: string;\r\n constructor(cartLines: IMFICartLine[], zipCode?: string) {\r\n this.cartLines = cartLines;\r\n this.zipCode = zipCode;\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 return this.cartLines?.sort((a, b) => a?.VariantRecordId && b?.VariantRecordId && a?.VariantRecordId > b?.VariantRecordId ? 1 : -1).map(item => `FetchCoreDeliveryList-${item.VariantRecordId}-${this.zipCode}-${item.VariantRecordId?.length}`).toString();\r\n };\r\n public getCacheObjectType = () => 'FetchCoreDeliveryList';\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\nexport interface IFetchCoreDeliveryListData {\r\n text: string;\r\n}\r\n\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 FetchCoreDeliveryListInput();\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 fetchCoreDeliveryAction(input: FetchCoreDeliveryListInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n const atpInput: IMFIDeliveryScheduleParameters = {\r\n Weeks: 6,\r\n InventoryType: 'Delivery',\r\n StoreId: '',\r\n RequestedDate: dayjs(Date.now()).format('MM/DD/YYYY'),\r\n ZipCode: input.zipCode ?? getZipCode(ctx),\r\n ItemLines: input.cartLines,\r\n CustomerRequestTime: dayjs(Date.now()).format('MM/DD/YYYY HH:mm:ss'),\r\n Id: 0,\r\n NoOfPriorityDC: 0\r\n };\r\n const response = await mFIATPInventoryPLPAsync({ callerContext: ctx }, atpInput);\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >fetchCoreDeliveryAction,\r\n // Give your data action a unique id\r\n id: 'FetchCoreDeliveryList'\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\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetComfortTypesData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private comfortTypesDataUrl: string = '';\r\n constructor(comfortTypesDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'comfortTypesDataCache', cacheKey: 'comfortTypesDataCache' });\r\n this.comfortTypesDataUrl = comfortTypesDataUrl;\r\n }\r\n public getComfortTypesDataUrl = () => this.comfortTypesDataUrl;\r\n public getCacheKey = () => `comfortTypesDataCache`;\r\n public getCacheObjectType = () => 'comfortTypesDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.comfortTypesDataUrl) {\r\n return new GetComfortTypesData(inputData.config.comfortTypesDataUrl);\r\n }\r\n return new GetComfortTypesData('');\r\n};\r\nasync function action(input: GetComfortTypesData, ctx: Msdyn365.IActionContext): Promise {\r\n const comfortTypesDataJsonUrl = ctx.requestContext.app.config.comfortTypesDataJsonUrl;\r\n const jsonUrl = comfortTypesDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const comfortTypesData = res.data && res.data;\r\n return comfortTypesData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'ComfortTypesDataCache',\r\n action: >action,\r\n input: createInput\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\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetProductBenefitsData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private productBenefitsDataUrl: string = '';\r\n constructor(productBenefitsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsDataCache', cacheKey: 'productBenefitsDataCache' });\r\n this.productBenefitsDataUrl = productBenefitsDataUrl;\r\n }\r\n public getProductBenefitsDataUrl = () => this.productBenefitsDataUrl;\r\n public getCacheKey = () => `productBenefitsDataCache`;\r\n public getCacheObjectType = () => 'productBenefitsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.productBenefitsDataUrl) {\r\n return new GetProductBenefitsData(inputData.config.productBenefitsDataUrl);\r\n }\r\n return new GetProductBenefitsData('');\r\n};\r\nasync function action(input: GetProductBenefitsData, ctx: Msdyn365.IActionContext): Promise {\r\n const productBenefitsDataJsonUrl = ctx.requestContext.app.config.productBenefitsDataUrl;\r\n const jsonUrl = productBenefitsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const productBenefitsData = res.data && res.data;\r\n return productBenefitsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'productBenefitsData',\r\n action: >action,\r\n input: createInput\r\n});","import { generateProductImageUrl, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\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 {\r\n getByIdAsync,\r\n getDimensionValuesAsync,\r\n getVariantsByDimensionValuesAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n AttributeValue,\r\n CommerceProperty,\r\n ProductDimension,\r\n ProductDimensionValue,\r\n ProductSearchCriteria,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { variantQueryStringName } from '../Utilities/constants';\r\nimport getAttributesForSelectedVariant, { AttributesForSelectedVariantInput } from './get-attributes-for-selected-variant';\r\nimport { getQueryParamsFromQueryByName } from './utilities/utils';\r\n// import { AttributesForSelectedVariantInput, getAttributesForSelectedVariantAction } from '@msdyn365-commerce-modules/product-specification/src/dataActions/get-attributes-for-selected-variant';\r\n\r\nexport interface IDefaultDimension {\r\n dimensionType: number;\r\n dimensionValue: string;\r\n}\r\n\r\nlet shouldDefaultSet: boolean = true;\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class SelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n public getCacheKey = () => `SelectedVariant`;\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): SelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new SelectedVariantInput(+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\n/**\r\n * Action method for the getSelectedVariant data aciton\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\n// tslint:disable-next-line:cyclomatic-complexity max-func-body-length\r\nasync function getSelectedVariantAction(input: SelectedVariantInput, ctx: IActionContext): Promise {\r\n //TODO: what is the use case for `matchingDimensionValues` to ever have values?\r\n // the `createInput` always passes an empty array to the input constructor. Where\r\n // else / how else is this getting called that would pass a populated array?\r\n const matchingDimensionValues = input.matchingDimensionValues ?? [];\r\n const variantId = ctx.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n MsDyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : ctx.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n let getByIdResponse;\r\n try {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n matchingDimensionValues?.length === 0 && variantId && !Number.isNaN(Number(variantId))\r\n ? Number(variantId)\r\n : await getDefaultVariantId(input.productId, ctx) ?? input.productId,\r\n input.channelId);\r\n } catch (error) {\r\n console.log('[getByIdAsync Error calling API]', error);\r\n }\r\n // bellow cond will only be 1 if we have invalid variantid\r\n if (!getByIdResponse && variantId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n input.productId,\r\n input.channelId);\r\n }\r\n\r\n // below condition will only be true if we have masterid in url and query\r\n if (getByIdResponse && !getByIdResponse?.MasterProductId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n await getDefaultVariantId(getByIdResponse.RecordId, ctx) ?? input.productId,\r\n input.channelId);\r\n }\r\n\r\n const baseProduct: SimpleProduct = Array.isArray(getByIdResponse)\r\n ? getByIdResponse[0]\r\n : getByIdResponse;\r\n // Need to dereference this before editing it. Otherwise we might not\r\n // properly get the mobx events because if things aren't properly observable\r\n // they won't fire when you set them, and then if you don't deref the value in\r\n // the cache will match the value when you try to save it, so it won't detect any\r\n // changes there either\r\n let product: SimpleProduct | null = { ...baseProduct };\r\n const originalDimensionLength = product.Dimensions ? product.Dimensions.length : 0;\r\n\r\n if (product && product.RecordId > 0) {\r\n let baseProductHadUnmatchedDimension: boolean = false;\r\n\r\n product.Dimensions?.forEach(dimension => {\r\n const matchedTargetDimension = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimension) {\r\n dimension.DimensionValue = matchedTargetDimension?.DimensionValue;\r\n } else {\r\n baseProductHadUnmatchedDimension = true;\r\n }\r\n });\r\n\r\n const actionInput = new AttributesForSelectedVariantInput(\r\n product.RecordId,\r\n input.channelId,\r\n product\r\n );\r\n const productSpecificationData: AttributeValue[] = await getAttributesForSelectedVariant(actionInput, ctx)\r\n .catch((error: Error) => {\r\n error;\r\n }) || [];\r\n\r\n // check if default variant is given for product\r\n // const productSpecificationData: AttributeValue[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, product.RecordId, input.channelId, 0);\r\n const defaultValues = productSpecificationData.find(data => data.Name?.toLowerCase().trim() === 'default variants')?.TextValue;\r\n const parsedDefaultData = defaultValues\r\n ? parseDefaultDimensionsData(defaultValues)\r\n : undefined;\r\n const productPreSelectionDimensions: ProductDimensionFull[] = [];\r\n\r\n //new - literally 10x faster!\r\n if (!product.MasterProductId) {\r\n // const now = (new Date()).valueOf()\r\n // console.time(`productPreSelectionDimensions${now}`);\r\n const asyncCalls = product.Dimensions?.map(async dimension => {\r\n const dimensionValues = await getDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n product?.MasterProductId\r\n ? product.MasterProductId\r\n // @ts-ignore: nested in `if(product && product.RecordId > 0)`\r\n : product.RecordId,\r\n input.channelId,\r\n dimension.DimensionTypeValue,\r\n matchingDimensionValues.filter(value => value.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n null\r\n );\r\n\r\n // if dimensionValues have a length of exactly one then we need to make\r\n // it as selected dimension for getting variant of the product\r\n if (dimensionValues.length === 1 && shouldDefaultSet) {\r\n dimension.DimensionValue = dimensionValues[0];\r\n } else {\r\n // search through default dimensions to find current dimension\r\n const defaultValueToFind = parsedDefaultData\r\n ?.find(defaultData => defaultData.dimensionType === dimension.DimensionTypeValue)\r\n ?.dimensionValue.toLowerCase()\r\n .trim();\r\n\r\n // look through all dimension values to find the default one\r\n const defaultDimension: ProductDimensionValue | undefined = dimensionValues.find(\r\n availableDimensionValue => availableDimensionValue.Value?.toLowerCase().trim() === defaultValueToFind || availableDimensionValue.DimensionId?.toLowerCase().trim() === defaultValueToFind\r\n );\r\n\r\n if (defaultDimension && shouldDefaultSet) {\r\n dimension.DimensionValue = defaultDimension;\r\n }\r\n }\r\n\r\n const fullDimension: ProductDimensionFull = {\r\n ...dimension,\r\n DimensionValues: dimensionValues\r\n };\r\n\r\n productPreSelectionDimensions.push(fullDimension);\r\n }) || [];\r\n\r\n await Promise.allSettled(asyncCalls);\r\n }\r\n //*/\r\n\r\n // if there is any selection in productPreSelectionDimensions array then get the variant\r\n if (productPreSelectionDimensions.length > 0) {\r\n const mappedDimensions = productPreSelectionDimensions\r\n .filter(dimension => dimension && dimension.DimensionValue)\r\n .map(dimension => {\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue: dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n });\r\n //console.log(\"mappedDimensions: \",mappedDimensions)\r\n if (originalDimensionLength > 0 && originalDimensionLength === mappedDimensions.length) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n mappedDimensions\r\n );\r\n if (variants && variants.length === 1) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n }\r\n else if (productPreSelectionDimensions.length === 0 && !baseProductHadUnmatchedDimension && matchingDimensionValues.length > 0) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n matchingDimensionValues\r\n );\r\n\r\n if (variants && variants.length > 0) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n else {\r\n //TODO: what should happen here??\r\n //console.log(\"in 'else' for getVariantsByDimensionValuesAsync\")\r\n }\r\n\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n }\r\n\r\n shouldDefaultSet = false;\r\n\r\n return product;\r\n}\r\n\r\nconst parseDefaultDimensionsData = (defaultValue: string): IDefaultDimension[] | undefined => {\r\n try {\r\n const defaultDimensions: IDefaultDimension[] = [];\r\n\r\n const splitDimensionTypes = defaultValue.split(',');\r\n splitDimensionTypes.forEach(dimensionData => {\r\n const [dimensionTypeString, dimensionValue] = dimensionData.split('_');\r\n const dimensionType = parseInt(dimensionTypeString, 10);\r\n defaultDimensions.push({\r\n dimensionType,\r\n dimensionValue\r\n });\r\n });\r\n\r\n return defaultDimensions;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getDefaultVariantId = async (masterId: number, context: IActionContext): Promise => {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [masterId],\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n const productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n const defaultVariantId = productSearchResults[0]?.ExtensionProperties && productSearchResults[0]?.ExtensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\"\r\n )?.Value?.LongValue;\r\n return !defaultVariantId || defaultVariantId === 0 ? undefined : defaultVariantId;\r\n }\r\n return undefined;\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * The complete getSelectedVariant data action\r\n */\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-selected-variant',\r\n action: >getSelectedVariantAction,\r\n input: createInput\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 */\r\n\r\nimport * as Msdyn365All from '@msdyn365-commerce/core';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\nimport fetchChooseYourFoundationDatabaseDataAction, { FetchChooseYourFoundationDatabaseInput } from '../../actions/fetch-choose-your-foundation-database.action';\r\nimport { getQueryParamsFromQueryByName, getSelectedProductIdFromActionInput } from '../../data-actions/utilities/utils';\r\nimport { getDefaultVariantId } from '../../data-actions/get-selected-variant.override.action';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n\r\n/**\r\n * GetUnbxdCollectionCompareData Input Action\r\n */\r\nexport class GetUnbxdCollectionCompareDataInput implements Msdyn365All.IActionInput {\r\n // Construct the input needed to run the action\r\n public configs?: any;\r\n public recordId?: string;\r\n constructor(configs?: any, recordId?: string) {\r\n this.configs = configs;\r\n this.recordId = recordId;\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 = () => `VariantIDs-${this.recordId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): Msdyn365All.CacheType => 'request';\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\nexport interface IGetUnbxdCollectionCompareDataData {\r\n collectionData: any | null;\r\n productId: number | undefined | null;\r\n variantIds: string[] | undefined;\r\n collectionDescription: string | undefined;\r\n}\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365All.ICreateActionContext): Msdyn365All.IActionInput => {\r\n const variantId = args.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n Msdyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : args.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n return new GetUnbxdCollectionCompareDataInput(args, variantId);\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 getUnbxdCollectionCompare(input: GetUnbxdCollectionCompareDataInput, ctx: Msdyn365All.IActionContext): Promise {\r\n let variantIdNumber: number | null | undefined;\r\n const actionInput = new FetchChooseYourFoundationDatabaseInput(ctx.requestContext.app.config.jsonSrc);\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n const collectionJson: any = await fetchChooseYourFoundationDatabaseDataAction(actionInput, ctx);\r\n let collectionData: any | null = {};\r\n let variantIds: string[] | undefined = [];\r\n let collectionDescription: string | undefined;\r\n let response: any = {};\r\n if (collectionJson) {\r\n const baseURL = 'https://search.unbxd.io';\r\n variantIdNumber = input.recordId && !Number.isNaN(Number(input.recordId))\r\n ? Number(input.recordId)\r\n : await getDefaultVariantId(Number(getSelectedProductIdFromActionInput(ctx)), ctx);\r\n if (collectionJson.length > 0 && variantIdNumber) {\r\n variantIds = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.mattressComparisonReqIdList?.map((value: any) => value);\r\n collectionDescription = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.collectionDescription;\r\n variantIds && variantIds?.length >= 1 && variantIds?.unshift(`${variantIdNumber}`);\r\n let collectionCompareIds = '';\r\n if (variantIds && variantIds?.length >= 2) {\r\n for (let index = 0; index < variantIds?.length; index++) {\r\n collectionCompareIds += index === 0 ? `variantId:${variantIds[index]}` : ` OR variantId:${variantIds[index]}`;\r\n }\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n if (collectionCompareIds.length) {\r\n const unbxdUrl = `${baseURL}/${unbxdApiKey}/${unbxdSiteKey}/search?q=*&variants=true&variants.count=*&filter= ${collectionCompareIds}`;\r\n response = await Msdyn365All.sendRequest(unbxdUrl, 'get');\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n\r\n collectionData = response?.data?.response;\r\n return { collectionData, productId: variantIdNumber, variantIds: variantIds, collectionDescription };\r\n }\r\n }\r\n // Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n}\r\n\r\nexport default Msdyn365All.createObservableDataAction({\r\n action: >getUnbxdCollectionCompare,\r\n // Give your data action a unique id\r\n id: 'GetUnbxdCollectionCompareData',\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\r\n","import React from 'react';\r\nimport { IBooleanMattributesData } from '../mfrm-products-compare.props.autogenerated';\r\nexport interface IProductMattributeProps {\r\n mattributeName?: string | undefined,\r\n mattributeScore?: any | undefined,\r\n mattributeValue?: string | undefined,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined;\r\n}\r\n\r\nexport const ProductMattribute: React.FC = (props) => {\r\n const { mattributeName, mattributeScore, mattributeValue, booleanMattributes} = props;\r\n const mattributescore = mattributeScore && Number(mattributeScore) / 2;\r\n if (booleanMattributes?.find(m => m?.mattributeName?.toLowerCase().trim() === mattributeName?.toLowerCase().trim())) {\r\n return (\r\n
\r\n
{mattributeName}
\r\n {mattributeValue === '1' ? YES : NO}\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n
{mattributeName}
\r\n
    \r\n {[...Array(5)].map((_, i) =>\r\n i < mattributescore && i + 1 > mattributescore ?\r\n (
  • )\r\n : i < mattributescore ? (
  • )\r\n : mattributescore === 0 || !mattributescore ? (
  • )\r\n : (
  • )\r\n )}\r\n\r\n
\r\n
\r\n );\r\n};\r\n","import React from 'react';\r\nimport 'mfcl/variables.scss';\r\nimport { ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\n//** currently marking all as optional to excape errors */\r\nimport { ProductMattribute } from './product-mattribute';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProductAndAttributes } from '../mfrm-products-compare';\r\nimport { getAttributeArrayValueByNameUnbxd, getAttributeValueByNameUnbxd } from '../../../Utilities/getAttributeUtils';\r\nimport { IBooleanMattributesData } from '../mfrm-products-compare.props.autogenerated';\r\nexport interface IProductCompareCarouselItemProps {\r\n productUrl?: string | undefined,\r\n zipCode?: string | undefined,\r\n title: string | undefined,\r\n price: number | undefined,\r\n image: JSX.Element | null,\r\n basePrice: number,\r\n productBadge: JSX.Element | undefined,\r\n ratings: React.ReactNode | undefined,\r\n deliveryMessage?: React.ReactNode | undefined\r\n mattributeData?: any[],\r\n index: number,\r\n comfort?: string,\r\n mattressType?: string,\r\n heigth?: string,\r\n bestFor?: string,\r\n product?: SimpleProductAndAttributes,\r\n brandName?: string,\r\n context?: any,\r\n comfortIcon?: any,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined;\r\n}\r\n\r\nexport const ProductCompareCarouselItem: React.FC = (props) => {\r\n const { product, brandName, productUrl, price, image, title,\r\n basePrice, productBadge, ratings, deliveryMessage,\r\n mattributeData, index, comfort, mattressType, heigth, bestFor, comfortIcon, booleanMattributes } = props;\r\n function renderPrice(\r\n productPrice?: number,\r\n basePrice?: number\r\n ): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: basePrice,\r\n CustomerContextualPrice: productPrice\r\n };\r\n\r\n return basePrice ? (\r\n
\r\n {price.AdjustedPrice && price.CustomerContextualPrice && price.CustomerContextualPrice < price.AdjustedPrice ? <>\r\n ${price.CustomerContextualPrice}\r\n \r\n \r\n ${price.AdjustedPrice}\r\n \r\n \r\n :\r\n \r\n ${price.BasePrice}\r\n }\r\n
\r\n ) : null;\r\n }\r\n\r\n function renderMattributes(\r\n mattributeData: any,\r\n booleanMattributes?: IBooleanMattributesData[] | undefined\r\n ): JSX.Element | null {\r\n return mattributeData ? (\r\n
\r\n

Mattributes

\r\n {mattributeData?.sort((a: any, b: any) => a?.mattributeName > b?.mattributeName ? 1 : -1)?.sort((a: any, b: any) => {\r\n if (booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === a?.mattributeName?.toUpperCase())) {\r\n return 1;\r\n } else if (booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === b?.mattributeName?.toUpperCase())) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n }).map((mattribute: any, index: number) => {\r\n return ;\r\n })}\r\n
\r\n ) : null;\r\n }\r\n const callTealiumOnClick = async (): Promise => {\r\n const productName = product?.Name;\r\n const variantID = getAttributeValueByNameUnbxd(product as any, 'v_VariantId');\r\n const productCategory = getAttributeArrayValueByNameUnbxd(product as any, 'categoryPathId2')?.at(-2)?.split('|')[1] ?? '';\r\n\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n // eslint-disable-next-line security/detect-non-literal-fs-filename\r\n utag.link({\r\n event: 'product-click',\r\n enhanced_action: 'product_click',\r\n event_category: 'ecommerce',\r\n event_action: 'product click',\r\n event_label: `${product?.ItemId}: ${productName}`,\r\n event_noninteraction: 'false',\r\n product_list_name: [`PDP Collection Compare`],\r\n product_position: [`${index}`],\r\n product_id: [`${product?.ItemId}`],\r\n product_name: [`${productName}`],\r\n product_category: [`${productCategory}`],\r\n product_brand: [`${brandName}`],\r\n product_variant: [`${variantID}`]\r\n });\r\n }\r\n };\r\n const scrollToBuybox = () => {\r\n if(MsDyn365.isBrowser){\r\n const currentProduct= document.getElementById('mfrm-buybox');\r\n currentProduct?.scrollIntoView({\r\n behavior: 'smooth'\r\n });\r\n }\r\n };\r\n\r\n const renderCompareCard = () => {\r\n return (\r\n <>\r\n
\r\n {productBadge}\r\n
\r\n
index !== 0 && callTealiumOnClick()}>\r\n {image}\r\n
\r\n
\r\n \r\n
\r\n \r\n {title}\r\n \r\n
\r\n
\r\n {renderPrice(\r\n price, basePrice)\r\n }\r\n
\r\n
\r\n {ratings}\r\n
\r\n {deliveryMessage}\r\n
\r\n
\r\n
\r\n Comfort\r\n
\r\n

{comfort ? comfort : '--'}

\r\n {`${comfort}\r\n
\r\n
\r\n
\r\n Best For\r\n

{bestFor ? bestFor : '--'}

\r\n
\r\n
\r\n Mattress Type\r\n

{mattressType ? mattressType : '--'}

\r\n
\r\n
\r\n Height\r\n

{heigth ? heigth : '--'}

\r\n
\r\n
\r\n {renderMattributes(mattributeData, booleanMattributes)}\r\n
index !== 0 && callTealiumOnClick()}>\r\n {index === 0 ? scrollToBuybox()}>Shop Now\r\n : Shop Now}\r\n
\r\n
\r\n \r\n );\r\n };\r\n\r\n return (\r\n
\r\n {index === 0 ?\r\n
scrollToBuybox()}>\r\n {renderCompareCard()}\r\n
\r\n :\r\n \r\n {renderCompareCard()}\r\n \r\n }\r\n
\r\n );\r\n};","import dayjs from \"dayjs\";\r\nimport { IBrandListData } from \"../modules/mfrm-buybox/mfrm-buybox.view\";\r\nimport { _deliveryMessage } from \"../modules/mfrm-buybox/components/buybox-devliery-by-message\";\r\nimport { _getProductType } from \"../themes/mattressfirm/views/components/delivery-message/deliverymessage.component\";\r\n\r\nexport interface IBatchDeliveryMessage {\r\n ItemId: string | undefined;\r\n Brand: string | undefined;\r\n brandList: any;\r\n deliveryDays: string | undefined;\r\n VariantId: number;\r\n ShippingInfo: string;\r\n DeliveryMessage: string | undefined;\r\n coreDefaultMessage: string | undefined\r\n}\r\nconst GetBatchDeliveryMessage = (prductIdsAndTypes: IBatchDeliveryMessage[]): IBatchDeliveryMessage[] => {\r\n return prductIdsAndTypes?.map((product: IBatchDeliveryMessage) => {\r\n let deliveryByMessage: string | undefined = '';\r\n let deliveryByMessageRange = '';\r\n const productType = _getProductType(product.ShippingInfo);\r\n if (productType.toLowerCase() === \"core\") {\r\n deliveryByMessage = product.coreDefaultMessage;\r\n }\r\n else if (productType.toLowerCase() === \"drop ship\" || productType.toLowerCase() === \"small parcel\" || !deliveryByMessage) {\r\n let deliveryDays = product.deliveryDays;\r\n if (\r\n !deliveryDays &&\r\n product.brandList &&\r\n product.brandList?.length > 0) {\r\n if (product.Brand) {\r\n product.brandList?.map((brandList: IBrandListData) => {\r\n if (brandList?.brandName?.toLowerCase() === product.Brand) {\r\n deliveryDays =\r\n brandList.brandLeadtime !== undefined && brandList.brandLeadtime !== '' && brandList.brandLeadtime !== null\r\n ? brandList.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n }\r\n if (deliveryByMessage === '' && deliveryDays && deliveryDays !== '' && deliveryDays !== undefined) {\r\n const daysSpan = deliveryDays?.split('-');\r\n if (daysSpan && daysSpan[1] !== undefined && daysSpan.length) {\r\n daysSpan?.map((item: string, index: number) => {\r\n const date = new Date();\r\n const deliveryDate = date.setDate(date.getDate());\r\n if (parseInt(item, 10) > 0) {\r\n let numberOfDays = parseInt(item, 10);\r\n let newDate = deliveryDate;\r\n while (numberOfDays > 0) {\r\n newDate = date.setDate(date.getDate() + 1);\r\n if (dayjs(newDate).format('d') !== '0' && dayjs(newDate).format('d') !== '6') {\r\n numberOfDays--;\r\n }\r\n }\r\n deliveryByMessage = dayjs(newDate).format('MMM D');\r\n if (deliveryByMessageRange !== '') {\r\n deliveryByMessageRange = `${deliveryByMessageRange} to ${deliveryByMessage}`;\r\n } else {\r\n deliveryByMessageRange = deliveryByMessage;\r\n newDate = date.setDate(date.getDate() - parseInt(item[0], 10));\r\n }\r\n }\r\n });\r\n deliveryByMessage = deliveryByMessageRange;\r\n } else {\r\n deliveryByMessage = _deliveryMessage(deliveryDays);\r\n }\r\n }\r\n }\r\n return {\r\n ...product,\r\n DeliveryMessage: deliveryByMessage\r\n };\r\n });\r\n};\r\nexport default GetBatchDeliveryMessage;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport MsDyn365, { ICoreContext ,IGridSettings, IImageData, IImageSettings,Image } from '@msdyn365-commerce/core';\r\nimport { addThrottledEvent } from '@msdyn365-commerce-modules/utilities';\r\nimport { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IMfrmProductsCompareData } from './mfrm-products-compare.data';\r\nimport { IMfrmProductsCompareProps } from './mfrm-products-compare.props.autogenerated';\r\nimport { ProductCompareCarouselItem } from './components/product-compare-carousel-item';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\nimport { renderProductBadge } from '../../Utilities/get-product-badge';\r\nimport { parseBrandNameUnbxd } from '../../Utilities/get-product-brand';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport GetBatchDeliveryMessage, { IBatchDeliveryMessage } from '../../Utilities/get-delivery-message-batch';\r\nimport { getAttributeArrayValueByNameUnbxd, getAttributeValueByNameUnbxd, getunbxdAttributeNameByCRTName } from '../../Utilities/getAttributeUtils';\r\nimport Cookies from 'universal-cookie';\r\nimport { _getProductType } from '../../themes/mattressfirm/views/components/delivery-message/deliverymessage.component';\r\nimport { _getSoonestDeliveryDate } from '../../Utilities/product-search-result-utils';\r\nimport { IFetchedCategoryIds } from '../mfrm-product-recommendations/mfrm-product-recommendations';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport getUnbxdCollectionCompare, { GetUnbxdCollectionCompareDataInput, IGetUnbxdCollectionCompareDataData } from './get-unbxd-collection-compare-data.action';\r\nimport { IMFICartLine } from '../../actions/BatchCoreProductDataServiceEntities.g';\r\nimport getListOfCoreDeliveryMessage, { IMFIATPInventoryEntityPLPEx } from '../../Utilities/get-core-delivery-batch';\r\nimport { getZipCode } from '../../Utilities/get-zipcode';\r\nimport { BVRatingSummary } from '../../Utilities/components/BVRatingSummary';\r\nimport { getBVAttributeValuesUnbxd } from '../../Utilities/get-bv-attributes';\r\nimport { renderRating } from '../../Utilities/get-rating';\r\nimport { removeSpecialChars } from '../../Utilities/allRegex';\r\nimport { urlFallBackImage } from '../../Utilities/fallbackImageUrl';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n\r\nexport interface IMfrmProductsCompareViewProps extends IMfrmProductsCompareProps {\r\n carouselItems: React.ReactNode[] | null;\r\n mattributeHeadings: string[],\r\n compareProductsList: SimpleProductAndAttributes[],\r\n isDesktop: boolean,\r\n collectionDescription: string | undefined\r\n compareRef?: (node?: Element | null | undefined) => void\r\n}\r\nexport interface IMfrmAttributesList {\r\n RecordId: string | undefined;\r\n status: string | undefined;\r\n value: AttributeValue[] | undefined;\r\n}\r\nexport interface SimpleProductAndAttributes extends SimpleProduct {\r\n Attributes?: AttributeValue[] | undefined;\r\n Category?: IFetchedCategoryIds | undefined;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmProductsCompare component\r\n * @extends {React.PureComponent>}\r\n */\r\nexport const MfrmProductsCompare: React.FC> = props => {\r\n\r\n let resizeThrottledEventHandler: (event: Event) => void;\r\n const [compareData, setCompareData] = React.useState(undefined);\r\n const [isDesktop, setIsDesktop] = React.useState(false);\r\n const [deliveryMessages, setDeliveryMessages] = React.useState([]);\r\n const [coreDeliveryMessages, setCoreDeliveryMessages] = React.useState([]);\r\n const onInitial = React.useRef(true);\r\n const unbxdData = props.data.unbxdCollectionCompare?.result;\r\n let collectionDescription = unbxdData?.collectionDescription;\r\n const cookies = new Cookies();\r\n const zipcode = cookies.get('zip_code');\r\n const attrListName = props.context.app.config?.attributeNamesMapingCrtToUnbxd;\r\n const updateViewPort = (context: ICoreContext): void => {\r\n const viewport = _getViewPort(context);\r\n if (viewport === 'lg' || viewport === 'xl') {\r\n setIsDesktop(true);\r\n } else {\r\n setIsDesktop(false);\r\n }\r\n };\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=0&h=210&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=0&h=210&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=0&h=210&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const getVariantsList = (): any[] => {\r\n const variantsData: any[] = [];\r\n const currentProductId = unbxdData?.productId;\r\n if (currentProductId && currentProductId === props?.data?.product?.result?.RecordId) {\r\n unbxdData?.collectionData?.products.map((product: any) => {\r\n product?.variants?.map((variant: any, index: number) => {\r\n variantsData.push(variant);\r\n });\r\n });\r\n collectionDescription = unbxdData?.collectionDescription;\r\n }\r\n else if (compareData?.collectionData?.products) {\r\n compareData?.collectionData?.products.map((product: any) => {\r\n product?.variants?.map((variant: any, index: number) => {\r\n variantsData.push(variant);\r\n });\r\n });\r\n collectionDescription = compareData?.collectionDescription;\r\n }\r\n return variantsData;\r\n };\r\n const compareProductsList = getVariantsList();\r\n\r\n const callTealiumOnLoad = async () => {\r\n if (compareProductsList.length) {\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n const positions: string[] = [];\r\n const productPIds: string[] = [];\r\n const productsName: string[] = [];\r\n const productsCategory: string[] = [];\r\n const productsBrand: string[] = [];\r\n const productsVariant: string[] = [];\r\n const productsPrice: string[] = [];\r\n compareProductsList.slice(1).forEach((item: any, index: number) => {\r\n const retailVariantid = getAttributeValueByNameUnbxd(item, 'v_VariantId');\r\n const count = index + 1;\r\n positions.push(`${count}`);\r\n item?.ItemId && productPIds.push(item?.ItemId);\r\n item?.Name && productsName.push(item?.Name);\r\n item?.categoryPathId2.length && productsCategory.push(getAttributeArrayValueByNameUnbxd(item, 'categoryPathId2')?.at(-2)?.split('|')[1] ?? '');\r\n productsBrand.push(parseBrandNameUnbxd(item, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.brandBackofficeAttributePdp, attrListName) ?? '') || '');\r\n retailVariantid && productsVariant.push(retailVariantid?.toString());\r\n productsPrice.push(item?.v_Price?.toString());\r\n });\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n // eslint-disable-next-line security/detect-non-literal-fs-filename\r\n utag.link({\r\n event: 'product-impression',\r\n enhanced_action: 'product_impression',\r\n event_category: 'ecommerce',\r\n event_action: 'product impression',\r\n event_label: getPagePath() ?? '',\r\n event_noninteraction: 'true',\r\n product_impression_list_name: [`PDP Collection Compare`],\r\n product_impression_position: positions,\r\n product_impression_id: productPIds,\r\n product_impression_name: productsName,\r\n product_impression_category: productsCategory,\r\n product_impression_brand: productsBrand,\r\n product_impression_variant: productsVariant,\r\n product_impression_price: productsPrice\r\n });\r\n }\r\n }\r\n };\r\n\r\n const getPagePath = (): string => {\r\n return MsDyn365.isBrowser\r\n ? window.location.href.split(location.host)[1].includes('?')\r\n ? window.location.href.split(location.host)[1].split('?')[0]\r\n : window.location.href.split(location.host)[1]\r\n : '';\r\n };\r\n\r\n const getMattributeData = (attributes: any | undefined, uniqueHeadings: string[]): any => {\r\n const mattributeData: any = [];\r\n uniqueHeadings &&\r\n uniqueHeadings.length > 0 &&\r\n uniqueHeadings.map((item, index) => {\r\n const scoreAttribute = attributes && attributes[getunbxdAttributeNameByCRTName(`${item} score`?.toLowerCase(), attrListName) ?? ''];\r\n const mattributeValue = attributes && attributes[getunbxdAttributeNameByCRTName(`${item}`?.toLowerCase(), attrListName) ?? ''];\r\n const obj = {\r\n mattributeName: item,\r\n score: scoreAttribute,\r\n mattributeValue\r\n };\r\n mattributeData.push(obj);\r\n });\r\n return mattributeData;\r\n };\r\n\r\n const getUniqueMattributeData = (): string[] => {\r\n const mattributeHeadings: string[] = [];\r\n compareProductsList?.map((product: any) => {\r\n const spotlightAttributeKey = product && product[getunbxdAttributeNameByCRTName('PDP_Feature Spotlight_Sequence', attrListName) ?? ''];\r\n const spotlightValues = spotlightAttributeKey ?? undefined;\r\n if (spotlightValues !== undefined) {\r\n const spotlightValuesArr = spotlightValues && spotlightValues.split(',');\r\n spotlightValuesArr &&\r\n spotlightValuesArr.length > 0 &&\r\n spotlightValuesArr.map((item: any, index: number) => {\r\n const attribute = product && product[getunbxdAttributeNameByCRTName(item, attrListName) ?? ''];\r\n attribute && !!attribute && mattributeHeadings.push(item);\r\n });\r\n }\r\n });\r\n return [...new Set(mattributeHeadings)]?.sort((a, b) => a.toUpperCase() > b.toUpperCase() ? 1 : -1)?.sort((a: any, b: any) => {\r\n if (props.config.booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === a?.toUpperCase())) {\r\n return 1;\r\n } else if (props.config.booleanMattributes?.find(e => e?.mattributeName?.toUpperCase() === b?.toUpperCase())) {\r\n return -1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n };\r\n\r\n const getRatings = (attributes: any | undefined): React.ReactNode | undefined => {\r\n return attributes && renderRating(\r\n props.context,\r\n props.typeName,\r\n props.id,\r\n getBVAttributeValuesUnbxd(attributes, getunbxdAttributeNameByCRTName('BVAverageOverallRating', attrListName) ?? ''),\r\n getBVAttributeValuesUnbxd(attributes, getunbxdAttributeNameByCRTName('BVTotalReviewCount', attrListName) ?? ''),\r\n props.resources.ratingAriaLabel\r\n );\r\n };\r\n\r\n const _renderDeliveryMessage = (recordId: number | undefined, shippingInfo: string | undefined) => {\r\n if (!deliveryMessages || deliveryMessages.length < 1) {\r\n return <>;\r\n }\r\n let deliveryMessage: string | undefined = '';\r\n if (_getProductType(shippingInfo).toLowerCase() === 'core' && coreDeliveryMessages && coreDeliveryMessages.find((item: any) => Number(item.VariantRecordId) === recordId)) {\r\n const atpDeliveryMsg = coreDeliveryMessages.find((item: any) => Number(item.VariantRecordId) === recordId)?.deliveryMessage;\r\n if (atpDeliveryMsg && atpDeliveryMsg !== '') {\r\n deliveryMessage = atpDeliveryMsg;\r\n\r\n }\r\n }\r\n if (!deliveryMessage || deliveryMessage === '') {\r\n deliveryMessage = deliveryMessages?.find(msg => msg?.VariantId === recordId)?.DeliveryMessage;\r\n }\r\n\r\n return (\r\n
\r\n {props.resources.deliveryBy}\r\n
\r\n {deliveryMessage}\r\n {zipcode && <> to{zipcode}}\r\n
\r\n
\r\n );\r\n };\r\n\r\n const [compareRef, inView] = useInView({\r\n threshold: 0,\r\n triggerOnce: true\r\n });\r\n function renderImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n fallbackImageUrl?: string,\r\n altText?: string\r\n ): JSX.Element | null {\r\n if (!fallbackImageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl ? imageUrl : fallbackImageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings,\r\n fallbackImageUrl\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return ;\r\n }\r\n\r\n const _renderCaouselItems = (): React.ReactNode[] | null => {\r\n const uniqueHeadings = getUniqueMattributeData();\r\n const sortedArray = compareData?.variantIds ?? unbxdData?.variantIds;\r\n return sortedArray && compareProductsList?.sort((a: any, b: any) => sortedArray?.indexOf(a?.variantId) - sortedArray?.indexOf(b?.variantId))?.map((product: any, index: number) => {\r\n const queryBasedSelection = props?.context?.app?.config?.queryBasedVariantSelection;\r\n let productUrl = getProductPageUrlSync(removeSpecialChars(product?.Name!, props.context) || '', queryBasedSelection ? product.MasterProductId || product.variantId : product.variantId, props.context && props.context.actionContext, undefined);\r\n if (queryBasedSelection && product.MasterProductId) {\r\n const variantIdQueryParams = productUrl.includes('?') ? `&${variantQueryStringName}=${product.variantId}` : `?${variantQueryStringName}=${product.variantId}`;\r\n productUrl += variantIdQueryParams;\r\n }\r\n const productMattributeData = getMattributeData(product, uniqueHeadings);\r\n const comfort = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Comfort', attrListName)) ?? \"\";\r\n const sleepPosition = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Sleep Position', attrListName)) ?? \"\";\r\n const bestFor = props.config.sleepStyleOptions?.find(option => option.selectedSleepStyle === sleepPosition);\r\n const mattressType = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Product Type', attrListName)) ?? \"\";\r\n const heigth = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName('Height', attrListName)) ?? \"\";\r\n const brandName = parseBrandNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.brandBackofficeAttributePdp, attrListName) ?? '') || '';\r\n const title = brandName ? `${brandName} ${product?.Name}` : product?.Name ?? '';\r\n const comfortIcons = props.data.comfortTypesData.result;\r\n const badgeValue = getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.productBadgeAttribute, attrListName));\r\n const deliveryByMessage = _renderDeliveryMessage(Number(product?.variantId), getAttributeValueByNameUnbxd(product, getunbxdAttributeNameByCRTName(props?.context?.app?.config?.smallParcelAttributeKey, attrListName)) ?? '');\r\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\r\n const imageUrl = generateImageUrl(product?.PrimaryImageUrl, props.context.request.apiSettings);\r\n const fallBackImageUrl = urlFallBackImage(emptyPlaceHolderImage, product?.ItemId, props.context.actionContext.requestContext);\r\n return (\r\n : getRatings(product)}\r\n mattributeData={productMattributeData}\r\n productBadge={renderProductBadge(badgeValue, props?.context?.request)}\r\n deliveryMessage={deliveryByMessage}\r\n comfort={comfort}\r\n mattressType={mattressType}\r\n heigth={heigth}\r\n bestFor={bestFor?.sleepStyleDisplayName}\r\n product={product}\r\n brandName={brandName}\r\n context={props.context}\r\n comfortIcon={comfortIcons && comfortIcons[comfort] && comfortIcons[comfort]?.icon}\r\n booleanMattributes={props.config.booleanMattributes}\r\n />\r\n );\r\n });\r\n };\r\n\r\n const getDeliveryMessages = async (productIdsAndtype: IBatchDeliveryMessage[]) => {\r\n const data = GetBatchDeliveryMessage(productIdsAndtype);\r\n void getCoreProductsDelivery(productIdsAndtype);\r\n if (data) {\r\n setDeliveryMessages(data);\r\n }\r\n };\r\n const getCoreProductsDelivery = async (productIdsAndtype: IBatchDeliveryMessage[]) => {\r\n productIdsAndtype = productIdsAndtype.filter(product => _getProductType(product.ShippingInfo).toLowerCase() === 'core');\r\n const itemLines: IMFICartLine[] = productIdsAndtype?.map(product => {\r\n return {\r\n ItemId: product?.ItemId,\r\n Quantity: 1,\r\n VariantRecordId: product.VariantId.toString()\r\n };\r\n });\r\n if (itemLines && itemLines.length > 0) {\r\n const atpResponse = await getListOfCoreDeliveryMessage(props.context.actionContext, itemLines, getZipCode(props.context.actionContext));\r\n atpResponse !== undefined && setCoreDeliveryMessages(atpResponse);\r\n\r\n }\r\n };\r\n\r\n const UpdateProductsData = async () => {\r\n const currentProductId = unbxdData?.productId;\r\n if (!currentProductId || currentProductId !== props?.data?.product?.result?.RecordId) {\r\n // get data from dataAction\r\n const response: IGetUnbxdCollectionCompareDataData = await getUnbxdCollectionCompare(new GetUnbxdCollectionCompareDataInput(props.config, props?.data?.product?.result?.RecordId?.toString()), props.context.actionContext);\r\n if (response?.collectionData?.products) {\r\n setCompareData(response);\r\n } else {\r\n setCompareData(undefined);\r\n }\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n void UpdateProductsData();\r\n }, [props?.data?.product?.result?.RecordId]);\r\n\r\n React.useEffect(() => {\r\n if (compareProductsList && compareProductsList.length && compareProductsList.length >= 1) {\r\n const productIdsAndtype: IBatchDeliveryMessage[] = compareProductsList.map((product: any) => {\r\n return {\r\n ItemId: product?.ItemId,\r\n VariantId: Number(product?.variantId),\r\n brandList: props.context.app.config.brandList,\r\n coreDefaultMessage: props.context.app.config.defaultDeliveryMessage,\r\n deliveryDays: product[getunbxdAttributeNameByCRTName(props.context.app.config.leadTime, attrListName) ?? ''] ?? '',\r\n Brand: product[getunbxdAttributeNameByCRTName(props.context.app.config.brandBackofficeAttributePdp, attrListName) ?? ''] ?? '',\r\n ShippingInfo: product[getunbxdAttributeNameByCRTName(props.context.app.config.smallParcelAttributeKey, attrListName) ?? ''] ?? '',\r\n DeliveryMessage: \"\"\r\n };\r\n });\r\n void getDeliveryMessages(productIdsAndtype);\r\n }\r\n }, [compareData, props?.data?.product?.result?.RecordId, zipcode]);\r\n\r\n React.useEffect(() => {\r\n if (inView) {\r\n void callTealiumOnLoad();\r\n }\r\n }, [inView]);\r\n\r\n React.useEffect(() => {\r\n if (MsDyn365.isBrowser) {\r\n resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => updateViewPort(props.context));\r\n }\r\n return () => {\r\n MsDyn365.isBrowser && window.removeEventListener('resize', resizeThrottledEventHandler!, false);\r\n };\r\n }, [props.context.request.gridSettings, MsDyn365.isBrowser && window.innerWidth]);\r\n\r\n React.useEffect(() => {\r\n if (onInitial.current) {\r\n onInitial.current = false;\r\n } else {\r\n void callTealiumOnLoad();\r\n }\r\n }, [props?.data?.product?.result?.RecordId]);\r\n\r\n if (!compareProductsList?.length) {\r\n return <>;\r\n }\r\n return props.renderView({\r\n ...props,\r\n carouselItems: compareProductsList ? _renderCaouselItems() : null,\r\n mattributeHeadings: getUniqueMattributeData(),\r\n compareProductsList: compareProductsList,\r\n isDesktop: isDesktop,\r\n collectionDescription,\r\n compareRef: compareRef\r\n });\r\n};\r\n\r\nexport default MfrmProductsCompare;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { Heading } from '@msdyn365-commerce-modules/utilities';\r\nimport { IMfrmProductsCompareViewProps } from './mfrm-products-compare';\r\nimport { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport Carousel from 'mfcl/Carousel';\r\n\r\nexport default (props: IMfrmProductsCompareViewProps) => {\r\n\r\n const { mattributeHeadings, carouselItems, compareRef, isDesktop, collectionDescription } = props;\r\n const { sleepExpertModuleSlot } = props.slots;\r\n if (!carouselItems?.length) {\r\n props.context.telemetry.error('Product Compare is empty, module wont render.');\r\n return null;\r\n }\r\n const mattributeIcons = props.data.productBenefitsData.result;\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
    \r\n
  • Price
  • \r\n
  • Deliver By
  • \r\n
  • Comfort
  • \r\n
  • Best For
  • \r\n
  • Mattress Type
  • \r\n
  • Height
  • \r\n
\r\n
\r\n
\r\n
    \r\n {mattributeHeadings.map((heading) =>\r\n (
  • \r\n {`${heading}\r\n {heading}\r\n
  • )\r\n )}\r\n
\r\n
\r\n
\r\n
\r\n {carouselItems && carouselItems[0]}\r\n
\r\n
\r\n {isDesktop ? \r\n {carouselItems && carouselItems.length > 1 && carouselItems.slice(1)}\r\n \r\n :\r\n carouselItems && carouselItems.length > 1 && carouselItems.slice(1).map((item) => {\r\n return item;\r\n })}\r\n
\r\n
\r\n
{sleepExpertModuleSlot}
\r\n
\r\n );\r\n};\r\n","import { ICoreContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../../../../../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { _getSoonestDeliveryDate, _makeDeliveryMessage } from '../../../../../Utilities/product-search-result-utils';\r\nimport { ProductSearchResultExtended } from '../../../custom-components/product-search-result-items';\r\nimport CustomSkeleton from '../../../custom-components/CustomSkeleton';\r\ninterface IDeliveryMessage {\r\n product?: ProductSearchResultExtended;\r\n context: ICoreContext>;\r\n isMasterProduct?: boolean;\r\n attributeValues?: AttributeValue[];\r\n extensionProperties?: CommerceProperty[];\r\n lowestPriceVariantRecordId?: string;\r\n}\r\n\r\n//TODO: common method; move to general utility file. AND change return type to an Enumeration\r\nexport const _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\nexport const computeItemLines = (\r\n product: IDeliveryMessage['product'],\r\n defaultVariantId: number | undefined,\r\n lowestPriceVariantRecordId: string | undefined\r\n) => {\r\n if (product?.IsMasterProduct) {\r\n if (defaultVariantId && defaultVariantId !== 0) {\r\n return defaultVariantId.toString();\r\n }\r\n if (lowestPriceVariantRecordId && lowestPriceVariantRecordId !== '') {\r\n return lowestPriceVariantRecordId;\r\n }\r\n }\r\n return product?.RecordId.toString();\r\n};\r\n\r\nconst DeliveryMessage: React.FC = ({\r\n product,\r\n context,\r\n attributeValues,\r\n extensionProperties,\r\n lowestPriceVariantRecordId\r\n}) => {\r\n let productDeliveryMessage = '';\r\n const { app } = context;\r\n const shippingInformationSmall = attributeValues && attributeValues.find(\r\n (attr: AttributeValue) => attr.Name?.trim() === app.config.smallParcelAttributeKey\r\n )?.TextValue?.toLowerCase();\r\n\r\n const defaultVariantShippingInformation = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantShippingInformation\"\r\n )?.Value?.StringValue;\r\n\r\n if ((_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Core') {\r\n productDeliveryMessage = product?.deliveryByMessage ?? '';\r\n } else if ((\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Small Parcel' ||\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Drop Ship'\r\n )) {\r\n let deliveryDays =\r\n attributeValues && attributeValues.find(attr => attr.Name?.trim() === app.config.leadTime)?.TextValue;\r\n if (\r\n (deliveryDays === '' || deliveryDays === undefined || deliveryDays === null) &&\r\n app.config.brandList &&\r\n app.config.brandList.length > 0\r\n ) {\r\n const brand =\r\n attributeValues &&\r\n attributeValues.find(\r\n attr =>\r\n app.config.brandBackofficeAttributePlp &&\r\n attr.Name?.trim() === app.config.brandBackofficeAttributePlp\r\n )?.TextValue?.toLowerCase();\r\n\r\n if (brand !== undefined && brand !== null && brand !== '') {\r\n app.config.brandList.map((singleBrand: IBrandListData) => {\r\n if (singleBrand.brandName.toLowerCase() === brand) {\r\n deliveryDays =\r\n singleBrand.brandLeadtime !== undefined &&\r\n singleBrand.brandLeadtime !== '' &&\r\n singleBrand.brandLeadtime !== null\r\n ? singleBrand.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n deliveryDays = app.config.brandList[0].brandLeadtime;\r\n }\r\n if (deliveryDays && productDeliveryMessage === '') {\r\n productDeliveryMessage = _makeDeliveryMessage(deliveryDays);\r\n }\r\n }\r\n\r\n return productDeliveryMessage ? (\r\n
\r\n {productDeliveryMessage}\r\n
\r\n ) : ;\r\n};\r\n\r\nexport default DeliveryMessage;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-products-compare'] = {\n c: () => require('partner/modules/mfrm-products-compare/mfrm-products-compare.tsx'),\n $type: 'containerModule',\n da: [{name:'comfortTypesData', path:'data-actions/get-comfort-type.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productBenefitsData', path:'data-actions/get-product-benefits-data.action', runOn: 0},{name:'productCompareBuyboxStateSharing', path:'actions/product-compare-buybox-state-sharing', runOn: 0},{name:'productsCompareIds', path:'actions/fetch-choose-your-foundation-database.action', runOn: 0},{name:'unbxdCollectionCompare', path:'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-products-compare',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-products-compare'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/fetch-choose-your-foundation-database.action';\n let dataAction = require('partner/actions/fetch-choose-your-foundation-database.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/product-compare-buybox-state-sharing';\n let dataAction = require('partner/actions/product-compare-buybox-state-sharing');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-comfort-type.action';\n let dataAction = require('partner/data-actions/get-comfort-type.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-product-benefits-data.action';\n let dataAction = require('partner/data-actions/get-product-benefits-data.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action';\n let dataAction = require('partner/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-products-compare|mfrm-products-compare'] = {\n c: () => require('partner/modules/mfrm-products-compare/mfrm-products-compare.view.tsx'),\n cn: '__local__-__local__-mfrm-products-compare'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.allSettled` method\n// https://tc39.es/ecma262/#sec-promise.allsettled\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (error) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: error };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\n// TODO: Remove from `core-js@4`\nrequire('../modules/es.promise.all-settled.js');\n","module.exports = React;","module.exports = ReactDOM;"],"names":["emailRegex","emailValue","test","removeSpecialChars","str","ctx","_ctx$request$app","request","app","config","removeSpecialCharsPDP","replace","removeSpecialCharsFromURLPath","_ctx$request$app2","_decodeURIComponent","decodeURIComponent","split","customerInfoPhoneRegex","inputRegexObj","nameRegex","addressInputRegex","phoneNumerRegex","cartDeliveryMsgRegex","BVRatingSummary","_ref","itemId","onClick","variantId","hideReadReviewsButton","dataBvProductIdAttr","setDataBvProductIdAttr","useState","wrapper","useRef","interval","numReviews","setNumReviews","useEffect","pollInterval","window","setInterval","_wrapper$current","numReviewsHTML","current","querySelector","innerHTML","match","clearInterval","style","display","React","onMouseEnter","button","Array","from","document","querySelectorAll","find","outerHTML","onMouseLeave","ref","urlFallBackImage","imageUrl","apiSettings","fallbackImageUrl","getFallbackImageUrl","async","cartLines","zipCode","_data$ATPInventoryPLP","data","fetchCoreDeliveryListAction","FetchCoreDeliveryListInput","ATPInventoryPLPData","map","deliveryItem","i","deliveryMessage","Available","undefined","ATPQuantity","parseInt","date","Date","today","dayjs","now","format","deliveryDate","SlotDate","setDate","getDate","requestContext","defaultDeliveryMessage","_objectSpread","tz","utc","isBetween","defaultImageSettings","viewports","xs","q","w","h","disableLazyLoad","parseBadgeData","badgeData","_startTime","_endTime","dataSegments","scheduleStart","scheduleEnd","badgeType","parsedScheduleStart","startDate","startTime","parsedScheduleEnd","endDate","endTime","e","startMoment","endMoment","startMomentFormatted","endMomentFormatted","isValid","baseUrl","baseImageUrl","substring","length","removed$","src","toLowerCase","alt","start","convertTimeZone","end","time","local","buildProductBadge","parsedBadgeData","Image","className","gridSettings","altText","title","imageSettings","renderProductBadge","attributeName","finalizedBadges","badge","parsedBadge","context","MsDyn365","isBrowser","innerWidth","sm","md","lg","getAttributeByName","attributeValues","keyValue","currAttribute","Name","trim","getAttributeValueByNameUnbxd","list","getAttributeArrayValueByNameUnbxd","getunbxdAttributeNameByCRTName","crtName","mapList","_mapList$find","isArray","attr","CRTName","UnbxdName","FetchChooseYourFoundationDatabaseInput","constructor","jsonSrc","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","id","args","_this$cartLines","sort","a","b","VariantRecordId","item","_item$VariantRecordId","toString","_input$zipCode","atpInput","Weeks","InventoryType","StoreId","RequestedDate","ZipCode","getZipCode","ItemLines","CustomerRequestTime","Id","NoOfPriorityDC","mFIATPInventoryPLPAsync","callerContext","GetComfortTypesData","comfortTypesDataUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getComfortTypesDataUrl","jsonUrl","comfortTypesDataJsonUrl","res","inputData","GetProductBenefitsData","productBenefitsDataUrl","getProductBenefitsDataUrl","shouldDefaultSet","SelectedVariantInput","productId","channelId","matchingDimensionValues","parseDefaultDimensionsData","defaultValue","defaultDimensions","forEach","dimensionData","dimensionTypeString","dimensionValue","dimensionType","push","console","log","getDefaultVariantId","masterId","productSearchCriteria","Ids","Context","ChannelId","CatalogId","catalogId","IncludeAttributes","SearchCondition","productSearchResults","searchByCriteriaAsync","telemetry","debug","JSON","stringify","_productSearchResults","_productSearchResults2","defaultVariantId","ExtensionProperties","property","Key","Value","LongValue","error","createObservableDataAction","_input$matchingDimens","_getByIdResponse","queryBasedVariantSelection","getQueryParamsFromQueryByName","URL","location","href","url","requestUrl","variantQueryStringName","getByIdResponse","_await$getDefaultVari","getByIdAsync","Number","isNaN","_await$getDefaultVari2","MasterProductId","RecordId","baseProduct","product","originalDimensionLength","Dimensions","_product$Dimensions","_productSpecification","baseProductHadUnmatchedDimension","dimension","matchedTargetDimension","targetDimension","DimensionTypeValue","DimensionValue","actionInput","AttributesForSelectedVariantInput","defaultValues","getAttributesForSelectedVariant","catch","_data$Name","TextValue","parsedDefaultData","productPreSelectionDimensions","_product$Dimensions2","asyncCalls","_product","dimensionValues","getDimensionValuesAsync","queryResultSettings","filter","value","_parsedDefaultData$fi","defaultValueToFind","defaultData","defaultDimension","availableDimensionValue","_availableDimensionVa","_availableDimensionVa2","DimensionId","fullDimension","DimensionValues","Promise","allSettled","mappedDimensions","variants","getVariantsByDimensionValuesAsync","newImageUrl","generateProductImageUrl","PrimaryImageUrl","getSelectedProductIdFromActionInput","Error","GetUnbxdCollectionCompareDataInput","configs","recordId","Msdyn365All","variantIdNumber","unbxdApiKey","unbxdSiteKey","collectionJson","fetchChooseYourFoundationDatabaseDataAction","collectionDescription","collectionData","variantIds","response","baseURL","_collectionJson$find","_collectionJson$find2","_variantIds","_variantIds2","_variantIds3","_response","mattressVariantReqId","mattressComparisonReqIdList","unshift","collectionCompareIds","index","_variantIds4","unbxdUrl","ProductMattribute","props","mattributeName","mattributeScore","mattributeValue","booleanMattributes","mattributescore","m","_m$mattributeName","_","key","ProductCompareCarouselItem","brandName","productUrl","price","image","basePrice","productBadge","ratings","mattributeData","comfort","mattressType","heigth","bestFor","comfortIcon","callTealiumOnClick","_getAttributeArrayVal","_getAttributeArrayVal2","productName","variantID","productCategory","at","utag","link","event","enhanced_action","event_category","event_action","event_label","ItemId","event_noninteraction","product_list_name","product_position","product_id","product_name","product_category","product_brand","product_variant","scrollToBuybox","currentProduct","getElementById","scrollIntoView","behavior","renderCompareCard","productPrice","BasePrice","AdjustedPrice","CustomerContextualPrice","renderPrice","_mattributeData$sort","_e$mattributeName","_a$mattributeName","toUpperCase","_e$mattributeName2","_b$mattributeName","mattribute","score","renderMattributes","prductIdsAndTypes","deliveryByMessage","deliveryByMessageRange","productType","_getProductType","ShippingInfo","coreDefaultMessage","_product$brandList","deliveryDays","_product$brandList2","brandList","Brand","_brandList$brandName","brandLeadtime","_deliveryDays","daysSpan","numberOfDays","newDate","_deliveryMessage","DeliveryMessage","MfrmProductsCompare","_props$data$unbxdColl","_props$context$app$co","_props$data5","_props$data6","_props$data7","resizeThrottledEventHandler","compareData","setCompareData","isDesktop","setIsDesktop","deliveryMessages","setDeliveryMessages","coreDeliveryMessages","setCoreDeliveryMessages","onInitial","unbxdData","unbxdCollectionCompare","result","zipcode","Cookies","get","attrListName","attributeNamesMapingCrtToUnbxd","xl","lazyload","compareProductsList","getVariantsList","_props$data","_compareData$collecti","variantsData","currentProductId","_unbxdData$collection","products","_product$variants","variant","_compareData$collecti2","_product$variants2","callTealiumOnLoad","_getPagePath","positions","productPIds","productsName","productsCategory","productsBrand","productsVariant","productsPrice","slice","_getunbxdAttributeNam","_props$context","_item$v_Price","retailVariantid","count","categoryPathId2","parseBrandNameUnbxd","brandBackofficeAttributePdp","v_Price","getPagePath","product_impression_list_name","product_impression_position","product_impression_id","product_impression_name","product_impression_category","product_impression_brand","product_impression_variant","product_impression_price","host","includes","getUniqueMattributeData","_ref3","mattributeHeadings","_getunbxdAttributeNam4","spotlightAttributeKey","spotlightValues","spotlightValuesArr","_getunbxdAttributeNam5","attribute","Set","_props$config$boolean","_props$config$boolean2","compareRef","inView","useInView","threshold","triggerOnce","renderImage","img","fallBackSrc","imageProps","cropFocalRegion","Object","assign","imageFallbackOptimize","loadFailureBehavior","getCoreProductsDelivery","_productIdsAndtype","itemLines","productIdsAndtype","Quantity","VariantId","atpResponse","getListOfCoreDeliveryMessage","actionContext","_props$data3","_props$data4","_response$collectionD","getUnbxdCollectionCompare","UpdateProductsData","GetBatchDeliveryMessage","getDeliveryMessages","_getunbxdAttributeNam9","_product2","_getunbxdAttributeNam10","_product3","_getunbxdAttributeNam11","leadTime","smallParcelAttributeKey","addThrottledEvent","viewport","_getViewPort","updateViewPort","removeEventListener","renderView","carouselItems","_renderCaouselItems","_compareData$variantI","_compareProductsList$","uniqueHeadings","sortedArray","indexOf","_props$context2","_getAttributeValueByN","_getAttributeValueByN2","_props$config$sleepSt","_getAttributeValueByN3","_getAttributeValueByN4","_getunbxdAttributeNam8","_props$context3","_product$Name","_props$context4","_getAttributeValueByN5","_props$context5","_props$context$app$co2","_props$data2","_props$context6","_comfortIcons$comfort","queryBasedSelection","getProductPageUrlSync","variantIdQueryParams","productMattributeData","getMattributeData","attributes","_getunbxdAttributeNam2","_getunbxdAttributeNam3","_ref2","obj","sleepPosition","sleepStyleOptions","option","selectedSleepStyle","comfortIcons","comfortTypesData","badgeValue","productBadgeAttribute","_renderDeliveryMessage","shippingInfo","_coreDeliveryMessages","atpDeliveryMsg","_deliveryMessages$fin","msg","resources","deliveryBy","emptyPlaceHolderImage","placeholderImageName","generateImageUrl","fallBackImageUrl","v_AdjustedPrice","showBVRatings","renderRating","typeName","getBVAttributeValuesUnbxd","_getunbxdAttributeNam6","_getunbxdAttributeNam7","ratingAriaLabel","sleepStyleDisplayName","icon","sleepExpertModuleSlot","slots","mattributeIcons","productBenefitsData","Heading","heading","text","RichTextComponent","description","_mattributeIcons$head","Carousel","ariaLabel","layoutGap","controlStyle","variableWidth","controlAlignment","controlClass","itemsToShow","hideIndicators","disableEndButtons","hideControls","disableControls","shippingInformation","computeItemLines","lowestPriceVariantRecordId","IsMasterProduct","_attributeValues$find","_extensionProperties$","extensionProperties","productDeliveryMessage","shippingInformationSmall","_attr$Name","defaultVariantShippingInformation","StringValue","_product$deliveryByMe","_attributeValues$find2","_attr$Name2","_attributeValues$find3","brand","_attr$Name3","brandBackofficeAttributePlp","singleBrand","_makeDeliveryMessage","CustomSkeleton","type","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","$","call","aCallable","newPromiseCapabilityModule","perform","iterate","target","stat","forced","iterable","C","capability","f","resolve","reject","promiseResolve","values","counter","remaining","promise","alreadyCalled","then","status","reason","module","exports","ReactDOM"],"sourceRoot":""}