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EAASC,KAAU,IAAA8L,EAAAC,EACnC,MAAMlB,EAAiB,QAAXiB,EAAG7iB,gBAAQ,IAAA6iB,OAAA,EAARA,EAAUhB,cAAc,UACvCD,EAAOzT,KAAO,kBACdyT,EAAOpnC,OAAQ,EACfonC,EAAOmB,OAAQ,EACfnB,EAAO/T,IAAMpX,EACbmrB,EAAO/0B,GAAK,uBACRiL,SACAA,OAAO2qB,YAAc,KACjBh2B,KAAKi2B,gBAAiB,EACtB5L,MAGR8K,EAAOoB,iBAAiB,SAAUz/B,IAC9BwzB,EAAOxzB,MAEH,QAARu/B,EAAA9iB,gBAAQ,IAAA8iB,GAAM,QAANA,EAARA,EAAUZ,YAAI,IAAAY,GAAdA,EAAgBX,YAAYP,OC5GjC,SAASqB,EAA8B/zB,GAC1C,OAAO,IAAIg0B,EAAAA,aAAyC,UAAWh0B,EAAQ,+BDavEoB,EAAAA,EAAAA,IAAA,CADC3D,EAAAA,IAAM,+BAsDP2D,EAAAA,EAAAA,IAAA,CADC3D,EAAAA,IAAM,+BC9DX,MAIaw2B,GAA6BtuB,EAAAA,EAAAA,IAA2B,CACjElI,OAA6Cy2B,EAAAA,iBAC7Cx2B,MAN2CkI,GACpCmuB,EAA8B,IAAIlC,KAQ7C,wBCxBAsC,EAAOC,QAAU3yB,2BCAjB0yB,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/analytics/clickTrack.ts?bce2","webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/cart-utils.ts?6ba1","webpack://mattressfirm/./src/Utilities/constants.ts?8bdf","webpack://mattressfirm/./src/Utilities/emtpyChecker.ts?e2f5","webpack://mattressfirm/./src/Utilities/enum.ts?dc36","webpack://mattressfirm/./src/Utilities/get-bv-attributes.ts?f55a","webpack://mattressfirm/./src/Utilities/get-html-parser-value.ts?1fb6","webpack://mattressfirm/./src/Utilities/get-zipcode.ts?4f03","webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","webpack://mattressfirm/./src/actions/complete-your-bed-pillow.action.ts?db7f","webpack://mattressfirm/./src/actions/complete-your-bed-protector.action.ts?82b2","webpack://mattressfirm/./src/actions/EyebrowMessageDataServiceEntities.g.ts?c30c","webpack://mattressfirm/./src/actions/EyebrowMessageDataActionExtension.g.ts?1765","webpack://mattressfirm/./src/actions/get-eyebrow-message.action.ts?b0a0","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/actions/product-compare-buybox-state-sharing.ts?5126","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/common/components/error-boundary.tsx?6c0c","webpack://mattressfirm/./src/common/cookies/cookie-utils.ts?68f7","webpack://mattressfirm/./src/data-actions/buybox-get-dimension-pricing-action.ts?1fcd","webpack://mattressfirm/./src/data-actions/buybox-get-dimension-variants-availability-action.ts?fbe8","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/data-actions/store-selector-state-data-action.ts?6df6","webpack://mattressfirm/./src/data-actions/utilities/utils.ts?7452","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-call-chat.tsx?d8c6","webpack://mattressfirm/./src/modules/mfrm-buybox/list-page-state-buybox.ts?792c","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-size-component.tsx?61da","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-size-redesign-component.tsx?fe1b","webpack://mattressfirm/./src/Utilities/get-customized-variant-name.ts?0a2b","webpack://mattressfirm/./src/modules/mfrm-buybox/components/dropdown/dropdown.tsx?7f62","webpack://mattressfirm/./src/modules/mfrm-buybox/components/listing/listing.tsx?f7d9","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-height-foundation-redesign-component.tsx?0fe1","webpack://mattressfirm/./src/modules/mfrm-buybox/components/addtocart.tsx?6747","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-add-to-cart.tsx?1948","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-view-cart-link.tsx?5f11","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-social-share.tsx?5cfe","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-find-in-store.tsx?4a1a","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/sleep-expert-summary-component.tsx?b78e","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-sleep-expert-summary.tsx?1d11","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.props.autogenerated.ts?86c0","webpack://mattressfirm/./src/modules/mfrm-buybox/components/progressive-leasing-estimator.tsx?83c4","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-progressive-leasing-estimator.tsx?bad7","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-financing-per-month.tsx?dd8b","webpack://mattressfirm/./src/modules/mfrm-buybox/mfrm-buybox.view.tsx?d135","webpack://mattressfirm/./src/modules/mfrm-buybox/components/buybox-product-configure-mfrm.tsx?77c4","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/CustomSkeleton/index.tsx?ef9d","webpack://mattressfirm/./src/themes/mattressfirm/custom-components/financing-per-month-component.tsx?fa70","webpack://mattressfirm/./lib/mfrm-buybox/module-registration.js?d206","webpack://mattressfirm/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://mattressfirm/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://mattressfirm/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { callUtagLink } from \"./utagCaller\";\r\n\r\nexport interface IUtagPromoConfig {\r\n promotion_impression_name?: string[];\r\n promotion_impression_id?: string[];\r\n promotion_impression_creative?: string[];\r\n promotion_impression_position?: (string | undefined)[];\r\n promotion_name?: string[];\r\n promotion_id?: string[];\r\n promotion_creative?: string[];\r\n promotion_position?: (string | undefined)[];\r\n}\r\n\r\nexport interface IUtagGeneralConfig {\r\n enhanced_action?: string | undefined;\r\n}\r\nexport interface ICustomerConfig {\r\n customer_email?: string;\r\n}\r\nexport interface IProductConfig {\r\n product_id?: string[];\r\n product_name?: string[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n product_list_name?: string[];\r\n product_position?: (number | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n checkout_step?: string;\r\n}\r\nexport interface IProductImpressionConfig {\r\n product_impression_brand?: (string | undefined)[];\r\n product_impression_list_name?: (string | undefined)[];\r\n product_impression_id?: string[];\r\n product_impression_name?: string[];\r\n product_impression_category?: string[];\r\n product_impression_variant?: (string | undefined)[];\r\n product_impression_position?: number[];\r\n product_impression_price?: number[];\r\n}\r\nexport interface IAnalyticsConfiguration {\r\n event?: string | null;\r\n eventName?: string | null;\r\n eventCategory?: string | null;\r\n eventAction?: string | null;\r\n eventLabel?: string | null;\r\n eventType?: string | null;\r\n eventNoninteraction?: string;\r\n enhancedAction?: string | null;\r\n searchTerm?: string | undefined | null;\r\n searchType?: string | undefined | null;\r\n generalConfig?: IUtagGeneralConfig;\r\n promoConfig?: IUtagPromoConfig;\r\n productConfig?: IProductConfig;\r\n customerConfig?: ICustomerConfig;\r\n productImpressionConfig?: IProductImpressionConfig;\r\n}\r\n\r\nexport const fireAnalyticsLink = ({\r\n searchTerm = null,\r\n searchType = null,\r\n eventName = null,\r\n eventCategory = null,\r\n eventAction = null,\r\n eventLabel = null,\r\n eventType = null,\r\n eventNoninteraction = 'false',\r\n enhancedAction = null,\r\n generalConfig = {},\r\n promoConfig = {},\r\n productConfig = {},\r\n customerConfig = {},\r\n productImpressionConfig = {}\r\n}: IAnalyticsConfiguration) => {\r\n void callUtagLink({\r\n ...generalConfig,\r\n ...promoConfig,\r\n ...productConfig,\r\n ...customerConfig,\r\n ...productImpressionConfig,\r\n event: eventName,\r\n event_category: eventCategory,\r\n event_action: eventAction,\r\n event_label: eventLabel,\r\n event_type: eventType,\r\n event_noninteraction: eventNoninteraction,\r\n enhanced_action: enhancedAction,\r\n search_term: searchTerm,\r\n search_type: searchType\r\n });\r\n};","import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n core_item_flag?: string | null;\r\n funnel_type?: string | null;\r\n ga_title?: string | null;\r\n ga_location?: string | null;\r\n order_quantity?: string | null;\r\n master_customer_code?: string | null;\r\n order_number?: string | null;\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if('utag' in window) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","import MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\r\nimport {IProductDetails,IProductBonusItems, IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {IMFIBonusItemsResponse, IMFIGetBonusCouponsDetailsResponse} from '../actions/BonusItemDataServiceEntities.g';\r\nimport { SimpleProduct, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { setCookie } from '../common/cookies/cookie-utils';\r\nimport { LocalStorageKeys, MFRMProductTypes } from './enum';\r\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { IMfrmAddress } from '../modules/mfrm-checkout-shipping-address';\r\nimport { ICoreProductsCartData } from '../themes/mattressfirm/views/checkout.view';\r\n\r\nexport interface IMFRMDateGroupedProducts {\r\n dateStr: string;\r\n days?: string;\r\n productVariantRecordIds: number[];\r\n productItemIds: string[];\r\n productsType: string;\r\n}\r\n\r\nexport interface IExpressFlow {\r\n paymentEdit: boolean\r\n}\r\n\r\nexport interface ICartProductPrice {\r\n variantRecordId?: number;\r\n price?: number;\r\n}\r\n\r\n/** interface for parcel inventory details */\r\nexport interface IParcelInventoryDetails {\r\n itemId: string | undefined;\r\n location: string | undefined;\r\n productId: string | undefined;\r\n quantity: string | undefined;\r\n}\r\nexport interface ICartIconData {\r\n iconUrl?: string;\r\n altText?: string;\r\n ariaLabel?: string;\r\n}\r\nexport interface IEyeBrowIcon {\r\n iconName?: string;\r\n iconURL?: string;\r\n}\r\n\r\nconst getSetLocalStorage = (key: string, getSet: string, valueToSet?: any, returnType?: any) => {\r\n // The type of the value to return (must be added).\r\n if (MsDyn365.isBrowser) {\r\n switch (getSet) {\r\n case 'set':\r\n return localStorage.setItem(key, JSON.stringify(valueToSet || returnType));\r\n case 'get':\r\n const storedValue = localStorage.getItem(key);\r\n try {\r\n return storedValue ? JSON.parse(storedValue) : (returnType ?? \"\");\r\n } catch {\r\n // JSON.parse will throw an error If it's stored as string; return string value in that case\r\n return storedValue;\r\n }\r\n case 'remove':\r\n return localStorage.removeItem(key);\r\n default:\r\n return returnType;\r\n }\r\n } else {\r\n return returnType;\r\n }\r\n};\r\n\r\nexport const getSetProductData = (getSet: string, products?: IProductDetails[]) => {\r\n products?.length && products.length > 0 && setCoreProductCookie(products); // Set cookie if it has core products\r\n return getSetLocalStorage('product_details', getSet, products, []);\r\n};\r\n\r\n// Following function sets cookie to check if cart has core item; Cookie is needed to access it on server side for skeleton on checkout\r\nconst setCoreProductCookie = (products: IProductDetails[]) => {\r\n for (const psp of products) {\r\n if (psp.typeOfProduct.toLowerCase().trim() === MFRMProductTypes.core) {\r\n setCookie('has-core-product', true);\r\n return;\r\n }\r\n }\r\n setCookie('has-core-product', false);\r\n};\r\n\r\nexport const getSetProductSpec = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_specification', getSet, products, []);\r\n};\r\n\r\nexport const getSetPromoCodeApplyList = (getSet: string) => {\r\n return getSetLocalStorage('promo_code_apply_list', getSet, [], []);\r\n};\r\n\r\nexport const getSetPromoCode = (getSet: string) => {\r\n return getSetLocalStorage('promoCode', getSet, [], []);\r\n};\r\n\r\nexport const getSetGrandTotal = (getSet: string, total?: string) => {\r\n return getSetLocalStorage('grand_total', getSet, total, 0);\r\n};\r\n\r\nexport const getSetBonusItemProd = (getSet: string, globalBonusItems?: IMFIBonusItemsResponse[])=>{\r\n return getSetLocalStorage('BonusItemProduct', getSet, globalBonusItems, []);\r\n};\r\n\r\nexport const getSetSelectedBonusItem = (getSet: string, bonusItemArray?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('selectedBonasItems', getSet, bonusItemArray, []);\r\n};\r\n\r\nexport const getSetBonusCouponDetail = (getSet: string, getCoupons?: IMFIGetBonusCouponsDetailsResponse[])=>{\r\n return getSetLocalStorage('bonusCouponsDetail', getSet, getCoupons, []);\r\n};\r\n\r\nexport const getSetPrevBonasModalState = (getSet: string, previousBonasModal?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('previousBonasModalState', getSet, previousBonasModal, []);\r\n};\r\n\r\nexport const getSetBonusItemBrandName = (getSet: string, bonusItemsBrandName?: IProductBonusWithBrandName[]) => {\r\n return getSetLocalStorage('bonusItmesWithBrand', getSet, bonusItemsBrandName, []);\r\n};\r\n\r\nexport const getSetDateGroupedProducts = (getSet: string, products?: IMFRMDateGroupedProducts[]) => {\r\n return getSetLocalStorage('date_grouped_products', getSet, products, []);\r\n};\r\n\r\nexport const getSetExpressFlow = (getSet: string, express?: IExpressFlow) => {\r\n return getSetLocalStorage('express_flow', getSet, express, []);\r\n};\r\nexport const getSetWmapCartLines = (getSet: string, products?: { product: SimpleProduct; count: number }[]) => {\r\n return getSetLocalStorage('wmapCartLines', getSet, products, []);\r\n};\r\n\r\nexport const getSetCartProductPrice = (getSet: string, priceDetails?: ICartProductPrice[]) => {\r\n return getSetLocalStorage('cart_product_price', getSet, priceDetails, []);\r\n};\r\n\r\nexport const getSetParcelInventoryData = (getSet: string, details?: IParcelInventoryDetails[]) => {\r\n return getSetLocalStorage('parcel_inventory_details', getSet, details, []);\r\n};\r\n\r\nexport const getSetDropshipLatestDeliveryMsg = (getSet: string, msg?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.DropshipLatestDeliveryMsg, getSet, msg, '');\r\n};\r\n\r\nexport const getSetParcelLatestDeliveryMsg = (getSet: string, msg?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.ParcelLatestDeliveryMsg, getSet, msg, '');\r\n};\r\n\r\nexport const getSetCustomerPhone = (getSet: string, phone?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.CustomerPhone, getSet, phone, '');\r\n};\r\n\r\nexport const getSetSelectedDeliveryService = (getSet: string, phone?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.SelectedDeliveryService, getSet, phone, '');\r\n};\r\n\r\nexport const getSetCustomerBillingSameDelivery = (getSet: string, isSame?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.CustomerBillingSameDelivery, getSet, isSame, '');\r\n};\r\n\r\nexport const getSetRecycleFee = (getSet: string, fee?: string) => {\r\n return getSetLocalStorage(LocalStorageKeys.RecycleFee, getSet, fee, '');\r\n};\r\n\r\nexport const getSetSelectedDeliverySlot = (getSet: string, slot?: string) => {\r\n return getSetLocalStorage('selected_delivery_slot ', getSet, slot, '');\r\n};\r\n\r\nexport const getSetSelectedDeliveryDate = (getSet: string, date?: Date) => {\r\n return getSetLocalStorage('selected_delivery_date', getSet, date, '');\r\n};\r\nexport const getSetCoreProductDeliveryMsg = (getSet: string, msg?: string) => {\r\n return getSetLocalStorage('coreprod_deliverymsg', getSet, msg, '');\r\n};\r\n\r\nexport const getSetDefaultDeliverySelected = (getSet: string, selected?: boolean) => {\r\n return getSetLocalStorage('default_delivery_selected', getSet, selected, '');\r\n};\r\n\r\nexport const getSetTimeSlot = (getSet: string, selected?: string) => {\r\n return getSetLocalStorage('time_slot', getSet, selected, '');\r\n};\r\n\r\nexport const getSetDaySlot = (getSet: string, selected?: string) => {\r\n return getSetLocalStorage('day_slot', getSet, selected, '');\r\n};\r\n\r\nexport const getSetServiceName = (getSet: string, selected?: string) => {\r\n return getSetLocalStorage('service_name', getSet, selected, '');\r\n};\r\n\r\nexport const getSetSelectedServicePrice = (getSet: string, selected?: number) => {\r\n return getSetLocalStorage('selected_service_price', getSet, selected, 0);\r\n};\r\n\r\nexport const getSetCoreShippingMsg = (getSet: string, selected?: string) => {\r\n return getSetLocalStorage('core_shipping_msg', getSet, selected, '');\r\n};\r\n\r\nexport const getSetEcomMonthlyAmount = (getSet: string, selected?: number) => {\r\n return getSetLocalStorage('ecom_monthly_amount', getSet, selected, '');\r\n};\r\n\r\nexport const getSetExpressType = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('express-type', getSet, value, ''); /* Selected express payment method name; Also used in sales header attributes */\r\n};\r\n\r\nexport const getSetApplepayCheckoutError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('applepay-checkout-error', getSet, value, ''); /* It indicates that retrieveCardPayment/checkout API for applepay is failed on the Cart/Checkout page, It displays error above the shipping address */\r\n};\r\n\r\nexport const getSetApplepayError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('applepay-error', getSet, value, ''); /* It indicates that retrieveCardPayment API for applepay is failed on the Cart page, It displays error above the shipping address */\r\n};\r\n\r\nexport const getSetApplepayIFrameError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('applepay-iframe-error', getSet, value, ''); /* It indicates that applepay iframe has an error and if its true; applepay button will not be shown and also stop showing loader for applepay */\r\n};\r\n\r\nexport const getSetGetCardApplepayPass = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('getcardapplepay-pass', getSet, value, ''); /* It indicates that getCardPaymentAcceptPoint() API gives success for applepay; If it's true, 'applepay-iframe-error' will be checked after that */\r\n};\r\n\r\nexport const getSetGetCardApplepayFail = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('getcardapplepay-fail', getSet, value, ''); /* It indicates that getCardPaymentAcceptPoint() API is failed for applepay; If it's true => 1. 'applepay-iframe-error' will be checked after that; 2. it'll display error on the respective page cart/checkout */\r\n};\r\n\r\nexport const getSetLoadExpress = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('loadExpress', getSet, value, ''); /* Avoid display loader on checkout page in case of express checkout */\r\n};\r\n\r\nexport const getSetPaypalCheckoutError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('paypal-checkout-error', getSet, value, ''); /* It indicates that retrieveCardPayment/checkout API for paypal is failed on the Cart/Checkout page, It displays error above the shipping address */\r\n};\r\n\r\nexport const getSetPaypalError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('paypal-error', getSet, value, ''); /* It indicates that retrieveCardPayment API for paypal is failed on the Cart page, It displays error above the shipping address */\r\n};\r\n\r\nexport const getSetPaypalIFrameError = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('paypal-iframe-error', getSet, value, ''); /* It indicates that paypal iframe has an error and if its true; paypal button will not be shown and also stop showing loader for paypal */\r\n};\r\n\r\nexport const getSetGetCardExpressPass = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('getcardexpress-pass', getSet, value, ''); /* It indicates that getCardPaymentAcceptPoint() API gives success for paypal; If it's true, 'paypal-iframe-error' will be checked after that */\r\n};\r\n\r\nexport const getSetGetCardExpressFail = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('getcardexpress-fail', getSet, value, ''); /* It indicates that getCardPaymentAcceptPoint() API is failed for paypal; If it's true => 1. 'paypal-iframe-error' will be checked after that; 2. it'll display error on the respective page cart/checkout */\r\n};\r\n\r\nexport const getSetExpressAddress = (getSet: string, value?: IMfrmAddress) => {\r\n return getSetLocalStorage('express-address', getSet, value, []); /* Address from express address is saved. If user updates it by clicking on edit customer info, updated address will be saved in it. But if user re-authenticate, it will reset the old address and will save the new one */\r\n};\r\n\r\nexport const getSetExpressPageLoad = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('express_page_load', getSet, value, ''); /* It checks if express checkout page is reloaded */\r\n};\r\n\r\nexport const getSetThankyou = (getSet: string, value?: any) => {\r\n return getSetLocalStorage('thankyou_payment_details', getSet, value, '');\r\n};\r\n\r\nexport const getSetEcomFinanceOption = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('Ecom_FinanceOption', getSet, value, '');\r\n};\r\n\r\nexport const getSetEcomFinancePlanId = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('Ecom_FinancePlanId', getSet, value, '');\r\n};\r\n\r\nexport const getSetCoreProdMsg = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('payment_review_latest_core_prod_msg', getSet, value, '');\r\n};\r\n\r\nexport const getSetBillingAddress = (getSet: string, value?: any) => {\r\n return getSetLocalStorage('billing_address', getSet, value, {});\r\n};\r\n\r\nexport const getSetPaymentLoader = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('paymentloader', getSet, value, '');\r\n};\r\n\r\nexport const getSetLastPaymentConnector = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('lastPaymentConnector', getSet, value, '');\r\n};\r\n\r\nexport const getSetPaymentRadioName = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('payment_radio_name', getSet, value, '');\r\n};\r\n\r\nexport const getSetPaymentRadioIndex = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('payment_radio_index', getSet, value, '');\r\n};\r\n\r\nexport const getSetSelectedPaymentRadio = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('selectedPaymentRadio', getSet, value, '');\r\n};\r\n\r\nexport const getSetPaymentInfoForOCPage = (getSet: string, value?: any) => {\r\n return getSetLocalStorage('temp_card_payment_info_for_order_confirmation', getSet, value, '');\r\n};\r\n\r\nexport const getSetCurrentStep = (getSet: string, value?: number) => {\r\n return getSetLocalStorage('current_step', getSet, value, 0);\r\n};\r\n\r\nexport const getSetCheckoutCurrentStep = (getSet: string, value?: number) => {\r\n return getSetLocalStorage('checkout_current_step', getSet, value, 0);\r\n};\r\n\r\nexport const getSetCartCoreProductInfo = (getSet: string, value?: ICoreProductsCartData[]) => {\r\n return getSetLocalStorage('cart_core_prods_info', getSet, value, []);\r\n};\r\n\r\nexport const getSetUpdatedEmail = (getSet: string, value?: string) => {\r\n return getSetLocalStorage('updated_email ', getSet, value, '');\r\n};\r\n\r\nexport const getSetSelectedDeliverySlotZone = (getSet: string, zone?: string) => {\r\n return getSetLocalStorage('selected_delivery_slot_zone ', getSet, zone, '');\r\n};\r\n\r\nconst processCartLine = async (cartLine: CartLine, actionContext: IActionContext, channelId: number) => {\r\n try {\r\n const productResponse = await getByIdAsync(\r\n {callerContext: actionContext, queryResultSettings: {Paging: {Top: 1}}},\r\n cartLine.ProductId || 0,\r\n channelId\r\n );\r\n\r\n if (productResponse?.DefaultUnitOfMeasure) {\r\n // Adding unit of measure for order confirmation emails to get Ecom_variantId attribute\r\n cartLine.UnitOfMeasureSymbol = productResponse.DefaultUnitOfMeasure;\r\n return cartLine;\r\n } else {\r\n // Handle the case where DefaultUnitOfMeasure is not available\r\n return cartLine;\r\n }\r\n } catch (error) {\r\n // Handle errors if getByIdAsync fails for a specific productId\r\n console.error(`Error processing ProductId ${cartLine.ProductId}: ${error.message}`);\r\n return cartLine;\r\n }\r\n};\r\n\r\nexport const addUnitOfMeasureInAddCartLine = async (cartLines: CartLine[], actionContext: IActionContext, channelId: number) => {\r\n const promises = cartLines\r\n .filter((cartLine: any) => !cartLine.DefaultUnitOfMeasure)\r\n .map((cartLine: any) => processCartLine(cartLine, actionContext, channelId));\r\n\r\n try {\r\n return await Promise.all(promises);\r\n } catch (error) {\r\n // Handle errors if any of the promises fail\r\n console.error(`Error processing cartLines: ${error}`);\r\n return cartLines;\r\n }\r\n};","export const variantQueryStringName = 'variantid';","// tslint:disable\r\nexport const hasArray = (values: any): any[] | undefined => {\r\n return (typeof values !== 'string') && values && values.length ? values : undefined;\r\n};","/* MFRMProductTypes enum is used to check/compare the product type with product_details cookie\r\nby converting it to lower case used mainly in \"conditional statements\" */\r\nexport enum MFRMProductTypes {\r\n core = 'core',\r\n smallParcel = 'parcel',\r\n dropShip = 'drop ship'\r\n}\r\n\r\n// DeliveryModes enum is used to pass the modOfDelivery value in \"API payloads\"\r\nexport enum DeliveryModes {\r\n core = 'Delivery',\r\n smallParcel = 'Parcel',\r\n dropShip = 'Drop Ship'\r\n}\r\n\r\n// Enum for Delivery Date details messages show on cart page.\r\nexport enum DeliveryDateDetails {\r\n DeliveryToday = 'Delivery by Today',\r\n DeliveryTomorrow = 'Delivery by Tomorrow',\r\n DeliveryBy = 'Delivery by',\r\n AvailableYes = 'yes'\r\n}\r\n\r\n// coreItemShippingType constant value is used to compare the shipping type of core products\r\nexport const coreItemShippingType = 'delivery';\r\n\r\nexport enum EyeBrowMessage {\r\n BestSeller = \"Best Seller\",\r\n SleepExpertPick = \"Sleep Expert® Pick\",\r\n OnlyAtMattressFirm = \"Only at Mattress Firm\",\r\n SleepScoreValidated = \"Sleep score validated\",\r\n PLPRibbon = \"Best Seller\",\r\n}\r\n\r\nexport enum EyeBrowAttributeName {\r\n BestSeller = 'BestSeller',\r\n SE_Pick = 'SE_Pick',\r\n IsExclusive = 'IsExclusive',\r\n SleepScore = 'SleepScore',\r\n PLP_Ribbon = 'PLP_Ribbon',\r\n}\r\n// this text is sent to rating component on cart page (as it is used on cart page so sending cart module name)\r\nexport const cartModuleName = 'mfrm-cart';\r\n\r\n// Define an enum for local storage keys\r\nexport enum LocalStorageKeys {\r\n DropshipLatestDeliveryMsg = 'payment_review_dropship_latest_del_msg',\r\n ParcelLatestDeliveryMsg = 'payment_review_parcel_latest_del_msg',\r\n CustomerPhone = 'customer_phone',\r\n SelectedDeliveryService = 'selected_delivery_service',\r\n CustomerBillingSameDelivery = 'is_customer_billing_same_as_delivery',\r\n RecycleFee = 'recycleFee'\r\n}\r\n// this text is using for progressive value\r\nexport const progressiveName = 'Progressive';","import { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport const getBVAttributeValues = (attributeValues: AttributeValue[] | undefined, key: string): number => {\r\n const value = +(attributeValues?.find(attr => attr.Name?.trim() === key)?.TextValue || 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n\r\nexport const getBVAttributeValuesUnbxd = (attributeValues: any | undefined, key: string): number => {\r\n const value = +(attributeValues[key] ?? 0);\r\n return Math.round(value * 10) / 10;\r\n};\r\n","import ReactHtmlParser from 'react-html-parser';\r\n\r\nconst getHtmlParserValue = (value?: string) => {\r\n let parsedValue = '';\r\n const parsedArr = value && ReactHtmlParser(value);\r\n if (parsedArr && parsedArr?.length > 0) {\r\n parsedValue = parsedArr[0] ? parsedArr[0].toString() : '';\r\n }\r\n return parsedValue;\r\n};\r\n\r\nexport default getHtmlParserValue;","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport const getZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const geolocationZipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n const cookie = new Cookies();\r\n const zipcode = cookie.get('zip_code') ? cookie.get('zip_code') : geolocationZipCode;\r\n return zipcode ?? undefined;\r\n};\r\nexport const getGeoLocationZipCode = (ctx: IActionContext): string | undefined => {\r\n //@ts-ignore\r\n const zipCode = ctx.requestContext.geoLocation?.zipCode ? ctx.requestContext.geoLocation.zipCode : ctx.requestContext.geoLocation?.res?.zipCode;\r\n return zipCode ?? null;\r\n};\r\n","import { RichText } from '@msdyn365-commerce/core';\r\n\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\nconst format = 'M/D/YYYY';\r\n\r\nexport interface IFinancingOffer {\r\n offerName?: string;\r\n noInterestFor: number;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage: string,\r\n limitedFinancingOfferMessage: string,\r\n lowCostFinancingOfferMessage: string,\r\n cashbackFinancingOfferMessage: string,\r\n monthlyOfferDetails?: RichText;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n offerValidStartDate?: string;\r\n offerValidEndDate?: string;\r\n specialCampaignOffer?: IFinancingOfferCampaign;\r\n checkoutDisplay?: { heading: string; details: string; specialOffer?: string},\r\n FinancingOfferDataOnPage?: RichText;\r\n cashBackPercentageAmount?: number;\r\n cashbackBannerDetails?: RichText;\r\n}\r\nexport interface ILowCostOffer {\r\n offerName?: string;\r\n maxPurchase: number;\r\n lowCostFinancingOfferMessage: string,\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n defaultNumberOfMonths: number;\r\n lowCostOfferDetailsOnCart?: RichText;\r\n}\r\n\r\n\r\nexport interface IFinancingOfferFormatted {\r\n lowCostOfferDetailsOnCart?: RichText;\r\n numOfMonths: number;\r\n costPerMonth: number;\r\n startDate?: string;\r\n endDate?: string;\r\n isLTO: boolean;\r\n monthlyOfferDetails?: RichText;\r\n minPurchase: number;\r\n lowCostFinancingOfferMessage?: string;\r\n everydayFinancingOfferMessage?: string;\r\n limitedFinancingOfferMessage?: string;\r\n cashbackFinancingOfferMessage?: string;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n specialCampaign?: IFinancingOfferCampaign;\r\n offerName?: string;\r\n checkoutDisplay?: { heading: string; details: string; specialOffer?: string },\r\n FinancingOfferDataOnPage?: RichText;\r\n isCashBack?: boolean;\r\n cashBackPercentageAmount?: number;\r\n cashbackBannerDetails?: RichText;\r\n}\r\n\r\nexport interface IFinancingOfferCampaign {\r\n initialMonthlyAmount: number;\r\n numOfDiscountedMonths: number;\r\n campaignValidStartDate: string;\r\n campaignValidEndDate: string;\r\n enableCampaign: boolean;\r\n showEverydayFlag: boolean;\r\n}\r\n\r\nexport interface ISelectFinancingOfferData {\r\n limitedTimeFinancingOffers: IFinancingOffer[];\r\n everydayFinancingOffers: IFinancingOffer[];\r\n lowCostOffer?: ILowCostOffer[]\r\n totalPrice: number | undefined;\r\n specialFinancingOffer?: IFinancingOffer[];\r\n synchronySpecialFinancingCondition?: boolean;\r\n specialFinancingEnable?: boolean;\r\n checkoutShowEveryDayOffers?: boolean;\r\n cashbackFinancingEnable?: boolean;\r\n cashBackFinancingOffer?: IFinancingOffer[];\r\n}\r\n\r\nexport interface ICampaignRemainingCost {\r\n cost: number;\r\n months: number;\r\n}\r\n\r\nexport const getValidSpecialCampaign = (financingOffer: IFinancingOfferFormatted): IFinancingOfferCampaign | undefined => {\r\n if (\r\n financingOffer.specialCampaign &&\r\n financingOffer.specialCampaign.enableCampaign &&\r\n financingOffer.specialCampaign.initialMonthlyAmount &&\r\n financingOffer.specialCampaign.numOfDiscountedMonths &&\r\n isCampaignScheduled(financingOffer)\r\n ) {\r\n return financingOffer.specialCampaign;\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getCampaignRemainingCost = (\r\n campaign: IFinancingOfferCampaign,\r\n financingOffer: IFinancingOfferFormatted,\r\n totalPrice: number | undefined\r\n): ICampaignRemainingCost | undefined => {\r\n if (!totalPrice) {\r\n return undefined;\r\n }\r\n\r\n const initialCost = campaign.initialMonthlyAmount * campaign.numOfDiscountedMonths;\r\n const remainingCost = totalPrice - initialCost;\r\n const remainingMonths = financingOffer.numOfMonths - campaign.numOfDiscountedMonths;\r\n const monthlyCost = remainingCost / remainingMonths;\r\n\r\n return {\r\n cost: monthlyCost,\r\n months: remainingMonths\r\n };\r\n};\r\nexport const isValidLimitedTimeOffer = (offer: IFinancingOffer): boolean => {\r\n const startDate = dayjs(offer.offerValidStartDate, format);\r\n const endDate = dayjs(offer.offerValidEndDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const isCampaignScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const tempOffer = Object.create(offer);\r\n if (tempOffer.specialCampaign?.campaignValidStartDate && tempOffer.specialCampaign?.campaignValidEndDate) {\r\n tempOffer.startDate = tempOffer.specialCampaign?.campaignValidStartDate;\r\n tempOffer.endDate = tempOffer.specialCampaign?.campaignValidEndDate;\r\n\r\n return isScheduled(tempOffer);\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const isScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const startDate = dayjs(offer.startDate, format);\r\n const endDate = dayjs(offer.endDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const selectFinancingOffer = ({ limitedTimeFinancingOffers = [], everydayFinancingOffers = [], lowCostOffer = [], totalPrice = 0, specialFinancingOffer = [], synchronySpecialFinancingCondition = false, specialFinancingEnable = false, checkoutShowEveryDayOffers, cashbackFinancingEnable = false, cashBackFinancingOffer = [] }: ISelectFinancingOfferData, returnCustomOfferArray?: boolean): IFinancingOfferFormatted | undefined => {\r\n let highestMinimumPurchase: number = 0;\r\n let bestOffer: IFinancingOfferFormatted = {\r\n numOfMonths: 0,\r\n costPerMonth: 0,\r\n isLTO: false,\r\n minPurchase: 0,\r\n everydayFinancingOfferMessage: '',\r\n limitedFinancingOfferMessage: '',\r\n cashbackFinancingOfferMessage: '',\r\n monthlyOfferDetails: '',\r\n financingOfferDescription: '',\r\n disclaimer: ''\r\n };\r\n let offerFound = false;\r\n\r\n let campaignFound: IFinancingOfferFormatted | undefined;\r\n\r\n const everydayOffers: IFinancingOfferFormatted[] | undefined = [];\r\n const specialOffer: IFinancingOfferFormatted[] | undefined = [];\r\n\r\n const validLimitedTimeFinancingOffers = limitedTimeFinancingOffers.filter((offer) => {\r\n return isValidLimitedTimeOffer(offer) && offer;\r\n });\r\n\r\n if (synchronySpecialFinancingCondition && specialFinancingEnable) {\r\n if (!offerFound || (!isScheduled(bestOffer) && specialFinancingOffer.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n specialFinancingOffer.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n offerName: offer.offerName,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n FinancingOfferDataOnPage: offer?.FinancingOfferDataOnPage,\r\n checkoutDisplay: offer?.checkoutDisplay\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n specialOffer?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = specialOffer;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n // if cashback enabled and has length check for cashback offer\r\n if (cashbackFinancingEnable && cashBackFinancingOffer?.length) {\r\n cashBackFinancingOffer.forEach((offer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n // if minimum purchase criteria is met, then create best offer\r\n if (totalPrice >= minPurchase) {\r\n const cashBackOffer = {\r\n numOfMonths: offer?.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer?.noInterestFor),\r\n startDate: offer?.offerValidStartDate,\r\n endDate: offer?.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer?.minPurchase || 0,\r\n offerName: offer?.offerName,\r\n financingOfferDescription: offer?.financingOfferDescription,\r\n disclaimer: offer?.disclaimer,\r\n FinancingOfferDataOnPage: offer?.FinancingOfferDataOnPage,\r\n isCashBack: cashbackFinancingEnable,\r\n checkoutDisplay: offer?.checkoutDisplay,\r\n cashBackPercentageAmount: offer?.cashBackPercentageAmount,\r\n cashbackBannerDetails: offer?.cashbackBannerDetails,\r\n cashbackFinancingOfferMessage: offer?.cashbackFinancingOfferMessage\r\n };\r\n offerFound = true;\r\n bestOffer = cashBackOffer;\r\n }\r\n\r\n // check if current offer expired\r\n if (offerFound && offer?.offerValidEndDate) {\r\n const endDate = dayjs(offer?.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate?.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n // if no offer found then check limited time financing offers\r\n if (!offerFound || !isScheduled(bestOffer)) {\r\n validLimitedTimeFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n\r\n if (totalPrice >= minPurchase && minPurchase > highestMinimumPurchase) {\r\n const currentOffer: IFinancingOfferFormatted = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: true,\r\n minPurchase: offer.minPurchase,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n specialCampaign: offer.specialCampaignOffer,\r\n checkoutDisplay: offer.checkoutDisplay,\r\n offerName: offer.offerName\r\n };\r\n bestOffer = currentOffer;\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n\r\n // check if campaign schedule is scheduled, otherwise fall back to parent offer\r\n const validCampaign = getValidSpecialCampaign(currentOffer);\r\n if (validCampaign) {\r\n currentOffer.startDate = validCampaign.campaignValidStartDate;\r\n currentOffer.endDate = validCampaign.campaignValidEndDate;\r\n campaignFound = currentOffer;\r\n }\r\n else {\r\n campaignFound = undefined;\r\n }\r\n }\r\n });\r\n }\r\n // if no offer found then check everyday financing offer\r\n if (!offerFound || (!isScheduled(bestOffer) && everydayFinancingOffers.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n\r\n everydayFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = checkoutShowEveryDayOffers ? 0 : offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n everydayOffers?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage: offer.limitedFinancingOfferMessage,\r\n cashbackFinancingOfferMessage: offer.cashbackFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = everydayOffers;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n if (lowCostOffer?.length) {\r\n lowCostOffer.forEach((offer: ILowCostOffer) => {\r\n if (totalPrice <= offer.maxPurchase && offer.offerName?.toLowerCase() === 'low cost offer') {\r\n const LCO = {\r\n offerName: offer.offerName,\r\n maxPurchase: offer.maxPurchase || 0,\r\n lowCostFinancingOfferMessage: offer.lowCostFinancingOfferMessage,\r\n financingOfferDescription: offer?.financingOfferDescription?.replace(/{defaultNumOfMonths}/g, `${offer?.defaultNumberOfMonths?.toString() || 6}`),\r\n disclaimer: offer.disclaimer,\r\n lowCostOfferDetailsOnCart: offer.lowCostOfferDetailsOnCart\r\n };\r\n highestMinimumPurchase = offer.maxPurchase;\r\n offerFound = true;\r\n // @ts-ignore\r\n bestOffer = LCO;\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (!offerFound) {\r\n return undefined;\r\n }\r\n if (campaignFound) {\r\n return campaignFound;\r\n }\r\n return bestOffer;\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedPillow Input Action\r\n */\r\nexport class CompleteYourBedPillowInput implements Msdyn365.IActionInput {\r\n public pillow: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(pillow: SimpleProduct | undefined | null) {\r\n this.pillow = pillow;\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 = () => `CompleteyourBedPillow`;\r\n public getCacheObjectType = () => 'CompleteyourBedPillow';\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 ICompleteYourBedPillowData {\r\n pillow: SimpleProduct | undefined | null;\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 CompleteYourBedPillowInput(args?.config?.pillow);\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: CompleteYourBedPillowInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { pillow: input.pillow };\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: 'CompleteyourBedPillow',\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedProtector Input Action\r\n */\r\nexport class CompleteyourBedProtectorInput implements Msdyn365.IActionInput {\r\n public protector: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(protector: SimpleProduct | undefined | null) {\r\n this.protector = protector;\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 = () => `CompleteyourBedProtector`;\r\n public getCacheObjectType = () => 'CompleteyourBedProtector';\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 ICompleteYourBedProtectorData {\r\n protector: SimpleProduct | undefined | null;\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 CompleteyourBedProtectorInput(args?.config?.protector);\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: CompleteyourBedProtectorInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { protector: input.protector };\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: 'CompleteyourBedProtector',\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","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIPromotion entity interface.\r\n */\r\nexport interface IMFIPromotion {\r\n ItemId: string;\r\n DistinctProductVariant?: string;\r\n EyeBrows?: Entities.Promotion[];\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity interface.\r\n */\r\nexport interface IMFIAvailablePromotionDescription {\r\n PriceGroup?: string;\r\n Items?: IMFIItem[];\r\n}\r\n\r\n/**\r\n * MFIItem entity interface.\r\n */\r\nexport interface IMFIItem {\r\n ItemId?: string;\r\n DistinctProductVariant?: string;\r\n}\r\n\r\n/**\r\n * MFIPromotion entity class.\r\n */\r\nexport class MFIPromotionExtensionClass implements IMFIPromotion {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public EyeBrows: Entities.Promotion[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows = undefined;\r\n if (odataObject.EyeBrows) {\r\n this.EyeBrows = [];\r\n for (let i = 0; i < odataObject.EyeBrows.length; i++) {\r\n if (odataObject.EyeBrows[i]) {\r\n if (odataObject.EyeBrows[i]['@odata.type']) {\r\n let className: string = odataObject.EyeBrows[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.EyeBrows[i] = new EntityClasses[className](odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n this.EyeBrows[i] = new EntityClasses.PromotionClass(odataObject.EyeBrows[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.EyeBrows[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIAvailablePromotionDescription entity class.\r\n */\r\nexport class MFIAvailablePromotionDescriptionExtensionClass implements IMFIAvailablePromotionDescription {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PriceGroup: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIItem[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PriceGroup = odataObject.PriceGroup;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIItemExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIItem entity class.\r\n */\r\nexport class MFIItemExtensionClass implements IMFIItem {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DistinctProductVariant: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ItemId = odataObject.ItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DistinctProductVariant = odataObject.DistinctProductVariant;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest,\r\n IQueryResultSettings\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './EyebrowMessageDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction availablePromotionsDescriptionsQuery(itemId?: string): DataServiceQuery {\r\n const key = itemId ? { ItemId: itemId } : null;\r\n return new DataServiceQuery('AvailablePromotionsDescriptions', 'MFIPromotion', DataServiceEntities.MFIPromotionExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetAvailablePromotionsDescriptionInput(\r\n queryResultSettings: IQueryResultSettings,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): IDataServiceRequest {\r\n const query = availablePromotionsDescriptionsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetAvailablePromotionsDescription',\r\n true,\r\n DataServiceEntities.MFIPromotionExtensionClass,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIPromotion' },\r\n { availablePromotionsDescription: availablePromotionsDescription }\r\n );\r\n}\r\n\r\nexport function mFIGetAvailablePromotionsDescriptionAsync(\r\n context: IContext,\r\n availablePromotionsDescription: DataServiceEntities.IMFIAvailablePromotionDescription\r\n): AsyncResult {\r\n const request = createMFIGetAvailablePromotionsDescriptionInput(context.queryResultSettings || {}, availablePromotionsDescription);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType } from '@msdyn365-commerce/retail-proxy';\r\nimport { mFIGetAvailablePromotionsDescriptionAsync } from './EyebrowMessageDataActionExtension.g';\r\nimport { IMFIAvailablePromotionDescription, IMFIPromotion } from './EyebrowMessageDataServiceEntities.g';\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetEyebrowMessageInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public item: IMFIAvailablePromotionDescription;\r\n public isCached?: boolean;\r\n public pageType?: string;\r\n private readonly createCacheKey: string | '';\r\n constructor(item: IMFIAvailablePromotionDescription, pageType?: string, isCached?: boolean) {\r\n this.item = item;\r\n this.isCached = isCached;\r\n this.pageType = pageType;\r\n // incase of pdp cache key will be based on variantId and on PLP will be basded on ItemId\r\n this.createCacheKey =\r\n this.item.Items?.map(obj => (this.pageType === 'pdp' ? obj?.DistinctProductVariant : obj?.ItemId))\r\n .join('-')\r\n .toString() || '';\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 = () => `Get-Eyebrow-Message-${this.createCacheKey}`;\r\n // public getCacheKey = () => 'EyebrowMessage';\r\n public getCacheObjectType = () => 'EyebrowMessage';\r\n public dataCacheType = (): CacheType => (this.isCached ? 'application' : 'application');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * Use this function to create the input required to make the action call\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 getEyebrowAction(input: GetEyebrowMessageInput, ctx: IActionContext): Promise {\r\n try {\r\n const result = await mFIGetAvailablePromotionsDescriptionAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 50 } } },\r\n input.item\r\n );\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEyebrowAction,\r\n // Give your data action a unique id\r\n id: 'GetEyebrowMessage'\r\n // Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryStatusAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryStatusResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * Small parcel getInventory status Input Action\r\n */\r\n\r\nexport class GetATPInventoryStatusInput implements Msdyn365.IActionInput {\r\n // Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\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 const key = Array.prototype.map.call(this.input.ItemLines, (item) => { return item.VariantRecordId; }).sort().join(\",\");\r\n return `Get-Inventory-Status${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${key}-${\r\n this.input?.Weeks\r\n }-${this.input?.RequestedDate}`;\r\n };\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetATPInventoryStatusResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\r\n}\r\n\r\n// Create a data model here or import one to capture the response of the action\r\n\r\n/**\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 GetDeliveryMessageInput();\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 getATPInventoryStatusAction(\r\n request: GetATPInventoryStatusInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryStatusAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getATPInventoryStatusAction,\r\n // Give your data action a unique id\r\n id: 'GetATPInventoryStatus'\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 { observable } from 'mobx';\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class ProductCompareBuyboxStateSharing implements Msdyn365.IActionInput {\r\n @observable public zipCode?: string | undefined;\r\n // Construct the input needed to run the action\r\n constructor(zipCode: string | undefined) {\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 = () => `ProductCompareBuyboxStateSharing`;\r\n public getCacheObjectType = () => 'ProductCompareBuyboxStateSharing';\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 ISelectYourFoundationData {\r\n zipCode: 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: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ProductCompareBuyboxStateSharing(args?.config?.zipCode);\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: ProductCompareBuyboxStateSharing, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { zipCode: input.zipCode };\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: 'ProductCompareBuyboxStateSharing',\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 { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class SelectYourFoundationInput implements Msdyn365.IActionInput {\r\n public foundation: SimpleProduct | undefined | null;\r\n // Construct the input needed to run the action\r\n constructor(foundation: SimpleProduct | undefined | null) {\r\n this.foundation = foundation;\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 = () => `SelectYourFoundation`;\r\n public getCacheObjectType = () => 'SelectYourFoundation';\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 ISelectYourFoundationData {\r\n foundation: SimpleProduct | undefined | null;\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 SelectYourFoundationInput(args?.config?.foundation);\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: SelectYourFoundationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\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 { foundation: input.foundation };\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: 'SelectYourFoundation',\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","import * as React from \"react\";\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\ninterface ErrorBoundaryState {\r\n hasError: boolean;\r\n errorMessage: string;\r\n}\r\n\r\ninterface ErrorBoundaryProps {\r\n showMessage?: boolean | string; //true to show the error message, set to string to show custom message\r\n telemetry: ITelemetry\r\n}\r\n\r\n\r\n// Put this in a child component to mock an error in order to test ErrorBoundary.\r\nexport const MockError = (props: {message?: string}) => {\r\n throw new Error(props.message);\r\n};\r\n\r\nexport class ErrorBoundary extends React.Component {\r\n constructor(props: ErrorBoundaryProps) {\r\n super(props);\r\n this.state = {\r\n hasError: false,\r\n errorMessage: \"\"\r\n };\r\n }\r\n\r\n\r\n // @ts-ignore\r\n private static getDerivedStateFromError(error: any) {\r\n // Update state so the next render will show the fallback UI.\r\n return { hasError: true, errorMessage: error.message };\r\n }\r\n\r\n// public componentDidCatch(error: any, errorInfo: any) {\r\n// // You can also log the error to an error reporting service\r\n// logErrorToMyService(error, errorInfo);\r\n// }\r\n\r\n public render() {\r\n const bgColor = \"rgba(0,0,255)\";\r\n\r\n if (this.state.hasError) {\r\n const { showMessage } = this.props;\r\n const message = typeof showMessage === 'string' ? showMessage : showMessage ? this.state.errorMessage : false;\r\n this.props?.telemetry?.error(this.state?.errorMessage);\r\n // TODO design this custom UI fallback\r\n return message ?
{message}
: null;\r\n }\r\n\r\n return this.props.children || null;\r\n }\r\n}\r\n","import Cookies from 'universal-cookie';\r\n\r\nconst cookies = new Cookies();\r\n\r\n// use this function to get cookie\r\nexport function getCookie(cookieName: string): string | undefined {\r\n return cookies.get(cookieName);\r\n}\r\n\r\n// use this function to set cookie\r\nexport function setCookie(cookieName: string, cookieValue: any, options?: any): void {\r\n cookies.set(cookieName, cookieValue, options);\r\n}\r\n\r\n// use this function to remove cookie\r\nexport function removeCookie(cookieName: string, options?: any): void {\r\n cookies.remove(cookieName, options);\r\n}","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport getHtmlParserValue from '../Utilities/get-html-parser-value';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionPricingInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `DimensionPrices`;\r\n public getCacheObjectType = () => 'Product';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionPricingActionData {\r\n discountAmount?: number;\r\n name: string;\r\n price: number;\r\n productId: number;\r\n dimensionLabel: string;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionPricingInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionPricingInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionPricingInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nconst getDimensionLabel = (dimension: ProductDimension): string | undefined => {\r\n const extensionProperties = dimension.DimensionValue?.ExtensionProperties;\r\n\r\n let dimensionLabel;\r\n extensionProperties?.forEach(property => {\r\n if (property.Key?.toLowerCase() === 'description') {\r\n dimensionLabel = property.Value?.StringValue && getHtmlParserValue(property.Value?.StringValue);\r\n }\r\n });\r\n\r\n return dimensionLabel;\r\n};\r\n\r\nexport async function getDimensionPricingAction(\r\n input: BuyboxGetDimensionPricingInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const pricingData: IBuyboxGetDimensionPricingActionData[] = [];\r\n\r\n const productResponse = await getByIdAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } },\r\n input.productId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n\r\n await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n )\r\n .then(async (variants: SimpleProduct[]) => {\r\n // TODO: refactor code to use Hashmap\r\n // ex: https://codepen.io/asadalikanwal/pen/ZEpgmzd?editors=1111\r\n if (variants) {\r\n const dimensionsSizes = {};\r\n const productIds = [];\r\n variants.forEach(variant => {\r\n variant.Dimensions?.forEach(dimension => {\r\n if (dimension.DimensionTypeValue === 3) {\r\n const sizeLabel = dimension.DimensionValue?.Value?.toLowerCase().trim();\r\n const priceLabel = variant.Price;\r\n const dimensionLabel = getDimensionLabel(dimension);\r\n if (sizeLabel) {\r\n if (dimensionsSizes.hasOwnProperty(sizeLabel)) {\r\n if (priceLabel && dimensionsSizes[sizeLabel].price >= priceLabel) {\r\n dimensionsSizes[sizeLabel] = {\r\n price: priceLabel,\r\n productId: variant.RecordId,\r\n name: dimension.DimensionValue?.Value,\r\n dimensionLabel: dimensionLabel\r\n };\r\n }\r\n } else {\r\n dimensionsSizes[sizeLabel] = {\r\n price: priceLabel,\r\n productId: variant.RecordId,\r\n name: dimension.DimensionValue?.Value,\r\n dimensionLabel: dimensionLabel\r\n };\r\n }\r\n }\r\n }\r\n });\r\n });\r\n\r\n if (dimensionsSizes) {\r\n // push all dimension/variant ids to array for activePrice call\r\n for (const key of Object.keys(dimensionsSizes)) {\r\n if (dimensionsSizes.hasOwnProperty(key)) {\r\n pricingData.push(dimensionsSizes[key]);\r\n productIds.push(dimensionsSizes[key].productId);\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n });\r\n return pricingData;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'DimensionPrices',\r\n action: >getDimensionPricingAction,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { getByIdAsync, getVariantsByDimensionValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BuyboxGetDimensionVariantAvailabilityInput implements IActionInput {\r\n public channelId: number;\r\n public productId: number;\r\n constructor(productId: number, channelId: number) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n }\r\n public getCacheKey = () => `VariantIDs-${this.productId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IBuyboxGetDimensionVariantAvailabilityActionData {\r\n variantID: number;\r\n sizeDimensionRecordID: number;\r\n colorDimensionRecordId: number;\r\n dimensionRecordID?: number;\r\n itemID: string;\r\n sizeValue: string;\r\n isAvailable: boolean;\r\n secondaryDimensionValue?: string; // can be color or height\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n if (inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.query.productId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.requestContext && inputData.requestContext.urlTokens && inputData.requestContext.urlTokens.itemId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(\r\n +inputData.requestContext.urlTokens.itemId,\r\n +inputData.requestContext.apiSettings.channelId\r\n );\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return new BuyboxGetDimensionVariantAvailabilityInput(inputData.config.productId, inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\nexport async function getAllVariantsAction(\r\n input: BuyboxGetDimensionVariantAvailabilityInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const fetchedVariants: IBuyboxGetDimensionVariantAvailabilityActionData[] = [];\r\n const productResponse = await getByIdAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, input.productId, input.channelId);\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: 500 } } },\r\n baseProduct.MasterProductId || input.productId,\r\n input.channelId,\r\n []\r\n )\r\n .then(async (variants: SimpleProduct[]) => {\r\n // TODO: refactor code to use Hashmap\r\n // ex: https://codepen.io/asadalikanwal/pen/ZEpgmzd?editors=1111\r\n if (variants) {\r\n variants.forEach((variant) => {\r\n const variantAvailabilityData: IBuyboxGetDimensionVariantAvailabilityActionData = { variantID: -1, sizeDimensionRecordID: -1, colorDimensionRecordId: -1, itemID: '', isAvailable: true, sizeValue: '' };\r\n variant.Dimensions?.forEach((dimension) => {\r\n if (dimension.DimensionTypeValue === 1) {\r\n variantAvailabilityData.variantID = variant.RecordId;\r\n variantAvailabilityData.colorDimensionRecordId = dimension.DimensionValue!.RecordId;\r\n variantAvailabilityData.itemID = variant.ItemId!;\r\n variantAvailabilityData.secondaryDimensionValue = dimension.DimensionValue?.Value;\r\n } else if (dimension.DimensionTypeValue === 3) {\r\n variantAvailabilityData.variantID = variant.RecordId;\r\n variantAvailabilityData.sizeDimensionRecordID = dimension.DimensionValue!.RecordId;\r\n variantAvailabilityData.sizeValue = dimension.DimensionValue!.Value!;\r\n }\r\n });\r\n fetchedVariants.push(variantAvailabilityData);\r\n });\r\n }\r\n return fetchedVariants;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[IBuyboxGetDimensionPricingActionData]Unable to retieve data');\r\n });\r\n return fetchedVariants;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: 'VariantIDs',\r\n action: >getAllVariantsAction,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { IFinancingOfferFormatted } from '../Utilities/select-financing-offer';\r\n\r\n/**\r\n * FinancingOfferState Input Action\r\n */\r\n\r\nexport class FinancingOfferStateInput implements Msdyn365.IActionInput {\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 = () => `FinancingOfferState`;\r\n public getCacheObjectType = () => 'FinancingOfferState';\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 IFinancingOfferStateData {\r\n isOpen: boolean;\r\n totalPrice?: number;\r\n financingOffer?: IFinancingOfferFormatted;\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 FinancingOfferStateInput();\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: FinancingOfferStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'FinancingOfferState',\r\n input: createInput\r\n});\r\n","import 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 { OrgUnitLocation } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IStoreSelectorState } from './store-selector-state';\r\n/**\r\n * storeSelectorState - action input\r\n */\r\nexport class StoreSelectorStateInput implements IActionInput {\r\n public getCacheKey = () => `storeSelectorState`;\r\n public getCacheObjectType = () => 'storeSelectorState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * StoreSelectorStateInput - action\r\n */\r\nexport async function storeSelectorStateAction(input: StoreSelectorStateInput, ctx: IActionContext): Promise {\r\n const prefferedStore: OrgUnitLocation =\r\n MsDyn365.isBrowser && localStorage.getItem('_mfrm__prefferedStore_')\r\n ? JSON.parse(localStorage.getItem('_mfrm__prefferedStore_') || '')\r\n : {};\r\n return { isModalOpen: false, prefferedStore: prefferedStore };\r\n}\r\n\r\n/**\r\n * StoreSelectorStateInput - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new StoreSelectorStateInput();\r\n};\r\n\r\n/**\r\n * StoreSelectorStateInput - create action\r\n */\r\nexport default createObservableDataAction({\r\n id: 'StoreSelectorState',\r\n action: >storeSelectorStateAction,\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IAny, ICommerceApiSettings, ICoreContext, ICreateActionContext, IGeneric, IRequestContext } from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult, CartLine, CommerceListLine, ProductDimension,\r\n ProductDimensionType, ProductSearchResult, SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ProductDetailsCriteria, InventoryLevels, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n// import { parseSearchData } from '@msdyn365-commerce-modules/retail-actions/src/utilities/input-data-parser';\r\n\r\nexport const wrapInResolvedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'SUCCESS',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\r\nexport const wrapInRejectedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'FAILED',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\r\n\r\n/**\r\n * Utility function to extract the active productId in the following priority:\r\n * First query param (productId), then UrlToken (itemId), then module config.\r\n * @param inputData - The Action Input data.\r\n * @returns Productid or undefined.\r\n */\r\nexport const getSelectedProductIdFromActionInput = (inputData: ICreateActionContext>): string | undefined => {\r\n const context = inputData.requestContext;\r\n const variantId = context.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(context.url.requestUrl, variantQueryStringName) : undefined;\r\n\r\n if (variantId) {\r\n return variantId;\r\n } else if (context.query?.productId) {\r\n return context.query.productId;\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Exsiting code.\r\n } else if (context.urlTokens && inputData.requestContext.urlTokens.itemId && inputData.requestContext.urlTokens.pageType === 'Product') {\r\n return context.urlTokens.itemId;\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return inputData.config.productId;\r\n }\r\n return undefined;\r\n};\r\n\r\nexport const getQueryParamsFromQueryByName = (inputUrl: URL, queryParamName: string) => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const value = urlParameters.get(queryParamName.trim().toLocaleLowerCase());\r\n if (!value || Number.isNaN(Number(value))) {\r\n return undefined;\r\n }\r\n return value;\r\n};\r\n/**\r\n * Generates a Image URL based on data return from retail server.\r\n * @param imageUrl The image url returned by Retail Server.\r\n * @param ctx The request context.\r\n * @param apiSettings\r\n */\r\nexport const generateImageUrl = (imageUrl: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (imageUrl) {\r\n // Images hosted in CMS include schema\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\r\n\r\n // Images hosted in Retail Server must be encoded and joined with the base image url\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\r\n }\r\n\r\n // D365Commerce.telemetry.warning(`Unable to generate a proper Image URL for Product: ${product.RecordId}`);\r\n return undefined;\r\n\r\n};\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsConfig {\r\n dimensionsAsSwatchType?: DimensionTypes[];\r\n dimensionsInProductCard?: DimensionTypes[];\r\n inventoryLevel?: InventoryLevels;\r\n dimensionToPreSelectInProductCard?: DimensionTypes;\r\n}\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsApp {\r\n config: IDimensionsConfig;\r\n}\r\n\r\n/**\r\n * Represents product dimension types.\r\n */\r\nexport enum DimensionTypes {\r\n none = 'none',\r\n color = 'color',\r\n configuration = 'configuration',\r\n size = 'size',\r\n style = 'style'\r\n}\r\n\r\n/**\r\n * Defines display configuration types.\r\n */\r\nexport enum DimensionSwatchDisplayTypes {\r\n default = 'default',\r\n productCard = 'productCard'\r\n}\r\n\r\n/**\r\n * Checks if rendering the particular dimensions is allowed.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @param context - Core application context.\r\n * @param displayType - The swatch location, the component from which it comes from.\r\n * @returns Updates the state with new product page url.\r\n */\r\nexport const checkIfShouldDisplayAsSwatch = (\r\n dimensionType: DimensionTypes,\r\n context: ICoreContext,\r\n displayType: DimensionSwatchDisplayTypes = DimensionSwatchDisplayTypes.default): boolean => {\r\n\r\n // Additional checks for the product card since it has a separate config setting.\r\n if (displayType === DimensionSwatchDisplayTypes.productCard) {\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n if (!ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) ||\r\n dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) ||\r\n !dimensionsToDisplayOnProductCard.includes(dimensionType)) {\r\n return false;\r\n }\r\n }\r\n\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayAsSwatch.includes(dimensionType);\r\n};\r\n\r\n/**\r\n * Generates an image URL for a swatch.\r\n * @param imageUrl - The image url returned by Retail Server.\r\n * @param apiSettings - The request context.\r\n * @returns Full image url.\r\n */\r\nexport const generateSwatchImageUrl = (imageUrl: string, apiSettings: ICommerceApiSettings): string => {\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\r\n\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\r\n};\r\n\r\n/**\r\n * Generates a Image URL for a product based on data return from retail server.\r\n * @param product The Product returned by Retail Server.\r\n * @param ctx The request context.\r\n * @param apiSettings\r\n */\r\nexport const generateProductImageUrl = (\r\n product: SimpleProduct | ProductSearchResult,\r\n apiSettings: ICommerceApiSettings\r\n): string | undefined => {\r\n return generateImageUrl(product.PrimaryImageUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Creates a CartLine object from the passed data.\r\n * @param product The product.\r\n * @param quantity The quantity.\r\n * @param catalogId The catalog.\r\n */\r\nexport const buildCartLine = (product: SimpleProduct, quantity?: number, catalogId?: number): CartLine => {\r\n return {\r\n CatalogId: catalogId || 0,\r\n Description: product.Description,\r\n\r\n // TODO: Investigate this value and what it represents\r\n EntryMethodTypeValue: 3,\r\n ItemId: product.ItemId,\r\n ProductId: product.RecordId,\r\n Quantity: quantity || 1,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: product.DefaultUnitOfMeasure\r\n };\r\n};\r\n\r\n/**\r\n * Creates a CommerceListLine (also know as WishlistLine) object from the passed data.\r\n * @param productId The RecordId of the Product to be added.\r\n * @param customerId The account number of the customer.\r\n * @param wishlistId The Id of the commerce list.\r\n */\r\nexport const buildWishlistLine = (productId: number, customerId: string, wishlistId: number): CommerceListLine => {\r\n return {\r\n CommerceListId: wishlistId,\r\n ProductId: productId,\r\n CustomerId: customerId\r\n };\r\n};\r\n\r\n/**\r\n * Utility function to prepare the product details criteria before getting full product:\r\n * @param inputData The Action Input data\r\n */\r\nexport const getProductDetailsCriteriaFromActionInput = (inputData: ICreateActionContext>): ProductDetailsCriteria => {\r\n if (inputData && inputData.config) {\r\n return {\r\n getPrice: !inputData.config.hidePrice,\r\n getRating: !inputData.config.hideRating\r\n };\r\n }\r\n return {\r\n getPrice: true,\r\n getRating: true\r\n };\r\n};\r\n\r\n/**\r\n * Transforms search text into the expected 'search terms' format, expected by refiner APIs.\r\n * @param searchText Free-form text used for searching for products or categories of products.\r\n */\r\nexport const ensureSearchTextIsFormedProperly = (searchText: string): string => {\r\n const prefix = searchText.startsWith('\\'') ? '' : '\\'';\r\n const suffix = searchText.endsWith('\\'') ? '' : '\\'';\r\n return `${prefix}${searchText}${suffix}`;\r\n};\r\n\r\nexport const ensureSafeSearchText = (searchText: string): string => {\r\n return searchText?.replace(/[^\\d\\sA-Za-z]+/g, '');\r\n};\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\nexport const buildCacheKeyWithUrlTokens = (base: string, requestContext: IRequestContext): string => {\r\n const urlTokens = requestContext.urlTokens;\r\n const defaultCacheKey = buildCacheKey(base, requestContext.apiSettings, requestContext.locale);\r\n return urlTokens ? `${defaultCacheKey}-${urlTokens.itemId}-${urlTokens.recordId}-${urlTokens.pageType}` : defaultCacheKey;\r\n};\r\n\r\n/**\r\n * Generates a key from set of arguments as inputs.\r\n *\r\n * @param args Argument list of pivots to generate key from.\r\n * @param handler Handler function for null/undefined values.\r\n */\r\n\r\ntype TKeyTypes = string | number | boolean | null | undefined;\r\ninterface IGenerateKeyOptions {\r\n separator?: string;\r\n handler?(input: null | undefined): string;\r\n}\r\nexport const generateKey = (args: TKeyTypes[], options?: IGenerateKeyOptions): string => {\r\n const { handler, separator }: IGenerateKeyOptions = { ...{ separator: '-', handler: undefined }, ...(options || {}) };\r\n return args\r\n .map(arg => {\r\n if (arg === null || arg === undefined) {\r\n if (handler) {\r\n return handler(arg);\r\n }\r\n }\r\n return arg;\r\n })\r\n .join(separator);\r\n};\r\n\r\n/**\r\n * Gets the fall back image url for a variant image.\r\n * @param itemId Item id of a product.\r\n * @param apiSettings Api setting from request context.\r\n */\r\nexport const getFallbackImageUrl = (itemId: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (!itemId) {\r\n return '';\r\n }\r\n\r\n const parsedItemId = itemId.trim().split(' ')[0];\r\n\r\n const productUrl = `Products/${parsedItemId}_000_001.png`;\r\n return generateImageUrl(productUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Converts retail proxy product dimension type to display dimension type.\r\n * @param productDimensionType - Product dimension type from retail proxy.\r\n * @returns Local dimension type.\r\n */\r\nexport const convertProductDimensionTypeToDimensionTypes = (productDimensionType: ProductDimensionType): DimensionTypes => {\r\n switch (productDimensionType) {\r\n case ProductDimensionType.Color:\r\n return DimensionTypes.color;\r\n case ProductDimensionType.Configuration:\r\n return DimensionTypes.configuration;\r\n case ProductDimensionType.Size:\r\n return DimensionTypes.size;\r\n case ProductDimensionType.Style:\r\n return DimensionTypes.style;\r\n default:\r\n return DimensionTypes.none;\r\n }\r\n};\r\n\r\n/**\r\n * Converts display dimension type to retail proxy product dimension type.\r\n * @param dimensionType - Local dimension type.\r\n * @returns Product dimension type from retail proxy.\r\n */\r\nexport const convertDimensionTypeToProductDimensionType = (dimensionType: DimensionTypes): ProductDimensionType => {\r\n switch (dimensionType) {\r\n case DimensionTypes.color:\r\n return ProductDimensionType.Color;\r\n case DimensionTypes.configuration:\r\n return ProductDimensionType.Configuration;\r\n case DimensionTypes.size:\r\n return ProductDimensionType.Size;\r\n case DimensionTypes.style:\r\n return ProductDimensionType.Style;\r\n default:\r\n return ProductDimensionType.None;\r\n }\r\n};\r\n\r\n/**\r\n * Sets dimensions to url.\r\n * @param inputUrl - Url to update.\r\n * @param productDimensions - Dimensions to set.\r\n */\r\nexport const setDimensionValuesToQuery = (inputUrl: URL, productDimensions: ProductDimension[]): void => {\r\n for (const dimension of productDimensions) {\r\n inputUrl.searchParams.set(\r\n convertProductDimensionTypeToDimensionTypes(dimension.DimensionTypeValue), dimension.DimensionValue?.Value ?? '');\r\n }\r\n\r\n window.history?.replaceState(window.history.state, '', inputUrl.toString()?.replace(inputUrl.host, window.location.host));\r\n};\r\n\r\n/**\r\n * Retrieves dimension value stored in url.\r\n * @param urlParameters - Url parameters.\r\n * @param productDimensionType - The dimension type to retrieve.\r\n * @returns Product dimension item.\r\n */\r\nconst parseDimensionFromUrl = (urlParameters: URLSearchParams, productDimensionType: ProductDimensionType): ProductDimension | undefined => {\r\n const localDimensionType = convertProductDimensionTypeToDimensionTypes(productDimensionType);\r\n const value = urlParameters.get(localDimensionType);\r\n if (!value) {\r\n return undefined;\r\n }\r\n return {\r\n DimensionTypeValue: productDimensionType,\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: value\r\n }\r\n };\r\n};\r\n\r\n/**\r\n * Retrieves all dimensions from URL.\r\n * @param urlParameters - Url parameters.\r\n * @returns Product dimensions stored in url.\r\n */\r\nconst parseDimensionsFromUrl = (urlParameters: URLSearchParams): ProductDimension[] => {\r\n const dimensionsToParse: ProductDimensionType[] = [\r\n ProductDimensionType.Color,\r\n ProductDimensionType.Configuration,\r\n ProductDimensionType.Size,\r\n ProductDimensionType.Style\r\n ];\r\n const parsedDimensions = dimensionsToParse.map(dimension => parseDimensionFromUrl(urlParameters, dimension));\r\n return ArrayExtensions.validValues(parsedDimensions);\r\n};\r\n\r\n/**\r\n * Utility function to extract the dimension values from input url querystring.\r\n * @param inputUrl - The request url.\r\n * @returns The selected dimension values.\r\n */\r\nexport const getDimensionValuesFromQuery = (inputUrl: URL): ProductDimension[] => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const dimensions: ProductDimension[] = parseDimensionsFromUrl(urlParameters);\r\n return dimensions;\r\n};\r\n","import React from 'react';\r\nimport { IMfrmBuyboxConfig } from \"..\";\r\nimport {\r\n ContentEditableEvent,\r\n IRequestContext,\r\n Text\r\n} from '@msdyn365-commerce/core';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport const BuyboxCallChat = (props: {config: IMfrmBuyboxConfig, requestContext: IRequestContext}): JSX.Element => {\r\n const {config, requestContext} = props;\r\n const telOnClick = () => {\r\n window.location.href = `tel:+${config.callChatPhoneNumber}`;\r\n };\r\n\r\n const toggleChatClick = () => {\r\n // tslint:disable: no-function-expression\r\n // tslint:disable: typedef\r\n setTimeout(function () {\r\n // eslint-disable-next-line no-eval, security/detect-eval-with-expression\r\n eval(\r\n `var elems = document.querySelectorAll('.uiButton.helpButtonEnabled, .minimizedContainer.helpButton, .sidebarHeader.minimizedContainer'); if(elems != undefined && elems.length > 0) { if(elems.length > 1){elems[1].click()} else {elems[0].click()}}`\r\n );\r\n }, 1000);\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 utag.link({\r\n event: 'chat-widget-initiated',\r\n event_type: 'chat_click',\r\n event_category: 'chat',\r\n event_action: 'click',\r\n event_label: 'chat engagement'\r\n });\r\n }\r\n };\r\n\r\n const onTextChange = (event: ContentEditableEvent) => (config.callChatMessage = event.target.value);\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \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 {\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\n/* tslint:disable: no-duplicate-imports */\r\nimport { observable } from 'mobx';\r\n\r\n\r\n/**\r\n * ListPageState class\r\n */\r\nexport class ListPageStateBuyBox {\r\n @observable public variantId: string | undefined = '';\r\n @observable public itemId: string | undefined = '';\r\n @observable public name: string | undefined = '';\r\n @observable public categoryName: string | undefined = '';\r\n @observable public productBrandName: string | undefined = '';\r\n @observable public price: string | undefined = '';\r\n @observable public productUrl: string | undefined = '';\r\n @observable public productImageUrl: string | undefined = '';\r\n @observable public productSize: string | undefined = '';\r\n}\r\n\r\n/**\r\n * ListPageStateInput - action input\r\n */\r\nexport class ListPageStateBuyBoxInput implements IActionInput {\r\n public getCacheKey = () => `ListPageStateBuyBox`;\r\n public getCacheObjectType = () => 'ListPageStateBuyBox';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport async function listPageStateAction(\r\n input: ListPageStateBuyBoxInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return new ListPageStateBuyBox();\r\n}\r\n\r\n/**\r\n * create new input for create action\r\n */\r\nexport const createListPageInput = (\r\n inputData: ICreateActionContext>\r\n): IActionInput => {\r\n return new ListPageStateBuyBoxInput();\r\n};\r\n\r\n/**\r\n * ListPageState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >listPageStateAction,\r\n input: createListPageInput\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 React from 'react';\r\n\r\nimport { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IModalDimensions } from './buybox-product-configure-mfrm';\r\n\r\nimport classnames from 'classnames';\r\n\r\nexport interface IMfrmModalDrawerViewProps {\r\n isOpen?: boolean;\r\n className?: string;\r\n isMobile: boolean;\r\n modalDimensions?: IModalDimensions[];\r\n preSelection?: IModalDimensions;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n outOfStockText: string;\r\n percentFunc(dimensionPrice: number, discountAmount: number): void;\r\n formatCurrencyFunc(dimPrice: number | undefined): void;\r\n addItemClick(\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n selectedDimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ): void;\r\n dimensionClickFunc?(): void;\r\n onCloseModal?(): void;\r\n}\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const BuyBoxSizeComponent: React.FC = props => {\r\n const { preSelection } = props;\r\n const isPreSelected = preSelection && preSelection.selectId.length && preSelection.selectedValue.length ? true : false;\r\n const [selectId, setSelectId] = React.useState();\r\n const [preSelectionPending, setPreSelectionPending] = React.useState(true);\r\n\r\n const handleKeyPress = (\r\n e: React.KeyboardEvent,\r\n highlightId: string,\r\n highlightValue: string,\r\n highlightDimensionLabel?: string\r\n ) => {\r\n if (e.keyCode === 13) {\r\n updatePricing(highlightId, highlightValue, highlightDimensionLabel, true);\r\n }\r\n };\r\n\r\n const updatePricing = (highlightId: string, highlightValue: string, highlightDimensionLabel?: string, isAddItemClick?: boolean) => {\r\n const selectHighlightId = highlightId;\r\n const selectedValue = highlightValue;\r\n const selectedDimensionLabel = highlightDimensionLabel;\r\n setSelectId(highlightId);\r\n\r\n let discountAmount = 0;\r\n let dimensionPrice = 0;\r\n\r\n props.modalDimensions &&\r\n props.modalDimensions.map(i => {\r\n if (preSelectionPending) {\r\n if (i.selectedValue === preSelection?.selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n } else {\r\n if (i.selectedValue === selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n }\r\n });\r\n\r\n if (preSelectionPending) {\r\n if (isPreSelected) {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n } else {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n\r\n if (highlightId) {\r\n selectHighlightId &&\r\n selectedValue &&\r\n props.modalDimensions &&\r\n props.addItemClick(\r\n selectHighlightId,\r\n selectedValue,\r\n props.modalDimensions[0].dropdownId,\r\n selectedDimensionLabel,\r\n isAddItemClick\r\n );\r\n } else {\r\n preSelection &&\r\n props.modalDimensions &&\r\n props.addItemClick(\r\n preSelection.selectId,\r\n preSelection.selectedValue,\r\n props.modalDimensions[0].dropdownId,\r\n preSelection.dimensionLabel,\r\n isAddItemClick\r\n );\r\n }\r\n };\r\n\r\n const returnValidPricing = (discountAmount: number, dimensionPrice: number) => {\r\n return discountAmount && dimensionPrice\r\n ? props.formatCurrencyFunc(dimensionPrice - discountAmount)\r\n : dimensionPrice\r\n ? props.formatCurrencyFunc(dimensionPrice)\r\n : '';\r\n };\r\n\r\n\r\n // if a pre-selection was made\r\n if (preSelection && isPreSelected && preSelectionPending) {\r\n updatePricing(preSelection.selectId, preSelection.selectedValue, preSelection.dimensionLabel, false);\r\n setPreSelectionPending(false);\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n

Choose a Size

\r\n {props.modalDimensions && props.modalDimensions.map((dimension: IModalDimensions) => {\r\n let isAvailable = false;\r\n for (let idx = 0; idx < props.variantAvailibilityList.length; idx++) {\r\n // tslint:disable-next-line: radix\r\n const sameSizeVariantsAvailability = props.variantAvailibilityList.filter((variant => variant.sizeDimensionRecordID === parseInt(dimension.selectId, 10)));\r\n isAvailable = sameSizeVariantsAvailability.find(variant => variant.isAvailable) ? true : false;\r\n }\r\n return (\r\n { dimension.selectId && dimension.selectedValue && updatePricing(dimension.selectId, dimension.selectedValue, dimension.dimensionLabel, true); }}\r\n // tslint:disable-next-line: jsx-no-lambda & react-this-binding-issue\r\n onKeyUp={(e) => { dimension.selectId && dimension.selectedValue && handleKeyPress(e, dimension.selectId, dimension.selectedValue, dimension.dimensionLabel); }}\r\n >\r\n
\r\n
\r\n
\r\n {dimension.selectedValue}\r\n
\r\n
\r\n {dimension.dimensionLabel}\r\n
\r\n
\r\n {isAvailable ?\r\n
\r\n {\r\n dimension && dimension.discountAmount !== undefined && dimension.dimensionPrice !== undefined\r\n ? returnValidPricing(dimension.discountAmount, dimension.dimensionPrice)\r\n : ''\r\n }\r\n
\r\n {dimension.percentDiff ? {dimension.percentDiff}% Off : null}\r\n {dimension.discountAmount ?  {props.formatCurrencyFunc(dimension.dimensionPrice)} : null}\r\n
\r\n
\r\n :\r\n
\r\n
\r\n {props.outOfStockText}\r\n
\r\n
\r\n }\r\n
\r\n \r\n );\r\n })}\r\n
\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IModalDimensions } from './buybox-product-configure-mfrm';\r\nimport { IVariantNameMappingData } from '../mfrm-buybox.props.autogenerated';\r\nimport { getCustomizedVariantName } from '../../../Utilities/get-customized-variant-name';\r\nexport interface IMfrmSizeViewProps {\r\n sizeDimensions?: IModalDimensions[];\r\n preSelection?: IModalDimensions;\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n outOfStockText: string;\r\n percentFunc(dimensionPrice: number, discountAmount: number): void;\r\n addItemClick(\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n selectedDimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ): void;\r\n variantMappingConfig: IVariantNameMappingData[] | undefined;\r\n}\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const BuyBoxSizeRedesignComponent: React.FC = props => {\r\n const { preSelection } = props;\r\n const isPreSelected = preSelection && preSelection.selectId.length && preSelection.selectedValue.length ? true : false;\r\n const [selectId, setSelectId] = React.useState();\r\n const [preSelectionPending, setPreSelectionPending] = React.useState(true);\r\n const handleKeyPress = (\r\n e: React.KeyboardEvent,\r\n highlightId: string,\r\n highlightValue: string,\r\n highlightDimensionLabel?: string\r\n ) => {\r\n if (e.keyCode === 13) {\r\n updatePricing(highlightId, highlightValue, highlightDimensionLabel, true);\r\n }\r\n };\r\n const updatePricing = (highlightId: string, highlightValue: string, highlightDimensionLabel?: string, isAddItemClick?: boolean) => {\r\n const selectHighlightId = highlightId;\r\n const selectedValue = highlightValue;\r\n const selectedDimensionLabel = highlightDimensionLabel;\r\n setSelectId(highlightId);\r\n let discountAmount = 0;\r\n let dimensionPrice = 0;\r\n props.sizeDimensions &&\r\n props.sizeDimensions.map(i => {\r\n if (preSelectionPending) {\r\n if (i.selectedValue === preSelection?.selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n } else {\r\n if (i.selectedValue === selectedValue) {\r\n discountAmount = i.discountAmount || 0;\r\n dimensionPrice = i.dimensionPrice || 0;\r\n }\r\n }\r\n });\r\n if (preSelectionPending) {\r\n if (isPreSelected) {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n } else {\r\n props.percentFunc(dimensionPrice, discountAmount);\r\n }\r\n if (highlightId) {\r\n selectHighlightId &&\r\n selectedValue &&\r\n props.sizeDimensions &&\r\n props.addItemClick(\r\n selectHighlightId,\r\n selectedValue,\r\n props.sizeDimensions[0].dropdownId,\r\n selectedDimensionLabel,\r\n isAddItemClick\r\n );\r\n } else {\r\n preSelection &&\r\n props.sizeDimensions &&\r\n props.addItemClick(\r\n preSelection.selectId,\r\n preSelection.selectedValue,\r\n props.sizeDimensions[0].dropdownId,\r\n preSelection.dimensionLabel,\r\n isAddItemClick\r\n );\r\n }\r\n };\r\n // if a pre-selection was made\r\n if (preSelection && isPreSelected && preSelectionPending) {\r\n updatePricing(preSelection.selectId, preSelection.selectedValue, preSelection.dimensionLabel, false);\r\n setPreSelectionPending(false);\r\n }\r\n return (\r\n
    \r\n {props.sizeDimensions && props.sizeDimensions.map((dimension: IModalDimensions) => {\r\n let isAvailable = false;\r\n for (let idx = 0; idx < props.variantAvailibilityList.length; idx++) {\r\n // tslint:disable-next-line: radix\r\n const sameSizeVariantsAvailability = props.variantAvailibilityList.filter((variant => variant.sizeDimensionRecordID === parseInt(dimension.selectId, 10)));\r\n isAvailable = sameSizeVariantsAvailability.find(variant => variant.isAvailable) ? true : false;\r\n }\r\n const isActive = dimension.selectId === selectId;\r\n if (isActive && isAvailable === false) {\r\n const selectedValueData = props.variantAvailibilityList.filter(item => item.sizeValue === dimension.selectedValue);\r\n const isVariantAvailableAtAll = selectedValueData.filter(item => item.isAvailable === true)?.length;\r\n const isAnyVariantAvailable = props.variantAvailibilityList.filter(item => item.isAvailable === true);\r\n if (isVariantAvailableAtAll === 0 && isAnyVariantAvailable.length !== 0) {\r\n updatePricing(isAnyVariantAvailable[0].sizeDimensionRecordID.toString(), isAnyVariantAvailable[0].sizeValue, '', true);\r\n }\r\n }\r\n const customVariantName = getCustomizedVariantName(props.variantMappingConfig, dimension.selectedValue);\r\n return (\r\n { dimension.selectId && dimension.selectedValue && updatePricing(dimension.selectId, dimension.selectedValue, dimension.dimensionLabel, true); }}\r\n // tslint:disable-next-line: jsx-no-lambda & react-this-binding-issue\r\n onKeyUp={(e) => { dimension.selectId && dimension.selectedValue && handleKeyPress(e, dimension.selectId, dimension.selectedValue, dimension.dimensionLabel); }}\r\n >\r\n \r\n \r\n );\r\n })}\r\n
\r\n );\r\n};","import { IVariantNameMappingData } from '../modules/mfrm-buybox/mfrm-buybox.props.autogenerated';\r\n\r\nexport const getCustomizedVariantName = (variantNameConfig: IVariantNameMappingData[] | undefined, originalVariantName: string): string | undefined => {\r\n const variantNameMapObject = variantNameConfig?.find((variant) => variant.originalVariantName === originalVariantName);\r\n if (variantNameMapObject?.originalVariantName === originalVariantName) {\r\n return variantNameMapObject?.customizedVariantName;\r\n }\r\n else {\r\n return originalVariantName;\r\n }\r\n};","/**\r\n * Copyright (c) 2018 Microsoft Corporation\r\n */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDropdownProps } from './';\r\nimport { IDropdownItemProps } from './dropdown.props';\r\nimport { observer } from 'mobx-react';\r\ntype IDropdownState = {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description selected index\r\n */\r\n selectedIndex: string;\r\n /**\r\n * @friendlyName preSelectionSet\r\n * @description is a preselection set for the dropdown\r\n */\r\n preSelectionSet?: boolean;\r\n};\r\n/**\r\n *\r\n * DropDown component\r\n * @extends {React.PureComponent}\r\n */\r\n@observer\r\nexport class Dropdown extends React.PureComponent {\r\n private selectMenu: React.RefObject = React.createRef();\r\n private payLoad: IPayLoad;\r\n constructor(props: IDropdownProps, state: IDropdownState) {\r\n super(props);\r\n {\r\n /* VSI Customization - START */\r\n }\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n this.state = {\r\n selectedIndex: selectedValue\r\n };\r\n {\r\n /* VSI Customization - END */\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n public componentDidMount(): void {\r\n {\r\n /* VSI Customization - START */\r\n }\r\n if (this.selectMenu.current && this.state.selectedIndex === '') {\r\n this.selectMenu.current.selectedIndex = 0;\r\n }\r\n {\r\n /* VSI Customization - END */\r\n }\r\n }\r\n public componentDidUpdate(): void {\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n selectedValue && !this.state.preSelectionSet && this.setState({ selectedIndex: selectedValue, preSelectionSet: true });\r\n }\r\n public render(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n \r\n \r\n {dropdownList.map(\r\n (item: IDropdownItemProps) => {\r\n const isAvailable = this.props.variantAvailibilityList?.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize?.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.isAvailable;\r\n const isActive = this.state.selectedIndex === item.id.toString();\r\n return (\r\n item && \r\n {item.value}\r\n \r\n );\r\n }\r\n )}\r\n \r\n );\r\n }\r\n private _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };\r\n}","import { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { getQueryParamsFromQueryByName } from '../../../../data-actions/utilities/utils';\r\nimport { variantQueryStringName } from '../../../../Utilities/constants';\r\nexport interface IListingProps {\r\n swatchName: string;\r\n dimension: IDimensionData;\r\n baseImageUrl: string;\r\n availabilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n selectedSize: string;\r\n generateOnClick(id: number, value: string, variantID: number): (e: React.MouseEvent) => void;\r\n setActiveVariant(variantID: number): void;\r\n isVariantSelectionRedesignEnabled: boolean;\r\n selectedValueAvailable: boolean | undefined;\r\n}\r\nexport interface IDimensionData {\r\n DimensionTypeValue: number;\r\n DimensionValue?: ProductDimensionValue;\r\n DimensionValues?: ProductDimensionValue[];\r\n}\r\n/**\r\n *\r\n * Listing component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nexport const _renderSlashItem = (\r\n isVariantSelectionRedesignEnabled: boolean\r\n): JSX.Element => {\r\n return (\r\n isVariantSelectionRedesignEnabled\r\n ? \r\n : \r\n );\r\n};\r\n\r\nconst Listing = (props: IListingProps) => {\r\n const render = (props: IListingProps) => {\r\n const { baseImageUrl, dimension, generateOnClick, setActiveVariant, selectedValueAvailable, isVariantSelectionRedesignEnabled } = props;\r\n return (\r\n
    \r\n {dimension.DimensionValues\r\n ? dimension.DimensionValues.map((dimensionValue, index) => {\r\n const recordID = dimensionValue.RecordId.toString();\r\n let isAvailable = false;\r\n // For value of current color variant ID\r\n let currVariantID = -1;\r\n // check variant availability list to see if variant is out of stock\r\n for (let i = 0; i < props.availabilityList.length; i++) {\r\n const colorDimensionRecordId = JSON.stringify(props.availabilityList[i].colorDimensionRecordId);\r\n if (props.selectedSize === props.availabilityList[i].sizeValue && colorDimensionRecordId === recordID) {\r\n isAvailable = props.availabilityList[i].isAvailable;\r\n currVariantID = props.availabilityList[i].variantID;\r\n }\r\n }\r\n const dimensionId = dimensionValue.DimensionId?.replace(/[/]/g, '^')?.replace(/\\s+/g, '_').toLowerCase();\r\n const selectedValue = (dimension.DimensionValue && dimension.DimensionValue.RecordId) || 'not available';\r\n const isActive = selectedValue === dimensionValue.RecordId;\r\n const url = new URL(window.location.href.toString());\r\n const isVariantIdNotAvailable = Number(getQueryParamsFromQueryByName(url, variantQueryStringName)) ? false : true;\r\n\r\n if (isActive) {\r\n if (isVariantIdNotAvailable || !selectedValueAvailable) {\r\n const element = document.getElementsByClassName(\"selected\")[0] as HTMLElement;\r\n element?.click();\r\n }\r\n setActiveVariant(currVariantID);\r\n }\r\n return (\r\n !isAvailable ?\r\n \r\n
    \r\n {/*Note: will likely eventually update generateOnClick so you can pass in dimensionValue.RecordId instead of the index*/}\r\n \r\n {_renderSlashItem(isVariantSelectionRedesignEnabled)}\r\n
    \r\n \r\n :\r\n \r\n
    \r\n {/*Note: will likely eventually update generateOnClick so you can pass in dimensionValue.RecordId instead of the index*/}\r\n \r\n
    \r\n \r\n );\r\n })\r\n : false}\r\n
\r\n );\r\n };\r\n return render(props);\r\n};\r\nexport default Listing;","/**\r\n * Copyright (c) 2018 Microsoft Corporation\r\n */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDropdownItemProps, IDropdownOnSelectionChangeNotification } from './dropdown/dropdown.props';\r\nimport { observer } from 'mobx-react';\r\nimport { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\ntype IHeightFoundationState = {\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description selected index\r\n */\r\n selectedIndex: string;\r\n /**\r\n * @friendlyName preSelectionSet\r\n * @description is a preselection set for the dropdown\r\n */\r\n preSelectionSet?: boolean;\r\n};\r\nexport interface IDimensionProps {\r\n /**\r\n * @friendlyName dropdownId\r\n * @description Id for dropdown component\r\n */\r\n dimensionId: string;\r\n /**\r\n * @friendlyName variantAvailibilityList\r\n * @description array for checking variant aviability\r\n */\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n /**\r\n * @friendlyName dropdownName\r\n * @description Name of the dropdown component\r\n */\r\n dimensionName: string;\r\n selectedSize: string;\r\n dimensionValue?: ProductDimensionValue;\r\n /**\r\n * @friendlyName dropdownList\r\n * @description List of items in dropdown\r\n */\r\n dimensionList: IDropdownItemProps[];\r\n /**\r\n * @telemetryContent telemetryContent\r\n * @description telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n /**\r\n * @friendlyName onChange\r\n * @description Callback that gets fired when when a selected dimension changes\r\n */\r\n onChange?(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n setActiveVariant(variantID: number): void;\r\n}\r\n/**\r\n *\r\n * DropDown component\r\n * @extends {React.PureComponent}\r\n */\r\n@observer\r\nexport class HeightFoundationComponent extends React.PureComponent {\r\n private selectMenu: React.RefObject = React.createRef();\r\n private payLoad: IPayLoad;\r\n constructor(props: IDimensionProps, state: IHeightFoundationState) {\r\n super(props);\r\n {\r\n /* VSI Customization - START */\r\n }\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n this.state = {\r\n selectedIndex: selectedValue\r\n };\r\n {\r\n /* VSI Customization - END */\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dimensionName);\r\n }\r\n public componentDidMount(): void {\r\n {\r\n /* VSI Customization - START */\r\n }\r\n if (this.selectMenu.current && this.state.selectedIndex === '') {\r\n this.selectMenu.current.selectedIndex = 0;\r\n }\r\n {\r\n /* VSI Customization - END */\r\n }\r\n }\r\n public componentDidUpdate(): void {\r\n const selectedValue = this.props?.dimensionValue?.RecordId?.toString() || '';\r\n selectedValue && !this.state.preSelectionSet && this.setState({ selectedIndex: selectedValue, preSelectionSet: true });\r\n }\r\n public render(): JSX.Element {\r\n const { dimensionList } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n <>\r\n
    \r\n {dimensionList.map(\r\n (item) => {\r\n const isAvailable = this.props.variantAvailibilityList.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.isAvailable;\r\n const isActive = this.state.selectedIndex === item.id.toString();\r\n const classNames = !isAvailable ? 'msc-dimensions-wrapper msc-dimensions-wrapper-disable' : isActive ? 'msc-dimensions-wrapper msc-dimensions-wrapper-active' : 'msc-dimensions-wrapper';\r\n const currentVariantId = this.props.variantAvailibilityList.find(dim => dim.sizeValue.toLowerCase() === this.props.selectedSize.toLowerCase() && dim.colorDimensionRecordId.toString() === item.id)?.variantID;\r\n if (isActive) {\r\n currentVariantId && this.props.setActiveVariant(currentVariantId);\r\n }\r\n return (\r\n item && this._handleOnClick(item.id, item.value)}\r\n role='button'\r\n >\r\n \r\n \r\n );\r\n }\r\n )}\r\n
\r\n \r\n );\r\n }\r\n private _handleOnClick = async (selectedId: string, selectedValue: string) => {\r\n this.setState({ selectedIndex: selectedId });\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dimensionId,\r\n selectId: selectedId,\r\n selectedValue: selectedValue\r\n });\r\n }\r\n };\r\n}\r\n","import { getConfigureErrors, getGenericError, getQuantityError } from '@msdyn365-commerce-modules/buybox';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, getTelemetryObject, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { IAddToCartFailureResult } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport AddToCartComponent from '../../../themes/mattressfirm/views/components/addtocart';\r\nimport _getInventoryQuantity from '../../../Utilities/get-inventory-quantity';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxResources } from '../mfrm-buybox.props.autogenerated';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IMfrmBuyboxAddToCartViewProps {\r\n ContainerProps?: INodeProps;\r\n errorBlock?: React.ReactNode;\r\n button?: React.ReactNode;\r\n}\r\nexport interface IBuyboxErrorBlockProps {\r\n configureErrors: { [configureId: string]: string | undefined };\r\n quantityError?: string;\r\n customAmountError?: string;\r\n otherError?: string;\r\n resources: IMfrmBuyboxResources;\r\n showError: boolean;\r\n}\r\n\r\nlet telemetryContent: ITelemetryContent;\r\nlet outOfStockSmallParcel: boolean = false;\r\nlet outOfStockBoolean: boolean | undefined = false;\r\nexport const BuyboxErrorBlock: React.FC = ({ showError, configureErrors, quantityError, customAmountError, otherError, resources }) => {\r\n let errorMessages: (string | undefined)[] = [];\r\n\r\n errorMessages = Object.values(configureErrors).filter(message => message !== undefined);\r\n\r\n if (quantityError) {\r\n errorMessages.push(quantityError);\r\n }\r\n\r\n if (customAmountError) {\r\n errorMessages.push(customAmountError);\r\n }\r\n\r\n if (otherError) {\r\n errorMessages.push(otherError);\r\n }\r\n\r\n return (\r\n 0}\r\n color='danger'\r\n assertive={true}\r\n aria-label={resources.buyboxErrorMessageHeader}\r\n >\r\n \r\n {errorMessages.map((message, index) => {\r\n return (\r\n
\r\n {message}\r\n
\r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\n// tslint:disable-next-line:max-func-body-length cyclomatic-complexity\r\nexport function mfrmgetBuyboxAddToCart(\r\n props: IBuyboxViewPropsExtended,\r\n defaultMinimumKeyInPrice: number,\r\n defaultMaximumKeyInPrice: number,\r\n variantOutOfStock: boolean,\r\n itemOutOfMarket: boolean,\r\n outOfStockSmallParcelState: boolean,\r\n adjustableItem: SimpleProduct | undefined,\r\n pillow: SimpleProduct | undefined,\r\n protector: SimpleProduct | undefined\r\n): IMfrmBuyboxAddToCartViewProps {\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n product: { result: product },\r\n productPrice: { result: productPrice },\r\n productAvailableQuantity: { result: productAvailableQuantity },\r\n productSpecificationData,\r\n categoryPaths\r\n },\r\n resources,\r\n config: { minimumKeyInPrice, maximumKeyInPrice },\r\n app: {\r\n config: { brandBackofficeAttributePdp }\r\n }\r\n } = props;\r\n const allCategoriesArr = categoryPaths?.result;\r\n const categoryObj = allCategoriesArr && allCategoriesArr[allCategoriesArr?.length - 1];\r\n const categoryName: string | undefined = categoryObj ? `${categoryObj?.Name}` : undefined;\r\n const fallBackBrandAttribute = 'VENDOR BRAND';\r\n const attribute = brandBackofficeAttributePdp || fallBackBrandAttribute;\r\n const attributes = productSpecificationData.result;\r\n let productBrandName =\r\n attributes &&\r\n attributes.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attribute.toLowerCase().trim())\r\n ?.TextValue;\r\n productBrandName = productBrandName ? `${productBrandName}` : undefined;\r\n const {\r\n quantity,\r\n errorState: { configureErrors, quantityError, customAmountError, otherError, errorHost },\r\n selectedProduct,\r\n isUpdatingDimension,\r\n isUpdatingDeliveryOptions,\r\n isServiceItem,\r\n keyInPriceAmount\r\n } = props.state;\r\n let allVariantOOS = false;\r\n const { ecomAllVairantStockInfoConcatenated } = props;\r\n if (ecomAllVairantStockInfoConcatenated && ecomAllVairantStockInfoConcatenated.length > 0) {\r\n for (let i = 0;i < props.ecomAllVairantStockInfoConcatenated.length;i++) {\r\n const variantIdOOS = ecomAllVairantStockInfoConcatenated[i].split('|');\r\n if (variantIdOOS && variantIdOOS[0] && variantIdOOS[1] && variantIdOOS[1] !== '0') {\r\n allVariantOOS = true;\r\n } else {\r\n allVariantOOS = false;\r\n break;\r\n }\r\n }\r\n }\r\n const lastBreadcrumbCategoryLink = categoryPaths && categoryPaths.result && categoryPaths?.result[categoryPaths?.result.length - 1];\r\n const outOfStockValue = productSpecificationData.result?.filter((specificationData) => {\r\n return specificationData.Name?.trim().toLowerCase() === props.context.app.config.outOfStockProductKey?.trim().toLowerCase();\r\n });\r\n\r\n const shippingInformationSmall = productSpecificationData.result?.find(\r\n attr => attr.Name?.trim() === props.context.app.config.smallParcelAttributeKey\r\n )?.TextValue;\r\n outOfStockBoolean = outOfStockValue && outOfStockValue[0] && outOfStockValue[0].BooleanValue;\r\n outOfStockBoolean ? (outOfStockSmallParcel = true) : (outOfStockSmallParcel = false);\r\n if (outOfStockBoolean === null || outOfStockBoolean === undefined) {\r\n outOfStockSmallParcel = false;\r\n }\r\n\r\n // checked product small parcel and drop ship product type\r\n if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Drop Ship') {\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n } else if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Small Parcel') {\r\n // tslint:disable-next-line: no-floating-promises\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n const checkSPAvailibility = props.state?.variantAvailibilityList?.find((variant) => variant.variantID === product?.RecordId);\r\n if (checkSPAvailibility && !checkSPAvailibility?.isAvailable) {\r\n if (!props.state?.variantAvailibilityList?.some(variant => variant.isAvailable && variant.variantID !== product?.RecordId)) {\r\n outOfStockSmallParcel = true;\r\n }\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n }\r\n } else if (shippingInformationSmall && _getProductType(shippingInformationSmall.toLowerCase()) === 'Core') {\r\n if (outOfStockBoolean) {\r\n outOfStockSmallParcel = true;\r\n } else {\r\n outOfStockSmallParcel = false;\r\n }\r\n }\r\n const productAvailability = props.state.productAvailableQuantity\r\n ? props.state.productAvailableQuantity.ProductAvailableQuantity\r\n : productAvailableQuantity && productAvailableQuantity.length\r\n ? productAvailableQuantity[0].ProductAvailableQuantity\r\n : undefined;\r\n\r\n const onAddToCartFailed = (result: IAddToCartFailureResult) => {\r\n let quantityErrorForState: string | undefined;\r\n let customAmountErrorForState: string | undefined;\r\n // VSI Performance Customization - used cart props.data.cart.result\r\n let otherErrorForState: string | undefined = getGenericError(\r\n result,\r\n props.data.cart.result,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n undefined\r\n );\r\n\r\n if (result.failureReason === 'OUTOFSTOCK') {\r\n quantityErrorForState = result.failureReason === 'OUTOFSTOCK' ? getQuantityError(result.stockLeft, resources) : undefined;\r\n } else if (\r\n result.failureReason === 'CARTACTIONFAILED' &&\r\n result.cartActionResult &&\r\n (result.cartActionResult.substatus === 'MAXQUANTITY' || result.cartActionResult.substatus === 'QUANTITYLIMITS')\r\n ) {\r\n // VSI Performance Customization - used cart props.data.cart.result\r\n quantityErrorForState = getGenericError(\r\n result,\r\n props.data.cart.result,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n undefined\r\n );\r\n otherErrorForState = undefined; // prevent error duplication in otherError and quantityError\r\n }\r\n\r\n if (result.failureReason === 'INVALIDCUSTOMAMOUNT') {\r\n if (keyInPriceAmount === undefined || keyInPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(minimumKeyInPrice || defaultMinimumKeyInPrice);\r\n customAmountErrorForState = resources.invalidSmallCustomAmountText?.replace('{minAmount}', formatedAmountLimit);\r\n } else if (keyInPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice)) {\r\n const formatedAmountLimit = props.context.cultureFormatter.formatCurrency(maximumKeyInPrice || defaultMaximumKeyInPrice);\r\n customAmountErrorForState = resources.invalidLargeCustomAmountText?.replace('{maxAmount}', formatedAmountLimit);\r\n }\r\n }\r\n\r\n props.callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n quantityError: quantityErrorForState,\r\n configureErrors:\r\n result.failureReason === 'MISSINGDIMENSION'\r\n ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard)\r\n : {},\r\n customAmountError: customAmountErrorForState,\r\n otherError: otherErrorForState\r\n });\r\n };\r\n\r\n const dialogStrings = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=240&h=240&m=6`, w: 0, h: 0 },\r\n xl: { q: `w=240&h=240&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const isLoading = props.data.productAvailableQuantity.status === 'LOADING';\r\n if (isLoading) {\r\n props.callbacks.changeUpdatingDimension(false);\r\n }\r\n\r\n const isLoadingDeliveryOptions = typeName !== 'quickview' && props.data.deliveryOptions?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions && props.callbacks.changeUpdatingDeliveryOptions) {\r\n props.callbacks.changeUpdatingDeliveryOptions(false);\r\n }\r\n\r\n telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = props.data.deliveryOptions?.result;\r\n const isEmailDelivery =\r\n deliveryOptions &&\r\n deliveryOptions.DeliveryOptions &&\r\n ArrayExtensions.hasElements(deliveryOptions.DeliveryOptions) &&\r\n deliveryOptions.DeliveryOptions[0].Code === emailDeliveryModeCode;\r\n\r\n const successfulATC = props.state.successfulATC;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__add-to-cart-container'\r\n },\r\n button: product && (\r\n <>\r\n \r\n \r\n ),\r\n errorBlock: (\r\n \r\n )\r\n };\r\n}\r\n\r\nconst _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\nconst _isOrderQuantityLimitsFeatureEnabled = (props: IBuyboxViewPropsExtended): boolean | undefined => {\r\n const defaultOrderQuantityLimitsFeatureConfig = props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n\r\n const customerInfo = props.data.customerInformation.result;\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxAddToCartViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { mfrmgetBuyboxAddToCart } from './addtocart';\r\n\r\nexport const BuyboxAddToCart = (props:{\r\n addToCart: IBuyboxAddToCartViewProps,\r\n buyboxProps: IBuyboxViewPropsExtended,\r\n variantOutOfStock: boolean,\r\n itemOutOfMarket: boolean,\r\n outOfStockSmallParcelState: boolean,\r\n adjustableItem: SimpleProduct | undefined,\r\n pillow: SimpleProduct | undefined,\r\n protector: SimpleProduct | undefined\r\n}): JSX.Element => {\r\n const {addToCart, buyboxProps, variantOutOfStock, itemOutOfMarket, outOfStockSmallParcelState, adjustableItem, pillow, protector} = props;\r\n const { ContainerProps } = addToCart;\r\n const mfrmDefaultMinimumKeyInPrice = 10;\r\n const mfrmDefaultMaximumKeyInPrice = 100;\r\n // tslint:disable-next-line:max-line-length\r\n const mfrmAddToCart = mfrmgetBuyboxAddToCart(\r\n buyboxProps,\r\n mfrmDefaultMinimumKeyInPrice,\r\n mfrmDefaultMaximumKeyInPrice,\r\n variantOutOfStock,\r\n itemOutOfMarket,\r\n outOfStockSmallParcelState,\r\n adjustableItem,\r\n pillow,\r\n protector\r\n ); // mfrmgetBuyboxAddToCart(props, props.state, props.callbacks, mfrmDefaultMinimumKeyInPrice, mfrmDefaultMaximumKeyInPrice);\r\n\r\n return (\r\n \r\n {mfrmAddToCart && mfrmAddToCart.errorBlock}\r\n {mfrmAddToCart && mfrmAddToCart.button}\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\n\r\nexport const BuyboxViewCartLink = (props: IBuyboxViewPropsExtended) => {\r\n return (\r\n \r\n \r\n \r\n {props.resources.viewCartLinkText}\r\n \r\n \r\n \r\n );\r\n};","import React from 'react';\r\n\r\nexport const BuyboxSocialShare = (props: {socialShare: React.ReactNode[]}): JSX.Element | null => {\r\n const { socialShare } = props;\r\n if (!socialShare || socialShare?.length === 0) {\r\n return null;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n","import React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IBuyboxFindInStoreViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport const BuyboxFindInStore = (props: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const {\r\n ContainerProps,\r\n storeSelector,\r\n heading,\r\n description,\r\n errors,\r\n button,\r\n modal,\r\n productPickupOptionList\r\n } = props;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};","import * as React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\n\r\nexport interface ISleepExpertSummaryComponentProps {\r\n sleepExpertOpinionHeadingText : RichText,\r\n sleepExpertSummaryText?:string;\r\n }\r\nexport const SleepExpertSummaryComponent: React.FC = ({sleepExpertOpinionHeadingText,sleepExpertSummaryText}) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {sleepExpertSummaryText}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default SleepExpertSummaryComponent;","import React from 'react';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { SleepExpertSummaryComponent } from '../../../themes/mattressfirm/custom-components/sleep-expert-summary-component';\r\n\r\n\r\nexport const BuyboxSleepExpertSummary = (props:{buyboxProps: IBuyboxViewPropsExtended, sleepExpertSummaryText: string | undefined}): JSX.Element => {\r\n const {buyboxProps, sleepExpertSummaryText} = props;\r\n const sleepExpertOpinionHeadingText = buyboxProps.config.sleepExpertOpinionHeadingText ?? '';\r\n return sleepExpertSummaryText ? (\r\n \r\n ) : (\r\n <>\r\n );\r\n};","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IMfrmBuybox containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum titleHeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IMfrmBuyboxConfig extends Msdyn365.IModuleConfig {\r\n showBVRatings?: boolean;\r\n eComDisplayColorAsDropDown?: string;\r\n eComDisplayColorLabel?: string;\r\n titleHeadingTag?: titleHeadingTag;\r\n className?: string;\r\n variantNameMapping?: IVariantNameMappingData[];\r\n enableShopSimilarLooks?: boolean;\r\n renderOOBMediaGallery?: boolean;\r\n enableShopSimilarDescription?: boolean;\r\n enableKeyInPrice?: boolean;\r\n minimumKeyInPrice?: number;\r\n maximumKeyInPrice?: number;\r\n callChatPhoneNumber?: string;\r\n callChatMessage?: string;\r\n productId?: string;\r\n progressiveLeasingEstimator?: IProgressiveLeasingEstimatorData;\r\n targetAudienceGroup?: string;\r\n enableVariantSelectionRedesign?: boolean;\r\n cSatRatingHeadingText?: string;\r\n cSatRatingPopoverText?: string;\r\n sleepExpertOpinionHeadingText?: Msdyn365.RichText;\r\n}\r\n\r\nexport interface IMfrmBuyboxResources {\r\n closeNotificationLabel: string;\r\n findInStoreNotAvailableTextButton: string;\r\n findInStoreNotAvailableDescription: string;\r\n findInStoreLinkText: string;\r\n findInStoreHeaderText: string;\r\n findInStoreDescriptionText: string;\r\n priceFree: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n addToCartText: string;\r\n addToCartProductsText: string;\r\n viewCartLinkText: string;\r\n outOfStockText: string;\r\n averageRatingAriaLabel: string;\r\n selectDimensionFormatString: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeConfiguration: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeAmount: string;\r\n createOrderTemplateHeader: string;\r\n orderTemplateTitle: string;\r\n orderTemplateNameAriaLabel: string;\r\n createOrderTemplateDescription: string;\r\n createNewOrderTemplateButtonText: string;\r\n createOrderTemplateButtonText: string;\r\n cancelNewOrderTemplateCreationButtonText: string;\r\n defaultOrderTemplateName: string;\r\n addToOrderTemplateHeader: string;\r\n addToOrderTemplateButtonTooltip: string;\r\n noOrderTemplatesMessage: string;\r\n noOrderTemplatesDescription: string;\r\n createAnOrderTemplateButtonText: string;\r\n cancelOrderTemplateCreationButtonText: string;\r\n selectTemplatesText: string;\r\n addToTemplateButtonText: string;\r\n lineItemsText: string;\r\n addToOrderTemplateButtonText: string;\r\n addToOrderTemplateMessage: string;\r\n addItemToOrderTemplateError: string;\r\n viewOrderTemplateButtonText: string;\r\n continueShoppingButtonText: string;\r\n itemAddedToOrderTemplateHeaderItemOneText: string;\r\n itemAddedToOrderTemplateHeaderItemFormatText: string;\r\n itemAddedToOrderTemplateHeaderMessageText: string;\r\n duplicatedProductsHeader: string;\r\n duplicatedProductsDescription: string;\r\n updateQuantityButtonText: string;\r\n cancelDuplicateItemsButtonText: string;\r\n addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n nameOfWishlist: string;\r\n inputQuantityAriaLabel: string;\r\n addToWishlistMessage: string;\r\n removedFromWishlistMessage: string;\r\n addItemToWishlistError: string;\r\n removeItemFromWishlistError: string;\r\n productQuantityHeading: string;\r\n errorMessageOutOfStock: string;\r\n errorMessageOutOfRangeOneLeft: string;\r\n errorMessageOutOfRangeFormat: string;\r\n productDimensionTypeColorErrorMessage: string;\r\n productDimensionTypeConfigurationErrorMessage: string;\r\n productDimensionTypeSizeErrorMessage: string;\r\n productDimensionTypeStyleErrorMessage: string;\r\n productDimensionTypeAmountErrorMessage: string;\r\n buyboxErrorMessageHeader: string;\r\n addedToCartFailureMessage: string;\r\n maxQuantityLimitText: string;\r\n invalidSmallCustomAmountText: string;\r\n invalidLargeCustomAmountText: string;\r\n shopSimilarLooksText: string;\r\n shopSimilarDescriptionText: string;\r\n buyBoxGoToCartText: string;\r\n buyBoxContinueShoppingText: string;\r\n buyBoxSingleItemText: string;\r\n buyBoxMultiLineItemFormatText: string;\r\n buyBoxHeaderMessageText: string;\r\n maxQuantityText: string;\r\n minQuantityText: string;\r\n addedQuantityText: string;\r\n buyboxKeyInPriceLabelHeading: string;\r\n descriptionTextToShowAllPickupOptions: string;\r\n availableInStoresText: string;\r\n notAvailableInStoresText: string;\r\n availableInStoresTextV2: string;\r\n notAvailableInStoresTextV2: string;\r\n onlineOnlyProductsText: string;\r\n deliveryBy: string;\r\n changeZipCode: string;\r\n enterZipCode: string;\r\n mfrmOutOfStockText: string;\r\n mfrmContinueShoppingText: string;\r\n mfrmInvalidZipCode: string;\r\n informationIconText: string;\r\n priceRangeSeparator: string;\r\n bulkPurchaseLinkText: string;\r\n viewStoreDetailsText: string;\r\n changeStoreText: string;\r\n storeOpenAtHours: string;\r\n storeCloseAtHours: string;\r\n storeHoursClosedText: string;\r\n swatchItemAriaLabel: string;\r\n salesAgreementPricePrompt: string;\r\n salesAgreementExpirationDatePrompt: string;\r\n salesAgreementCommittedQuantityPrompt: string;\r\n salesAgreementRemainingQuantityPrompt: string;\r\n}\r\n\r\nexport interface IVariantNameMappingData {\r\n originalVariantName?: string;\r\n customizedVariantName?: string;\r\n}\r\n\r\nexport const enum ProgressiveLeasingEstimatorRequestType {\r\n pdp = 'pdp',\r\n checkoutPdp = 'checkoutPdp'\r\n}\r\n\r\nexport const enum ProgressiveLeasingEstimatorPayFrequency {\r\n weekly = 'weekly',\r\n biWeekly = 'biWeekly',\r\n semiMonthly = 'semiMonthly',\r\n monthly = 'monthly'\r\n}\r\n\r\nexport interface IProgressiveLeasingEstimatorData {\r\n infoText: string;\r\n progressiveLogo?: Msdyn365.IImageData;\r\n estimatorLink?: IEstimatorLinkData;\r\n requestType: ProgressiveLeasingEstimatorRequestType;\r\n payFrequency: ProgressiveLeasingEstimatorPayFrequency;\r\n storeId: string;\r\n approveMeName?: string;\r\n approveMeSlugValue?: string;\r\n}\r\n\r\nexport interface IEstimatorLinkData {\r\n linkText?: string;\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IMfrmBuyboxProps extends Msdyn365.IModule {\r\n resources: IMfrmBuyboxResources;\r\n config: IMfrmBuyboxConfig;\r\n slots: {\r\n mediaGallery: React.ReactNode[];\r\n storeSelector: React.ReactNode[];\r\n textBlocks: React.ReactNode[];\r\n socialShare: React.ReactNode[];\r\n mfrmStoreSelector: React.ReactNode[];\r\n mfrmMediaGallery: React.ReactNode[];\r\n additionalModules: React.ReactNode[];\r\n stylesAndDisruptorsModules: React.ReactNode[];\r\n completeYourBed: React.ReactNode[];\r\n chooseYourFoundationModule: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport React, { useEffect, useState } from 'react';\r\n\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport {\r\n IProgressiveLeasingEstimatorData,\r\n ProgressiveLeasingEstimatorPayFrequency,\r\n ProgressiveLeasingEstimatorRequestType\r\n} from '../mfrm-buybox.props.autogenerated';\r\n\r\nexport interface IMfrmProgressiveLeasingEstimatorProps {\r\n progressiveLeasingEstimator: IProgressiveLeasingEstimatorData;\r\n productPrice: number;\r\n ctx: Msdyn365.IRequestContext;\r\n isLeaseActive: boolean;\r\n}\r\n\r\nexport const MfrmProgressiveLeasingEstimator: React.FC = props => {\r\n const { infoText, estimatorLink } = props.progressiveLeasingEstimator;\r\n const [isOpen, setModalStatus] = useState(false);\r\n let estimatorUrl = buildEstimatorURL(props.progressiveLeasingEstimator, props.productPrice);\r\n // If MSFT suggests us to use imageSettings, we will uncomment this piece of code (linked to line : 73)\r\n // const imageProps = {\r\n // gridSettings: props.ctx.gridSettings || {},\r\n // imageSettings: progressiveLogo && progressiveLogo.imageSettings,\r\n // };\r\n\r\n const _openModal = (e: React.MouseEvent) => {\r\n if (!props.isLeaseActive) {\r\n e.preventDefault();\r\n } else {\r\n fireAnalyticsLink({\r\n eventName: 'internal navigation',\r\n eventCategory: 'internal links',\r\n eventAction: 'to: Progressive Leasing modal',\r\n eventLabel: `from PDP financing “${estimatorLink?.linkText}” link`,\r\n eventNoninteraction: 'false'\r\n });\r\n setModalStatus(true);\r\n }\r\n };\r\n\r\n const _closeModal = () => {\r\n setModalStatus(false);\r\n };\r\n\r\n useEffect(() => {\r\n const iframe = Msdyn365.msdyn365Commerce.isBrowser && document.querySelector('.msc-modal__iframe');\r\n if (iframe) {\r\n if (!isOpen) {\r\n (iframe as HTMLIFrameElement).src = 'about:blank';\r\n } else {\r\n (iframe as HTMLIFrameElement).src = estimatorUrl!;\r\n }\r\n }\r\n }, [isOpen]);\r\n\r\n useEffect(() => {\r\n estimatorUrl = buildEstimatorURL(props.progressiveLeasingEstimator, props.productPrice);\r\n }, [props.productPrice]);\r\n\r\n return (\r\n <>\r\n
\r\n
or {infoText?.replace(/\\u2028/, '')}\r\n \r\n {estimatorLink?.linkText || 'Link'}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {/* // TODO: Remove the hardcoding once MSFT fixes the issue with imageSettings */}\r\n {/* */}\r\n \r\n {
\r\n
\r\n \r\n );\r\n};\r\n\r\nconst buildEstimatorURL = (progressiveLeasingEstimator: IProgressiveLeasingEstimatorData, itemCost: number) => {\r\n const { storeId, estimatorLink, requestType, payFrequency, approveMeName, approveMeSlugValue } = progressiveLeasingEstimator;\r\n\r\n // base url\r\n const estimatorURL =\r\n (estimatorLink &&\r\n estimatorLink.linkUrl &&\r\n estimatorLink.linkUrl.destinationUrl &&\r\n new URL(estimatorLink.linkUrl.destinationUrl?.replace('#', '%23'))) ||\r\n undefined;\r\n\r\n // add params\r\n const requestTypeValue = getRequestType(requestType);\r\n requestTypeValue && estimatorURL?.searchParams.append('requestType', requestTypeValue);\r\n\r\n const payFrequencyValue = getPayFrequency(payFrequency);\r\n payFrequencyValue && estimatorURL?.searchParams.append('payFrequency', payFrequencyValue);\r\n\r\n estimatorURL?.searchParams.append('storeId', storeId);\r\n estimatorURL?.searchParams.append('itemCost', itemCost.toString());\r\n\r\n approveMeName && estimatorURL?.searchParams.append('approveMeName', approveMeName);\r\n approveMeSlugValue && estimatorURL?.searchParams.append('approveMeSlugValue', approveMeSlugValue);\r\n\r\n const stateCode = getStateCode();\r\n stateCode && estimatorURL?.searchParams.append('stateCode', stateCode);\r\n\r\n return estimatorURL ? decodeURIComponent(estimatorURL.href) : undefined;\r\n};\r\n\r\nconst getRequestType = (type: ProgressiveLeasingEstimatorRequestType) => {\r\n switch (type) {\r\n case ProgressiveLeasingEstimatorRequestType.pdp:\r\n return 'pdp';\r\n case ProgressiveLeasingEstimatorRequestType.checkoutPdp:\r\n return 'checkout-pdp';\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\nconst getPayFrequency = (frequency: ProgressiveLeasingEstimatorPayFrequency) => {\r\n switch (frequency) {\r\n case ProgressiveLeasingEstimatorPayFrequency.weekly:\r\n return 'weekly';\r\n case ProgressiveLeasingEstimatorPayFrequency.biWeekly:\r\n return 'biWeekly';\r\n case ProgressiveLeasingEstimatorPayFrequency.semiMonthly:\r\n return 'semiMonthly';\r\n case ProgressiveLeasingEstimatorPayFrequency.monthly:\r\n return 'monthly';\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n// TODO: will use MaxMind Geolocation to get state code in the future\r\nconst getStateCode = (): string | undefined => {\r\n const prefferedStoreData = localStorage.getItem('_mfrm__prefferedStore_');\r\n const parsedPrefferedStoreData = prefferedStoreData && JSON.parse(prefferedStoreData);\r\n\r\n return parsedPrefferedStoreData?.State;\r\n};\r\n","import React from 'react';\r\nimport { IProgressiveLeasingEstimatorData } from '../mfrm-buybox.props.autogenerated';\r\nimport {\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport { MfrmProgressiveLeasingEstimator } from './progressive-leasing-estimator';\r\n\r\nexport const BuyboxProgressiveLeasingEstimator = (\r\n props: {\r\n progressiveLeasingEstimator: IProgressiveLeasingEstimatorData,\r\n productPrice: number,\r\n ctx: IRequestContext,\r\n leaseState: boolean\r\n }\r\n): JSX.Element | null => {\r\n const {\r\n progressiveLeasingEstimator,\r\n productPrice,\r\n ctx,\r\n leaseState\r\n } = props;\r\n return (\r\n \r\n );\r\n};\r\n","import React from 'react';\r\nimport { FinancingPerMonthComponent } from '../../../themes/mattressfirm/custom-components/financing-per-month-component';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\nimport { IMfrmBuyBoxData } from '../mfrm-buybox.view';\r\n\r\nexport const BuyboxFinancingPerMonth = (\r\n props:{\r\n buyboxProps: IBuyboxViewPropsExtended & IMfrmBuyboxProps,\r\n originalPrice: number | undefined,\r\n discountValue: number | undefined,\r\n productPrice: number | undefined,\r\n categoryName: string | undefined,\r\n activeVariantId: number | undefined,\r\n productId: number | undefined,\r\n activeColorVariantId: number | undefined,\r\n isLoadedPriceComponent: boolean | undefined,\r\n parentCategory?: string | undefined\r\n }\r\n): JSX.Element => {\r\n const {\r\n buyboxProps,\r\n originalPrice,\r\n discountValue,\r\n productPrice,\r\n categoryName,\r\n activeVariantId,\r\n productId,\r\n activeColorVariantId,\r\n isLoadedPriceComponent,\r\n parentCategory\r\n } = props;\r\n const percentageDiscount = discountValue && originalPrice && (discountValue / originalPrice) * 100;\r\n return (\r\n \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 { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\n// VSI Customization - end\r\nimport {\r\n HtmlHeadInclude,\r\n IImageData,\r\n ILinkData,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\n// VSI Customization - starts\r\nimport { AsyncResult, AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Dayjs } from 'dayjs';\r\nimport * as React from 'react';\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { IStoreSelectorState } from '../../data-actions/store-selector-state';\r\nimport _getDeliveryByMessage from '../../Utilities/get-delivery-by-message';\r\n\r\n/** VSI Customization - Start */\r\nimport _getInventoryQuantity from '../../Utilities/get-inventory-quantity';\r\nimport { BuyboxProductConfigureMfrm } from './components/buybox-product-configure-mfrm';\r\n/** VSI Customization - End */\r\nimport { IBuyboxViewPropsExtended } from './types';\r\nimport { IMfrmBuyboxData } from './mfrm-buybox.data';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../data-actions/buybox-get-dimension-pricing-action';\r\n\r\nimport CustomSkeleton from '../../themes/mattressfirm/custom-components/CustomSkeleton';\r\n\r\nimport { BuyboxCallChat } from './components/buybox-call-chat';\r\nimport { BuyboxAddToCart } from './components/buybox-add-to-cart';\r\nimport { BuyboxViewCartLink } from './components/buybox-view-cart-link';\r\nimport { BuyboxSocialShare } from './components/buybox-social-share';\r\nimport { BuyboxFindInStore } from './components/buybox-find-in-store';\r\nimport { BuyboxSleepExpertSummary } from './components/buybox-sleep-expert-summary';\r\nimport { BuyboxProgressiveLeasingEstimator } from './components/buybox-progressive-leasing-estimator';\r\nimport { BuyboxFinancingPerMonth } from './components/buybox-financing-per-month';\r\nimport { BuyboxDeliveryByMessage } from './components/buybox-devliery-by-message';\r\nimport { _smallParcelProductATPCallForInventoryStatus } from '../../Utilities/mfrm-buybox-utils';\r\nimport { ErrorBoundary } from '../../common/components/error-boundary';\r\nimport useVwoClientInstance from '../../common/hooks/useVwoClientInstance';\r\n\r\n// TODO: remove this interface and all references to it\r\nexport interface IMfrmBuyBoxData extends IMfrmBuyboxData {\r\n productSpecificationData: AsyncResult;\r\n dimensionPrices: AsyncResult;\r\n allVariants: AsyncResult;\r\n storeSelectorStateManager: AsyncResult;\r\n storeSelectorState: AsyncResult;\r\n categoryPaths: AsyncResult;\r\n allProductVariants: AsyncResult;\r\n}\r\n\r\nexport interface IBrandLinkData {\r\n linkText?: string;\r\n linkUrl: ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IVariantStockInfo {\r\n VariantRecID: number;\r\n OutOfStock: boolean;\r\n}\r\n\r\nexport interface IBrandListData {\r\n brandName: string;\r\n brandLogo: IImageData;\r\n logoHeight?: number;\r\n brandLink?: IBrandLinkData;\r\n brandLeadtime?: string;\r\n}\r\n\r\nexport interface IMfrmAtpMessage {\r\n Message?: string;\r\n}\r\n\r\nexport interface IBadgeData {\r\n src: string;\r\n alt: string;\r\n start: Dayjs;\r\n end: Dayjs;\r\n}\r\n\r\nconst setActiveSwatchSelected = (\r\n variantID: number,\r\n outOfStock: boolean,\r\n setOutOfStock: (outOfStock: boolean) => void,\r\n avList: IBuyboxGetDimensionVariantAvailabilityActionData[]\r\n): void => {\r\n if (variantID < 0) {\r\n return;\r\n }\r\n if (avList?.length) {\r\n for (let variantsIDIter = 0; variantsIDIter < avList.length; variantsIDIter++) {\r\n if (avList[variantsIDIter].variantID === variantID) {\r\n if (outOfStock !== !avList[variantsIDIter].isAvailable) {\r\n setOutOfStock(!avList[variantsIDIter].isAvailable);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n};\r\n\r\n// tslint:disable-next-line\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n /*addToWishlist,*/\r\n findInStore,\r\n title,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n /*addToOrderTemplate*/\r\n productBadges,\r\n ratingComponent,\r\n tryInStoreComponent,\r\n promotionalMessage,\r\n customerSatisfactionScore,\r\n adjustableItem,\r\n pillow,\r\n protector,\r\n config: {\r\n progressiveLeasingEstimator,\r\n renderOOBMediaGallery\r\n },\r\n slots: { mfrmStoreSelector, mediaGallery, mfrmMediaGallery, additionalModules, stylesAndDisruptorsModules, chooseYourFoundationModule, completeYourBed },\r\n data: { product, productSpecificationData, categoryPaths: { result } }\r\n } = props;\r\n {\r\n /* VSI Customization - START */\r\n }\r\n let parentCategory = result && result[0]?.Name ? result[0]?.Name?.toLowerCase() : '';\r\n parentCategory = parentCategory === 'mattresses' || parentCategory === 'pillows' || parentCategory === 'bedding' ? parentCategory : 'default';\r\n const dimensionRows = parentCategory === 'pillows' ? 1 : 2;\r\n const AttributeValues = productSpecificationData.result;\r\n const productPrice = props.state.productPrice?.CustomerContextualPrice;\r\n const originalPrice = props.state.productPrice?.AdjustedPrice;\r\n const discountValue = props.state.productPrice?.DiscountAmount;\r\n const productId = props.state.productPrice?.ProductId;\r\n const productIdPrefix = (props.app.config.productIdPrefix && props.app.config.productIdPrefix?.trim()) || '';\r\n const mfrmProductId = product.result?.ItemId ? `${productIdPrefix}${product.result?.ItemId}` : null;\r\n const [isLeaseActive, setLeasingButtonActive] = React.useState(true);\r\n const [activeVariantId, setActiveVariantId] = React.useState(productId);\r\n const [activeColorVariantId, setActiveColorVariantId] = React.useState(productId);\r\n const [outOfStockSmallParcelState, SetoutOfStockSmallParcelState] = React.useState(false);\r\n // call/chat product\r\n const isCallChatProduct = productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === 'call/chat only')\r\n ?.BooleanValue;\r\n const sleepExpertSummaryText = productSpecificationData.result?.find(attr => attr.Name?.trim().toLowerCase() === 'sleep expert opinion')\r\n ?.TextValue;\r\n const tagsArr = _getBuyboxSEOMetaTags(AttributeValues);\r\n const [itemOutOfMarket, setItemOutOfMarket] = React.useState(false);\r\n const [variantOutOfStock, setVariantOutOfStock] = React.useState(false);\r\n const setActiveVariant = async (variantID: number) => {\r\n setActiveColorVariantId(variantID);\r\n setActiveSwatchSelected(variantID, variantOutOfStock, setVariantOutOfStock, props.state.variantAvailibilityList);\r\n if (outOfStockSmallParcelState) {\r\n await _smallParcelProductATPCallForInventoryStatus(props, props.data.product.result!.RecordId, props.data.product.result!.ItemId, SetoutOfStockSmallParcelState, true).then().catch();\r\n }\r\n };\r\n const categoryName = props.data.listPageStateBuyBox.result?.categoryName;\r\n const propsWithLeasingState = {\r\n ...props,\r\n setLeasingButtonActive,\r\n variantAvailibilityList: props.state.variantAvailibilityList,\r\n setActiveVariant,\r\n outOfStockSmallParcelState,\r\n setActiveVariantId\r\n };\r\n const renderDimensions = BuyboxProductConfigureMfrm(propsWithLeasingState);\r\n const showViewCartLink = props.showViewCartLink;\r\n /* VSI Customization - END */\r\n const isLoadedPriceComponent = (productPrice && (activeVariantId === product.result?.RecordId || activeColorVariantId === productId)) ? true : false;\r\n const isLoadedprogressiveLeasingEstimator = progressiveLeasingEstimator && productPrice ? true : false;\r\n // VWO Tracking\r\n const {vwoAccountId, vwoSdkKey} = props.app.config;\r\n if( vwoAccountId && vwoSdkKey ){\r\n const [ vwoClientInstance, vwoUserId ] = useVwoClientInstance(vwoAccountId, vwoSdkKey );\r\n if( vwoClientInstance ){\r\n const campaignKey = null;\r\n const userId = vwoUserId;\r\n vwoClientInstance.track(campaignKey, userId, 'pdpPageviews');\r\n }\r\n }\r\n\r\n return (\r\n \r\n {/* VSI Customization - START - 6432 */}\r\n \r\n {tagsArr?.map(\r\n (tag, index) =>\r\n tag?.content && \r\n )}\r\n \r\n\r\n {/* VSI Customization - END - 6432 */}\r\n \r\n {/* VSI Customization - START */}\r\n {productBadges}\r\n {/* VSI Customization - END */}\r\n {renderOOBMediaGallery ? mediaGallery : mfrmMediaGallery}\r\n \r\n\r\n {/* VSI Customization - END */}\r\n \r\n {/* VSI Customization - START */}\r\n \r\n {customerSatisfactionScore}\r\n {/* VSI Customization - END */}\r\n {title}\r\n {/* VSI Customization - START */}\r\n \r\n {mfrmProductId && (\r\n \r\n {mfrmProductId}\r\n \r\n )}\r\n {!props.context.app.config.hideRating && ratingComponent}\r\n \r\n {/* Financing Per Month Redesign code starts here */}\r\n { }\r\n {!isLoadedPriceComponent ?\r\n <>\r\n \r\n \r\n \r\n : \r\n }\r\n {isLoadedprogressiveLeasingEstimator ? (progressiveLeasingEstimator &&\r\n productPrice &&\r\n ) ||\r\n null : }\r\n {/* Financing Per Month Redesign code ends here */}\r\n {/*TODO: What is this*/}\r\n {inventoryLabel}\r\n {(props.state.isEyeBrowLoading) ? :\r\n }\r\n {/*Delivery By Message and Try In-store Redesign code starts here */}\r\n
\r\n \r\n {' '}\r\n {props.state.isStoreLoading ? : tryInStoreComponent}\r\n
\r\n {/*Delivery By Message and Try In-store Redesign code starts here */}\r\n {!props.state.currentProductDimensions?.length && <>\r\n \r\n
\r\n {[...Array(dimensionRows * 3)].map((i, x) => )}\r\n
\r\n \r\n
\r\n {[...Array(1 * 3)].map((i, x) => )}\r\n
}\r\n {renderDimensions}\r\n {chooseYourFoundationModule}\r\n {categoryName === \"Mattresses\" && completeYourBed}\r\n {/*TODO: What is this*/}\r\n {keyInPrice}\r\n <>\r\n {isCallChatProduct\r\n ? \r\n : addToCart &&\r\n }\r\n {showViewCartLink ? : null}\r\n \r\n {/*TODO: What is this*/}\r\n {findInStore && }\r\n
\r\n \r\n {shopSimilarLook}\r\n {mfrmStoreSelector?.[0]}\r\n {additionalModules}\r\n \r\n
\r\n {stylesAndDisruptorsModules}\r\n
\r\n
\r\n
\r\n );\r\n };\r\n\r\n{\r\n /* VSI Customization - START - 6432 */\r\n}\r\n\r\nconst _getBuyboxSEOMetaTags = (attributeValues: AttributeValue[] | undefined) => {\r\n const pageKeywords = _getSEOMetaTagValue(attributeValues, 'pageKeywords');\r\n const pageKeywordsParser = pageKeywords && getHtmlParserValue(pageKeywords);\r\n\r\n return [{ content: pageKeywordsParser?.toString(), name: 'keywords' }];\r\n};\r\n\r\nconst _getSEOMetaTagValue = (attributeValues: AttributeValue[] | undefined, keyValue: string) => {\r\n return attributeValues?.find(currAttribute => currAttribute.Name?.toLowerCase().trim() === keyValue?.toLowerCase().trim())?.TextValue;\r\n};\r\n\r\n\r\n{\r\n /* VSI Customization - END - 6432 */\r\n}\r\n\r\nexport default BuyboxView;\r\n","import { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductDimensionValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport * as React from 'react';\r\nimport { IBuyboxGetDimensionPricingActionData } from '../../../data-actions/buybox-get-dimension-pricing-action';\r\nimport { IBuyboxGetDimensionVariantAvailabilityActionData } from '../../../data-actions/buybox-get-dimension-variants-availability-action';\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport _getViewPort from '../../../Utilities/get-view-port';\r\nimport { _getActivePrices } from '../../../Utilities/mfrm-buybox-utils';\r\nimport { IBuyboxViewPropsExtended } from '../types';\r\nimport { IMfrmBuyboxProps } from '../mfrm-buybox.props.autogenerated';\r\nimport { IMfrmBuyBoxData } from '../mfrm-buybox.view';\r\nimport { BuyBoxSizeComponent } from './buybox-size-component';\r\nimport { BuyBoxSizeRedesignComponent } from './buybox-size-redesign-component';\r\nimport { Dropdown } from './dropdown/dropdown';\r\nimport { IDropdownItemProps } from './dropdown/dropdown.props';\r\nimport Listing from './listing';\r\nimport { HeightFoundationComponent } from './buybox-height-foundation-redesign-component';\r\n\r\nexport interface INotificationData {\r\n dropdownId: string;\r\n selectId: string;\r\n selectedValue: string;\r\n}\r\nexport interface IModalDimensions {\r\n selectId: string;\r\n selectedValue: string;\r\n dropdownId: string;\r\n dimensionPrice?: number;\r\n discountAmount?: number;\r\n percentDiff?: string;\r\n dimensionLabel?: string;\r\n}\r\n\r\nexport interface IProgressiveLeasingState {\r\n setLeasingButtonActive: React.Dispatch>;\r\n}\r\nexport interface IVariantAvailabilityProps {\r\n variantAvailibilityList: IBuyboxGetDimensionVariantAvailabilityActionData[];\r\n}\r\n\r\nexport interface IVariantSelected {\r\n setActiveVariant(variantID: number): void;\r\n}\r\n\r\nexport interface IFinancingPerMonthCallbacks {\r\n setActiveVariantId(selectedVariantId: number | undefined): void;\r\n}\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const BuyboxProductConfigureMfrm: React.FC &\r\n IProgressiveLeasingState &\r\n IVariantAvailabilityProps &\r\n IVariantSelected &\r\n IFinancingPerMonthCallbacks> = props => {\r\n const [sizeVariantsLength, setSizeVariantsLength] = React.useState(0);\r\n const [isOpen, setIsOpen] = React.useState(false); // modal toggle state\r\n const [isMobile, setisMobile] = React.useState(false);\r\n const [selectedDisplayLabel, setselectedDisplayLabel] = React.useState();\r\n const [selectedDimensionLabel, setSelectedDimensionLabel] = React.useState();\r\n const [dimensionPrice, setDimensionPrice] = React.useState();\r\n const [discountAmount, setDiscountAmount] = React.useState();\r\n const [percentDiff, setPercentDiff] = React.useState();\r\n const [selectedSize, setSetlectedSize] = React.useState('');\r\n const selectedVariantId = props.variantAvailibilityList.find(\r\n item => item.sizeValue && item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim() && item.variantID === props.data.product?.result?.RecordId\r\n )?.variantID;\r\n const modalDimensionsArray: IModalDimensions[] = [];\r\n let preSelectedDimension: IModalDimensions = {\r\n selectId: '',\r\n selectedValue: '',\r\n dropdownId: ''\r\n };\r\n const { context } = props;\r\n React.useEffect(() => {\r\n const viewPort = _getViewPort(context);\r\n viewPort === 'xs' || viewPort === 'sm' ? setisMobile(true) : setisMobile(false);\r\n }, []);\r\n\r\n // VSI Customization - START - 47026\r\n React.useEffect(() => {\r\n props.state.currentProductDimensions && props.state.currentProductDimensions.length > 0\r\n && props.state.currentProductDimensions?.map((dimension, i) => {\r\n const dropdownList: IDropdownItemProps[] = getDropdownList(dimension.DimensionValues);\r\n if (dimension && dimension.DimensionTypeValue === 3) {\r\n setSizeVariantsLength(dropdownList?.length ? dropdownList?.length : 0);\r\n }\r\n });\r\n }, [props.state.currentProductDimensions]);\r\n\r\n React.useEffect(() => {\r\n props.setActiveVariantId(selectedVariantId);\r\n }, [selectedVariantId]);\r\n\r\n const getDropdownList = (dimensionValues: ProductDimensionValue[] | undefined): IDropdownItemProps[] => {\r\n const dropdownList = dimensionValues && dimensionValues?.length > 0\r\n ? dimensionValues.map(dimensionValue => {\r\n return {\r\n value: dimensionValue.Value || '',\r\n id: dimensionValue.RecordId.toString(),\r\n selectedValue: (dimensionValue && dimensionValue.RecordId.toString()) || ''\r\n };\r\n })\r\n : [];\r\n return dropdownList;\r\n };\r\n // VSI Customization - END - 47026\r\n\r\n const {\r\n context: {\r\n request: {\r\n apiSettings: { baseImageUrl }\r\n }\r\n }\r\n } = props;\r\n const [activePrices, setActivePrices] = React.useState(props.data.dimensionPrices.result!);\r\n const [showColorPicker] = React.useState(\r\n !!props.data.productSpecificationData.result\r\n ?.find(attr => attr.Name?.toLowerCase().trim() === props.config.eComDisplayColorLabel?.toLowerCase().trim())\r\n ?.TextValue?.toLowerCase()\r\n );\r\n React.useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n _getActivePrices(props.data.dimensionPrices.result!, props.context.actionContext).then(resultPrices => {\r\n setActivePrices(resultPrices);\r\n }).catch(err => console.log('Error', err));\r\n }, [props.data.dimensionPrices.result]);\r\n\r\n const generateOnClick = (id: number, valueId: string, variantID: number) => async (e: React.MouseEvent) => {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventCategory: 'PDP Card Action',\r\n eventAction: 'Change Color',\r\n eventLabel: 'Change Color PDP',\r\n eventNoninteraction: 'false',\r\n enhancedAction: 'change_color',\r\n generalConfig: { enhanced_action: 'change_color' }\r\n });\r\n await props.callbacks.dimensionSelectedAsync(id, valueId);\r\n };\r\n const dropdownCallback = (notification: INotificationData): Promise => {\r\n return new Promise((resolve, reject) => {\r\n resolve(props.callbacks.dimensionSelectedAsync(+notification.dropdownId, notification.selectId));\r\n });\r\n };\r\n const toggleBuyBoxModal = () => {\r\n setIsOpen(!isOpen);\r\n };\r\n const buyBoxModalAddItemClick = async (\r\n selectId: string,\r\n selectedValue: string,\r\n dropdownId: string,\r\n dimensionLabel?: string,\r\n isAddItemClick?: boolean\r\n ) => {\r\n setSetlectedSize(selectedValue);\r\n if (isAddItemClick) {\r\n fireAnalyticsLink({\r\n eventName: 'PDP-card-action',\r\n eventAction: 'Change Size',\r\n eventCategory: 'PDP Card Action',\r\n eventNoninteraction: 'false',\r\n eventLabel: 'Change Size PDP',\r\n enhancedAction: 'change_size',\r\n generalConfig: { enhanced_action: 'change_size' }\r\n });\r\n }\r\n setIsOpen(false);\r\n props.setLeasingButtonActive(false);\r\n setselectedDisplayLabel(selectedValue);\r\n setSelectedDimensionLabel(dimensionLabel);\r\n isAddItemClick ? await dropdownCallback({ selectId: selectId, selectedValue: selectedValue, dropdownId: dropdownId }) : null;\r\n props.setLeasingButtonActive(true);\r\n };\r\n const calculatePercentage = (dimPrice: number, discountAmnt: number) => {\r\n const percentSaved = Math.round((discountAmnt / dimPrice) * 100);\r\n setPercentDiff(percentSaved);\r\n setDiscountAmount(discountAmnt);\r\n setDimensionPrice(dimPrice);\r\n };\r\n const formatCurrency = (price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n return props.context.cultureFormatter.formatCurrency(price);\r\n };\r\n // tslint:disable-next-line: max-func-body-length\r\n const output = props.state.currentProductDimensions && props.state.currentProductDimensions.length > 0\r\n ? props.state.currentProductDimensions?.map((dimension, i) => {\r\n const {\r\n data: {\r\n productSpecificationData: { result }\r\n },\r\n config: { eComDisplayColorAsDropDown, eComDisplayColorLabel }\r\n } = props;\r\n // tslint:disable-next-line: max-line-length\r\n const displayAsDropdown =\r\n result && eComDisplayColorAsDropDown\r\n ? result.find(obj => obj.Name && obj.Name.toLowerCase().trim() === eComDisplayColorAsDropDown.toLowerCase().trim())\r\n ?.BooleanValue\r\n : ''; // Get EcomDisplayColorAsDropDown value\r\n const dropDownDisplayLabel =\r\n result && eComDisplayColorLabel\r\n ? result.find(obj => obj.Name && obj.Name.toLowerCase().trim() === eComDisplayColorLabel.toLowerCase().trim())\r\n ?.TextValue\r\n : ''; // Get EcomDisplayColorLabel value\r\n const dropdownName = props.callbacks.getDropdownName(dimension.DimensionTypeValue, props.resources);\r\n const dropdownId = dimension.DimensionTypeValue.toString();\r\n const dropdownToggleName = props.resources.selectDimensionFormatString?.replace('{0}', dropdownName.toLowerCase());\r\n const swatchName = props.callbacks.getDropdownName(dimension.DimensionTypeValue, props.resources).toLowerCase();\r\n const dropdownList: IDropdownItemProps[] = getDropdownList(dimension.DimensionValues);\r\n if (dimension && dimension.DimensionTypeValue === 1) {\r\n const { DimensionTypeValue, DimensionValues, DimensionValue } = dimension;\r\n // check if type of dimension is height since it also has a DimensionTypeValue of 1\r\n // TODO: see if any other dimension types have a DimensionTypeValue of 1\r\n const doesSelectedValueExist = props.variantAvailibilityList.filter(item => item.colorDimensionRecordId === dimension.DimensionValue?.RecordId && item.sizeValue === selectedSize).length;\r\n const doesSelectedValueAvailable = props.variantAvailibilityList.find(item => item.colorDimensionRecordId === dimension.DimensionValue?.RecordId && item.sizeValue === selectedSize)?.isAvailable;\r\n const availableOptions = props.variantAvailibilityList.filter(item => item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim()).map(item => item.secondaryDimensionValue);\r\n const availableDimensionValues = DimensionValues?.filter(item => availableOptions.includes(item.Value));\r\n const alternativeOption = props.variantAvailibilityList.find(item => item.sizeValue.toLowerCase().trim() === selectedSize.toLowerCase().trim() && item.isAvailable === true)?.secondaryDimensionValue;\r\n const dimensionValue = doesSelectedValueExist !== 0 && doesSelectedValueAvailable ? DimensionValue : DimensionValues?.find(item => item.Value === alternativeOption);\r\n const selectedValue = (dimension.DimensionValue && dimension.DimensionValue.RecordId) || 'not available';\r\n const isActive = selectedValue === DimensionValue?.RecordId;\r\n const isVariantSelectionRedesignEnabled = props.config.enableVariantSelectionRedesign || false;\r\n\r\n return (\r\n <>\r\n {(displayAsDropdown !== true || displayAsDropdown === null) && showColorPicker ?\r\n <>\r\n \r\n {props.config.enableVariantSelectionRedesign ?\r\n \r\n \r\n {`${dropdownName.toUpperCase()}: `}\r\n {isVariantSelectionRedesignEnabled && isActive ? dimensionValue?.DimensionId : ''}\r\n \r\n {`${availableDimensionValues?.length} Colors`}\r\n :\r\n \r\n {dropdownName} {dimensionValue && dimensionValue.Value ? ({dimensionValue.Value}) : false}\r\n \r\n }\r\n \r\n \r\n \r\n \r\n {/* Keep original Color Dropdown hidden for SEO */}\r\n \r\n {dropdownName}\r\n \r\n \r\n \r\n :\r\n null\r\n }\r\n {dropdownList.length > 1 && displayAsDropdown === true ?\r\n \r\n {props.config.enableVariantSelectionRedesign ? {`${dropDownDisplayLabel} :`} : {dropDownDisplayLabel}}\r\n {/* tslint:disable: max-line-length */}\r\n
\r\n {props.config.enableVariantSelectionRedesign ?\r\n :\r\n \r\n }\r\n
\r\n
\r\n :\r\n null\r\n }\r\n \r\n );\r\n\r\n } else if (dimension && dimension.DimensionTypeValue === 3) {\r\n const { DimensionValue } = dimension;\r\n\r\n dropdownList && dropdownList.length > 0 && dropdownList.forEach(item => {\r\n let damount = 0;\r\n let price = 0;\r\n let percent = '';\r\n let label;\r\n\r\n activePrices &&\r\n activePrices.forEach(size => {\r\n if (size.name === item.value) {\r\n price = size.price;\r\n label = size.dimensionLabel;\r\n if (size.discountAmount) {\r\n damount = size.discountAmount;\r\n percent = damount > 0 ? Math.round((damount / price) * 100).toString() : '';\r\n }\r\n }\r\n });\r\n if (item.value.trim().toLowerCase() === DimensionValue?.Value?.trim().toLowerCase()) {\r\n preSelectedDimension = {\r\n selectId: item.id,\r\n selectedValue: item.value,\r\n dropdownId: dropdownId,\r\n discountAmount: damount,\r\n dimensionPrice: price,\r\n percentDiff: percent,\r\n dimensionLabel: label\r\n };\r\n if ((discountAmount === undefined || discountAmount <= 0) && damount > 0) {\r\n setDiscountAmount(damount);\r\n const percentSaved = Math.round((damount / price) * 100);\r\n setPercentDiff(percentSaved);\r\n }\r\n }\r\n modalDimensionsArray.push({\r\n selectId: item.id,\r\n selectedValue: item.value,\r\n dropdownId: dropdownId,\r\n discountAmount: damount,\r\n dimensionPrice: price,\r\n percentDiff: percent,\r\n dimensionLabel: label\r\n });\r\n });\r\n\r\n // Hidden Size Dropdown with full dimensions for SEO\r\n const SEODropdownList = modalDimensionsArray.map(productDimension => {\r\n // tslint:disable-next-line: no-shadowed-variable\r\n const { dimensionLabel, dimensionPrice, selectId, selectedValue } = productDimension;\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const SEODropDownItem = {\r\n value: `${selectedValue} - ${dimensionLabel} - ${formatCurrency(dimensionPrice)}`,\r\n id: selectId,\r\n selectedValue: selectedValue\r\n };\r\n\r\n return SEODropDownItem;\r\n });\r\n return (// Keeping dropdown for ADA complianace hidden for now.\r\n \r\n {dropdownName}\r\n \r\n \r\n );\r\n } else {\r\n return (// Keeping dropdown for ADA complianace hidden for now.\r\n \r\n {dropdownName}\r\n \r\n \r\n );\r\n }\r\n }) : undefined;\r\n\r\n return (\r\n \r\n {!props.config.enableVariantSelectionRedesign ?\r\n <>\r\n \r\n {/* tslint:disable-next-line: cyclomatic-complexity */}\r\n {sizeVariantsLength === 1 || sizeVariantsLength === 0 ? (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {selectedDisplayLabel ? selectedDisplayLabel : 'Select a Size'}\r\n
\r\n
{selectedDimensionLabel}
\r\n
\r\n \r\n {selectedDisplayLabel && discountAmount && dimensionPrice\r\n ? formatCurrency(dimensionPrice - discountAmount)\r\n : dimensionPrice\r\n ? formatCurrency(dimensionPrice)\r\n : ''\r\n }\r\n
\r\n
\r\n {selectedDisplayLabel && percentDiff && percentDiff !== 0 ? (\r\n {percentDiff}% Off\r\n ) : null}\r\n {selectedDisplayLabel && discountAmount ? (\r\n  {formatCurrency(dimensionPrice)}\r\n ) : null}\r\n
\r\n
\r\n
\r\n \r\n
\r\n ) : (\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n {selectedDisplayLabel ? selectedDisplayLabel : 'Select a Size'}\r\n
\r\n
{selectedDimensionLabel}
\r\n
\r\n \r\n {selectedDisplayLabel && discountAmount && dimensionPrice\r\n ? formatCurrency(dimensionPrice - discountAmount)\r\n : formatCurrency(dimensionPrice)}\r\n
\r\n
\r\n {selectedDisplayLabel && percentDiff && percentDiff !== 0 ? (\r\n {percentDiff}% Off\r\n ) : null}\r\n {selectedDisplayLabel && discountAmount ? (\r\n  {formatCurrency(dimensionPrice)}\r\n ) : null}\r\n
\r\n
\r\n
\r\n \r\n
\r\n )}\r\n \r\n : <>\r\n {modalDimensionsArray.length !== 0 &&

Size: {preSelectedDimension?.dimensionLabel !== undefined && preSelectedDimension?.dimensionLabel}

}\r\n \r\n \r\n }\r\n {output}\r\n \r\n );\r\n };\r\n","import React, { FunctionComponent } from 'react';\r\n\r\n\r\ninterface Props {\r\n /** Sets the skeleton-pulse style */\r\n type?: 'text' | 'image' | 'button' | 'button-secondary';\r\n /** Sets the width of the skeleton. Default unit is px. */\r\n width?: number | string;\r\n /** Sets the height of the skeleton. Default unit is px. */\r\n height?: number | string;\r\n /** Makes the skeleton look like a circle */\r\n circle?: boolean;\r\n /** Override classNames on wrapper */\r\n className?: string;\r\n /** Override styles on wrapper */\r\n style?: object;\r\n [rest: string]: unknown; // ...rest property\r\n}\r\n\r\nconst getValidCSSInput = (input: string | number) => {\r\n switch (typeof input) {\r\n case 'undefined':\r\n case 'boolean':\r\n return null;\r\n case 'number':\r\n return `${input}px`;\r\n default:\r\n const parsedInput = parseFloat(input);\r\n const unit = input.match(/%|em/);\r\n return isNaN(parsedInput) ? '' : unit ? `${parsedInput}${unit}` : `${parsedInput}px`;\r\n }\r\n};\r\n\r\nconst CustomSkeleton: FunctionComponent = ({\r\n width,\r\n height,\r\n circle,\r\n type = 'text',\r\n className = '',\r\n style = {},\r\n ...rest\r\n}) => {\r\n const isTextType = type === 'text';\r\n const classNames = `pulse ${!className ? type : ``} ${isTextType ? 'transform' : ''} ${type === 'button-secondary' && !className ? 'button' : ''} ${circle ? 'circle' : ''} ${className}`;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default CustomSkeleton;\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 React from 'react';\r\n\r\nimport { ICoreContext, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { FinancingOfferStateInput, IFinancingOfferStateData } from '../../../data-actions/financing-offer-state.action';\r\nimport { fireAnalyticsLink } from '../../../Utilities/analytics/clickTrack';\r\nimport {\r\n getCampaignRemainingCost,\r\n getValidSpecialCampaign,\r\n IFinancingOfferFormatted,\r\n selectFinancingOffer\r\n} from '../../../Utilities/select-financing-offer';\r\nimport { getQueryParamsFromQueryByName } from '../../../data-actions/utilities/utils';\r\nimport { variantQueryStringName } from '../../../Utilities/constants';\r\nimport CustomSkeleton from './CustomSkeleton';\r\n\r\nexport type FinancingComponentPageType = 'PDP' | 'PLP';\r\n\r\nexport interface IFinancingPerMonthComponentProps {\r\n pageType: FinancingComponentPageType;\r\n sellingPrice: number;\r\n // tslint:disable-next-line:no-any\r\n context: ICoreContext<{ [x: string]: any }>;\r\n priceComponent?: JSX.Element;\r\n // VSI Customization - START\r\n sizeValue?: string | undefined;\r\n dimensionPrice?: number | undefined;\r\n percentDiff?: number | undefined;\r\n discountAmount?: number;\r\n categoryName?: String | undefined,\r\n activeVariantId: number | undefined,\r\n productId: number | undefined,\r\n activeColorVariantId: number | undefined,\r\n isLoadedPriceComponent?: boolean | undefined,\r\n parentCategory?: string | undefined\r\n // VSI Customization - END\r\n}\r\n\r\nexport const FinancingPerMonthComponent: React.FC = ({\r\n pageType,\r\n sellingPrice,\r\n context,\r\n priceComponent,\r\n sizeValue,\r\n dimensionPrice,\r\n percentDiff,\r\n discountAmount,\r\n categoryName,\r\n activeVariantId,\r\n productId,\r\n activeColorVariantId,\r\n isLoadedPriceComponent,\r\n parentCategory\r\n}) => {\r\n const selectedFinancingOffer: IFinancingOfferFormatted | undefined = selectFinancingOffer({\r\n limitedTimeFinancingOffers: context.app.config.limitedTimeFinancingOffers,\r\n everydayFinancingOffers: context.app.config.everydayFinancingOffers,\r\n lowCostOffer: context.app.config.lowCostFinancingOffers,\r\n cashBackFinancingOffer: context.app.config.cashBackFinancingOffer,\r\n cashbackFinancingEnable: context.app.config.cashbackFinancingEnable,\r\n totalPrice: sellingPrice\r\n });\r\n\r\n if (!sellingPrice) {\r\n return null;\r\n }\r\n const monthlyCost = selectedFinancingOffer && Math.ceil(sellingPrice / selectedFinancingOffer.numOfMonths);\r\n const stateUpdate: IFinancingOfferStateData = {\r\n isOpen: true,\r\n totalPrice: sellingPrice,\r\n financingOffer: selectedFinancingOffer\r\n };\r\n const url = new URL(window.location.href.toString());\r\n const variantId = Number(getQueryParamsFromQueryByName(url, variantQueryStringName)) || undefined;\r\n const openModal = () => {\r\n fireAnalyticsLink({\r\n eventName: 'internal navigation',\r\n eventCategory: 'internal links',\r\n eventAction: 'to: Financing Per Month modal',\r\n eventLabel: `from ${pageType} Financing Per Month “Learn How” link`,\r\n eventNoninteraction: 'false'\r\n });\r\n context.actionContext.update(new FinancingOfferStateInput(), stateUpdate);\r\n };\r\n // format currency and strip trailing zeros\r\n // TODO: remove the cents portion in a dynamic way for all currencies\r\n const formattedMonthlyCost = monthlyCost && context.cultureFormatter.formatCurrency(monthlyCost);\r\n const monthlyCostStrippedZeros = formattedMonthlyCost && formattedMonthlyCost.substring(0, formattedMonthlyCost.length - 3);\r\n\r\n const campaign = selectedFinancingOffer && getValidSpecialCampaign(selectedFinancingOffer);\r\n const campaignRemainingCost =\r\n campaign && selectedFinancingOffer && getCampaignRemainingCost(campaign, selectedFinancingOffer, sellingPrice);\r\n\r\n const formattedCampaignCost =\r\n campaign && campaignRemainingCost && context.cultureFormatter.formatCurrency(Math.ceil(campaignRemainingCost.cost));\r\n const campaignCostStrippedZeros = formattedCampaignCost && formattedCampaignCost?.substring(0, formattedCampaignCost.length - 3);\r\n\r\n const cashbackFinancingMessage = context.app.config?.cashbackFinancingMessage;\r\n const pdpCashbackFinancingMessage = context.app.config?.pdpCashbackFinancingMessage;\r\n const everydayFinancingMessage = context.app.config.everydayFinancingMessage;\r\n const limitedFinancingMessage = context.app.config.limitedFinancingMessage;\r\n const limitedCampaignFinancingMessage = context.app.config.limitedCampaignFinancingMessage;\r\n\r\n const sellingPriceDollars = sellingPrice.toFixed(2).split('.')[0];\r\n const sellingPriceCents = sellingPrice.toFixed(2).split('.')[1];\r\n\r\n const dimensionDollars = dimensionPrice?.toFixed(2).split('.')[0];\r\n const dimensionCents = dimensionPrice?.toFixed(2).split('.')[1];\r\n const readyToShow = activeVariantId === productId || activeColorVariantId === productId || variantId === productId || pageType === \"PLP\";\r\n const promotionalPeriod = selectedFinancingOffer?.numOfMonths;\r\n const validThroughDate = selectedFinancingOffer && selectedFinancingOffer.isLTO && (promotionalPeriod === 36 || promotionalPeriod === 48 || promotionalPeriod === 60) ? '' : ` Valid thru ${selectedFinancingOffer?.endDate} `;\r\n const offerMinPurchase =\r\n selectedFinancingOffer && context.cultureFormatter.formatCurrency(Math.ceil(selectedFinancingOffer.minPurchase));\r\n const offerMinPurchaseStrippedZeros = offerMinPurchase && offerMinPurchase?.substring(0, offerMinPurchase.length - 3);\r\n // tslint:disable: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role\r\n return pageType === 'PDP' ? (\r\n
\r\n
\r\n
0 && Number(percentDiff) < 100 && discountAmount !== 0 ? 'product-price' : 'product-price-black'}>\r\n\r\n {Number(percentDiff) > 0 && discountAmount !== 0 ? readyToShow ?\r\n <>\r\n ${sellingPriceDollars}\r\n {sellingPriceCents}\r\n \r\n \r\n ${dimensionDollars}\r\n {dimensionCents}\r\n \r\n {percentDiff && percentDiff.toFixed()}% Off\r\n \r\n : : readyToShow ? priceComponent || (\r\n <>\r\n ${sellingPriceDollars}\r\n {sellingPriceCents}\r\n ) : \r\n }\r\n
\r\n
\r\n {selectedFinancingOffer && (\r\n <>\r\n {campaign && campaignRemainingCost ? (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n
or {`$${Math.ceil(\r\n campaign.initialMonthlyAmount\r\n )}/mo for the first ${campaign.numOfDiscountedMonths} months`}
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {`Then $${Math.ceil(campaignRemainingCost.cost)}/mo for ${\r\n campaignRemainingCost?.months\r\n } months with 0% APR with Mattress Firm Credit Card.Limited Time.`} */}\r\n {limitedCampaignFinancingMessage &&\r\n limitedCampaignFinancingMessage\r\n ?.replace('{campaignCost}', campaignCostStrippedZeros)\r\n ?.replace('{campaignMonths}', campaignRemainingCost?.months)}\r\n \r\n Learn How\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n ) : selectedFinancingOffer.offerName?.toLowerCase() === 'low cost offer' ?\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {selectedFinancingOffer.lowCostFinancingOfferMessage}\r\n \r\n Learn How\r\n \r\n
\r\n
: (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n {/*
\r\n {pageType === 'PDP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`}\r\n
*/}\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {pageType === 'PDP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`} */}\r\n {selectedFinancingOffer?.isCashBack ? pdpCashbackFinancingMessage &&\r\n :\r\n selectedFinancingOffer.isLTO\r\n ? `${limitedFinancingMessage &&\r\n limitedFinancingMessage?.replace(\r\n '{numOfMonths}',\r\n selectedFinancingOffer.numOfMonths\r\n )}${(pageType === 'PDP' && validThroughDate)}`\r\n : everydayFinancingMessage &&\r\n everydayFinancingMessage\r\n ?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n ?.replace('{numOfMonths}', selectedFinancingOffer.numOfMonths)}\r\n {/* ? `0% Interest with ${\r\n selectedFinancingOffer.numOfMonths\r\n } equal monthly payments. Limited Time.${(pageType === 'PDP' &&\r\n ` Valid thru ${selectedFinancingOffer.endDate} `) ||\r\n ''}`\r\n :`Suggested payments with ${selectedFinancingOffer.numOfMonths} months special financing. `} */}\r\n \r\n Learn How\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n ) : (\r\n
\r\n
\r\n {/* VSI Customization - START */}\r\n
{pageType === 'PLP' ? (sizeValue ? sizeValue : 'Starting at') : null}
\r\n {/* VSI Customization - END */}\r\n
{priceComponent || `${context.cultureFormatter.formatCurrency(sellingPrice)}`}
\r\n
\r\n {selectedFinancingOffer && (\r\n <>\r\n
\r\n OR\r\n
\r\n {campaign && campaignRemainingCost ? (\r\n
\r\n {/* commented as per story no 21902 */}\r\n {/*
Pay as low as
*/}\r\n
{`$${Math.ceil(\r\n campaign.initialMonthlyAmount\r\n )}/mo for the first ${campaign.numOfDiscountedMonths} months`}
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n {/* {`Then $${Math.ceil(campaignRemainingCost.cost)}/mo for ${\r\n campaignRemainingCost?.months\r\n } months with 0% APR with Mattress Firm Credit Card.Limited Time.`} */}\r\n {limitedCampaignFinancingMessage &&\r\n limitedCampaignFinancingMessage\r\n ?.replace('{campaignCost}', campaignCostStrippedZeros)\r\n ?.replace('{campaignMonths}', campaignRemainingCost?.months)}\r\n \r\n
\r\n
\r\n )\r\n :\r\n selectedFinancingOffer.offerName?.toLowerCase() === 'low cost offer' ?\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
e.stopPropagation()}>\r\n

{selectedFinancingOffer.lowCostFinancingOfferMessage?.replace('.', '.\\n')}

\r\n \r\n
\r\n
\r\n : (\r\n
\r\n {/* tslint:disable-next-line: react-this-binding-issue jsx-no-lambda react-a11y-event-has-role*/}\r\n
\r\n {pageType === 'PLP' ? `${monthlyCostStrippedZeros}/mo` : `${monthlyCostStrippedZeros} / mo`}\r\n
\r\n
e.stopPropagation()}>\r\n {selectedFinancingOffer?.isCashBack ? cashbackFinancingMessage &&\r\n :\r\n selectedFinancingOffer.isLTO\r\n ? `${limitedFinancingMessage &&\r\n limitedFinancingMessage?.replace(\r\n '{numOfMonths}',\r\n selectedFinancingOffer.numOfMonths\r\n )?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n }`\r\n : everydayFinancingMessage &&\r\n everydayFinancingMessage\r\n ?.replace('{numOfMonths}', selectedFinancingOffer.numOfMonths)\r\n ?.replace('{monthlyCostStrippedZeros}', monthlyCostStrippedZeros)\r\n }\r\n \r\n
\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-buybox'] = {\n c: () => require('partner/modules/mfrm-buybox/mfrm-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'allProductVariants', path:'data-actions/buybox-get-all-variants-list', runOn: 0},{name:'allVariants', path:'data-actions/buybox-get-dimension-variants-availability-action', runOn: 0},{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 1},{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', runOn: 0},{name:'completeYourBedPillow', path:'actions/complete-your-bed-pillow.action', runOn: 0},{name:'completeYourBedProtector', path:'actions/complete-your-bed-protector.action', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'dimensionPrices', path:'data-actions/buybox-get-dimension-pricing-action', runOn: 0},{name:'listPageStateBuyBox', path:'modules/mfrm-buybox/list-page-state-buybox', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'productSpecificationData', path:'data-actions/get-attributes-for-selected-variant', runOn: 0},{name:'selectedFoundation', path:'actions/select-your-foundation.action', runOn: 0},{name:'storeSelectorState', path:'data-actions/store-selector-state-data-action', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/complete-your-bed-pillow.action';\n let dataAction = require('partner/actions/complete-your-bed-pillow.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/complete-your-bed-protector.action';\n let dataAction = require('partner/actions/complete-your-bed-protector.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/select-your-foundation.action';\n let dataAction = require('partner/actions/select-your-foundation.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-all-variants-list';\n let dataAction = require('partner/data-actions/buybox-get-all-variants-list');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-dimension-pricing-action';\n let dataAction = require('partner/data-actions/buybox-get-dimension-pricing-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/buybox-get-dimension-variants-availability-action';\n let dataAction = require('partner/data-actions/buybox-get-dimension-variants-availability-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/get-attributes-for-selected-variant';\n let dataAction = require('partner/data-actions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'data-actions/store-selector-state-data-action';\n let dataAction = require('partner/data-actions/store-selector-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-buybox/list-page-state-buybox';\n let dataAction = require('partner/modules/mfrm-buybox/list-page-state-buybox');\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-buybox|mfrm-buybox'] = {\n c: () => require('partner/modules/mfrm-buybox/mfrm-buybox.view.tsx'),\n cn: '__local__-__local__-mfrm-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["fireAnalyticsLink","_ref","searchTerm","searchType","eventName","eventCategory","eventAction","eventLabel","eventType","eventNoninteraction","enhancedAction","generalConfig","promoConfig","productConfig","customerConfig","productImpressionConfig","callUtagLink","_objectSpread","event","event_category","event_action","event_label","event_type","event_noninteraction","enhanced_action","search_term","search_type","callUtag","async","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","getSetLocalStorage","getSet","valueToSet","returnType","MsDyn365","isBrowser","localStorage","setItem","JSON","stringify","storedValue","getItem","parse","_unused","removeItem","getSetProductData","products","length","setCoreProductCookie","psp","typeOfProduct","toLowerCase","trim","MFRMProductTypes","core","setCookie","getSetProductSpec","getSetPromoCodeApplyList","getSetPromoCode","getSetGrandTotal","total","getSetBonusItemProd","globalBonusItems","getSetSelectedBonusItem","bonusItemArray","getSetBonusCouponDetail","getCoupons","getSetPrevBonasModalState","previousBonasModal","getSetBonusItemBrandName","bonusItemsBrandName","getSetDateGroupedProducts","getSetExpressFlow","express","getSetWmapCartLines","getSetCartProductPrice","priceDetails","getSetParcelInventoryData","details","getSetDropshipLatestDeliveryMsg","msg","LocalStorageKeys","DropshipLatestDeliveryMsg","getSetParcelLatestDeliveryMsg","ParcelLatestDeliveryMsg","getSetCustomerPhone","phone","CustomerPhone","getSetSelectedDeliveryService","SelectedDeliveryService","getSetCustomerBillingSameDelivery","isSame","CustomerBillingSameDelivery","getSetRecycleFee","fee","RecycleFee","getSetSelectedDeliverySlot","slot","getSetSelectedDeliveryDate","date","getSetCoreProductDeliveryMsg","getSetDefaultDeliverySelected","selected","getSetTimeSlot","getSetDaySlot","getSetServiceName","getSetSelectedServicePrice","getSetCoreShippingMsg","getSetEcomMonthlyAmount","getSetExpressType","value","getSetApplepayCheckoutError","getSetApplepayError","getSetApplepayIFrameError","getSetGetCardApplepayPass","getSetGetCardApplepayFail","getSetLoadExpress","getSetPaypalCheckoutError","getSetPaypalError","getSetPaypalIFrameError","getSetGetCardExpressPass","getSetGetCardExpressFail","getSetExpressAddress","getSetExpressPageLoad","getSetThankyou","getSetEcomFinanceOption","getSetEcomFinancePlanId","getSetCoreProdMsg","getSetBillingAddress","getSetPaymentLoader","getSetLastPaymentConnector","getSetPaymentRadioName","getSetPaymentRadioIndex","getSetSelectedPaymentRadio","getSetPaymentInfoForOCPage","getSetCurrentStep","getSetCheckoutCurrentStep","getSetCartCoreProductInfo","getSetUpdatedEmail","getSetSelectedDeliverySlotZone","zone","addUnitOfMeasureInAddCartLine","cartLines","actionContext","channelId","promises","filter","cartLine","DefaultUnitOfMeasure","map","productResponse","getByIdAsync","callerContext","queryResultSettings","Paging","Top","ProductId","UnitOfMeasureSymbol","error","message","processCartLine","Promise","all","variantQueryStringName","hasArray","values","undefined","DeliveryModes","DeliveryDateDetails","coreItemShippingType","EyeBrowMessage","EyeBrowAttributeName","cartModuleName","progressiveName","getBVAttributeValues","attributeValues","_attributeValues$find","find","attr","_attr$Name","Name","TextValue","Math","round","getBVAttributeValuesUnbxd","_attributeValues$key","parsedValue","parsedArr","ReactHtmlParser","toString","getZipCode","ctx","_ctx$requestContext$g","_ctx$requestContext$g2","geolocationZipCode","requestContext","geoLocation","zipCode","res","cookie","Cookies","zipcode","get","getGeoLocationZipCode","_ctx$requestContext$g3","_ctx$requestContext$g4","dayjs","tz","utc","isBetween","format","getValidSpecialCampaign","financingOffer","specialCampaign","enableCampaign","initialMonthlyAmount","numOfDiscountedMonths","isCampaignScheduled","getCampaignRemainingCost","campaign","totalPrice","remainingCost","remainingMonths","numOfMonths","cost","months","offer","_tempOffer$specialCam","_tempOffer$specialCam2","tempOffer","create","_tempOffer$specialCam3","_tempOffer$specialCam4","campaignValidStartDate","campaignValidEndDate","startDate","endDate","isScheduled","add","startDateCentralTime","isValid","local","endDateCentralTime","now","selectFinancingOffer","returnCustomOfferArray","campaignFound","limitedTimeFinancingOffers","everydayFinancingOffers","lowCostOffer","specialFinancingOffer","synchronySpecialFinancingCondition","specialFinancingEnable","checkoutShowEveryDayOffers","cashbackFinancingEnable","cashBackFinancingOffer","highestMinimumPurchase","bestOffer","costPerMonth","isLTO","minPurchase","everydayFinancingOfferMessage","limitedFinancingOfferMessage","cashbackFinancingOfferMessage","monthlyOfferDetails","financingOfferDescription","disclaimer","offerFound","everydayOffers","specialOffer","validLimitedTimeFinancingOffers","offerValidStartDate","offerValidEndDate","isValidLimitedTimeOffer","currentOfferAccepted","noInterestFor","ceil","offerName","FinancingOfferDataOnPage","checkoutDisplay","push","isAfter","cashBackOffer","isCashBack","cashBackPercentageAmount","cashbackBannerDetails","currentOffer","specialCampaignOffer","validCampaign","_offer$offerName","maxPurchase","_offer$financingOffer","_offer$defaultNumberO","LCO","lowCostFinancingOfferMessage","replace","defaultNumberOfMonths","lowCostOfferDetailsOnCart","CompleteYourBedPillowInput","constructor","pillow","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","input","id","args","_args$config","config","CompleteyourBedProtectorInput","protector","MFIPromotionExtensionClass","odataObject","ItemId","DistinctProductVariant","EyeBrows","i","className","substr","lastIndexOf","concat","EntityClasses","ExtensionProperties","createMFIGetAvailablePromotionsDescriptionInput","availablePromotionsDescription","itemId","DataServiceQuery","DataServiceEntities","availablePromotionsDescriptionsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","GetEyebrowMessageInput","item","pageType","isCached","_this$item$Items","createCacheKey","Items","obj","join","result","context","request","callActionOrExecute","mFIGetAvailablePromotionsDescriptionAsync","GetATPInventoryStatusInput","arguments","_this$input","_this$input2","Array","prototype","call","ItemLines","VariantRecordId","sort","ZipCode","Weeks","RequestedDate","mFIATPInventoryStatusAsync","ProductCompareBuyboxStateSharing","__decorate","observable","SelectYourFoundationInput","foundation","ErrorBoundary","React","props","super","state","hasError","errorMessage","render","_this$props","_this$state","showMessage","telemetry","style","background","padding","color","children","cookies","getCookie","cookieName","cookieValue","options","set","removeCookie","remove","BuyboxGetDimensionPricingInput","productId","getDimensionPricingAction","pricingData","baseProduct","isArray","getVariantsByDimensionValuesAsync","MasterProductId","then","variants","dimensionsSizes","productIds","variant","_variant$Dimensions","Dimensions","dimension","DimensionTypeValue","_dimension$DimensionV2","sizeLabel","DimensionValue","Value","priceLabel","Price","dimensionLabel","_dimension$DimensionV","extensionProperties","property","_property$Key","_property$Value","_property$Value2","Key","StringValue","getHtmlParserValue","getDimensionLabel","_dimension$DimensionV3","_dimension$DimensionV4","price","RecordId","name","catch","exception","Error","createObservableDataAction","inputData","query","apiSettings","urlTokens","BuyboxGetDimensionVariantAvailabilityInput","getAllVariantsAction","fetchedVariants","variantAvailabilityData","variantID","sizeDimensionRecordID","colorDimensionRecordId","itemID","isAvailable","sizeValue","secondaryDimensionValue","FinancingOfferStateInput","isOpen","StoreSelectorStateInput","storeSelectorStateAction","isModalOpen","prefferedStore","getSelectedProductIdFromActionInput","_context$query","variantId","app","queryBasedVariantSelection","getQueryParamsFromQueryByName","url","requestUrl","inputUrl","queryParamName","URL","toLocaleLowerCase","searchParams","Number","isNaN","generateImageUrl","imageUrl","startsWith","baseImageUrl","encodeURIComponent","DimensionTypes","DimensionSwatchDisplayTypes","getFallbackImageUrl","parsedItemId","split","BuyboxCallChat","telOnClick","window","location","href","callChatPhoneNumber","toggleChatClick","setTimeout","eval","onTextChange","callChatMessage","target","Node","Text","text","editProps","onEdit","onClick","ListPageStateBuyBox","categoryName","productBrandName","productUrl","productImageUrl","productSize","ListPageStateBuyBoxInput","listPageStateAction","createListPageInput","BuyBoxSizeComponent","preSelection","isPreSelected","selectId","selectedValue","setSelectId","preSelectionPending","setPreSelectionPending","updatePricing","highlightId","highlightValue","highlightDimensionLabel","isAddItemClick","selectHighlightId","selectedDimensionLabel","discountAmount","dimensionPrice","modalDimensions","percentFunc","addItemClick","dropdownId","Modal","autoFocus","fade","horizontalPosition","isMobile","verticalPosition","zIndex","toggle","onCloseModal","applicationNode","modalClassName","classnames","ModalHeader","ModalBody","idx","variantAvailibilityList","parseInt","role","tabIndex","onKeyUp","handleKeyPress","keyCode","formatCurrencyFunc","percentDiff","outOfStockText","returnValidPricing","BuyBoxSizeRedesignComponent","sizeDimensions","isActive","_selectedValueData$fi","isVariantAvailableAtAll","isAnyVariantAvailable","customVariantName","getCustomizedVariantName","variantNameConfig","originalVariantName","variantNameMapObject","customizedVariantName","variantMappingConfig","disabled","Dropdown","selectMenu","_onChanged","setState","selectedIndex","onChange","innerText","dimensionValue","payLoad","getPayloadObject","telemetryContent","dropdownName","componentDidMount","current","componentDidUpdate","_this$props2","preSelectionSet","dropdownList","dropdownToggleName","attribute","getTelemetryAttributes","assign","ref","hidden","_this$props$variantAv","dim","_this$props$selectedS","selectedSize","observer","generateOnClick","setActiveVariant","selectedValueAvailable","isVariantSelectionRedesignEnabled","swatchName","DimensionValues","index","_dimensionValue$Dimen","recordID","currVariantID","availabilityList","dimensionId","DimensionId","isVariantIdNotAvailable","element","document","getElementsByClassName","click","backgroundImage","slice","_renderSlashItem","HeightFoundationComponent","_handleOnClick","selectedId","dimensionName","dimensionList","_this$props$variantAv2","classNames","currentVariantId","outOfStockSmallParcel","outOfStockBoolean","BuyboxErrorBlock","showError","configureErrors","quantityError","customAmountError","otherError","resources","errorMessages","Alert","assertive","buyboxErrorMessageHeader","_getProductType","shippingInformation","_isOrderQuantityLimitsFeatureEnabled","_props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","data","customerInformation","IsB2b","BuyboxAddToCart","addToCart","buyboxProps","variantOutOfStock","itemOutOfMarket","outOfStockSmallParcelState","adjustableItem","ContainerProps","mfrmAddToCart","defaultMinimumKeyInPrice","defaultMaximumKeyInPrice","_attributes$find","_productSpecification","_productSpecification2","_props$data$deliveryO","_props$context$action","_props$data$deliveryO2","typeName","product","productPrice","productAvailableQuantity","productSpecificationData","categoryPaths","minimumKeyInPrice","maximumKeyInPrice","brandBackofficeAttributePdp","allCategoriesArr","categoryObj","attributes","currAttribute","quantity","errorState","errorHost","selectedProduct","isUpdatingDimension","isUpdatingDeliveryOptions","isServiceItem","keyInPriceAmount","allVariantOOS","ecomAllVairantStockInfoConcatenated","variantIdOOS","lastBreadcrumbCategoryLink","outOfStockValue","specificationData","_specificationData$Na","_props$context$app$co","outOfStockProductKey","shippingInformationSmall","smallParcelAttributeKey","BooleanValue","_props$state","checkSPAvailibility","_props$state2","some","productAvailability","ProductAvailableQuantity","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","isLoading","status","callbacks","changeUpdatingDimension","isLoadingDeliveryOptions","deliveryOptions","changeUpdatingDeliveryOptions","getTelemetryObject","telemetryPageName","friendlyName","emailDeliveryModeCode","channel","EmailDeliveryModeCode","isEmailDelivery","DeliveryOptions","ArrayExtensions","hasElements","Code","successfulATC","button","AddToCartComponent","addToCartText","addToCartProductsText","mfrmOutOfStockCustomText","mfrmOutOfStockText","mfrmContinueShoppingText","mfrmContinueShoppingLink","mfrmOutOfStockSmallParcell","navigationUrl","getUrlSync","onError","quantityErrorForState","customAmountErrorForState","otherErrorForState","getGenericError","cart","failureReason","getQuantityError","stockLeft","cartActionResult","substatus","_resources$invalidSma","formatedAmountLimit","cultureFormatter","formatCurrency","invalidSmallCustomAmountText","_resources$invalidLar","invalidLargeCustomAmountText","updateErrorState","getConfigureErrors","missingDimensions","IsGiftCard","getSelectedProduct","gridSettings","imageSettings","isAddServiceItemToCart","isPriceKeyedIn","customPriceAmount","isCustomPriceSelected","isOrderQuantityLimitsFeatureEnabled","isAddEmailDeliveryItemToCart","extensionProps","allProductVariants","productCategoryName","productBrand","updateSuccessfulATC","variantIdForTracking","errorBlock","mfrmgetBuyboxAddToCart","BuyboxViewCartLink","viewCartLink","viewCartLinkText","BuyboxSocialShare","socialShare","BuyboxFindInStore","storeSelector","heading","description","errors","modal","productPickupOptionList","SleepExpertSummaryComponent","sleepExpertOpinionHeadingText","sleepExpertSummaryText","tag","RichTextComponent","BuyboxSleepExpertSummary","_buyboxProps$config$s","titleHeadingTag","ProgressiveLeasingEstimatorRequestType","ProgressiveLeasingEstimatorPayFrequency","MfrmProgressiveLeasingEstimator","infoText","estimatorLink","progressiveLeasingEstimator","setModalStatus","useState","estimatorUrl","buildEstimatorURL","_closeModal","useEffect","iframe","querySelector","src","isLeaseActive","linkText","preventDefault","ariaLabel","alt","type","sandbox","itemCost","_estimatorLink$linkUr","storeId","requestType","payFrequency","approveMeName","approveMeSlugValue","estimatorURL","linkUrl","destinationUrl","requestTypeValue","getRequestType","append","payFrequencyValue","getPayFrequency","stateCode","getStateCode","decodeURIComponent","pdp","checkoutPdp","frequency","weekly","biWeekly","semiMonthly","monthly","prefferedStoreData","parsedPrefferedStoreData","State","BuyboxProgressiveLeasingEstimator","leaseState","BuyboxFinancingPerMonth","originalPrice","discountValue","activeVariantId","activeColorVariantId","isLoadedPriceComponent","parentCategory","percentageDiscount","FinancingPerMonthComponent","sellingPrice","_getBuyboxSEOMetaTags","pageKeywords","_getSEOMetaTagValue","pageKeywordsParser","content","keyValue","_currAttribute$Name","_result$","_result$2","_props$state$productP","_props$state$productP2","_props$state$productP3","_props$state$productP4","_props$app$config$pro","_product$result","_product$result2","_props$data$listPageS","_product$result3","_props$state$currentP","ModuleProps","MediaGalleryContainerProps","ProductInfoContainerProps","findInStore","title","inventoryLabel","shopSimilarLook","keyInPrice","productBadges","ratingComponent","tryInStoreComponent","promotionalMessage","customerSatisfactionScore","renderOOBMediaGallery","slots","mfrmStoreSelector","mediaGallery","mfrmMediaGallery","additionalModules","stylesAndDisruptorsModules","chooseYourFoundationModule","completeYourBed","dimensionRows","AttributeValues","CustomerContextualPrice","AdjustedPrice","DiscountAmount","productIdPrefix","mfrmProductId","setLeasingButtonActive","setActiveVariantId","setActiveColorVariantId","SetoutOfStockSmallParcelState","isCallChatProduct","_attr$Name2","tagsArr","setItemOutOfMarket","setVariantOutOfStock","listPageStateBuyBox","renderDimensions","_props$variantAvailib","_props$data$productSp","_props$state$currentP2","_preSelectedDimension","_preSelectedDimension2","sizeVariantsLength","setSizeVariantsLength","setIsOpen","setisMobile","selectedDisplayLabel","setselectedDisplayLabel","setSelectedDimensionLabel","setDimensionPrice","setDiscountAmount","setPercentDiff","setSetlectedSize","selectedVariantId","_props$data$product","modalDimensionsArray","preSelectedDimension","viewPort","_getViewPort","currentProductDimensions","getDropdownList","dimensionValues","activePrices","setActivePrices","dimensionPrices","showColorPicker","_props$config$eComDis","eComDisplayColorLabel","_getActivePrices","resultPrices","err","valueId","dimensionSelectedAsync","dropdownCallback","notification","resolve","reject","toggleBuyBoxModal","buyBoxModalAddItemClick","calculatePercentage","dimPrice","discountAmnt","percentSaved","output","_result$find","_result$find2","_props$resources$sele","eComDisplayColorAsDropDown","displayAsDropdown","dropDownDisplayLabel","getDropdownName","selectDimensionFormatString","_props$variantAvailib2","_props$variantAvailib3","doesSelectedValueExist","doesSelectedValueAvailable","availableOptions","availableDimensionValues","includes","alternativeOption","enableVariantSelectionRedesign","toUpperCase","Listing","_DimensionValue$Value","label","damount","percent","size","SEODropdownList","productDimension","variantNameMapping","BuyboxProductConfigureMfrm","setActiveSwatchSelected","outOfStock","setOutOfStock","avList","variantsIDIter","_smallParcelProductATPCallForInventoryStatus","showViewCartLink","isLoadedprogressiveLeasingEstimator","vwoAccountId","vwoSdkKey","vwoClientInstance","vwoUserId","useVwoClientInstance","campaignKey","userId","track","Module","HtmlHeadInclude","hideRating","CustomSkeleton","isEyeBrowLoading","BuyboxDeliveryByMessage","isStoreLoading","x","circle","getValidCSSInput","parsedInput","parseFloat","unit","match","_getValidCSSInput","_getValidCSSInput2","width","height","rest","_objectWithoutProperties","_excluded","borderRadius","_context$app$config","_context$app$config2","_limitedCampaignFinan","_selectedFinancingOff","_pdpCashbackFinancing","_everydayFinancingMes","_limitedCampaignFinan2","_selectedFinancingOff2","_selectedFinancingOff3","_cashbackFinancingMes","_limitedFinancingMess","_everydayFinancingMes2","priceComponent","selectedFinancingOffer","lowCostFinancingOffers","monthlyCost","stateUpdate","openModal","update","formattedMonthlyCost","monthlyCostStrippedZeros","substring","campaignRemainingCost","formattedCampaignCost","campaignCostStrippedZeros","cashbackFinancingMessage","pdpCashbackFinancingMessage","everydayFinancingMessage","limitedFinancingMessage","limitedCampaignFinancingMessage","sellingPriceDollars","toFixed","sellingPriceCents","dimensionDollars","dimensionCents","readyToShow","promotionalPeriod","validThroughDate","offerMinPurchase","offerMinPurchaseStrippedZeros","stopPropagation","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","preferredStore","_context","selectedStoreLocationId","storeName","writeToCookie","StoreId","StoreName","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","computed","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","encodeURI","geolocationApiUrl","script","createElement","setAttribute","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","lang","market","_document2","_document3","defer","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}