{"version":3,"sources":["webpack:///src/actions/submit-helpfulness-vote.ts?be08","webpack:///src/modules/checkout/components/get-line-items.tsx?5207","webpack:///src/index.ts?c6ae","webpack:///src/modules/quick-order/components/quick-order-drawer.tsx?25f0","webpack:///src/modules/quick-order/components/quick-order-form.tsx?61bd","webpack:///src/modules/quick-order/components/quick-order-product.ts?af99","webpack:///src/modules/quick-order/components/quick-order-table/components/quick-order-table-header-component.tsx?d661","webpack:///src/modules/quick-order/components/quick-order-table/components/quick-order-table-row-component.tsx?cb68","webpack:///src/modules/quick-order/components/quick-order-table/quick-order-table-component.tsx?a7a8","webpack:///src/modules/quick-order/quick-order.tsx?7aab","webpack:///src/modules/fabrikam/views/components/promocode.component.tsx?7eef","webpack:///src/Common/get-product.ts?5f1d","webpack:///src/actions/inputs/submit-user-review-input.ts?921c","webpack:///src/modules/social-share-item/social-share-item.tsx?e01b","webpack:///src/modules/checkout/methods/empty-active-cart.ts?524e","webpack:///src/modules/checkout/components/index.ts?5ba9","webpack:///src/modules/video-player/components/additional-content.tsx?22a8","webpack:///src/modules/video-player/video-player.tsx?cfb9","webpack:///src/modules/checkout/methods/checkout.ts?3b66","webpack:///src/modules/adventureworks/views/cart-icon.view.tsx?d4b7","webpack:///src/modules/search-result-container/components/title.tsx?365d","webpack:///src/modules/bulk-purchase/bulk-purchase.view.tsx?2550","webpack:///src/modules/write-review/index.ts?2b94","webpack:///src/common/rnrInterface.ts?25e5","webpack:///src/modules/reviews-list/components/review-card.tsx?2d16","webpack:///src/modules/reviews-list/components/components.tsx?c96f","webpack:///src/modules/search-result-container/components/utilities.ts?41e3","webpack:///src/modules/quick-order/quick-order.view.tsx?2242","webpack:///src/modules/ratings-histogram/ratings-histogram.tsx?4c32","webpack:///src/modules/wishlist-items/components/wishlist-items-dimensions.tsx?671e","webpack:///src/modules/wishlist-items/components/wishlist-item.tsx?1fe2","webpack:///src/modules/wishlist-items/components/wishlist-items-status-message.tsx?7062","webpack:///src/modules/wishlist-items/wishlist-items.tsx?3721","webpack:///./src/modules/poc-cart/components/poc-cart-pick-up-in-store.tsx?3c15","webpack:///./src/experlogix-d365commerce-ux/modifyCartLineButton.tsx?5b63","webpack:///./src/modules/poc-cart/components/poc-cart-line-items.tsx?35a2","webpack:///./src/modules/poc-cart/components/poc-cart-line-groups.tsx?a70e","webpack:///./src/modules/poc-cart/utils/get-promotion-in-poc-cart.ts?a04b","webpack:///./src/modules/poc-cart/poc-cart.tsx?652c","webpack:///./src/modules/poc-cart/components/poc-cart-line-items-promotion.tsx?7280","webpack:///src/modules/reviews-list/reviews-list.tsx?b5d0","webpack:///src/modules/search-result-container/search-result-container.tsx?97e0","webpack:///src/order-summary-lineitem.tsx?86d9","webpack:///src/common/index.ts?ee63","webpack:///../../src/index.ts?0e3e","webpack:///src/modules/search-result-container/components/error-message.tsx?c0c2","webpack:///src/modules/cart/components/cart-pick-up-in-store.tsx?f7bf","webpack:///src/modules/cart/components/cart-line-items.tsx?a1e3","webpack:///src/modules/cart/components/cart-line-groups.tsx?b88f","webpack:///src/modules/cart/utils/get-promotion-in-cart.ts?1379","webpack:///src/modules/cart/cart.tsx?f1c3","webpack:///src/modules/cart/components/cart-line-items-promotion.tsx?6882","webpack:///src/actions/inputs/submit-helpfulness-vote-input.ts?cfb5","webpack:///src/modules/carousel/carousel.view.tsx?b19a","webpack:///src/modules/active-image/active-image.view.tsx?b3e2","webpack:///src/actions/report-review-concern.ts?11eb","webpack:///../../../src/module-state-manager/with-module-state.tsx?61ca","webpack:///src/modules/cart/cart.view.tsx?394b","webpack:///src/modules/checkout-gift-card/components/get-form.tsx?9f59","webpack:///src/modules/checkout-gift-card/components/get-item.tsx?ec46","webpack:///src/modules/checkout-gift-card/components/get-list.tsx?9723","webpack:///src/modules/checkout-gift-card/components/title.tsx?6d07","webpack:///src/modules/checkout-gift-card/checkout-gift-card.tsx?e6b8","webpack:///../../src/checkout-state.ts?acd8","webpack:///src/modules/search-result-container/search-result-container.view.tsx?3d61","webpack:///src/modules/video-player/video-player.view.tsx?2e40","webpack:///src/modules/checkout/index.ts?1106","webpack:///src/modules/search-result-container/components/refine-item.tsx?b232","webpack:///src/modules/adventureworks/views/ratings-histogram.view.tsx?1adf","webpack:///src/modules/reviews-list/components/report-review-modal.tsx?22a9","webpack:///src/modules/search-result-container/components/index.ts?cc7a","webpack:///src/modules/checkout/checkout.view.tsx?e9a7","webpack:///src/common/review-modal.tsx?7ef9","webpack:///src/modules/checkout/components/get-invoice-payment-summary.tsx?6271","webpack:///src/modules/checkout/checkout.tsx?baa3","webpack:///src/modules/search-result-container/components/product-search-result-items.tsx?1766","webpack:///src/modules/search-result-container/components/choice-summary.tsx?f4a7","webpack:///src/modules/search/search.view.tsx?e62d","webpack:///src/modules/gift-card-balance-check/components/get-form.tsx?f122","webpack:///src/modules/gift-card-balance-check/components/get-item.tsx?d7f7","webpack:///src/modules/gift-card-balance-check/gift-card-balance-check.tsx?6bc9","webpack:///src/modules/search-result-container/components/refine-submenu.tsx?1e62","webpack:///../../../src/module-state-manager/module-state.ts?7579","webpack:///src/modules/search-result-container/components/separator.tsx?7b76","webpack:///src/modules/reviews-list/index.ts?51cb","webpack:///src/modules/write-review/components/components.tsx?ead4","webpack:///src/modules/write-review/write-review.tsx?dea3","webpack:///src/modules/active-image-utilities/active-product.tsx?2e3c","webpack:///src/modules/active-image-utilities/additional-content.tsx?115e","webpack:///src/modules/active-image-utilities/image-mapper.tsx?3afb","webpack:///src/modules/active-image/active-image.tsx?f30d","webpack:///src/actions/inputs/report-review-concern-input.ts?c9d1","webpack:///src/modules/social-share-item/social-share-item.view.tsx?ce9b","webpack:///src/modules/ratings-histogram/component/components.tsx?2a0b","webpack:///src/modules/search-result-container/components/range-refine-item.tsx?6e24","webpack:///src/modules/reviews-list/reviews-list.view.tsx?6dd9","webpack:///src/actions/index.ts?e12b","webpack:///src/modules/checkout/components/alert.tsx?5f0c","webpack:///src/modules/wishlist-items/wishlist-items.view.tsx?caf1","webpack:///src/modules/checkout-gift-card/checkout-gift-card.view.tsx?3424","webpack:///src/modules/search-result-container/components/link.tsx?d3ce","webpack:///src/modules/bulk-purchase/bulk-purchase.tsx?d704","webpack:///./src/modules/poc-cart/poc-cart.view.tsx?f8d6","webpack:///src/modules/checkout/components/place-order-button.tsx?c8b4","webpack:///../../../src/module-state-manager/index.ts?8e3a","webpack:///src/modules/carousel/carousel.tsx?bfbb","webpack:///src/modules/ratings-histogram/ratings-histogram.view.tsx?4481","webpack:///src/modules/search-result-container/actions/index.ts?3dfa","webpack:///src/modules/checkout/components/get-order-summary.tsx?6f62","webpack:///src/modules/checkout/methods/index.ts?4c8b","webpack:///src/modules/ratings-histogram/index.ts?834d","webpack:///src/modules/search-result-container/components/modal.tsx?afdd","webpack:///src/modules/gift-card-balance-check/gift-card-balance-check.view.tsx?ce1c","webpack:///src/modules/search-result-container/components/feature-search-result-item.tsx?98c1","webpack:///src/modules/checkout/components/guided-card.tsx?5a55","webpack:///src/search-state.ts?b5d7","webpack:///src/modules/search/actions/get-auto-suggest-suggestions.ts?6ade","webpack:///src/modules/search/components/search.categorysuggest.tsx?3bc4","webpack:///src/modules/search/components/search.form.tsx?3c4b","webpack:///src/modules/search/components/search.keywordsuggest.tsx?59ca","webpack:///src/modules/search/components/search.label.tsx?91cb","webpack:///src/modules/search/components/search.productsuggest.tsx?d6fa","webpack:///src/modules/search/search.tsx?3f45","webpack:///src/modules/checkout/components/guided-form.tsx?7fad","webpack:///src/invoice-summary-lineitem.tsx?1b66","webpack:///../../src/checkout-state-data-action.ts?8344","webpack:///src/actions/submit-user-review.ts?d4c7","webpack:///src/validate-cart.ts?28cc","webpack:///src/modules/checkout/methods/place-order.ts?6d11","webpack:///src/modules/write-review/write-review.view.tsx?9069"],"names":["submitHelpfulnessVoteDataAction","createObservableDataAction","id","action","async","input","ctx","reviewId","length","tenantId","locale","authToken","inputIsValid","Error","requestUrl","serviceEndpoint","requestBody","isHelpful","requestHeader","headers","Authorization","sendRequest","then","response","status","catch","error","trace","telemetry","exception","debug","getLineItems","telemetryContent","pickupDeliveryModeCode","get","emailDeliveryModeCode","channelDeliveryOptionConfig","featureState","data","retailMultiplePickUpOptionEnabled","result","find","feature","Name","IsEnabled","_getDeliveryLocation","cartLine","orgUnitLocations","FulfillmentStoreId","locationMatch","location","OrgUnitNumber","OrgUnitName","_getLineItemComponent","product","ProductId","productId","_product","RecordId","typeName","context","config","imageSettings","showShippingChargesForLineItems","resources","quantityDisplayString","productDimensionTypeColor","productDimensionTypeSize","productDimensionTypeStyle","productDimensionTypeAmount","configString","inputQuantityAriaLabel","discountStringText","shippingCharges","request","gridSettings","productUrl","getProductUrlSync","actionContext","undefined","MsDyn365","isBrowser","fullUrl","URL","window","href","searchParams","set","CatalogId","React","CartLineItemComponent","sizeString","colorString","styleString","amountString","originalPriceText","currentPriceText","shippingChargesText","isQuantityEditable","primaryImageUrl","PrimaryImageUrl","_getPickUpAtStoreComponents","pickupDeliveryLocation","pickUpAtStoreWithLocationText","PickUpAtStore","className","label","_getEmailDeliveryComponents","emailDeliveryText","EmailDelivery","_getLineItemsComponents","items","map","isPickUp","_getCartPickDeliveryMode","isEmailDelivery","DeliveryMode","LineId","LineItem","item","pickUpAtStore","emailDelivery","cartLineItem","StringExtensions","isNullOrWhitespace","PickupDeliveryModeCodes","deliveryMode","_countItems","reduce","count","Quantity","_filterItemsByDiliveryType","type","cart","CartLines","filter","_getLineItemsByDeliveryType","title","itemLabel","itemsLabel","inStorePickUpLabel","shippingCountCheckoutLineItem","emailDeliveryModeDesc","deliveryOptions","productDeliveryOptions","DeliveryOptions","deliveryOption","Code","Description","suffix","replace","toString","_getGroupTitleComponent","LineItemDeliveryGroup","classnames","LineItemList","heading","lineItems","handleLineItemHeadingChange","event","lineItemsHeading","text","target","value","_getLineItemsByDeliveryTypeWithMulitplePickupMode","multiplePickUpLabel","shippingLable","getGroupByStorePickup","groupBy","groupDelivery","cartLinesGroup","cartLinesGrp","Object","entries","forEach","groupByDeliveryType","push","keys","key","cartLines","index","_filterItemsByMultiplePickupMode","lineItemDeliveryGroup","fulFillmentStoreId","pickupDeliveryModeDesc","pickupTitle","_getGroupTitleComponentWithMultiplePickUp","groupTitle","iconClass","lineItemWraperIcon","lineItemWraper","products","editCartText","payLoad","getPayloadObject","TelemetryConstant","EditCart","attribute","getTelemetryAttributes","groupClass","LineItems","Header","Msdyn365","tag","editProps","onEdit","requestContext","editLink","Button","color","itemsForPickup","itemsForShip","itemsForEmail","itemsGroupWithMulitplePickupMode","_getLineItems","QuickOrderDrawer","constructor","props","super","this","_toggle","bind","isManuallyToggled","state","isOpen","collapseProps","drawerGlyphClass","toggleGlyphClassName","animateGlyph","drawerOpenGlyph","openGlyph","closeGlyph","drawerCloseGlyph","shouldComponentUpdate","nextProps","nextState","render","children","drawerClass","toggleButtonProps","onClick","block","disabled","_generateDrawerButtonInnerMarkup","Collapse","collapseState","drawerButtonTextClass","toggleButtonClassName","moduleHeadingText","moduleDescriptionText","_generateGlyphMarkup","glyphClass","e","preventDefault","setState","onToggle","QuickOrderFormComponent","productTextInput","quantityTextInput","quickOrderState","maxChars","maxQuantity","disableAddtoCart","ariaLabelQuantity","ariaLabelProduct","ariaLabelAddtoCart","handleQuantityChange","handleInputChange","handleAddToCartClick","onInputChange","onInputChangeFunction","onQuantityInputChange","onQuantityChangeFunction","productNode","ref","onChange","quantityNode","pattern","maxLength","quantity","addToCartBtn","userMessage","stateMessage","Alert","statusCssString","messageGlyph","messageText","QuickOrderProduct","simpleProduct","isSelected","__decorate","observable","QuickOrderDesktopHeaderCellsComponent","columnWithNumberClassName","quickOrderProductNumberText","quickOrderProductText","quickOrderUnitPriceText","quickOrderUnitOfMeasureText","quickOrderQuantityText","quickOrderTotalText","quickOrderActionsText","QuickOrderMobileHeaderCellsComponent","QuickOrderTableHeaderComponent","rowClassName","headerCells","isMobile","defaultImageSettings","viewports","xs","q","w","h","lg","lazyload","cropFocalRegion","QuickOrderTableRowProductImageComponent","fallbackImageUrl","getFallbackImageUrl","ItemId","apiSettings","containerClassName","Image","altText","src","fallBackSrc","loadFailureBehavior","QuickOrderExtraActionsPopupComponent","ObjectExtensions","isNullOrUndefined","getProductPageUrlSync","QuickOrderDesktopTableRowCellComponent","Dimensions","dimension","DimensionValue","Value","dimensionValue","join","quickOrderProductDimensionsSeparator","Price","UnitOfMeasureSymbol","IncrementalQuantity","max","currentCount","quickOrderInputQuantityAriaLabel","decrementButtonAriaLabel","quickOrderDecrementButtonAriaLabel","incrementButtonAriaLabel","quickOrderIncrementButtonAriaLabel","isGiftCard","IsGiftCard","TotalAmount","quickOrderRemoveItemButtonAriaLabel","QuickOrderMobileTableRowCellComponent","format","quickOrderQuantityMobileText","QuickOrderTableRowComponent","QuickOrderTableComponent","setIsMobile","useState","isMobileView","quickOrderProducts","updateViewport","addEventListener","headerClassName","quickOrderProduct","QuickOrder","waitTime","dimensionUpdateQueue","FinitePromiseQueue","dimensions","cssClassNameConfigure","quickOrderCallbacks","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","changeUpdatingDimension","isUpdatingDimension","_handleInputChange","query","productText","productResponse","productDimensions","cancellabelDebounce","cancel","isQuickOrderFormExpanded","getScanResult","GetScanResultInput","channelId","results","Product","ProductDimensionFull","setTimeout","_addItemToCart","quickOrderAddedToCartSuccessMessage","quickOrderAddedToCartFailureMessage","_validateCart","isOrderQuantityLimitsFeatureEnabledInHq","defaultOrderQuantityLimitsFeatureConfig","app","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","isOrderQuantityLimitsFeatureEnabledInSiteSettings","IsB2b","getDeliveryOptionsAsync","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","channel","EmailDeliveryModeCode","defaultDeliveryOption","ArrayExtensions","hasElements","isOrderQuantityLimitsFeatureEnabled","productAvailableQuantity","_updateAvailablity","addProductToCartInput","enableStockCheck","availableQuantity","ProductAvailableQuantity","AvailableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","addProductToCart","substatus","maxQtyLimitReachedMessage","_getMaxQtyMessage","errorDetails","LocalizedMessage","warning","_handleQuantityChange","currentValue","Number","parseInt","inputElement","quantityInput","current","HTMLInputElement","isNaN","setAttribute","_updateDimensionValue","productDimensionFull","newValueId","DimensionValues","productDimensionTypeConfiguration","dimensionsToUpdate","productDimensionErrorState","otherError","clearOtherErrorState","configureErrors","errorState","mappedDimensions","DimensionTypeValue","ExtensionProperties","selectedProduct","Promise","resolve","reject","newProduct","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","variantProduct","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","productAvailable","_getDimensionErrorString","dimensionTypeValue","quickOrderproductDimensionTypeColorErrorMessage","quickOrderproductDimensionTypeConfigurationErrorMessage","quickOrderproductDimensionTypeSizeErrorMessage","quickOrderproductDimensionTypeAmountErrorMessage","quickOrderproductDimensionTypeStyleErrorMessage","missingDimensions","_getConfigureErrors","quickOrderWrongQuantityErrorMsg","viewport","device","Type","getTelemetryObject","telemetryPageName","friendlyName","quickOrderFormClass","quickOrderFormProductContent","quickOrderFormMsgContent","quickOrderModuleHeading","quickOrderModuleDescription","quickOrderAddtobag","quickOrderProductQuantityInputLabel","quickOrderProductInputLabel","quickOrderProductDimensionTypeColor","quickOrderProductDimensionTypeConfiguration","quickOrderSelectDimensionFormatString","quickOrderProductDimensionTypeSize","quickOrderProductDimensionTypeStyle","quickOrderProductDimensionTypeAmount","productConfigureResources","selectDimensionFormatString","viewProps","quickOrderProps","moduleProps","contentProps","isB2B","drawer","quickOrderForm","quickOrderList","_renderQuickOrderTable","form","configure","getProductConfigure","renderView","_initQuickOrderProducts","validValues","tableClassName","productInventoryInfo","currentQuantity","quickOrderMaxQuantityLimitText","maxQuantityForLineItem","maxQuantityForCartLineItem","minInventory","Math","min","computed","PromoCode","_onInputChangeHandler","promoCodeInputValue","canApply","_applyPromotion","cartState","appliedPromo","addPromoCode","promoCode","duplicatePromoCodeErrorText","invalidPromoCodeErrorText","failedToAddPromoCodeErrorText","_onSubmitHandler","_applyPromotionHandler","_renderForm","promoPlaceholderText","promoCodeApplyButtonText","attributes","onSubmit","placeholder","_removePromotion","code","currentTarget","getAttribute","removePromoCodes","promoCodes","failedToRemovePromoCodeErrorText","_calculateDiscount","discountAmount","line","DiscountLines","discountLine","DiscountCode","DiscountCost","_renderAppliedPromoCode","Coupons","removePromotionHandler","promoCodTotalDiscount","coupon","appliedPromoCodeHeadingText","PriceComponent","price","CustomerContextualPrice","ariaLabel","removePromoAriaLabelFormat","removePromoText","ApplyPromoCode","isCollapseOpen","promoCodeHeadingText","getProductByProductId","getProductByProductIdAndWarehouse","warehouseId","targetWarehouseValue","WarehouseId","Behavior","InventoryLocationId","SubmitUserReviewInput","userReviewData","authorization","getCacheKey","getCacheObjectType","dataCacheType","SocialShareItem","_getSocialShareItem","viewprops","SocialShareItemElement","icon","socialMedia","SocialMediaComponent","SocialMedia","Facebook","postUrl","document","Twitter","Pinterest","Linkedin","Mail","emptyActiveCart","checkoutState","lineItemIdsToRemove","getCartState","getCheckoutState","checkoutCart","activeCart","activeCartLine","checkoutCartLine","removeCartLines","cartLineIds","removeAllPromoCodes","removeCheckoutCartId","getAdditionalContentItems","additionalContentHeading","handleAdditionalTextChange","renderHeading","subtext","additionalContentParagraphText","handleAdditionalParagraphChange","renderParagraph","links","ctaLink","linkIndex","editableLink","linkText","linkUrl","destinationUrl","openInNewTab","role","link","onTextChange","handleAdditionalLinkTextChange","renderLinks","additionalContentItemContainer","additionalContentItemLinks","videoPlayerAdditionalContent","additionalContent","additionalContentNode","additionalContentItems","VideoPlayer","handleTextChange","handleParagraphChange","paragraph","isMobileDevice","variant","VariantType","Viewport","options","video","playerResources","playAriaLabel","playLabel","pauseAriaLabel","pauseLabel","playingAriaLabel","playingLabel","pausedAriaLabel","pausedLabel","muteAriaLabel","muteLabel","unMuteAriaLabel","unMuteLabel","fullScreenAriaLabel","fullScreenLabel","exitFullScreenAriaLabel","exitFullScreenLabel","seekBarLabel","videoTimeDurationLabel","closedCaptionLabel","videoMetaData","videoId","duration","playTime","thumbnail","posterframeUrl","_links","binaryReferences","videoBinaryReferences","videoPlayerData","metaData","player","Player","playerData","isEditor","params","_getVideoDetailsHeading","_getVideoDetailsParagraph","_getVideoDetailsLinks","detailsContainer","detailsContainerCTA","handleText","handleParagraph","handleAdditionalText","handleAdditionalParagraph","handleLink","handleLinkTextChange","handleAdditionalLink","linkData","contentAction","etext","linkId","OPERATIONS","PayCard","PayGiftCertificate","PayLoyalty","PayCustomerAccount","getCardTypeId","cardPrefix","resolveCardTypesAsync","CardType","Unknown","TypeId","findTenderIdTypeByOperationId","tenderTypes","operationId","matchedTenderType","tenderType","OperationId","TenderTypeId","roundNumber","toFixed","updatedCartVersion","isPaymentVerificationRedirection","channelConfiguration","giftCardExtends","tokenizedPaymentCard","guestCheckoutEmail","billingAddress","loyaltyAmount","cardPaymentAcceptResult","shouldEnableSinglePaymentAuthorizationCheckout","Currency","cartTenderLines","amountDue","AmountDue","getTenderLinePromises","loyaltyCardNumber","LoyaltyCardId","chargedAmount","loyaltyTenderLinePromise","Amount","getTenderTypesAsync","getLoyaltyTenderLine","some","giftCardExtend","Balance","tenderTypeId","giftCardPin","Pin","giftCardExpirationYear","ExpirationDate","split","giftCardExpirationMonth","creditCardTenderLinePromise","GiftCardId","GiftCardPin","GiftCardExpirationYear","GiftCardExpirationMonth","getGiftCardTenderLine","Id","customerAccountAmount","customerAccountTenderLinePromise","CustomerId","user","isAuthenticated","createCustomerAccountTenderLine","isExpressCheckoutApplied","amount","currency","cardTenderLine","CardPaymentAcceptResult","getCreditCardTenderLineForSinglePaymentAuth","cartTypeId","CardTypeId","TenderType","TokenizedPaymentCard","House","CardTokenInfo","Phone","Country","ThreeLetterISORegionName","Address1","Street","City","State","Zip","ZipCode","getCreditCardTenderLine","all","cartVersion","Version","salesOrder","checkoutAsync","bypassCache","AdditionalContext","updateShouldCollapsePaymentSection","newShouldCollapsePaymentSection","updateRedirectAdditionalContext","newRedirectAdditionalContext","updateIsCheckoutCallFailed","newIsCheckoutCallFailed","refreshCart","CartIconView","PureComponent","_modalContainer","Modal","placement","hideArrow","wrapClassName","isModalOpen","toggle","closeModal","_openModal","onTelemetryClick","_renderCartCloseIcon","_renderCartItemCount","cartItemCount","cartlines","Node","tabIndex","_escFunction","keyCode","KeyCodes","Escape","isAutoDisplayTriggered","componentDidMount","componentWillUnmount","removeEventListener","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","miniCartWrapper","renderModuleAttributes","cartIcon","flyoutTitle","isEmpty","slots","emptyCart","CartlinesWrapper","cartLineIndex","miniCartItemWrapper","storeLocation","cartline","remove","promoContentItem","hasInvoiceLine","totalPrice","cultureFormatter","formatCurrency","emptyPrice","totalPriceFormatString","renderTotalPrice","subTotalMessage","checkoutAsSignInUserButton","checkoutAsGuestButton","goToCartButton","getUrlSync","continueShoppingButtonTitle","Title","BulkPurchaseViewComponent","Module","container","content","TOGGLE_REVIEW_MODAL_BUTTON_ID","TOGGLE_EDIT_MODAL_BUTTON_CARD_ID","ReviewCard","cardProps","isUserReview","review","name","userName","rating","date","renderDate","submittedDateTime","reviewTitle","reviewText","ratingHelpfulLabel","wasReviewHelpfulText","like","voteHelpfulButton","dislike","edit","editButton","report","reportToggle","responseName","userResponse","responderName","responseText","responseDate","cardBodyProps","responseProps","reviewProps","controlsProps","headerProps","RatingComponent","readOnly","avgRating","reviewRatingNarratorText","parentId","parentType","isVoted","i","votedReviews","approved","isVotedFor","isDisabled","yesButtonText","noButtonText","voteCount","helpfulPositive","helpfulNegative","updateReviewHelpfulness","signInUrl","toggleWriteReviewModal","editReviewCardText","Intl","DateTimeFormat","month","day","year","Date","toggleReportReviewModal","reportConcernText","reportedReviews","includes","reportedText","reportedReviewId","returnRef","innerRef","ReviewCount","currentPage","reviewsCount","reviewsShownOnEachPage","pageReviewCountText","_getReviewStartNumber","_getReviewEndNumber","PageControls","previousPageClick","_getPreviousPageData","nextPageClick","_getNextPageData","Next","nextAttribute","Previous","previousAttribute","_hasPreviousPage","_paginationAriaLabel","pageReviewAriaLabel","previousButtonText","_hasNextPage","nextButtonText","_getPagesCount","_getReviewsShown","ceil","isNextPage","page","pageModifier","pageReviewCount","updateReviews","selectedSortByOption","selectedFilterByOption","ProductRefinerValueDataTypeValue","ProductRefinerTypeValue","ProductRefinerSource","isRangeType","dataTypeValue","AttributeDataType","Decimal","Integer","findMatchingRefinementCriterion","productRefinerValue","refinementCriteria","refinementCriterion","isMatchingRefinementCriterion","RefinerRecordId","RefinerSourceValue","DataTypeValue","LeftValueBoundString","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","toggledItemFound","selectedCriterion","isSelecting","next","rangeStart","RightValueBoundString","rangeEnd","Text","TrueFalse","parentProductRefinerHierarchy","RefinerTypeValue","RefinerType","SingleSelect","Values","child","matchingIndex","findIndex","criterion","splice","renderConfigure","containerProps","dropdowns","renderConfigureDropdown","dropdown","labelContainerProps","errors","select","quickOrderView","quickOrderProductContent","quickOrderMsgContent","renderForm","RatingsHistogram","handleHeadingChange","selectFilterBy","ratingsSummary","ratingCount","totalRatingsCount","completeClass","classname","callbacks","histogramItems","HistogramItems","averageRating","averageRatingAriaLabel","hideCount","averageNumber","AverageRatingNumber","summary","totalReviews","TotalReviews","ratingsSummaryProps","histogramProps","stars","filterKey","update","createRatingsReviewsStateInput","observer","WishlistItemDimension","WishListItemActions","itemKey","handlers","onAddToCart","onRemoveItem","_renderAriaLabel","formattedPrice","BasePrice","freePriceText","CurrencyCode","productDimension","renderProductLink","recordId","productName","productAttributes","renderInventoryInformationLabel","inventoryInformationLabel","inventoryLabelClassName","inventoryCssName","WishlistItemAddToCartButtonComponent","isInStock","addToCartText","outOfStockText","isServiceItem","ItemTypeValue","ReleasedProductType","Service","addItemAction","WishlistItemRemoveFromWishlistButtonComponent","removeFromWishlistText","removeItemAction","renderUnitOfMeasure","unitOfMeasure","unitOfMeasureDisplayType","_renderProductImage","image","fallbackImage","xl","_renderPrice","moduleId","moduleTypeName","_renderProductDimensions","WishlistItemsStatusMessage","errorType","WishlistItems","_onDismiss","_renderHeading","productAvailability","addedToCartSuccessMessage","addedToCartFailureMessage","invoiceInCartErrorMessage","productInventoryInformation","_getProductInventory","ProductDetails","curQuantity","_getInventoryValueMessage","_removeItemFromWishlist","wishlists","userToken","token","wishlistLineId","_getWishlistLineIdFromProductId","removeLinesAsync","commerceList","castCommerceList","createGetByCustomerInput","getItemsInWishlists","ActiveWishlistInput","castSimpleProducts","_inventoryLabel","StockLevelLabel","_inventoryClassName","StockLevelCode","toLowerCase","_isProductInStock","productResult","IsProductAvailable","CommerceListLines","foundWishlistItem","commerceListLine","emptyWishlistText","wishlistErrorGettingWishlist","errorProps","statusMessage","productsList","emptyViewProps","Products","ProductDimensions","_renderProductList","priceFree","addToCartButtonText","removeButtonText","enableImageProductLink","wishlistState","productImage","productLink","productPrice","productUnitOfMeasure","DefaultUnitOfMeasure","entireProductLink","productAriaLabel","addToCartButton","inventoryInformation","removeButton","productStatusMessage","onDismiss","WishlistItem","ProductPrice","maxQuantityLimitText","productInventoryCollection","PickUpInStore","_toggleBOPIS","isBopisSelected","storeSelectorStateManager","storeSelectorModuleId","openDialog","alreadySelectedLocation","onLocationSelected","orgUnitLocation","updateCartLinePickupLocation","cartLineId","locationChangedHandler","_onLocationChangedCallback","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","foundLocation","option","toggleBopis","defaultComponent","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","checked","_renderShippingMethod","shipitText","pickUpInStoreText","pickupStore","delivery","_getDeliveryOption","ContainerProps","ExperlogixModifyCartLineButton","labelText","p","Key","assembleUrlParams","assembleCartlines","reactNodes","_getProduct","foundProductAvailability","foundProductDeliveryOption","productAvailabilites","InventLocationId","foundProductDeliveryOptions","removeItemClickHandler","moveToWishlistSuccessHandler","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","addToWishlistButtonText","removeFromWishlistButtonText","orderTemplates","defaultWishlistName","nameOfWishlist","availableQuantityInStock","isStockCheckEnabled","maxQuantityByConfig","isQuantityLimitsFeatureEnabled","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","_getCartItemMaxQuantity","maxCartlineQuantity","MaximumQuantity","errorMessage","lineIndex","finalErrorMessages","includeErrors","outOfRangeOneText","outOfRangeFormatText","cartlinesErrors","LineIndex","DataValidationFailure","ErrorContext","_getErrorMessage","payload","TelemetryEvent","RemoveFromCart","inventoryLbl","inventoryCode","isCustomPriceSelected","cartlineId","isOutOfStock","getInvoiceDetailsPageUrlSync","quantityOnChange","updateCartLinesQuantitySuccessHandler","isCartStateReady","pickUpInStore","pickitUpText","addToWishlist","AddToWishlistComponent","showButtonText","showStatusMessage","showRemoveButton","showButtonTooltip","onSuccess","addToOrderTemplate","AddToOrderTemplateComponent","shouldShowButtonFailedTooltip","disableButton","experlogixModify","experlogixModifyText","_assembleNode","CartLineGroupItems","deliveryType","carLineViewProps","_assembleGroupCartlines","getPromotionData","promotionData","getPromotionOptionsForCartLineItems","PromotionOptionsForCartLineItems","promotionOptions","Cart","Component","showPromotionDialog","promotionPopupId","promotionLinkClick","promotionCloseButtonclick","_hidePromotionDialog","_getImageSettings","sm","_removeItemFromCartHandler","cartlineToRemove","_moveToWishlistSuccessHandler","_updateCartlineQuantity","cartlineToUpdate","isUsingDefaultOrderSettingsMax","modifiedProduct","newQuantity","updateCartLineQuantity","_fulfillmentStoreIdUpdated","getActiveCartProductsAction","ActiveCartProductsInput","message","_getOrderQuantityLimitsFeatureFlag","showAvailablePromotions","reaction","guestCheckoutUrl","backToShoppingUrl","checkoutURL","_getCheckoutURL","isCartEmpty","_getCartLines","RetailMultiplePickupFeatureState","multiplePickUpEnabled","_getCartLinesGroup","Checkout","checkoutBySignInAttributes","GuestCheckout","checkoutByGuestAttributes","BackToShopping","backtoShoppingAttributes","hasErrors","cartTitle","OrderSummaryWrapper","OrderSummaryItems","_getPromoCode","_getPromotions","orderSummaryHeading","invoiceSummaryTitle","orderSummaryTitle","orderSummaryLineitems","_getOrderSummaryLineItems","invoiceSummaryLineitems","_getInvoiceSummaryLineItems","checkoutButtonTitle","guestCheckoutButtonTitle","backToShoppingButton","backToShoppingButtonTitle","createTemplateFromCartButton","_displayAddCartToTemplate","SaveCartToOrderTemplateComponent","_generateAddToOrderTemplateDialogResources","_generateOrderTemplateNameDialogResources","linesAddedToOrderTemplateDialogResources","_generateLinesAddedToOrderTemplateDialogResources","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","storeSelector","waitingComponent","Waiting","cartLoadingStatus","cartLoadingErrorMessage","cartDataResult","OrderSummaryErrors","_getOrderSummaryErrors","RetailB2BEcommerceFeatureState","showPromotionPopup","promotions","promotionLinkText","promotionPopupHeading","onCloseButtonClick","onSeeAllClick","titleId","promotionMessageWrapper","promotionMessage","promotionStringHeading","promotionSeeAllLink","promotionDialog","ModalHeader","ModalBody","_promotion","Promotion","OfferName","ModalFooter","cartPromotions","promotionCloseButtonAriaLabel","allErrors","fullError","Wrapper","assertive","outOfStockErrorMessageHeader","header","InvoiceSummary","orderTotalLabel","totalAmountLabel","invoiceLabel","OrderSummary","subTotalLabel","itemsWithCountLabel","shippingLabel","estimatedShippingLabel","otherChargeLabel","otherCharges","taxLabel","estimatedTaxLabel","orderTotal","totalDiscountsLabel","toBeCalculatedText","yetToBeCalculatedText","freeText","PromoCodeComponent","collapseTimeOut","duplicatePromotionErrorText","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","_generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","linesAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateCustomPriceAlertMessageText","_generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","PickupDeliveryModeCode","modules","storeSelectorId","CartLineItems","quantityDisplayText","removeCartButtonText","shipInsteadDisplayText","pickItUpDisplayText","changeStoreDisplayText","outOfStockErrorMessage","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","showOutOfStockErrors","addToOrderTemplateMessage","addItemToOrderTemplateError","isAbsoluteUrl","RegExp","test","returnURL","origin","retry","AsyncResult","cartResult","validationResult","validateForCheckoutAsync","ValidationFailuresByCartLines","refreshError","validateError","featureStatuses","ReviewsList","sortByDropdownOptions","mostHelpfulSortOptionText","mostRecentSortOptionText","highestRatedSortOptionText","lowestRatedSortOptionText","filterByDropdownOptions","allRatinsFilterByOptionText","fiveStarFilterByOptionText","fourStarFilterByOptionText","threeStarFilterByOptionText","twoStarFilterByOptionText","oneStarFilterByOptionText","reviewsList","pagingInfo","totalItems","listOfReviews","isFilterApplied","ratingsReviewsState","filterKeyValue","dropdownItemsCount","filterByOption","selectedIndex","_userReview","userReview","_reviewCard","_reviewCards","reviewList","reviewElements","isTakenDown","isPublished","_userReportModalToggle","reportingReviewId","_toggleReviewModal","_onReportModalOpen","updateReviewHelpfulnessVote","_userReviewModal","ReviewModal","isReviewModalOpen","userReviewRating","userReviewTitle","userReviewText","onModalToggle","onTitleChange","_onTitleChange","_onTextChange","onRatingChange","_onRatingChange","onReviewComplete","_onReviewComplete","renderContextId","_userReviewModalToggle","hasError","hasReviewError","reviewsListCallbacks","updateReviewTitle","updateReviewText","updateRating","isSuccess","_reportReviewModal","ReportReviewModal","isReportModalOpen","reportedKey","_onReportModalClose","onRadioChange","_onRadioChange","reportReview","_reportReview","hasReportError","reported","ReviewConcernCategory","SpamAdvertising","_reportReviewCallback","reportReviewConcern","ReportReviewConcernInput","getRnrPartnerId","getUserToken","getRnrAuthEndpointId","_value","reportedReview","updateSortByDropdown","notification","selectedOption","updateFilterByDropdown","skipItems","getSelectedProductIdFromActionInput","getReviewsForGivenProduct","GetProductReviewsInput","getRnrEndpointId","_updateVoteUi","alreadyExists","list","concat","submitHelpfulnessVote","SubmitHelpfulnessVoteInput","onReviewSubmitted","isSuccessful","submitReview","toggleModal","toggleReportModal","showSpinner","reviewModal","reportReviewModal","filterByDropdown","LabeledDropdown","filterByDropdownText","dropdownId","dropdownOptions","onSelectOption","controlledByParent","sortByDropdown","sortByDropdownText","reviewCount","refineReviewsProps","reviewsListProps","reviewCards","pageControls","noReviewsMessage","noReviewsWithFilterMessage","noReviewsWithSelectedFilterMessage","sortByOptions","filterByOptions","SearchResultContainer","sortOptions","sortByOptionRelevanceDesc","sortByOptionNameAsc","sortByOptionNameDesc","sortByOptionPriceAsc","sortByOptionPriceDesc","sortByOptionRatingDesc","sortByOptionBestSelling","sortByOptionNewScore","sortByOptionTrendingScore","_pageType","urlTokens","pageType","_viewport","expandrefinerCount","defaultPageNumber","catalogId","getCatalogId","_getProductsDimensionsAvailabilities","listPageState","activeProducts","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","_getActivePrice","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSearchResultModal","SearchResultModal","modalCloseButtonText","modalTitle","modalIsOpen","_modalToggleRef","_toggleModal","_getCollectionTitle","collectionTitle","category","SearchResultContainer_1","getFriendlyName","NameTranslations","productCountNumber","productCountText","totalProductCount","numberOfProducts","oneProduct","pageName","titlePrefix","searchTextPrefix","titleText","titleCount","TitleContainer","_getCategoryHierarchy","categoryHierarchy","CategoryHierarchyContainer","categoryHierarchyList","Link","categoryLinkAriaLabel","Url","categoryHierarchySeparator","Separator","separator","_getSortingDropDown","activeDropdown","_getCurrentlySelectedOption","sortingState","_getAllSortByOptions","hideRating","dropdownOption","SortingContainer","sortByDropDown","labelClassname","sortByDropdownLabel","dropdownClassname","toggleColor","_updateSortByDropdown","_sortAndFilterContainerRef","_getPagination","getCurrentUrl","itemsPerPage","skipCount","currentPageNumber","skip","previousText","flipperPrevious","nextText","flipperNext","UncontrolledPagination","paginationAriaLabel","url","qsp","startingItem","_renderPrev","_renderNext","previousAriaLabel","nextAriaLabel","_getRefineMenu","tempRangeTypeTODO","inputRange","validRefiners","updateRefinerPanel","refiners","refiner","_shouldHideFromRefiners","activeRefiners","activeFilters","_getexpandRefinerCount","expandRefinersCount","expandedRefiners","RefineMenuContainer","RefinerSectionContainer","productRefinerHierarchy","RefineSubmenu","selectedRefinerValues","refineItemCommonProps","_refineItemCommonProps","minValueSliderThumbAriaLabel","maxValueSliderThumbAriaLabel","onUpdateRefiners","_onUpdateRefiners","urlBuilder","_buildRefinerUrl","isExpandedOnInitialLoad","productCountAriaLabel","refineItemAriaLabel","refineItemsAriaLabel","singleProductCountAriaLabel","productListInventoryDisplay","ProductListInventoryFilteringOptions","HideOOS","channelInventoryConfigurationId","_getChoiceSummary","selectedRefiners","ChoiceSummary","classNames","clearAllText","choiceSummaryLabel","closeAriaLabel","selectedChoices","refinerHierarchy","choiceFormat","choiceRangeValueFormat","onChoiceClicked","_onChoiceClicked","_buildRefinerUrlForChoiceSummary","choiceAriaLabel","_getProducts","allowBackNavigation","breaCrumbType","breadcrumbType","allowBack","quickviewslot","quickview","isPriceMinMaxFeatureState","ProductSearchResultItems","moduleType","quickviewSlot","isPriceMinMaxEnabled","history","pushState","buildListPageUrl","_getSortColumnFromSelectedOption","transaction","sortingCritera","Columns","searchConfiguration","mappedConfiguration","sortColumn","_getSortCriteriaColumn","sortCriteria","queryColumns","parseQueryParam","mappedSearchConfiguration","mappedSearchConfig","activeSortColumn","activeMappedConfig","ColumnName","IsDescending","newRefinementCriteria","clearAll","dropdownElementId","dropdownElement","getElementById","focus","selectedChoice","choiceClicked","selectedRefiner","isClearAll","refinerCount","paginationPreviousText","paginationNextText","_updateViewport","productPrices","pending","placeholderTextMax","minLabel","maxLabel","rangeNameFormat","validationErrorNaN","validationErrorNotNumber","validationErrorRange","validationErrorNotRange","querySorting","sorting","JSON","parse","decodeURIComponent","pageSize","hydrateRefinersFromUrl","GetFullProductsByCollectionInput","Paging","Top","Skip","Sorting","itemId","stringify","Recommendation","recommendation","includeAttributes","getCollectionProducts","productResults","enableAffiliationBasedPricing","refinerInput","RefinersByCollectionInput","getCollectionRefinersAction","featureProduct","listPageStateFeature","nameTranslations","nameTranslation","Language","dimensionsToDisplayOnProductCard","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","DimensionTypes","none","searchProduct","errorText","resultCategoryNotFoundText","resultSearchNotFoundText","productsComponent","featureComponent","FeatureSearchResultItem","searchResultContainerViewProps","TitleViewProps","disableHierarchy","refineMenu","pagination","ProductsContainer","ProductSectionContainer","CategoryNavContainer","RefineAndProductSectionContainer","choiceSummary","modalToggle","ModalToggle","searchResultModal","ErrorMessage","FeatureSearchContainer","similarLookProduct","_getViewport","Browser","OrderSummaryLine","cssLabel","_buildOrderSummarySection","_computedLoyaltyAmount","getDeliveryMode","featureSate","pickupDeliveryMode","dM","SubtotalAmount","TaxAmount","DiscountAmountWithoutTax","OtherChargeAmount","canShip","hasDeliveryMethod","hasShippingMethod","freightFee","deliveryModes","ShippingChargeAmount","getDeliveryConfiguration","isTaxGreaterThanZero","subtotal","tax","otherCharge","shipping","giftCardAmount","giftCardTotalValue","giftCard","_computeGiftCardAmount","totalAmountAfterGiftCard","loyalty","loyaltyLabel","giftcardLabel","totalDiscounts","shouldSkipStockCheck","IsInvoiceLine","shouldIgnoreWarehouse","onRemoveClickHandler","onRemoveClickFunction","catalogs","ariaRole","disableTooltip","_isMounted","getImageSettings","removeItemFromCartHandler","validateCart","updateCartlineQuantity","cartLineQuantityUpdatedAsync","cartActionResult","lineUpdateFailure","validationResults","previousState","currentErrors","fulfillmentStoreIdUpdated","isCartValid","getOrderQuantityLimitsFeatureFlag","getCheckoutURL","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","getCartLinesGroup","cartLineGroup","_updateCartLineErrorForInvalidInventory","expressCheckoutButton","paymentExpress","cartLineInventoryValidationResult","productIdWithErrors","productIdWithError","element","warehouseAggregation","priceEditorResources","validateCartAsync","retrieveItems","CarouselView","carouselContainer","Carousel","closeAnimation","activeIndex","previous","pause","pauseOnHover","ride","autoplay","interval","transitionType","hideFlipper","dismissEnabled","onIndicatorsClickHandler","handleDismissCarousel","dismissCarouselAriaText","ariaLabelForDismissButton","indicatorAriaText","ariaLabelForSlide","directionTextPrev","directionTextNext","handleOnExited","handleOnExiting","activeImageView","activePointContainer","activePointDetailsContainer","imageMapper","additionalContentContainer","detailsContainerCta","style","top","productCardtopPosition","left","productCardleftPosition","overlay","productCard","reportReviewConcernDataAction","concernCategory","withModuleState","WrappedComponent","_super","_this","states","getModuleStates","updateModuleStates","_a","hasInitialized","isRequired","isCancellable","isSubmitContainer","childIds","moduleState","validate","isReady","isUpdating","isPending","isSkipped","isCancelAllowed","shouldSubmitContainer","hasExternalSubmitGroup","hasModuleState","setIsRequired","setIsCancellable","setIsSubmitContainer","setHasError","onReady","onUpdating","onPending","onSkip","onDisable","getModule","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","init","__assign","moduleStates","values","_moduleState","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","childId","_isPaymentSectionContainer","_validateContainer","enableControl","initializeState","__extends","ModuleState","_renderCartlines","cartEmptyText","renderCartLinesGroupHeader","pickUpText","shippingText","emailShippingText","titleSeparate","renderCartLinesGroupTitle","CartView","errorData","emailshippingText","emptyCartText","renderCartLinesGroup","invoiceSummaryLines","invoices","_renderInvoiceSummarylines","orderSummaryLines","_renderOrderSummarylines","onApplyHandler","onApplyGiftCard","onChangeNumberHandler","onEnterGiftCardNumber","onChangePinHandler","onEnterGiftCardPin","onChangeExpHandler","onEnterGiftCardExp","getForm","inputRef","inputPinRef","inputExpRef","giftCardNumber","giftCardExp","supportExternalGiftCard","additionalFields","disableAddGiftCard","applyGiftCardButton","giftCardFormLabel","giftCardNumberLabel","giftCardPinLabel","giftCardExpLabel","giftCardAlertLabel","giftCardPinPlaceholderText","giftCardExpPlaceholderText","formProps","inputPinLabel","inputExpLabel","alertFieldLabel","alert","fade","includeAlertClass","inputNumber","inputPin","inputExp","applyButton","showGiftCardPinInput","showGiftCardExpInput","inputProps","inputNumProps","inputPinProps","inputExpProps","onRemoveHandler","onRemoveGiftCard","getItem","getFormattedPrice","canRemove","enteredGiftCardLabel","giftCardAvailableBalanceLabel","removeGiftCardButton","balance","CardCurrencyCode","giftCardLast4Digit","substr","selectedGiftCard","itemProps","getList","giftCards","listProps","GiftCardTitle","SupportedGiftCardType","CheckoutGiftCard","isFetchingGiftCard","onCancel","isEnabled","checkout","couldPaidByGiftCard","giftCardSupported","External","shouldBeEnabledForGuest","handleCancelOrSubmit","hasSelectedItem","currencyCode","enterGiftCardNumber","clearError","enterGiftCardPin","enterGiftCardExp","setError","removeGiftCard","applyGiftCard","trim","giftCardTypes","getGiftCardTypes","giftCardType","isPinRequired","IsPinRequired","isExpRequired","IsExpirationDateRequired","PaymentMethodId","getGiftCard","addGiftCard","findGiftcardTenderTypes","giftcardType","matchedTenderTypes","Internal","ConnectorId","noBalanceError","invalidCardInfoError","invalidCardTypeError","noCardPinError","noCardExpError","supportedGiftCardType","internalGiftcardTenderTypes","externalGiftcardTenderTypes","Both","getGiftCardAsync","activeGiftCard","emptyInputError","duplicatedCodeError","invalidCodeError","card","GiftCard","getLoyaltyAmount","getGiftCardTotalAmount","requestFormData","pv","when","isDataReady","showAdditionalFields","shouldPayGiftCard","moduleClassName","checkoutGiftCardProps","showGiftCard","TitleCompoent","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_isTermsAndConditionAccepted","_customerAccountAmount","CheckoutState","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","newTokenizedPaymentCard","newTenderLine","newShippingAddress","newBillingAddress","newCardPrefix","__spreadArrays","newLoyaltyCardNumber","newAmount","newGuestCheckoutEmail","newIsTermsAndConditionAccepted","createSearchResultModal","modalProps","isRecoSearchPage","modal","modalHeader","createModalBody","modalFooter","modalBody","renderSort","renderRefiner","submenu","renderCategoryHierarchy","renderTitle","renderTitleCount","SearchResultContainerView","VideoPlayerView","RefineItem","_onClick","selectedRefinementCriterion","anchorType","isChecked","attrs","isSingleSelect","itemTypeClassName","inputType","SourceValue","Rating","_renderRating","LeftValueBoundLocalizedString","productCount","Count","refineMenuItemAriaLabel","KeyName","_getRefinerUrl","_renderSwatch","toLocaleLowerCase","hasColor","SwatchColorHexCode","hasImage","SwatchImageUrl","swatchItems","checkIfShouldDisplayAsSwatch","colorHexCode","imageUrl","SwatchComponent","isSelectionEnabled","isRefineItem","ratingUserCountAriaLabel","ratingSingleUserCountAriaLabel","refinerRating","ratingRefiner","selectedRating","defaultChkProductCount","ratingComponentClass","productCountAriaLabelValue","RatingsHistogramView","componentId","reviewsCountString","numberOfReviewsString","buttonProps","starLabel","bar","histogramItem","reportConcernDropdownOptions","SubmitReview","submitReviewAttribute","SuccessButton","successAttribute","Cancel","cancelAttribute","reportSpamText","OffensiveContent","offensiveContentText","Profanity","profanityContentText","applicationNode","returnFocusRef","headerSubmitted","feedbackThankYouText","cancelButton","cancelReportReviewText","submitButton","reportReviewButtonText","succesfulButton","okReportReviewText","reportMessage","reportModalMessage","reportSubmittedMessage","radioButtons","radioPairs","errorMessageText","pairs","inputId","htmlFor","PickUpAtStoreComponent","EmailDeliveryComponent","LineItemComponent","LineItemGroupComponent","lineItem","LineItemGroupComponentWithMultiplePickUp","LineItemComponentWithMultiplePickUp","PickUpAtStoreComponentWithMultiplePickUp","LineItemsComponent","OrderSummaryComponent","lines","PaymentSummaryComponent","CheckoutView","canShow","checkoutProps","hasSalesOrder","bodyProps","mainProps","mainControlProps","sideProps","sideControlFirstProps","sideControlSecondProps","termsAndConditionsProps","orderConfirmation","loading","guidedForm","orderSummary","invoicePaymentSummary","placeOrderButton","termsAndConditions","keepShoppingButton","onClickSubmit","submitButtonAttribute","cancelButtonAttribute","modalHeaderNode","discardReviewButtonText","submitDisabled","submitReviewButtonText","ratingsInput","ratingLabel","ratingsLabel","titleInput","titleLabel","textInput","textLabel","privacyPolicyUrl","privacyPolicyLink","autoComplete","inputRow","editReviewModalTitle","writeReviewModalTitle","stripWhiteSpacesFromString","selectRatingAriaLabel","initialRating","selectRatingLabel","reviewTitleMaxLength","reviewTitleAriaLabel","reviewTitleLabel","reviewTextMaxLength","rows","reviewAriaLabel","reviewTextLabel","policyTextBlocks","privacyPolicyTextFormat","isSeparatorAtStart","startsWith","isSeparatorAtEnd","endsWith","PrivacyPolicy","privacyPolicyAttribute","privacyPolicyTitle","onReviewSubmission","userEmail","emailAddress","submitUserReview","firstName","getReviewInput","GetUserReviewInput","getInvoicePaymentSummary","isValidationPassed","isPlaceOrderLoading","handleCheckoutHeadingChange","checkoutHeading","isLoading","cartStatus","isEmptyCart","getSlotItems","triggerPaymentWithPlaceOrder","updateShouldTriggerPaymentWithPlaceOrder","newShouldTriggerPaymentWithPlaceOrder","shouldTriggerPaymentWithPlaceOrder","onPlaceOrder","checkoutOutOfStockErrorMessage","genericErrorMessage","invalidCartVersionErrorMessage","isOverMaxQuantity","hasOrderConfirmation","updateCartLineEmailAddress","placeOrder","updateIsPaymentSectionContainerReady","newIsPaymentSectionContainerReady","emailDeliveryCartLines","lineDeliverySpecifications","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","DeliveryPreferenceType","ElectronicDelivery","ElectronicDeliveryEmailAddress","updateLineDeliverySpecificationsAsync","updatedCart","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","productsThatShouldValidateInventory","cartlineProduct","isStockedItem","IsStockedProduct","productInventory","cartLinesInventoryValidation","getActiveChildModuleStates","onContainerReady","redirectToCartPage","notFoundEditCartLinkMessage","editCartLink","assign","validateForCheckout","isEditorialMode","isTermsAndConditionAccepted","isCartReady","isPaymentSectionContainerReady","redirectAdditionalContext","isPaymentVerificationRequired","isPaymentSectionContainerHasError","canPlaceOrder","updateIsPlaceOrderEnabledInRedirection","newIsPlaceOrderEnabledInRedirection","disableGuidedCheckoutFlow","backToShopping","placeOrderText","confirmPaymentText","cookieConsentRequiredMessage","checkoutClass","checkoutInformation","isConsentGiven","cookies","backToShoppingAttributes","checkoutBtnText","hasShippingAddress","hasCartDeliveryMode","hasGuestCheckoutEmail","renderMsdyn365Text","AlertComponent","GuidedFormComponent","resource","getOrderSummary","PlaceOrderButtonComponent","getInventoryLabel","AttributeValues","inventoryAttribute","TextValue","priceResources","priceRangeSeparator","ProductComponent","ratingAriaLabel","quickViewButton","inventoryLabel","swatchItemAriaLabel","dimensionAvailabilities","dimensionAvailability","masterProductId","closeButtonGlyph","stopPropagation","_getSelectedRefinerChoice","itemClicked","nextItemToFocus","nextSibling","choice","parent","hierarchy","_getKeyForRefinerValue","selectedRefinersMap","clearAllAttributes","overallFormat","rangeFormat","refinerValueName","refinerName","_formatPrice","UnitText","selected","textContent","SearchForm","FormWrapper","cancelBtn","submitBtn","_renderKeywordSuggestions","KeywordSuggest","UlKeyword","keywordSuggestions","isLoadingAutoSuggest","isLoadingNode","_renderProductSuggestions","ProductSuggest","UlProduct","productSuggestions","LiProduct","AProduct","_renderCategorySuggestions","CategorySuggest","UlCategory","categorySuggestions","SearchView","Search","AutoSuggestAriaLabel","AutoSuggestAriaLabelText","searchText","AutoSuggest","autosuggestCategory","autosuggestKeyword","autosuggestProduct","balanceCheckButton","GiftCardBalanceCheck","_isEnabled","_getFormattedPrice","_enterGiftCardNumber","_clearError","_enterGiftCardPin","_enterGiftCardExp","_setError","_applyGiftCard","_getGiftCardTypes","_getGiftCard","_findGiftcardTenderTypes","giftCardBalanceCheckProps","_onToggleItem","_onToggleSubmenu","isExpanded","expanded","timeout","_renderChildItems","_renderRange","_renderSingleMultiSelect","refinerValuesList","listItems","selectedValue","_getRangeType","DisplayTemplateValue","DisplayTemplate","Range","Slider","SliderWithBars","rangeType","RangeRefineItem","sliderKey","prevState","cacheKey","ModuleStatesCacheKey","SignInMessage","SignInButton","SignIn","WriteReview","writeReviewCallbacks","createRef","userInfo","signInMessage","signInButton","signInLabel","signInAriaLabel","editReviewButtonText","reviewButtonLabel","_buildUserReviewModal","renderRating","ratingId","totalRatings","numberRatings","roundedRating","getRatingAriaLabel","ActiveProductComponent","savingsText","imgData","imageProps","renderProductPlacementImage","basePrice","adjustedPrice","AdjustedPrice","renderPrice","description","AverageRating","TotalRatings","assembleNode","isOpenInNewTab","activeImageAdditionalContent","CanvasCalculations","CanvasStyles","ImageMapper","_isDesktopViewPort","_context","getActiveImageWidth","activeImageReferenceValue","activeImageRefs","clientWidth","getActiveImageHeight","clientHeight","convertHexToRgb","hexColor","exec","rValue","gValue","bValue","applyFadingTransition","coords","rgbColor","alpha","halfDivisor","_canvas","getContext","buttonPadding","paddingAdjustment","buttonWidth","measureText","width","fillStyle","body","parentElement","fillText","drawButton","buttonTextClor","buttonHeight","buttonPositionX","buttonPositionY","arcsize","beginPath","moveTo","lineTo","arcTo","stroke","closePath","fill","expandAnimation","buttonText","imageMapperResources","animationStartWidth","expandAnimationStartWidth","pointPositionX","pointPositionY","animationEndWidth","expandAnimationEndWidth","radius","expandRadius","rotation","startAngle","endAngle","textFadeInValue","textFadeInStartValue","buttonTextClorInRgb","animate","ellipse","requestAnimationFrame","textFadeInterval","collapseAnimation","collapseAnimationStartWidth","collapseAnimationEndWidth","clearMargin","clearHeight","clearWidth","collapseRadius","textFadeOutValue","textFadeOutStartValue","clearRect","drawCircle","viewPort","doubleMultiplier","strokeStyle","arc","PI","scaleCoords","imgWidth","defaultWidth","defaultScale","scale","coord","renderPrefilledAreas","areaMap","areas","area","computeCenter","scaledCoords","handleHoverOn","center","handleHoverOff","canvasPositionX","defaultPositionX","canvasPositionY","defaultPositionY","height","click","hoverOn","onMouseEnter","hoverOff","onMouseLeave","renderAreas","xsRadius","extendedArea","areaKey","altTextWithProductName","productSearchResult","shape","onFocus","onBlur","alt","initCanvas","_backgroundImage","_container","onLoad","defaultHeight","canvasWidth","canvasHeight","componentDidUpdate","shouldRender","imageData","useMap","ActiveImageConstants","ActiveImage","_defaultProductCardWidth","_defaultProdutCardHight","_activePoints","addActivePoints","areaId","updateClientWidth","renderImageMapper","activePoints","configProduct","xPosition","yPosition","activePoint","mappedArea","_activeImageClass","enterArea","leaveArea","activeImage","_activeImageRefs","altTextForSeeMoreButtonWithProductName","seeMoreButtonText","overlayClass","open","resetState","renderProductComponent","baseImageUrl","productImageSettings","renderProductCard","_productCardDivRef","renderOverlay","getProductCardPositionX","getDefaultImageSettings","productImageSettingsWidth","productCardWidth","leftAllignPosition","position","getProductCardPositionY","productImageSettingsHeight","produtCardHight","keyDown","enterKey","nodeName","escKey","renderActiveImageDetailsLinks","_telemetryContent","willOpenInNewTab","renderActiveImageDetailsHeading","renderActiveImageDetailsParagraph","getActiveImageId","activeImageId","activeImageSource","decrementOne","_handleOutsideClick","contains","timeoutInterval","images","getElementsByClassName","Array","from","removeAttribute","handleAdditionalLinkText","SocialShareItemView","renderItem","star5Count","star4Count","star3Count","star2Count","star1Count","totalCount","percentage","formattedPercent","NumberFormat","barItemAriaLabel","Progress","_formattedPriceReverseLookup","Map","getLabels","sliderId","minPrice","maxPrice","labelId","labelString","labelPositioning","getSliderThumbs","selectedMin","selectedMinPrice","selectedMax","selectedMaxPrice","ariaValueText","_onRangeUpdate","_onRangeUpdateEnd","_handleRangeTooltipText","_changeMin","_changeMax","_finishChangeMin","_finishChangeMax","minInput","maxInput","initialMin","initialMax","String","minValue","maxValue","labels","sliderKeyString","sliderThumbs","validationErrorMin","validationErrorMax","touchedMin","touchedMax","previousProps","updateSliderProps","_renderInputFields","_renderSlider","formAttrs","minInputClassName","maxInputClassName","formattedSelectedMin","_getFormattedSelectedValue","formattedSelectedMax","ariaAttributes","inForm","step","orientation","showLabels","showTooltip","onChangeEnd","debounce","handleTooltipText","_changeValue","selectedKey","touchedKey","_getInputWithoutFormatting","selectedMinValue","minTouched","maxNum","_focus","_validateRange","selectedMaxValue","maxTouched","minNum","touched","validationError","inputAsNum","sliderChangeNotification","eventType","firstThumbValue","secondThumbValue","_focusOnSliderThumb","tooltip","buildReviewCard","createReviewModal","createReportModal","ReviewsListview","CheckoutAlert","_renderItem","WishlistItemsView","From","SelectedGiftCard","GiftCardList","AddResource","ShowResource","CheckoutGiftCardView","BulkPurchase","_toggleCollapse","hasDimensionsInProps","hasDimensionsInData","_renderCollapseContent","_renderCollapseButton","_renderCollapse","bulkPurchaseHeaderTitle","_renderMainContent","RichTextComponent","bulkPurchaseDescriptionText","_renderMatrix","ProductDimensionsMatrix","buttonsStates","onPlaceOrderHandler","isBusy","buttonSetState","CheckoutPlaceOrderButton","setIsBusy","Purchase","CarouselModule","_handleDismissCarousel","dismissCarousel","_next","nextIndex","animating","closeNow","_previous","_onExiting","_onExited","_goToIndex","newIndex","showLineItems","orderSummaryProps","modalNode","modalFooterNode","autoFocus","zIndex","Form","Item","GiftCardBalanceCheckView","productRecordId","featureSimilarDescriptionTitle","featureSimilarLooksTitle","img","CheckoutGuidedCard","editButtonRef","formCardRef","renderFooder","isVisted","isSubmitting","hasControlGroup","saveBtnLabel","cancelBtnLabel","saveAndContinueBtnLabel","canSubmit","canCancel","Save","SaveContinue","saveBtnAttributes","cancelBtnAttributes","focusOnFirstFocusableElement","node","querySelector","focusOnEditButton","scrollToTitle","formCard","scrollIntoView","getTitle","headingTag","Tag","prevProps","isActive","onNext","changeBtnLabel","CheckoutChange","changeBtnAttributes","canEdit","active","closed","visted","hidden","initialized","ready","updating","SearchState","SuggestionType","AutoSuggestInput","suggestionType","hitPrefix","hitSuffix","searchQuery","topResultsCount","_getAutoSuggest","autosuggest","searchCriteria","ProductSearchCriteria","SearchCondition","Context","ChannelId","HitPrefix","HitSuffix","searchSuggestions","getSearchSuggestionsAsync","ImageUrl","generateImageUrl","AllSearchResults","getSearchSuggestionsActionDataAction","autoSuggestPromises","inputData","CategorySuggestionsComponent","suggestions","autoSuggestProps","categorySuggestionHeading","_renderTitle","categoryAutoSuggestionHeading","shouldShowFullPath","splitValue","pop","_generateLink","_getHighlightedText","suggestion","_getCategoryLink","searchPageURL","searchQsp","searchRefiners","queryUrl","categoryRefiners","Category","encodedRefiner","compressRefiners","formattedText","dangerouslySetInnerHTML","getRichTextHtml","compressedRefinerKeys","compressedRefiners","compressedRefiner","refinerKey","FormComponent","searchPlaceholder","hideSearchLabel","searchTextInput","disableSubmitSearch","handleCancelSearchChange","ariaLabelCancel","ariaLabelSearch","ariaLabelSubmit","inputNode","submitBtnNode","KeywordSuggestionsComponent","formattedLink","LabelComponent","searchLabelClass","searchLabelArialLabel","isSearchFormExpanded","searchtext","searchCollapsedLabel","ProductSuggestionsComponent","productSuggestionHeading","productAutoSuggestionHeading","Value3","DecimalValue","_renderThumbnail","_getLiWrapper","_getAWrapper","recid","_isLoadingNode","loadingText","autoSuggestResultLoadingMessage","Spinner","size","SpinnerSize","medium","labelPosition","_focusOutTarget","closest","_clearAutoSuggestState","_keyup","formReference","autoSuggestResultDiv","searchState","defaultBasicSearchUrl","searchQueryStringParameter","createSearchStateInput","getSearchSuggestionsAction","_getSuggestionType","inputSuggestionType","_getSearchRefiners","autoSuggestAriaLabel","_setAutoSuggestResultCount","suggestionTypes","distinctSuggestionTypes","suggestionTypeItem","charAt","toUpperCase","slice","_handleSubmit","searchURL","_appendQueryParams","_handleCancelSearchChange","isInitialState","route","autoSuggestResultScreenReaderDiv","ariaLiveRegion","suggestResultString","autoSuggestFoundMessage","emptyResultString","noAutoSuggestionMessage","innerText","searchKeywordSuggestClass","searchProductSuggestClass","searchCategorySuggestClass","searchInputMaxLength","suggestionTypeCriterion","searchFormClass","cancelBtnAriaLabel","searchBtnAriaLabel","submitBtnAriaLabel","searchplaceholderText","shouldShowFullCategoryPath","Keyword","None","ProductsDataActions","getProductSearchRefinersAsync","CheckoutGuidedForm","currentStep","getEnabledModules","getStep","indexOf","getId","getHeading","currentId","shouldCollapseAfterRedirect","hasMissingInfo","hasOrderError","GuidedCard","InvoiceSummaryLine","_buildPaymentSummarySection","invoiceLines","invoiceLine","InvoiceAmount","InvoiceId","CheckoutStateInput","submitReviewDataAction","propsContext","shouldRetry","CartsDataActions","cartLineToUpdate","updateLineResult","orderedProducts","redirect","orderConfirmationUrl","updateSalesOrder","newSalesOrder","newOrderedProducts","WriteReviewView"],"mappings":"uHAuDO,MAAMA,EAAkCC,YAA2B,CACtEC,GAAI,qEACJC,OAhDJC,eAAqCC,EAAmCC,GACpE,IAmCJ,SAAsBD,GAClB,OACIA,GACAA,EAAME,SAASC,OAAS,GACxBH,EAAMI,SAASD,OAAS,GACxBH,EAAMK,OAAOF,OAAS,GACtBH,EAAMM,UAAUH,OAAS,EAzCxBI,CAAaP,GACd,MAAM,IAAIQ,MAAJ,0DACiDR,EAAME,SADvD,qBAC4EF,EAAMI,SADlF,qBAEEJ,EAAMK,OAFR,MAOV,MAAMI,EACF,UAAGT,EAAMU,gBAAT,8BAA8CV,EAAME,UAApD,oBACaF,EAAMI,UADnB,kBAEWJ,EAAMK,QAEfM,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nD,OACIjrB,gBAACkxB,SAAM/rB,iBAAKqV,GACPrW,EACC8mB,EAGIjrB,gCACDguD,EACA4+B,EAAkB9vC,EAAatiC,IALhBxa,gCACfu5E,EACAC","file":"static/js/9.0f5056bc9c908a597802.chunk.js","sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\n\nimport { SubmitHelpfulnessVoteInput } from './inputs/submit-helpfulness-vote-input';\n\nasync function submitHelpfulnessVote(input: SubmitHelpfulnessVoteInput, ctx: IActionContext): Promise {\n if (!inputIsValid(input)) {\n throw new Error(\n `[SubmitHelpfulnessVote] Invalid input. ReviewId=${input.reviewId},tenantId=${input.tenantId}, locale= ${\n input.locale\n },`\n );\n }\n\n const requestUrl =\n `${input.serviceEndpoint}/v2.0/votes/review/${input.reviewId}` +\n `?tenantId=${input.tenantId}` +\n `&locale=${input.locale}`;\n\n const requestBody = {\n isHelpful: !!input.isHelpful\n };\n\n const requestHeader = {\n headers: {\n Authorization: `id_token ${input.authToken}`\n }\n };\n\n return sendRequest(requestUrl, 'post', requestBody, requestHeader)\n .then(response => {\n return response.status === 200 || response.status === 201;\n })\n .catch((error) => {\n ctx.trace('[SubmitHelpfulnessVote] Failed to vote on a review');\n ctx.telemetry.exception(error);\n ctx.telemetry.debug('[SubmitHelpfulnessVote] Failed to vote on a review');\n return false;\n });\n}\n\nfunction inputIsValid(input: SubmitHelpfulnessVoteInput): boolean {\n return (\n input &&\n input.reviewId.length > 0 &&\n input.tenantId.length > 0 &&\n input.locale.length > 0 &&\n input.authToken.length > 0\n );\n}\n\nexport const submitHelpfulnessVoteDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/submit-helpfulness-vote',\n action: >submitHelpfulnessVote\n});\n\nexport default submitHelpfulnessVoteDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CartLineItemComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, * as Msdyn365 from '@msdyn365-commerce/core';\nimport { CartLine, OrgUnitLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport groupBy from 'lodash/groupBy';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\ntype deliveryType = 'pickup' | 'ship' | 'email';\n\nexport interface IPickUpAtStore {\n PickUpAtStore: INodeProps;\n label: React.ReactNode;\n location: React.ReactNode;\n}\n\nexport interface IEmailDelivery {\n EmailDelivery: INodeProps;\n label: React.ReactNode;\n}\n\nexport interface ILineItem {\n LineId: string;\n LineItem: INodeProps;\n item?: React.ReactNode;\n pickUpAtStore?: IPickUpAtStore;\n emailDelivery?: IEmailDelivery;\n}\n\nexport interface ILineItemDeliveryGroup {\n LineItemDeliveryGroup: INodeProps;\n LineItemList: INodeProps;\n heading: React.ReactNode;\n lineItemWraper?: React.ReactNode;\n lineItemWraperIcon?: React.ReactNode;\n lineItems: ILineItem[];\n}\n\nexport interface ILineItems {\n LineItems: INodeProps;\n Header: INodeProps;\n heading: React.ReactNode;\n editLink: React.ReactNode;\n itemsForPickup?: ILineItemDeliveryGroup;\n itemsForShip?: ILineItemDeliveryGroup;\n itemsForEmail?: ILineItemDeliveryGroup;\n itemsGroupWithMulitplePickupMode?: ILineItemDeliveryGroup[];\n}\n\nexport const getLineItems = (input: ICheckoutProps, telemetryContent?: ITelemetryContent): ILineItems | undefined => {\n const pickupDeliveryModeCode = get(input, 'context.request.channel.PickupDeliveryModeCode');\n const emailDeliveryModeCode = get(input, 'context.request.channel.EmailDeliveryModeCode');\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = input.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const _getDeliveryLocation = (cartLine: CartLine): string => {\n const orgUnitLocations = get(input, 'data.orgUnitLocations.result');\n if (!cartLine.FulfillmentStoreId || !orgUnitLocations) {\n return '';\n }\n\n const locationMatch = (orgUnitLocations || []).find((location: OrgUnitLocation): boolean => {\n return location.OrgUnitNumber === cartLine.FulfillmentStoreId;\n });\n\n return locationMatch && locationMatch.OrgUnitName;\n };\n\n const _getProduct = (productId: number): SimpleProduct | undefined => {\n const products = get(input, 'data.products.result') || [];\n return products.find((_product: SimpleProduct) => {\n return productId === _product.RecordId;\n });\n };\n\n const _getLineItemComponent = (cartLine: CartLine): JSX.Element | undefined => {\n const product = cartLine.ProductId && _getProduct(cartLine.ProductId);\n const {\n id,\n typeName,\n context,\n config: { imageSettings, showShippingChargesForLineItems },\n resources: {\n quantityDisplayString,\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle,\n productDimensionTypeAmount,\n configString,\n inputQuantityAriaLabel,\n discountStringText,\n shippingCharges\n },\n context: {\n request: { gridSettings }\n }\n } = input;\n\n if (!product) {\n return;\n }\n\n let productUrl = getProductUrlSync(product, context.actionContext, undefined);\n if (MsDyn365.isBrowser) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartLine.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n\n return (\n \n );\n };\n\n const _getPickUpAtStoreComponents = (pickupDeliveryLocation: string): IPickUpAtStore => {\n const {\n resources: { pickUpAtStoreWithLocationText }\n } = input;\n\n return {\n PickUpAtStore: { className: 'ms-checkout__pick-up-at-store' },\n label: \n {pickUpAtStoreWithLocationText}\n ,\n location:
\n {pickupDeliveryLocation}\n
\n };\n };\n\n const _getEmailDeliveryComponents = (): IEmailDelivery => {\n const {\n resources: { emailDeliveryText }\n } = input;\n\n return {\n EmailDelivery: { className: 'ms-checkout__email-delivery' },\n label: \n {emailDeliveryText}\n \n };\n };\n\n const _getLineItemsComponents = (items: CartLine[]): ILineItem[] => {\n return items.map(cartLine => {\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\n const isPickUp = _getCartPickDeliveryMode(cartLine);\n const isEmailDelivery = (cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? cartLine.DeliveryMode === emailDeliveryModeCode : false;\n return {\n LineId: cartLine.LineId || '',\n LineItem: { className: 'ms-checkout__line-item' },\n item: _getLineItemComponent(cartLine),\n pickUpAtStore: isPickUp ? _getPickUpAtStoreComponents(pickupDeliveryLocation) : undefined,\n emailDelivery: isEmailDelivery ? _getEmailDeliveryComponents() : undefined\n };\n });\n };\n\n const _getCartPickDeliveryMode = (cartLineItem: CartLine): boolean => {\n return (!StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)) ? (retailMultiplePickUpOptionEnabled ? cartLineItem.DeliveryMode === channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLineItem.DeliveryMode) : (cartLineItem.DeliveryMode === pickupDeliveryModeCode)) : false;\n };\n\n const _getCartShipDeliveryMode = (cartLineItem: CartLine): boolean => {\n return (!StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)) ? (retailMultiplePickUpOptionEnabled ? cartLineItem.DeliveryMode !== channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLineItem.DeliveryMode) : (cartLineItem.DeliveryMode !== pickupDeliveryModeCode)) : false;\n };\n\n const _getGroupTitleComponent = (count: number, type: deliveryType): string => {\n const {\n resources: {\n itemLabel,\n itemsLabel,\n inStorePickUpLabel,\n shippingCountCheckoutLineItem\n }\n } = input;\n\n let emailDeliveryModeDesc: string = '';\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n emailDeliveryModeDesc = emailDeliveryModeDesc ? emailDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)?.Description!;\n });\n\n const suffix = count > 1 ? itemsLabel : itemLabel;\n const title = type === 'ship' ? shippingCountCheckoutLineItem : (type === 'pickup' ? inStorePickUpLabel : `${emailDeliveryModeDesc} (${count} ${suffix})`);\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\n };\n\n const _countItems = (items: CartLine[]): number => {\n return items.reduce((count, item) => {\n return count + (item.Quantity || 0);\n\n }, 0);\n };\n\n const _filterItemsByDiliveryType = (type: deliveryType): CartLine[] => {\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n if (type === 'ship') {\n return cart.CartLines.filter((\n cartLine: CartLine) => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (_getCartShipDeliveryMode(cartLine) && cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\n );\n } else if (type === 'pickup') {\n return cart.CartLines.filter((cartLine: CartLine) => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (_getCartPickDeliveryMode(cartLine)) : null)\n );\n }\n return cart.CartLines.filter((cartLine: CartLine) => cartLine.DeliveryMode === emailDeliveryModeCode);\n\n };\n\n const _getLineItemsByDeliveryType = (type: deliveryType): ILineItemDeliveryGroup | undefined => {\n if ((pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) && (type === 'pickup' || type === 'email')) {\n return;\n }\n\n const items = _filterItemsByDiliveryType(type);\n\n if (items.length === 0) {\n return undefined;\n }\n\n const count = _countItems(items);\n const title = _getGroupTitleComponent(count, type);\n\n return {\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group', type) },\n LineItemList: { className: 'ms-checkout__line-items-list' },\n heading:
\n {title}\n
,\n lineItems: _getLineItemsComponents(items)\n };\n };\n\n const _getLineItems = (): ILineItems | undefined => {\n const {\n context,\n config: { lineItemsHeading },\n data: { products },\n resources: { editCartText }\n } = input;\n\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.EditCart);\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n const groupClass = retailMultiplePickUpOptionEnabled ? ' multiple-pickup-enabled' : '';\n if (!cart || !cart.CartLines || cart.CartLines.length === 0 || !products) {\n return undefined;\n }\n\n return {\n LineItems: { className: `ms-checkout__line-items${groupClass}` },\n Header: { className: 'ms-checkout__line-items-header' },\n heading: lineItemsHeading && lineItemsHeading.text && (\n \n ),\n editLink: (\n \n {editCartText}\n \n ),\n itemsForPickup: _getLineItemsByDeliveryType('pickup'),\n itemsForShip: _getLineItemsByDeliveryType('ship'),\n itemsForEmail: _getLineItemsByDeliveryType('email'),\n itemsGroupWithMulitplePickupMode: retailMultiplePickUpOptionEnabled ? _getLineItemsByDeliveryTypeWithMulitplePickupMode() : undefined\n };\n };\n\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\n const {\n config: { lineItemsHeading }\n } = input;\n lineItemsHeading!.text = event.target.value;\n };\n\n const _getGroupTitleComponentWithMultiplePickUp = (count: number, type: deliveryType, deliveryMode?: string, fulFillmentStoreId?: string): string => {\n const {\n resources: {\n itemLabel,\n itemsLabel\n }\n } = input;\n\n let emailDeliveryModeDesc: string = '';\n let pickupDeliveryModeDesc: string = '';\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n emailDeliveryModeDesc = emailDeliveryModeDesc ? emailDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)?.Description!;\n });\n\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\n pickupDeliveryModeDesc = pickupDeliveryModeDesc ? pickupDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === deliveryMode)?.Description!;\n });\n\n const pickupTitle: string = `${pickupDeliveryModeDesc}, ${fulFillmentStoreId}`;\n const suffix = count > 1 ? itemsLabel : itemLabel;\n const title = type === 'ship' ? `(${count} ${suffix})` : (type === 'pickup' ? `${pickupTitle} (${count} ${suffix})` : `${emailDeliveryModeDesc} (${count} ${suffix})`);\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\n };\n\n const _filterItemsByMultiplePickupMode = (): CartLine[][] => {\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => (item.DeliveryMode));\n const groupDelivery = getGroupByDelivery(cart.CartLines);\n const cartLinesGroup: CartLine[] = [];\n const cartLinesGrp: CartLine[][] = [];\n\n // 1) Group by store and pick up mode\n Object.entries(groupDelivery).forEach(([deliveryMode, groupByDeliveryType]) => {\n // @ts-expect-error\n groupDelivery[deliveryMode] = getGroupByStorePickup(groupByDeliveryType);\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\n });\n\n Object.keys(cartLinesGroup).forEach(key => {\n const cartLines = cartLinesGroup[key];\n Object.keys(cartLines).forEach(index => {\n const cartLine = cartLines[index];\n cartLinesGrp.push(cartLine);\n });\n });\n\n return cartLinesGrp;\n };\n\n const _getLineItemsByDeliveryTypeWithMulitplePickupMode = (): ILineItemDeliveryGroup[] | undefined => {\n if (pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) {\n return;\n }\n\n const {\n resources: {\n multiplePickUpLabel,\n shippingLable\n }\n } = input;\n\n const items = _filterItemsByMultiplePickupMode();\n\n if (items.length === 0) {\n return undefined;\n }\n\n const lineItemDeliveryGroup: ILineItemDeliveryGroup[] = [];\n items.map(item => {\n const count = _countItems(item);\n const cartLine = item[0];\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\n const type: deliveryType = cartLine.FulfillmentStoreId && cartLine.DeliveryMode ? 'pickup' : (cartLine.FulfillmentStoreId === '' && cartLine.DeliveryMode === emailDeliveryModeCode ? 'email' : 'ship');\n const title = _getGroupTitleComponentWithMultiplePickUp(count, type, cartLine.DeliveryMode, pickupDeliveryLocation);\n const groupTitle = type === 'pickup' ? multiplePickUpLabel : (type === 'ship' ? shippingLable : 'email');\n const iconClass = `ms-checkout__line-items-group-title-multiple-pickup-${type}icon`;\n lineItemDeliveryGroup.push({\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group multiple-pickup', type) },\n LineItemList: { className: 'ms-checkout__line-items-list' },\n lineItemWraperIcon:
,\n lineItemWraper:
\n {groupTitle}\n
,\n heading:
\n {title}\n
,\n lineItems: _getLineItemsComponents(item)\n });\n });\n\n return lineItemDeliveryGroup;\n };\n\n return _getLineItems();\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './validate-cart';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Button, Collapse, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IQuickOrderDrawerProps } from './quick-order-drawer-props';\n\nexport interface IQuickOrderDrawerState {\n isOpen: boolean;\n}\n\nexport type GlyphPlacement = 'start' | 'end';\n\n/**\n * Quick Order Drawer - This is a full width uncontrolled collapse where the button glyph changes\n * when the drawer is open and closed.\n */\n\nexport default class QuickOrderDrawer extends React.Component {\n public state: IQuickOrderDrawerState;\n\n private readonly drawerOpenGlyph: string;\n\n private readonly drawerCloseGlyph: string;\n\n private readonly drawerGlyphClass: string;\n\n private isManuallyToggled: boolean;\n\n constructor(props: IQuickOrderDrawerProps) {\n super(props);\n this._toggle = this._toggle.bind(this);\n this.isManuallyToggled = false;\n this.state = { isOpen: (props.collapseProps && props.collapseProps.isOpen) || false };\n this.drawerGlyphClass = classnames('drawer__glyph',\n this.props.toggleGlyphClassName ? this.props.toggleGlyphClassName : '');\n\n if (this.props.animateGlyph) {\n this.drawerOpenGlyph = classnames(this.drawerGlyphClass,\n this.props.openGlyph ? this.props.openGlyph : (this.props.closeGlyph ? this.props.closeGlyph : ''));\n this.drawerCloseGlyph = this.drawerOpenGlyph;\n } else {\n this.drawerOpenGlyph = classnames(this.drawerGlyphClass,\n this.props.openGlyph ? this.props.openGlyph : '');\n this.drawerCloseGlyph = classnames(this.drawerGlyphClass,\n this.props.closeGlyph ? this.props.closeGlyph : '');\n }\n }\n\n public shouldComponentUpdate(nextProps: IQuickOrderDrawerProps,\n nextState: IQuickOrderDrawerState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const collapseProps = { ...this.props.collapseProps } as ICollapseProps;\n\n // If the drawer is manually toggled by pressing the button, then we use the internal state\n if (collapseProps.isOpen === undefined || this.isManuallyToggled) {\n collapseProps.isOpen = this.state.isOpen;\n } else {\n this.state.isOpen = collapseProps.isOpen;\n }\n collapseProps.children = this.props.children;\n const drawerClass = classnames('drawer', this.props.className ? this.props.className : '');\n this.isManuallyToggled = false;\n return (\n
\n \n {this._generateDrawerButtonInnerMarkup(collapseProps.isOpen)}\n \n \n
\n );\n }\n\n private _generateDrawerButtonInnerMarkup(collapseState: boolean): JSX.Element {\n const drawerButtonTextClass = classnames('drawer__buttontext', this.props.toggleButtonClassName ? this.props.toggleButtonClassName : '');\n return (\n <>\n

\n {this.props.moduleHeadingText}\n

\n \n {this.props.moduleDescriptionText}\n \n {this._generateGlyphMarkup('drawer__glyph__end', collapseState)}\n \n );\n }\n\n private _generateGlyphMarkup(location: string, collapseState: boolean): JSX.Element {\n let glyphClass = collapseState ? this.drawerOpenGlyph : this.drawerCloseGlyph;\n glyphClass = `${glyphClass} ${location}`;\n return (\n \n );\n }\n\n private _toggle(e: React.MouseEvent | React.KeyboardEvent): void {\n e.preventDefault();\n this.setState({ isOpen: !this.state.isOpen });\n this.isManuallyToggled = true;\n if (this.props.onToggle) {\n this.props.onToggle(this.state);\n }\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Alert, Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IQuickOrderState } from '../quick-order';\n\nexport interface IQuickOrderFormProps {\n disableAddtoCart: boolean | undefined;\n productTextInput: React.RefObject;\n quantityTextInput: React.RefObject;\n maxChars: number;\n maxQuantity?: number;\n ariaLabelQuantity: string;\n ariaLabelProduct: string;\n ariaLabelAddtoCart: string;\n quickOrderState: IQuickOrderState;\n handleInputChange(query: string): void;\n handleQuantityChange(query: string): void;\n handleAddToCartClick(): Promise;\n}\n\nexport interface IQuickOrderFormViewProps {\n product: React.ReactNode;\n quantity: React.ReactNode;\n addToCartBtn: React.ReactNode;\n userMessage?: React.ReactNode;\n}\n\n/**\n * On Input Change functionality.\n * @param handleInputChange -Input change function.\n * @returns Input change value.\n */\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent) => {\n handleInputChange(event.target.value || '');\n};\n\n/**\n * On Quantity Change functionality.\n * @param handleQuantityChange -Quantity change function.\n * @returns Quantity change value.\n */\nconst onQuantityChangeFunction = (handleQuantityChange: (query: string) => void) => (event: React.ChangeEvent) => {\n handleQuantityChange(event.target.value || '');\n};\n\nexport const QuickOrderFormComponent = (props: IQuickOrderFormProps): IQuickOrderFormViewProps => {\n const {\n productTextInput,\n quantityTextInput,\n quickOrderState,\n maxChars,\n maxQuantity,\n disableAddtoCart,\n ariaLabelQuantity,\n ariaLabelProduct,\n ariaLabelAddtoCart,\n handleQuantityChange,\n handleInputChange,\n handleAddToCartClick\n } = props;\n\n const onInputChange = onInputChangeFunction(handleInputChange);\n\n const onQuantityInputChange = onQuantityChangeFunction(handleQuantityChange);\n\n const productNode = (\n
\n

\n {ariaLabelProduct}\n

\n \n
\n );\n\n const quantityNode = (\n
\n

\n {ariaLabelQuantity}\n

\n \n
\n );\n\n const addtoCartNode = (\n
\n \n {ariaLabelAddtoCart}\n \n
\n );\n\n const userMessageNode = quickOrderState && quickOrderState.stateMessage ? (\n \n \n \n {quickOrderState.stateMessage.messageText}\n \n \n ) : undefined;\n\n return {\n product: productNode,\n addToCartBtn: addtoCartNode,\n quantity: quantityNode,\n userMessage: userMessageNode\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { observable } from 'mobx';\n\n/**\n * Represents a product for quick order.\n */\nexport class QuickOrderProduct {\n @observable\n public isSelected: boolean;\n\n public readonly cartLine: CartLine;\n\n public readonly simpleProduct: SimpleProduct;\n\n public constructor(cartLine: CartLine, simpleProduct: SimpleProduct) {\n this.cartLine = cartLine;\n this.simpleProduct = simpleProduct;\n this.isSelected = false;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IComponent, IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport React from 'react';\n\n/**\n * Interface for quick order table header resources.\n */\nexport interface IQuickOrderTableHeaderResources {\n quickOrderProductNumberText: string;\n quickOrderProductText: string;\n quickOrderUnitPriceText: string;\n quickOrderUnitOfMeasureText: string;\n quickOrderQuantityText: string;\n quickOrderTotalText: string;\n quickOrderActionsText: string;\n}\n\n/**\n * Interface for quick order table props.\n */\nexport interface IQuickOrderTableHeaderProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n isMobile: boolean;\n resources: IQuickOrderTableHeaderResources;\n}\n\n/**\n * Interface for quick order table header component.\n */\nexport interface IQuickOrderTableHeaderComponent extends IComponent {\n}\n\n/**\n * Get the quick order header cells for desktop.\n * @param props -- The quick order table header props.\n * @returns The list of cells for quick order header component in desktop version.\n */\nconst QuickOrderDesktopHeaderCellsComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const { resources } = props;\n const columnWithNumberClassName = `${props.className}__row__column-with-number`;\n return (\n <>\n \n \n \n \n {resources.quickOrderProductNumberText}\n \n \n {resources.quickOrderProductText}\n \n \n {resources.quickOrderUnitPriceText}\n \n \n {resources.quickOrderUnitOfMeasureText}\n \n \n {resources.quickOrderQuantityText}\n \n \n {resources.quickOrderTotalText}\n \n \n {resources.quickOrderActionsText}\n \n \n );\n};\n\n/**\n * Get the quick order header cells for mobile.\n * @param props -- The quick order table header props.\n * @returns The quick order header component in desktop version.\n */\nconst QuickOrderMobileHeaderCellsComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const { resources } = props;\n return (\n <>\n \n \n {resources.quickOrderProductNumberText}\n \n \n \n );\n};\n\n/**\n * Quick order table header component.\n * @param props - Configuration of the component.\n * @returns React node with the header.\n */\nexport const QuickOrderTableHeaderComponent: React.FC = (props: IQuickOrderTableHeaderProps) => {\n const rowClassName = `${props.className}__row`;\n\n let headerCells: JSX.Element;\n if (props.isMobile) {\n headerCells = ();\n } else {\n headerCells = ();\n }\n\n return (\n \n \n {headerCells}\n \n \n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { CartLine, format, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl, getProductPageUrlSync, ObjectExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, IncrementalQuantity } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Data required to render each quick order row.\n */\nexport interface IQuickOrderTableRowData {\n cartLine: CartLine;\n product: SimpleProduct;\n}\n\n/**\n * Resources for quick order table rows.\n */\nexport interface IQuickOrderTableRowResources {\n quickOrderQuantityMobileText: string;\n quickOrderProductDimensionsSeparator: string;\n quickOrderViewDetailsButtonText: string;\n quickOrderViewDetailsButtonAriaLabel: string;\n quickOrderRemoveItemButtonAriaLabel: string;\n quickOrderInputQuantityAriaLabel: string;\n quickOrderDecrementButtonAriaLabel: string;\n quickOrderIncrementButtonAriaLabel: string;\n}\n\n/**\n * Interface for quick order table props.\n */\nexport interface IQuickOrderTableRowProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n imageSettings?: IImageSettings;\n isMobile: boolean;\n resources: IQuickOrderTableRowResources;\n}\n\n/**\n * The default image settings for quick order table row.\n */\nconst defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=80&h=80&m=6', w: 0, h: 0 },\n lg: { q: 'w=147&h=147&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n};\n\n/**\n * Renders product image for quick order row.\n * @param props - Quick order table row props.\n * @returns React element.\n */\nconst QuickOrderTableRowProductImageComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n\n const fallbackImageUrl = getFallbackImageUrl(props.data.product.ItemId, props.context.actionContext.requestContext.apiSettings);\n\n const containerClassName = `${props.className}__product-image-container`;\n\n return (\n
\n \n
\n );\n};\n\n/**\n * Renders actions popup for the mobile view.\n * @param props - Configuration for popup.\n * @returns A react node with actions..\n */\nconst QuickOrderExtraActionsPopupComponent: React.FC = (props: IQuickOrderTableRowProps): JSX.Element | null => {\n const product: SimpleProduct = props.data.product;\n\n let productUrl = '';\n if (!StringExtensions.isNullOrWhitespace(product.Name) && !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.Name!, product.RecordId, props.context.actionContext);\n }\n\n if (StringExtensions.isNullOrWhitespace(productUrl)) {\n return null;\n }\n\n const className = `${props.className}__extra-actions-cell`;\n\n return (\n
\n
\n );\n};\n\n/**\n * Renders quick order table rows for desktop view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of quick order rows for desktop view.\n */\nexport const QuickOrderDesktopTableRowCellComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n const product: SimpleProduct = props.data.product;\n const cartLine: CartLine = props.data.cartLine;\n const columnWithNumberClassName = `${props.className}__column-with-number`;\n\n let productUrl = '';\n if (!StringExtensions.isNullOrWhitespace(product.Name) && !ObjectExtensions.isNullOrUndefined(product.RecordId)) {\n productUrl = getProductPageUrlSync(product.Name!, product.RecordId, props.context.actionContext);\n }\n\n return (\n <>\n \n \n \n \n {product.ItemId}\n \n \n
\n \n {product.Name}\n \n \n {\n product.Dimensions?.map(\n dimension => dimension.DimensionValue?.Value).filter(\n dimensionValue => !StringExtensions.isNullOrWhitespace(dimensionValue)).join(\n props.resources.quickOrderProductDimensionsSeparator)\n }\n \n
\n \n \n {cartLine.Price}\n \n \n {cartLine.UnitOfMeasureSymbol}\n \n \n \n \n \n {cartLine.TotalAmount}\n \n \n \n \n \n );\n};\n\n/**\n * Renders rows for mobile view.\n * @param props - Configuration for the rows.\n * @returns A react node with a list of quick order rows for mobile view.\n */\nexport const QuickOrderMobileTableRowCellComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n const product: SimpleProduct = props.data.product;\n const cartLine: CartLine = props.data.cartLine;\n\n return (\n <>\n \n \n \n \n
\n \n {product.ItemId}\n \n \n {format(props.resources.quickOrderQuantityMobileText, cartLine.Quantity)}\n \n
\n \n \n \n \n \n );\n};\n\n/**\n * Quick order table row component.\n * @param props - Configuration of the component.\n * @returns React node for the row.\n */\nexport const QuickOrderTableRowComponent: React.FC = (props: IQuickOrderTableRowProps) => {\n const rowClassName = `${props.className}__row`;\n\n let headerCells: JSX.Element;\n if (props.isMobile) {\n headerCells = ();\n } else {\n headerCells = ();\n }\n\n return (\n \n \n {headerCells}\n \n \n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { IComponent, IComponentProps, ICoreContext } from '@msdyn365-commerce/core';\nimport React from 'react';\n\nimport { QuickOrderProduct } from '../quick-order-product';\nimport { IQuickOrderTableHeaderResources, QuickOrderTableHeaderComponent } from './components/quick-order-table-header-component';\nimport { IQuickOrderTableRowResources, QuickOrderTableRowComponent } from './components/quick-order-table-row-component';\n\n/**\n * Quick order table data interface.\n */\ninterface IQuickOrderTableData {\n quickOrderProducts: QuickOrderProduct[];\n}\n\n/**\n * Quick order table resources.\n */\nexport interface IQuickOrderTableResources extends IQuickOrderTableHeaderResources, IQuickOrderTableRowResources {\n}\n\n/**\n * Quick order table props.\n */\nexport interface IQuickOrderTableProps extends IComponentProps {\n context: ICoreContext;\n className: string;\n\n resources: IQuickOrderTableResources;\n isMobileView: boolean;\n}\n\n/**\n * Quick order table component.\n */\nexport interface IQuickOrderTableComponent extends IComponent {\n}\n\n/**\n * The quick order table.\n * @param props -- The quick order table props.\n * @returns The quick order table element.\n */\nexport const QuickOrderTableComponent: React.FC = (props: IQuickOrderTableProps) => {\n const [isMobile, setIsMobile] = React.useState(props.isMobileView);\n const quickOrderProducts = props.data.quickOrderProducts;\n\n /**\n * Update the view port.\n */\n const updateViewport = () => {\n setIsMobile(props.isMobileView);\n };\n if (MsDyn365.isBrowser) {\n window.addEventListener('resize', updateViewport);\n }\n\n const headerClassName = `${props.className}__header`;\n const rowClassName = `${props.className}__row`;\n\n return (\n \n \n {\n quickOrderProducts.map((quickOrderProduct, index) => {\n return (\n \n );\n })\n }\n
\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { getProductConfigure, IErrorState, IProductDimensionCallbacks, IProductDimensionConfigureResources,\n IProductDimensionConfigureViewProps } from '@msdyn365-commerce/components';\nimport { CartLine, ProductDimension, ProductDimensionValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ArrayExtensions, FinitePromiseQueue, FinitePromiseQueueError,\n getDimensionsForSelectedVariant, GetDimensionsForSelectedVariantInput,\n getProductAvailabilitiesForSelectedVariant, getScanResult, GetScanResultInput,\n getSelectedVariant, IProductInventoryInformation, IPromiseQueue, ObjectExtensions, ProductAvailabilitiesForSelectedVariantInput,\n QueryResultSettingsProxy, SelectedVariantInput, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { computed, observable } from 'mobx';\nimport * as React from 'react';\n\nimport { QuickOrderDrawer, QuickOrderFormComponent, QuickOrderProduct } from './components';\nimport { QuickOrderTableComponent } from './components/quick-order-table/quick-order-table-component';\nimport { IQuickOrderData } from './quick-order.data';\nimport { IQuickOrderProps, IQuickOrderResources } from './quick-order.props.autogenerated';\n\n/**\n * Quick Order View Props Interface properties.\n */\nexport interface IQuickOrderViewProps extends IQuickOrderProps {\n isB2B?: boolean;\n productText: string;\n isQuickOrderFormExpanded: boolean;\n contentProps: INodeProps ;\n drawer: INodeProps;\n quickOrderForm: INodeProps;\n quickOrderFormProductContent: INodeProps;\n quickOrderFormMsgContent: INodeProps;\n quickOrderProps: IModuleProps;\n quickOrderList?: React.ReactNode;\n form: React.ReactNode;\n configure?: IProductDimensionConfigureViewProps;\n isMobileView: boolean;\n}\n\n/**\n * Quick Order State Message Interface properties.\n */\nexport interface IQuickOrderStateMessage {\n isOpen: boolean;\n messageGlyph: string;\n messageText: string;\n statusCssString: string;\n}\n\n/**\n * GridSize Interface properties.\n */\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Quick Order Interface properties.\n */\nexport interface IQuickOrderState {\n isQuickOrderFormExpanded: boolean;\n isUpdatingDimension?: boolean;\n productAvailableQuantity: IProductInventoryInformation | undefined;\n productResponse: SimpleProduct | undefined;\n productDimensions: ProductDimensionFull[] | undefined;\n productText: string;\n quantity: number;\n stateMessage?: IQuickOrderStateMessage;\n productDimensionErrorState: IErrorState;\n isMobile: boolean;\n products: SimpleProduct[];\n}\n\n/**\n *\n * QuickOrder component.\n * @extends {React.PureComponent, IQuickOrderState>}\n */\nclass QuickOrder extends React.PureComponent, IQuickOrderState> {\n @observable\n private readonly viewport: GridSize;\n\n private readonly productTextInput: React.RefObject;\n\n private readonly quantityInput: React.RefObject;\n\n private readonly waitTime: number = 500;\n\n private readonly quickOrderFormClass: string;\n\n private readonly quickOrderFormProductContent: string;\n\n private readonly quickOrderFormMsgContent: string;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\n\n private dimensions: { [id: number]: string } = {};\n\n private readonly cssClassNameConfigure: string = 'ms-quick-order__content-form-main';\n\n // @ts-expect-error -- Existing code.\n private cancellabelDebounce: debounce;\n\n private readonly quickOrderCallbacks: IProductDimensionCallbacks = {\n\n /**\n * Get Dropdown name.\n * @param selectedDimensionId - Dimension type.\n * @param selectedDimensionValueId - Resources.\n * @returns Dropdown name.\n */\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\n return this.dimensionUpdateQueue.enqueue(async () => {\n return this._updateDimensions();\n }).catch((error: any) => { // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw error;\n }\n });\n },\n\n /**\n * Get Dropdown name.\n * @param dimensionType - Dimension type.\n * @param resources - Resources.\n * @returns Dropdown name.\n */\n getDropdownName: (dimensionType: number, resources: IProductDimensionConfigureResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n\n /**\n * Method to call on dimension change.\n * @param isUpdatingDimension - Flag to update dimension.\n */\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n }\n };\n\n public constructor(props: IQuickOrderProps) {\n super(props);\n this.productTextInput = React.createRef();\n this.quantityInput = React.createRef();\n this.viewport = props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n this.state = {\n productText: '',\n isQuickOrderFormExpanded: false,\n productAvailableQuantity: undefined,\n quantity: 1,\n productResponse: undefined,\n productDimensions: undefined,\n productDimensionErrorState: {\n configureErrors: {}\n },\n isMobile: this.isMobile,\n products: []\n };\n this._handleInputChange = this._handleInputChange.bind(this);\n this._handleQuantityChange = this._handleQuantityChange.bind(this);\n this.quickOrderFormClass = 'ms-quick-order__content-form';\n this.quickOrderFormProductContent = 'ms-quick-order__content-form-main';\n this.quickOrderFormMsgContent = 'ms-quick-order__content-form-msg';\n }\n\n @computed get isMobile(): boolean {\n return (this.viewport === 'xs' || this.viewport === 'sm');\n }\n\n public render(): JSX.Element | null {\n\n const { data } = this.props;\n if (!data.customerInformation.result) {\n return null;\n }\n\n const { className = '', maxQuantity } = this.props.config;\n const customerInfo = this.props.data.customerInformation.result;\n const { quickOrderModuleHeading, quickOrderModuleDescription,\n quickOrderAddtobag, quickOrderProductQuantityInputLabel,\n quickOrderProductInputLabel, quickOrderProductDimensionTypeColor,\n quickOrderProductDimensionTypeConfiguration, quickOrderSelectDimensionFormatString,\n quickOrderProductDimensionTypeSize, quickOrderProductDimensionTypeStyle,\n quickOrderProductDimensionTypeAmount\n } = this.props.resources;\n\n const productConfigureResources: IProductDimensionConfigureResources = {\n selectDimensionFormatString: quickOrderSelectDimensionFormatString,\n productDimensionTypeColor: quickOrderProductDimensionTypeColor,\n productDimensionTypeConfiguration: quickOrderProductDimensionTypeConfiguration,\n productDimensionTypeSize: quickOrderProductDimensionTypeSize,\n productDimensionTypeStyle: quickOrderProductDimensionTypeStyle,\n productDimensionTypeAmount: quickOrderProductDimensionTypeAmount\n };\n\n const {\n isQuickOrderFormExpanded,\n productText,\n productDimensionErrorState,\n productResponse,\n productDimensions\n } = this.state;\n\n const moduleClassName: string = 'ms-quick-order';\n\n const viewProps: IQuickOrderViewProps = {\n ...(this.props as IQuickOrderProps),\n\n quickOrderProps: { className: classnames('ms-quick-order', className), moduleProps: this.props },\n contentProps: { className: 'ms-quick-order__content' },\n isB2B: customerInfo?.IsB2b,\n drawer: {\n tag: QuickOrderDrawer,\n className: `${moduleClassName}__drawer`,\n collapseProps: { isOpen: this.state.isQuickOrderFormExpanded },\n moduleHeadingText: quickOrderModuleHeading,\n moduleDescriptionText: quickOrderModuleDescription,\n requestContext: this.props.context.request,\n telemetryContent: this.telemetryContent\n },\n quickOrderForm: {\n className: `${this.quickOrderFormClass} ${isQuickOrderFormExpanded ? 'qo-show' : 'qo-hide'}`\n },\n quickOrderFormProductContent: {\n className: this.quickOrderFormProductContent\n },\n quickOrderFormMsgContent: {\n className: this.quickOrderFormMsgContent\n },\n productText,\n quickOrderList: ArrayExtensions.hasElements(this.state.products) ? this._renderQuickOrderTable('ms-quick-order') : undefined,\n form: QuickOrderFormComponent({\n productTextInput: this.productTextInput,\n quantityTextInput: this.quantityInput,\n disableAddtoCart: !productResponse,\n ariaLabelAddtoCart: quickOrderAddtobag,\n ariaLabelProduct: quickOrderProductInputLabel,\n ariaLabelQuantity: quickOrderProductQuantityInputLabel,\n maxChars: 50,\n maxQuantity,\n quickOrderState: this.state,\n handleInputChange: this._handleInputChange,\n handleAddToCartClick: this._addItemToCart,\n handleQuantityChange: this._handleQuantityChange\n }),\n configure: productResponse && productDimensions ? getProductConfigure(this.cssClassNameConfigure, this.props.context, this.props.friendlyName,\n this.props.telemetry, quickOrderSelectDimensionFormatString,\n productConfigureResources, this.quickOrderCallbacks, productResponse,\n productDimensions, productDimensionErrorState) : undefined,\n isQuickOrderFormExpanded: this.state.isQuickOrderFormExpanded,\n isMobileView: this.state.isMobile\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Initial the products on quick order.\n * @returns List of quick order products or undefined.\n */\n private _initQuickOrderProducts(): QuickOrderProduct[] {\n const {\n data: {\n cart: { result: cart }\n }\n } = this.props;\n\n const products: SimpleProduct[] = this.state.products;\n\n const quickOrderProducts = cart?.cart.CartLines?.map((cartLine: CartLine) => {\n const quickOrderProduct = products.find(product => product.RecordId === cartLine.ProductId);\n if (ObjectExtensions.isNullOrUndefined(quickOrderProduct)) {\n return undefined;\n }\n\n return new QuickOrderProduct(cartLine, quickOrderProduct);\n });\n\n return ArrayExtensions.validValues(quickOrderProducts);\n }\n\n /**\n * Render Quick Order Table.\n * @param className - Class name.\n * @returns JSX element.\n */\n private _renderQuickOrderTable(className: string): JSX.Element {\n const tableClassName = `${className}__table-list`;\n\n return (\n \n );\n }\n\n /**\n * Method to handle input change.\n * @param query - Class name.\n */\n private readonly _handleInputChange = (query: string): void => {\n if (!query || query.length > 4) {\n this.setState({ productText: query, quantity: 0, productResponse: undefined, productDimensions: [] });\n this.setState({ stateMessage: {\n messageText: '',\n statusCssString: '',\n messageGlyph: '',\n isOpen: false\n } });\n } else {\n return;\n }\n\n if (this.cancellabelDebounce) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call -- existing code.\n this.cancellabelDebounce.cancel();\n }\n\n const {\n telemetry,\n context\n } = this.props;\n const maxChar = 50;\n if (context) {\n if (!StringExtensions.isNullOrWhitespace(query)) {\n if (query.length > maxChar) {\n return;\n }\n\n this.cancellabelDebounce = debounce(() => {\n getScanResult(\n new GetScanResultInput(\n context.actionContext.requestContext.apiSettings,\n query,\n context.actionContext.requestContext.apiSettings.channelId\n ),\n this.props.context.actionContext)\n .then(results => {\n this.setState({\n productResponse: results?.Product,\n productDimensions: results?.ProductDimensionFull,\n isQuickOrderFormExpanded: true\n });\n })\n .catch(error => {\n this.setState({ productText: '' });\n telemetry.exception(error);\n telemetry.debug('Unable to get scan results');\n });\n }, this.waitTime);\n\n setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call -- Existing code.\n this.cancellabelDebounce();\n }, 0);\n this.setState({ productText: query, isQuickOrderFormExpanded: true });\n } else {\n this.setState({ productText: '', productResponse: undefined, isQuickOrderFormExpanded: true });\n }\n }\n };\n\n /**\n * Method to add product in cart.\n */\n private readonly _addItemToCart = async (): Promise => {\n const { context, data, resources, telemetry } = this.props;\n const { cart } = data;\n const { quickOrderAddedToCartSuccessMessage, quickOrderAddedToCartFailureMessage } = resources;\n const { productResponse, quantity } = this.state;\n this.setState({ stateMessage: {\n messageText: '',\n statusCssString: '',\n messageGlyph: '',\n isOpen: false\n } });\n\n if (context && productResponse !== undefined && this._validateCart(productResponse, quantity) && cart.result) {\n const isOrderQuantityLimitsFeatureEnabledInHq = this.props.data.featureState.result\n ?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing code.\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context.request.app.platform?.enableDefaultOrderQuantityLimits;\n const customerInfo = this.props.data.customerInformation.result;\n\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all' ||\n (customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b)));\n\n // Get product delivery mode info\n const deliveryOptions = await getDeliveryOptionsAsync(\n {\n callerContext: this.props.context.actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(this.props.context.actionContext)\n },\n [productResponse.RecordId]);\n const emailDeliveryModeCode = this.props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n const defaultDeliveryOption = ArrayExtensions.hasElements(deliveryOptions) &&\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) ? deliveryOptions[0].DeliveryOptions[0].Code : undefined;\n\n const isOrderQuantityLimitsFeatureEnabled = isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings;\n if (this.state.productAvailableQuantity === undefined) {\n await this._updateAvailablity();\n }\n const { productAvailableQuantity } = this.state;\n const addProductToCartInput = {\n product: productResponse,\n count: quantity,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- Existing code.\n enableStockCheck: context.app.config.enableStockCheck,\n availableQuantity: productAvailableQuantity ? productAvailableQuantity.ProductAvailableQuantity.AvailableQuantity : 0,\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: isOrderQuantityLimitsFeatureEnabled },\n isAddEmailDeliveryItemToCart: defaultDeliveryOption !== undefined && defaultDeliveryOption === emailDeliveryModeCode,\n deliveryMode: defaultDeliveryOption\n };\n\n cart.result.addProductToCart(addProductToCartInput)\n .then(async result => {\n if (result.status === 'SUCCESS') {\n this.props.telemetry.debug('[quick-order] Cart Updated');\n\n this.setState({ stateMessage: {\n messageText: quickOrderAddedToCartSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n } });\n } else if (result.substatus === 'MAXQUANTITY') {\n this.props.telemetry.debug('[quick-order] Unable to Update Cart Line from the quick order', quantity);\n const maxQtyLimitReachedMessage = this._getMaxQtyMessage(productAvailableQuantity, quantity);\n\n this.setState({ stateMessage: {\n messageText: maxQtyLimitReachedMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n } });\n } else if (result.substatus === 'QUANTITYLIMITS' && isOrderQuantityLimitsFeatureEnabled) {\n const maxQtyLimitReachedMessage = result.errorDetails?.LocalizedMessage!;\n this.props.telemetry.debug('[quick-order] Unable to Update Cart Line from the quick order', maxQtyLimitReachedMessage);\n\n this.setState({ stateMessage: {\n messageText: maxQtyLimitReachedMessage || quickOrderAddedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n } });\n } else {\n this.props.telemetry.debug('[quick-order] Unable to Update Cart Line from the quick order');\n\n this.setState({ stateMessage: {\n messageText: quickOrderAddedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n } });\n }\n })\n .catch(error => {\n telemetry.warning(error);\n telemetry.debug('[quick-order] Error trying to Update Cart Line from the quick order');\n\n this.setState({ stateMessage: {\n messageText: quickOrderAddedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n } });\n });\n }\n };\n\n private _getMaxQtyMessage(productInventoryInfo: IProductInventoryInformation | undefined, currentQuantity: number): string {\n const { context, resources } = this.props;\n const { quickOrderMaxQuantityLimitText } = resources;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing code.\n const maxQuantityForLineItem = context.app.config.maxQuantityForCartLineItem || 10;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- existing code.\n if (!productInventoryInfo || !productInventoryInfo.ProductAvailableQuantity.AvailableQuantity || !context.app.config.enableStockCheck) {\n return quickOrderMaxQuantityLimitText.replace(\n '{maxQuantity}',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call -- existing code.\n maxQuantityForLineItem.toString()).replace('{curQuantity}',\n currentQuantity.toString()\n );\n }\n\n const minInventory = Math.min(maxQuantityForLineItem, productInventoryInfo.ProductAvailableQuantity.AvailableQuantity);\n\n return quickOrderMaxQuantityLimitText.replace('{maxQuantity}', minInventory.toString()).replace('{curQuantity}', currentQuantity.toString());\n }\n\n /**\n * Method to handle quantity change.\n * @param value - Quantity.\n */\n private readonly _handleQuantityChange = (value: string): void => {\n const currentValue = Number.parseInt((value), 10);\n const inputElement = this.quantityInput.current instanceof HTMLInputElement && this.quantityInput.current;\n\n this.setState(\n { quantity: currentValue },\n () => {\n debounce(\n () => {\n if (!isNaN(this.state.quantity) && !(this.state.quantity < 0) && inputElement) {\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\n inputElement.setAttribute('value', currentValue.toString());\n }\n },\n 200)();\n }\n );\n };\n\n private readonly _updateDimensionValue = (productDimensionFull: ProductDimensionFull, newValueId: string | undefined): ProductDimensionValue | undefined => {\n if (newValueId && productDimensionFull.DimensionValues) {\n return productDimensionFull.DimensionValues.find(dimension => dimension.RecordId === +newValueId);\n }\n\n return undefined;\n };\n\n private readonly _getDropdownName = (dimensionType: number, resources: IProductDimensionConfigureResources): string => {\n const isGiftCard = this.state.productResponse?.IsGiftCard;\n\n switch (dimensionType) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n /**\n * Method to update product dimension.\n */\n private readonly _updateDimensions = async (): Promise => {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: {\n channelId\n }\n }\n }\n } = this.props;\n const { productDimensions, productResponse } = this.state;\n if (!productResponse || !productDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\n this.setState({ isUpdatingDimension: true });\n\n // Step 1: Update state to indicate which dimensions are selected\n if (this.state.productDimensionErrorState.otherError) {\n const clearOtherErrorState = { ...this.state.productDimensionErrorState };\n clearOtherErrorState.otherError = undefined;\n this.setState({ productDimensionErrorState: clearOtherErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const key of Object.keys(dimensionsToUpdate)) {\n if (this.state.productDimensionErrorState.configureErrors[key]) {\n const errorState = { ...this.state.productDimensionErrorState };\n errorState.configureErrors[key] = undefined;\n\n this.setState({ productDimensionErrorState: errorState });\n }\n }\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions.map(dimension => {\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue: this._updateDimensionValue(dimension, dimensionsToUpdate[dimension.DimensionTypeValue]) || dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n }).filter(dimension => {\n return dimension.DimensionValue;\n });\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n const selectedProduct = new Promise(async (resolve, reject) => {\n const newProduct = (await getSelectedVariant(\n new SelectedVariantInput(\n productResponse.MasterProductId ? productResponse.MasterProductId : productResponse.RecordId,\n channelId,\n mappedDimensions, undefined,\n this.props.context.request\n ),\n actionContext\n ));\n if (newProduct) {\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n newProduct.MasterProductId ? newProduct.MasterProductId : newProduct.RecordId,\n channelId,\n mappedDimensions,\n this.props.context.request\n ),\n actionContext\n );\n }\n\n resolve(newProduct);\n });\n\n const variantProduct = await selectedProduct;\n this.setState({ productResponse: variantProduct !== null ? variantProduct : undefined });\n if (variantProduct) {\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\n // so that places like add to cart can await it\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(\n variantProduct.RecordId,\n channelId\n ),\n actionContext\n );\n\n if (newAvailableQuantity && newAvailableQuantity.length > 0) {\n this.setState({ productAvailableQuantity: newAvailableQuantity[0] });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n }\n };\n\n /**\n * Method to update product availablity.\n */\n private readonly _updateAvailablity = async (): Promise => {\n const {\n context: {\n actionContext,\n request: {\n apiSettings: {\n channelId\n }\n }\n }\n } = this.props;\n const { productResponse } = this.state;\n if (!productResponse) {\n return;\n }\n\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(\n productResponse.RecordId,\n channelId\n ),\n actionContext\n );\n\n if (newAvailableQuantity && ArrayExtensions.hasElements(newAvailableQuantity)) {\n const productAvailable = newAvailableQuantity.find(quantity => quantity.ProductAvailableQuantity.ProductId === productResponse.RecordId);\n this.setState({ productAvailableQuantity: productAvailable });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n };\n\n /**\n * Method to get dimension error string.\n * @param dimensionTypeValue - Dimension value.\n * @param resources - Localized error message.\n * @param isGiftCard - Flag to check giftcard.\n * @returns Dimension error string.\n */\n private readonly _getDimensionErrorString = (dimensionTypeValue: number, resources: IQuickOrderResources, isGiftCard?: boolean): string => {\n switch (dimensionTypeValue) {\n case 1: // ProductDimensionType.Color\n return resources.quickOrderproductDimensionTypeColorErrorMessage;\n case 2: // ProductDimensionType.Configuration\n return resources.quickOrderproductDimensionTypeConfigurationErrorMessage;\n case 3: // ProductDimensionType.Size\n return resources.quickOrderproductDimensionTypeSizeErrorMessage;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.quickOrderproductDimensionTypeAmountErrorMessage : resources.quickOrderproductDimensionTypeStyleErrorMessage;\n default:\n return '';\n }\n };\n\n /**\n * Method to validate the cart.\n * @param productResponse - Simple product object.\n * @param quantity - Quantity.\n * @returns Flag after validating cart.\n */\n private readonly _validateCart = (productResponse: SimpleProduct, quantity: number): boolean => {\n const missingDimensions = productResponse.Dimensions?.filter(\n (dimension: ProductDimension) => !(dimension.DimensionValue?.Value)\n );\n if (missingDimensions && missingDimensions.length > 0) {\n const userMessage = this._getConfigureErrors(missingDimensions, false);\n if (this.state.productDimensionErrorState.configureErrors) {\n const errorState = { ...this.state.productDimensionErrorState };\n errorState.configureErrors = userMessage;\n\n this.setState({ productDimensionErrorState: errorState });\n return false;\n }\n }\n\n if (quantity <= 0) {\n const resources = this.props.resources;\n this.setState({ stateMessage: {\n messageText: resources.quickOrderWrongQuantityErrorMsg,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n } });\n return false;\n }\n return true;\n };\n\n /**\n * Method to get configuration error string.\n * @param result - List of Dimension values.\n * @param isGiftCard - Flag to check giftcard.\n * @returns Error object.\n */\n private _getConfigureErrors(result: ProductDimension[] | undefined, isGiftCard?: boolean): { [configureId: string]: string | undefined } {\n if (!result) {\n return {};\n }\n const dimensions: { [configureId: string]: string | undefined } = {};\n const resources = this.props.resources;\n for (const dimension of result) {\n dimensions[dimension.DimensionTypeValue] = this._getDimensionErrorString(dimension.DimensionTypeValue, resources, isGiftCard);\n }\n return dimensions;\n }\n}\n\nexport default QuickOrder;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Button, format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\ninterface IPromoCodeState {\n isCollapseOpen: boolean;\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent}\n */\nclass PromoCode extends React.Component {\n\n private readonly payLoad: IPayLoad;\n\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n isCollapseOpen: false,\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public shouldComponentUpdate(nextProps: IPromoCodeProps, nextState: IPromoCodeState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n return (\n
\n
\n {this.props.promoCodeHeadingText}\n
\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n

\n {this.state.error}\n

\n {this._renderAppliedPromoCode(this.props)}\n
\n );\n }\n\n private readonly _onInputChangeHandler = (e: React.ChangeEvent) => {\n const error = e.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: e.target.value, error,\n canApply: !!e.target.value\n });\n };\n\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState.addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // Show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(error => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n };\n\n /**\n * On Submit function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent) => {\n event.preventDefault();\n this._applyPromotionHandler(cartState);\n };\n\n /**\n * On apply promotion function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _applyPromotionHandler = (cartState: ICartState | undefined) => () => {\n this._applyPromotion(cartState);\n };\n\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
\n
\n \n \n {promoCodeApplyButtonText}\n \n
\n
\n );\n };\n\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') || '';\n cartState.removePromoCodes({\n promoCodes: [code]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: '' });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\n });\n\n };\n\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\n return;\n }\n let discountAmount = 0;\n for (const line of cartState.cart.CartLines) {\n if (line.DiscountLines) {\n for (const discountLine of line.DiscountLines) {\n if (discountLine.DiscountCode === code) {\n discountAmount += discountLine.DiscountCost!;\n }\n }\n }\n }\n return discountAmount * -1;\n };\n\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || props.cart.cart.Coupons.length === 0) {\n return;\n }\n\n const removePromotionHandler = (event: React.MouseEvent) => {\n this._removePromotion(props.cart, event);\n };\n\n const promoCodTotalDiscount = props.cart.cart.Coupons.reduce(\n (count: number, coupon: Coupon) => {\n return count + (this._calculateDiscount(coupon.Code || '', props.cart) || 0);\n },\n 0);\n\n return (\n <>\n
\n
\n {this.props.appliedPromoCodeHeadingText}\n
\n \n
\n {\n props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code) : '';\n\n return (\n
\n
\n {coupon.Code}\n {' '}\n (\n \n )\n
\n \n {props.removePromoText}\n \n
\n );\n })\n }\n \n );\n };\n}\n\nexport default PromoCode;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Find the product in array of products considering product id.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @returns - The found product.\n */\nexport function getProductByProductId(productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined {\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId;\n });\n }\n\n return undefined;\n}\n\n/**\n * Find the product in array of products considering product id and product behavior's warehouse.\n * @param productId - The searched product id.\n * @param products - The array of products in which search is executed.\n * @param warehouseId - Warehouse id of cartLine.\n * @param cartState - The cart start in case cart line has no warehouse.\n * @returns - The found product.\n */\nexport function getProductByProductIdAndWarehouse(\n productId: number | undefined,\n products?: SimpleProduct[],\n warehouseId?: string,\n cartState?: ICartState): SimpleProduct | undefined {\n const targetWarehouseValue = warehouseId ?? cartState?.cart.WarehouseId;\n\n if (productId !== undefined && ArrayExtensions.hasElements(products)) {\n return products.find(product => {\n return productId === product.RecordId &&\n product.Behavior?.InventoryLocationId === targetWarehouseValue;\n });\n }\n\n return undefined;\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IUserReviewData } from './submit-user-review-input-data';\n\n/**\n * SubmitUserReview Input Action.\n */\nexport class SubmitUserReviewInput implements IActionInput {\n /**\n * The Id representing the product to get the ratings for.\n */\n public productId?: string;\n\n /**\n * The ID representing the tenant.\n */\n public tenantId: string;\n\n /**\n * The calling organization's channel id.\n */\n public channelId: string;\n\n /**\n * The locale for which to get the ratings from.\n */\n public locale: string;\n\n /**\n * The user's review data.\n */\n public userReviewData: IUserReviewData;\n\n /**\n * The user's authorization token.\n */\n public authorization: string;\n\n /**\n * The ratings and reviews service endpoint.\n */\n public serviceEndpoint: string;\n\n constructor(\n productId: string | undefined,\n tenantId: string,\n channelId: string,\n locale: string,\n userReviewData: IUserReviewData,\n authorization: string,\n serviceEndpoint: string\n ) {\n this.productId = productId;\n this.tenantId = tenantId;\n this.channelId = channelId;\n this.locale = locale;\n this.userReviewData = userReviewData;\n this.authorization = authorization;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => 'SubmitUserReview';\n\n public getCacheObjectType = () => 'SubmitUserReview';\n\n public dataCacheType = (): CacheType => 'none';\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { SocialMedia, SocialMediaComponent } from '@msdyn365-commerce/components';\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISocialShareItemConfig, ISocialShareItemProps, socialMedia } from './social-share-item.props.autogenerated';\n\nexport interface ISocialShareItemViewProps extends ISocialShareItemProps {\n SocialShareItemElement: React.ReactNode | null;\n SocialShareItem: IModuleProps;\n}\n\n/**\n *\n * SocialShareItem component.\n * @extends {React.PureComponent>}\n */\nclass SocialShareItem extends React.PureComponent> {\n constructor(props: ISocialShareItemProps) {\n super(props);\n\n this._getSocialShareItem = this._getSocialShareItem.bind(this);\n }\n\n public render(): JSX.Element | null {\n const viewprops = {\n ...this.props,\n SocialShareItem: {\n moduleProps: this.props,\n className: 'ms-social-share-item'\n },\n SocialShareItemElement: this._getSocialShareItem()\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n\n private _getSocialShareItem(): React.ReactNode | null {\n const src = this.props.config.icon;\n if (MsDyn365.isBrowser) {\n switch (this.props.config.socialMedia) {\n case socialMedia.facebook:\n return ();\n case socialMedia.twitter:\n return ();\n case socialMedia.pinterest:\n return ();\n case socialMedia.linkedin:\n return ();\n case socialMedia.mail:\n return ();\n default:\n return null;\n }\n }\n return null;\n }\n}\n\nexport default SocialShareItem;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\n\nasync function emptyActiveCart(ctx: IActionContext): Promise {\n let cartState;\n let checkoutState;\n const lineItemIdsToRemove = [];\n\n try {\n cartState = await getCartState(ctx);\n checkoutState = await getCheckoutState(ctx);\n } catch (error) {\n throw error;\n }\n\n if (!cartState || !cartState.cart) {\n throw new Error('Fail to fetch active cart');\n }\n\n if (!checkoutState || !checkoutState.checkoutCart) {\n throw new Error('Fail to fetch checkoutCart cart');\n }\n\n const activeCart = cartState.cart;\n const checkoutCart = checkoutState.checkoutCart.cart;\n\n for (const activeCartLine of activeCart.CartLines || []) {\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\n lineItemIdsToRemove.push(activeCartLine.LineId);\n }\n }\n }\n\n try {\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\n await cartState.removeAllPromoCodes({});\n await checkoutState.removeCheckoutCartId({});\n } catch (error) {\n throw error;\n }\n}\n\nexport default emptyActiveCart;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './alert';\nexport * from './get-line-items';\nexport * from './get-order-summary';\nexport * from './guided-card';\nexport * from './guided-form';\nexport * from './place-order-button';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAdditionalContentData, ILinksData } from '../video-player.props.autogenerated';\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content Component props.\n */\nexport interface IVideoPlayerAdditionalContentProps {\n requestContext: Msdyn365.IRequestContext;\n additionalContent: IAdditionalContentData | undefined;\n handleAdditionalTextChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalParagraphChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalLinkTextChange(linkIndex: number, event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content view props.\n */\nexport interface IVideoPlayerAdditionalContentViewProps {\n additionalContentNode: INodeProps;\n additionalContentItems?: IVideoPlayerAdditionalContentItemViewProps;\n}\n\n/**\n * IVideoPlayerAdditionalContentProps: Interface for\n * Video Player Additional Content Item view props.\n */\nexport interface IVideoPlayerAdditionalContentItemViewProps {\n heading: React.ReactNode;\n text: React.ReactNode;\n links: React.ReactNode;\n additionalContentItemContainer: INodeProps;\n additionalContentItemLinks: INodeProps;\n}\n\n/**\n * Renders additional content heading.\n * @param additionalContentHeading - Additional content heading.\n * @param props - Video Player Additional content component props.\n * @returns Heading Node.\n */\nconst renderHeading = (additionalContentHeading: string, props: IVideoPlayerAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalTextChange(event);\n }, requestContext\n }}\n />);\n};\n\n/**\n * Renders additional content heading.\n * @param additionalContentParagraphText - Additional content paragraph text.\n * @param props - Video Player Additional content component props.\n * @returns Paragraph Node.\n */\nconst renderParagraph = (additionalContentParagraphText: string, props: IVideoPlayerAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalParagraphChange(event);\n }, requestContext\n }}\n />);\n};\n\n/**\n * Renders additional content heading.\n * @param ctaLink - Additional content link.\n * @param props - Video Player Additional content component props.\n * @param linkIndex - Additional content link index.\n * @returns Link Node.\n */\nconst renderLinks = (ctaLink: ILinksData, props: IVideoPlayerAdditionalContentProps, linkIndex: number) => {\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: ctaLink.ariaLabel,\n className: 'ms-video-player__details__additional-content__cta__links',\n linkText: ctaLink.linkText,\n linkUrl: ctaLink.linkUrl.destinationUrl,\n openInNewTab: ctaLink.openInNewTab,\n role: 'link'\n };\n const requestContext = props.requestContext;\n return (\n {\n props.handleAdditionalLinkTextChange(linkIndex, event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Create node for each additonal content item.\n * @param item - Video Player additonal content item props.\n * @param props - Video Player Additional content component props.\n * @returns IVideoPlayerAdditionalContentItemViewProps.\n */\nconst getAdditionalContentItems = (\n item: IAdditionalContentData,\n props: IVideoPlayerAdditionalContentProps\n): IVideoPlayerAdditionalContentItemViewProps => {\n const headingNode = item.heading && renderHeading(item.heading, props);\n const paragraphNode = item.subtext && renderParagraph(item.subtext, props);\n const linksNode = item.links?.map((ctaLink: ILinksData, index: number) => {\n return renderLinks(ctaLink, props, index);\n });\n\n return {\n heading: headingNode,\n text: paragraphNode,\n links: linksNode,\n additionalContentItemContainer: { className: 'ms-video-player__details__additional-content__container' },\n additionalContentItemLinks: { className: 'ms-video-player__details__additional-content__cta' }\n };\n};\n\n/**\n * VideoPlayerAdditionalContent component.\n * @param props - Video Player Additional content component props.\n * @returns Video Player Additional content view props.\n */\nexport const videoPlayerAdditionalContent = (props: IVideoPlayerAdditionalContentProps): IVideoPlayerAdditionalContentViewProps | undefined => {\n const { additionalContent } = props;\n if (!additionalContent) {\n return undefined;\n }\n\n const reactNodes: IVideoPlayerAdditionalContentItemViewProps = getAdditionalContentItems(additionalContent, props);\n return {\n additionalContentNode: { className: 'ms-video-player__details__additional-content' },\n additionalContentItems: reactNodes\n };\n};\n\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IPlayerData, IPlayerOptions, IPlayerResources, IVideoMetadata, Player } from '@msdyn365-commerce/components';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { getPayloadObject, getTelemetryAttributes, getTelemetryObject, INodeProps,\n isMobile, ITelemetryContent, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IVideoPlayerAdditionalContentViewProps, videoPlayerAdditionalContent } from './components/additional-content';\nimport { ILinksData, IVideoPlayerConfig, IVideoPlayerProps } from './video-player.props.autogenerated';\n\nexport interface IVideoPlayerViewProps extends IVideoPlayerProps<{}> {\n player: React.ReactNode;\n title?: React.ReactNode;\n text?: React.ReactNode;\n links?: React.ReactNode;\n detailsContainer?: INodeProps;\n detailsContainerCta?: INodeProps;\n additionalContent?: IVideoPlayerAdditionalContentViewProps;\n handleText?(): void;\n handleParagraph?(): void;\n handleAdditionalText?(): void;\n handleAdditionalParagraph?(): void;\n handleLink?(): void;\n handleAdditionalLink?(): void;\n}\n\n/**\n *\n * VideoPlayer component.\n * @extends {React.PureComponent>}\n */\nclass VideoPlayer extends React.PureComponent> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly isMobileDevice: boolean;\n\n public constructor(props: IVideoPlayerProps) {\n super(props);\n this.isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n }\n\n public render(): JSX.Element {\n const options = {\n ...this.props.config,\n isMobileDevice: this.isMobileDevice\n };\n const video: MsDyn365.IVideoData = this.props.config.video;\n const playerResources: IPlayerResources = {\n playAriaLabel: this.props.resources.playLabel,\n pauseAriaLabel: this.props.resources.pauseLabel,\n playingAriaLabel: this.props.resources.playingLabel,\n pausedAriaLabel: this.props.resources.pausedLabel,\n muteAriaLabel: this.props.resources.muteLabel,\n unMuteAriaLabel: this.props.resources.unMuteLabel,\n fullScreenAriaLabel: this.props.resources.fullScreenLabel,\n exitFullScreenAriaLabel: this.props.resources.exitFullScreenLabel,\n seekBarLabel: this.props.resources.seekBarLabel,\n videoTimeDurationLabel: this.props.resources.videoTimeDurationLabel,\n closedCaptionLabel: this.props.resources.closedCaptionLabel\n };\n const videoMetaData: IVideoMetadata = {};\n\n if (video) {\n videoMetaData.videoId = video.id;\n videoMetaData.title = video.title;\n videoMetaData.duration = video.playTime;\n\n if (video.thumbnail) {\n videoMetaData.posterframeUrl = video.thumbnail.src;\n }\n\n if (video._links?.binaryReferences) {\n videoMetaData.videoBinaryReferences = video._links.binaryReferences;\n }\n }\n const videoPlayerData: IPlayerData = { options: options as IPlayerOptions, metaData: videoMetaData };\n const viewProps = {\n // Context for telemetry and raw data for C1 to do customization\n // Including computed data, state data and methods\n ...this.props,\n\n player: (\n \n \n \n ),\n title: this._getVideoDetailsHeading(),\n text: this._getVideoDetailsParagraph(),\n links: this._getVideoDetailsLinks(),\n detailsContainer: { className: 'ms-video-player__details' },\n detailsContainerCTA: { className: 'ms-video-player__details__cta' },\n additionalContent: videoPlayerAdditionalContent({\n requestContext: this.props.context.request,\n additionalContent: this.props.config.additionalContent,\n handleAdditionalTextChange: this.handleAdditionalTextChange,\n handleAdditionalParagraphChange: this.handleAdditionalParagraphChange,\n handleAdditionalLinkTextChange: this.handleAdditionalLinkTextChange\n\n }),\n handleText: this.handleTextChange,\n handleParagraph: this.handleParagraphChange,\n handleAdditionalText: this.handleAdditionalTextChange,\n handleAdditionalParagraph: this.handleAdditionalParagraphChange,\n handleLink: this.handleLinkTextChange,\n handleAdditionalLink: this.handleAdditionalTextChange\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle link text change.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.links && this.props.config.links[Number(linkIndex)]) {\n this.props.config.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * Handle text change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleTextChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n /**\n * Handle paragraph change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleParagraphChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.paragraph = event.target.value;\n };\n\n /**\n * Handle additional text change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalTextChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.heading = event.target.value;\n }\n }\n\n /**\n * Handle additional link text change.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n const additionalContent = this.props.config.additionalContent ?? {};\n if (additionalContent.links) {\n additionalContent.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * Handle additional paragraph change.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalParagraphChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.subtext = event.target.value;\n }\n }\n\n /**\n * Get video details links.\n * @returns - React node.\n */\n private _getVideoDetailsLinks(): React.ReactNode[] | undefined {\n const { links } = this.props.config;\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\n\n return (\n links?.map((linkData: ILinksData, index: number) => {\n payLoad.contentAction.etext = linkData.linkText;\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n const linkId = index;\n const editableLink: MsDyn365.ILinksData = {\n ariaLabel: linkData.ariaLabel,\n className: 'ms-video-player__details__cta__link',\n linkText: linkData.linkText,\n linkUrl: linkData.linkUrl.destinationUrl,\n openInNewTab: linkData.openInNewTab,\n role: 'button',\n additionalProperties: attributes\n };\n\n return (\n {\n this.handleLinkTextChange(index, event);\n }, requestContext: this.props.context.request }}\n />\n );\n })\n );\n }\n\n private _getVideoDetailsHeading(): React.ReactNode | undefined {\n const { heading } = this.props.config;\n\n return (\n heading && (\n \n )\n );\n }\n\n private _getVideoDetailsParagraph(): React.ReactNode | undefined {\n const { paragraph } = this.props.config;\n\n return (\n paragraph && (\n \n )\n );\n }\n}\n\nexport default VideoPlayer;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\nimport { checkoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n getTenderTypesAsync, resolveCardTypesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Address, CardPaymentAcceptResult, CardType, CartTenderLine, RetailOperation, SalesOrder, TenderType, TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport const OPERATIONS = {\n PayCard: 201,\n PayGiftCertificate: 214,\n PayLoyalty: 207,\n PayCustomerAccount: 202\n};\n\nconst getCardTypeId = async (ctx: IActionContext, cardPrefix: string = ''): Promise => {\n try {\n const response = await resolveCardTypesAsync({ callerContext: ctx }, cardPrefix, CardType.Unknown);\n if (response && response.length > 0) {\n return response[0].TypeId;\n }\n } catch (error) {\n ctx.telemetry.error('Call to resolveCardTypesAsync failed.', error);\n }\n return undefined;\n};\n\nconst findTenderIdTypeByOperationId = (tenderTypes: TenderType[], operationId: RetailOperation): string | undefined => {\n const matchedTenderType = tenderTypes.find(tenderType => tenderType.OperationId === operationId);\n if (matchedTenderType) {\n return matchedTenderType.TenderTypeId;\n }\n return;\n};\n\nconst roundNumber = (value: number) => Number(value.toFixed(2));\n\nasync function getLoyaltyTenderLine(\n ctx: IActionContext,\n LoyaltyCardId: string,\n Amount: number = 0,\n Currency: string = 'USD'\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayLoyalty);\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n LoyaltyCardId\n };\n}\n\nasync function getGiftCardTenderLine(\n ctx: IActionContext,\n GiftCardId: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n tenderTypeId?: string,\n giftCardPin?: string,\n giftCardExpirationYear?: number,\n giftCardExpirationMonth?: number\n): Promise {\n let TenderTypeId = tenderTypeId;\n\n if (!TenderTypeId) {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayGiftCertificate);\n }\n\n const GiftCardPin = giftCardPin;\n const GiftCardExpirationYear = giftCardExpirationYear;\n const GiftCardExpirationMonth = giftCardExpirationMonth;\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n GiftCardId,\n GiftCardPin,\n GiftCardExpirationYear,\n GiftCardExpirationMonth\n };\n}\n\nasync function getCreditCardTenderLine(\n ctx: IActionContext,\n tokenizedPaymentCard: TokenizedPaymentCard,\n cardPrefix: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n billingAddress?: Address\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n let cartTypeId = tokenizedPaymentCard.CardTypeId;\n\n if (!cartTypeId) {\n cartTypeId = await getCardTypeId(ctx, cardPrefix);\n }\n\n if (!tenderTypes) {\n throw new Error('Fail to get card tender type');\n }\n\n if (!cartTypeId) {\n throw new Error('Fail to get card type id');\n }\n\n const TenderTypeId = tokenizedPaymentCard.TenderType ?? findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n Amount,\n TenderTypeId,\n CardTypeId: cartTypeId\n };\n cardTenderLine.TokenizedPaymentCard = {\n ...tokenizedPaymentCard,\n CardTypeId: cartTypeId,\n\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\n House: tokenizedPaymentCard.House || 'N/A',\n ...(tokenizedPaymentCard.CardTokenInfo && {\n CardTokenInfo: {\n ...tokenizedPaymentCard.CardTokenInfo,\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardTokenInfo'\n }\n }),\n ...(billingAddress && {\n Phone: billingAddress.Phone,\n Country: billingAddress.ThreeLetterISORegionName,\n Address1: billingAddress.Street,\n City: billingAddress.City,\n State: billingAddress.State,\n Zip: billingAddress.ZipCode\n })\n };\n\n return cardTenderLine;\n}\n\n/**\n * Get credit card tender line.\n * @param context - Action context.\n * @param amount - Due amount for credit card.\n * @param currency - Currency.\n * @param cardPaymentAcceptResult - CardPaymentAcceptResult.\n * @returns - The credit card tender line.\n */\nasync function getCreditCardTenderLineForSinglePaymentAuth(\n context: IActionContext,\n amount: number = 0,\n currency: string = 'USD',\n cardPaymentAcceptResult?: CardPaymentAcceptResult\n): Promise {\n const tenderTypes = await getTenderTypesAsync({ callerContext: context, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n const tenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error -- existing data.\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency: currency,\n Amount: amount,\n TenderTypeId: tenderTypeId,\n CardPaymentAcceptResult: cardPaymentAcceptResult\n };\n\n return cardTenderLine;\n}\n\nasync function createCustomerAccountTenderLine(\n ctx: IActionContext,\n Amount: number,\n Currency: string = 'USD'\n): Promise {\n const CustomerId = null;\n if (!ctx.requestContext.user.isAuthenticated) {\n ctx.telemetry.error('A customer id is required to pay with customer account');\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n ctx.telemetry.error('No tender types found for this channel');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCustomerAccount);\n if (!TenderTypeId) {\n ctx.telemetry.error('No customer account tender type');\n }\n return {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n\n // @ts-expect-error\n CustomerId\n };\n}\n\nexport default async (ctx: IActionContext, updatedCartVersion?: number, isPaymentVerificationRedirection?: boolean): Promise => {\n const checkoutState = await getCheckoutState(ctx).catch(error => {\n throw error;\n });\n\n const cartState = checkoutState.checkoutCart;\n\n const channelConfiguration = ctx.requestContext.channel;\n\n if (!cartState || Object.keys(cartState).length === 0 || !channelConfiguration) {\n throw new Error('Fail to placeOrder');\n }\n\n const {\n giftCardExtends,\n tokenizedPaymentCard,\n cardPrefix,\n guestCheckoutEmail,\n billingAddress,\n loyaltyAmount,\n cardPaymentAcceptResult,\n shouldEnableSinglePaymentAuthorizationCheckout\n } = checkoutState;\n const { Currency } = channelConfiguration;\n\n let amountDue = cartState.cart.AmountDue || 0;\n let cartTenderLines;\n const getTenderLinePromises = [];\n const loyaltyCardNumber = cartState.cart.LoyaltyCardId;\n\n // Pay by loyalty first\n if (loyaltyAmount && loyaltyCardNumber) {\n const chargedAmount = roundNumber(Math.min(loyaltyAmount, amountDue));\n const loyaltyTenderLinePromise = getLoyaltyTenderLine(ctx, loyaltyCardNumber, chargedAmount, Currency);\n getTenderLinePromises.push(loyaltyTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n }\n\n // Then by gift card\n if (giftCardExtends && giftCardExtends.length > 0) {\n giftCardExtends.some(giftCardExtend => {\n if (giftCardExtend.Balance && amountDue > 0) {\n const chargedAmount = roundNumber(Math.min(giftCardExtend.Balance, amountDue));\n const tenderTypeId = giftCardExtend.TenderTypeId;\n const giftCardPin = giftCardExtend.Pin;\n const giftCardExpirationYear = giftCardExtend.ExpirationDate ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[1], 10) : undefined;\n const giftCardExpirationMonth = giftCardExtend.ExpirationDate ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[0], 10) : undefined;\n const creditCardTenderLinePromise = getGiftCardTenderLine(ctx, giftCardExtend.Id, chargedAmount, Currency, tenderTypeId, giftCardPin, giftCardExpirationYear, giftCardExpirationMonth);\n getTenderLinePromises.push(creditCardTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n }\n return amountDue === 0;\n });\n }\n\n // Then by customer account\n if (checkoutState.customerAccountAmount > 0) {\n const chargedAmount = roundNumber(Math.min(checkoutState.customerAccountAmount, amountDue));\n const customerAccountTenderLinePromise = createCustomerAccountTenderLine(ctx, chargedAmount, Currency);\n getTenderLinePromises.push(customerAccountTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n }\n\n // Pay the rest by credit card\n if (amountDue > 0) {\n let creditCardTenderLinePromise: Promise;\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && !checkoutState.isExpressCheckoutApplied) {\n creditCardTenderLinePromise = getCreditCardTenderLineForSinglePaymentAuth(\n ctx,\n amountDue,\n Currency,\n cardPaymentAcceptResult\n );\n } else {\n if (!tokenizedPaymentCard) {\n throw new Error('Fail to placeOrder: no token found');\n }\n creditCardTenderLinePromise = getCreditCardTenderLine(\n ctx,\n tokenizedPaymentCard,\n cardPrefix,\n amountDue,\n Currency,\n billingAddress\n );\n }\n\n getTenderLinePromises.push(creditCardTenderLinePromise);\n }\n\n if (getTenderLinePromises.length > 0) {\n // When payment methods is required\n cartTenderLines = await Promise.all(getTenderLinePromises).catch(error => {\n throw error;\n });\n\n if (!cartTenderLines || cartTenderLines.length === 0) {\n throw new Error('Fail to placeOrder: fail to get cart tender lines');\n }\n }\n\n const cartVersion = updatedCartVersion || cartState.cart.Version;\n\n // Proceed checkout\n const salesOrder = await checkoutAsync(\n { callerContext: ctx, bypassCache: 'get' },\n cartState.cart.Id,\n guestCheckoutEmail,\n undefined,\n undefined,\n cartTenderLines || null,\n cartVersion\n ).catch(async error => {\n if (checkoutState.shouldEnableSinglePaymentAuthorizationCheckout) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n if (error.data?.AdditionalContext) {\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n await checkoutState.updateRedirectAdditionalContext({ newRedirectAdditionalContext: error?.data?.AdditionalContext as string });\n } else {\n await checkoutState.updateIsCheckoutCallFailed({ newIsCheckoutCallFailed: true });\n\n if (isPaymentVerificationRedirection) {\n await checkoutState.checkoutCart.refreshCart({});\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n }\n }\n }\n\n throw error;\n });\n\n if (!salesOrder) {\n throw new Error('Fail to placeOrder: fail to checkout');\n }\n\n return salesOrder;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\n\n/**\n * ICartIconViewState: Interface for Cart Icon View State.\n */\ninterface ICartIconViewState {\n isModalOpen: boolean;\n}\n\n/**\n * Render Cart lines.\n * @param cartLines - Flyout cart line view props.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n return cartLines.map((cartLine, index) => {\n const cartLineIndex = index;\n return (\n \n \n {cartLine.cartline}\n \n {cartLine.remove}\n {cartLine.storeLocation}\n \n );\n });\n};\n\n/**\n * Initiate total price.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\n const totalPrice = price ? props.context.cultureFormatter.formatCurrency(price) : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\n return (\n
\n \n {props.resources.totalPriceFormatString}\n \n {totalPrice}\n \n \n
\n );\n};\n\n/**\n *\n * CartIconView component.\n * @extends {React.PureComponent}\n */\nexport class CartIconView extends React.PureComponent, ICartIconViewState> {\n\n private isAutoDisplayTriggered: boolean;\n\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\n super(props);\n this.isAutoDisplayTriggered = false;\n this.state = {\n isModalOpen: false\n };\n }\n\n public componentDidMount(): void {\n if (MsDyn365.isBrowser) {\n window.addEventListener('keydown', this._escFunction, false);\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser) {\n window.removeEventListener('keydown', this._escFunction, false);\n }\n }\n\n /**\n * Render Cart Item count.\n * @returns JSX Element.\n */\n public render(): JSX.Element | null {\n const cart = this.props.data.cart.result ?? undefined;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart = cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n if (shouldShowMiniCart) {\n if (!this.isAutoDisplayTriggered) {\n // First time trigger auto mini cart.\n this.setState({ isModalOpen: true });\n this.isAutoDisplayTriggered = true;\n } else if (!this.state.isModalOpen) {\n // If modal is closed, reset the flag.\n this.isAutoDisplayTriggered = false;\n }\n }\n return (\n \n \n {this.props.cartIcon}\n \n \n \n {this.props.flyoutTitle}\n {this._renderCartItemCount(this.props)}\n {this._renderCartCloseIcon()}\n \n \n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\n \n {renderCartlines(this.props.cartlines, this.props)}\n \n \n \n {this.props.slots.promoContentItem}\n {renderTotalPrice(this.props)}\n

\n {this.props.resources.subTotalMessage}\n

\n {this.props.checkoutAsSignInUserButton}\n {this.props.checkoutAsGuestButton}\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\n \n {\n this.props.data.cart.result?.isEmpty ? \n {this.props.resources.continueShoppingButtonTitle}\n : null\n }\n \n
\n \n \n );\n }\n\n /**\n * Initiate modal container.\n * @returns Inode props.\n */\n private readonly _modalContainer = (): INodeProps => {\n return {\n tag: Modal,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__minicartmodal-container',\n wrapClassName: 'ms-cart-icon__minicartmodal',\n isOpen: this.state.isModalOpen,\n toggle: this.closeModal\n };\n };\n\n /**\n * Initiate open modal.\n */\n private readonly _openModal = (): void => {\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\n this.setState({\n isModalOpen: true\n });\n };\n\n /**\n * Initiate close modal.\n */\n private readonly closeModal = (): void => {\n this.setState({\n isModalOpen: false\n });\n\n };\n\n /**\n * Initiate cart close Icon.\n * @returns JSX Element.\n */\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\n return (\n \n );\n };\n\n /**\n * Render Cart Item count.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\n private readonly _renderCartItemCount = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n let cartItemCount;\n const defaultCartItemCount: number = 0;\n const defaultCartItemCountOne: number = 1;\n\n if (ArrayExtensions.hasElements(props.cartlines)) {\n if (props.cartlines.length === defaultCartItemCountOne) {\n cartItemCount = `${defaultCartItemCountOne} ${props.resources.item}`;\n } else {\n cartItemCount = `${props.cartlines.length} ${props.resources.items}`;\n }\n } else {\n cartItemCount = `${defaultCartItemCount} ${props.resources.items}`;\n }\n return (\n \n {cartItemCount}\n \n );\n };\n\n /**\n * Handle escape click to close modal.\n * @param event - On press of any key.\n */\n private readonly _escFunction = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCodes.Escape && this.state.isModalOpen) {\n this.closeModal();\n }\n };\n\n}\n\nexport default CartIconView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface ITitle {\n className: string;\n text: string;\n}\n\nexport const Title: React.FC = ({ text, className }) => (\n {' '}\n {text}\n {' '}\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IBulkPurchaseViewProps } from './bulk-purchase';\n\n/**\n * Bulk purchase view.\n * @param props - Bulk purchase view props.\n * @returns React node with a module.\n */\nexport const BulkPurchaseViewComponent: React.FC = props => {\n return (\n \n {props.content}\n \n );\n};\n\nexport default BulkPurchaseViewComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport WriteReview from './write-review';\nimport WriteReviewView from './write-review.view';\n\nexport * from './write-review';\nexport * from './write-review.data';\nexport { IWriteReviewConfig, IWriteReviewProps, IWriteReviewResources } from './write-review.props.autogenerated';\nexport * from './write-review.view';\n\nexport {\n WriteReview,\n WriteReviewView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { OrderBy } from '../actions/inputs/get-product-reviews-input';\n\nexport interface IRnrKeyValuePair {\n key: string;\n value: string;\n}\n\nexport interface IRnrOrderByKeyValuePair {\n key: OrderBy;\n value: string;\n}\n\nexport function setFocusOnElement(id: string): void {\n const element = document.getElementById(id);\n if (element) {\n element.focus();\n }\n}\n\nexport const TOGGLE_REVIEW_MODAL_BUTTON_ID: string = 'reviewproductid';\nexport const TOGGLE_EDIT_MODAL_BUTTON_ID: string = 'ms-write-review__edit';\nexport const TOGGLE_EDIT_MODAL_BUTTON_CARD_ID: string = 'ms-reviews-list__edit';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { Button, format, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { TOGGLE_EDIT_MODAL_BUTTON_CARD_ID } from '../../../common/rnrInterface';\n\nexport interface IReviewCardResources {\n wasReviewHelpfulText: string;\n yesButtonText: string;\n noButtonText: string;\n editReviewCardText: string;\n reportedText: string;\n reportConcernText: string;\n reviewRatingNarratorText: string;\n}\n\nexport interface IReviewCardProps {\n review: Review;\n resources: IReviewCardResources;\n context: ICoreContext>;\n isUserReview?: boolean;\n parentId: string;\n parentType: string;\n reportedReviews: string[];\n returnRef: React.RefObject | undefined;\n reportedReviewId: string;\n votedReviews: { reviewId: string; approved: boolean }[];\n toggleWriteReviewModal?(): void;\n toggleReportReviewModal(reviewId: string): void;\n updateReviewHelpfulness(reviewId: string, isHelpful: boolean): void;\n}\n\nexport interface IReviewCardViewProps {\n cardProps: INodeProps;\n name: React.ReactElement;\n rating: React.ReactElement;\n date: React.ReactElement;\n reviewTitle: React.ReactElement;\n reviewText: React.ReactElement;\n ratingHelpfulLabel?: React.ReactElement;\n like?: React.ReactElement;\n dislike?: React.ReactElement;\n edit: React.ReactNode;\n report: React.ReactNode;\n responseName: React.ReactNode;\n responseDate: React.ReactNode;\n responseText: React.ReactNode;\n cardBodyProps: INodeProps;\n responseProps: INodeProps;\n reviewProps: INodeProps;\n controlsProps: INodeProps;\n headerProps: INodeProps;\n}\n\n/**\n * Review card component.\n */\n\nexport const ReviewCard = (props: IReviewCardProps): IReviewCardViewProps => {\n const className = props.isUserReview ? 'ms-reviews-list__card ms-reviews-list__user-review' : 'ms-reviews-list__card';\n return {\n cardProps: { className, key: props.review.reviewId },\n name:

\n {props.review.userName}\n

,\n rating: rating(props),\n date:

\n {renderDate(props, props.review.submittedDateTime)}\n

,\n reviewTitle:

\n {props.review.title}\n

,\n reviewText:

\n {props.review.reviewText}\n

,\n ratingHelpfulLabel: props.isUserReview ? undefined :

\n {props.resources.wasReviewHelpfulText}\n

,\n like: props.isUserReview ? undefined : voteHelpfulButton(props, true),\n dislike: props.isUserReview ? undefined : voteHelpfulButton(props, false),\n edit: editButton(props),\n report: reportToggle(props),\n responseName: props.review.userResponse ?

\n {props.review.userResponse.responderName}\n

: undefined,\n responseText: props.review.userResponse ?

\n {props.review.userResponse.responseText}\n

: undefined,\n responseDate: props.review.userResponse ?

\n {renderDate(props, props.review.userResponse.submittedDateTime)}\n

: undefined,\n cardBodyProps: { className: 'ms-reviews-list__card-body' },\n responseProps: { className: 'ms-reviews-list__response' },\n reviewProps: { className: 'ms-reviews-list__review' },\n controlsProps: { className: 'ms-reviews-list__card-controls' },\n headerProps: { className: 'ms-reviews-list__card-header' }\n };\n};\n\nconst rating = (props: IReviewCardProps) => {\n return (\n \n );\n};\n\nconst isVotedFor = (props: IReviewCardProps, isHelpful: boolean): boolean => {\n for (let i = 0; i < props.votedReviews.length; i++) {\n if (props.votedReviews[i].reviewId === props.review.reviewId) {\n return props.votedReviews[i].approved === isHelpful;\n }\n }\n\n return false;\n};\n\nconst voteHelpfulButton = (props: IReviewCardProps, isHelpful: boolean) => {\n const isVoted = isVotedFor(props, isHelpful);\n const isDisabled = props.isUserReview || isVoted ? 'disabled' : '';\n let className = isHelpful ? 'ms-reviews-list__like' : 'ms-reviews-list__dislike';\n className = `${className} ${isDisabled}`;\n const label = isHelpful ? props.resources.yesButtonText : props.resources.noButtonText;\n let voteCount = (isHelpful ? props.review.helpfulPositive : props.review.helpfulNegative) || 0;\n voteCount = isVoted ? voteCount + 1 : voteCount;\n const title = `(${voteCount})`;\n const user = props.context.request.user;\n const onClickMethod = () => {\n props.updateReviewHelpfulness(props.review.reviewId!, isHelpful);\n };\n const onClick = isDisabled ? undefined : onClickMethod;\n\n if (user.isAuthenticated) {\n return (\n {title}\n );\n }\n return (\n {title}\n );\n};\n\nconst editButton = (props: IReviewCardProps) => {\n if (props.isUserReview) {\n return ();\n }\n\n return undefined;\n};\n\nconst renderDate = (props: IReviewCardProps, date?: Date): string | Date => {\n if (!date) {\n return '';\n }\n\n try {\n return new Intl.DateTimeFormat(props.context.request.locale, { month: 'long', day: 'numeric', year: 'numeric' }).format(new Date(date));\n } catch {\n return date;\n }\n};\n\n/**\n * On Click Handler.\n * @param props -Review card props.\n * @returns Report review modal.\n */\nconst onClick = (props: IReviewCardProps) => () => {\n props.toggleReportReviewModal(props.review.reviewId!);\n};\n\nconst reportToggle = (props: IReviewCardProps) => {\n const user = props.context.request.user;\n if (props.isUserReview) {\n return undefined;\n } else if (!user.isAuthenticated) {\n return ();\n }\n\n if (props.reportedReviews.includes(props.review.reviewId!)) {\n return (

\n {props.resources.reportedText}\n

);\n }\n\n const ref = props.review.reviewId === props.reportedReviewId ? props.returnRef : undefined;\n\n return ();\n\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { format, getPayloadObject, getTelemetryAttributes, ILabeledDropdownOption, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IReviewCountResources {\n pageReviewCountText: string;\n}\n\nexport interface IReviewCountProps {\n resources: IReviewCountResources;\n currentPage: number;\n reviewsCount: number;\n reviewsShownOnEachPage: number;\n}\n\nexport const ReviewCount: React.FC = (props: IReviewCountProps) => {\n const { currentPage, resources, reviewsCount, reviewsShownOnEachPage } = props;\n\n return (\n \n {format(\n resources.pageReviewCountText,\n _getReviewStartNumber(currentPage, reviewsShownOnEachPage),\n _getReviewEndNumber(currentPage, reviewsCount, reviewsShownOnEachPage),\n reviewsCount\n )}\n \n );\n};\n\nexport interface IPageControlResources {\n previousButtonText: string;\n nextButtonText: string;\n pageReviewAriaLabel: string;\n}\n\nexport interface IPageControlsProps {\n resources: IPageControlResources;\n currentPage: number;\n reviewsCount: number;\n reviewsShownOnEachPage: number;\n selectedSortByOption: ILabeledDropdownOption;\n selectedFilterByOption: ILabeledDropdownOption;\n telemetryContent?: ITelemetryContent;\n updateReviews(skipItems: number, selectedSortByOption: ILabeledDropdownOption, selectedFilterByOption: ILabeledDropdownOption, currentPage: number, isFilterApplied: boolean): Promise;\n}\n\nexport const PageControls: React.FC = (props: IPageControlsProps) => {\n const { currentPage, resources, reviewsCount, reviewsShownOnEachPage } = props;\n const previousPageClick = React.useCallback(() => {\n return _getPreviousPageData(props);\n }, [props]);\n const nextPageClick = React.useCallback(() => {\n return _getNextPageData(props);\n }, [props]);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Next);\n const nextAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Previous;\n const previousAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n
\n {_hasPreviousPage(currentPage) && (\n \n {resources.previousButtonText}\n \n )}\n {_hasNextPage(currentPage, reviewsCount, reviewsShownOnEachPage) && (\n \n {resources.nextButtonText}\n \n )}\n
\n );\n};\n\nconst _hasPreviousPage = (currentPage: number): boolean => {\n return currentPage > 1;\n};\n\nconst _hasNextPage = (currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number): boolean => {\n return _getPagesCount(reviewsCount, reviewsShownOnEachPage) > currentPage;\n};\n\nconst _getReviewsShown = (reviewsShownOnEachPage: number) => {\n return Math.min(25, reviewsShownOnEachPage);\n};\n\nconst _getPagesCount = (reviewsCount: number, reviewsShownOnEachPage: number): number => {\n return Math.ceil(reviewsCount / _getReviewsShown(reviewsShownOnEachPage));\n};\n\nconst _paginationAriaLabel = (pageReviewAriaLabel: string, currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number, isNextPage: boolean, page?: number): string => {\n const pageModifier = isNextPage ? 1 : -1;\n return format(\n pageReviewAriaLabel,\n _getReviewStartNumber(currentPage, reviewsShownOnEachPage, currentPage + pageModifier),\n _getReviewEndNumber(currentPage, reviewsCount, reviewsShownOnEachPage, currentPage + pageModifier),\n reviewsCount\n );\n};\n\nconst _getReviewStartNumber = (currentPage: number, reviewsShownOnEachPage: number, page?: number): number => {\n return ((page || currentPage) - 1) * _getReviewsShown(reviewsShownOnEachPage) + 1;\n};\n\nconst _getReviewEndNumber = (currentPage: number, reviewsCount: number, reviewsShownOnEachPage: number, page?: number): number => {\n const pageUsed = page || currentPage;\n const pageReviewCount = pageUsed * _getReviewsShown(reviewsShownOnEachPage);\n return pageReviewCount < reviewsCount ? pageReviewCount : reviewsCount;\n};\n\nconst _getPreviousPageData = async (props: IPageControlsProps) => {\n await props.updateReviews(\n _getReviewStartNumber(props.currentPage, props.reviewsShownOnEachPage) - 1 - _getReviewsShown(props.reviewsShownOnEachPage),\n props.selectedSortByOption,\n props.selectedFilterByOption,\n props.currentPage - 1,\n false\n );\n};\n\nconst _getNextPageData = async (props: IPageControlsProps) => {\n\n await props.updateReviews(\n _getReviewEndNumber(props.currentPage, props.reviewsCount, props.reviewsShownOnEachPage),\n props.selectedSortByOption,\n props.selectedFilterByOption,\n props.currentPage + 1,\n false\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ITelemetry } from '@msdyn365-commerce/core';\nimport { AttributeDataType, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\n\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\n\n/**\n * Types of product refiner values.\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport enum ProductRefinerValueDataTypeValue {\n\n /**\n * Range slider is used for selections like price.\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Range = 1,\n\n /**\n * Range input is a different way to specify ranges and can be expressed with input boxes\n * as well as a set of discrete single-select type values.\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n RangeInput = 4,\n\n /**\n * This is a discrete list item, either multi-select or single-select.\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n List = 5,\n\n /**\n * Boolean types allows only single-select.\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Boolean = 6\n}\n\n/**\n * Types of product refiners.\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport enum ProductRefinerTypeValue {\n\n /**\n * Refiner values are single-select.\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Single = 0,\n\n /**\n * Refiner values are multi-select.\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Multi = 1\n}\n\n/**\n * ProductRefinerSource enum type.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\nexport enum ProductRefinerSource {\n\n /**\n * The None member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n None = 0,\n\n /**\n * The Attribute member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Attribute = 1,\n\n /**\n * The Category member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Category = 2,\n\n /**\n * The Price member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Price = 3,\n\n /**\n * The Rating member.\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\n * @example\n * ```\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\n * ```\n */\n Rating = 4\n}\n\n/**\n * Checks if the data type value corresponds to a slider.\n * @param dataTypeValue\n */\nexport function isRangeType(dataTypeValue: number | undefined): boolean {\n return dataTypeValue === AttributeDataType.Currency ||\n dataTypeValue === AttributeDataType.Decimal ||\n dataTypeValue === AttributeDataType.Integer;\n}\n\n/**\n * Find the refinement criterion associated with this product refiner value.\n * @param productRefinerValue Product refiner value to match.\n * @param refinementCriteria Selected refinement criteria.\n */\nexport function findMatchingRefinementCriterion(\n productRefinerValue: ProductRefinerValue,\n refinementCriteria: ProductRefinerValue[]\n): ProductRefinerValue | undefined {\n // If the value is a range, then match only on data type value; otherwise match on item string\n return refinementCriteria.find(\n (refinementCriterion: ProductRefinerValue) => isMatchingRefinementCriterion(productRefinerValue, refinementCriterion)\n );\n}\n\n/**\n * Find the refinement criterion associated with this product refiner value.\n * @param productRefinerValue Product refiner value to match.\n * @param refinementCriteria Selected refinement criteria.\n * @param refinementCriterion\n */\nexport function isMatchingRefinementCriterion(\n productRefinerValue: ProductRefinerValue,\n refinementCriterion: ProductRefinerValue\n): boolean {\n // If the value is a range, then match only on data type value; otherwise match on item string\n return refinementCriterion.RefinerRecordId === productRefinerValue.RefinerRecordId &&\n refinementCriterion.RefinerSourceValue === productRefinerValue.RefinerSourceValue &&\n refinementCriterion.DataTypeValue === productRefinerValue.DataTypeValue &&\n (isRangeType(refinementCriterion.DataTypeValue) || refinementCriterion.LeftValueBoundString === productRefinerValue.LeftValueBoundString);\n}\n\nexport function getUpdatedRefinementCriteria(\n itemToggleNotification: IRefineItemToggleNotification,\n currentRefinementCriteria: ProductRefinerValue[]): ProductRefinerValue[] {\n const updatedRefinementCriteria: ProductRefinerValue[] = [];\n let toggledItemFound = false;\n currentRefinementCriteria.forEach((selectedCriterion: ProductRefinerValue) => {\n if (isMatchingRefinementCriterion(itemToggleNotification.productRefinerValue, selectedCriterion)) {\n toggledItemFound = true;\n if (itemToggleNotification.isSelecting) {\n const next = {\n ...selectedCriterion,\n LeftValueBoundString: itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}` || selectedCriterion.LeftValueBoundString,\n RightValueBoundString: itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}` || selectedCriterion.RightValueBoundString\n };\n updatedRefinementCriteria.push(next);\n\n } // Else the item is being de-selected, so omit it from the refinement criteria\n } else {\n // Keep existing criterion because it is not in the item toggle notification\n updatedRefinementCriteria.push(selectedCriterion);\n }\n });\n\n if (!toggledItemFound) {\n const next = {\n ...itemToggleNotification.productRefinerValue,\n LeftValueBoundString: itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}` || itemToggleNotification.productRefinerValue.LeftValueBoundString,\n RightValueBoundString: itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}` || itemToggleNotification.productRefinerValue.RightValueBoundString\n };\n updatedRefinementCriteria.push(next);\n\n // If single select, then deselect any others in the parent refiner group\n if ((itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.Text || itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.TrueFalse) &&\n itemToggleNotification.parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect) {\n itemToggleNotification.parentProductRefinerHierarchy.Values.forEach((child: ProductRefinerValue) => {\n if (child.RefinerRecordId === next.RefinerRecordId && child.LeftValueBoundString === next.LeftValueBoundString) {\n // Do nothing\n } else {\n const matchingIndex = updatedRefinementCriteria.findIndex((criterion: ProductRefinerValue) => isMatchingRefinementCriterion(child, criterion));\n if (matchingIndex > -1) {\n updatedRefinementCriteria.splice(matchingIndex, 1);\n }\n }\n });\n }\n }\n\n return updatedRefinementCriteria;\n}\n\nexport function formatPrice(\n amount: string | undefined,\n currency: string | undefined,\n locale: string | undefined,\n telemetry: ITelemetry): string {\n if (!amount || !currency) {\n telemetry.trace(`[refine-menu.utilities.formatPrice] could not format price for ${amount} ${currency}`);\n return amount || '';\n }\n const priceAmount = (amount && Number(amount)) || 0;\n let result: string;\n\n try {\n result = new Intl.NumberFormat(locale, {\n style: 'currency',\n currencyDisplay: 'symbol',\n currency,\n minimumFractionDigits: 0\n }).format(priceAmount);\n } catch (error) {\n result = `${priceAmount} ${currency}`;\n telemetry.warning(`[refine-menu.utilities.formatPrice] Failed to format price for ${result}: ${error}`);\n }\n\n return result;\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductDimensionConfigureDropdownViewProps, IProductDimensionConfigureViewProps } from '@msdyn365-commerce/components';\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IQuickOrderFormViewProps } from './components';\nimport { IQuickOrderViewProps } from './quick-order';\n\n/**\n * Render product dimension/configure container.\n * @param configure -- Product dimension configuration.\n * @returns Container to have dimension dropdown.\n */\nconst renderConfigure = (configure?: IProductDimensionConfigureViewProps): JSX.Element | null => {\n if (configure !== undefined) {\n const { containerProps, dropdowns } = configure;\n\n return (\n \n {dropdowns.map(renderConfigureDropdown)}\n \n );\n }\n return null;\n\n};\n\n/**\n * Render product dimension/configure dropdown.\n * @param dropdown -- Product dimension drop down.\n * @returns Dropdown.\n */\nconst renderConfigureDropdown = (dropdown: IProductDimensionConfigureDropdownViewProps): JSX.Element => {\n const { containerProps, labelContainerProps, heading, errors, select } = dropdown;\n\n return (\n \n \n {heading}\n \n {errors}\n {select}\n \n );\n};\n\nconst renderForm = (form: IQuickOrderFormViewProps, isMobileView: boolean, quickOrderForm: INodeProps, quickOrderProductContent: INodeProps, quickOrderMsgContent: INodeProps, configure?: IProductDimensionConfigureViewProps) => {\n return isMobileView ? (\n \n \n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n \n {form.userMessage}\n \n {form.addToCartBtn}\n \n \n ) : (\n \n \n {form.userMessage}\n \n \n {form.product}\n {renderConfigure(configure)}\n {form.quantity}\n {form.addToCartBtn}\n \n \n );\n};\n\nconst quickOrderView: React.FC = props => {\n const {\n isB2B,\n quickOrderProps,\n contentProps,\n form,\n quickOrderForm,\n drawer,\n configure,\n quickOrderFormProductContent,\n quickOrderFormMsgContent,\n quickOrderList,\n isMobileView\n } = props;\n\n return isB2B ? (\n \n \n \n {renderForm(form as IQuickOrderFormViewProps, isMobileView, quickOrderForm,\n quickOrderFormProductContent, quickOrderFormMsgContent, configure)}\n \n \n\n {quickOrderList}\n \n ) : null;\n};\nexport default quickOrderView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { format, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { createRatingsReviewsStateInput } from '../../actions/ratings-reviews-state-data-action';\nimport { AverageRatingNumber, HistogramItems, IHistogramItemViewProps, TotalReviews } from './component/components';\nimport { IRatingsHistogramData } from './ratings-histogram.data';\nimport { IRatingsHistogramProps } from './ratings-histogram.props.autogenerated';\n\nexport interface IRatingsHistogramViewProps extends IRatingsHistogramProps {\n className: string;\n histogramItems: IHistogramItemViewProps[];\n moduleProps: IModuleProps;\n heading: React.ReactNode;\n averageRating: React.ReactNode;\n averageNumber: React.ReactNode;\n totalReviews: React.ReactNode;\n histogramProps: INodeProps;\n ratingsSummaryProps: INodeProps;\n callbacks: IRatingsHistogramCallbacks;\n}\n\nexport interface IRatingsHistogramCallbacks {\n selectFilterBy(stars: number): void;\n}\n\n/**\n * RatingsHistogram component.\n * @extends {React.Component>}\n */\n@observer\nclass RatingsHistogram extends React.PureComponent> {\n\n constructor(props: IRatingsHistogramProps) {\n super(props);\n this.selectFilterBy = this.selectFilterBy.bind(this);\n }\n\n public render(): JSX.Element | null {\n const { resources } = this.props;\n const { className, heading } = this.props.config;\n const { ratingsSummary: { result: ratingsSummary } } = this.props.data;\n const ratingCount = ratingsSummary && ratingsSummary.totalRatingsCount ? `${ratingsSummary.totalRatingsCount}` : '0';\n\n const completeClass = classname('ms-ratings-histogram', className);\n const viewProps: IRatingsHistogramViewProps = {\n ...this.props,\n className: completeClass,\n callbacks: {\n selectFilterBy: this.selectFilterBy\n },\n moduleProps: {\n moduleProps: this.props,\n className: completeClass\n },\n histogramItems: ratingsSummary ? HistogramItems({ ratingsSummary, resources: { ...resources }, locale: this.props.context.request.locale, onClick: this.selectFilterBy }) : [],\n averageRating: ratingsSummary && (\n \n ),\n averageNumber: ratingsSummary && ,\n totalReviews: ratingsSummary && ,\n ratingsSummaryProps: { className: 'ms-ratings-histogram__summary' },\n heading: heading && (\n \n ),\n histogramProps: { className: 'ms-ratings-histogram__histogram' }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n public selectFilterBy(stars: number): void {\n const filterKey = `${stars}`;\n this.props.context.actionContext.update(createRatingsReviewsStateInput({ filterKey }), { filterKey });\n }\n}\n\nexport default RatingsHistogram;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IWishlistItemDimension {\n key: string;\n className?: string;\n dimensionType: string;\n dimensionValue: string;\n}\n\nexport const WishlistItemDimension: React.FC = ({ key, className, dimensionType, dimensionValue }) => (\n
\n \n {dimensionType}\n :\n \n \n {dimensionValue}\n \n
\n);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IAny, ICoreContext, IGeneric, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { CommerceListLine, ProductPrice, ReleasedProductType, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getFallbackImageUrl, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IWishlistItemActionMessageState } from '../wishlist-items';\nimport { WishlistItemDimension } from './wishlist-items-dimensions';\n\nexport interface IWishlistItemProps extends CommerceListLine {\n product: SimpleProduct;\n wishlistState: IWishlistItemActionMessageState;\n price?: ProductPrice;\n context: ICoreContext>;\n productUrl: string;\n imageSettings?: IImageSettings;\n removeFromWishlistText: string;\n isInStock: boolean;\n addToCartText: string;\n outOfStockText: string;\n index: number;\n itemKey: string;\n telemetry: ITelemetry;\n moduleId: string;\n moduleTypeName: string;\n enableImageProductLink?: boolean;\n inventoryInformationLabel?: string;\n inventoryLabelClassName?: string;\n telemetryContent?: ITelemetryContent;\n handlers: {\n onAddToCart(product: SimpleProduct, itemKey: string): void;\n onRemoveItem(productId: number): void | undefined;\n onDismiss(): void;\n };\n resources: {\n productDimensionTypeColor: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n originalPriceText: string;\n currentPriceText: string;\n freePriceText: string;\n };\n}\n\nexport interface IWishlistItemViewProps {\n key: string;\n productImage: React.ReactNode;\n productLink: React.ReactNode;\n productDimensions?: React.ReactNode[];\n productPrice?: React.ReactNode;\n addToCartButton?: React.ReactNode;\n removeButton?: React.ReactNode;\n productStatusMessage?: React.ReactNode;\n productName?: React.ReactNode;\n productAriaLabel?: string;\n entireProductLink?: string;\n inventoryInformation?: React.ReactNode;\n productUnitOfMeasure?: React.ReactNode;\n}\n\nconst _addItemToCart = (props: IWishlistItemProps): void => {\n const { product, itemKey, handlers } = props;\n const { onAddToCart } = handlers;\n\n onAddToCart && product && itemKey && onAddToCart(product, itemKey);\n};\n\nconst _removeItemFromWishlist = (props: IWishlistItemProps): void => {\n const { onRemoveItem } = props.handlers;\n const { RecordId } = props.product;\n\n onRemoveItem && RecordId && onRemoveItem(RecordId);\n};\n\nconst WishListItemActions = {\n addToCart: _addItemToCart,\n removeItem: _removeItemFromWishlist\n};\n\nconst _renderAriaLabel = (props: IWishlistItemProps): string => {\n const { product, price, context, resources } = props;\n\n const { Name, Dimensions } = product;\n const { productDimensionTypeColor, productDimensionTypeSize, productDimensionTypeStyle } = resources;\n\n let formattedPrice = 'Free';\n let dimensions = null;\n\n if (price) {\n formattedPrice = price.BasePrice === 0 ? resources.freePriceText : context.cultureFormatter.formatCurrency(price.BasePrice!, price.CurrencyCode);\n }\n\n if (Dimensions) {\n dimensions = Dimensions.map(productDimension => {\n switch (productDimension.DimensionTypeValue) {\n case 1:\n return (`${productDimensionTypeColor}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n case 3:\n return (`${productDimensionTypeSize}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n case 4:\n return (`${productDimensionTypeStyle}${productDimension.DimensionValue && productDimension.DimensionValue.Value}`);\n default:\n return '';\n }\n });\n }\n\n return (`${Name} ${formattedPrice} ${dimensions && dimensions.join('') || ''}`);\n};\n\n/**\n * Renders a link to a product based on the given props.\n * @param input - Wishlist item props with the info about the product.\n * @returns React component with a link to a product.\n */\nconst renderProductLink = (input: IWishlistItemProps) => {\n const { productUrl, telemetryContent } = input;\n const { RecordId: recordId, Name: productName } = input.product;\n const payLoad = getPayloadObject('click', telemetryContent!, '', recordId.toString());\n const productAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return !StringExtensions.isNullOrWhitespace(productUrl) &&\n (\n \n {productName}\n \n );\n};\n\n/**\n * Renders a product name box.\n * @param productName - The text to display.\n * @returns React component with a name of a product.\n */\nconst renderProductName = (productName: string) => {\n return (\n
\n {productName}\n
\n );\n};\n\n/**\n * Renders inventory information.\n * @param inventoryInformationLabel - The text to display.\n * @param inventoryLabelClassName - The component class name.\n * @returns React component.\n */\nconst renderInventoryInformationLabel = (inventoryInformationLabel: string | undefined, inventoryLabelClassName: string | undefined) => {\n const inventoryCssName = inventoryLabelClassName ? `ms-wishlist-items__inventory-label ${inventoryLabelClassName}` : 'ms-wishlist-items__inventory-label';\n return !StringExtensions.isNullOrWhitespace(inventoryInformationLabel) && (\n \n {inventoryInformationLabel}\n \n );\n};\n\n/**\n * Renders add to cart button.\n * @param input - Wishlist item props with the configuration.\n * @returns React component.\n */\nconst WishlistItemAddToCartButtonComponent = (input: IWishlistItemProps) => {\n const { isInStock, addToCartText, outOfStockText } = input;\n\n // Check if the product is service or not by product type.\n const isServiceItem = input.product.ItemTypeValue === ReleasedProductType.Service;\n\n const addItemAction = React.useCallback(() => {\n WishListItemActions.addToCart(input);\n }, [input]);\n\n return (\n \n { (isServiceItem || isInStock) && addToCartText || outOfStockText }\n \n );\n};\n\n/**\n * Renders remove from wishlist button.\n * @param input - Wishlist item props with the configuration.\n * @returns React component.\n */\nconst WishlistItemRemoveFromWishlistButtonComponent = (input: IWishlistItemProps) => {\n const { removeFromWishlistText } = input;\n\n const removeItemAction = React.useCallback(() => {\n WishListItemActions.removeItem(input);\n }, [input]);\n\n return (\n \n );\n};\n\n/**\n * Gets the react node for product unit of measure display.\n * @param context - Module context.\n * @param unitOfMeasure - Product unit of measure.\n * @returns The node representing markup for unit of measure component.\n */\nconst renderUnitOfMeasure = (context: ICoreContext>, unitOfMeasure?: string) => {\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (context.app.config && (!context.app.config.unitOfMeasureDisplayType || context.app.config.unitOfMeasureDisplayType === 'none')) {\n return undefined;\n }\n\n if (!unitOfMeasure) {\n return undefined;\n }\n\n return (\n
\n \n {unitOfMeasure}\n \n
\n );\n};\n\nexport const WishlistItem = (input: IWishlistItemProps): IWishlistItemViewProps | null => {\n const { product, productUrl, price, context, imageSettings,\n wishlistState, itemKey, handlers, inventoryInformationLabel, enableImageProductLink, inventoryLabelClassName } = input;\n\n if (!product) {\n return null;\n }\n\n const { RecordId, Name, PrimaryImageUrl, Dimensions } = product;\n\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\n\n return {\n key: `${RecordId}-item`,\n productImage: PrimaryImageUrl && Name && _renderProductImage(context, product.Name!, PrimaryImageUrl, fallbackImage, imageSettings),\n productLink: renderProductLink(input),\n productDimensions: Dimensions && _renderProductDimensions(input),\n productPrice: price && _renderPrice(input),\n productUnitOfMeasure: product.DefaultUnitOfMeasure && renderUnitOfMeasure(context, product.DefaultUnitOfMeasure),\n entireProductLink: enableImageProductLink ? productUrl : undefined,\n productAriaLabel: enableImageProductLink ? _renderAriaLabel(input) : undefined,\n productName: enableImageProductLink && Name && renderProductName(Name),\n\n addToCartButton: ,\n inventoryInformation: renderInventoryInformationLabel(inventoryInformationLabel, inventoryLabelClassName),\n removeButton: ,\n productStatusMessage: wishlistState && wishlistState.isOpen &&\n wishlistState.productId === RecordId && wishlistState.itemKey === itemKey &&\n (\n
\n \n \n {wishlistState.userMessage}\n \n \n
\n )\n };\n};\n\nconst _renderProductImage = (context: ICoreContext, heading: string, image?: string, fallbackImage?: string, imageSettings?: IImageSettings): JSX.Element | null => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=315&h=315&m=6', w: 0, h: 0 },\n lg: { q: 'w=315&h=315&m=6', w: 0, h: 0 },\n xl: { q: 'w=315&h=315&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n if (image) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderPrice = (props: IWishlistItemProps): JSX.Element | null => {\n const { price, context, moduleId, moduleTypeName, resources } = props;\n\n if (price) {\n return (\n \n );\n }\n return null;\n};\n\nconst _renderProductDimensions = (props: IWishlistItemProps): (React.ReactNode | undefined)[] => {\n const { product, resources } = props;\n\n if (!product || !product.Dimensions) {\n return [];\n }\n\n return product.Dimensions.map((dimension, index) => {\n if (!dimension.DimensionValue || !dimension.DimensionValue.Value) {\n return undefined;\n }\n\n let type = '';\n\n switch (dimension.DimensionTypeValue) {\n case 1: {\n type = resources.productDimensionTypeColor;\n break;\n }\n case 3: {\n type = resources.productDimensionTypeSize;\n break;\n }\n case 4: {\n type = resources.productDimensionTypeStyle;\n break;\n }\n default:\n return undefined;\n }\n\n return (\n \n );\n });\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { wishlistStatus } from '../wishlist-items';\n\nexport interface IWishlistItemsStatusMessageProps {\n className?: string;\n errorType: wishlistStatus;\n text?: string;\n}\n\nexport const WishlistItemsStatusMessage: React.FC = ({ className, errorType, text }) => {\n switch (errorType) {\n case 'EMPTY':\n return (\n

\n { text }\n

\n );\n case 'FAILED':\n return (\n

\n { text }\n

\n );\n case 'LOADING':\n default:\n return (\n

\n { text }\n

\n );\n }\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { AsyncResult, CommerceList, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { createGetByCustomerInput, removeLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CommerceListsDataActions.g';\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ArrayExtensions, getProductUrlSync, IProductInventoryInformation, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport getItemsInWishlists, { ActiveWishlistInput } from './actions/get-items-in-wishlists';\nimport { IWishlistItemViewProps, WishlistItem, WishlistItemsStatusMessage } from './components';\nimport { IWishlistItemsData } from './wishlist-items.data';\nimport { IHeadingData, IWishlistItemsProps } from './wishlist-items.props.autogenerated';\n\nexport interface IWishlistItemActionMessageState {\n productId: number;\n itemKey: string;\n userMessage: string;\n statusCssString: string;\n messageGlyph: string;\n isOpen: boolean;\n}\n\nexport type wishlistStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'EMPTY';\n\nexport interface IWishlistItemsViewProps extends IWishlistItemsProps {\n WishlistItems: IModuleProps;\n status?: wishlistStatus;\n statusMessage?: React.ReactNode;\n heading?: React.ReactNode;\n Products?: INodeProps;\n Product?: INodeProps;\n ProductDetails?: INodeProps;\n ProductDimensions?: INodeProps;\n products?: IWishlistItemViewProps[];\n telemetryContent?: ITelemetryContent;\n}\n\n/**\n *\n * WishlistItems component.\n * @extends {React.PureComponent, IWishlistItemActionMessageState>}\n */\n@observer\nclass WishlistItems extends React.Component, IWishlistItemActionMessageState> {\n\n private readonly telemetryContent: ITelemetryContent;\n\n constructor(props: IWishlistItemsProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public async componentDidMount(): Promise {\n this.setState({});\n }\n\n public shouldComponentUpdate(nextProps: IWishlistItemsProps,\n nextState: IWishlistItemActionMessageState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { heading, className } = this.props.config;\n const { emptyWishlistText, wishlistErrorGettingWishlist } = this.props.resources;\n const { cart, productAvailability, wishlists, products } = this.props.data;\n\n if (cart.status === 'LOADING' || productAvailability.status === 'LOADING' || wishlists.status === 'LOADING') {\n const errorProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className)\n },\n status: 'LOADING',\n\n // StatusMessage: \n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n return this.props.renderView(errorProps);\n }\n\n if (cart.status === 'FAILED' || productAvailability.status === 'FAILED' || wishlists.status === 'FAILED') {\n const errorProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className)\n },\n status: 'FAILED',\n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n\n return this.props.renderView(errorProps);\n }\n\n const productsList = products && (products as AsyncResult).result;\n\n if (productsList && productsList.length === 0) {\n const emptyViewProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className)\n },\n status: 'EMPTY',\n statusMessage: ,\n heading: this._renderHeading(heading)\n };\n\n return this.props.renderView(emptyViewProps);\n }\n\n const viewProps: IWishlistItemsViewProps = {\n ...(this.props as IWishlistItemsProps),\n WishlistItems: {\n moduleProps: this.props,\n className: classnames('ms-wishlist-items', className)\n },\n status: 'SUCCESS',\n heading: this._renderHeading(heading),\n Products: {\n className: 'ms-wishlist-items__products',\n tag: 'ul'\n },\n Product: {\n className: 'ms-wishlist-items__product',\n tag: 'li'\n },\n ProductDetails: {\n className: 'ms-wishlist-items__product-link',\n tag: 'a'\n },\n telemetryContent: this.telemetryContent,\n ProductDimensions: {\n className: 'ms-wishlist-items__product-dimensions'\n },\n products: productsList && this._renderProductList(productsList)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: MsDyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private _renderProductList(products: FullProduct[]): IWishlistItemViewProps[] {\n\n const { priceFree, originalPriceText, currentPriceText, addToCartButtonText, outOfStockText, removeButtonText, productDimensionTypeColor, productDimensionTypeSize, productDimensionTypeStyle, productDimensionTypeAmount } = this.props.resources;\n const { context, telemetry } = this.props;\n const { imageSettings, enableImageProductLink } = this.props.config;\n\n return products.map((product: FullProduct, index) => {\n const currentProductProps = {\n product: product.ProductDetails,\n price: product.ProductPrice,\n context,\n wishlistState: this.state,\n productUrl: getProductUrlSync(product.ProductDetails, context.actionContext, undefined),\n imageSettings,\n removeFromWishlistText: removeButtonText,\n isInStock: this._isProductInStock(product),\n addToCartText: addToCartButtonText,\n outOfStockText,\n index,\n itemKey: `${product.ProductDetails.RecordId}-${product.ProductDetails.ItemId}-${index}`,\n telemetry,\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n enableImageProductLink,\n inventoryInformationLabel: this._inventoryLabel(product),\n inventoryLabelClassName: this._inventoryClassName(product),\n telemetryContent: this.telemetryContent,\n handlers: {\n onAddToCart: this._addItemToCart,\n onRemoveItem: this._removeItemFromWishlist,\n onDismiss: this._onDismiss\n },\n resources: {\n productDimensionTypeColor,\n productDimensionTypeSize,\n productDimensionTypeStyle: product.ProductDetails.IsGiftCard ? productDimensionTypeAmount : productDimensionTypeStyle,\n freePriceText: priceFree,\n originalPriceText,\n currentPriceText\n }\n };\n\n return (\n WishlistItem(currentProductProps)!\n );\n });\n }\n\n // Dismiss alert when addingToCart/removeItem\n private readonly _onDismiss = () => {\n this.setState({\n isOpen: false\n });\n };\n\n private readonly _renderHeading = (heading?: IHeadingData): JSX.Element | undefined => {\n if (!heading) {\n return undefined;\n }\n return (\n \n );\n };\n\n private readonly _addItemToCart = async (product: SimpleProduct, itemKey: string): Promise => {\n const { context, data, resources, telemetry } = this.props;\n const { cart, productAvailability } = data;\n const { addedToCartSuccessMessage, addedToCartFailureMessage, invoiceInCartErrorMessage } = resources;\n\n const productInventoryInformation = this._getProductInventory({ ProductDetails: product }, productAvailability.result);\n\n if (context) {\n if (cart.result) {\n const isOrderQuantityLimitsFeatureEnabledInHq = this.props.data.featureState.result\n ?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n const customerInfo = this.props.data.customerInformation.result;\n\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all' ||\n (customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b)));\n\n // Check if the product delivery mode is electronic\n const emailDeliveryModeCode = this.props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n\n const deliveryOptions = await getDeliveryOptionsAsync(\n {\n callerContext: this.props.context.actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(this.props.context.actionContext)\n },\n [product.RecordId]);\n\n const isOrderQuantityLimitsFeatureEnabled = isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings;\n const addProductToCartInput = {\n product,\n quantity: 1,\n enableStockCheck: context.app.config.enableStockCheck,\n availableQuantity: productInventoryInformation ? productInventoryInformation.ProductAvailableQuantity.AvailableQuantity : 0,\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: isOrderQuantityLimitsFeatureEnabled },\n isAddEmailDeliveryItemToCart: ArrayExtensions.hasElements(deliveryOptions) && ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) && deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\n };\n\n cart.result.addProductToCart(addProductToCartInput)\n .then(async result => {\n if (result.status === 'SUCCESS') {\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: addedToCartSuccessMessage,\n statusCssString: 'success',\n messageGlyph: 'fas fa-check',\n isOpen: true\n });\n } else if (result.substatus === 'MAXQUANTITY') {\n const curQuantity = (await cart).cart?.CartLines?.find(item => item.ProductId === product.RecordId)?.Quantity || 0;\n const maxQtyLimitReachedMessage = this._getInventoryValueMessage(productInventoryInformation, curQuantity);\n\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: maxQtyLimitReachedMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n } else if (result.substatus === 'QUANTITYLIMITS' && isOrderQuantityLimitsFeatureEnabled) {\n const maxQtyLimitReachedMessage = result.errorDetails?.LocalizedMessage!;\n\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: maxQtyLimitReachedMessage || addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n } else if (result.substatus === 'INVOICEINCART') {\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: result.errorDetails?.LocalizedMessage || invoiceInCartErrorMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n } else {\n this.props.telemetry.debug('[wishlist-items] Unable to Update Cart Line from the wishlist');\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n }\n })\n .catch(error => {\n telemetry.warning(error);\n telemetry.debug('[wishlist-items] Error trying to Update Cart Line from the wishlist');\n this.setState({\n productId: product.RecordId,\n itemKey,\n userMessage: addedToCartFailureMessage,\n statusCssString: 'danger',\n messageGlyph: 'fas fa-exclamation-triangle',\n isOpen: true\n });\n });\n }\n }\n };\n\n private readonly _removeItemFromWishlist = (productId: number): void => {\n const { context, data, telemetry } = this.props;\n const { wishlists } = data;\n\n if (context && context.actionContext) {\n const userToken = context.request.user.isAuthenticated && context.request.user.token;\n const wishlistLineId = this._getWishlistLineIdFromProductId(productId);\n if (userToken && wishlists.result && wishlists.result[0] && wishlistLineId) {\n removeLinesAsync({ callerContext: context.actionContext }, wishlists.result[0].Id, [{ LineId: wishlistLineId }])\n .then(commerceList => {\n const castCommerceList: CommerceList | null = commerceList as (CommerceList | null);\n\n if (castCommerceList && castCommerceList.Id && context.request.user.isAuthenticated) {\n context.actionContext.update(createGetByCustomerInput({}, null), [castCommerceList]);\n getItemsInWishlists(new ActiveWishlistInput(), context.actionContext)\n .then((products) => {\n const castSimpleProducts: FullProduct[] | null = products as (FullProduct[] | null);\n if (castSimpleProducts && castSimpleProducts.length > 0) {\n context.actionContext.update(new ActiveWishlistInput(), castSimpleProducts);\n }\n })\n .catch(error => {\n telemetry.warning('[wishlist-items] Unable to hyderate the wishlist with product information');\n telemetry.error(error);\n });\n }\n })\n .catch(error => {\n telemetry.warning('[wishlist-items] Unable remove items from the wishlist');\n telemetry.error(error);\n });\n } else {\n telemetry.warning('[wishlist-items] Unable remove items from the wishlist user token or lineItemID wasn\\'t found');\n }\n }\n };\n\n private _getInventoryValueMessage(product: IProductInventoryInformation | undefined, curQuantity: number): string {\n const { context, resources } = this.props;\n const { maxQuantityLimitText } = resources;\n\n const maxQuantityForLineItem = context.app.config.maxQuantityForCartLineItem || 10;\n\n if (!product || !product.ProductAvailableQuantity.AvailableQuantity || !context.app.config.enableStockCheck) {\n return maxQuantityLimitText.replace('{maxQuantity}', maxQuantityForLineItem.toString()).replace('{curQuantity}', curQuantity.toString());\n }\n\n const minInventory = Math.min(maxQuantityForLineItem, product.ProductAvailableQuantity.AvailableQuantity);\n\n return maxQuantityLimitText.replace('{maxQuantity}', minInventory.toString()).replace('{curQuantity}', curQuantity.toString());\n }\n\n private _getProductInventory(product: FullProduct, productInventoryCollection: IProductInventoryInformation[] | undefined): IProductInventoryInformation | undefined {\n if (productInventoryCollection && productInventoryCollection.length > 0) {\n for (const productResult of productInventoryCollection) {\n if (product.ProductDetails.RecordId === productResult.ProductAvailableQuantity.ProductId) {\n return productResult;\n }\n }\n }\n return undefined;\n }\n\n private readonly _inventoryLabel = (product: FullProduct): string | undefined => {\n const { productAvailability } = this.props.data;\n if (productAvailability && productAvailability.result) {\n const productInventoryInformation = this._getProductInventory(product, productAvailability.result);\n if (productInventoryInformation) {\n return productInventoryInformation.StockLevelLabel;\n }\n }\n\n return undefined;\n };\n\n private readonly _inventoryClassName = (product: FullProduct): string | undefined => {\n const { productAvailability } = this.props.data;\n if (productAvailability && productAvailability.result) {\n const productInventoryInformation = this._getProductInventory(product, productAvailability.result);\n if (productInventoryInformation && productInventoryInformation.StockLevelCode) {\n return `ms-wishlist-items__${productInventoryInformation.StockLevelCode.toLowerCase()}`;\n }\n }\n\n return undefined;\n };\n\n private readonly _isProductInStock = (product: FullProduct): boolean => {\n const { data, context } = this.props;\n const { productAvailability } = data;\n\n if (!context.app.config.enableStockCheck) {\n return true;\n }\n\n if (!productAvailability.result || !product.ProductDetails) {\n return false;\n }\n\n for (const productResult of productAvailability.result) {\n if (productResult.ProductAvailableQuantity &&\n productResult.ProductAvailableQuantity.ProductId &&\n productResult.ProductAvailableQuantity.ProductId === product.ProductDetails.RecordId) {\n return productResult.IsProductAvailable;\n }\n }\n\n return false;\n };\n\n private readonly _getWishlistLineIdFromProductId = (productId: number): number | null => {\n const { wishlists } = this.props.data;\n\n if (!wishlists.result || wishlists.result.length === 0 || !wishlists.result[0].CommerceListLines || wishlists.result[0].CommerceListLines.length === 0) {\n this.props.telemetry.error('Wishlist content is empty, module wont render.');\n return null;\n }\n\n const foundWishlistItem = wishlists.result[0].CommerceListLines.filter((commerceListLine) => {\n return commerceListLine.ProductId === productId;\n });\n\n if (foundWishlistItem && foundWishlistItem[0].LineId) {\n return foundWishlistItem[0].LineId;\n }\n return null;\n\n };\n}\n\nexport default WishlistItems;\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\n/* eslint-disable no-duplicate-imports */\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, OrgUnitLocation, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IPickUpInStoreViewProps {\r\n callbacks: {\r\n toggleBopis(isBopisSelected: boolean): void;\r\n };\r\n defaultComponent?: React.ReactNode;\r\n orgUnitName?: string;\r\n isBopisSelected: boolean;\r\n ContainerProps: INodeProps;\r\n deliveryOption?: string;\r\n}\r\n\r\nexport interface IPickUpInStoreProps {\r\n cartline: CartLine;\r\n product: SimpleProduct;\r\n shipitText: string;\r\n pickUpInStoreText: string;\r\n changeStoreText: string;\r\n cartState: ICartState | undefined;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n orgUnitLocations?: OrgUnitLocation[] | undefined;\r\n deliveryOptions?: ProductDeliveryOptions;\r\n pickupDeliveryModeCode?: string;\r\n storeSelectorModuleId?: string;\r\n locationChangedHandler(): void;\r\n}\r\n\r\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\r\n const _onLocationChangedCallback = async (\r\n orgUnitLocation: OrgUnitLocation,\r\n cartState: ICartState | undefined,\r\n cartline: CartLine,\r\n deliveryMode?: string\r\n ) => {\r\n if (!cartState) {\r\n return Promise.resolve();\r\n }\r\n return cartState\r\n .updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {});\r\n };\r\n\r\n const _toggleBOPIS = (isBopisSelected: boolean) => {\r\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\r\n\r\n if (isBopisSelected) {\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n storeSelectorStateManager\r\n .openDialog({\r\n id: storeSelectorModuleId,\r\n product,\r\n alreadySelectedLocation: {\r\n OrgUnitNumber: cartline.FulfillmentStoreId\r\n },\r\n deliveryOptions: props.deliveryOptions,\r\n onLocationSelected: async (orgUnitLocation, deliveryMode: string | undefined) => {\r\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\r\n }\r\n })\r\n .catch(error => {});\r\n } else {\r\n if (!cartState) {\r\n return;\r\n }\r\n cartline.DeliveryMode = '';\r\n cartline.FulfillmentStoreId = '';\r\n cartline.ShippingAddress = {};\r\n cartState\r\n .clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {});\r\n }\r\n };\r\n\r\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n };\r\n\r\n const _renderShippingMethod = (\r\n cartLine: CartLine,\r\n shipItText: string,\r\n pickupInStoretext: string,\r\n changeStoreText: string,\r\n orgUnitLocations: OrgUnitLocation[] | undefined\r\n ): JSX.Element => {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\r\n const bopisSelected = !!cartLine.FulfillmentStoreId;\r\n\r\n const toggleBOPIS = (isBopisSelected: boolean) => {\r\n return () => {\r\n _toggleBOPIS(isBopisSelected);\r\n };\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {cartLine.FulfillmentStoreId ? (\r\n
\r\n {orgUnitName}\r\n \r\n
\r\n ) : null}\r\n \r\n );\r\n };\r\n\r\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\r\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\r\n return delivery?.Description;\r\n };\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (\r\n !props.deliveryOptions ||\r\n !props.deliveryOptions.DeliveryOptions ||\r\n !props.pickupDeliveryModeCode ||\r\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n callbacks: {\r\n toggleBopis: _toggleBOPIS\r\n },\r\n defaultComponent: _renderShippingMethod(\r\n props.cartline,\r\n props.shipitText,\r\n props.pickUpInStoreText,\r\n props.changeStoreText,\r\n props.orgUnitLocations\r\n ),\r\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\r\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\r\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\r\n ContainerProps: {\r\n className: 'msc-cart-line__bopis-container'\r\n }\r\n };\r\n};\r\n","import { CartLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { assembleUrlParams } from '../experlogix-d365commerce-core/urlUtilities';\r\n\r\nconst cartLineExtensionProperty_ExperlogixConfigurationId = 'ExperlogixConfigurationId';\r\n\r\nexport interface IExperlogixModifyCartLineButtonProps {\r\n cartLine: CartLine;\r\n labelText: string;\r\n productUrl: string | undefined;\r\n}\r\n\r\nexport default class ExperlogixModifyCartLineButton extends React.PureComponent {\r\n public render(): JSX.Element | null {\r\n const { cartLine, labelText, productUrl } = this.props;\r\n // If there is no product, there's nothing configurable about this line\r\n if (!productUrl) {\r\n return null;\r\n }\r\n\r\n // If there is no product line id, this is weird, probably impossible, and may herald the end of all things.\r\n if (!cartLine.LineId) {\r\n return null;\r\n }\r\n\r\n // Check to see that this CartLine is configured\r\n if (!cartLine.ExtensionProperties?.find(p => p.Key === cartLineExtensionProperty_ExperlogixConfigurationId)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {labelText}\r\n \r\n );\r\n }\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\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToOrderTemplateComponent,\r\n AddToWishlistComponent,\r\n CartLineItemComponent,\r\n IAddToOrderTemplateDialogResources,\r\n ICartlineResourceString,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionSuccessResult\r\n} from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IGridSettings, IImageSettings, ITelemetry, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CommerceList,\r\n Customer,\r\n LineDataValidationFailure,\r\n OrgUnitLocation,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ProductDimensionType, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport {\r\n getInvoiceDetailsPageUrlSync,\r\n getProductUrlSync,\r\n IProductInventoryInformation,\r\n ObjectExtensions,\r\n OrderTemplate\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IPickUpInStoreViewProps, PickUpInStore } from './poc-cart-pick-up-in-store';\r\n\r\n// Experlogix components\r\nimport ExperlogixModifyCartLineButton from '../../../experlogix-d365commerce-ux/modifyCartLineButton';\r\n\r\nexport interface ICartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartlinesErrors: LineDataValidationFailure[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n\r\n /** GridSettings for the product image in cartline */\r\n gridSettings: IGridSettings;\r\n\r\n /** ImageSettings for the product image in cartline */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n shipItText: string;\r\n pickitUpText: string;\r\n changeStoreText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n isStockCheckEnabled: boolean;\r\n wishlists: CommerceList[] | undefined;\r\n defaultWishlistName: string;\r\n maxCartlineQuantity: number;\r\n includeErrors?: boolean;\r\n showShippingChargesForLineItems?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n storeSelectorModuleId?: string;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\r\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\r\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\r\n\r\n addToOrderTemplateButtonText: string;\r\n addToOrderTemplateButtonTooltip: string;\r\n addToOrderTemplateMessage: string;\r\n addItemToOrderTemplateError: string;\r\n orderTemplates: OrderTemplate[] | undefined;\r\n customerInformation: Customer | undefined;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number): boolean;\r\n locationChangedHandler(): void;\r\n\r\n // Experlogix components\r\n experlogixModifyText: string;\r\n}\r\n\r\nexport interface ICartlinesViewProps {\r\n cartline: React.ReactNode;\r\n pickUpInStore?: IPickUpInStoreViewProps;\r\n remove: React.ReactNode;\r\n addToWishlist: React.ReactNode | undefined;\r\n addToOrderTemplate: React.ReactNode | undefined;\r\n\r\n // Experlogix components\r\n experlogixModify: React.ReactNode | undefined;\r\n\r\n error?: string;\r\n cartlineId?: string;\r\n data?: {\r\n product?: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getProduct = (productId: number | undefined, products?: SimpleProduct[]): SimpleProduct | undefined => {\r\n if (productId !== undefined && products) {\r\n return products.find(product => {\r\n return productId === product.RecordId;\r\n });\r\n }\r\n return undefined;\r\n};\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n productAvailability: IProductInventoryInformation | undefined\r\n): number => {\r\n if (\r\n !isStockCheckEnabled ||\r\n !productAvailability ||\r\n !productAvailability.ProductAvailableQuantity ||\r\n !productAvailability.IsProductAvailable ||\r\n !productAvailability.ProductAvailableQuantity.AvailableQuantity\r\n ) {\r\n return 0;\r\n }\r\n\r\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\nconst _getErrorMessage = (\r\n availableQuantityInStock: number,\r\n currentQuantity: number,\r\n props: ICartLineItemsProps,\r\n lineIndex: number,\r\n isServiceItem: boolean\r\n): string | undefined => {\r\n const finalErrorMessages: string[] = [];\r\n if (props.includeErrors) {\r\n if (props.isStockCheckEnabled && !isServiceItem) {\r\n if (availableQuantityInStock <= 0) {\r\n finalErrorMessages.push(props.outOfStockText);\r\n } else if (availableQuantityInStock < currentQuantity) {\r\n if (availableQuantityInStock === 1) {\r\n finalErrorMessages.push(props.outOfRangeOneText);\r\n } else {\r\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Server-side validation\r\n props.cartlinesErrors\r\n .filter(i => i.LineIndex === lineIndex)\r\n .forEach(i => {\r\n if (i.DataValidationFailure?.ErrorContext) {\r\n finalErrorMessages.push(i.DataValidationFailure.ErrorContext);\r\n }\r\n });\r\n\r\n if (finalErrorMessages.length > 0) {\r\n return finalErrorMessages.join(' ');\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\n// eslint-disable-next-line complexity -- Auto-suppressed.\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct | undefined,\r\n props: ICartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: IProductInventoryInformation,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): ICartlinesViewProps => {\r\n const {\r\n imageSettings,\r\n gridSettings,\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n removeButtonText,\r\n removeItemClickHandler,\r\n moveToWishlistSuccessHandler,\r\n addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateDialogResources,\r\n createOrderTemplateDialogResources,\r\n itemAddedToOrderTemplateDialogResources,\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n addToWishlistButtonText,\r\n removeFromWishlistButtonText,\r\n orderTemplates,\r\n customerInformation,\r\n wishlists,\r\n defaultWishlistName,\r\n storeSelectorModuleId\r\n } = props;\r\n\r\n const isAuthenticated = context.request.user.isAuthenticated;\r\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(props.isStockCheckEnabled, foundProductAvailability);\r\n\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isServiceItem = product?.ItemTypeValue === PRODUCTASSERVICE;\r\n\r\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\r\n ? undefined\r\n : _getErrorMessage(availableQuantityInStock, cartline.Quantity!, props, index, isServiceItem);\r\n\r\n const onRemoveClickHandler = (event: React.MouseEvent) => {\r\n removeItemClickHandler(cartline);\r\n };\r\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n\r\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\r\n const inventoryCode = foundProductAvailability\r\n ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}`\r\n : undefined;\r\n const productDimension = 4;\r\n const customPriceDimensionType = productDimension as ProductDimensionType.Style;\r\n const isCustomPriceSelected =\r\n product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === customPriceDimensionType)?.DimensionValue?.Value ===\r\n 'Custom';\r\n\r\n // Experlogix components\r\n const cartLineExtensionProperty_ExperlogixConfigurationId = 'ExperlogixConfigurationId';\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n cartlineId: cartline.LineId,\r\n error: errorMessage,\r\n cartline: (\r\n p.Key === cartLineExtensionProperty_ExperlogixConfigurationId)\r\n }\r\n quantityOnChange={props.updateCartLinesQuantitySuccessHandler}\r\n primaryImageUrl={product?.PrimaryImageUrl}\r\n errorMessage={errorMessage}\r\n inventoryInformationLabel={inventoryLbl}\r\n inventoryLabelClassName={inventoryCode}\r\n isCartStateReady={props.cartState?.status === 'READY'}\r\n showShippingChargesForLineItems={props.showShippingChargesForLineItems}\r\n telemetryContent={props.telemetryContent}\r\n channelDeliveryOptionConfig={props.channelDeliveryOptionConfig}\r\n />\r\n ),\r\n pickUpInStore: product\r\n ? PickUpInStore({\r\n storeSelectorModuleId,\r\n cartState: props.cartState,\r\n cartline,\r\n product,\r\n shipitText: props.shipItText,\r\n pickUpInStoreText: props.pickitUpText,\r\n changeStoreText: props.changeStoreText,\r\n storeSelectorStateManager: props.storeSelectorStateManager,\r\n orgUnitLocations: props.orgUnitLocations,\r\n deliveryOptions: foundProductDeliveryOptions,\r\n pickupDeliveryModeCode:\r\n cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\r\n locationChangedHandler: props.locationChangedHandler\r\n })\r\n : undefined,\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n addToWishlist:\r\n isAuthenticated && product && !isCustomPriceSelected ? (\r\n \r\n ) : (\r\n undefined\r\n ),\r\n addToOrderTemplate:\r\n isAuthenticated && orderTemplates && product ? (\r\n \r\n ) : (\r\n undefined\r\n ),\r\n // Experlogix components\r\n experlogixModify: (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport const assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: ICartLineItemsProps\r\n): ICartlinesViewProps[] | null => {\r\n const reactNodes: ICartlinesViewProps[] = [];\r\n\r\n cartlines.map((cartline, index) => {\r\n const product = _getProduct(cartline.ProductId, products);\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return (\r\n productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId &&\r\n productAvailability.InventLocationId === cartline.WarehouseId\r\n );\r\n });\r\n }\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption));\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n * @param props\r\n */\r\nexport const CartLineItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return assembleCartlines(cartlines, products, props);\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\n/* eslint-disable no-duplicate-imports */\r\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport groupBy from 'lodash/groupBy';\r\n\r\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './poc-cart-line-items';\r\n\r\nconst _assembleGroupCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: ICartLineItemsProps\r\n): ICartlinesViewProps[][] | null => {\r\n const reactNodes: ICartlinesViewProps[][] = [];\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error('Products content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\r\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => item.DeliveryMode);\r\n const groupDelivery = getGroupByDelivery(cartlines);\r\n const cartLinesGroup: CartLine[] = [];\r\n\r\n // 1) Group by store and pick up mode\r\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\r\n // @ts-expect-error\r\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\r\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\r\n });\r\n\r\n // 2) Create cartlines group\r\n Object.keys(cartLinesGroup).forEach(key => {\r\n const cartLines = cartLinesGroup[key];\r\n Object.keys(cartLines).forEach(index => {\r\n const cartLine = cartLines[index];\r\n const carLineViewProps = assembleCartlines(cartLine, products, props);\r\n if (carLineViewProps !== null) {\r\n reactNodes.push(carLineViewProps);\r\n }\r\n });\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLine Group component.\r\n * @param props\r\n */\r\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleGroupCartlines(cartlines, products, props);\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\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * IPromotionData entity interface.\r\n */\r\nexport interface IPromotionData {\r\n promotionOptions?: CartPromotionLine[];\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns a promotion data.\r\n * @param ctx\r\n */\r\nexport async function getPromotionData(ctx: IActionContext): Promise {\r\n const promotionData: IPromotionData = {};\r\n\r\n await getPromotionOptionsForCartLineItems(new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\r\n .then(promotionOptions => {\r\n if (promotionOptions) {\r\n promotionData.promotionOptions = promotionOptions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n return {};\r\n });\r\n\r\n return promotionData;\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\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n ILinesAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionSuccessResult,\r\n PromoCodeComponent,\r\n SaveCartToOrderTemplateComponent\r\n} from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n AsyncResult,\r\n CartLine,\r\n CartLineValidationResults,\r\n LineDataValidationFailure,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { validateForCheckoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\r\nimport { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\r\nimport {\r\n ActiveCartProductsInput,\r\n ArrayExtensions,\r\n getActiveCartProductsAction,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Alert,\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n IPayLoad,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n Waiting\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\n\r\nimport { IPocCartData } from './poc-cart.data';\r\nimport { IPocCartProps, IPocCartResources } from './poc-cart.props.autogenerated';\r\nimport { CartLineGroupItems } from './components/poc-cart-line-groups';\r\nimport { CartLineItems, ICartlinesViewProps } from './components/poc-cart-line-items';\r\nimport { cartPromotions, ICartLineItemViewProps } from './components/poc-cart-line-items-promotion';\r\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-poc-cart';\r\n\r\nexport interface ICartViewProps extends IPocCartProps {\r\n className: string;\r\n title?: React.ReactNode;\r\n CartlinesWrapper: INodeProps;\r\n cartlines?: ICartlinesViewProps[];\r\n cartLinesGroup?: ICartlinesViewProps[][];\r\n cart: ICartState | undefined;\r\n orderSummaryHeading: React.ReactNode;\r\n orderSummaryLineitems?: IOrderSummaryLines;\r\n invoiceSummaryLineitems?: IInvoiceSummaryLines;\r\n OrderSummaryWrapper: INodeProps;\r\n OrderSummaryItems: INodeProps;\r\n OrderSummaryErrors?: IOrderSummaryErrors;\r\n checkoutAsGuestButton: React.ReactNode;\r\n checkoutAsSignInUserButton: React.ReactNode;\r\n storeSelector?: React.ReactNode;\r\n backToShoppingButton: React.ReactNode;\r\n waitingComponent: React.ReactNode;\r\n promotionOptions?: ICartLineItemViewProps;\r\n promoCode: React.ReactNode;\r\n cartLoadingStatus: string;\r\n cartDataResult: boolean;\r\n multiplePickUpEnabled?: boolean;\r\n createTemplateFromCartButton: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n}\r\n\r\nexport interface IOrderSummaryErrors {\r\n Wrapper: INodeProps;\r\n\r\n header: React.ReactNode;\r\n errors: React.ReactNode[];\r\n}\r\n\r\ninterface ICartComponentState {\r\n showPromotionDialog: boolean;\r\n cartlinesErrors: LineDataValidationFailure[];\r\n promotionData: IPromotionData;\r\n products: SimpleProduct[];\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass Cart extends React.Component> {\r\n public state: ICartComponentState = {\r\n cartlinesErrors: [],\r\n showPromotionDialog: false,\r\n promotionData: {},\r\n products: []\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n private isQuantityLimitsFeatureEnabled: boolean = false;\r\n\r\n private readonly promotionPopupId: string = 'cart-promotion-popup';\r\n\r\n constructor(props: IPocCartProps) {\r\n super(props);\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\r\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n config,\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n this.isQuantityLimitsFeatureEnabled = await this._getOrderQuantityLimitsFeatureFlag();\r\n if (this.isQuantityLimitsFeatureEnabled) {\r\n await this._validateCart();\r\n }\r\n try {\r\n const products = await this.props.data.products;\r\n this.setState({ products });\r\n } catch (error) {\r\n this.props.telemetry.warning(`${error}`);\r\n this.props.telemetry.debug('Unable to get cart');\r\n }\r\n\r\n if (config.showAvailablePromotions) {\r\n if (this.props.data.cart.result?.cart.CartLines) {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n );\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n products: { result: products }\r\n },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n },\r\n resources\r\n } = this.props;\r\n\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const backToShoppingUrl = getUrlSync('home', this.props.context.actionContext) || '';\r\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n const cartLines = this._getCartLines();\r\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n const multiplePickUpEnabled = !cart?.hasInvoiceLine && RetailMultiplePickupFeatureState?.IsEnabled;\r\n const cartLinesGroup = multiplePickUpEnabled ? this._getCartLinesGroup() : null;\r\n\r\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\r\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\r\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n const hasErrors = cartLines ? cartLines.some(cartline => cartline.error !== undefined) : false;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n className: classnames('ms-cart'),\r\n title:

{resources.cartTitle}

,\r\n cart: this.props.data.cart.result,\r\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\r\n OrderSummaryWrapper: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary-wrapper' : 'msc-order-summary-wrapper' },\r\n OrderSummaryItems: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary__items' : 'msc-order-summary__items' },\r\n cartlines: cartLines,\r\n cartLinesGroup,\r\n promoCode: this._getPromoCode(),\r\n promotionOptions: this._getPromotions(),\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n telemetry: this.props.telemetry,\r\n id: this.props.id,\r\n multiplePickUpEnabled,\r\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\r\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\r\n cart?.hasInvoiceLine ? (\r\n

{resources.invoiceSummaryTitle}

\r\n ) : (\r\n

{resources.orderSummaryTitle}

\r\n )\r\n ) : null,\r\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\r\n invoiceSummaryLineitems: this._getInvoiceSummaryLineItems(),\r\n checkoutAsSignInUserButton: !isCartEmpty ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n backToShoppingButton: (\r\n \r\n {resources.backToShoppingButtonTitle}\r\n \r\n ),\r\n createTemplateFromCartButton:\r\n this._displayAddCartToTemplate() && products ? (\r\n \r\n ) : null,\r\n storeSelector:\r\n this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n waitingComponent: ,\r\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\r\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\r\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\r\n telemetryContent: this.telemetryContent\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private readonly promotionLinkClick = () => {\r\n this.setState({\r\n showPromotionDialog: !this.state.showPromotionDialog\r\n });\r\n };\r\n\r\n private readonly promotionCloseButtonclick = () => {\r\n this._hidePromotionDialog();\r\n };\r\n\r\n private _hidePromotionDialog(): void {\r\n this.setState({\r\n showPromotionDialog: false\r\n });\r\n }\r\n\r\n private _displayAddCartToTemplate(): boolean {\r\n const cart = this.props.data.cart?.result;\r\n if (ObjectExtensions.isNullOrUndefined(cart) || cart.hasInvoiceLine) {\r\n return false;\r\n }\r\n\r\n const RetailB2BEcommerceFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailB2BEcommerceFeature'\r\n );\r\n if (\r\n RetailB2BEcommerceFeatureState?.IsEnabled &&\r\n this.props.data.customerInformation.result?.IsB2b &&\r\n this.props.data.orderTemplates.result &&\r\n ArrayExtensions.hasElements(cart.cart?.CartLines) &&\r\n this.props.data.customerInformation.result\r\n ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _getPromotions(): React.ReactNode {\r\n return (\r\n this.props.config.showAvailablePromotions &&\r\n cartPromotions({\r\n id: this.promotionPopupId,\r\n showPromotionPopup: this.state.showPromotionDialog,\r\n onSeeAllClick: this.promotionLinkClick,\r\n onCloseButtonClick: this.promotionCloseButtonclick,\r\n promotions: this.state.promotionData.promotionOptions,\r\n resources: {\r\n promotionStringHeading: this.props.resources.promotionStringHeading,\r\n promotionLinkText: this.props.resources.promotionLinkText,\r\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\r\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\r\n }\r\n })\r\n );\r\n }\r\n\r\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\r\n const allErrors =\r\n (cartLines &&\r\n cartLines\r\n .map(cartline => {\r\n // Check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isServiceItem = cartline.data?.product?.ItemTypeValue === PRODUCTASSERVICE;\r\n\r\n if (!isServiceItem && cartline.error) {\r\n const fullError =\r\n cartline.data && cartline.data.product?.Name\r\n ? `${cartline.data.product.Name}: ${cartline.error}`\r\n : cartline.error;\r\n\r\n return
{fullError}
;\r\n }\r\n\r\n return null;\r\n })\r\n .filter((line): line is JSX.Element => !!line)) ||\r\n [];\r\n\r\n return {\r\n Wrapper: {\r\n tag: Alert,\r\n className: 'msc-alert',\r\n isOpen: allErrors.length > 0,\r\n color: 'danger',\r\n assertive: true,\r\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\r\n },\r\n header: (\r\n \r\n ),\r\n errors: allErrors\r\n };\r\n }\r\n\r\n private _getInvoiceSummaryLineItems(): IInvoiceSummaryLines | undefined {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n return cart?.hasInvoiceLine\r\n ? InvoiceSummary({\r\n orderTotalLabel: resources.totalAmountLabel,\r\n invoiceLabel: resources.invoiceLabel,\r\n cart: cart.cart,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n telemetry,\r\n id: this.props.id\r\n })\r\n : undefined;\r\n }\r\n\r\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n channelDeliveryOptionConfig\r\n },\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const channelConfiguration = this.props.context && this.props.context.request && this.props.context.request.channel;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const featureState = this.props?.data?.featureState;\r\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) && !cart?.hasInvoiceLine\r\n ? OrderSummary({\r\n cart: cart!.cart,\r\n subTotalLabel: resources.itemsWithCountLabel,\r\n shippingLabel: resources.estimatedShippingLabel,\r\n otherChargeLabel: resources.otherCharges,\r\n taxLabel: resources.estimatedTaxLabel,\r\n orderTotalLabel: resources.orderTotal,\r\n totalDiscountsLabel: resources.totalDiscountsLabel,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n toBeCalculatedText: resources.yetToBeCalculatedText,\r\n freeText: resources.priceFree,\r\n channelConfiguration,\r\n retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\r\n telemetry\r\n })\r\n : undefined;\r\n }\r\n\r\n private _getPromoCode(): React.ReactNode {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n resources\r\n } = this.props;\r\n\r\n return (\r\n cart && (\r\n \r\n )\r\n );\r\n }\r\n\r\n private _generateAddToOrderTemplateDialogResources(resources: IPocCartResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n }\r\n\r\n private _generateItemAddedToOrderTemplateDialogResources(resources: IPocCartResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.freePriceText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n }\r\n\r\n private _generateLinesAddedToOrderTemplateDialogResources(resources: IPocCartResources): ILinesAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\r\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\r\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\r\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\r\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText,\r\n linesAddedToOrderTemplateCustomPriceAlertMessageText: resources.linesAddedToOrderTemplateCustomPriceAlertMessageText\r\n };\r\n }\r\n\r\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: IPocCartResources\r\n ): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n }\r\n\r\n private _generateOrderTemplateNameDialogResources(resources: IPocCartResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n }\r\n\r\n private _getCartLines(): ICartlinesViewProps[] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n return ArrayExtensions.hasElements(cart?.cart.CartLines)\r\n ? CartLineItems({\r\n cartlines: cart!.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors,\r\n products: this.state.products,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges\r\n },\r\n telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: this.props.data.orgUnitLocations.result,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this._updateCartlineQuantity,\r\n locationChangedHandler: this._fulfillmentStoreIdUpdated,\r\n wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\r\n\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources\r\n ),\r\n\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates,\r\n customerInformation,\r\n // Experlogix components\r\n experlogixModifyText: resources.experlogixModifyText\r\n })\r\n : null;\r\n }\r\n\r\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\r\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (MsDyn365.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\r\n }\r\n\r\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n this.props.data.cart.result\r\n .removeCartLines(input)\r\n .then(() => {\r\n this._validateCart().catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n }\r\n };\r\n\r\n private readonly _moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\r\n if (result.status === 'ADDED' && cartline) {\r\n this._removeItemFromCartHandler(cartline);\r\n }\r\n };\r\n\r\n private readonly _updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number): boolean => {\r\n if (this.props.data.cart.result) {\r\n let isUsingDefaultOrderSettingsMax: boolean = false;\r\n if (this.state.products.length > 0 && this.isQuantityLimitsFeatureEnabled) {\r\n const modifiedProduct: SimpleProduct | undefined = this.state.products.find(\r\n (product: SimpleProduct) => product.RecordId === cartlineToUpdate.ProductId\r\n );\r\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\r\n } else {\r\n isUsingDefaultOrderSettingsMax = false;\r\n }\r\n const input = {\r\n cartLineId: cartlineToUpdate.LineId!.toString(),\r\n newQuantity: quantity,\r\n additionalProperties: { isUsingDefaultOrderSettingsMax }\r\n };\r\n this.props.data.cart.result\r\n .updateCartLineQuantity(input)\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'SUCCESS') {\r\n this._validateCart().catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to update Cart Line quantity');\r\n });\r\n }\r\n\r\n return false;\r\n };\r\n\r\n private readonly _fulfillmentStoreIdUpdated = () => {\r\n if (this.isQuantityLimitsFeatureEnabled) {\r\n getActiveCartProductsAction(new ActiveCartProductsInput(), this.props.context.actionContext)\r\n .then(products => {\r\n this.setState({ products });\r\n })\r\n .then(async () => this._validateCart())\r\n .catch((error: Error) => {\r\n this.props.telemetry.warning(error.message);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n }\r\n };\r\n\r\n private async _validateCart(retry: boolean = true): Promise {\r\n if (!this.isQuantityLimitsFeatureEnabled) {\r\n return AsyncResult.resolve();\r\n }\r\n\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n let cartResult: ICartState;\r\n try {\r\n cartResult = await cart;\r\n } catch (error) {\r\n this.props.telemetry.warning(`${error}`);\r\n this.props.telemetry.debug('Unable to get cart');\r\n return AsyncResult.resolve();\r\n }\r\n const cartVersion = cartResult.cart?.Version;\r\n if (cartVersion) {\r\n try {\r\n const validationResult: CartLineValidationResults = await validateForCheckoutAsync(\r\n { callerContext: this.props.context.actionContext, bypassCache: 'none' },\r\n cartResult?.cart?.Id,\r\n cartVersion\r\n );\r\n this.setState({ cartlinesErrors: validationResult.ValidationFailuresByCartLines || [] });\r\n await AsyncResult.resolve();\r\n return;\r\n } catch (error) {\r\n if (retry && error instanceof Error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\r\n try {\r\n await cartResult.refreshCart({});\r\n } catch (refreshError) {\r\n this.props.telemetry.warning(`${refreshError}`);\r\n this.props.telemetry.debug('Unable to refresh Cart');\r\n return AsyncResult.resolve();\r\n }\r\n try {\r\n await this._validateCart(false);\r\n return AsyncResult.resolve();\r\n } catch (validateError) {\r\n this.props.telemetry.warning(`${validateError}`);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n return AsyncResult.resolve();\r\n }\r\n }\r\n\r\n this.props.telemetry.warning(`${error}`);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n return AsyncResult.resolve();\r\n }\r\n } else {\r\n this.props.telemetry.warning('Cart version not found for Cart validation request.');\r\n return AsyncResult.resolve();\r\n }\r\n }\r\n\r\n private async _getOrderQuantityLimitsFeatureFlag(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(`${error}`);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n try {\r\n const customerInfo = await this.props.data.customerInformation;\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } catch (error) {\r\n this.props.telemetry.warning(`${error}`);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n return false;\r\n }\r\n }\r\n\r\n private _getCartLinesGroup(): ICartlinesViewProps[][] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n return this.props.data.products &&\r\n this.props.data.products.result &&\r\n cart &&\r\n cart.cart.CartLines &&\r\n cart.cart.CartLines.length > 0 &&\r\n this.props.data.channelDeliveryOptionConfig?.result\r\n ? CartLineGroupItems({\r\n cartlines: cart.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors,\r\n products: this.props.data.products.result,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges\r\n },\r\n telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: this.props.data.orgUnitLocations.result,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this._moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this._updateCartlineQuantity,\r\n locationChangedHandler: this._fulfillmentStoreIdUpdated,\r\n wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\r\n\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources\r\n ),\r\n\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates,\r\n customerInformation,\r\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\r\n // Experlogix components\r\n experlogixModifyText: resources.experlogixModifyText\r\n })\r\n : null;\r\n }\r\n}\r\n\r\nexport default Cart;\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\n/* eslint-disable no-duplicate-imports */\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface ICartLineItemPromotion {\r\n id: string;\r\n showPromotionPopup: boolean;\r\n promotions: CartPromotionLine[] | undefined;\r\n resources: ICartLineItemPromotionResourceString;\r\n onSeeAllClick(event: React.MouseEvent): void;\r\n onCloseButtonClick(): void;\r\n}\r\n\r\nexport interface ICartLineItemViewProps {\r\n promotionMessageWrapper: INodeProps;\r\n promotionMessage: React.ReactNode;\r\n promotionSeeAllLink: React.ReactElement;\r\n promotionDialog: React.ReactNode;\r\n}\r\n\r\nexport interface ICartLineItemPromotionResourceString {\r\n promotionLinkText: string;\r\n promotionStringHeading: string;\r\n promotionPopupHeading: string;\r\n promotionCloseButtonAriaLabel: string;\r\n}\r\n\r\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\r\n const {\r\n id,\r\n showPromotionPopup,\r\n promotions,\r\n resources: { promotionLinkText, promotionPopupHeading },\r\n onCloseButtonClick,\r\n onSeeAllClick\r\n } = props;\r\n\r\n if (!ArrayExtensions.hasElements(promotions)) {\r\n return;\r\n }\r\n\r\n const titleId = `${id}_title`;\r\n const className = 'msc-cart__promotion';\r\n return {\r\n promotionMessageWrapper: {\r\n className: 'msc-cart__promotion'\r\n },\r\n promotionMessage: (\r\n <>\r\n \r\n {props.resources.promotionStringHeading}\r\n \r\n ),\r\n promotionSeeAllLink: (\r\n \r\n {' '}\r\n {promotionLinkText}{' '}\r\n \r\n ),\r\n promotionDialog: (\r\n \r\n \r\n
\r\n {promotionPopupHeading}\r\n
\r\n
\r\n \r\n
    \r\n {promotions.map(_promotion => {\r\n return (\r\n
  • \r\n {_promotion.Promotion?.OfferName}{' '}\r\n
  • \r\n );\r\n })}\r\n
\r\n
\r\n \r\n
\r\n )\r\n };\r\n};\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getRnrAuthEndpointId, getRnrEndpointId, getRnrPartnerId, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getTelemetryObject, ILabeledDropdownOnChangeNotification, ILabeledDropdownOption, IModuleProps, INodeProps, ITelemetryContent, LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { reportReviewConcern, submitHelpfulnessVote } from '../..';\nimport { getReviewsForGivenProduct } from '../../actions/get-product-reviews';\nimport { GetProductReviewsInput } from '../../actions/inputs/get-product-reviews-input';\nimport { ReportReviewConcernInput, ReviewConcernCategory } from '../../actions/inputs/report-review-concern-input';\nimport { SubmitHelpfulnessVoteInput } from '../../actions/inputs/submit-helpfulness-vote-input';\nimport { IReviewModalViewProps, ReviewModal, submitReview } from '../../common/review-modal';\nimport { IRnrKeyValuePair, IRnrOrderByKeyValuePair } from '../../common/rnrInterface';\nimport { PageControls, ReviewCount } from './components/components';\nimport { IReportReviewModalViewProps, ReportReviewModal } from './components/report-review-modal';\nimport { IReviewCardViewProps, ReviewCard } from './components/review-card';\nimport { IReviewsListData } from './reviews-list.data';\nimport { IReviewsListProps } from './reviews-list.props.autogenerated';\n\nexport interface IReviewsListState {\n skipItems: number;\n listOfReviews: Review[];\n currentPage: number;\n reviewsCount: number;\n showSpinner: boolean;\n isFilterApplied: boolean;\n selectedSortByOption: ILabeledDropdownOption;\n selectedFilterByOption: ILabeledDropdownOption;\n userReviewRating: number;\n userReviewTitle: string;\n userReviewText: string;\n isReviewModalOpen: boolean;\n hasReviewError: boolean;\n isReportModalOpen: boolean;\n hasReportError: boolean;\n reportingReviewId: string;\n reportedKey: string;\n reported: boolean;\n reportedReviews: string[];\n votedReviews: { reviewId: string; approved: boolean }[];\n}\n\nexport interface IReviewsListCallbacks {\n toggleModal(): void;\n updateReviewTitle(title: string): void;\n updateReviewText(text: string): void;\n updateRating(rating: number): void;\n onReviewSubmitted(isSuccessful: boolean): void;\n submitReview(product: SimpleProduct, title: string, text: string, rating: number, context: Msdyn365.ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void): void;\n updateReviewHelpfulnessVote(reviewId: string, isHelpful: boolean): void;\n toggleReportModal(reviewId: string): void;\n reportReview(reviewId: string, reportedKey: string): void;\n updateSortByDropdown(notification: ILabeledDropdownOnChangeNotification): void;\n updateFilterByDropdown(notification: ILabeledDropdownOnChangeNotification): void;\n updateReviews(skipItems: number, selectedSortByOption: ILabeledDropdownOption, selectedFilterByOption: ILabeledDropdownOption, currentPage: number, isFilterApplied: boolean): void;\n}\n\nexport interface IReviewsListViewProps extends IReviewsListProps {\n state: IReviewsListState;\n className: string;\n callbacks: IReviewsListCallbacks;\n moduleProps: IModuleProps;\n reviewModal: IReviewModalViewProps;\n reportReviewModal: IReportReviewModalViewProps;\n sortByDropdown: React.ReactNode;\n filterByDropdown: React.ReactNode;\n averageRating: React.ReactNode;\n reviewCount: React.ReactElement;\n refineReviewsProps: INodeProps;\n reviewsListProps: INodeProps;\n reviewCards: IReviewCardViewProps[];\n userReview?: IReviewCardViewProps;\n pageControls: React.ReactNode;\n noReviewsMessage: React.ReactElement;\n noReviewsWithFilterMessage: React.ReactElement;\n heading: React.ReactNode;\n sortByOptions: IRnrOrderByKeyValuePair[];\n filterByOptions: IRnrOrderByKeyValuePair[];\n}\n\n/**\n *\n * ReviewsList component.\n * @extends {React.Component, IReviewsListState>}\n */\n@observer\nclass ReviewsList extends React.Component, IReviewsListState> {\n public sortByDropdownOptions: IRnrOrderByKeyValuePair[] = [\n { key: 'MostHelpful', value: this.props.resources.mostHelpfulSortOptionText },\n { key: 'MostRecent', value: this.props.resources.mostRecentSortOptionText },\n { key: 'HighestRating', value: this.props.resources.highestRatedSortOptionText },\n { key: 'LowestRating', value: this.props.resources.lowestRatedSortOptionText }\n ];\n\n public filterByDropdownOptions: IRnrKeyValuePair[] = [\n { key: '1;2;3;4;5', value: this.props.resources.allRatinsFilterByOptionText },\n { key: '5', value: this.props.resources.fiveStarFilterByOptionText },\n { key: '4', value: this.props.resources.fourStarFilterByOptionText },\n { key: '3', value: this.props.resources.threeStarFilterByOptionText },\n { key: '2', value: this.props.resources.twoStarFilterByOptionText },\n { key: '1', value: this.props.resources.oneStarFilterByOptionText }\n ];\n\n private readonly _userReviewModalToggle: React.RefObject;\n\n private readonly _userReportModalToggle: React.RefObject;\n\n private readonly telemetryContent?: ITelemetryContent;\n\n constructor(props: IReviewsListProps) {\n super(props);\n const { userReview: { result: userReview } } = this.props.data;\n\n this.state = {\n skipItems: 0,\n reviewsCount: 0,\n listOfReviews: [],\n currentPage: 1,\n showSpinner: false,\n isFilterApplied: false,\n selectedSortByOption: this.sortByDropdownOptions[0],\n selectedFilterByOption: this.filterByDropdownOptions[0],\n userReviewRating: userReview ? userReview.rating : 0,\n userReviewText: userReview ? userReview.reviewText : '',\n userReviewTitle: userReview ? userReview.title : '',\n isReviewModalOpen: false,\n hasReviewError: false,\n isReportModalOpen: false,\n hasReportError: false,\n reported: false,\n reportedKey: ReviewConcernCategory.SpamAdvertising,\n reportingReviewId: '',\n reportedReviews: [],\n votedReviews: []\n };\n\n this._userReviewModalToggle = React.createRef();\n this._userReportModalToggle = React.createRef();\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public componentDidMount = async () => {\n this.props.data.reviewsList.then((reviewsList) => {\n if (\n reviewsList &&\n reviewsList.pagingInfo &&\n reviewsList.pagingInfo.totalItems &&\n reviewsList.items &&\n reviewsList.items.length > 0\n ) {\n this.setState({\n listOfReviews: reviewsList.items,\n reviewsCount: reviewsList.pagingInfo.totalItems\n });\n }\n });\n await this.updateReviews(0, this.state.selectedSortByOption, this.state.selectedFilterByOption, 1, this.state.isFilterApplied);\n\n reaction(\n () => this.props.data.ratingsReviewsState.result && this.props.data.ratingsReviewsState.result.filterKey,\n async (filterKey: string | undefined) => {\n const filterKeyValue = Number(filterKey);\n const dropdownItemsCount = this.filterByDropdownOptions.length;\n if (\n filterKey &&\n !isNaN(filterKeyValue) &&\n filterKeyValue < dropdownItemsCount\n ) {\n const filterByOption = this.filterByDropdownOptions.find((option: IRnrKeyValuePair) => option.key === filterKey);\n if (!filterByOption) {\n this.props.telemetry.warning(`[reviews-list] cannot find filter with key ${filterKey}`);\n } else {\n await this.updateReviews(0, this.state.selectedSortByOption, filterByOption, 1, true);\n const selectedIndex = dropdownItemsCount - filterKeyValue;\n this.setState({\n selectedFilterByOption: this.filterByDropdownOptions[selectedIndex]\n });\n }\n }\n }\n );\n };\n\n public shouldComponentUpdate(nextProps: IReviewsListProps,\n nextState: IReviewsListState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { className, heading, reviewsShownOnEachPage } = this.props.config;\n const { currentPage, reviewsCount, selectedFilterByOption, selectedSortByOption } = this.state;\n const { ratingsSummary: { result: ratingsSummary } } = this.props.data;\n const resources = this.props.resources;\n const completeClass = classname('ms-reviews-list', className);\n const viewProps: IReviewsListViewProps = {\n ...this.props,\n state: this.state,\n className: completeClass,\n moduleProps: {\n moduleProps: this.props,\n className: completeClass\n },\n callbacks: this.reviewsListCallbacks,\n reviewModal: this._userReviewModal(),\n reportReviewModal: this._reportReviewModal(),\n filterByDropdown: (\n \n ),\n sortByDropdown: ,\n averageRating: ratingsSummary && (\n \n ),\n reviewCount: ,\n refineReviewsProps: { className: 'ms-reviews-list__refiners' },\n reviewsListProps: { className: 'ms-reviews-list__reviews' },\n reviewCards: this._reviewCards(this.state.listOfReviews),\n userReview: this._userReview(),\n pageControls: (\n ),\n noReviewsMessage: \n {resources.noReviewsMessage}\n ,\n noReviewsWithFilterMessage: \n {resources.noReviewsWithSelectedFilterMessage}\n ,\n heading: heading && heading.text && (\n \n ),\n sortByOptions: this.sortByDropdownOptions,\n filterByOptions: this.filterByDropdownOptions\n } as IReviewsListViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private readonly _userReview = () => {\n const userReview = this.props.data.userReview.result;\n\n return userReview && this._reviewCard(userReview, true);\n };\n\n private readonly _reviewCards = (reviewList: Review[]) => {\n const userReview = this.props.data.userReview.result;\n const reviewElements: IReviewCardViewProps[] = [];\n\n for (const review of reviewList) {\n if (!review.isTakenDown && review.isPublished && userReview ? review.reviewId !== userReview.reviewId : true) {\n reviewElements.push(this._reviewCard(review, false));\n }\n }\n return reviewElements;\n };\n\n private readonly _reviewCard = (review: Review, userReview: boolean): IReviewCardViewProps => {\n return ReviewCard({\n review,\n resources: { ...this.props.resources },\n context: this.props.context,\n isUserReview: userReview,\n parentId: this.props.id,\n parentType: this.props.typeName,\n reportedReviews: this.state.reportedReviews,\n returnRef: this._userReportModalToggle,\n reportedReviewId: this.state.reportingReviewId,\n toggleWriteReviewModal: this._toggleReviewModal,\n toggleReportReviewModal: this._onReportModalOpen,\n updateReviewHelpfulness: this.updateReviewHelpfulnessVote,\n votedReviews: this.state.votedReviews\n });\n };\n\n private readonly _userReviewModal = (): IReviewModalViewProps => {\n return ReviewModal({\n userReview: this.props.data.userReview.result,\n product: this.props.data.product.result,\n resources: { ...this.props.resources },\n context: this.props.context,\n parentId: this.props.id,\n parentType: this.props.typeName,\n isOpen: this.state.isReviewModalOpen,\n rating: this.state.userReviewRating,\n reviewTitle: this.state.userReviewTitle,\n reviewText: this.state.userReviewText,\n onModalToggle: this._toggleReviewModal,\n onTitleChange: this._onTitleChange,\n onTextChange: this._onTextChange,\n onRatingChange: this._onRatingChange,\n onReviewComplete: this._onReviewComplete,\n renderContextId: 'writeReview-list',\n returnRef: this._userReviewModalToggle,\n hasError: this.state.hasReviewError\n });\n };\n\n private readonly _onTitleChange = (event: React.ChangeEvent): void => {\n this.reviewsListCallbacks.updateReviewTitle(event.target.value);\n };\n\n private readonly _onTextChange = (event: React.ChangeEvent): void => {\n this.reviewsListCallbacks.updateReviewText(event.target.value);\n };\n\n private readonly _onRatingChange = (value: number): void => {\n this.reviewsListCallbacks.updateRating(value);\n };\n\n private readonly _toggleReviewModal = (): void => {\n const userReview = this.props.data.userReview.result;\n if (this.state.isReviewModalOpen) {\n this.setState({ isReviewModalOpen: false, hasReviewError: false });\n\n } else {\n this.setState({\n isReviewModalOpen: true,\n userReviewText: userReview!.reviewText,\n userReviewTitle: userReview!.title,\n userReviewRating: userReview!.rating\n });\n }\n };\n\n private readonly _onReviewComplete = (isSuccess: boolean): void => {\n if (isSuccess) {\n this.setState({ isReviewModalOpen: false, hasReviewError: false });\n } else {\n this.setState({ hasReviewError: true });\n }\n };\n\n private readonly _reportReviewModal = () => {\n return ReportReviewModal({\n resources: { ...this.props.resources },\n context: this.props.context,\n isOpen: this.state.isReportModalOpen,\n returnRef: this._userReportModalToggle,\n reportedKey: this.state.reportedKey,\n onModalToggle: this._onReportModalClose,\n onRadioChange: this._onRadioChange,\n reportReview: this._reportReview,\n hasError: this.state.hasReportError,\n telemetryContent: this.telemetryContent\n });\n };\n\n private readonly _onReportModalOpen = (reviewId: string) => {\n this.setState({ isReportModalOpen: true, reportingReviewId: reviewId, reported: false, reportedKey: ReviewConcernCategory.SpamAdvertising });\n };\n\n private readonly _onReportModalClose = () => {\n this.setState({ isReportModalOpen: false, hasReportError: false });\n };\n\n private readonly _onRadioChange = (event: React.ChangeEvent) => {\n this.setState({ reportedKey: event.currentTarget.getAttribute('data-key') || '' });\n };\n\n private readonly _reportReviewCallback = (reviewId: string, reportedKey: string) => {\n reportReviewConcern(\n new ReportReviewConcernInput(\n reviewId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n reportedKey,\n this.getUserToken(this.props.context.request),\n getRnrAuthEndpointId(this.props.context.actionContext)\n ),\n this.props.context.actionContext\n ).then((_value: boolean) => {\n const reportedReview = this.state.reportedReviews;\n reportedReview.push(reviewId);\n this.setState({ reported: true, reportedReviews: reportedReview, hasReportError: false });\n }).catch((error: boolean) => {\n this.setState({ hasReportError: true });\n });\n };\n\n private readonly _reportReview = () => {\n this._reportReviewCallback(this.state.reportingReviewId, this.state.reportedKey);\n };\n\n private readonly updateSortByDropdown = async (notification: ILabeledDropdownOnChangeNotification) => {\n await this.updateReviews(0, notification.selectedOption, this.state.selectedFilterByOption, 1, this.state.isFilterApplied);\n };\n\n private readonly updateFilterByDropdown = async (notification: ILabeledDropdownOnChangeNotification) => {\n await this.updateReviews(0, this.state.selectedSortByOption, notification.selectedOption, 1, true);\n };\n\n private readonly updateReviews = async (\n skipItems: number | 0,\n selectedSortByOption: ILabeledDropdownOption,\n selectedFilterByOption: ILabeledDropdownOption,\n currentPage: number,\n isFilterApplied: boolean\n ) => {\n const productId = getSelectedProductIdFromActionInput(this.props.context.actionContext);\n if (productId === undefined) {\n return;\n }\n const result = await getReviewsForGivenProduct(\n\n // Task #211227597 Remove this hardcoded values.\n new GetProductReviewsInput(\n productId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n getRnrEndpointId(this.props.context.actionContext),\n selectedSortByOption.key,\n selectedFilterByOption.key,\n skipItems < 0 ? 0 : skipItems,\n this.props.config.reviewsShownOnEachPage\n ),\n this.props.context.actionContext\n );\n if (result && result.items && result.pagingInfo && result.pagingInfo.totalItems !== undefined) {\n this.setState({\n currentPage,\n listOfReviews: result.items,\n selectedSortByOption,\n selectedFilterByOption,\n reviewsCount: result.pagingInfo.totalItems,\n isFilterApplied\n });\n }\n };\n\n private readonly _updateVoteUi = (reviewId: string, isHelpful: boolean): void => {\n let alreadyExists = false;\n let list = this.state.votedReviews.map((review) => {\n if (review.reviewId === reviewId) {\n review.approved = isHelpful;\n alreadyExists = true;\n }\n return review;\n });\n\n if (!alreadyExists) {\n list = list.concat({ reviewId, approved: isHelpful });\n }\n\n this.setState({ votedReviews: list });\n };\n\n private readonly updateReviewHelpfulnessVote = (reviewId: string, isHelpful: boolean): void => {\n submitHelpfulnessVote(\n new SubmitHelpfulnessVoteInput(\n reviewId,\n getRnrPartnerId(this.props.context.actionContext),\n this.props.context.request.locale,\n isHelpful,\n this.getUserToken(this.props.context.request),\n getRnrAuthEndpointId(this.props.context.actionContext)\n ),\n this.props.context.actionContext\n ).then(() => {\n this._updateVoteUi(reviewId, isHelpful);\n }).catch((error: Error) => {\n throw new Error('[submitHelpfulnessVote]Error executing action');\n });\n };\n\n private readonly getUserToken = (context: Msdyn365.IRequestContext): string => {\n return context && context.user && context.user.token;\n };\n\n private readonly reviewsListCallbacks: IReviewsListCallbacks = {\n updateReviewTitle: (title: string): void => {\n this.setState({ userReviewTitle: title });\n },\n updateReviewText: (text: string): void => {\n this.setState({ userReviewText: text });\n },\n updateRating: (rating: number): void => {\n this.setState({ userReviewRating: rating });\n },\n onReviewSubmitted: (isSuccessful: boolean): void => {\n if (isSuccessful) {\n this.setState({ isReviewModalOpen: false, hasReviewError: false });\n } else {\n this.setState({ hasReviewError: true });\n }\n },\n submitReview,\n toggleModal: this._toggleReviewModal,\n updateReviewHelpfulnessVote: this.updateReviewHelpfulnessVote,\n toggleReportModal: (reviewId: string): void => {\n this.state.isReportModalOpen ? this._onReportModalOpen(reviewId) : this._onReportModalClose();\n },\n reportReview: this._reportReviewCallback,\n updateFilterByDropdown: this.updateFilterByDropdown,\n updateSortByDropdown: this.updateSortByDropdown,\n updateReviews: this.updateReviews\n };\n}\n\nexport default ReviewsList;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CategoryHierarchy as CategoryHierarchyData, IProductRefinerHierarchy, IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport MsDyn365, { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\nimport { format, ProductPrice, ProductRefinerValue, SortColumn,\n TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, DimensionAvailabilitiesForProductSearchResultInput, DimensionTypes,\n getDimensionAvailabilitiesForProductSearchResultAction, getPriceForProductSearchResult,\n IDimensionsApp, PriceForProductSearchResultInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, ILabeledDropdownOnChangeNotification, ILabeledDropdownOption, IModuleProps,\n INodeProps, isMobile, ITelemetryContent, LabeledDropdown, UncontrolledPagination, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { computed, observable, reaction, transaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { buildListPageUrl, getCollectionProducts, getCollectionRefinersAction, getCurrentUrl,\n GetFullProductsByCollectionInput, parseQueryParam, ProductListInventoryFilteringOptions, RefinersByCollectionInput, sortOptions } from './actions';\nimport { hydrateRefinersFromUrl } from './actions/url-utils';\nimport {\n ErrorMessage, FeatureSearchResultItem, getUpdatedRefinementCriteria, IChoiceSummaryClickNotification,\n IRefineItemCommonProps, IRefineItemToggleNotification, ISearchResultModalViewProps, isMatchingRefinementCriterion,\n Link, ModalToggle, ProductSearchResultItems, SearchResultModal, Separator, Title\n} from './components';\nimport ChoiceSummary from './components/choice-summary';\nimport RefineSubmenu from './components/refine-submenu';\nimport { ISearchResultContainerData } from './search-result-container.data';\nimport { expandRefinersCount, ISearchResultContainerProps } from './search-result-container.props.autogenerated';\n\nexport interface ISearchResultContainerViewProps extends ISearchResultContainerProps {\n products?: React.ReactNode;\n className?: string;\n SearchResultContainer: IModuleProps;\n TitleViewProps: ITitleViewProps;\n categoryHierarchy: ICategoryHierarchyViewProps;\n pagination?: React.ReactNode;\n ProductsContainer: INodeProps;\n ProductSectionContainer: INodeProps;\n refineMenu: IRefineMenuViewProps;\n sortByOptions: ISortByViewProps;\n choiceSummary?: React.ReactNode;\n modalToggle: React.ReactNode;\n searchResultModal: ISearchResultModalViewProps;\n isMobile: boolean;\n CategoryNavContainer: INodeProps;\n RefineAndProductSectionContainer: INodeProps;\n errorMessage: React.ReactNode;\n FeatureSearchContainer: INodeProps;\n similarLookProduct?: React.ReactNode;\n productPrices?: ProductPrice[];\n}\n\nexport interface ITitleViewProps {\n TitleContainer: INodeProps;\n title: ISearchResultTitle;\n}\n\nexport interface IRefineMenuViewProps {\n RefineMenuContainer: INodeProps;\n RefinerSectionContainer: INodeProps;\n refiners?: React.ReactNode[];\n}\n\nexport interface ICategoryHierarchyViewProps {\n categoryHierarchyList?: React.ReactNode[];\n categoryHierarchySeparator?: React.ReactNode;\n CategoryHierarchyContainer: INodeProps;\n}\n\nexport interface ISortByViewProps {\n SortingContainer: INodeProps;\n sortByDropDown?: React.ReactNode;\n}\n\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Title component for search result container.\n */\nexport interface ISearchResultTitle {\n titlePrefix?: React.ReactNode;\n titleText?: React.ReactNode;\n titleCount?: React.ReactNode;\n}\n\nexport interface ISearchResultContainerState {\n sortingState: ISortByCollectionState;\n modalIsOpen: boolean;\n refiners: IProductRefinerHierarchy[];\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\n}\n\ninterface ISortByCollectionState {\n selectedSortByOption: ILabeledDropdownOption;\n pending: boolean;\n}\n\n/**\n *\n * SearchResultContainer component.\n * @extends {React.PureComponent>}\n */\n@observer\nexport default class SearchResultContainer extends React.PureComponent, ISearchResultContainerState> {\n\n @computed get isMobile(): boolean {\n return (this._viewport === 'xs' || this._viewport === 'sm');\n }\n\n private readonly sortByDropdownOptions: ILabeledDropdownOption[] = [\n { key: sortOptions.sortByOptionRelevanceDesc, value: this.props.resources.sortByOptionRelevanceDesc },\n { key: sortOptions.sortByOptionNameAsc, value: this.props.resources.sortByOptionNameAsc },\n { key: sortOptions.sortByOptionNameDesc, value: this.props.resources.sortByOptionNameDesc },\n { key: sortOptions.sortByOptionPriceAsc, value: this.props.resources.sortByOptionPriceAsc },\n { key: sortOptions.sortByOptionPriceDesc, value: this.props.resources.sortByOptionPriceDesc },\n { key: sortOptions.sortByOptionRatingDesc, value: this.props.resources.sortByOptionRatingDesc },\n { key: sortOptions.sortByOptionBestSelling, value: this.props.resources.sortByOptionBestSelling },\n { key: sortOptions.sortByOptionNewScore, value: this.props.resources.sortByOptionNewScore },\n { key: sortOptions.sortByOptionTrendingScore, value: this.props.resources.sortByOptionTrendingScore }\n ];\n\n private readonly _refineItemCommonProps: IRefineItemCommonProps;\n\n private readonly _pageType: string | undefined = this.props.context.request.urlTokens.pageType;\n\n @observable\n private _viewport: GridSize = 'lg';\n\n private readonly _modalToggleRef: React.RefObject;\n\n private readonly _sortAndFilterContainerRef: React.RefObject;\n\n private expandrefinerCount: number | undefined = 0;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly productPrices: ProductPrice[];\n\n private readonly defaultPageNumber = 0;\n\n private readonly catalogId = getCatalogId(this.props.context.request);\n\n public constructor(props: ISearchResultContainerProps, state: ISearchResultContainerState) {\n super(props);\n this._viewport = props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\n this._modalToggleRef = React.createRef();\n this._sortAndFilterContainerRef = React.createRef();\n this._toggleModal = this._toggleModal.bind(this);\n this._updateViewport = this._updateViewport.bind(this);\n this.productPrices = [];\n this.state = {\n sortingState: {\n pending: false,\n selectedSortByOption: this.sortByDropdownOptions[0]\n },\n modalIsOpen: false,\n refiners: []\n };\n const {\n placeholderTextMax,\n minLabel,\n maxLabel,\n rangeNameFormat\n } = this.props.resources;\n\n const locale = this.props.context.request.locale;\n const telemetry = this.props.telemetry;\n const validationErrorNaN = this.props.resources.validationErrorNotNumber;\n const validationErrorRange = this.props.resources.validationErrorNotRange;\n this._refineItemCommonProps = {\n telemetry,\n locale,\n placeholderTextMax,\n minLabel,\n maxLabel,\n rangeNameFormat,\n validationErrorNaN,\n validationErrorRange\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n\n // Initalization of list page\n // eslint-disable-next-line max-len -- existing code\n /* eslint-disable @typescript-eslint/no-floating-promises, promise/catch-or-return, promise/always-return, promise/prefer-await-to-then -- existing code */\n this.props.data.products.then((products) => {\n this.props.data.listPageState.then((listPageState) => {\n if (this._pageType === 'Category') {\n listPageState.pageType = 'Category';\n } else {\n listPageState.pageType = 'Search';\n }\n\n let querySorting: SortColumn[] = [];\n\n if (this.props.context.request.query && this.props.context.request.query.sorting) {\n querySorting = JSON.parse(decodeURIComponent(this.props.context.request.query.sorting)) as SortColumn[];\n }\n\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, max-len -- existing code\n listPageState.currentPageNumber = this.props.context.request.query && (+this.props.context.request.query.skip / (this.props.config.itemsPerPage || 10)) || 0;\n listPageState.sortingCritera = { Columns: querySorting };\n listPageState.pageSize = this.props.config.itemsPerPage || 10;\n listPageState.activeProducts = products.products;\n listPageState.totalProductCount = products.count;\n listPageState.activeFilters = hydrateRefinersFromUrl(this.props.context.request);\n\n // Initialize reaction based on listPageState properties\n reaction(\n () => {\n // eslint-disable-next-line max-len -- existing code\n return [listPageState.activeFilters && listPageState.activeFilters.length, listPageState.currentPageNumber, listPageState.sortingCritera && listPageState.sortingCritera.Columns && listPageState.sortingCritera.Columns.length];\n },\n () => {\n const input = new GetFullProductsByCollectionInput(\n listPageState.pageType,\n this.props.context.request.apiSettings,\n // eslint-disable-next-line max-len -- existing code\n { Paging: { Top: this.props.config.itemsPerPage, Skip: Math.max((listPageState.pageSize * (listPageState.currentPageNumber || 0)), 0) }, count: true, Sorting: listPageState.sortingCritera || {} },\n listPageState.activeFilters || [],\n +(this.props.context.request.urlTokens.itemId || 0),\n\n // eslint-disable-next-line max-len -- existing code\n this.props.context.request.query && this.props.context.request.query.q ? this.props.context.request.query.q : JSON.stringify({ ProductId: this.props.context.request.query?.productId, Recommendation: this.props.context.request.query?.recommendation }),\n !!(this.props && this.props.config && this.props.config.includeAttributes !== undefined && this.props.config.includeAttributes),\n this.props.config.updateRefinerPanel,\n this.props.context.request.locale,\n this.catalogId\n );\n getCollectionProducts(input, this.props.context.actionContext).then(productResults => {\n listPageState.activeProducts = productResults.products;\n listPageState.totalProductCount = productResults.count;\n\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\n this._getActivePrice();\n }\n });\n\n if (this.props.config.updateRefinerPanel) {\n const refinerInput = new RefinersByCollectionInput(\n listPageState.pageType,\n this.props.context.request.apiSettings,\n {\n Paging: {\n Top: this.props.config.itemsPerPage,\n Skip: Math.max((listPageState.pageSize * (listPageState.currentPageNumber ?? this.defaultPageNumber)),\n this.defaultPageNumber)\n },\n count: true, Sorting: listPageState.sortingCritera ?? {}\n },\n listPageState.activeFilters ?? [],\n +(this.props.context.request.urlTokens.itemId ?? 0),\n this.props.context.request.query?.q ? this.props.context.request.query.q : this.props.context.request.query?.productId,\n false,\n this.props.config.updateRefinerPanel,\n undefined,\n this.catalogId\n );\n\n getCollectionRefinersAction(refinerInput, this.props.context.actionContext).then((refiners) => {\n this.setState({ refiners });\n }).catch(error => {\n this.props.telemetry.error(error);\n });\n }\n }\n );\n\n });\n });\n // eslint-disable-next-line max-len -- existing code\n /* eslint-enable @typescript-eslint/no-floating-promises, promise/catch-or-return, promise/always-return, promise/prefer-await-to-then -- Existing code. */\n\n if (this.props.context.request.query?.productId) {\n this.props.data.featureProduct.then((products) => {\n this.props.data.listPageState.then((listPageStateFeature) => {\n listPageStateFeature.featureProduct = products;\n });\n });\n }\n this._updateViewport();\n }\n\n public static getFriendlyName(locale: string, nameTranslations?: TextValueTranslation[]): string | undefined {\n let nameTranslation: TextValueTranslation | undefined;\n if (locale && nameTranslations && ArrayExtensions.hasElements(nameTranslations)) {\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\n }\n\n return nameTranslation?.Text;\n }\n\n public async componentDidMount(): Promise {\n if (MsDyn365.isBrowser && window.addEventListener) {\n window.addEventListener('resize', this._updateViewport);\n this._updateViewport();\n }\n if (this.props.config.enableAffiliationBasedPricing &&\n this.props.context.actionContext.requestContext?.user?.isAuthenticated) {\n this._getActivePrice();\n }\n\n const context = this.props.context as ICoreContext;\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\n if (ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) && !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) && !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\n this.props.config.includeAttributes) {\n await this._getProductsDimensionsAvailabilities();\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.isBrowser && window.removeEventListener) {\n window.removeEventListener('resize', this._updateViewport);\n }\n }\n\n public render(): JSX.Element {\n const { imageSettings, className } = this.props.config;\n const { resources } = this.props;\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\n const searchProduct = (this.props.data.listPageState.result && this.props.data.listPageState.result.featureProduct) || null;\n let errorText = '';\n if (!products || products.length === 0) {\n errorText = this._pageType === 'Category' ? resources.resultCategoryNotFoundText : resources.resultSearchNotFoundText;\n\n }\n const productsComponent = this._getProducts();\n const featureComponent = (\n \n );\n\n const searchResultContainerViewProps = {\n ...this.props,\n products: productsComponent,\n TitleViewProps: this._getCollectionTitle(),\n categoryHierarchy: !this.props.config.disableHierarchy && this._getCategoryHierarchy(),\n refineMenu: this._getRefineMenu(),\n className: classnames('ms-search-result-container', className),\n SearchResultContainer: {\n moduleProps: this.props,\n className: classnames('ms-search-result-container', className)\n },\n // eslint-disable-next-line max-len -- existing code\n sortByOptions: this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0 ? this._getSortingDropDown() : null,\n pagination: this._getPagination(),\n ProductsContainer: { className: 'ms-search-result-container__Products' },\n ProductSectionContainer: { className: 'ms-search-result-container__product-section' },\n CategoryNavContainer: { className: 'ms-search-result-container__category-nav-section' },\n RefineAndProductSectionContainer: { className: 'ms-search-result-container__refine-product-section' },\n choiceSummary: this._getChoiceSummary(),\n modalToggle: this.props.data.listPageState.result && this.props.data.listPageState.result.totalProductCount !== 0 ? (\n \n ) : null,\n searchResultModal: this._getSearchResultModal(),\n isMobile: this.isMobile,\n errorMessage: errorText && (\n \n ),\n FeatureSearchContainer: { className: 'ms-feature-search-result' },\n // eslint-disable-next-line max-len -- existing code\n similarLookProduct: this.props.data.listPageState.result && (this.props.data.listPageState.result.featureProduct !== null && this.props.data.listPageState.result.featureProduct !== undefined) ? featureComponent : null,\n productPrices: this.productPrices\n };\n return this.props.renderView(searchResultContainerViewProps) as React.ReactElement;\n }\n\n /**\n * Get products dimension availabilities.\n * @returns Void.\n */\n private readonly _getProductsDimensionsAvailabilities = async (): Promise => {\n const productsList = (this.props.data.listPageState.result?.activeProducts) ?? [];\n\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\n new DimensionAvailabilitiesForProductSearchResultInput(productsList, this.props.context as ICoreContext),\n this.props.context.actionContext);\n\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\n this.setState({ productsDimensionAvailabilities });\n }\n };\n\n /**\n * Get the active price for the products.\n */\n private readonly _getActivePrice = async (): Promise => {\n const productsList = (this.props.data.listPageState.result?.activeProducts) ?? [];\n const products = await getPriceForProductSearchResult(\n new PriceForProductSearchResultInput(productsList),\n this.props.context.actionContext);\n\n const listPageState = await this.props.data.listPageState;\n listPageState.activeProducts = products;\n };\n\n private readonly _getSearchResultModal = (): ISearchResultModalViewProps => {\n const { resources } = this.props;\n return SearchResultModal(\n {\n resources: {\n modalCloseButtonText: resources.modalCloseButtonText,\n modalTitle: resources.modalTitle\n },\n isOpen: this.state.modalIsOpen,\n returnRef: this._modalToggleRef,\n onModalToggle: this._toggleModal\n });\n };\n\n private readonly _getCollectionTitle = (): ITitleViewProps => {\n const { data, context, resources } = this.props;\n\n let collectionTitle: string | undefined = '';\n if (context && context.request && context.request.query && context.request.query.q) {\n collectionTitle = `\"${context.request.query.q}\"`;\n } else {\n collectionTitle = (data.category.result && SearchResultContainer.getFriendlyName(context.request.locale, data.category.result.NameTranslations)) ||\n (data.category.result && data.category.result.Name);\n }\n let productCountText = '';\n let productCountNumber: number | undefined;\n if (data.listPageState && data.listPageState.result && data.listPageState.result.totalProductCount !== undefined) {\n productCountNumber = data.listPageState.result.totalProductCount;\n } else if (data.products && data.products.result) {\n productCountNumber = data.products.result.count;\n }\n\n if (productCountNumber && productCountNumber !== 0) {\n productCountText = productCountNumber !== 1 ? format(this.props.resources.numberOfProducts, productCountNumber) : this.props.resources.oneProduct;\n } else {\n productCountText = format(this.props.resources.numberOfProducts, 0);\n }\n const pageName = context.request.telemetryPageName ? `result-count-${context.request.telemetryPageName.toLowerCase()}` : '';\n const titlePrefix = ;\n const titleText = collectionTitle && <Title className='ms-search-result__collection-title-text' text={collectionTitle} />;\n const titleCount = <Title className='ms-search-result__collection-title-count' text={productCountText} />;\n\n return {\n TitleContainer: { className: `ms-search-result-container__title ${pageName}` },\n title: {\n titlePrefix,\n titleText,\n titleCount\n }\n };\n\n };\n\n private readonly _getCategoryHierarchy = (): ICategoryHierarchyViewProps => {\n const { data } = this.props;\n const categoryHierarchy = data.categoryHierarchy.result;\n const categoryLinks =\n categoryHierarchy && categoryHierarchy.map((value: CategoryHierarchyData, index: number) => {\n\n return (\n <Link\n key={index}\n text={value.Name}\n ariaLabel={`${this.props.resources.categoryLinkAriaLabel} ${value.Name}`}\n href={value.Url}\n />\n );\n });\n const categoryLinkSeparator = <Separator separator='/' />;\n\n return {\n CategoryHierarchyContainer: { tag: 'nav', className: 'ms-search-result-container__category-hierarchy' },\n categoryHierarchyList: categoryLinks,\n categoryHierarchySeparator: categoryLinkSeparator\n };\n\n };\n\n private readonly _getSortingDropDown = (): ISortByViewProps => {\n const { resources } = this.props;\n const activeDropdown = this._getCurrentlySelectedOption() || this.state.sortingState.selectedSortByOption;\n let dropdownOptions = this._getAllSortByOptions();\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- App config settings are of \"any\" value.\n if (this.props.context.app.config.hideRating) {\n dropdownOptions = dropdownOptions.filter((dropdownOption) => dropdownOption.key !== sortOptions.sortByOptionRatingDesc);\n }\n\n const dropdown = (\n <LabeledDropdown\n labelClassname='reviews-list-sort-by'\n labelText={resources.sortByDropdownLabel}\n dropdownId='categorySortByDropdown'\n dropdownClassname='reviews-list-dropdown'\n toggleColor='link'\n dropdownOptions={dropdownOptions}\n selectedOption={activeDropdown}\n onSelectOption={this._updateSortByDropdown}\n ref={this._sortAndFilterContainerRef}\n />);\n return {\n SortingContainer: { className: 'ms-search-result-container__Sort-by-category' },\n sortByDropDown: dropdown\n };\n };\n\n private readonly _getPagination = (): React.ReactNode => {\n const { config, context, data, resources } = this.props;\n const listPageState = data && data.listPageState && data.listPageState.result;\n const fullUrl = getCurrentUrl(context.request);\n const itemsPerPage = config.itemsPerPage || 10;\n // eslint-disable-next-line max-len -- existing code\n const skipCount = listPageState && listPageState.currentPageNumber !== null ? (listPageState.currentPageNumber * (this.props.config.itemsPerPage || 10)) : ((this.props.context.request.query && +this.props.context.request.query.skip) || 0);\n const totalItems = listPageState && listPageState.totalProductCount || 0;\n const previousText = resources.flipperPrevious;\n const nextText = resources.flipperNext;\n\n if (totalItems <= itemsPerPage) {\n return null;\n }\n return (\n <UncontrolledPagination\n className='ms-search-result-container__pagination'\n role='navigation'\n aria-label={resources.paginationAriaLabel}\n url={fullUrl.href}\n qsp='skip'\n items={totalItems}\n itemsPerPage={itemsPerPage}\n startingItem={skipCount}\n previousText={this._renderPrev(previousText)}\n nextText={this._renderNext(nextText)}\n previousAriaLabel={previousText}\n nextAriaLabel={nextText}\n telemetryContent={this.telemetryContent}\n />);\n };\n\n private readonly _getRefineMenu = (): IRefineMenuViewProps => {\n const { data, context, config } = this.props;\n const tempRangeTypeTODO = context.request.query && context.request.query.inputRange ? 'input' : 'slider';\n const validRefiners = this.props.config.updateRefinerPanel && ArrayExtensions.hasElements(this.state.refiners) ? this.state.refiners.filter(refiner => {\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\n }) : data.refiners.result && data.refiners.result.filter(refiner => {\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\n });\n\n const activeRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n this._getexpandRefinerCount(validRefiners && validRefiners.length, config.expandRefinersCount);\n const expandedRefiners = this.expandrefinerCount;\n const subMenus = validRefiners && validRefiners.map((productRefinerHierarchy: IProductRefinerHierarchy, index: number) => {\n return (\n <RefineSubmenu\n productRefinerHierarchy={productRefinerHierarchy}\n selectedRefinerValues={activeRefiners}\n refineItemCommonProps={this._refineItemCommonProps}\n minValueSliderThumbAriaLabel={this.props.resources.minValueSliderThumbAriaLabel}\n maxValueSliderThumbAriaLabel={this.props.resources.maxValueSliderThumbAriaLabel}\n key={index}\n onUpdateRefiners={this._onUpdateRefiners}\n urlBuilder={this._buildRefinerUrl}\n isDisabled={false}\n isExpandedOnInitialLoad={!!(expandedRefiners && expandedRefiners > index)}\n tempRangeTypeTODO={tempRangeTypeTODO}\n context={context}\n moduleId={this.props.id}\n moduleTypeName={this.props.typeName}\n telemetryContent={this.telemetryContent}\n productCountAriaLabel={this.props.resources.productCountAriaLabel}\n refineItemAriaLabel={this.props.resources.refineItemAriaLabel}\n refineItemsAriaLabel={this.props.resources.refineItemsAriaLabel}\n singleProductCountAriaLabel={this.props.resources.singleProductCountAriaLabel}\n isMobile={this.isMobile}\n />\n );\n });\n\n return {\n RefineMenuContainer: { className: 'ms-search-result-container__refine-menu' },\n RefinerSectionContainer: { className: 'ms-search-result-container__refiner-section' },\n refiners: subMenus\n };\n\n };\n\n /**\n * Should hide from refiners.\n * @param refiner - The refiner.\n * @returns ShouldHideFromRefiners.\n */\n private readonly _shouldHideFromRefiners = (refiner: IProductRefinerHierarchy): boolean => {\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n return this.props.context.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS &&\n refiner.RecordId === this.props.data.products.result?.channelInventoryConfigurationId;\n };\n\n private readonly _getChoiceSummary = (): React.ReactNode => {\n const { resources, data, telemetry } = this.props;\n const selectedRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n return (\n <ChoiceSummary\n classNames='ms-choice-summary-by-category'\n clearAllText={resources.clearAllText}\n label={resources.choiceSummaryLabel}\n closeAriaLabel={resources.closeAriaLabel}\n selectedChoices={selectedRefiners}\n\n // @ts-expect-error: NOTE Type-unsafe line below, null refinersByCategoryHierarchy case not handled\n refinerHierarchy={data.refiners.result}\n choiceFormat={resources.choiceFormat}\n choiceRangeValueFormat={resources.choiceRangeValueFormat}\n telemetry={telemetry}\n onChoiceClicked={this._onChoiceClicked}\n urlBuilder={this._buildRefinerUrlForChoiceSummary}\n choiceAriaLabel={resources.choiceAriaLabel}\n telemetryContent={this.telemetryContent}\n context={this.props.context}\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\n />\n );\n\n };\n\n private readonly _getProducts = (): JSX.Element => {\n const { imageSettings, allowBackNavigation } = this.props.config;\n const { resources } = this.props;\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\n const quickviewslot = this.props.slots && this.props.slots.quickview && this.props.slots.quickview[0];\n const isPriceMinMaxFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature');\n return (\n <ProductSearchResultItems\n products={products}\n context={this.props.context}\n imageSettings={imageSettings}\n resources={resources}\n moduleType={this.props.typeName}\n moduleId={this.props.id}\n allowBackNavigation={allowBack}\n telemetryContent={this.telemetryContent}\n quickviewSlot={quickviewslot}\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\n productsDimensionAvailabilities={this.state.productsDimensionAvailabilities}\n />\n );\n };\n\n private readonly _updateSortByDropdown = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { context } = this.props;\n const requestContext = context && context.request;\n const actionContext = context && context.actionContext;\n\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\n // eslint-disable-next-line max-len -- existing code\n const error = `[sort-by-category] cannot sort without context: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\n this.props.telemetry.warning(error);\n }\n\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), undefined, [this._getSortColumnFromSelectedOption(notification.selectedOption)], undefined));\n transaction(() => {\n this.props.data.listPageState.result!.currentPageNumber = 0;\n this.props.data.listPageState.result!.sortingCritera = { Columns: [this._getSortColumnFromSelectedOption(notification.selectedOption)] };\n });\n };\n\n private readonly _getSortColumnFromSelectedOption = (option: ILabeledDropdownOption): SortColumn => {\n const { data } = this.props;\n\n if (!data.searchConfiguration.result) {\n return {};\n }\n\n const mappedConfiguration = data.searchConfiguration.result.find((searchConfiguration) => {\n return searchConfiguration.key === option.key;\n });\n\n if (mappedConfiguration) {\n return mappedConfiguration.sortColumn;\n }\n\n return {};\n };\n\n /**\n * Retrieves current sort criteria.\n * @returns Sort criteria column which is currently active or undefined if it's not specified.\n */\n private readonly _getSortCriteriaColumn = (): SortColumn | undefined => {\n const sortCriteria = this.props.data.listPageState.result?.sortingCritera;\n if (ArrayExtensions.hasElements(sortCriteria?.Columns)) {\n return sortCriteria!.Columns[0];\n }\n\n const queryColumns = parseQueryParam<SortColumn[]>('sorting', this.props.context.request);\n if (ArrayExtensions.hasElements(queryColumns)) {\n return queryColumns[0];\n }\n\n return undefined;\n };\n\n /**\n * Retrieves dropdown options.\n * @returns All dropdown options.\n */\n private readonly _getAllSortByOptions = (): ILabeledDropdownOption[] => {\n const searchConfiguration = this.props.data.searchConfiguration.result;\n\n if (!searchConfiguration) {\n return [];\n }\n\n const mappedSearchConfiguration = this.sortByDropdownOptions.filter(\n mappedSearchConfig => searchConfiguration.find(item => mappedSearchConfig.key === item.key)\n );\n\n return ArrayExtensions.validValues(mappedSearchConfiguration);\n };\n\n /**\n * Retrieves current selected dropdown option based on the sort criteria.\n * @returns Current dropdown option.\n */\n private readonly _getCurrentlySelectedOption = (): ILabeledDropdownOption | undefined => {\n const activeSortColumn = this._getSortCriteriaColumn();\n\n const searchConfiguration = this.props.data.searchConfiguration.result;\n\n if (!activeSortColumn || !searchConfiguration) {\n return undefined;\n }\n\n const activeMappedConfig = searchConfiguration.find(mappedSearchConfig => mappedSearchConfig.sortColumn.ColumnName === activeSortColumn.ColumnName &&\n mappedSearchConfig.sortColumn.IsDescending === activeSortColumn.IsDescending\n );\n if (!activeMappedConfig) {\n return undefined;\n }\n\n return this.sortByDropdownOptions.find(dropdownOption => dropdownOption.key === activeMappedConfig.key);\n };\n\n private readonly _onUpdateRefiners = (itemToggleNotification: IRefineItemToggleNotification): void => {\n const { context } = this.props;\n const requestContext = context && context.request;\n const actionContext = context && context.actionContext;\n\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\n const error = `Refine menu cannot refine search criteria: ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\n this.props.telemetry.warning(error);\n }\n\n const updatedRefinementCriteria = getUpdatedRefinementCriteria(itemToggleNotification, this.props.data.listPageState.result && this.props.data.listPageState.result.activeFilters || []);\n\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), updatedRefinementCriteria));\n transaction(() => {\n this.props.data.listPageState.result!.currentPageNumber = 0;\n this.props.data.listPageState.result!.activeFilters = updatedRefinementCriteria;\n });\n };\n\n private readonly _buildRefinerUrl = (itemToggleNotification: IRefineItemToggleNotification): string => {\n if (this.props.data.listPageState.result) {\n const newRefinementCriteria = getUpdatedRefinementCriteria(itemToggleNotification, this.props.data.listPageState.result.activeFilters || []);\n\n return buildListPageUrl(getCurrentUrl(this.props.context.request), newRefinementCriteria);\n }\n this.props.telemetry.warning('[buildRefinerQueryString]List Page State Not available, unable to build refiner URL');\n return '';\n\n };\n\n private readonly _onChoiceClicked = (notification: IChoiceSummaryClickNotification): void => {\n const { data, telemetry } = this.props;\n\n if (!data.listPageState.result) {\n telemetry.warning('[choice-summary-by-category._onChoiceClicked]ListPageState unavailable, unable to update refiners.');\n return;\n }\n\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n if (!notification.clearAll) {\n const selectedChoice = notification.choiceClicked;\n if (!selectedChoice) {\n telemetry.warning('[choice-summary-by-category._onChoiceClicked] Choice could not be determined');\n return;\n }\n currentRefinementCriteria = currentRefinementCriteria.filter(\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedChoice, selectedCriterion)\n );\n } else {\n currentRefinementCriteria = [];\n\n // Set focus to sort and filter\n const dropdownElementId = this._sortAndFilterContainerRef.current && this._sortAndFilterContainerRef.current.props.dropdownId;\n const dropdownElement = dropdownElementId && document.getElementById(dropdownElementId);\n setTimeout(() => {\n dropdownElement && dropdownElement.focus();\n },\n 50);\n }\n\n const fullUrl = getCurrentUrl(this.props.context.request);\n window.history.pushState({}, '', buildListPageUrl(fullUrl, currentRefinementCriteria));\n data.listPageState.result.currentPageNumber = 0;\n data.listPageState.result.activeFilters = currentRefinementCriteria;\n };\n\n private readonly _buildRefinerUrlForChoiceSummary = (selectedRefiner: ProductRefinerValue, isClearAll: boolean): string => {\n const { data, telemetry } = this.props;\n const fullUrl = getCurrentUrl(this.props.context.request);\n\n if (!data.listPageState.result) {\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl]ListPageState unavailable, unable to create refiner URL.');\n return fullUrl.href;\n }\n\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\n\n if (!isClearAll) {\n if (!selectedRefiner) {\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl] URL for Choice could not be determined');\n return fullUrl.href;\n }\n currentRefinementCriteria = currentRefinementCriteria.filter(\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedRefiner, selectedCriterion)\n );\n } else {\n currentRefinementCriteria = [];\n }\n\n return buildListPageUrl(fullUrl, currentRefinementCriteria);\n };\n\n private _getViewport(): GridSize {\n if (MsDyn365.isBrowser) {\n return isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n }\n return isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\n }\n\n private _toggleModal(): void {\n this.setState({\n modalIsOpen: !this.state.modalIsOpen\n });\n }\n\n private _updateViewport(): void {\n this._viewport = this._getViewport();\n\n if (this.state.modalIsOpen && !this.isMobile) {\n this._toggleModal();\n }\n }\n\n private readonly _getexpandRefinerCount = (validRefiners?: number, refinerCount?: expandRefinersCount): void => {\n switch (refinerCount) {\n case expandRefinersCount.all:\n this.expandrefinerCount = validRefiners;\n break;\n case expandRefinersCount.one:\n this.expandrefinerCount = 1;\n break;\n case expandRefinersCount.two:\n this.expandrefinerCount = 2;\n break;\n case expandRefinersCount.three:\n this.expandrefinerCount = 3;\n break;\n case expandRefinersCount.four:\n this.expandrefinerCount = 4;\n break;\n default:\n this.expandrefinerCount = 0;\n }\n };\n\n /**\n * Renders a Pagination previous text.\n * @param paginationPreviousText - Pagination previous text from resources.\n * @returns Previous text and flipper icon.\n */\n private readonly _renderPrev = (paginationPreviousText: string) => {\n return (\n <div className='msc-pagination__prev'>\n <span className='ms-search-result__pagination-left' aria-hidden='true' />\n <span className='prev-text'>\n {paginationPreviousText}\n </span>\n </div>\n );\n };\n\n /**\n * Renders a Pagination next text.\n * @param paginationNextText - Pagination next text from resources.\n * @returns Next text and flipper icon.\n */\n private readonly _renderNext = (paginationNextText: string) => {\n return (\n <div className='msc-pagination__next'>\n <span className='next-text'>\n {paginationNextText}\n </span>\n <span className='ms-search-result__pagination-right' aria-hidden='true' />\n </div>\n );\n };\n\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IOrderSummaryProps {\n subTotalLabel: string;\n shippingLabel: string;\n taxLabel: string;\n orderTotalLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n totalDiscountsLabel: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n id: string;\n typeName: string;\n otherChargeLabel?: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n retailMultiplePickUpOptionEnabled?: boolean;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n}\n\nexport interface IOrderSummaryLines {\n subtotal: React.ReactNode;\n shipping?: React.ReactNode;\n otherCharge?: React.ReactNode;\n tax: React.ReactNode;\n orderTotal: React.ReactNode;\n totalDiscounts?: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IOrderSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\ninterface IShippingOrderLine {\n cart: Cart;\n channelConfiguration: ChannelConfiguration;\n canShip?: boolean;\n hasDeliveryMethod?: boolean;\n hasShippingMethod?: boolean;\n freightFee?: number;\n}\n\nconst OrderSummaryLine: React.FC<IOrderSummaryLineProps> = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n <p className={`msc-order-summary__line-${cssLabel}`}>\n <span className='msc-order-summary__label'>\n {label}\n </span>\n {price || price === 0 ? (\n <PriceComponent\n data={{\n price: { CustomerContextualPrice: price }\n }}\n freePriceText={freeText}\n context={context}\n id={id}\n typeName={typeName}\n className='msc-order-summary__value'\n />\n ) : (\n <span className='msc-order-summary__value'>\n {toBeCalculatedText}\n </span>\n )}\n </p>\n );\n};\n\nconst _buildOrderSummarySection = (\n props: IOrderSummaryProps,\n price: number | undefined,\n cssLabel: string,\n label: string = ''\n): React.ReactNode => {\n return (\n <OrderSummaryLine\n price={price}\n label={label}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n toBeCalculatedText={props.toBeCalculatedText}\n freeText={props.freeText}\n telemetry={props.telemetry}\n cssLabel={cssLabel}\n />\n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nconst getDeliveryConfiguration = (cart: Cart, channelConfiguration: ChannelConfiguration, channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration, retailMultiplePickUpOptionEnabled?: boolean): IShippingOrderLine => {\n\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\n const cartLines = cart.CartLines || [];\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\n\n const freightFee = cart.ShippingChargeAmount;\n const canShip = deliveryModes.some(deliveryMode => (!((deliveryMode !== '' && (deliveryMode === getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) || deliveryMode === emailDeliveryModeCode)))));\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\n const hasShippingMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) && deliveryMode !== emailDeliveryModeCode);\n return {\n canShip,\n hasDeliveryMethod,\n hasShippingMethod,\n freightFee\n } as IShippingOrderLine;\n};\n\nconst getDeliveryMode = (deliveryMode?: string, featureSate: boolean = false, channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration, pickupDeliveryMode?: string) => {\n if (!featureSate) {\n return pickupDeliveryMode;\n }\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\n\n};\n\nexport const OrderSummary = (props: IOrderSummaryProps) => {\n const { SubtotalAmount, TaxAmount, DiscountAmountWithoutTax = 0, TotalAmount, OtherChargeAmount } = props.cart;\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(props.cart, props.channelConfiguration, props.channelDeliveryOptionConfig, props.retailMultiplePickUpOptionEnabled);\n const isTaxGreaterThanZero = TaxAmount !== undefined && TaxAmount > 0;\n const reactNodes: IOrderSummaryLines = {\n subtotal: _buildOrderSummarySection(props, SubtotalAmount, 'sub-total', props.subTotalLabel),\n tax: _buildOrderSummarySection(props, hasDeliveryMethod || isTaxGreaterThanZero ? TaxAmount : undefined, 'tax-amount', props.taxLabel),\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\n otherCharge: OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount, 'other-charges', props.otherChargeLabel) || undefined\n };\n\n if (canShip) {\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\n }\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\n }\n\n reactNodes.orderTotal = _buildOrderSummarySection({ ...props, freeText: undefined }, totalAmountAfterGiftCard, 'total', props.orderTotalLabel);\n }\n\n if (DiscountAmountWithoutTax > 0) {\n reactNodes.totalDiscounts = _buildOrderSummarySection(props, -DiscountAmountWithoutTax, 'total-discounts', props.totalDiscountsLabel);\n }\n\n return reactNodes;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './review-modal';\nexport * from './rnrInterface';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport checkoutStateDataAction from './checkout-state-data-action';\n\nexport * from './checkout-state';\nexport * from './checkout-state-data-action';\nexport * from './module-state-manager';\n\nexport { checkoutStateDataAction };\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface IErrorMessage {\n text?: string;\n}\n\nexport const ErrorMessage: React.FC<IErrorMessage> = ({ text }) => {\n return (\n <span className='ms-search-result-container__no-results-message'>\n <h5 className='error-text'>\n {' '}\n {text}\n {' '}\n </h5>\n </span>\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { CartLine, OrgUnitLocation, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPickUpInStoreViewProps {\n callbacks: {\n toggleBopis(isBopisSelected: boolean): void;\n };\n defaultComponent?: React.ReactNode;\n orgUnitName?: string;\n isBopisSelected: boolean;\n ContainerProps: INodeProps;\n deliveryOption?: string;\n}\n\nexport interface IPickUpInStoreProps {\n cartline: CartLine;\n product: SimpleProduct;\n shipitText: string;\n pickUpInStoreText: string;\n changeStoreText: string;\n cartState: ICartState | undefined;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n orgUnitLocations?: OrgUnitLocation[] | undefined;\n deliveryOptions?: ProductDeliveryOptions;\n pickupDeliveryModeCode?: string;\n storeSelectorModuleId?: string;\n locationChangedHandler(): void;\n}\n\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\n const _onLocationChangedCallback = async (orgUnitLocation: OrgUnitLocation, cartState: ICartState | undefined, cartline: CartLine, deliveryMode?: string) => {\n if (!cartState) {\n return Promise.resolve();\n }\n return cartState.updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n };\n\n const _toggleBOPIS = (isBopisSelected: boolean) => {\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\n\n if (isBopisSelected) {\n if (!storeSelectorStateManager) {\n return;\n }\n storeSelectorStateManager.openDialog({\n id: storeSelectorModuleId,\n product,\n alreadySelectedLocation: {\n OrgUnitNumber: cartline.FulfillmentStoreId\n },\n deliveryOptions: props.deliveryOptions,\n onLocationSelected: async (orgUnitLocation, deliveryMode: string | undefined) => {\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\n }\n })\n .catch(error => {});\n } else {\n if (!cartState) {\n return;\n }\n cartline.DeliveryMode = '';\n cartline.FulfillmentStoreId = '';\n cartline.ShippingAddress = {};\n cartState.clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\n .then(result => {\n if (result.status === 'SUCCESS') {\n props.locationChangedHandler();\n }\n })\n .catch(error => {});\n }\n };\n\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n\n };\n\n const _renderShippingMethod = (\n cartLine: CartLine,\n shipItText: string,\n pickupInStoretext: string,\n changeStoreText: string,\n orgUnitLocations: OrgUnitLocation[] | undefined): JSX.Element => {\n\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\n const bopisSelected = !!cartLine.FulfillmentStoreId;\n\n const toggleBOPIS = (isBopisSelected: boolean) => {\n return () => {\n _toggleBOPIS(isBopisSelected);\n };\n };\n\n return (\n <>\n <label className='msc-cart-line__bopis-shipping'>\n <input\n id={`ms-cart-bopis-ship-option-${cartLine.LineId}`}\n type='radio'\n name={`shippingType ${cartLine.LineId}`}\n onChange={toggleBOPIS(false)}\n value={shipItText}\n checked={!bopisSelected}\n aria-checked={!bopisSelected}\n key={`${cartLine.LineId}-shipit`}\n />\n {shipItText}\n </label>\n <label className='msc-cart-line__bopis-store-pickup'>\n <input\n id={`ms-cart-bopis-pickup-option-${cartLine.LineId}`}\n type='radio'\n name={`shippingType ${cartLine.LineId}`}\n onChange={toggleBOPIS(true)}\n value={pickupInStoretext}\n checked={bopisSelected}\n aria-checked={bopisSelected}\n key={`${cartLine.LineId}-pickup`}\n />\n {pickupInStoretext}\n </label>\n {\n cartLine.FulfillmentStoreId ? (\n <div className='msc-cart-line__bopis__fullfilment'>\n <span className='msc-cart-line__bopis__fullfilment-store'>\n {orgUnitName}\n </span>\n <button className='msc-cart-line__bopis-changestore btn' onClick={toggleBOPIS(true)}>\n {changeStoreText}\n </button>\n </div>\n ) : null\n }\n </>\n );\n };\n\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\n return delivery?.Description;\n };\n\n // If no delivery options present on the product, or none of the delivery options\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\n if (!props.deliveryOptions ||\n !props.deliveryOptions.DeliveryOptions ||\n !props.pickupDeliveryModeCode ||\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)) {\n return undefined;\n }\n\n return {\n callbacks: {\n toggleBopis: _toggleBOPIS\n },\n defaultComponent: _renderShippingMethod(props.cartline, props.shipitText, props.pickUpInStoreText, props.changeStoreText, props.orgUnitLocations),\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\n ContainerProps: {\n className: 'msc-cart-line__bopis-container'\n }\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n AddToOrderTemplateComponent, AddToWishlistComponent, CartLineItemComponent,\n IAddToOrderTemplateDialogResources, ICartlineResourceString, IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources, IOrderTemplateNameDialogResources, IWishlistActionSuccessResult } from '@msdyn365-commerce/components';\nimport MsDyn365, { IAny, ICoreContext, IGeneric, IGridSettings, IImageSettings, ITelemetry, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult,\n CartLine,\n ChannelDeliveryOptionConfiguration,\n CommerceList,\n Customer,\n LineDataValidationFailure,\n OrgUnitLocation,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ProductDimensionType, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\nimport {\n ArrayExtensions,\n getInvoiceDetailsPageUrlSync,\n getProductUrlSync,\n IProductInventoryInformation,\n ObjectExtensions,\n OrderTemplate\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\nimport { IPickUpInStoreViewProps, PickUpInStore } from './cart-pick-up-in-store';\n\nexport interface ICartLineItemsProps {\n cartlines: CartLine[];\n cartlinesErrors: LineDataValidationFailure[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n catalogs?: ProductCatalog[];\n\n /* GridSettings for the product image in cartline */\n gridSettings: IGridSettings;\n\n /* ImageSettings for the product image in cartline */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext<IGeneric<IAny>>;\n telemetry: ITelemetry;\n removeButtonText: string;\n addToWishlistButtonText: string;\n removeFromWishlistButtonText: string;\n shipItText: string;\n pickitUpText: string;\n changeStoreText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\n isStockCheckEnabled: boolean;\n wishlists: CommerceList[] | undefined;\n defaultWishlistName: string;\n maxCartlineQuantity: number;\n includeErrors?: boolean;\n showShippingChargesForLineItems?: boolean;\n telemetryContent?: ITelemetryContent;\n isQuantityLimitsFeatureEnabled: boolean;\n storeSelectorModuleId?: string;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n addToOrderTemplateButtonText: string;\n addToOrderTemplateButtonTooltip: string;\n addToOrderTemplateMessage: string;\n addItemToOrderTemplateError: string;\n orderTemplates: OrderTemplate[] | undefined;\n customerInformation: Customer | undefined;\n shouldIgnoreWarehouse: boolean | undefined;\n productAvailability?: AsyncResult<IProductInventoryInformation[]>;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number, lineIndex?: number): boolean;\n locationChangedHandler(): void;\n}\n\nexport interface ICartlinesViewProps {\n cartline: React.ReactNode;\n pickUpInStore?: IPickUpInStoreViewProps;\n remove: React.ReactNode;\n addToWishlist: React.ReactNode | undefined;\n addToOrderTemplate: React.ReactNode | undefined;\n\n error?: string;\n cartlineId?: string;\n hasError?: boolean;\n data?: {\n product?: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (isStockCheckEnabled: boolean, productAvailability: IProductInventoryInformation | undefined): number => {\n if (!isStockCheckEnabled ||\n !productAvailability ||\n !productAvailability.ProductAvailableQuantity ||\n !productAvailability.IsProductAvailable ||\n !productAvailability.ProductAvailableQuantity.AvailableQuantity) {\n return 0;\n }\n\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled ? (maxByQuantityLimitsFeatureResult < availableQuantityInStock ? maxByQuantityLimitsFeatureResult : availableQuantityInStock) : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n\n};\n\nconst _getErrorMessage = (availableQuantityInStock: number, currentQuantity: number,\n props: ICartLineItemsProps, lineIndex: number, shouldSkipStockCheck: boolean, cartLine: CartLine): string | undefined => {\n const finalErrorMessages: string[] = [];\n\n const isLoadingDeliveryOptions = props.productAvailability?.status === 'LOADING';\n if (isLoadingDeliveryOptions) {\n return undefined;\n }\n\n let foundProductAvailability;\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n foundProductAvailability = props.productAvailabilites.find((productAvailability) => {\n if (props.shouldIgnoreWarehouse) {\n return productAvailability.ProductAvailableQuantity.ProductId === cartLine.ProductId;\n }\n return productAvailability.ProductAvailableQuantity.ProductId === cartLine.ProductId &&\n productAvailability.InventLocationId === cartLine.WarehouseId;\n });\n if (foundProductAvailability === undefined) {\n return undefined;\n }\n }\n\n if (props.includeErrors && props.isStockCheckEnabled && !shouldSkipStockCheck) {\n if (availableQuantityInStock <= 0) {\n finalErrorMessages.push(props.outOfStockText);\n } else if (availableQuantityInStock < currentQuantity) {\n if (availableQuantityInStock === 1) {\n finalErrorMessages.push(props.outOfRangeOneText);\n } else {\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\n }\n }\n }\n\n // Server-side validation\n props.cartlinesErrors\n .filter(i => i.LineIndex === lineIndex)\n .forEach(i => {\n if (i.DataValidationFailure?.ErrorContext) {\n finalErrorMessages.push(i.DataValidationFailure.ErrorContext);\n }\n });\n\n if (finalErrorMessages.length > 0) {\n return finalErrorMessages.join(' ');\n }\n\n return undefined;\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\n\n// eslint-disable-next-line complexity -- Auto-suppressed.\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct | undefined,\n props: ICartLineItemsProps,\n index: number,\n foundProductAvailability?: IProductInventoryInformation,\n foundProductDeliveryOptions?: ProductDeliveryOptions): ICartlinesViewProps => {\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText,\n removeItemClickHandler, moveToWishlistSuccessHandler, addToOrderTemplateButtonText, addToOrderTemplateButtonTooltip,\n addToOrderTemplateDialogResources, createOrderTemplateDialogResources,\n itemAddedToOrderTemplateDialogResources, duplicateItemsWhenAddingToOrderTemplateDialogResources,\n addToWishlistButtonText, removeFromWishlistButtonText, orderTemplates, customerInformation,\n wishlists, defaultWishlistName, storeSelectorModuleId } = props;\n\n const isAuthenticated = context.request.user.isAuthenticated;\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\n const availableQuantityInStock = _getCartItemAvailableQuantity(props.isStockCheckEnabled, foundProductAvailability);\n\n const maxQuantity = product && _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0);\n\n // Skip stock check if the cart line is a service item or an invoice line\n const shouldSkipStockCheck = product?.ItemTypeValue === ReleasedProductType.Service || !!cartline.IsInvoiceLine;\n\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity) ? undefined : _getErrorMessage(availableQuantityInStock, cartline.Quantity!, props, index, shouldSkipStockCheck, cartline);\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\n const inventoryCode = foundProductAvailability ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}` : undefined;\n const productDimension = 4;\n const customPriceDimensionType = productDimension as ProductDimensionType.Style;\n const isCustomPriceSelected = product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === customPriceDimensionType)?.DimensionValue?.Value === 'Custom';\n\n let productUrl: string | undefined;\n if (product) {\n productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n\n if (MsDyn365.isBrowser) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n } else {\n productUrl = getInvoiceDetailsPageUrlSync(cartline.Description || '', props.context.actionContext);\n }\n\n return {\n data: {\n product,\n cartline\n },\n cartlineId: cartline.LineId,\n error: errorMessage,\n hasError: (!shouldSkipStockCheck && props.isStockCheckEnabled) ? cartline.Quantity! > (maxQuantity ?? 0) : false,\n cartline: (\n <CartLineItemComponent\n data={{\n cartLine: cartline,\n cartState: props.cartState,\n product,\n catalogs: props.catalogs\n }}\n currentQuantity={cartline.Quantity}\n maxQuantity={maxQuantity}\n isOutOfStock={(!shouldSkipStockCheck && props.isStockCheckEnabled) ? (availableQuantityInStock <= 0) : false}\n gridSettings={gridSettings}\n imageSettings={imageSettings}\n id={id}\n typeName={typeName}\n productUrl={productUrl}\n context={context}\n resources={resources}\n key={`${index}-${productUrl}`}\n lineIndex={index}\n isQuantityEditable={!ObjectExtensions.isNullOrUndefined(product)}\n quantityOnChange={props.updateCartLinesQuantitySuccessHandler}\n primaryImageUrl={product?.PrimaryImageUrl}\n errorMessage={errorMessage}\n inventoryInformationLabel={inventoryLbl}\n inventoryLabelClassName={inventoryCode}\n isCartStateReady={props.cartState?.status === 'READY'}\n showShippingChargesForLineItems={props.showShippingChargesForLineItems}\n telemetryContent={props.telemetryContent}\n channelDeliveryOptionConfig={props.channelDeliveryOptionConfig}\n />),\n pickUpInStore: product ? (\n PickUpInStore({\n storeSelectorModuleId,\n cartState: props.cartState,\n cartline,\n product,\n shipitText: props.shipItText,\n pickUpInStoreText: props.pickitUpText,\n changeStoreText: props.changeStoreText,\n storeSelectorStateManager: props.storeSelectorStateManager,\n orgUnitLocations: props.orgUnitLocations,\n deliveryOptions: foundProductDeliveryOptions,\n pickupDeliveryModeCode: cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\n locationChangedHandler: props.locationChangedHandler\n })\n ) : undefined,\n remove: (\n <Button\n className='msc-cart-line__remove-item'\n onClick={onRemoveClickHandler}\n title={removeButtonText}\n {...attributes}\n >\n {removeButtonText}\n </Button>\n ),\n addToWishlist: (\n isAuthenticated && product && !isCustomPriceSelected ? (\n <AddToWishlistComponent\n className='msc-cart-line__add-to-wishlist'\n addToWishlistButtonText={addToWishlistButtonText}\n removeFromWishlistButtonText={removeFromWishlistButtonText}\n context={context}\n id={id}\n key={cartline.LineId}\n typeName={typeName}\n nameOfWishlist={nameOfWishlist}\n cartline={cartline}\n showButtonText\n showStatusMessage={false}\n showRemoveButton={false}\n showButtonTooltip={false}\n ariaRole='button'\n data={{\n wishlists,\n product\n }}\n onSuccess={moveToWishlistSuccessHandler}\n />\n ) : undefined\n ),\n addToOrderTemplate: (\n isAuthenticated && orderTemplates && product ? (\n <AddToOrderTemplateComponent\n className={classnames('msc-cart-line__add-to-order-template', isCustomPriceSelected ? 'disabled' : '')}\n addToOrderTemplateButtonText={addToOrderTemplateButtonText}\n addToOrderTemplateButtonTooltip={addToOrderTemplateButtonTooltip}\n addToOrderTemplateDialogResources={addToOrderTemplateDialogResources}\n createOrderTemplateDialogResources={createOrderTemplateDialogResources}\n itemAddedToOrderTemplateDialogResources={itemAddedToOrderTemplateDialogResources}\n duplicateItemsWhenAddingToOrderTemplateDialogResources={duplicateItemsWhenAddingToOrderTemplateDialogResources}\n data={{ product, quantity: cartline.Quantity || 1, orderTemplates, customerInformation }}\n context={context}\n showButtonText\n shouldShowButtonFailedTooltip={isCustomPriceSelected}\n disableButton={isCustomPriceSelected}\n id={id}\n typeName={typeName}\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- App config settings are of \"any\" value\n showButtonTooltip={!props.context.app.config.disableTooltip || false}\n />\n ) : undefined\n )\n };\n};\n\nexport const assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: ICartLineItemsProps): ICartlinesViewProps[] | null => {\n const reactNodes: ICartlinesViewProps[] = [];\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\n foundProductAvailability = props.productAvailabilites.find((productAvailability) => {\n if (props.shouldIgnoreWarehouse) {\n return productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId;\n }\n return productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId &&\n productAvailability.InventLocationId === cartline.WarehouseId;\n });\n }\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find((deliveryOption) => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption));\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n * @param props\n */\nexport const CartLineItems = (props: ICartLineItemsProps) => {\n const { products, cartlines } = props;\n return (\n assembleCartlines(cartlines, products, props)\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport groupBy from 'lodash/groupBy';\n\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './cart-line-items';\n\nconst _assembleGroupCartlines = (cartlines: CartLine[], products: SimpleProduct[] | undefined, props: ICartLineItemsProps): ICartlinesViewProps[][] | null => {\n const reactNodes: ICartlinesViewProps[][] = [];\n if (!products || products.length === 0) {\n props.context.telemetry.error('Products content is empty, module wont render');\n return null;\n }\n\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => (item.DeliveryMode));\n const groupDelivery = getGroupByDelivery(cartlines);\n const cartLinesGroup: CartLine[] = [];\n\n // 1) Group by store and pick up mode\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\n // @ts-expect-error\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\n });\n\n // 2) Create cartlines group\n Object.keys(cartLinesGroup).forEach(key => {\n const cartLines = cartLinesGroup[key];\n Object.keys(cartLines).forEach(index => {\n const cartLine = cartLines[index];\n const carLineViewProps = assembleCartlines(cartLine, products, props);\n if (carLineViewProps !== null) {\n reactNodes.push(carLineViewProps);\n }\n });\n\n });\n\n return reactNodes;\n};\n\n/**\n * CartLine Group component.\n * @param props\n */\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\n const { products, cartlines } = props;\n return (\n _assembleGroupCartlines(cartlines, products, props)\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IPromotionData entity interface.\n */\nexport interface IPromotionData {\n promotionOptions?: CartPromotionLine[];\n}\n\n/**\n * Calls the Retail API and returns a promotion data.\n * @param ctx\n */\nexport async function getPromotionData(ctx: IActionContext): Promise<IPromotionData> {\n const promotionData: IPromotionData = {};\n\n await getPromotionOptionsForCartLineItems(\n new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings),\n ctx\n ).then(promotionOptions => {\n if (promotionOptions) {\n promotionData.promotionOptions = promotionOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n return {};\n });\n\n return promotionData;\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n IAddToOrderTemplateDialogResources, IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\n IItemAddedToOrderTemplateDialogResources, ILinesAddedToOrderTemplateDialogResources, IOrderTemplateNameDialogResources,\n IWishlistActionSuccessResult, PromoCodeComponent, SaveCartToOrderTemplateComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport { AsyncResult, CartLine, LineDataValidationFailure } from '@msdyn365-commerce/retail-proxy';\nimport { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { cartLineQuantityUpdatedAsync, validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport {\n ActiveCartProductsInput,\n ArrayExtensions,\n getActiveCartProductsAction,\n ICartLineInventoryValidationResult,\n ObjectExtensions,\n validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, INodeProps, IPayLoad,\n ITelemetryContent, TelemetryConstant, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\n\nimport { ICartData } from './cart.data';\nimport { ICartProps, ICartResources } from './cart.props.autogenerated';\nimport { CartLineGroupItems } from './components/cart-line-groups';\nimport { CartLineItems, ICartlinesViewProps } from './components/cart-line-items';\nimport { cartPromotions, ICartLineItemViewProps } from './components/cart-line-items-promotion';\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-cart';\n\n/**\n * Cart view props interface.\n */\nexport interface ICartViewProps extends ICartProps<ICartData> {\n className: string;\n title?: React.ReactNode;\n CartlinesWrapper: INodeProps;\n cartlines?: ICartlinesViewProps[];\n cartLinesGroup?: ICartlinesViewProps[][];\n cart: ICartState | undefined;\n orderSummaryHeading: React.ReactNode;\n orderSummaryLineitems?: IOrderSummaryLines;\n invoiceSummaryLineitems?: IInvoiceSummaryLines;\n OrderSummaryWrapper: INodeProps;\n OrderSummaryItems: INodeProps;\n OrderSummaryErrors?: IOrderSummaryErrors;\n checkoutAsGuestButton: React.ReactNode;\n checkoutAsSignInUserButton: React.ReactNode;\n storeSelector?: React.ReactNode;\n expressCheckoutButton?: React.ReactNode;\n backToShoppingButton: React.ReactNode;\n waitingComponent: React.ReactNode;\n promotionOptions?: ICartLineItemViewProps;\n promoCode: React.ReactNode;\n cartLoadingStatus: string;\n cartDataResult: boolean;\n multiplePickUpEnabled?: boolean;\n createTemplateFromCartButton: React.ReactNode;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\n}\n\n/**\n * Order summary errors interface.\n */\nexport interface IOrderSummaryErrors {\n Wrapper: INodeProps;\n header: React.ReactNode;\n errors: React.ReactNode[];\n}\n\n/**\n * Cart component state interface.\n */\ninterface ICartComponentState {\n showPromotionDialog: boolean;\n cartlinesErrors: LineDataValidationFailure[];\n promotionData: IPromotionData;\n isCartValid: boolean;\n}\n\n/**\n * Cart component.\n * @extends {React.PureComponent<ICartProps<ICartData>>}\n */\n@observer\nclass Cart extends React.Component<ICartProps<ICartData>> {\n\n public state: ICartComponentState;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly payLoad: IPayLoad;\n\n private isQuantityLimitsFeatureEnabled: boolean = false;\n\n private _isMounted: boolean = false;\n\n private readonly promotionPopupId: string = 'cart-promotion-popup';\n\n public constructor(props: ICartProps<ICartData>) {\n super(props);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n this.payLoad = getPayloadObject('click', this.telemetryContent, '');\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\n this.state = {\n cartlinesErrors: [],\n showPromotionDialog: false,\n promotionData: {},\n isCartValid: true\n };\n }\n\n /**\n * Component did mount function.\n */\n public async componentDidMount(): Promise<void> {\n this._isMounted = true;\n const {\n config,\n context: {\n actionContext\n }\n } = this.props;\n\n this.isQuantityLimitsFeatureEnabled = await this.getOrderQuantityLimitsFeatureFlag();\n if (this.isQuantityLimitsFeatureEnabled) {\n await this.validateCart();\n }\n\n if (config.showAvailablePromotions) {\n if (this._isMounted && this.props.data.cart.result?.cart.CartLines) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n if (this._isMounted) {\n this.setState({ promotionData: await getPromotionData(actionContext) });\n }\n }\n );\n }\n }\n\n /**\n * Component will unmount function.\n */\n public componentWillUnmount(): void {\n this._isMounted = false;\n }\n\n /**\n * Should component update function.\n * @param nextProps - Next props.\n * @param nextState - Next state.\n * @returns True if component should update, false otherwise.\n */\n public shouldComponentUpdate(nextProps: ICartProps<ICartData>,\n nextState: ICartComponentState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n /* eslint-disable complexity -- Disabling complexity for render method */\n public render(): JSX.Element | null {\n const {\n data: {\n cart: { result: cart },\n products: { result: products }\n },\n context: {\n request: {\n user: {\n isAuthenticated,\n signInUrl\n }\n }\n },\n resources\n } = this.props;\n\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const backToShoppingUrl = getUrlSync('home', this.props.context.actionContext) || '';\n const checkoutURL = this.getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n const cartLines = this._getCartLines();\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.props.data.productAvailabilites.result ?? [],\n this.props.context.actionContext,\n products ?? [],\n emailDeliveryModeCode);\n\n const hasError = !validInventoryAcrossCartLines?.isValid || !validInventoryAcrossCartLines && !this.state.isCartValid || (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature');\n const multiplePickUpEnabled = !cart?.hasInvoiceLine && RetailMultiplePickupFeatureState?.IsEnabled;\n const cartLinesGroup = multiplePickUpEnabled ? this.getCartLinesGroup() : null;\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\n\n // If there's inventory issues across multiple cart lines then update the error and display as part of the order summary\n if (validInventoryAcrossCartLines && !validInventoryAcrossCartLines.isValid) {\n if (multiplePickUpEnabled && cartLinesGroup !== null) {\n for (const cartLineGroup of cartLinesGroup) {\n this._updateCartLineErrorForInvalidInventory(cartLineGroup, validInventoryAcrossCartLines);\n }\n }\n\n this._updateCartLineErrorForInvalidInventory(cartLines, validInventoryAcrossCartLines);\n }\n\n const viewProps = {\n ...this.props,\n className: classnames('ms-cart'),\n title: <h1 className='msc-cart__heading'>\n {resources.cartTitle}\n </h1>,\n cart: this.props.data.cart.result,\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\n OrderSummaryWrapper: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary-wrapper' : 'msc-order-summary-wrapper' },\n OrderSummaryItems: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary__items' : 'msc-order-summary__items' },\n cartlines: cartLines,\n cartLinesGroup,\n promoCode: this._getPromoCode(),\n promotionOptions: this._getPromotions(),\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry: this.props.telemetry,\n id: this.props.id,\n multiplePickUpEnabled,\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\n cart?.hasInvoiceLine ? <h2 className='msc-invoice-summary__heading'>\n { resources.invoiceSummaryTitle }\n </h2> : <h2 className='msc-order-summary__heading'>\n { resources.orderSummaryTitle}\n </h2>\n ) : null,\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\n invoiceSummaryLineitems: this._getInvoiceSummaryLineItems(),\n checkoutAsSignInUserButton: (!isCartEmpty) ? (\n <Button\n disabled={hasError} className='msc-cart__btn-checkout' href={checkoutURL}\n title={resources.checkoutButtonTitle} {...checkoutBySignInAttributes} >\n {resources.checkoutButtonTitle}\n </Button>\n ) : null,\n checkoutAsGuestButton: (!isCartEmpty && !isAuthenticated) ? (\n <Button\n disabled={hasError} className='msc-cart__btn-guestcheckout' href={guestCheckoutUrl}\n title={resources.guestCheckoutButtonTitle} {...checkoutByGuestAttributes}>\n {resources.guestCheckoutButtonTitle}\n </Button>\n ) : null,\n expressCheckoutButton: !isCartEmpty ? (this.props.slots.paymentExpress) : null,\n backToShoppingButton: <Button\n className='msc-cart__btn-backtoshopping' {...backtoShoppingAttributes} href={backToShoppingUrl}\n title={resources.backToShoppingButtonTitle}>\n {resources.backToShoppingButtonTitle}\n </Button>,\n createTemplateFromCartButton: (this._displayAddCartToTemplate() && products) ? (\n <SaveCartToOrderTemplateComponent\n addToOrderTemplateDialogResources={this._generateAddToOrderTemplateDialogResources(resources)}\n createOrderTemplateDialogResources={this._generateOrderTemplateNameDialogResources(resources)}\n linesAddedToOrderTemplateDialogResources={this._generateLinesAddedToOrderTemplateDialogResources(resources)}\n createOrderTemplateFromCartButton={resources.createOrderTemplateFromCartButton}\n createOrderTemplateFromCartButtonTooltip={resources.createOrderTemplateFromCartButtonTooltip}\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{\n orderTemplates: this.props.data.orderTemplates.result!,\n cartLines: this.props.data.cart.result!.cart.CartLines!,\n customerInformation: this.props.data.customerInformation.result\n }}\n />\n ) : null,\n storeSelector: this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n waitingComponent: <Waiting className='msc-waiting-circular msc-waiting-lg' />,\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\n telemetryContent: this.telemetryContent\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n /* eslint-enable complexity -- Disabling complexity for render method */\n\n /**\n * Promotion click event handler.\n * @param event - The mouse event.\n */\n private readonly promotionLinkClick = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {\n this.setState({\n showPromotionDialog: !this.state.showPromotionDialog\n });\n };\n\n /**\n * Promotion close button click.\n */\n private readonly promotionCloseButtonclick = () => {\n this._hidePromotionDialog();\n };\n\n /**\n * Hide promotion dialog.\n */\n private _hidePromotionDialog(): void {\n this.setState({\n showPromotionDialog: false\n });\n }\n\n /**\n * Display add to cart template.\n * @returns True if should display, false otherwise.\n */\n private _displayAddCartToTemplate(): boolean {\n const cart = this.props.data.cart?.result;\n if (ObjectExtensions.isNullOrUndefined(cart) || cart.hasInvoiceLine) {\n return false;\n }\n\n const RetailB2BEcommerceFeatureState = this.props.data.featureState.result?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailB2BEcommerceFeature');\n if (RetailB2BEcommerceFeatureState?.IsEnabled && this.props.data.customerInformation.result?.IsB2b && this.props.data.orderTemplates.result &&\n ArrayExtensions.hasElements(cart.cart?.CartLines) && this.props.data.customerInformation.result) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Get promotions.\n * @returns React node with the promotions.\n */\n private _getPromotions(): React.ReactNode {\n return (\n this.props.config.showAvailablePromotions &&\n cartPromotions({\n id: this.promotionPopupId,\n showPromotionPopup: this.state.showPromotionDialog,\n onSeeAllClick: this.promotionLinkClick,\n onCloseButtonClick: this.promotionCloseButtonclick,\n promotions: this.state.promotionData.promotionOptions,\n resources: {\n promotionStringHeading: this.props.resources.promotionStringHeading,\n promotionLinkText: this.props.resources.promotionLinkText,\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\n }\n })\n );\n }\n\n /**\n * Add error message in cart line in case the quantity exceeds the current inventory.\n * @param cartLines - The cart lines.\n * @param cartLineInventoryValidationResult - The cart line inventory result.\n */\n private _updateCartLineErrorForInvalidInventory(\n cartLines: ICartlinesViewProps[] | null, cartLineInventoryValidationResult: ICartLineInventoryValidationResult) {\n const { resources } = this.props;\n\n if (ArrayExtensions.hasElements(cartLines) &&\n !cartLineInventoryValidationResult.isValid &&\n ArrayExtensions.hasElements(cartLineInventoryValidationResult.productIdWithErrors)) {\n\n for (const productIdWithError of cartLineInventoryValidationResult.productIdWithErrors) {\n const cartLine = cartLines.find(element => element.data?.cartline.ProductId === productIdWithError);\n if (cartLine) {\n cartLine.error = resources.outOfStockErrorMessage;\n cartLine.hasError = true;\n }\n }\n }\n }\n\n /**\n * Get order summary errors.\n * @param cartLines - The cart lines.\n * @returns Order summary errors.\n */\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\n const allErrors = cartLines && cartLines.map(cartline => {\n\n // Check if the product is service or not by product type\n const isServiceItem = cartline.data?.product?.ItemTypeValue === ReleasedProductType.Service;\n\n if (!isServiceItem && cartline.error) {\n const fullError = (cartline.data && cartline.data.product?.Name) ? `${cartline.data.product.Name}: ${cartline.error}` : cartline.error;\n\n return (\n <div className='msc-alert__line'>\n {fullError}\n </div>\n );\n }\n\n return null;\n }).filter((line): line is JSX.Element => !!line) || [];\n\n return {\n Wrapper: {\n tag: Alert,\n className: 'msc-alert',\n isOpen: allErrors.length > 0,\n color: 'danger',\n assertive: true,\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\n },\n header: (\n <div className='msc-alert__header' aria-hidden='true'>\n <span className='msi-exclamation-triangle' />\n <span>\n {this.props.resources.outOfStockErrorMessageHeader}\n </span>\n </div>\n ),\n errors: allErrors\n };\n }\n\n /**\n * Gets invoice summary line items.\n * @returns Invoice summary lines.\n */\n private _getInvoiceSummaryLineItems(): IInvoiceSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart }\n },\n telemetry,\n resources\n } = this.props;\n\n return cart?.hasInvoiceLine ? (\n InvoiceSummary({\n orderTotalLabel: resources.totalAmountLabel,\n invoiceLabel: resources.invoiceLabel,\n cart: cart.cart,\n context: this.props.context,\n typeName: this.props.typeName,\n telemetry,\n id: this.props.id\n })\n ) : undefined;\n }\n\n /**\n * Gets order summary line items.\n * @returns Order summary lines.\n */\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\n const {\n data: {\n cart: { result: cart },\n channelDeliveryOptionConfig\n },\n telemetry,\n resources\n } = this.props;\n\n const channelConfiguration = this.props.context && this.props.context.request && this.props.context.request.channel;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const featureState = this.props?.data?.featureState;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) && !cart?.hasInvoiceLine ? (\n OrderSummary({\n cart: cart!.cart,\n subTotalLabel: resources.itemsWithCountLabel,\n shippingLabel: resources.estimatedShippingLabel,\n otherChargeLabel: resources.otherCharges,\n taxLabel: resources.estimatedTaxLabel,\n orderTotalLabel: resources.orderTotal,\n totalDiscountsLabel: resources.totalDiscountsLabel,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n toBeCalculatedText: resources.yetToBeCalculatedText,\n freeText: resources.priceFree,\n channelConfiguration,\n retailMultiplePickUpOptionEnabled,\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\n telemetry\n })\n ) : undefined;\n }\n\n /**\n * Gets promo code.\n * @returns React node with the promo code.\n */\n private _getPromoCode(): React.ReactNode {\n const {\n data: {\n cart: { result: cart }\n },\n resources\n } = this.props;\n\n return cart && (\n <PromoCodeComponent\n cart={cart}\n promoCodeHeadingText={resources.promoCodeHeadingText}\n promoPlaceholderText={resources.promoPlaceholderText}\n promoCodeApplyButtonText={resources.promoCodeApplyButtonText}\n appliedPromoCodeHeadingText={resources.appliedPromoCodeHeadingText}\n collapseTimeOut={350}\n removePromoAriaLabelFormat={resources.removePromoAriaLabelFormat}\n removePromoText={resources.removePromoText}\n invalidPromoCodeErrorText={resources.invalidPromoCodeErrorText}\n failedToAddPromoCodeErrorText={resources.failedToAddPromoCodeErrorText}\n failedToRemovePromoCodeErrorText={resources.failedToRemovePromoCodeErrorText}\n duplicatePromoCodeErrorText={resources.duplicatePromotionErrorText}\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{}}\n telemetryContent={this.telemetryContent}\n />\n );\n }\n\n /**\n * Generate add to order template dialog resources.\n * @param resources - The resources.\n * @returns IAddToOrderTemplateDialogResources.\n */\n private _generateAddToOrderTemplateDialogResources(resources: ICartResources): IAddToOrderTemplateDialogResources {\n return {\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\n\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\n\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\n\n selectTemplatesText: resources.selectTemplatesText,\n addToTemplateButtonText: resources.addToTemplateButtonText,\n lineItemsText: resources.lineItemsText\n };\n }\n\n /**\n * Generate item added to order template dialog resources.\n * @param resources - The resources.\n * @returns IItemAddedToOrderTemplateDialogResources.\n */\n private _generateItemAddedToOrderTemplateDialogResources(resources: ICartResources): IItemAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\n freePriceText: resources.freePriceText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText\n };\n }\n\n /**\n * Generate lines added to order template dialog resources.\n * @param resources - The resources.\n * @returns ILinesAddedToOrderTemplateDialogResources.\n */\n private _generateLinesAddedToOrderTemplateDialogResources(resources: ICartResources): ILinesAddedToOrderTemplateDialogResources {\n return {\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\n continueShoppingButtonText: resources.continueShoppingButtonText,\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText,\n linesAddedToOrderTemplateCustomPriceAlertMessageText: resources.linesAddedToOrderTemplateCustomPriceAlertMessageText\n };\n }\n\n /**\n * Generate duplicate items when adding to order template dialog resources.\n * @param resources - The resources.\n * @returns IDuplicateItemsWhenAddingToOrderTemplateDialogResources.\n */\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources: ICartResources): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\n return {\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\n updateQuantityButtonText: resources.updateQuantityButtonText,\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\n };\n }\n\n /**\n * Generate order template name dialog resources.\n * @param resources - The resources.\n * @returns IOrderTemplateNameDialogResources.\n */\n private _generateOrderTemplateNameDialogResources(resources: ICartResources): IOrderTemplateNameDialogResources {\n return {\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\n orderTemplateTitleLabel: resources.orderTemplateTitle,\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\n orderTemplateDescription: resources.createOrderTemplateDescription,\n\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\n\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\n };\n }\n\n /**\n * Gets the cart lines view props.\n * @returns ICartlinesViewProps [].\n */\n private _getCartLines(): ICartlinesViewProps[] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: {\n channel: {\n PickupDeliveryModeCode\n } = { PickupDeliveryModeCode: undefined }\n }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n return ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\n CartLineItems({\n cartlines: cart!.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n productAvailability: this.props.data.productAvailabilites\n })\n ) : null;\n }\n\n /**\n * Gets the checkout URL.\n * @param isAuthenticated - Is authenticated flag.\n * @param guestCheckoutUrl - Guest checkout URL.\n * @param signInUrl -The sign in URL.\n * @returns The checkout URL.\n */\n private getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (MsDyn365.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Gets the image settings.\n * @param imageSettings - Image settings.\n * @returns IImageSettings.\n */\n private readonly getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n };\n\n /**\n * Remove item from cart handler.\n * @param cartlineToRemove - The cart line to remove.\n */\n private readonly removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input)\n .then(() => {\n this.validateCart()\n .catch((error) => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n })\n .catch((error) => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n /**\n * Move to wish list handler.\n * @param result - The wish list action success result.\n * @param cartline - The cart line.\n */\n private readonly moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\n if (result.status === 'ADDED' && cartline) {\n this.removeItemFromCartHandler(cartline);\n }\n };\n\n /**\n * Updates the cart line quantity.\n * @param cartlineToUpdate - The cart line.\n * @param quantity - The quantity.\n * @param lineIndex - The line index.\n * @returns True if the cart line was updated, false otherwise.\n */\n private readonly updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number, lineIndex?: number): boolean => {\n cartLineQuantityUpdatedAsync(\n this.isQuantityLimitsFeatureEnabled,\n this.props.data.cart.result,\n this.props.telemetry,\n this.props.data.products.result,\n cartlineToUpdate,\n quantity)\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\n if (cartActionResult?.status === 'SUCCESS') {\n this.validateCart().catch((error) => {\n this.props.telemetry.warning((error as Error).message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n\n return true;\n }\n\n if (!ObjectExtensions.isNullOrUndefined(cartActionResult)) {\n // Show update line error message.\n const lineUpdateFailure: LineDataValidationFailure = {\n LineIndex: ObjectExtensions.isNullOrUndefined(lineIndex) ? 0 : lineIndex,\n DataValidationFailure: {\n ErrorContext:\n ArrayExtensions.hasElements(cartActionResult.validationResults) ? cartActionResult.validationResults[0].ErrorContext : '',\n LocalizedMessage: cartActionResult.errorDetails?.LocalizedMessage\n }\n };\n\n this.setState((previousState: Readonly<ICartComponentState>) => {\n const currentErrors: LineDataValidationFailure[] = previousState.cartlinesErrors.filter(error => error.LineIndex !== lineIndex);\n currentErrors.push(lineUpdateFailure);\n return { cartlinesErrors: currentErrors };\n });\n }\n\n return false;\n })\n .catch(() => {\n return false;\n });\n\n return false;\n };\n\n /**\n * Fulfillment store id is updated.\n */\n private readonly fulfillmentStoreIdUpdated = () => {\n if (this.isQuantityLimitsFeatureEnabled) {\n // Refresh products (in props.data) based on latest cart.\n getActiveCartProductsAction(new ActiveCartProductsInput(), this.props.context.actionContext)\n .then(async () => this.validateCart())\n .catch((error: Error) => {\n this.props.telemetry.warning(error.message);\n this.props.telemetry.debug('Unable to validate Cart');\n });\n }\n };\n\n /**\n * Validates cart.\n * @returns Void promise.\n */\n private async validateCart(): Promise<void> {\n const {\n data: { cart },\n telemetry,\n context\n } = this.props;\n\n const validationResults: LineDataValidationFailure[] | undefined = await validateCartAsync(this.isQuantityLimitsFeatureEnabled,\n cart,\n telemetry,\n context,\n true);\n\n if (validationResults) {\n const isValid = !ArrayExtensions.hasElements(validationResults);\n this.setState({\n cartlinesErrors: validationResults,\n isCartValid: isValid\n });\n } else {\n this.setState({ isCartValid: true });\n }\n\n return AsyncResult.resolve();\n }\n\n /**\n * Get order quantity limit feature flag.\n * @returns True if flag is enabled, false otherwise.\n */\n private async getOrderQuantityLimitsFeatureFlag(): Promise<boolean> {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n try {\n const featureStatuses = await this.props.data.featureState;\n const isQuantityLimitsFeatureEnabledInHq = featureStatuses\n .find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n return false;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n try {\n const customerInfo = await this.props.data.customerInformation;\n return !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n return false;\n }\n }\n\n /**\n * Gets the cart lines group.\n * @returns ICartlinesViewProps [][].\n */\n private getCartLinesGroup(): ICartlinesViewProps[][] | null {\n const {\n data: {\n cart: { result: cart },\n wishlists: { result: wishlists },\n orderTemplates: { result: orderTemplates },\n customerInformation: { result: customerInformation }\n },\n context: {\n request: {\n channel: {\n PickupDeliveryModeCode\n } = { PickupDeliveryModeCode: undefined }\n }\n },\n config,\n telemetry,\n resources,\n modules\n } = this.props;\n\n const imageSettings = this.getImageSettings(config.imageSettings);\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n\n return this.props.data.products && this.props.data.products.result && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0 && this.props.data.channelDeliveryOptionConfig?.result ? (\n CartLineGroupItems({\n cartlines: cart.cart.CartLines,\n storeSelectorModuleId: storeSelectorId,\n cartlinesErrors,\n products: this.props.data.products.result,\n productAvailabilites: this.props.data.productAvailabilites.result,\n productDeliveryOptions: this.props.data.deliveryOptions.result,\n catalogs: this.props.data.catalogs?.result,\n imageSettings,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n amountString: resources.productDimensionTypeAmount,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\n discountStringText: resources.discountStringText,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n shippingChargesText: resources.shippingCharges,\n priceEditorResources: {\n ...resources\n }\n },\n telemetry,\n addToWishlistButtonText: resources.addToWishlistButtonText,\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\n removeButtonText: resources.removeCartButtonText,\n shipItText: resources.shipInsteadDisplayText,\n pickitUpText: resources.pickItUpDisplayText,\n changeStoreText: resources.changeStoreDisplayText,\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\n outOfStockText: resources.outOfStockErrorMessage,\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\n cartState: this.props.data.cart.result,\n orgUnitLocations: this.props.data.orgUnitLocations.result,\n removeItemClickHandler: this.removeItemFromCartHandler,\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\n wishlists,\n defaultWishlistName: resources.defaultWishlistName,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n includeErrors: config.showOutOfStockErrors,\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\n telemetryContent: this.telemetryContent,\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\n\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(resources),\n\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\n orderTemplates,\n customerInformation,\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\n productAvailability: this.props.data.productAvailabilites\n })\n ) : null;\n }\n}\n\nexport default Cart;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface ICartLineItemPromotion {\n id: string;\n showPromotionPopup: boolean;\n promotions: CartPromotionLine[] | undefined;\n resources: ICartLineItemPromotionResourceString;\n onSeeAllClick(event: React.MouseEvent<HTMLElement>): void;\n onCloseButtonClick(): void;\n}\n\nexport interface ICartLineItemViewProps {\n promotionMessageWrapper: INodeProps;\n promotionMessage: React.ReactNode;\n promotionSeeAllLink: React.ReactElement;\n promotionDialog: React.ReactNode;\n}\n\nexport interface ICartLineItemPromotionResourceString {\n promotionLinkText: string;\n promotionStringHeading: string;\n promotionPopupHeading: string;\n promotionCloseButtonAriaLabel: string;\n}\n\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\n\n const {\n id,\n showPromotionPopup,\n promotions,\n resources: {\n promotionLinkText,\n promotionPopupHeading\n },\n onCloseButtonClick,\n onSeeAllClick\n } = props;\n\n if (!ArrayExtensions.hasElements(promotions)) {\n return;\n }\n\n const titleId = `${id}_title`;\n const className = 'msc-cart__promotion';\n return {\n promotionMessageWrapper: {\n className: 'msc-cart__promotion'\n },\n promotionMessage: (\n <>\n <span className='msi-promotion-icon' />\n <span>\n {' '}\n {props.resources.promotionStringHeading}\n </span>\n </>\n ),\n promotionSeeAllLink: (\n <a\n className='msc-cart__promotion_link' tabIndex={0} role='link'\n onClick={onSeeAllClick}>\n {' '}\n {promotionLinkText}\n {' '}\n </a>),\n promotionDialog: (\n <Modal isOpen={showPromotionPopup} className={`${className}`} toggle={onCloseButtonClick}>\n <ModalHeader className={`${className}__dialog__header`} toggle={onCloseButtonClick}>\n <h5 id={titleId} className='msc-cart__promotion-popup_title'>\n {promotionPopupHeading}\n </h5>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <ul>\n {promotions.map(_promotion => {\n return (\n <li className='msc-cart__promotion-popup_name' key={_promotion.LineId}>\n {_promotion.Promotion?.OfferName}\n {' '}\n </li>\n );\n }\n )}\n </ul>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`} />\n </Modal>\n )\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\n/**\n * SubmitHelpfulnessVote Input Action.\n */\nexport class SubmitHelpfulnessVoteInput implements IActionInput {\n public reviewId: string;\n\n public tenantId: string;\n\n public locale: string;\n\n public serviceEndpoint: string;\n\n public isHelpful: boolean;\n\n public authToken: string;\n\n constructor(\n reviewId: string,\n tenantId: string,\n locale: string,\n isHelpful: boolean,\n authToken: string,\n serviceEndpoint: string\n ) {\n this.reviewId = reviewId;\n this.tenantId = tenantId;\n this.locale = locale;\n this.isHelpful = isHelpful;\n this.authToken = authToken;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => 'SubmitHelpfulnessVote';\n\n public getCacheObjectType = () => 'SubmitHelpfulnessVote';\n\n public dataCacheType = (): CacheType => 'none';\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Carousel } from '@msdyn365-commerce/components';\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ICarouselViewProps } from './carousel';\n\n/**\n * Returns item slots.\n * @returns Array of item slots.\n * @param props -Props.\n */\nconst retrieveItems = (props: ICarouselViewProps): React.ReactNode[] => {\n let items = [];\n items = props.slots && props.slots.content && props.slots.content.length > 0 ? props.slots.content : [];\n return items;\n};\nconst CarouselView: React.FC<ICarouselViewProps> = props => (\n <Module {...props.carouselContainer} {...props.renderModuleAttributes(props)}>\n <Carousel\n className={classnames(props.closeAnimation)}\n activeIndex={props.activeIndex}\n next={props.next}\n previous={props.previous}\n pause={props.config.pauseOnHover ? 'hover' : false}\n ride={props.config.autoplay ? 'carousel' : undefined}\n autoplay={props.config.autoplay}\n interval={props.config.interval}\n transitionType={(props.config.transitionType) ? props.config.transitionType : undefined}\n items={retrieveItems(props)}\n hideFlipper={props.config.hideFlipper}\n dismissEnabled={props.config.dismissEnabled}\n onIndicatorsClickHandler={props.onIndicatorsClickHandler}\n handleDismissCarousel={props.handleDismissCarousel}\n dismissCarouselAriaText={props.resources && props.resources.ariaLabelForDismissButton}\n indicatorAriaText={props.resources && props.resources.ariaLabelForSlide}\n directionTextPrev={props.resources && props.resources.flipperPrevious}\n directionTextNext={props.resources && props.resources.flipperNext}\n handleOnExited={props.handleOnExited}\n handleOnExiting={props.handleOnExiting}\n telemetryContent={props.telemetryContent}\n />\n </Module>\n);\n\nexport default CarouselView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IActiveImageAdditionalContentViewProps } from '../active-image-utilities';\nimport { IActiveImageViewProps } from './active-image';\n\n/**\n * Render Additional Content.\n * @param additionalContent - Additional content view props.\n * @returns JSX Element.\n */\nconst renderAdditionalContent = (additionalContent: IActiveImageAdditionalContentViewProps) => {\n return (\n <Node {...additionalContent.additionalContentNode}>\n {additionalContent.heading}\n <Node {...additionalContent.additionalContentContainer}>\n {additionalContent.text}\n <Node {...additionalContent.additionalContentItemLinks}>\n {additionalContent.links}\n </Node>\n </Node>\n </Node >\n );\n};\n\n/**\n * Render View.\n * @param props - The view props.\n * @returns -The JSX Element.\n */\nexport const activeImageView: React.FC<IActiveImageViewProps> = props => {\n return (\n <Module {...props.activePointContainer}>\n <Node {...props.activePointDetailsContainer}>\n {props.imageMapper}\n <Node {...props.detailsContainer} className={props.detailsContainer ? props.detailsContainer.className : ''}>\n {props.title}\n {props.text}\n {props.additionalContent && renderAdditionalContent(props.additionalContent)}\n <Node {...props.detailsContainerCta} className={props.detailsContainerCta ? props.detailsContainerCta.className : ''}>\n {props.links}\n </Node>\n </Node>\n </Node>\n <Node\n className='msc-active-image-product-card-container'\n style={{ top: `${props.productCardtopPosition}px`, left: `${props.productCardleftPosition}px` }}>\n {props.overlay}\n {props.productCard}\n </Node>\n </Module>\n );\n};\n\nexport default activeImageView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\n\nimport { ReportReviewConcernInput } from './inputs/report-review-concern-input';\n\nasync function reportReviewConcern(input: ReportReviewConcernInput, ctx: IActionContext): Promise<boolean> {\n if (!inputIsValid(input)) {\n throw new Error(\n `[SubmitHelpfulnessVote] Invalid input. ReviewId=${input.reviewId},tenantId=${input.tenantId},locale= ${\n input.locale\n },`\n );\n }\n\n const requestUrl =\n `${input.serviceEndpoint}/v2.0/concerns/review/${input.reviewId}` +\n `?tenantId=${input.tenantId}` +\n `&locale=${input.locale}`;\n\n const requestBody = {\n concernCategory: input.concernCategory\n };\n\n const requestHeader = {\n headers: {\n Authorization: `id_token ${input.authToken}`\n }\n };\n\n return sendRequest<boolean>(requestUrl, 'post', requestBody, requestHeader)\n .then(response => {\n return response.status === 200 || response.status === 201;\n })\n .catch((error) => {\n ctx.trace('[ReportReviewConcernInput] Failed to report a concern');\n ctx.telemetry.exception(error);\n ctx.telemetry.debug('[ReportReviewConcernInput] Failed to report a concern');\n return false;\n });\n}\n\nfunction inputIsValid(input: ReportReviewConcernInput): boolean {\n return (\n input &&\n input.reviewId.length > 0 &&\n input.tenantId.length > 0 &&\n input.locale.length > 0 &&\n input.authToken.length > 0\n );\n}\n\nexport const reportReviewConcernDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/report-review-concern',\n action: <IAction<boolean>>reportReviewConcern\n});\n\nexport default reportReviewConcernDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst sectionContainerModuleId = 'section-container';\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst withModuleState = <P extends IProps>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P> => {\n /**\n *\n * ModuleState component.\n * @extends {React.Component<P>}\n */\n @observer\n class ModuleState extends React.Component<P> {\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public shouldComponentUpdate(nextProps: IModuleStateProps): boolean {\n if (this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return <WrappedComponent {...this.props} moduleState={this.getModuleStateManager(id)} />;\n }\n\n private readonly initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // State has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id.\n * @param id\n */\n private readonly getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState!,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => {\n this.update(id, { isRequired: value });\n },\n setIsCancellable: (value: boolean): void => {\n this.update(id, { isCancellable: value });\n },\n setIsSubmitContainer: (value: boolean): void => {\n this.update(id, { isSubmitContainer: value });\n },\n setHasError: (value: boolean): void => {\n this.update(id, { hasError: value });\n },\n onReady: (): void => {\n this.update(id, { status: 'ready' });\n },\n onUpdating: (): void => {\n this.update(id, { status: 'updating' });\n },\n onPending: (): void => {\n this.update(id, { status: 'pending' });\n },\n onSkip: (): void => {\n this.update(id, { status: 'skipped' });\n },\n onDisable: (): void => {\n this.update(id, { status: 'disabled' });\n },\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial<IModuleState>): void => {\n if (moduleState?.hasInitialized) {\n // State has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name.\n * @param typeName\n */\n private readonly getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState?.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states.\n */\n private readonly get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state.\n * @param id\n * @param value\n */\n private readonly update = (id: string, value: Partial<IModuleState>): void => {\n // Console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id]!,\n ...value\n };\n };\n\n private readonly _validateLeaf = (id: string, source: Partial<IModuleState>): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private readonly _validateContainer = (\n id: string,\n source: Partial<IModuleState>,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // Module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n let childIds = module.childIds;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (this.props.context.app.config.shouldEnableSinglePaymentAuthorizationCheckout) {\n // For new checkout flow, we bypass the isReady check for payment section container to enable the place order button.\n childIds = childIds.filter(childId => !this._isPaymentSectionContainer(childId));\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n if (!moduleId.includes(sectionContainerModuleId)) {\n return false;\n }\n\n const modules = this.get();\n const module = modules[moduleId];\n\n if (module && ArrayExtensions.hasElements(module.childIds.filter(childId => childId.includes(paymentInstrumentModuleId)))) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition.\n * @param id\n * @param source\n * @param allMatched\n * @param skipSkippableItem\n */\n private readonly validate = (id: string, source: Partial<IModuleState>, allMatched?: boolean, skipSkippableItem?: boolean): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * HasExternalSubmitGroup\n * Module will use external submit group.\n */\n private readonly hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * HasModuleState\n * Module is using module state manager.\n * @param id\n */\n private readonly hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IInvoiceSummaryLines } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport { IOrderSummaryLines } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartViewProps, IOrderSummaryErrors } from './cart';\nimport { ICartlinesViewProps } from './components/cart-line-items';\nimport { ICartLineItemViewProps } from './components/cart-line-items-promotion';\n\nconst _renderCartlines = (cartLines: ICartlinesViewProps[] | undefined, cartEmptyText: string, CartlinesWrapper: INodeProps, storeSelector: React.ReactNode | undefined,\n backToShoppingButton: React.ReactNode, waitingComponent: React.ReactNode, cartLoadingStatus: string, cartDataResult: boolean): JSX.Element[] | JSX.Element => {\n\n if (cartLoadingStatus) {\n return (<>\n {cartLoadingStatus}\n </>);\n }\n if (cartLines) {\n return cartLines.map((cartLine) => {\n return (\n <div className='msc-cart-lines-item' key={`${cartLine.cartlineId ?? ''}-${MsDyn365.isBrowser.toString()}`}>\n {cartLine.cartline}\n {\n storeSelector && cartLine.pickUpInStore ? <Node {...cartLine.pickUpInStore.ContainerProps}>\n {cartLine.pickUpInStore.defaultComponent}\n </Node> : null\n }\n {\n cartLine.addToOrderTemplate ? (\n <Node className='msc-cart-line__extra-actions'>\n {cartLine.remove}\n {cartLine.addToWishlist}\n {cartLine.addToOrderTemplate}\n </Node>\n ) : (\n <>\n {cartLine.remove}\n {cartLine.addToWishlist}\n </>\n )\n }\n </div>\n );\n });\n }\n return (cartDataResult ? (\n <div className='msc-cart__empty-cart'>\n <p className='msc-cart-line'>\n {cartEmptyText}\n </p>\n {backToShoppingButton}\n </div>\n ) : <>\n {waitingComponent}\n </>\n );\n\n};\n\n/**\n * Method will render error block.\n * @param errorData -The order summary errors interface.\n * @returns Jsx element.\n */\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\n if (!errorData || !ArrayExtensions.hasElements(errorData.errors)) {\n return null;\n }\n return (\n <Node {...errorData.Wrapper}>\n {errorData.header}\n {errorData.errors}\n </Node>\n );\n};\n\n/**\n * Method will render invoice summary lines.\n * @param invoiceSummaryLines -The invoicesummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderInvoiceSummarylines = (invoiceSummaryLines: IInvoiceSummaryLines | undefined, OrderSummaryItems: INodeProps, props: ICartViewProps):\nJSX.Element | null => {\n if (!invoiceSummaryLines) {\n props.context.telemetry.error('InvoiceSummary content is empty, module wont render');\n return null;\n }\n return (\n <Node {...OrderSummaryItems}>\n {invoiceSummaryLines.invoices}\n {invoiceSummaryLines.giftCard}\n {invoiceSummaryLines.loyalty}\n {invoiceSummaryLines.orderTotal}\n </Node>\n );\n};\n\n/**\n * Method will render order summary lines.\n * @param orderSummaryLines -The ordersummary lines interface.\n * @param OrderSummaryItems -The order summary items props.\n * @param props -The cartview props.\n * @returns Jsx element.\n */\nconst _renderOrderSummarylines = (orderSummaryLines: IOrderSummaryLines | undefined, OrderSummaryItems: INodeProps, props: ICartViewProps):\nJSX.Element | null => {\n if (!orderSummaryLines) {\n props.context.telemetry.error('OrderSummary content is empty, module wont render');\n return null;\n }\n return (\n <Node {...OrderSummaryItems}>\n {props.promoCode}\n {orderSummaryLines.subtotal}\n {orderSummaryLines.shipping}\n {orderSummaryLines.otherCharge}\n {orderSummaryLines.tax}\n {orderSummaryLines.totalDiscounts ? orderSummaryLines.totalDiscounts : null}\n {orderSummaryLines.orderTotal}\n </Node>\n );\n};\n\n/**\n * Method will render cart promotions.\n * @param promotions -The cartline item view props.\n * @returns Jsx element.\n */\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\n return (\n <>\n <Node {...promotions.promotionMessageWrapper} >\n {promotions.promotionMessage}\n {promotions.promotionSeeAllLink}\n {promotions.promotionDialog}\n </Node>\n\n </>\n );\n\n};\n\n/**\n * Method will render cartlines group title.\n * @param cartLine -The cartline view props.\n * @param titleSeparate -The title separate.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupTitle = (cartLine: ICartlinesViewProps, titleSeparate: string) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n return (\n <>\n <Node className='msc-cart-lines-group-wraper__bopis-heading-title'>\n {isBopisSelected ? <p className='msc-cart-lines-group-wraper__bopis-heading-title-st'>\n {cartLine.pickUpInStore?.deliveryOption}\n {titleSeparate}\n {cartLine.pickUpInStore?.orgUnitName}\n </p> : null}\n </Node>\n </>\n );\n};\n\n/**\n * Method will render cartlines groups header title.\n * @param pickUpText -The pickup text for group.\n * @param shippingText -The shipping text for group.\n * @param emailShippingText -The email shipping text for group.\n * @param titleSeparate -The title separator.\n * @param cartLine -The cartline view props.\n * @param emailDeliveryModeCode -The email delivery code from channel.\n * @returns Jsx element.\n */\nconst renderCartLinesGroupHeader = (pickUpText: string, shippingText: string, emailShippingText: string,\n titleSeparate: string, cartLine: ICartlinesViewProps, emailDeliveryModeCode?: string) => {\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\n let groupTitle: string;\n\n groupTitle = isBopisSelected ? pickUpText : shippingText;\n groupTitle = cartLine.data && cartLine.data.cartline.DeliveryMode === emailDeliveryModeCode ? emailShippingText : groupTitle;\n\n return (\n <>\n <div className='msc-cart-lines-group-wraper__bopis-heading'>\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}-icon`} />\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}`}>\n {groupTitle}\n </p>\n {renderCartLinesGroupTitle(cartLine, titleSeparate)}\n </div>\n </>\n );\n};\n\n/**\n * Method will render cartlines in groups.\n * @param props -The cartline.\n * @returns Jsx element.\n */\nconst renderCartLinesGroup = (props: ICartViewProps): JSX.Element | undefined => {\n if (props.cartLinesGroup && ArrayExtensions.hasElements(props.cartLinesGroup)) {\n return (\n <div className='msc-cart-lines-group'>\n { props.cartLinesGroup.map(cartlines => {\n return (<div key={cartlines[0].cartlineId} className='msc-cart-lines-group-wraper'>\n {renderCartLinesGroupHeader(props.resources.pickUpText, props.resources.shippingText,\n props.resources.emailshippingText, props.resources.titleSeparate, cartlines[0],\n props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode)}\n {_renderCartlines(cartlines, props.resources.emptyCartText, props.CartlinesWrapper, props.storeSelector,\n props.backToShoppingButton, props.waitingComponent, props.cartLoadingStatus, props.cartDataResult)}\n </div>);\n })}\n </div>\n );\n }\n return (props.cartDataResult ? (\n <div className='msc-cartline-wraper'>\n <div className='msc-cart__empty-cart'>\n <p className='msc-cart-line'>\n {props.resources.emptyCartText}\n </p>\n {props.backToShoppingButton}\n </div>\n </div>\n ) : <>\n {props.waitingComponent}\n </>\n );\n\n};\n\nconst CartView: React.FC<ICartViewProps> = (props: ICartViewProps) => (\n <div className={props.className} id={props.id} {...props.renderModuleAttributes(props)}>\n {props.title}\n {!props.cart?.hasInvoiceLine && props.promotionOptions && _renderPromotions(props.promotionOptions)}\n {props.multiplePickUpEnabled ? renderCartLinesGroup(props) : <Node {...props.CartlinesWrapper}>\n {_renderCartlines(props.cartlines, props.resources.emptyCartText, props.CartlinesWrapper, props.storeSelector,\n props.backToShoppingButton, props.waitingComponent, props.cartLoadingStatus, props.cartDataResult)}\n </Node>}\n {props.orderSummaryHeading &&\n <Node {...props.OrderSummaryWrapper}>\n {props.orderSummaryHeading}\n {props.cart?.hasInvoiceLine ? _renderInvoiceSummarylines(props.invoiceSummaryLineitems, props.OrderSummaryItems, props) : _renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props)}\n {_renderErrorBlock(props.OrderSummaryErrors)}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.expressCheckoutButton}\n {props.backToShoppingButton}\n {props.createTemplateFromCartButton}\n </Node>}\n {props.storeSelector}\n </div>\n);\n\nexport default CartView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { showAdditionalFields } from '../checkout-gift-card.props.autogenerated';\n\nexport interface IGetFormInput {\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n inputRef?: React.RefObject<HTMLInputElement>;\n inputPinRef?: React.RefObject<HTMLInputElement>;\n inputExpRef?: React.RefObject<HTMLInputElement>;\n supportExternalGiftCard?: boolean;\n additionalFields?: showAdditionalFields;\n disableAddGiftCard?: boolean;\n resources: {\n applyGiftCardButton: string;\n giftCardFormLabel: string;\n giftCardNumberLabel: string;\n giftCardPinLabel: string;\n giftCardExpLabel: string;\n giftCardAlertLabel: string;\n giftCardPinPlaceholderText: string;\n giftCardExpPlaceholderText: string;\n };\n onEnterGiftCardNumber(giftCardNumber: string): void;\n onEnterGiftCardPin(giftCardPin: string): void;\n onEnterGiftCardExp(giftCardExp: string): void;\n onApplyGiftCard(): Promise<void>;\n}\n\nexport interface IForm {\n formProps: INodeProps;\n label: React.ReactNode;\n inputPinLabel: React.ReactNode;\n inputExpLabel: React.ReactNode;\n alert: React.ReactNode;\n inputProps: INodeProps;\n inputNumProps: INodeProps;\n inputPinProps: INodeProps;\n inputExpProps: INodeProps;\n inputNumber: React.ReactNode;\n inputPin: React.ReactNode;\n inputExp: React.ReactNode;\n applyButton: React.ReactNode;\n supportExternalGiftCard: boolean | undefined;\n showGiftCardPinInput: boolean | undefined;\n showGiftCardExpInput: boolean | undefined;\n alertFieldLabel: React.ReactNode;\n}\n\n/**\n * On Apply Function.\n * @param onApplyGiftCard -On Apply Gift Card Function.\n * @returns Call of Apply Gift Card Function.\n */\nconst onApplyHandler = (onApplyGiftCard: () => Promise<void>) => async (event: React.SyntheticEvent): Promise<void> => {\n event.preventDefault();\n await onApplyGiftCard();\n};\n\n/**\n * On change number Function.\n * @param onEnterGiftCardNumber -On enter gift card number Function.\n * @returns Call of on enter gift card number Function.\n */\nconst onChangeNumberHandler = (onEnterGiftCardNumber: (giftCardNumber: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardNumber(value);\n};\n\n/**\n * On Change pin event.\n * @param onEnterGiftCardPin -On enter gift card pin Function.\n * @returns Call of on enter gift card pin Function.\n */\nconst onChangePinHandler = (onEnterGiftCardPin: (giftCardPin: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardPin(value);\n};\n\n/**\n * On Change Event.\n * @param onEnterGiftCardExp -On enter gift card function.\n * @returns Call of On enter gift card function.\n */\n// Need to filter out the month and year\nconst onChangeExpHandler = (onEnterGiftCardExp: (giftCardExp: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardExp(value);\n};\n\nexport const getForm = (options: IGetFormInput): IForm => {\n const {\n errorMessage,\n inputRef,\n inputPinRef,\n inputExpRef,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n onEnterGiftCardNumber,\n onEnterGiftCardPin,\n onEnterGiftCardExp,\n onApplyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n disableAddGiftCard,\n resources: { applyGiftCardButton, giftCardFormLabel, giftCardNumberLabel, giftCardPinLabel, giftCardExpLabel,\n giftCardAlertLabel, giftCardPinPlaceholderText, giftCardExpPlaceholderText }\n } = options;\n\n const formProps = {\n className: classnames('ms-checkout-gift-card__form', { 'is-invalid': !!errorMessage }),\n onSubmit: onApplyHandler(onApplyGiftCard),\n tag: 'form' as NodeTag\n };\n\n const label = (\n <label id='ms-checkout-gift-card__label' className='ms-checkout-gift-card__input-label'>\n {giftCardFormLabel}\n </label>\n );\n\n const inputPinLabel = (\n <label id='ms-checkout-gift-card__input-pin-label' className='ms-checkout-gift-card__input-pin-label'>\n {giftCardPinLabel}\n </label>\n );\n\n const inputExpLabel = (\n <label id='ms-checkout-gift-card__input-exp-label' className='ms-checkout-gift-card__input-exp-label'>\n {giftCardExpLabel}\n </label>\n );\n\n const alertFieldLabel = (\n <label id='ms-checkout-gift-card__input-alert' className='ms-checkout-gift-card__input-alert-label'>\n {giftCardAlertLabel}\n </label>\n );\n\n const alert = (\n <Alert\n tag='span'\n id='ms-checkout-gift-card__error'\n className='ms-checkout-gift-card__input-error'\n role='alert'\n assertive={false}\n fade={false}\n includeAlertClass={false}\n isOpen={!!errorMessage}\n >\n {errorMessage}\n </Alert>\n );\n\n const inputProps = {\n className: 'ms-checkout-gift-card__input-fields'\n };\n\n const inputNumProps = {\n className: 'ms-checkout-gift-card__input-num-fields'\n };\n\n const inputPinProps = {\n className: 'ms-checkout-gift-card__input-pin-fields'\n };\n\n const inputExpProps = {\n className: 'ms-checkout-gift-card__input-exp-fields'\n };\n\n const inputNumber = (\n <input\n ref={inputRef}\n type='text'\n className='ms-checkout-gift-card__input-text form-control'\n aria-label={giftCardNumberLabel}\n onChange={onChangeNumberHandler(onEnterGiftCardNumber)}\n value={giftCardNumber}\n aria-labelledby='ms-checkout-gift-card__label ms-checkout-gift-card__error'\n />\n );\n\n const inputPin = (\n <input\n ref={inputPinRef}\n type='text'\n className='ms-checkout-gift-card__input-pin-text form-contol'\n aria-label={giftCardPinLabel}\n placeholder={giftCardPinPlaceholderText}\n onChange={onChangePinHandler(onEnterGiftCardPin)}\n value={giftCardPin}\n aria-labelledby='ms-checkout-gift-card__label ms-checkout-gift-card__error'\n />\n );\n\n const inputExp = (\n <input\n ref={inputExpRef}\n type='text'\n className='ms-checkout-gift-card__input-exp-text form-contol'\n aria-label={`${giftCardExpLabel} ${giftCardExpPlaceholderText}`}\n placeholder={giftCardExpPlaceholderText}\n onChange={onChangeExpHandler(onEnterGiftCardExp)}\n value={giftCardExp}\n aria-describedby='ms-checkout-gift-card__label ms-checkout-gift-card__error'\n />\n );\n\n const applyButton = (\n <Button\n className='ms-checkout-gift-card__btn-apply'\n onClick={onApplyHandler(onApplyGiftCard)}\n aria-label={applyGiftCardButton}\n disabled={disableAddGiftCard || !giftCardNumber}\n >\n {applyGiftCardButton}\n </Button>\n );\n\n let showGiftCardPinInput = false;\n let showGiftCardExpInput = false;\n\n switch (additionalFields) {\n case showAdditionalFields.pin:\n showGiftCardPinInput = true;\n break;\n case showAdditionalFields.expirationDate:\n showGiftCardExpInput = true;\n break;\n case showAdditionalFields.pinAndExpirationDate:\n showGiftCardPinInput = true;\n showGiftCardExpInput = true;\n break;\n default:\n }\n\n return {\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IGetItemInput {\n giftCard: IGiftCardExtend;\n canRemove: boolean;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n removeGiftCardButton: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n onRemoveGiftCard(giftCardNumber: string): void;\n}\n\nexport interface IItem {\n itemProps: INodeProps;\n id?: string;\n selectedGiftCard: React.ReactNode;\n removeButton?: React.ReactNode;\n}\n\n/**\n * On remove function.\n * @param onRemoveGiftCard -Gift card number function.\n * @param giftCard -Gift card values.\n * @returns Call of onRemoveGiftCard function.\n */\nconst onRemoveHandler = (onRemoveGiftCard: (giftCardNumber: string) => void, giftCard: IGiftCardExtend) => (): void => {\n onRemoveGiftCard(giftCard.Id ?? '');\n};\n\n/**\n * GiftCardItem component.\n * @param root0\n * @param root0.giftCard\n * @param root0.getFormattedPrice\n * @param root0.canRemove\n * @param root0.onRemoveGiftCard\n * @param root0.resources\n * @param root0.resources.enteredGiftCardLabel\n * @param root0.resources.giftCardAvailableBalanceLabel\n * @param root0.resources.removeGiftCardButton\n * @extends {React.PureComponent<IGiftCardItemProps>}\n */\nexport const getItem = ({\n giftCard,\n getFormattedPrice,\n canRemove,\n onRemoveGiftCard,\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel, removeGiftCardButton }\n}: IGetItemInput): IItem => {\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\n\n const itemProps = {\n className: 'ms-checkout-gift-card__item'\n };\n\n const selectedGiftCard = (\n <span className='ms-checkout-gift-card__item-text'>\n {enteredGiftCardLabel}\n {' '}\n {giftCardLast4Digit}\n {' ('}\n {giftCardAvailableBalanceLabel}\n {' '}\n <span className='ms-checkout-gift-card__balance'>\n {balance}\n </span>\n {')'}\n </span>\n );\n\n const removeButton = canRemove && (\n <Button className='ms-checkout-gift-card__btn-remove' onClick={onRemoveHandler(onRemoveGiftCard, giftCard)}>\n {removeGiftCardButton}\n </Button>\n );\n\n return {\n itemProps,\n id: giftCard.Id,\n selectedGiftCard,\n removeButton\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\n\nimport { getItem, IItem } from './get-item';\n\ninterface IGetListInput {\n giftCards?: IGiftCardExtend[];\n canRemove: boolean;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n removeGiftCardButton: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n onRemoveGiftCard(giftCardNumber: string): void;\n}\n\nexport interface IList {\n listProps: INodeProps;\n list: IItem[];\n}\n\nexport const getList = ({ giftCards, canRemove, resources, getFormattedPrice, onRemoveGiftCard }: IGetListInput): IList | undefined => {\n if (!giftCards || giftCards.length === 0) {\n return undefined;\n }\n\n const listProps = {\n className: 'ms-checkout-gift-card__list'\n };\n\n const list = giftCards.map(giftCard => getItem({\n canRemove,\n getFormattedPrice,\n giftCard,\n onRemoveGiftCard,\n resources\n })\n );\n\n return {\n listProps,\n list\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface IGiftCardTitleProps {\n title: string;\n}\n\nconst GiftCardTitle: React.FC<IGiftCardTitleProps> = ({ title }) => (<label className='ms-checkout-gift-card__title'>\n {title}\n</label>);\n\nexport default GiftCardTitle;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport {\n getGiftCardAsync, getTenderTypesAsync, resolveCardTypesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CardType, CardTypeInfo, GiftCard, RetailOperation, TenderType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { computed, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { OPERATIONS } from '../checkout';\nimport { ICheckoutGiftCardData } from './checkout-gift-card.data';\nimport { ICheckoutGiftCardProps } from './checkout-gift-card.props.autogenerated';\nimport { getForm, IForm } from './components/get-form';\nimport { getList, IList } from './components/get-list';\nimport TitleCompoent from './components/title';\n\nexport * from './components/get-form';\nexport * from './components/get-item';\nexport * from './components/get-list';\n\ninterface ICheckoutGiftCardState {\n isFetchingGiftCard: boolean;\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n}\n\nenum SupportedGiftCardType {\n Internal = 'internal',\n External = 'external',\n Both = 'both'\n}\n\nexport interface ICheckoutGiftCardModuleProps extends ICheckoutGiftCardProps<ICheckoutGiftCardData>, IModuleStateProps { }\n\nexport interface IShowResource {\n title: React.ReactNode;\n list?: IList;\n}\n\nexport interface IAddResource {\n form: IForm;\n list?: IList;\n}\n\nexport interface ICheckoutGiftCardViewProps extends ICheckoutGiftCardProps<{}>, ICheckoutGiftCardState {\n className?: string;\n\n showGiftCard?: IShowResource;\n addGiftCard?: IAddResource;\n\n checkoutGiftCardProps: IModuleProps;\n couldPaidByGiftCard?: boolean;\n isEnabled?: boolean;\n onEdit?(): void;\n onCancel?(): void;\n onSubmit?(): void;\n enterGiftCardNumber?(giftCardNumber: string): void;\n enterGiftCardPin?(giftCardNumber: string): void;\n enterGiftCardExp?(giftCardNumber: string): void;\n removeGiftCard?(giftCardNumber: string): void;\n applyGiftCard?(): void;\n}\n\n/**\n *\n * CheckoutGiftCard component.\n * @extends {React.Component<ICheckoutGiftCardProps<ICheckoutGiftCardData>, ICheckoutGiftCardState>}\n */\n@observer\nexport class CheckoutGiftCard extends React.Component<ICheckoutGiftCardModuleProps, ICheckoutGiftCardState> {\n public state: ICheckoutGiftCardState = {\n isFetchingGiftCard: false,\n errorMessage: '',\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: ''\n };\n\n private readonly inputRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly inputPinRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly inputExpRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.loyaltyAmount) {\n return 0;\n }\n return checkoutState.loyaltyAmount;\n }\n\n @computed get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return 0;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n const balance: number = giftCard.Balance || 0;\n return count + balance;\n }, 0);\n }\n\n @computed get disableAddGiftCard(): boolean {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return true;\n }\n return (cart.TotalAmount || 0) - this.getLoyaltyAmount - this.getGiftCardTotalAmount <= 0;\n }\n\n @computed get shouldPayGiftCard(): boolean {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return false;\n }\n\n // Use gift card card when loyalty points do not cover the total amount\n const amountDue = (cart.TotalAmount || 0) - this.getLoyaltyAmount;\n return amountDue > 0;\n }\n\n @computed get hasSelectedItem(): boolean {\n const {\n data: { checkout }\n } = this.props;\n const giftCards = checkout.result && checkout.result.giftCardExtends;\n return !!giftCards && giftCards.length > 0;\n }\n\n @computed get isPaymentVerificationRedirection(): boolean {\n const { requestFormData, query } = this.props.context.request;\n return !!((requestFormData && query && query.pv === '1'));\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n () => {\n this.init();\n }\n );\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutGiftCardModuleProps,\n nextState: ICheckoutGiftCardState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n moduleState: { isReady },\n data: { checkout },\n config: { className, showAdditionalFields },\n resources\n } = this.props;\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\n const giftCards = checkout.result && checkout.result.giftCardExtends;\n const additionalFields = showAdditionalFields;\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!this.isEnabled() || (!this.shouldPayGiftCard && !isReady)) {\n this.props.context.telemetry.error('Checkout giftcard content is empty, module wont render');\n return null;\n }\n\n const supportExternalGiftCard = supportedGiftCardType !== SupportedGiftCardType.Internal;\n\n const moduleClassName = classname('ms-checkout-gift-card', className, isReady ? 'show' : 'add');\n\n const viewProps: ICheckoutGiftCardViewProps = {\n ...this.props,\n ...this.state,\n className: moduleClassName,\n\n checkoutGiftCardProps: { moduleProps: this.props, className: moduleClassName },\n couldPaidByGiftCard: this.couldPaidByGiftCard(),\n isEnabled: this.isEnabled(),\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n enterGiftCardNumber: this.enterGiftCardNumber,\n enterGiftCardPin: this.enterGiftCardPin,\n enterGiftCardExp: this.enterGiftCardExp,\n removeGiftCard: this.removeGiftCard,\n applyGiftCard: this.applyGiftCard,\n showGiftCard: isReady ?\n {\n title: <TitleCompoent title={resources.giftCardFormLabel} />,\n list: getList({\n canRemove: false,\n getFormattedPrice: this.getFormattedPrice,\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\n onRemoveGiftCard: this.removeGiftCard,\n resources\n })\n } :\n undefined,\n addGiftCard: !isReady ?\n {\n form: getForm({\n errorMessage,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n inputRef: this.inputRef,\n inputPinRef: this.inputPinRef,\n inputExpRef: this.inputExpRef,\n resources,\n onEnterGiftCardNumber: this.enterGiftCardNumber,\n onEnterGiftCardPin: this.enterGiftCardPin,\n onEnterGiftCardExp: this.enterGiftCardExp,\n onApplyGiftCard: this.applyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n disableAddGiftCard: this.disableAddGiftCard\n }),\n list: getList({\n canRemove: true,\n getFormattedPrice: this.getFormattedPrice,\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\n onRemoveGiftCard: this.removeGiftCard,\n resources\n })\n } :\n undefined\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly init = (): void => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n isRequired: false,\n ...(!this.isEnabled() && { status: 'disabled' })\n });\n\n const giftCards = this.props.data.checkout.result?.giftCardExtends;\n if (giftCards && giftCards.length > 0) {\n this.props.moduleState.onReady();\n } else if (this.isPaymentVerificationRedirection) {\n this.props.moduleState.onSkip();\n }\n\n };\n\n private readonly couldPaidByGiftCard = (): boolean => {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return false;\n }\n\n // Use gift card when it is not free\n return (cart.TotalAmount || 0) > 0;\n };\n\n private readonly isEnabled = (): boolean => {\n if (!this.props.context.request.user.isAuthenticated &&\n this.props.context.app.config.giftCardSupported !== SupportedGiftCardType.External &&\n !this.props.config.shouldBeEnabledForGuest) {\n return false;\n }\n return this.couldPaidByGiftCard();\n };\n\n private readonly onEdit = (): void => {\n // Show add gift card form\n this.props.moduleState.onUpdating();\n };\n\n private readonly onCancel = (): void => {\n this.handleCancelOrSubmit();\n };\n\n private readonly onSubmit = (): void => {\n this.handleCancelOrSubmit();\n };\n\n private readonly handleCancelOrSubmit = () => {\n if (this.hasSelectedItem) {\n // Show summary screen\n this.props.moduleState.onReady();\n } else {\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\n };\n\n private readonly enterGiftCardNumber = (giftCardNumber: string): void => {\n this.setState({\n giftCardNumber\n });\n this.clearError();\n };\n\n private readonly enterGiftCardPin = (giftCardPin: string): void => {\n this.setState({\n giftCardPin\n });\n this.clearError();\n };\n\n private readonly enterGiftCardExp = (giftCardExp: string): void => {\n this.setState({\n giftCardExp\n });\n this.clearError();\n };\n\n private readonly setError = (errorMessage: string): void => {\n this.props.telemetry.error('Error', errorMessage);\n this.props.telemetry.debug('Error', errorMessage);\n this.props.moduleState.setHasError(true);\n this.setState({\n errorMessage\n });\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n\n private readonly removeGiftCard = async (giftCardNumber: string): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState) {\n return;\n }\n\n await checkoutState.removeGiftCard({ giftCardNumber });\n };\n\n private readonly applyGiftCard = async (): Promise<void> => {\n if (this.state.isFetchingGiftCard) {\n return;\n }\n this.setState({\n isFetchingGiftCard: true\n });\n\n const checkoutState = this.props.data.checkout.result;\n const giftCardNumber = this.state.giftCardNumber.trim();\n const giftCardPin = this.state.giftCardPin.trim();\n const giftCardExp = this.state.giftCardExp.trim();\n\n const giftCardTypes = await this.getGiftCardTypes(giftCardNumber);\n const giftCardType = giftCardTypes && giftCardTypes[0];\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\n const giftCard = await this.getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\n\n if (checkoutState && giftCard) {\n await checkoutState.addGiftCard({ giftCard, additionalProperties: { Pin: giftCardPin, ExpirationDate: giftCardExp, TenderTypeId: tenderTypeId } });\n this.clearError();\n this.setState({\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: '',\n isFetchingGiftCard: false\n });\n return Promise.resolve();\n }\n const input =\n this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n this.setState({\n isFetchingGiftCard: false\n });\n\n };\n\n private readonly findGiftcardTenderTypes = (tenderTypes: TenderType[], operationId: RetailOperation, giftcardType: string): string[] | undefined => {\n let matchedTenderTypes: TenderType[] | undefined;\n\n switch (giftcardType) {\n case SupportedGiftCardType.Internal:\n matchedTenderTypes = tenderTypes.filter(tenderType => (tenderType.OperationId === operationId && tenderType.ConnectorId === ''));\n break;\n case SupportedGiftCardType.External:\n matchedTenderTypes = tenderTypes.filter(tenderType => (tenderType.OperationId === operationId && tenderType.ConnectorId !== ''));\n break;\n default:\n throw new Error('Invalid gift card type');\n }\n\n if (matchedTenderTypes) {\n return matchedTenderTypes.map(tenderType => tenderType.TenderTypeId || '');\n }\n return;\n };\n\n private readonly getGiftCard = async (giftCardNumber: string, giftCardPin: string, giftCardExp: string, isPinRequired: boolean | undefined, isExpRequired: boolean | undefined, tenderTypeId: string | undefined): Promise<GiftCard | undefined> => {\n const {\n resources: { noBalanceError, invalidCardInfoError, invalidCardTypeError, noCardPinError, noCardExpError }\n } = this.props;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!tenderTypeId) {\n return undefined;\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n const internalGiftcardTenderTypes = this.findGiftcardTenderTypes(tenderTypes, OPERATIONS.PayGiftCertificate, SupportedGiftCardType.Internal);\n const externalGiftcardTenderTypes = this.findGiftcardTenderTypes(tenderTypes, OPERATIONS.PayGiftCertificate, SupportedGiftCardType.External);\n\n switch (supportedGiftCardType) {\n case undefined:\n case SupportedGiftCardType.Internal:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.External:\n if (!externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.Both:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId) && !externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this.setError(invalidCardTypeError);\n return undefined;\n }\n break;\n default:\n throw new Error('Unsupported gift card type');\n }\n\n if (isPinRequired && giftCardPin === '') {\n this.setError(noCardPinError);\n return undefined;\n }\n\n if (isExpRequired && giftCardExp === '') {\n this.setError(noCardExpError);\n return undefined;\n }\n\n const month = Number.parseInt(giftCardExp.split('/')[0], 10);\n const year = Number.parseInt(giftCardExp.split('/')[1], 10);\n\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\n .then(activeGiftCard => {\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\n this.setError(noBalanceError);\n return;\n }\n return activeGiftCard;\n })\n .catch(error => {\n this.setError(invalidCardInfoError);\n return undefined;\n });\n };\n\n private readonly getGiftCardTypes = async (giftCardNumber: string): Promise<CardTypeInfo[] | undefined> => {\n const {\n resources: { emptyInputError, duplicatedCodeError, invalidCodeError },\n data: { checkout }\n } = this.props;\n\n if (!giftCardNumber) {\n this.setError(emptyInputError);\n return undefined;\n }\n\n const isDuplicated = checkout.result && checkout.result.giftCardExtends.some((card: GiftCard) => card.Id === giftCardNumber);\n if (isDuplicated) {\n this.setError(duplicatedCodeError);\n return undefined;\n }\n\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, CardType.GiftCard)\n .then(giftCardTypes => {\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\n this.setError(invalidCodeError);\n return;\n }\n return giftCardTypes;\n })\n .catch(error => {\n this.setError(invalidCodeError);\n return undefined;\n });\n };\n}\n\nexport default withModuleState(CheckoutGiftCard);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, GiftCard, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class CheckoutState {\n @observable private _tokenizedPaymentCard: TokenizedPaymentCard | undefined ;\n\n @computed public get tokenizedPaymentCard(): Readonly<TokenizedPaymentCard> | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly<TenderLine> | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined ;\n\n @computed public get billingAddress(): Readonly<Address> | undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly<Address> | undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly<string> | undefined {\n return this._cardPrefix;\n }\n\n @observable private _giftCards: GiftCard[] = [];\n\n @computed public get giftCards(): readonly GiftCard[] {\n return this._giftCards;\n }\n\n @observable private _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): readonly IGiftCardExtend[] {\n return this._giftCardExtends;\n }\n\n @observable private _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly<string> | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly<number> | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly<string> | string {\n return this._guestCheckoutEmail;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly<boolean> | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly<number> | number {\n return this._customerAccountAmount;\n }\n\n @action\n public updateTokenizedPaymentCard(newTokenizedPaymentCard: TokenizedPaymentCard): void {\n this._tokenizedPaymentCard = newTokenizedPaymentCard;\n }\n\n @action\n public updateTenderLine(newTenderLine: TenderLine | undefined): void {\n this._tenderLine = newTenderLine;\n }\n\n @action\n public updateShippingAddress(newShippingAddress: Address): void {\n this._shippingAddress = newShippingAddress;\n }\n\n @action\n public updateBillingAddress(newBillingAddress: Address): void {\n this._billingAddress = newBillingAddress;\n }\n\n @action\n public updateCardPrefix(newCardPrefix: string): void {\n this._cardPrefix = newCardPrefix;\n }\n\n @action\n public removeGiftCard(giftCardNumber: string): void {\n this._giftCards = this._giftCards.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public removeGiftCardExtend(giftCardNumber: string): void {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public addGiftCard(giftCard: GiftCard): void {\n this._giftCards = [giftCard, ...this._giftCards];\n }\n\n @action\n public addGiftCardExtend(giftCard: IGiftCardExtend): void {\n this._giftCardExtends = [giftCard, ...this._giftCards];\n }\n\n @action\n public updateLoyaltyCardNumber(newLoyaltyCardNumber: string): void {\n this._loyaltyCardNumber = newLoyaltyCardNumber;\n }\n\n @action\n public updateLoyaltyAmount(newAmount: number): void {\n this._loyaltyAmount = newAmount;\n }\n\n @action\n public updateGuestCheckoutEmail(newGuestCheckoutEmail: string): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\n }\n\n @action\n public updateTermsAndConditionsAcceptance(newIsTermsAndConditionAccepted: boolean): void {\n this._isTermsAndConditionAccepted = newIsTermsAndConditionAccepted;\n }\n\n @action\n public updateCustomerAccountAmount(newAmount: number): void {\n this._customerAccountAmount = newAmount;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchResultModalViewProps } from './components';\nimport { ICategoryHierarchyViewProps, IRefineMenuViewProps, ISearchResultContainerViewProps, ISortByViewProps, ITitleViewProps } from './search-result-container';\n\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps> = props => {\n const { SearchResultContainer, products, pagination, ProductsContainer, ProductSectionContainer, choiceSummary, isMobile, modalToggle, searchResultModal, TitleViewProps,\n refineMenu, categoryHierarchy, sortByOptions, CategoryNavContainer, RefineAndProductSectionContainer, errorMessage, FeatureSearchContainer, similarLookProduct } = props;\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\n if (isMobile) {\n return (\n <Module {...SearchResultContainer}>\n {renderCategoryHierarchy(categoryHierarchy)}\n {renderTitle(TitleViewProps)}\n {choiceSummary}\n {modalToggle}\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\n <Node {...FeatureSearchContainer}>\n {similarLookProduct}\n </Node>\n <Node {...ProductsContainer}>\n {errorMessage}\n {products}\n </Node>\n {pagination}\n </Module>\n );\n }\n return (\n <Module {...SearchResultContainer}>\n <Node {...CategoryNavContainer}>\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\n {TitleViewProps && renderTitleCount(TitleViewProps)}\n </Node>\n <Node {...RefineAndProductSectionContainer}>\n {refineMenu && renderRefiner(refineMenu)}\n <Node {...ProductSectionContainer}>\n {TitleViewProps && renderTitle(TitleViewProps)}\n {choiceSummary}\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\n <Node {...FeatureSearchContainer}>\n {similarLookProduct}\n </Node>\n <Node {...ProductsContainer}>\n {errorMessage}\n {products}\n </Node>\n {pagination}\n </Node>\n </Node>\n </Module>\n );\n\n};\n\nconst createSearchResultModal = (modalProps: ISearchResultModalViewProps, refineMenu: IRefineMenuViewProps,\n sortByDropDown: ISortByViewProps, isRecoSearchPage?: string): JSX.Element => {\n return React.cloneElement(modalProps.modal, {}, modalProps.modalHeader,\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage), modalProps.modalFooter);\n};\n\nconst createModalBody = (props: ISearchResultModalViewProps, refineMenu: IRefineMenuViewProps,\n sortByDropDown: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\n if (sortByDropDown) {\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefiner(refineMenu));\n }\n return null;\n};\n\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\n if (refiners) {\n return (\n <Node {...RefinerSectionContainer}>\n <Node {...RefineMenuContainer}>\n {refiners.map((submenu, index) => (\n <React.Fragment key={index}>\n {submenu}\n </React.Fragment>\n ))}\n </Node>\n </Node>\n );\n }\n return null;\n};\n\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\n const { SortingContainer, sortByDropDown } = props;\n if (sortByDropDown && !isRecoSearchPage) {\n return (\n <Node {...SortingContainer}>\n {sortByDropDown}\n </Node>\n );\n }\n return null;\n};\n\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\n if (categoryHierarchyList) {\n return (\n <Node {...CategoryHierarchyContainer}>\n {categoryHierarchyList.map((category, index) => (\n <React.Fragment key={index}>\n {category}\n {categoryHierarchyList && categoryHierarchyList[index + 1] && categoryHierarchySeparator}\n </React.Fragment>\n ))}\n </Node>\n );\n }\n\n return null;\n};\n\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\n const { title, TitleContainer } = props;\n if (title) {\n return (\n <Node {...TitleContainer}>\n <h2>\n {title.titlePrefix}\n {title.titleText}\n </h2>\n </Node>\n );\n }\n return null;\n};\n\nconst renderTitleCount = (props: ITitleViewProps): JSX.Element | null => {\n const { title, TitleContainer } = props;\n if (title) {\n return (\n <Node {...TitleContainer}>\n <h5>\n {title.titleCount}\n </h5>\n </Node>\n );\n }\n return null;\n};\n\nexport default SearchResultContainerView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IVideoPlayerAdditionalContentViewProps } from './components/additional-content';\nimport { IVideoPlayerViewProps } from './video-player';\n\n/**\n * Render Additional Content.\n * @param additionalContent - Additional content view props.\n * @returns JSX Element.\n */\nconst renderAdditionalContent = (additionalContent: IVideoPlayerAdditionalContentViewProps) => {\n if (additionalContent.additionalContentItems) {\n return (\n <Node {...additionalContent.additionalContentNode}>\n <>\n {additionalContent.additionalContentItems.heading}\n <Node {...additionalContent.additionalContentItems.additionalContentItemContainer}>\n {additionalContent.additionalContentItems.text}\n <Node {...additionalContent.additionalContentItems.additionalContentItemLinks}>\n {additionalContent.additionalContentItems.links}\n </Node>\n </Node>\n </>\n </Node >\n );\n }\n\n return null;\n};\n\nconst VideoPlayerView: React.FC<IVideoPlayerViewProps> = props => {\n return (\n <div\n id={props.id}\n className='ms-video-player'\n {...props.renderModuleAttributes(props)}\n >\n {props.player}\n <Node {...props.detailsContainer} className={props.detailsContainer ? props.detailsContainer.className : ''}>\n {props.title}\n {props.text}\n {props.additionalContent && renderAdditionalContent(props.additionalContent)}\n <Node {...props.detailsContainerCta} className={props.detailsContainerCta ? props.detailsContainerCta.className : ''}>\n {props.links}\n </Node>\n </Node>\n </div>\n );\n};\n\nexport default VideoPlayerView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport Checkout from './checkout';\nimport CheckoutView from './checkout.view';\n\nexport * from './actions/get-products-in-active-checkout-cart';\nexport * from './checkout';\nexport * from './checkout.data';\nexport * from './checkout.props.autogenerated';\nexport * from './checkout.view';\nexport * from './components';\nexport * from './methods';\n\nexport {\n Checkout,\n CheckoutView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent, SwatchComponent } from '@msdyn365-commerce/components';\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\nimport { checkIfShouldDisplayAsSwatch, DimensionTypes, IDimensionsApp, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IRefineItemCommonProps } from './refine-item.props.common';\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\n\n/**\n * RefineItem properties.\n */\nexport interface IRefineItemProps {\n\n parentProductRefinerHierarchy: IProductRefinerHierarchy;\n productRefinerValue: ProductRefinerValue;\n selectedRefinementCriterion: ProductRefinerValue | undefined;\n selectedRefinerValues?: ProductRefinerValue[];\n refineItemCommonProps: IRefineItemCommonProps;\n isDisabled: boolean;\n context: ICoreContext<IGeneric<IAny>>;\n moduleId: string;\n moduleTypeName: string;\n index?: number;\n productCountAriaLabel?: string;\n singleProductCountAriaLabel?: string;\n refineItemAriaLabel?: string;\n refineItemsAriaLabel?: string;\n isMobileView?: boolean;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n onToggle(notfication: Readonly<IRefineItemToggleNotification>): void;\n urlBuilder(refiner: IRefineItemToggleNotification): string;\n}\n\n/**\n * Refine item state.\n */\nexport interface IRefineItemState extends React.ComponentState {\n isChecked: boolean;\n renderingError?: object;\n}\n\n/**\n * Single-select and multi-select refine item component (controlled by RefineSubmenu).\n */\nexport default class RefineItem extends React.Component<IRefineItemProps, IRefineItemState> {\n private readonly anchorType: React.RefObject<HTMLAnchorElement>;\n\n private readonly payLoad: IPayLoad;\n\n public constructor(props: IRefineItemProps) {\n super(props);\n this._onClick = this._onClick.bind(this);\n this.state = {\n isChecked: !!this.props.selectedRefinementCriterion\n };\n this.anchorType = React.createRef();\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public shouldComponentUpdate(nextProps: IRefineItemProps,\n nextState: IRefineItemState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | undefined {\n const {\n isDisabled,\n refineItemCommonProps,\n parentProductRefinerHierarchy,\n productRefinerValue,\n selectedRefinementCriterion,\n productCountAriaLabel,\n singleProductCountAriaLabel,\n index,\n children,\n onToggle,\n context,\n telemetryContent,\n refineItemAriaLabel,\n refineItemsAriaLabel,\n ...attrs\n } = this.props;\n if (!productRefinerValue) {\n refineItemCommonProps.telemetry.error('[refine-item] Cannot render refineItem without productRefinerValue');\n return undefined;\n }\n if (!productRefinerValue.LeftValueBoundString) {\n refineItemCommonProps.telemetry.warning(`[refine-item] RefineItem without LeftValueBoundString: ${JSON.stringify(productRefinerValue)}`);\n }\n const isSingleSelect = parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect;\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\n itemTypeClassName = `ms-refine-submenu-item ${itemTypeClassName}`;\n const inputType = isSingleSelect ? 'radio' : 'checkbox';\n const isChecked = !!selectedRefinementCriterion;\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\n if (parentProductRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) {\n return this._renderRating(productRefinerValue, parentProductRefinerHierarchy, isChecked, context, index, telemetryContent,\n productCountAriaLabel, singleProductCountAriaLabel);\n\n }\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString ?? productRefinerValue.LeftValueBoundString;\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\n const productText = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\n const productCount = productRefinerValue.Count || 0;\n let refineMenuItemAriaLabel;\n if (productCount === 1) {\n refineMenuItemAriaLabel = refineItemAriaLabel ? format(refineItemAriaLabel, parentProductRefinerHierarchy.KeyName, productText) : '';\n } else {\n refineMenuItemAriaLabel =\n refineItemsAriaLabel ? format(refineItemsAriaLabel, parentProductRefinerHierarchy.KeyName, productText, productCount) : '';\n }\n return (\n <li className='ms-refine-submenu-item' id={`${parentProductRefinerHierarchy.KeyName!}_${index}`}>\n <a\n key={selectedRefinementCriterion ? 'true' : 'false'}\n ref={this.anchorType}\n href={this._getRefinerUrl()}\n tabIndex={0}\n onClick={this._onClick}\n className={itemTypeClassName}\n role={inputType}\n aria-label={refineMenuItemAriaLabel}\n aria-checked={!!selectedRefinementCriterion}\n {...attribute}\n {...attrs}\n >\n {this._renderSwatch()}\n <span className='ms-refine-submenu-item__label' aria-hidden='true'>\n {/* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string. */}\n {productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString}\n {productRefinerValue.Count !== undefined && ` (${productRefinerValue.Count})`}\n </span>\n </a>\n </li>\n );\n\n }\n\n private _renderSwatch(): JSX.Element | null {\n const productRefinerValue = this.props.productRefinerValue;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\n const text = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\n\n const dimensionType = (this.props.parentProductRefinerHierarchy.KeyName?.toLocaleLowerCase() ?? '') as DimensionTypes;\n const hasColor = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchColorHexCode);\n const hasImage = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchImageUrl);\n const hasValidSwatch = hasColor || hasImage;\n const shouldDisplayAsSwatch = hasValidSwatch && checkIfShouldDisplayAsSwatch(\n dimensionType, this.props.context as ICoreContext<IDimensionsApp>);\n const swatchItems = shouldDisplayAsSwatch ? [\n {\n itemId: `${productRefinerValue.RefinerRecordId ?? ''}-${dimensionType}-${text}`,\n value: text,\n dimensionType,\n colorHexCode: productRefinerValue.SwatchColorHexCode,\n imageUrl: productRefinerValue.SwatchImageUrl\n }\n ] : undefined;\n\n if (!swatchItems) {\n return null;\n }\n\n return (\n <SwatchComponent\n className='ms-refine-submenu-item__swatch'\n apiSettings={this.props.context.request.apiSettings}\n list={swatchItems}\n isSelectionEnabled={false}\n isRefineItem\n />\n );\n }\n\n private _getRefinerUrl(): string {\n const { urlBuilder, parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\n\n if (productRefinerValue) {\n return urlBuilder({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: !selectedRefinementCriterion\n });\n }\n\n return '';\n }\n\n private readonly _onClick = (e: React.MouseEvent<HTMLAnchorElement | HTMLInputElement>): void => {\n e.preventDefault();\n\n const { parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\n if (productRefinerValue) {\n this.props.onToggle({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: !selectedRefinementCriterion\n });\n\n setTimeout(\n () => {\n this.anchorType.current && this.anchorType.current.focus();\n },\n 0\n );\n }\n };\n\n private _renderRating(productRefinerValue: ProductRefinerValue, parentProductRefinerHierarchy: IProductRefinerHierarchy,\n isChecked: boolean, context: ICoreContext, index?: number, telemetryContent?: ITelemetryContent,\n ratingUserCountAriaLabel?: string, ratingSingleUserCountAriaLabel?: string): JSX.Element | undefined {\n if (productRefinerValue.LeftValueBoundString) {\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString;\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\n const refinerRating = Number.parseInt(productRefinerValue.LeftValueBoundString, 10);\n const ratingRefiner = this.props.selectedRefinerValues?.find(value => value.DataTypeValue === productRefinerValue.DataTypeValue);\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\n const selectedRating = Number.parseInt(ratingRefiner?.LeftValueBoundString || '0', 10);\n const defaultChkProductCount = 1;\n let ratingComponentClass: string = 'ms-rating-component';\n if (refinerRating > selectedRating) {\n ratingComponentClass = `${ratingComponentClass}__up`;\n } else if (refinerRating < selectedRating) {\n ratingComponentClass = `${ratingComponentClass}__down`;\n } else {\n ratingComponentClass = `${ratingComponentClass}__current`;\n }\n const productCountAriaLabelValue = (productRefinerValue.Count !== undefined &&\n productRefinerValue.Count === defaultChkProductCount) ? (ratingSingleUserCountAriaLabel &&\n format(ratingSingleUserCountAriaLabel, productRefinerValue.Count)) : (ratingUserCountAriaLabel &&\n format(ratingUserCountAriaLabel, productRefinerValue.Count));\n return (\n <li\n className='ms-refine-submenu-item'\n role={!this.props.isMobileView ? 'presentation' : undefined}\n id={`${parentProductRefinerHierarchy.KeyName!}_${index!}`}\n >\n <a\n href={this._getRefinerUrl()}\n role='option'\n aria-selected={isChecked}\n aria-label={`${parentProductRefinerHierarchy.KeyName!}_${productRefinerValue.LeftValueBoundLocalizedString!}\n ${productCountAriaLabelValue!}`}\n onClick={this._onClick}\n {...attribute}\n >\n <RatingComponent\n className={ratingComponentClass}\n avgRating={refinerRating}\n ratingCount={productRefinerValue.LeftValueBoundLocalizedString ?? productRefinerValue.LeftValueBoundString}\n hideCount={false}\n readOnly\n ariaLabel=''\n context={context}\n id={this.props.moduleId}\n typeName={this.props.moduleTypeName}\n data={{}}\n />\n <span className='refine-submenu-item__rating' aria-hidden={this.props.isMobileView ? 'true' : undefined}>\n {productRefinerValue.Count !== undefined && `(${productRefinerValue.Count})`}\n </span>\n </a>\n </li>\n );\n }\n return undefined;\n }\n\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { IHistogramItemViewProps,\n IRatingsHistogramData,\n IRatingsHistogramViewProps } from '@msdyn365-commerce-modules/ratings-reviews';\nimport { format, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IRatingsHistogramProps, IRatingsHistogramResources } from '../definition-extensions/ratings-histogram.ext.props.autogenerated';\n\n/**\n * Histogram item.\n * @param props - Histogram Item ViewProps.\n * @returns Histogram Item node.\n */\nconst histogramItem = (props: IHistogramItemViewProps) => {\n return (\n <Node {...props.buttonProps} >\n {props.starLabel}\n {props.bar}\n </Node>\n );\n};\n\n/**\n * Average ratings.\n * @param data - Props data.\n * @param context - Histogram Item ViewProps.\n * @param typeName - Histogram Item ViewProps.\n * @param componentId - Histogram Item ViewProps.\n * @param resources - Module resource strings.\n * @returns Average ratings.\n */\nconst averageRating = (data: IRatingsHistogramData, context: ICoreContext, typeName: string, componentId: string, resources: IRatingsHistogramResources) => {\n const defaultAverageRating: number = 0;\n const reviewsCount = data.ratingsSummary.result?.reviewsCount ?? defaultAverageRating;\n const reviewsCountString = resources.numberOfReviewsString ? format(resources.numberOfReviewsString, reviewsCount) : `${reviewsCount} reviews`;\n\n return (\n <div className='ms-ratings-histogram__ratings'>\n <div className='ms-ratings-histogram__ratings__heading'>\n {data.ratingsSummary.result?.averageRating}\n </div>\n <div>\n <RatingComponent\n context={context}\n id={componentId}\n typeName={typeName}\n avgRating={data.ratingsSummary.result?.averageRating ?? defaultAverageRating}\n readOnly\n ariaLabel={format(resources.averageRatingAriaLabel, data.ratingsSummary.result?.averageRating, '5')}\n data={{}}\n />\n </div>\n <div className='ms-ratings-histogram__ratings__reviews'>\n {reviewsCountString}\n </div>\n </div>\n );\n};\n\n/**\n * Histogram view.\n * @param props - Ratings HistogramV iewProps.\n * @returns Histogram view module.\n */\nconst RatingsHistogramView: React.FC<IRatingsHistogramViewProps & IRatingsHistogramProps<{}>> = props => {\n const { heading, histogramItems, histogramProps, moduleProps, data, resources } = props;\n const context = props.context;\n const typeName = props.typeName;\n const moduleId = props.id;\n\n return (\n <Module {...moduleProps}>\n {heading}\n <div className='ms-ratings-histogram__container'>\n {averageRating(data, context, typeName, moduleId, resources)}\n <Node {...histogramProps}>\n {histogramItems.map(item => {\n return histogramItem(item);\n })}\n </Node>\n </div>\n </Module>\n );\n};\n\nexport default RatingsHistogramView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { Alert, getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, Modal, ModalBody, ModalFooter, ModalHeader, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ReviewConcernCategory } from '../../../actions/inputs/report-review-concern-input';\nimport { IRnrKeyValuePair } from '../../../common/rnrInterface';\n\nexport interface IReportReviewModalProps {\n resources: IReportReviewModalResources;\n context: ICoreContext<IGeneric<IAny>>;\n isOpen: boolean;\n returnRef: React.RefObject<HTMLButtonElement> | undefined;\n reportedKey: string;\n hasError: boolean;\n telemetryContent?: ITelemetryContent;\n onModalToggle(): void;\n onRadioChange(event: React.ChangeEvent<HTMLInputElement>): void;\n reportReview(): void;\n}\n\nexport interface IReportReviewModalResources {\n reportConcernText: string;\n feedbackThankYouText: string;\n reportModalMessage: string;\n reportSubmittedMessage: string;\n reportSpamText: string;\n offensiveContentText: string;\n profanityContentText: string;\n okReportReviewText: string;\n cancelReportReviewText: string;\n reportReviewButtonText: string;\n errorMessageText: string;\n}\n\nexport interface IReportReviewModalViewProps {\n modal: INodeProps;\n modalHeader: INodeProps;\n modalFooter: INodeProps;\n modalBody: INodeProps;\n header: React.ReactElement;\n headerSubmitted: React.ReactElement;\n cancelButton: React.ReactElement;\n submitButton: React.ReactElement;\n succesfulButton: React.ReactElement;\n reportMessage: React.ReactElement;\n reportSubmittedMessage: React.ReactElement;\n radioButtons: React.ReactElement;\n error: React.ReactElement;\n}\n\nlet reportConcernDropdownOptions: IRnrKeyValuePair[];\n\n/**\n * CartLineItems component.\n */\n\nexport const ReportReviewModal = (props: IReportReviewModalProps): IReportReviewModalViewProps => {\n\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.SubmitReview);\n const submitReviewAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.SuccessButton;\n const successAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n reportConcernDropdownOptions = [\n { key: ReviewConcernCategory.SpamAdvertising, value: props.resources.reportSpamText },\n { key: ReviewConcernCategory.OffensiveContent, value: props.resources.offensiveContentText },\n { key: ReviewConcernCategory.Profanity, value: props.resources.profanityContentText }\n ];\n\n return {\n modal: { tag: Modal, className: 'ms-report-review-modal msc-modal-input-required', toggle: props.onModalToggle, applicationNode: 'renderPage', isOpen: props.isOpen, returnFocusRef: props.returnRef },\n modalHeader: { tag: ModalHeader, toggle: props.onModalToggle, className: 'ms-report-review-modal-header' },\n modalFooter: { tag: ModalFooter, className: 'ms-report-review-modal-footer' },\n modalBody: { tag: ModalBody, className: 'ms-report-review-modal-body' },\n header: <p className='ms-reviews-list__report-header'>\n {props.resources.reportConcernText}\n </p>,\n headerSubmitted: <p className='ms-reviews-list__report-header'>\n {props.resources.feedbackThankYouText}\n </p>,\n cancelButton: <button className='msc-btn ms-reviews-list__cancel' onClick={props.onModalToggle} {...cancelAttribute}>\n {props.resources.cancelReportReviewText}\n </button>,\n submitButton: <button className='msc-btn ms-reviews-list__submit' onClick={props.reportReview} {...submitReviewAttribute}>\n {' '}\n {props.resources.reportReviewButtonText || 'Report'}\n </button>,\n succesfulButton: <button className='msc-btn ms-reviews-list__success' onClick={props.onModalToggle} {...successAttribute}>\n {props.resources.okReportReviewText}\n </button>,\n reportMessage: <p className='ms-reviews-list__report-message'>\n {props.resources.reportModalMessage}\n </p>,\n reportSubmittedMessage: <p className='ms-reviews-list__report-message'>\n {props.resources.reportSubmittedMessage}\n </p>,\n radioButtons: radioPairs(props),\n error: <Alert className='ms-reviews-list__report-error' isOpen={props.hasError} color='danger'>\n {props.resources.errorMessageText}\n </Alert>\n };\n};\n\nconst radioPairs = (props: IReportReviewModalProps) => {\n const pairs = [];\n for (const option of reportConcernDropdownOptions) {\n const inputId = `report-review-${option.key}`;\n const checked = option.key === props.reportedKey;\n pairs.push(\n <div className='ms-report-review-modal-pair' key={option.key}>\n <input\n className='msc-radio-input'\n type='radio'\n name='report-error'\n id={inputId}\n data-key={option.key}\n value={option.value}\n checked={checked}\n aria-checked={checked}\n onChange={props.onRadioChange}\n />\n <label className='msc-radio-label' htmlFor={inputId}>\n {option.value}\n </label>\n </div>\n );\n }\n\n return (\n <fieldset>\n {pairs}\n </fieldset>\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './choice-summary';\nexport * from './choice-summary.props';\nexport * from './error-message';\nexport * from './feature-search-result-item';\nexport * from './link';\nexport * from './modal';\nexport * from './product-search-result-items';\nexport * from './range-refine-item';\nexport * from './refine-item';\nexport * from './refine-item.props.common';\nexport * from './refine-item-toggle-notification';\nexport * from './refine-submenu';\nexport * from './separator';\nexport * from './title';\nexport * from './utilities';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutViewProps, ILineItem, ILineItemDeliveryGroup, ILineItems, IOrderSummary, IPickUpAtStore } from './checkout';\nimport { IEmailDelivery } from './components';\nimport { IInvoicePaymentSummary } from './components/get-invoice-payment-summary';\n\nexport const PickUpAtStoreComponent: React.FC<IPickUpAtStore> = ({ PickUpAtStore, label, location }) => (\n <Node {...PickUpAtStore}>\n {label}\n {location}\n </Node>\n);\n\nexport const EmailDeliveryComponent: React.FC<IEmailDelivery> = ({ EmailDelivery, label }) => (\n <Node {...EmailDelivery}>\n {label}\n </Node>\n);\n\nexport const LineItemComponent: React.FC<ILineItem> = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\n <Node {...LineItem}>\n {item}\n {pickUpAtStore && <PickUpAtStoreComponent {...pickUpAtStore} />}\n {emailDelivery && <EmailDeliveryComponent {...emailDelivery} />}\n </Node>\n);\n\nexport const LineItemGroupComponent: React.FC<ILineItemDeliveryGroup> = ({ LineItemDeliveryGroup, LineItemList, heading, lineItems }) => (\n <Node {...LineItemDeliveryGroup}>\n {heading}\n <Node {...LineItemList}>\n {lineItems.map(lineItem => (\n <LineItemComponent key={lineItem.LineId} {...lineItem} />\n ))}\n </Node>\n </Node>\n);\n\nexport const LineItemGroupComponentWithMultiplePickUp: React.FC<ILineItemDeliveryGroup> = ({ LineItemDeliveryGroup, LineItemList, heading, lineItems, lineItemWraper, lineItemWraperIcon }) => (\n <Node {...LineItemDeliveryGroup}>\n {lineItemWraperIcon}\n {lineItemWraper}\n {heading}\n <Node {...LineItemList}>\n {lineItems.map(lineItem => (\n <LineItemComponentWithMultiplePickUp key={lineItem.LineId} {...lineItem} />\n ))}\n </Node>\n </Node>\n);\n\nexport const LineItemComponentWithMultiplePickUp: React.FC<ILineItem> = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\n <Node {...LineItem}>\n {item}\n {emailDelivery && <EmailDeliveryComponent {...emailDelivery} />}\n </Node>\n);\n\nexport const PickUpAtStoreComponentWithMultiplePickUp: React.FC<IPickUpAtStore> = ({ PickUpAtStore, label, location }) => (\n <Node {...PickUpAtStore}>\n {label}\n {location}\n </Node>\n);\n\nexport const LineItemsComponent: React.FC<ILineItems> = ({ LineItems, Header, heading, editLink, itemsForPickup, itemsForShip, itemsForEmail, itemsGroupWithMulitplePickupMode }) => (\n <Node {...LineItems}>\n <Node {...Header}>\n {heading}\n {editLink}\n </Node>\n {itemsGroupWithMulitplePickupMode === undefined && itemsForPickup && <LineItemGroupComponent {...itemsForPickup} />}\n {itemsGroupWithMulitplePickupMode === undefined && itemsForEmail && <LineItemGroupComponent {...itemsForEmail} />}\n {itemsGroupWithMulitplePickupMode === undefined && itemsForShip && <LineItemGroupComponent {...itemsForShip} />}\n {itemsGroupWithMulitplePickupMode !== undefined ? itemsGroupWithMulitplePickupMode.map((item, index) => {\n return <LineItemGroupComponentWithMultiplePickUp {...item} key={index} />;\n }) : null}\n </Node>\n);\n\nconst OrderSummaryComponent: React.FC<IOrderSummary> = ({ heading, lines }) => (\n <div className='msc-order-summary-wrapper'>\n {heading}\n <div className='msc-order-summary__items'>\n {lines && (\n <>\n {lines.subtotal}\n {lines.shipping}\n {lines.otherCharge}\n {lines.tax}\n {lines.totalDiscounts}\n {lines.loyalty}\n {lines.giftCard}\n {lines.orderTotal}\n </>\n )}\n </div>\n </div>\n);\n\nconst PaymentSummaryComponent: React.FC<IInvoicePaymentSummary> = ({ heading, lines }) => (\n <div className='msc-invoice-summary-wrapper'>\n {heading}\n <div className='msc-invoice-summary__items'>\n {lines && (\n <>\n {lines.invoices}\n {lines.giftCard}\n {lines.loyalty}\n {lines.orderTotal}\n </>\n )}\n </div>\n </div>\n);\n\nconst CheckoutView: React.FC<ICheckoutViewProps> = props => {\n const {\n isPaymentVerificationRedirection,\n shouldEnableSinglePaymentAuthorizationCheckout,\n canShow,\n checkoutProps,\n headerProps,\n hasSalesOrder,\n hasInvoiceLine,\n bodyProps,\n mainProps,\n mainControlProps,\n sideProps,\n sideControlFirstProps,\n sideControlSecondProps,\n termsAndConditionsProps,\n orderConfirmation,\n loading,\n alert,\n title,\n guidedForm,\n orderSummary,\n invoicePaymentSummary,\n lineItems,\n placeOrderButton,\n termsAndConditions,\n keepShoppingButton\n } = props;\n\n return (\n <Module {...checkoutProps}>\n {!hasSalesOrder && <Node {...headerProps}>\n {title}\n </Node>}\n {!hasSalesOrder && isPaymentVerificationRedirection && shouldEnableSinglePaymentAuthorizationCheckout && !alert && !loading &&\n <Waiting className='msc-waiting-circular msc-waiting-lg' />}\n {!hasSalesOrder &&\n <Node {...bodyProps}>\n {loading}\n {alert}\n {canShow && (\n <>\n <Node {...mainProps}>\n {guidedForm}\n <Node {...termsAndConditionsProps}>\n {termsAndConditions}\n </Node>\n <Node {...mainControlProps}>\n {placeOrderButton}\n {keepShoppingButton}\n </Node>\n </Node>\n <Node {...sideProps}>\n {!hasInvoiceLine ? orderSummary && <OrderSummaryComponent {...orderSummary} /> : invoicePaymentSummary && <PaymentSummaryComponent {...invoicePaymentSummary} />}\n <Node {...sideControlFirstProps}>\n <Node {...termsAndConditionsProps}>\n {termsAndConditions}\n </Node>\n {placeOrderButton}\n {keepShoppingButton}\n </Node>\n {lineItems && <LineItemsComponent {...lineItems} />}\n <Node {...sideControlSecondProps}>\n <Node {...termsAndConditionsProps}>\n {termsAndConditions}\n </Node>\n {placeOrderButton}\n {keepShoppingButton}\n </Node>\n </Node>\n </>\n )}\n </Node>}\n {hasSalesOrder && orderConfirmation}\n </Module>\n );\n};\n\nexport default CheckoutView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport { RatingComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getRnrAuthEndpointId, getRnrPartnerId } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Alert, Button, getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, Modal, ModalBody, ModalFooter, ModalHeader, TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { GetUserReviewInput } from '../actions/inputs/get-user-review-input';\nimport { SubmitUserReviewInput } from '../actions/inputs/submit-user-review-input';\nimport submitUserReview from '../actions/submit-user-review';\n\nexport interface IReviewModalProps {\n userReview?: Review;\n product?: SimpleProduct;\n renderContextId: string;\n resources: IReviewModalResources;\n context: ICoreContext<IGeneric<IAny>>;\n parentId: string;\n parentType: string;\n isOpen: boolean;\n rating: number;\n reviewTitle: string;\n reviewText: string;\n returnRef: React.RefObject<HTMLButtonElement> | undefined;\n hasError: boolean;\n telemetryContent?: ITelemetryContent;\n onModalToggle(): void;\n onTitleChange(event: React.ChangeEvent<HTMLInputElement>): void;\n onTextChange(event: React.ChangeEvent<HTMLTextAreaElement>): void;\n onRatingChange(value: number): void;\n onReviewComplete?(isSuccess: boolean): void;\n}\n\nexport interface IReviewModalResources {\n selectRatingAriaLabel: string;\n selectRatingLabel: string;\n reviewTitleLabel: string;\n reviewTextLabel: string;\n privacyPolicyTitle: string;\n privacyPolicyTextFormat: string;\n writeReviewModalTitle: string;\n editReviewModalTitle: string;\n submitReviewButtonText: string;\n discardReviewButtonText: string;\n errorMessageText: string;\n reviewTitleAriaLabel?: string;\n reviewAriaLabel?: string;\n}\n\nexport interface IReviewModalViewProps {\n modal: INodeProps;\n modalHeader: React.ReactElement;\n modalFooter: INodeProps;\n modalBody: INodeProps;\n cancelButton: React.ReactElement;\n submitButton: React.ReactElement;\n rating: React.ReactElement;\n ratingLabel: React.ReactElement;\n titleInput: React.ReactElement;\n titleLabel: React.ReactElement;\n textInput: React.ReactElement;\n textLabel: React.ReactElement;\n privacyPolicyUrl: React.ReactElement;\n form: INodeProps;\n inputRow: INodeProps;\n error: React.ReactElement;\n}\n\n/**\n * On Click Submit.\n * @param props -Review Modal props.\n * @returns On submit.\n */\nconst onClickSubmit = (props: IReviewModalProps) => () => {\n onSubmit(props);\n};\n\n/**\n * CartLineItems component.\n */\n\nexport const ReviewModal = (props: IReviewModalProps): IReviewModalViewProps => {\n\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.SubmitReview);\n const submitButtonAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelButtonAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n return {\n modal: { tag: Modal, className: 'ms-review-modal msc-modal-input-required', toggle: props.onModalToggle, applicationNode: 'renderPage', isOpen: props.isOpen, returnFocusRef: props.returnRef },\n modalHeader: modalHeaderNode(props),\n modalFooter: { tag: ModalFooter, className: 'ms-review-modal-footer' },\n modalBody: { tag: ModalBody, className: 'ms-review-modal-body' },\n cancelButton: <Button className='ms-review-modal-cancel' onClick={props.onModalToggle} {...submitButtonAttribute} >\n {props.resources.discardReviewButtonText}\n </Button>,\n submitButton: <Button\n className='ms-review-modal-submit' onClick={onClickSubmit(props)} {...cancelButtonAttribute}\n disabled={submitDisabled(props)}>\n {props.resources.submitReviewButtonText}\n </Button>,\n rating: ratingsInput(props),\n ratingLabel: ratingsLabel(props),\n titleInput: titleInput(props),\n titleLabel: titleLabel(props),\n textInput: textInput(props),\n textLabel: textLabel(props),\n privacyPolicyUrl: privacyPolicyLink(props),\n form: { tag: 'form', className: 'ms-review-modal-form', autoComplete: 'off' },\n inputRow: { tag: 'div', className: 'ms-review-modal-row', autoComplete: 'off' },\n error: <Alert className='ms-review-modal-error' isOpen={props.hasError} color='danger'>\n {props.resources.errorMessageText}\n </Alert>\n };\n};\n\nconst modalHeaderNode = (props: IReviewModalProps) => {\n return (\n <ModalHeader toggle={props.onModalToggle} className='ms-review-modal-header'>\n { props.userReview && props.userReview.reviewId ? props.resources.editReviewModalTitle : props.resources.writeReviewModalTitle }\n </ModalHeader>\n );\n};\n\nconst submitDisabled = (props: IReviewModalProps) => {\n return !props.rating || !stripWhiteSpacesFromString(props.reviewText) || !stripWhiteSpacesFromString(props.reviewTitle);\n};\n\nconst ratingsInput = (props: IReviewModalProps) => {\n return (\n <RatingComponent\n readOnly={false}\n avgRating={0}\n ariaLabel={props.resources.selectRatingAriaLabel}\n initialRating={props.rating}\n context={props.context}\n id={props.parentId}\n typeName={props.parentType}\n data={{}}\n key='ratings'\n onChange={props.onRatingChange}\n />\n );\n};\n\nconst ratingsLabel = (props: IReviewModalProps) => {\n return (<label className='ms-review-modal-rating-label' key='ratingsLabel'>\n {props.resources.selectRatingLabel}\n *\n </label>);\n};\n\nconst titleInput = (props: IReviewModalProps) => {\n const maxLength = props.context.app.config.reviewTitleMaxLength;\n\n return (\n <input\n maxLength={maxLength}\n id={`reviewTitle-${props.renderContextId}`}\n onChange={props.onTitleChange}\n value={props.reviewTitle}\n aria-required='true'\n className='ms-review-modal-title'\n aria-label={props.resources.reviewTitleAriaLabel}\n />\n );\n};\n\nconst titleLabel = (props: IReviewModalProps) => {\n return (<label className='ms-review-modal-title-label' htmlFor={`reviewTitle-${props.renderContextId}`}>\n {props.resources.reviewTitleLabel}\n </label>);\n};\n\nconst reviewTextWidth: number = 50;\n\nconst textInput = (props: IReviewModalProps) => {\n const maxLength = props.context.app.config.reviewTextMaxLength;\n return (\n <textarea\n maxLength={maxLength}\n className='ms-review-modal-text'\n id={`reviewTextArea-${props.renderContextId}`}\n onChange={props.onTextChange}\n rows={maxLength / reviewTextWidth}\n value={props.reviewText}\n aria-required='true'\n aria-label={props.resources.reviewAriaLabel}\n />\n );\n};\n\nconst textLabel = (props: IReviewModalProps) => {\n return (<label htmlFor={`reviewTextArea-${props.renderContextId}`} className='ms-review-modal-text-label'>\n {props.resources.reviewTextLabel}\n </label>);\n};\n\nconst privacyPolicyLink = (props: IReviewModalProps) => {\n const policyTextBlocks = props.resources.privacyPolicyTextFormat.split('{0}');\n const isSeparatorAtStart = props.resources.privacyPolicyTextFormat.startsWith('{0}');\n const isSeparatorAtEnd = props.resources.privacyPolicyTextFormat.endsWith('{0}');\n const privacyPolicyUrl = getUrlSync('rnrPrivacyPolicy', props.context.actionContext);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.PrivacyPolicy);\n const privacyPolicyAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n <p className='ms-review-modal-policy'>\n {isSeparatorAtStart ? '' : policyTextBlocks[0]}\n <a\n href={privacyPolicyUrl} target='_blank' className='msc-link'\n {...privacyPolicyAttribute}>\n {props.resources.privacyPolicyTitle}\n </a>\n {isSeparatorAtEnd ? '' : (isSeparatorAtStart ? policyTextBlocks[0] : policyTextBlocks[1]) }\n </p>\n );\n};\n\nconst onSubmit = (props: IReviewModalProps): void => {\n if (props.product) {\n submitReview(props.product, props.reviewTitle, props.reviewText, props.rating, props.context, props.userReview, props.onReviewComplete);\n }\n};\n\n/**\n * This method strips content of extra white spaces.\n * @param text The text to be stripped of extra white spaces.\n */\nconst stripWhiteSpacesFromString = (text: string): string => {\n return text\n .replace(new RegExp('\\\\r?\\\\n|\\\\r+', 'g'), ' ')\n .replace(new RegExp('\\\\s+', 'g'), ' ')\n .trim();\n};\n\nexport const submitReview = (product: SimpleProduct, title: string, text: string, rating: number, context: ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void) => {\n const { request } = context;\n const { user } = request;\n if (user && request) {\n const input = new SubmitUserReviewInput(\n product.RecordId.toString(),\n getRnrPartnerId(context.actionContext),\n request.apiSettings.channelId.toString(),\n request.locale,\n {\n productName: product && product.Name,\n rating,\n reviewText: stripWhiteSpacesFromString(text),\n title: stripWhiteSpacesFromString(title),\n userEmail: user.emailAddress,\n userName: user.name\n },\n request.user.token,\n getRnrAuthEndpointId(context.actionContext)\n );\n\n submitUserReview(input, context.actionContext).then(reviewId => {\n const review = reviewId ? {\n rating,\n title: stripWhiteSpacesFromString(title),\n reviewText: stripWhiteSpacesFromString(text),\n submittedDateTime: new Date(),\n helpfulPositive: userReview ? userReview.helpfulPositive : 0,\n helpfulNegative: userReview ? userReview.helpfulNegative : 0,\n reviewId,\n userName: request.user.firstName || request.user.name\n } : userReview;\n\n const getReviewInput = new GetUserReviewInput(input.productId!, input.tenantId, input.authorization, input.serviceEndpoint);\n context.actionContext.update(getReviewInput, review);\n\n if (onReviewSubmission) {\n onReviewSubmission(!!reviewId);\n }\n }).catch(() => {\n const productId = product.RecordId;\n context.telemetry.error(`Failed to submit review for product with recordId: ${productId}`);\n context.telemetry.debug(`Failed to submit review for product with recordId: ${productId}`);\n if (onReviewSubmission) {\n onReviewSubmission(false);\n }\n });\n }\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\nimport get from 'lodash/get';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\nexport interface IInvoicePaymentSummary {\n heading?: React.ReactNode;\n lines?: IInvoiceSummaryLines;\n}\nexport const getInvoicePaymentSummary = (input: ICheckoutProps<ICheckoutData>): IInvoicePaymentSummary => {\n const {\n data: { checkout },\n resources: {\n totalAmountLabel,\n invoiceLabel,\n invoiceSummaryTitle\n },\n context,\n typeName,\n id,\n telemetry\n } = input;\n\n const checkoutCart = get(checkout, 'result.checkoutCart');\n const cart = get(checkout, 'result.checkoutCart.cart');\n\n return {\n heading: <h2 className='msc-invoice-summary__heading'>\n { invoiceSummaryTitle }\n </h2>,\n lines: checkoutCart?.hasInvoiceLine ? InvoiceSummary({\n orderTotalLabel: totalAmountLabel,\n invoiceLabel,\n cart,\n context,\n typeName,\n telemetry,\n id,\n checkoutState: checkout.result\n }) : undefined\n };\n\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { Cart, CartLineValidationResults } from '@msdyn365-commerce/retail-proxy';\nimport { updateLineDeliverySpecificationsAsync, validateForCheckoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n DeliveryPreferenceType,\n LineDeliverySpecification,\n SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions,\n getAvailabilitiesForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n Waiting } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\nimport { computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutData } from './checkout.data';\nimport { ICheckoutHeadingData, ICheckoutProps } from './checkout.props.autogenerated';\nimport AlertComponent from './components/alert';\nimport { getInvoicePaymentSummary, IInvoicePaymentSummary } from './components/get-invoice-payment-summary';\nimport { getLineItems, ILineItems } from './components/get-line-items';\nimport { getOrderSummary, IOrderSummary } from './components/get-order-summary';\nimport GuidedFormComponent from './components/guided-form';\nimport PlaceOrderButtonComponent from './components/place-order-button';\nimport placeOrder from './methods/place-order';\n\nexport * from './components/get-line-items';\nexport * from './components/get-order-summary';\n\n/**\n * Device type.\n */\ntype DeviceType = 'Mobile';\n\n/**\n * The Checkout state.\n */\ninterface ICheckoutState {\n errorMessage: string;\n isValidationPassed: boolean;\n isPlaceOrderLoading?: boolean;\n}\n\n/**\n * The Checkout view props.\n * @extends ICheckoutProps<ICheckoutData>\n */\nexport interface ICheckoutViewProps extends ICheckoutProps<ICheckoutData> {\n className: string;\n canShow?: boolean;\n isEmptyCart?: boolean;\n isConsentGiven?: boolean;\n hasError?: boolean;\n isPaymentVerificationRedirection?: boolean;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n cartStatus?: string;\n isMobile?: boolean;\n isEditorialMode?: boolean;\n backToShoppingUrl?: string;\n editCartLink?: string;\n hasSalesOrder: boolean;\n hasInvoiceLine?: boolean;\n\n checkoutProps: IModuleProps;\n headerProps: INodeProps;\n bodyProps: INodeProps;\n mainProps: INodeProps;\n mainControlProps: INodeProps;\n sideProps: INodeProps;\n sideControlFirstProps: INodeProps;\n sideControlSecondProps: INodeProps;\n termsAndConditionsProps: INodeProps;\n\n guidedForm?: React.ReactNode;\n title?: React.ReactNode;\n loading?: React.ReactNode;\n alert?: React.ReactNode;\n orderSummary?: IOrderSummary;\n invoicePaymentSummary?: IInvoicePaymentSummary;\n lineItems?: ILineItems;\n placeOrderButton?: React.ReactNode;\n termsAndConditions?: React.ReactNode;\n keepShoppingButton?: React.ReactNode;\n orderConfirmation?: React.ReactNode;\n}\n\n/**\n * The checkout module props interface.\n */\nexport interface ICheckoutModuleProps extends ICheckoutProps<ICheckoutData>, IModuleStateProps { }\n\n/**\n *\n * CheckoutContainer component.\n * @extends {React.Component<ICheckoutModuleProps>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass Checkout extends React.PureComponent<ICheckoutModuleProps> {\n\n @computed get cartStatus(): Msdyn365.AsyncResultStatus {\n return this.props.data.checkout?.status;\n }\n\n @computed get isEmptyCart(): boolean {\n if (this.isEditorialMode) {\n // Editorial mode: Ignore empty cart\n return false;\n }\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\n return this.cartStatus === 'SUCCESS' && !!cart && !isEmpty(cart) && (!cart.CartLines || cart.CartLines.length === 0);\n }\n\n @computed get hasError(): boolean {\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\n return this.cartStatus === 'FAILED' || (this.cartStatus === 'SUCCESS' && (!cart || isEmpty(cart)));\n }\n\n @computed get isEditorialMode(): boolean {\n return this.props.context.request.params.isEditor;\n }\n\n @computed public get isPaymentVerificationRedirection(): boolean {\n const { requestFormData, query } = this.props.context.request;\n return !!((requestFormData || (query && query.pv === '1')));\n }\n\n @computed get canPlaceOrder(): boolean {\n const isTermsAndConditionAccepted = this.props.data.checkout.result && this.props.data.checkout.result?.isTermsAndConditionAccepted;\n\n const shouldEnableSinglePaymentAuthorizationCheckout = this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\n\n // If isTermsAndConditionAccepted is undefined means TermsAndCondition module is not added to page and we should able to place order.\n return this.props.moduleState.isReady &&\n (isTermsAndConditionAccepted === undefined ||\n isTermsAndConditionAccepted ||\n shouldEnableSinglePaymentAuthorizationCheckout) &&\n ((this.state.errorMessage === '' || shouldEnableSinglePaymentAuthorizationCheckout) || this.isPaymentVerificationRedirection);\n }\n\n @computed get isCartReady(): boolean {\n return !!this.props.data.checkout.result?.checkoutCart?.cart &&\n this.props.data.customerInformation.status !== 'LOADING' &&\n this.props.data.featureState.status !== 'LOADING';\n }\n\n public state: ICheckoutState = {\n errorMessage: '',\n isValidationPassed: false,\n isPlaceOrderLoading: false\n };\n\n private readonly telemetryContent: ITelemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n\n public componentDidMount(): void {\n const {\n resources: { genericErrorMessage }\n } = this.props;\n\n when(\n () => this.hasError,\n () => {\n this.setState({\n errorMessage: genericErrorMessage\n });\n this.props.context.telemetry.error('Failed to get cart');\n }\n );\n\n when(\n () => {\n return this.isEmptyCart;\n },\n () => {\n this.redirectToCartPage('Cart is empty, but no editCartLink found');\n }\n );\n\n when(\n () => this.isCartReady,\n () => {\n this.validateForCheckout();\n }\n );\n\n reaction(\n () => this.props.moduleState.isReady,\n () => {\n this.onContainerReady();\n }\n );\n\n // Reaction to call place order when isPaymentSectionContainerReady is true for new checkout flow.\n reaction(\n () => this.props.data.checkout.result?.isPaymentSectionContainerReady,\n async (isReady) => {\n if (!this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && isReady &&\n !this.props.data.checkout.result.redirectAdditionalContext) {\n if (!this.state.isPlaceOrderLoading) {\n this.setState({ isPlaceOrderLoading: true });\n }\n\n await this.onPlaceOrder();\n\n // If 3D authentication redirection, don't update isPlaceOrderLoading\n if (!this.props.data.checkout.result.isPaymentVerificationRequired) {\n this.setState({ isPlaceOrderLoading: false });\n }\n }\n }\n );\n\n // Reaction to enable place order button when isPaymentSectionContainerHasError is true for new checkout flow.\n reaction(\n () => this.props.data.checkout.result?.isPaymentSectionContainerHasError,\n (hasError) => {\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && hasError) {\n this.setState({ isPlaceOrderLoading: false });\n }\n }\n );\n\n // Reaction to enable place order button when redirection is true for new checkout flow.\n reaction(\n () => this.canPlaceOrder,\n async () => {\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && this.canPlaceOrder) {\n const { requestFormData, query } = this.props.context.request;\n const isRedirection = !!((requestFormData && query && query.pv === '1'));\n if (isRedirection) {\n await this.props.data.checkout.result.updateIsPlaceOrderEnabledInRedirection({\n newIsPlaceOrderEnabledInRedirection: true\n });\n }\n }\n }\n );\n }\n\n // eslint-disable-next-line complexity -- ignore the complexity.\n public render(): JSX.Element {\n const {\n moduleState,\n config: { className, checkoutHeading, disableGuidedCheckoutFlow },\n resources,\n context: {\n request: {\n user: {\n isAuthenticated\n }\n }\n }\n } = this.props;\n const { errorMessage } = this.state;\n const { backToShopping, placeOrderText, confirmPaymentText, cookieConsentRequiredMessage, genericErrorMessage } = resources;\n const checkoutClass = classnames('ms-checkout', className);\n const checkoutInformation = this.getSlotItems('checkoutInformation');\n\n const isConsentGiven =\n this.props.context.request &&\n this.props.context.request.cookies &&\n this.props.context.request.cookies.isConsentGiven &&\n this.props.context.request.cookies.isConsentGiven();\n\n const isMobile =\n this.props.context.request &&\n this.props.context.request.device &&\n (this.props.context.request.device.Type as DeviceType) === 'Mobile';\n\n const backToShoppingUrl = Msdyn365.getUrlSync('home', this.props.context.actionContext) || '';\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\n\n const termsAndConditions =\n this.props.slots.termsAndConditions &&\n this.props.slots.termsAndConditions.length > 0 &&\n this.props.slots.termsAndConditions[0];\n\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.BackToShopping);\n const backToShoppingAttributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n\n const hasInvoiceLine = this.props.data.checkout && this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n const checkoutBtnText = hasInvoiceLine ? confirmPaymentText : placeOrderText;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const shouldEnableSinglePaymentAuthorizationCheckout = this.props.data.checkout?.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const isExpressCheckoutApplied = this.props.data.checkout?.result?.isExpressCheckoutApplied ?? false;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasShippingAddress = this.props.data.checkout?.result?.hasShippingAddress;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasCartDeliveryMode = this.props.data.checkout?.result?.hasCartDeliveryMode;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const hasGuestCheckoutEmail = this.props.data.checkout?.result?.hasGuestCheckoutEmail;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check null/undefined.\n const isTermsAndConditionAccepted = this.props.data.checkout?.result?.isTermsAndConditionAccepted;\n\n let viewProps: ICheckoutViewProps = {\n ...this.props,\n className: checkoutClass,\n isEmptyCart: this.isEmptyCart,\n isConsentGiven,\n hasError: this.hasError,\n isPaymentVerificationRedirection: this.isPaymentVerificationRedirection,\n shouldEnableSinglePaymentAuthorizationCheckout,\n hasSalesOrder: this.props.data.checkout && this.props.data.checkout.result !== undefined && this.props.data.checkout.result.salesOrder !== undefined,\n hasInvoiceLine,\n cartStatus: this.cartStatus,\n isMobile,\n backToShoppingUrl,\n editCartLink,\n isEditorialMode: this.isEditorialMode,\n orderConfirmation: this.props.slots.orderConfirmation && this.props.slots.orderConfirmation.length > 0 ? this.props.slots.orderConfirmation[0] : undefined,\n checkoutProps: { moduleProps: this.props, className: checkoutClass },\n headerProps: { className: 'ms-checkout__head' },\n bodyProps: { className: 'ms-checkout__body' },\n mainProps: { className: 'ms-checkout__main' },\n mainControlProps: { className: 'ms-checkout__main-control' },\n sideProps: { className: 'ms-checkout__side' },\n sideControlFirstProps: { className: 'ms-checkout__side-control-first' },\n sideControlSecondProps: { className: 'ms-checkout__side-control-second' },\n termsAndConditionsProps: { className: 'ms-checkout__terms-and-conditions' },\n title: checkoutHeading && (\n this.renderMsdyn365Text(checkoutHeading)\n )\n };\n\n if (!isConsentGiven && isAuthenticated) {\n viewProps = {\n ...viewProps,\n alert: <AlertComponent {...{ message: cookieConsentRequiredMessage }} />\n };\n } else if (this.isLoading()) {\n viewProps = {\n ...viewProps,\n loading: <Waiting className='msc-waiting-circular msc-waiting-lg' />\n };\n } else if (this.hasError) {\n viewProps = {\n ...viewProps,\n alert: <AlertComponent {...{ message: genericErrorMessage }} />\n };\n } else {\n viewProps = {\n ...viewProps,\n alert: errorMessage && <AlertComponent {...{ message: errorMessage }} />,\n canShow: true,\n guidedForm: checkoutInformation ? (\n <GuidedFormComponent\n {...{\n items: checkoutInformation,\n moduleState,\n disableGuidedCheckoutFlow,\n resource: resources,\n requestContext: this.props.context,\n isMobile,\n isEditor: this.isEditorialMode,\n telemetryContent: this.telemetryContent,\n isPaymentVerificationRedirection: this.isPaymentVerificationRedirection,\n shouldEnableSinglePaymentAuthorizationCheckout,\n hasError: !!errorMessage,\n hasShippingAddress,\n hasCartDeliveryMode,\n hasGuestCheckoutEmail,\n isTermsAndConditionAccepted\n }}\n />\n ) : (\n undefined\n ),\n orderSummary: getOrderSummary(this.props),\n invoicePaymentSummary: getInvoicePaymentSummary(this.props),\n lineItems: hasInvoiceLine ? undefined : getLineItems(this.props, this.telemetryContent),\n placeOrderButton: (\n <PlaceOrderButtonComponent {...{\n checkoutBtnText,\n placeOrder: (\n !isExpressCheckoutApplied && shouldEnableSinglePaymentAuthorizationCheckout\n ) ? this.triggerPaymentWithPlaceOrder : this.onPlaceOrder,\n\n canPlaceOrder: this.canPlaceOrder,\n telemetryContent: this.telemetryContent,\n shouldEnableSinglePaymentAuthorizationCheckout: this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout,\n isPlaceOrderLoading: this.state.isPlaceOrderLoading,\n isExpressCheckoutApplied\n }} />\n ),\n termsAndConditions,\n keepShoppingButton: backToShoppingUrl && (\n <Button\n className='ms-checkout__btn-keep-shopping msc-btn'\n title={backToShopping}\n color='secondary'\n href={backToShoppingUrl}\n {...backToShoppingAttributes}\n >\n {backToShopping}\n </Button>\n )\n };\n }\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Renders heading.\n * @param checkoutHeading - The checkout heading.\n * @returns React node.\n */\n public renderMsdyn365Text(checkoutHeading: ICheckoutHeadingData): React.ReactNode {\n return (\n <Msdyn365.Text\n {...checkoutHeading}\n tag={checkoutHeading.tag || 'h2'}\n className='ms-checkout__title'\n text={checkoutHeading.text}\n editProps={{ onEdit: this.handleCheckoutHeadingChange, requestContext: this.props.context.request }}\n />\n );\n }\n\n /**\n * Event handler for heading change event.\n * @param event - The content change event in heading element.\n * @returns The new heading value.\n */\n public handleCheckoutHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.checkoutHeading!.text = event.target.value;\n\n /**\n * Checks if cart is loading.\n * @returns True if is loading, false otherwise.\n */\n private readonly isLoading = (): boolean => {\n return !this.cartStatus || this.cartStatus === 'LOADING' || this.isEmptyCart || !this.state.isValidationPassed;\n };\n\n /**\n * Get slot items.\n * @param key - The slot key.\n * @returns React node or undefined.\n */\n private readonly getSlotItems = (key: string): React.ReactNode[] | undefined => {\n const { slots } = this.props;\n return slots && slots[key] && slots[key].length > 0 ? slots[key] : undefined;\n };\n\n /**\n * Trigger the payment section container submit when placing order.\n */\n private readonly triggerPaymentWithPlaceOrder = async (): Promise<void> => {\n this.setState({ isPlaceOrderLoading: true });\n\n await this.props.data.checkout.result?.updateShouldTriggerPaymentWithPlaceOrder(\n { newShouldTriggerPaymentWithPlaceOrder: !this.props.data.checkout.result.shouldTriggerPaymentWithPlaceOrder });\n };\n\n /**\n * On place order.\n * @returns Void promise.\n */\n private readonly onPlaceOrder = async (): Promise<void> => {\n const {\n resources: { checkoutOutOfStockErrorMessage, genericErrorMessage, invalidCartVersionErrorMessage },\n context: { actionContext, app: { config: { enableStockCheck = false } } },\n slots: { orderConfirmation },\n data: { checkout, products }\n } = this.props;\n\n // If hasInvoiceLine is true, no inventory check\n if (!this.props.data.checkout.result?.checkoutCart.hasInvoiceLine && enableStockCheck &&\n await this.isOverMaxQuantity((await checkout).checkoutCart.cart, (await products))) {\n this.setState({\n errorMessage: checkoutOutOfStockErrorMessage\n });\n this.props.context.telemetry.error(checkoutOutOfStockErrorMessage);\n } else {\n const hasOrderConfirmation = orderConfirmation && orderConfirmation.length > 0;\n\n const updatedCartVersion = await this.updateCartLineEmailAddress(this.props.data.checkout.result?.guestCheckoutEmail || '');\n\n await placeOrder(actionContext, this.props.data.checkout.result, this.props.data.products.result,\n !hasOrderConfirmation, updatedCartVersion, this.isPaymentVerificationRedirection).catch(error => {\n let errorMessage = genericErrorMessage;\n\n if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n errorMessage = invalidCartVersionErrorMessage;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown error type.\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && error.data?.AdditionalContext &&\n !this.isPaymentVerificationRedirection) {\n return;\n }\n\n this.setState({\n errorMessage\n });\n this.props.telemetry.exception(error);\n });\n\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: false });\n }\n };\n\n /**\n * Update receipt email address for electronic cart line.\n * @param newGuestCheckoutEmail - The guest checkout email.\n * @returns The updated cart version.\n */\n private readonly updateCartLineEmailAddress = async (newGuestCheckoutEmail: string): Promise<number | undefined> => {\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n\n const emailDeliveryCartLines = this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(\n cartLine => (cartLine.DeliveryMode && cartLine.DeliveryMode !== '' && cartLine.DeliveryMode === emailDeliveryModeCode)\n );\n\n let updatedCartVersion: number | undefined;\n if (emailDeliveryCartLines && emailDeliveryCartLines.length > 0) {\n const lineDeliverySpecifications: LineDeliverySpecification[] = emailDeliveryCartLines.map(line => {\n return { LineId: line.LineId,\n DeliverySpecification: {\n DeliveryModeId: emailDeliveryModeCode,\n DeliveryPreferenceTypeValue: DeliveryPreferenceType.ElectronicDelivery,\n ElectronicDeliveryEmailAddress: newGuestCheckoutEmail\n }\n };\n });\n\n await updateLineDeliverySpecificationsAsync(\n { callerContext: this.props.context.actionContext },\n (await this.props.data.checkout).checkoutCart.cart.Id,\n lineDeliverySpecifications\n ).then(updatedCart => {\n updatedCartVersion = updatedCart.Version;\n }).catch(error => {\n this.props.context.actionContext.telemetry.exception(error);\n throw new Error('[updateLineDeliverySpecificationsAsync] Unable to update electronic delivery email address in cart');\n });\n }\n\n return updatedCartVersion;\n };\n\n /**\n * Return true if any product in the cart is over its max quantity.\n * @param cart -- The checkout cart.\n * @param products -- The checkout products.\n * @returns - Is any product in the cart is over max quantity.\n */\n private readonly isOverMaxQuantity = async (cart: Cart, products: SimpleProduct[]): Promise<boolean> => {\n let isOverMaxQuantity = false;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n\n await getAvailabilitiesForCartLineItems(\n new ProductAvailabilitiesForCartLineItems(this.props.context.actionContext.requestContext.apiSettings),\n this.props.context.actionContext\n ).then(productInventoryInformation => {\n const productsThatShouldValidateInventory: IProductInventoryInformation [] = [];\n\n cart.CartLines?.map((cartline) => {\n\n const cartlineProduct = products.find(product => product.RecordId === cartline.ProductId);\n\n // If product is non-stocked or cartline is electronic delivery, then no inventory check\n const isStockedItem = cartlineProduct?.Behavior?.IsStockedProduct;\n const isEmailDelivery = (cartline.DeliveryMode && cartline.DeliveryMode !== '') ? cartline.DeliveryMode === emailDeliveryModeCode : false;\n const shouldSkipInventoryCheck = !isStockedItem || isEmailDelivery;\n if (!shouldSkipInventoryCheck && ArrayExtensions.hasElements(productInventoryInformation)) {\n const foundProductAvailability = productInventoryInformation.find((productInventory) => {\n return productInventory.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n if (foundProductAvailability) {\n productsThatShouldValidateInventory.push(foundProductAvailability);\n }\n }\n });\n\n const cartLinesInventoryValidation = validateCartLinesInventory(\n cart.CartLines ?? [],\n productsThatShouldValidateInventory,\n this.props.context.actionContext,\n products,\n emailDeliveryModeCode);\n\n // If is invalid then exceeds the available quantity\n isOverMaxQuantity = !cartLinesInventoryValidation.isValid;\n return isOverMaxQuantity;\n }).catch(error => {\n this.props.context.actionContext.telemetry.exception(error);\n throw new Error('[getAvailabilitiesForCartLineItems] Unable to get availabilities for products in checkout cart');\n });\n\n return isOverMaxQuantity;\n };\n\n /**\n * Gets active child in module state.\n * @returns - The module state manager collection.\n */\n private readonly getActiveChildModuleStates = (): IModuleStateManager[] => {\n const { childIds, getModule } = this.props.moduleState;\n return childIds\n .map(getModule)\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\n };\n\n /**\n * On container ready.\n */\n private readonly onContainerReady = (): void => {\n this.getActiveChildModuleStates().forEach(state => {\n state.isReady && state.onContainerReady && state.onContainerReady();\n });\n };\n\n /**\n * Redirects to cart page.\n * @param notFoundEditCartLinkMessage - Not found edit cart link message.\n */\n private readonly redirectToCartPage = (notFoundEditCartLinkMessage: string): void => {\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\n if (window && editCartLink) {\n window.location.assign(editCartLink);\n } else {\n this.setState({\n errorMessage: this.props.resources.genericErrorMessage\n });\n this.props.context.telemetry.error(notFoundEditCartLinkMessage);\n }\n };\n\n /**\n * Validates for checkout.\n * @param retry - Retry flag.\n */\n private readonly validateForCheckout = (retry: boolean = true): void => {\n const notFoundEditCartLinkMessage = 'Cart doesn\\'t pass validation, but no editCartLink found';\n const cart = this.props.data.checkout.result!.checkoutCart.cart;\n const { Id, Version } = cart;\n const isOrderQuantityLimitsFeatureEnabledInHq = this.props.data.featureState.result\n ?.find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n const customerInfo = this.props.data.customerInformation.result;\n\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all' ||\n (customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b)));\n if (isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings) {\n if (Version && Id) {\n validateForCheckoutAsync({ callerContext: this.props.context.actionContext, bypassCache: 'none' }, Id, Version)\n .then((result: CartLineValidationResults) => {\n if (result.ValidationFailuresByCartLines?.length !== 0) {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n } else {\n this.setState({ isValidationPassed: true });\n }\n })\n .catch((error) => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to validate Cart');\n if (retry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n const cartState = this.props.data.checkout.result?.checkoutCart;\n cartState?.refreshCart({})\n .then(() => {\n this.validateForCheckout(false);\n })\n .catch((refreshError: Error) => {\n this.props.telemetry.warning(refreshError.message);\n this.props.telemetry.debug('Unable to refresh Cart');\n });\n } else {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n }\n });\n } else {\n this.redirectToCartPage(notFoundEditCartLinkMessage);\n }\n } else {\n this.setState({ isValidationPassed: true });\n }\n };\n}\n\nexport default Checkout;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchResultContainerResources } from '../search-result-container.props.autogenerated';\n\ninterface IProductSearchResultItems {\n products: ProductSearchResult[];\n context: ICoreContext;\n resources: ISearchResultContainerResources;\n imageSettings?: IImageSettings;\n moduleType: string;\n moduleId: string;\n allowBackNavigation?: boolean;\n telemetryContent: ITelemetryContent;\n quickviewSlot?: {} | null | undefined;\n channelInventoryConfigurationId?: number;\n isPriceMinMaxEnabled?: boolean;\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\n}\n\n/**\n * Returns the product inventory label.\n * @param channelInventoryConfigurationId - The channel configuration Id.\n * @param product - The product.\n * @returns The inventory label.\n */\nexport function getInventoryLabel(\n channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\n\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\n return undefined;\n }\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\n if (inventoryAttribute) {\n return inventoryAttribute.TextValue;\n }\n return undefined;\n}\n\nexport const ProductSearchResultItems: React.FC<IProductSearchResultItems> = ({\n products,\n context,\n imageSettings,\n resources,\n moduleType,\n moduleId,\n allowBackNavigation,\n telemetryContent,\n quickviewSlot,\n channelInventoryConfigurationId,\n isPriceMinMaxEnabled,\n productsDimensionAvailabilities\n}) => {\n const priceResources: IPriceComponentResources = {\n priceRangeSeparator: resources.priceRangeSeparator\n };\n return (\n\n <ul className='list-unstyled'>\n {products.map((product: ProductSearchResult, index: number) => (\n <li className='ms-product-search-result__item' key={index}>\n <ProductComponent\n context={context}\n telemetryContent={telemetryContent}\n imageSettings={imageSettings}\n freePriceText={resources.priceFree}\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n ratingAriaLabel={resources.ratingAriaLabel}\n allowBack={allowBackNavigation}\n id={moduleId}\n key={product.RecordId}\n typeName={moduleType}\n data={{ product }}\n quickViewButton={quickviewSlot}\n inventoryLabel={getInventoryLabel(channelInventoryConfigurationId, product)}\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\n priceResources={priceResources}\n swatchItemAriaLabel={resources.swatchItemAriaLabel}\n dimensionAvailabilities={productsDimensionAvailabilities?.find(\n dimensionAvailability => ArrayExtensions.hasElements(dimensionAvailability) &&\n dimensionAvailability[0].masterProductId === product.MasterProductId)}\n />\n </li>\n ))}\n </ul>\n );\n\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ProductListInventoryFilteringOptions } from '../actions';\nimport { IChoiceSummaryProps } from './choice-summary.props';\nimport { isMatchingRefinementCriterion, isRangeType } from './utilities';\n\ninterface IRefinerMap {\n key: string;\n value: ProductRefinerValue;\n}\n\n/**\n * ChoiceSummary component.\n */\n@observer\nexport default class ChoiceSummary extends React.PureComponent<IChoiceSummaryProps> {\n private readonly closeButtonGlyph: string = 'msi-close-btn';\n\n private readonly payLoad: IPayLoad;\n\n @computed get selectedRefinersMap(): IRefinerMap[] {\n let { selectedChoices } = this.props;\n const { channelInventoryConfigurationId, refinerHierarchy } = this.props;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n if (this.props.context?.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n selectedChoices = selectedChoices.filter(choice => {\n const parent = refinerHierarchy.find(\n // eslint-disable-next-line unicorn/prefer-array-some, max-len -- Existing code\n (hierarchy: IProductRefinerHierarchy) => !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, choice))\n );\n return parent && parent.RecordId !== channelInventoryConfigurationId;\n });\n }\n return selectedChoices.map((selectedRefiner: ProductRefinerValue) => {\n return {\n key: this._getKeyForRefinerValue(selectedRefiner),\n value: selectedRefiner\n } as IRefinerMap;\n });\n }\n\n constructor(props: Readonly<IChoiceSummaryProps>) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public render(): JSX.Element {\n const { clearAllText, label, classNames, choiceAriaLabel, closeAriaLabel } = this.props;\n const items = this.selectedRefinersMap;\n this.payLoad.contentAction.etext = clearAllText;\n const clearAllAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n <div className='msc-choice-summary'>\n {items.length > 0 && label && <span className='msc-choice-summary__label'>\n {label}\n </span>}\n <ul className={classnames(classNames, 'msc-choice-summary__list', 'list-unstyled')}>\n {items.map((item: IRefinerMap) => {\n this.payLoad.contentAction.etext = item.key;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <li className='msc-choice-summary__list-item' key={item.key}>\n <a\n className='msc-choice-summary__item'\n href={this.props.urlBuilder(item.value, false)}\n aria-label={`${item.key} ${choiceAriaLabel}`}\n onClick={this._onClick}\n role='button'\n {...attribute}\n >\n {item.key}\n <span className={`${this.closeButtonGlyph} msc-choice-summary__glyph`} role='button' aria-label={closeAriaLabel} />\n </a>\n </li>\n );\n })}\n </ul>\n {items.length > 0 && clearAllText && <a\n href={this.props.urlBuilder({}, true)} className='msc-choice-summary__clear-all' {...clearAllAttributes}\n onClick={this._onClick}>\n {clearAllText}\n </a>}\n </div>\n );\n }\n\n private _getKeyForRefinerValue(productRefinerValue: ProductRefinerValue): string {\n const { choiceFormat, choiceRangeValueFormat, refinerHierarchy, telemetry } = this.props;\n const overallFormat = choiceFormat || '{1}';\n const rangeFormat = choiceRangeValueFormat;\n let refinerName = '';\n if (refinerHierarchy && refinerHierarchy.find) {\n const parent = refinerHierarchy.find(\n // eslint-disable-next-line unicorn/prefer-array-some, max-len -- Existing code\n (hierarchy: IProductRefinerHierarchy) => !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, productRefinerValue))\n );\n\n if (!parent) {\n telemetry.warning('[choice-summary] could not find parent of selected refiner value');\n } else {\n refinerName = parent.KeyName || '';\n }\n }\n\n let refinerValueName: string;\n if (isRangeType(productRefinerValue.DataTypeValue)) {\n refinerValueName = rangeFormat\n .replace('{0}', this._formatPrice(productRefinerValue.LeftValueBoundString, productRefinerValue.UnitText))\n .replace('{1}', this._formatPrice(productRefinerValue.RightValueBoundString, productRefinerValue.UnitText));\n } else {\n refinerValueName = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\n }\n\n return overallFormat.replace('{0}', refinerName).replace('{1}', refinerValueName);\n }\n\n private _formatPrice(amount: string | undefined, currency: string | undefined): string {\n if (!amount || !currency) {\n this.props.telemetry.trace('[choice-summary] could not format price');\n return amount || '';\n }\n let result = amount;\n\n try {\n result = this.props.context!.cultureFormatter.formatCurrency(Number(amount), currency);\n } catch (error) {\n this.props.telemetry.warning(`Failed to format price for ${result}: ${error}`);\n }\n\n return result;\n }\n\n private readonly _onClick = (e: React.MouseEvent<HTMLAnchorElement>): void => {\n e.preventDefault();\n e.stopPropagation();\n\n const target = e.currentTarget as HTMLElement;\n const clearAll = target.getAttribute('class')!.includes('choice-summary__clear-all');\n const selectedRefiner = clearAll ? undefined : this._getSelectedRefinerChoice(target);\n\n if (this.props.onChoiceClicked) {\n this.props.onChoiceClicked({\n clearAll,\n itemClicked: target,\n choiceClicked: selectedRefiner,\n nextItemToFocus: target.nextSibling as HTMLElement\n });\n }\n };\n\n private _getSelectedRefinerChoice(itemClicked: HTMLElement): ProductRefinerValue | undefined {\n const result = this.selectedRefinersMap.find(selected => (itemClicked.textContent && itemClicked.textContent.trim()) === selected.key);\n return (result && result.value) || undefined;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from './components';\nimport { ISearchViewProps } from './search';\n\nconst SearchView: React.FC<ISearchViewProps> = props => {\n const {\n Search,\n AutoSuggestAriaLabel,\n AutoSuggestAriaLabelText,\n searchText,\n AutoSuggest,\n KeywordSuggest,\n ProductSuggest,\n CategorySuggest,\n UlKeyword,\n UlProduct,\n UlCategory,\n form,\n autosuggestCategory,\n autosuggestKeyword,\n autosuggestProduct,\n SearchForm,\n FormWrapper,\n label,\n isLoadingAutoSuggest,\n isLoadingNode\n } = props;\n\n return (\n <Module {...Search}>\n {label}\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\n <Node {...AutoSuggest}>\n {searchText && searchText.length > 0 ? <Node {...AutoSuggestAriaLabel}>\n {AutoSuggestAriaLabelText}\n </Node> : ''}\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword, isLoadingAutoSuggest, isLoadingNode)}\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct, isLoadingAutoSuggest, isLoadingNode)}\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory, isLoadingAutoSuggest, isLoadingNode)}\n </Node>\n </Module>\n );\n};\n\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\n return (\n <Node {...SearchForm}>\n <Node {...FormWrapper}>\n {form.input}\n {form.cancelBtn}\n {form.submitBtn}\n </Node>\n </Node>\n );\n};\n\nconst _renderKeywordSuggestions = (\n KeywordSuggest: INodeProps,\n UlKeyword: INodeProps,\n keywordSuggestions?: ISearchKeywordViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n keywordSuggestions && (\n <Node {...KeywordSuggest}>\n <Node {...UlKeyword}>\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest && keywordSuggestions.text.map(text => {\n return text;\n })}\n </Node>\n </Node>\n )\n );\n};\n\nconst _renderProductSuggestions = (\n ProductSuggest: INodeProps,\n UlProduct: INodeProps,\n productSuggestions?: ISearchProductViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n productSuggestions && (\n <Node {...ProductSuggest}>\n <Node {...UlProduct}>\n {productSuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest && productSuggestions.items.map((item, index) => {\n return (\n <Node {...item.LiProduct} key={item.id || index}>\n <Node {...item.AProduct}>\n {item.thumbnail}\n {item.text}\n {item.price}\n </Node>\n </Node>\n );\n })}\n </Node>\n </Node>\n )\n );\n};\n\nconst _renderCategorySuggestions = (\n CategorySuggest: INodeProps,\n UlCategory: INodeProps,\n categorySuggestions?: ISearchCategoryViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n categorySuggestions && (\n <Node {...CategorySuggest}>\n <Node {...UlCategory}>\n {categorySuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest && categorySuggestions.text.map(text => {\n return text;\n })}\n </Node>\n </Node>\n )\n );\n};\n\nexport default SearchView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { showAdditionalFields } from '../gift-card-balance-check.props.autogenerated';\n\nexport interface IGetFormInput {\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n inputRef?: React.RefObject<HTMLInputElement>;\n inputPinRef?: React.RefObject<HTMLInputElement>;\n inputExpRef?: React.RefObject<HTMLInputElement>;\n supportExternalGiftCard?: boolean;\n additionalFields?: showAdditionalFields;\n resources: {\n balanceCheckButton: string;\n giftCardFormLabel: string;\n giftCardNumberLabel: string;\n giftCardPinLabel: string;\n giftCardExpLabel: string;\n giftCardAlertLabel: string;\n giftCardPinPlaceholderText: string;\n giftCardExpPlaceholderText: string;\n };\n onEnterGiftCardNumber(giftCardNumber: string): void;\n onEnterGiftCardPin(giftCardPin: string): void;\n onEnterGiftCardExp(giftCardExp: string): void;\n onApplyGiftCard(): Promise<void>;\n}\n\nexport interface IForm {\n formProps: INodeProps;\n label: React.ReactNode;\n inputPinLabel: React.ReactNode;\n inputExpLabel: React.ReactNode;\n alert: React.ReactNode;\n inputProps: INodeProps;\n inputNumProps: INodeProps;\n inputPinProps: INodeProps;\n inputExpProps: INodeProps;\n inputNumber: React.ReactNode;\n inputPin: React.ReactNode;\n inputExp: React.ReactNode;\n applyButton: React.ReactNode;\n supportExternalGiftCard: boolean | undefined;\n showGiftCardPinInput: boolean | undefined;\n showGiftCardExpInput: boolean | undefined;\n alertFieldLabel: React.ReactNode;\n}\n\n/**\n * On apply function.\n * @param onApplyGiftCard -On apply gift card.\n * @returns Apply gift card.\n */\nconst onApplyHandler = (onApplyGiftCard: () => Promise<void>) => async (event: React.SyntheticEvent): Promise<void> => {\n event.preventDefault();\n await onApplyGiftCard();\n};\n\n/**\n * On change number function.\n * @param onEnterGiftCardNumber -On enter gift card number.\n * @returns On gift card enter pin function result.\n */\nconst onChangeNumberHandler = (onEnterGiftCardNumber: (giftCardNumber: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardNumber(value);\n};\n\n/**\n * On change pin function.\n * @param onEnterGiftCardPin -On enter gift card pin.\n * @returns On enter gift card pin function result.\n */\nconst onChangePinHandler = (onEnterGiftCardPin: (giftCardPin: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardPin(value);\n};\n\n/**\n * On change exp function.\n * @param onEnterGiftCardExp -On enter gift card.\n * @returns On enter gift card function result.\n */\nconst onChangeExpHandler = (onEnterGiftCardExp: (giftCardExp: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardExp(value);\n};\n\nexport const getForm = (options: IGetFormInput): IForm => {\n const {\n errorMessage,\n inputRef,\n inputPinRef,\n inputExpRef,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n onEnterGiftCardNumber,\n onEnterGiftCardPin,\n onEnterGiftCardExp,\n onApplyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n resources: { balanceCheckButton, giftCardFormLabel, giftCardNumberLabel, giftCardPinLabel, giftCardExpLabel,\n giftCardAlertLabel, giftCardPinPlaceholderText, giftCardExpPlaceholderText }\n } = options;\n\n const formProps = {\n className: classnames('ms-gift-card-balance-check__form', { 'is-invalid': !!errorMessage }),\n onSubmit: onApplyHandler(onApplyGiftCard),\n tag: 'form' as NodeTag\n };\n\n const label = (\n <label id='ms-gift-card-balance-check__label' className='ms-gift-card-balance-check__input-label'>\n {giftCardFormLabel}\n </label>\n );\n\n const inputPinLabel = (\n <label id='ms-gift-card-balance-check__input-pin-label' className='ms-gift-card-balance-check__input-pin-label'>\n {giftCardPinLabel}\n </label>\n );\n\n const inputExpLabel = (\n <label id='ms-gift-card-balance-check__input-exp-label' className='ms-gift-card-balance-check__input-exp-label'>\n {giftCardExpLabel}\n </label>\n );\n\n const alertFieldLabel = (\n <label id='ms-gift-card-balance-check__input-alert' className='ms-gift-card-balance-check__input-alert-label'>\n {giftCardAlertLabel}\n </label>\n );\n\n const alert = (\n <Alert\n tag='span'\n id='ms-gift-card-balance-check__error'\n className='ms-gift-card-balance-check__input-error'\n role='alert'\n assertive={false}\n fade={false}\n includeAlertClass={false}\n isOpen={!!errorMessage}\n >\n {errorMessage}\n </Alert>\n );\n\n const inputProps = {\n className: 'ms-gift-card-balance-check__input-fields'\n };\n\n const inputNumProps = {\n className: 'ms-gift-card-balance-check__input-num-fields'\n };\n\n const inputPinProps = {\n className: 'ms-gift-card-balance-check__input-pin-fields'\n };\n\n const inputExpProps = {\n className: 'ms-gift-card-balance-check__input-exp-fields'\n };\n\n const inputNumber = (\n <input\n ref={inputRef}\n type='text'\n className='ms-gift-card-balance-check__input-text form-control'\n aria-label={giftCardNumberLabel}\n onChange={onChangeNumberHandler(onEnterGiftCardNumber)}\n value={giftCardNumber}\n aria-labelledby='ms-gift-card-balance-check__label ms-gift-card-balance-check__error'\n />\n );\n\n const inputPin = (\n <input\n ref={inputPinRef}\n type='text'\n className='ms-gift-card-balance-check__input-pin-text form-contol'\n aria-label={giftCardPinLabel}\n placeholder={giftCardPinPlaceholderText}\n onChange={onChangePinHandler(onEnterGiftCardPin)}\n value={giftCardPin}\n aria-labelledby='ms-gift-card-balance-check__label ms-gift-card-balance-check__error'\n />\n );\n\n const inputExp = (\n <input\n ref={inputExpRef}\n type='text'\n className='ms-gift-card-balance-check__input-exp-text form-contol'\n aria-label={giftCardExpLabel}\n placeholder={giftCardExpPlaceholderText}\n onChange={onChangeExpHandler(onEnterGiftCardExp)}\n value={giftCardExp}\n aria-labelledby='ms-gift-card-balance-check__label ms-gift-card-balance-check__error'\n />\n );\n\n const applyButton = (\n <Button\n className='ms-gift-card-balance-check__btn-apply'\n onClick={onApplyHandler(onApplyGiftCard)}\n aria-label={balanceCheckButton}\n disabled={!giftCardNumber}\n >\n {balanceCheckButton}\n </Button>\n );\n\n let showGiftCardPinInput = false;\n let showGiftCardExpInput = false;\n\n switch (additionalFields) {\n case showAdditionalFields.pin:\n showGiftCardPinInput = true;\n break;\n case showAdditionalFields.expirationDate:\n showGiftCardExpInput = true;\n break;\n case showAdditionalFields.pinAndExpirationDate:\n showGiftCardPinInput = true;\n showGiftCardExpInput = true;\n break;\n default:\n }\n\n return {\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { GiftCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IGetItemInput {\n giftCard: GiftCard;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n}\n\nexport interface IItem {\n itemProps: INodeProps;\n id?: string;\n selectedGiftCard: React.ReactNode;\n removeButton?: React.ReactNode;\n}\n\n/**\n * GiftCardItem component.\n * @param root0\n * @param root0.giftCard\n * @param root0.getFormattedPrice\n * @param root0.resources\n * @param root0.resources.enteredGiftCardLabel\n * @param root0.resources.giftCardAvailableBalanceLabel\n * @extends {React.PureComponent<IGiftCardItemProps>}\n */\nexport const getItem = ({\n giftCard,\n getFormattedPrice,\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel }\n}: IGetItemInput): IItem => {\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\n\n const itemProps = {\n className: 'ms-gift-card-balance-check__item'\n };\n\n const selectedGiftCard = (\n <span className='ms-gift-card-balance-check__item-text'>\n {enteredGiftCardLabel}\n {' '}\n {giftCardLast4Digit}\n {' '}\n (\n {giftCardAvailableBalanceLabel}\n {' '}\n <span className='ms-gift-card-balance-check__balance'>\n {balance}\n </span>\n )\n </span>\n );\n\n return {\n itemProps,\n id: giftCard && giftCard.Id,\n selectedGiftCard\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getGiftCardAsync, getTenderTypesAsync, resolveCardTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CardType, CardTypeInfo, GiftCard, RetailOperation, TenderType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport * as React from 'react';\n\nimport { OPERATIONS } from '../checkout';\nimport { getForm, IForm } from './components/get-form';\nimport { getItem, IItem } from './components/get-item';\nimport { IGiftCardBalanceCheckProps } from './gift-card-balance-check.props.autogenerated';\n\ninterface IGiftCardBalanceCheckState {\n isFetchingGiftCard: boolean;\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n giftCard?: GiftCard;\n}\n\nenum SupportedGiftCardType {\n Internal = 'internal',\n External = 'external',\n Both = 'both'\n}\n\nexport interface IGiftCardBalanceCheckModuleProps extends IGiftCardBalanceCheckProps<{}> { }\n\nexport interface IGiftCardBalanceCheckViewProps extends IGiftCardBalanceCheckProps<{}>, IGiftCardBalanceCheckState {\n className?: string;\n\n form: IForm;\n item?: IItem;\n\n giftCardBalanceCheckProps: IModuleProps;\n\n enterGiftCardNumber?(giftCardNumber: string): void;\n enterGiftCardPin?(giftCardPin: string): void;\n enterGiftCardExp?(giftCardExp: string): void;\n applyGiftCard?(): void;\n}\n\n/**\n *\n * GiftCardBalanceCheck component.\n * @extends {React.Component<IGiftCardBalanceCheckModuleProps, IGiftCardBalanceCheckState>}\n */\nexport class GiftCardBalanceCheck extends React.Component<IGiftCardBalanceCheckModuleProps, IGiftCardBalanceCheckState> {\n public state: IGiftCardBalanceCheckState = {\n isFetchingGiftCard: false,\n errorMessage: '',\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: ''\n };\n\n private readonly inputRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly inputPinRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly inputExpRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n public shouldComponentUpdate(nextProps: IGiftCardBalanceCheckModuleProps,\n nextState: IGiftCardBalanceCheckState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className, showAdditionalFields },\n resources\n } = this.props;\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!this._isEnabled()) {\n this.props.context.telemetry.error('Gift card balance check is not supported, module wont render');\n return null;\n }\n\n const supportExternalGiftCard = supportedGiftCardType !== SupportedGiftCardType.Internal;\n\n const moduleClassName = classname('ms-gift-card-balance-check', className);\n\n const viewProps: IGiftCardBalanceCheckViewProps = {\n ...this.props,\n ...this.state,\n className: moduleClassName,\n giftCardBalanceCheckProps: { moduleProps: this.props, className: moduleClassName },\n\n enterGiftCardNumber: this._enterGiftCardNumber,\n enterGiftCardPin: this._enterGiftCardPin,\n enterGiftCardExp: this._enterGiftCardExp,\n applyGiftCard: this._applyGiftCard,\n\n form: getForm({\n errorMessage,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n inputRef: this.inputRef,\n inputPinRef: this.inputPinRef,\n inputExpRef: this.inputExpRef,\n resources,\n supportExternalGiftCard,\n additionalFields: showAdditionalFields,\n onEnterGiftCardNumber: this._enterGiftCardNumber,\n onEnterGiftCardPin: this._enterGiftCardPin,\n onEnterGiftCardExp: this._enterGiftCardExp,\n onApplyGiftCard: this._applyGiftCard\n }),\n item: this.state.giftCard && getItem({\n giftCard: this.state.giftCard,\n getFormattedPrice: this._getFormattedPrice,\n resources\n })\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly _isEnabled = (): boolean => {\n if (!this.props.context.request.user.isAuthenticated &&\n this.props.context.app.config.giftCardSupported !== SupportedGiftCardType.External &&\n !this.props.config.shouldBeEnabledForGuest) {\n return false;\n }\n return true;\n };\n\n private readonly _getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\n };\n\n private readonly _enterGiftCardNumber = (giftCardNumber: string): void => {\n this.setState({\n giftCardNumber\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardPin = (giftCardPin: string): void => {\n this.setState({\n giftCardPin\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardExp = (giftCardExp: string): void => {\n this.setState({\n giftCardExp\n });\n this._clearError();\n };\n\n private readonly _clearError = (): void => {\n this.setState({\n errorMessage: ''\n });\n };\n\n private readonly _setError = (errorMessage: string): void => {\n this.props.telemetry.error('Error', errorMessage);\n this.props.telemetry.debug('Error', errorMessage);\n this.setState({\n errorMessage\n });\n };\n\n private readonly _applyGiftCard = async (): Promise<void> => {\n if (this.state.isFetchingGiftCard) {\n return;\n }\n this.setState({\n isFetchingGiftCard: true\n });\n\n const giftCardNumber = this.state.giftCardNumber.trim();\n const giftCardPin = this.state.giftCardPin.trim();\n const giftCardExp = this.state.giftCardExp.trim();\n\n const giftCardTypes = await this._getGiftCardTypes(giftCardNumber);\n const giftCardType = giftCardTypes && giftCardTypes[0];\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\n const giftCard = await this._getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\n\n if (giftCard) {\n this._clearError();\n this.setState({\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: '',\n isFetchingGiftCard: false,\n giftCard\n });\n return Promise.resolve();\n }\n const input =\n this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n this.setState({\n isFetchingGiftCard: false,\n giftCard: undefined\n });\n\n };\n\n private readonly _findGiftcardTenderTypes = (tenderTypes: TenderType[], operationId: RetailOperation, giftcardType: string): string[] | undefined => {\n let matchedTenderTypes: TenderType[] | undefined;\n\n switch (giftcardType) {\n case SupportedGiftCardType.Internal:\n matchedTenderTypes = tenderTypes.filter(tenderType => (tenderType.OperationId === operationId && tenderType.ConnectorId === ''));\n break;\n case SupportedGiftCardType.External:\n matchedTenderTypes = tenderTypes.filter(tenderType => (tenderType.OperationId === operationId && tenderType.ConnectorId !== ''));\n break;\n default:\n throw new Error('Invalid gift card type');\n }\n\n if (matchedTenderTypes) {\n return matchedTenderTypes.map(tenderType => tenderType.TenderTypeId || '');\n }\n return;\n };\n\n private readonly _getGiftCard = async (giftCardNumber: string, giftCardPin: string, giftCardExp: string, isPinRequired: boolean | undefined, isExpRequired: boolean | undefined, tenderTypeId: string | undefined): Promise<GiftCard | undefined> => {\n const {\n resources: { invalidCardTypeError, noBalanceError, invalidCardInfoError, noCardPinError, noCardExpError }\n } = this.props;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!tenderTypeId) {\n return undefined;\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const internalGiftcardTenderTypes = this._findGiftcardTenderTypes(tenderTypes, OPERATIONS.PayGiftCertificate, SupportedGiftCardType.Internal);\n const externalGiftcardTenderTypes = this._findGiftcardTenderTypes(tenderTypes, OPERATIONS.PayGiftCertificate, SupportedGiftCardType.External);\n\n switch (supportedGiftCardType) {\n case undefined:\n case SupportedGiftCardType.Internal:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.External:\n if (!externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.Both:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId) && !externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n default:\n throw new Error('Unsupported gift card type');\n }\n\n if (!this.props.context.request.user.isAuthenticated && internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n\n if (isPinRequired && giftCardPin === '') {\n this._setError(noCardPinError);\n return undefined;\n }\n\n if (isExpRequired && giftCardExp === '') {\n this._setError(noCardExpError);\n return undefined;\n }\n\n const month = Number.parseInt(giftCardExp.split('/')[0], 10);\n const year = Number.parseInt(giftCardExp.split('/')[1], 10);\n\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\n .then(activeGiftCard => {\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\n this._setError(noBalanceError);\n return;\n }\n return activeGiftCard;\n })\n .catch(error => {\n this._setError(invalidCardInfoError);\n return undefined;\n });\n };\n\n private readonly _getGiftCardTypes = async (giftCardNumber: string): Promise<CardTypeInfo[] | undefined> => {\n const {\n resources: { emptyInputError, invalidCodeError }\n } = this.props;\n\n if (!giftCardNumber) {\n this._setError(emptyInputError);\n return undefined;\n }\n\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, CardType.GiftCard)\n .then(giftCardTypes => {\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\n this._setError(invalidCodeError);\n return;\n }\n return giftCardTypes;\n })\n .catch(error => {\n this._setError(invalidCodeError);\n return undefined;\n });\n };\n}\n\nexport default GiftCardBalanceCheck;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\nimport { DisplayTemplate, ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\nimport { Button, Collapse, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport RangeRefineItem, { RangeRefineItemType } from './range-refine-item';\nimport RefineItem from './refine-item';\nimport { IRefineItemCommonProps } from './refine-item.props.common';\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\nimport { findMatchingRefinementCriterion, isRangeType } from './utilities';\n\n/**\n * Properties associated with the RefineSubmenu component.\n */\nexport interface IRefineSubmenuProps {\n tempRangeTypeTODO: RangeRefineItemType;\n minValueSliderThumbAriaLabel?: string;\n maxValueSliderThumbAriaLabel?: string;\n productRefinerHierarchy: IProductRefinerHierarchy;\n selectedRefinerValues: ProductRefinerValue[];\n refineItemCommonProps: IRefineItemCommonProps;\n isDisabled: boolean;\n isExpandedOnInitialLoad: boolean;\n context: ICoreContext<IGeneric<IAny>>;\n moduleId: string;\n moduleTypeName: string;\n productCountAriaLabel?: string;\n singleProductCountAriaLabel?: string;\n refineItemAriaLabel?: string;\n refineItemsAriaLabel?: string;\n isMobile?: boolean;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n onUpdateRefiners(notfication: Readonly<IRefineItemToggleNotification>): void;\n urlBuilder(refiner: IRefineItemToggleNotification): string;\n}\n\n/**\n * Refine submenu state.\n */\nexport interface IRefineSubmenuState extends React.ComponentState {\n expanded: boolean;\n}\n\n/**\n *\n * The RefineSubmenu component renders the submenu category and child items.\n * This computed observes the stateful category hierarchy object.\n * @extends {React.PureComponent<IRefineSubmenuProps>}\n */\nclass RefineSubmenu extends React.Component<IRefineSubmenuProps, IRefineSubmenuState> {\n constructor(props: IRefineSubmenuProps) {\n super(props);\n\n this._onToggleItem = this._onToggleItem.bind(this);\n this._onToggleSubmenu = this._onToggleSubmenu.bind(this);\n\n const isExpanded = this.props.isExpandedOnInitialLoad;\n\n // If (this.props.productRefinerHierarchy.DataTypeValue === ProductRefinerValueDataTypeValue.Range) {\n // isExpanded = true;\n // }\n\n this.state = {\n expanded: isExpanded\n };\n }\n\n public shouldComponentUpdate(nextProps: IRefineSubmenuProps,\n nextState: IRefineSubmenuState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { productRefinerHierarchy, refineItemCommonProps } = this.props;\n\n if (!productRefinerHierarchy) {\n refineItemCommonProps.telemetry.error('Cannot render submenu without refiner hierarchy data');\n }\n\n if ((productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) && (this.props.context.app.config.hideRating)) {\n return null;\n }\n return (\n <div className={`ms-refine-submenu list-group ${productRefinerHierarchy.KeyName}`}>\n <Button\n className={this.state.expanded ? 'ms-refine-submenu__toggle_expanded' : 'ms-refine-submenu__toggle_collapsed'}\n aria-label={productRefinerHierarchy.KeyName || 'refiner.Name'}\n onClick={this._onToggleSubmenu}\n aria-expanded={this.state.expanded}\n >\n {productRefinerHierarchy.KeyName}\n </Button>\n <Collapse isOpen={this.state.expanded} timeout={350}>\n {this._renderChildItems(productRefinerHierarchy)}\n </Collapse>\n </div>\n );\n }\n\n private _renderChildItems(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n if (isRangeType(productRefinerHierarchy.DataTypeValue)) {\n return this._renderRange(productRefinerHierarchy);\n }\n return this._renderSingleMultiSelect(productRefinerHierarchy);\n }\n\n private _renderSingleMultiSelect(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n const { isDisabled, refineItemCommonProps, selectedRefinerValues, context,\n productCountAriaLabel, singleProductCountAriaLabel, refineItemAriaLabel, refineItemsAriaLabel, isMobile } = this.props;\n const isSingleSelect = (productRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect) && (productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating);\n const role = isSingleSelect ? { role: 'listbox' } : undefined;\n const refinerValuesList = (productRefinerHierarchy.Values || []);\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\n if (!child) {\n refineItemCommonProps.telemetry.error(\n `[refine-submenu] Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\n );\n return null;\n }\n\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\n\n return (\n <RefineItem\n parentProductRefinerHierarchy={productRefinerHierarchy}\n productRefinerValue={child}\n selectedRefinementCriterion={selectedRefinementCriterion}\n selectedRefinerValues={selectedRefinerValues.filter(selectedValue => refinerValuesList.find(value => value.RefinerRecordId === selectedValue.RefinerRecordId))}\n refineItemCommonProps={refineItemCommonProps}\n onToggle={this._onToggleItem}\n urlBuilder={this.props.urlBuilder}\n isDisabled={isDisabled}\n key={index}\n index={index}\n context={context}\n moduleId={this.props.moduleId}\n moduleTypeName={this.props.moduleTypeName}\n telemetryContent={this.props.telemetryContent}\n productCountAriaLabel={productCountAriaLabel}\n refineItemAriaLabel={refineItemAriaLabel}\n refineItemsAriaLabel={refineItemsAriaLabel}\n singleProductCountAriaLabel={singleProductCountAriaLabel}\n isMobileView={isMobile}\n />\n );\n });\n return (\n <ul className={`ms-refine-submenu__list ${productRefinerHierarchy.KeyName}`} {...role} aria-label={productRefinerHierarchy.KeyName}>\n {listItems}\n </ul>\n );\n }\n\n private _getRangeType(productRefinerHierarchy: IProductRefinerHierarchy): 'input' | 'slider' {\n if (productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Range ||\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Slider ||\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.SliderWithBars) {\n return 'slider';\n }\n return 'input';\n }\n\n private _renderRange(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\n const { isDisabled, refineItemCommonProps, selectedRefinerValues, context, minValueSliderThumbAriaLabel, maxValueSliderThumbAriaLabel } = this.props;\n const submenuClassNamePrefix = 'ms-refine-submenu__item list-group-item refine-submenu__item';\n const refinerValuesList = (productRefinerHierarchy.Values || []);\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\n if (!child) {\n refineItemCommonProps.telemetry.error(\n `Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\n );\n return null;\n }\n\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\n\n const rangeType = this._getRangeType(productRefinerHierarchy);\n const key = selectedRefinementCriterion ? `${selectedRefinementCriterion.LeftValueBoundString}-${selectedRefinementCriterion.RightValueBoundString}` : `not-selected-${index}`;\n return (\n <li className={`${submenuClassNamePrefix}--range`} key={index}>\n <RangeRefineItem\n parentProductRefinerHierarchy={productRefinerHierarchy}\n productRefinerValue={child}\n selectedRefinementCriterion={selectedRefinementCriterion}\n refineItemCommonProps={refineItemCommonProps}\n onToggle={this._onToggleItem}\n urlBuilder={this.props.urlBuilder}\n isDisabled={isDisabled}\n rangeType={rangeType}\n key={key}\n sliderKey={key}\n context={context}\n minValueSliderThumbAriaLabel={minValueSliderThumbAriaLabel}\n maxValueSliderThumbAriaLabel={maxValueSliderThumbAriaLabel}\n moduleId={this.props.moduleId}\n moduleTypeName={this.props.moduleTypeName}\n />\n </li>\n );\n });\n return (<ul className={`ms-refine-submenu__list list-unstyled ${productRefinerHierarchy.KeyName}`}>\n {listItems}\n </ul>);\n }\n\n private _onToggleItem(itemToggleNotification: IRefineItemToggleNotification): void {\n this.props.onUpdateRefiners(itemToggleNotification);\n }\n\n private _onToggleSubmenu(): void {\n this.setState(prevState => ({\n expanded: !prevState.expanded\n }));\n }\n}\n\nexport default RefineSubmenu;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput.\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n\n public getCacheObjectType = () => 'ModuleState';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n let moduleStates = <IModuleStates>ctx.get<IModuleStates>(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = <IModuleStates>ctx.get<IModuleStates>(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface ISeparator {\n separator: string;\n}\n\nexport const Separator: React.FC<ISeparator> = ({ separator }) => (<span>\n {' '}\n {separator}\n {' '}\n</span>);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport ReviewsList from './reviews-list';\nimport ReviewsListView from './reviews-list.view';\n\nexport * from './components/components';\nexport * from './components/report-review-modal';\nexport * from './components/review-card';\nexport * from './reviews-list';\nexport * from './reviews-list.data';\nexport * from './reviews-list.props.autogenerated';\nexport * from './reviews-list.view';\n\nexport {\n ReviewsList,\n ReviewsListView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport const SignInMessage: React.FC<{ text: string }> = (props: { text: string }) => {\n return (<p className='ms-write-review__sign-in'>\n {props.text}\n </p>);\n};\n\nexport const SignInButton: React.FC<{ text: string; href: string; ariaLabel: string; telemetryContent?: ITelemetryContent }> = (props: { text: string; href: string; ariaLabel: string; telemetryContent?: ITelemetryContent }) => {\n const { text, href, ariaLabel, telemetryContent } = props;\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.SignIn);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (<a\n href={href} className='ms-write-review__sign-in-btn msc-btn' aria-label={ariaLabel}\n {...attributes}>\n {text}\n </a>);\n};\n\ninterface IModalToggleProps {\n innerRef: React.RefObject<HTMLButtonElement> | undefined;\n id: string;\n text: string;\n ariaLabel: string;\n telemetryContent?: ITelemetryContent;\n onClick(): void;\n}\n\nexport const ModalToggle: React.FC<IModalToggleProps> = (props: IModalToggleProps) => {\n const { text, onClick, ariaLabel, innerRef, telemetryContent, id } = props;\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.WriteReview);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (<button\n id={id} className='ms-write-review__toggle msc-btn' aria-label={ariaLabel}\n onClick={onClick} ref={innerRef} {...attributes}>\n {text}\n </button>);\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Review } from '@msdyn365-commerce/commerce-entities';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { IReviewModalViewProps, ReviewModal, submitReview } from '../../common/review-modal';\nimport { TOGGLE_REVIEW_MODAL_BUTTON_ID } from '../../common/rnrInterface';\nimport { ModalToggle, SignInButton, SignInMessage } from './components/components';\nimport { IWriteReviewData } from './write-review.data';\nimport { IWriteReviewProps } from './write-review.props.autogenerated';\n\nexport interface IWriteReviewCallbacks {\n toggleModal(): void;\n updateReviewTitle(title: string): void;\n updateReviewText(text: string): void;\n updateRating(rating: number): void;\n onReviewSubmitted(isSuccessful: boolean): void;\n submitReview(product: SimpleProduct, title: string, text: string, rating: number, context: Msdyn365.ICoreContext, userReview?: Review, onReviewSubmission?: (isSuccessful: boolean) => void): void;\n}\n\nexport interface IWriteReviewState {\n rating: number;\n reviewTitle: string;\n reviewText: string;\n isReviewModalOpen: boolean;\n hasReviewError: boolean;\n}\n\nexport interface IWriteReviewViewProps extends IWriteReviewProps<IWriteReviewData> {\n state: IWriteReviewState;\n className: string;\n callbacks: IWriteReviewCallbacks;\n signInMessage: React.ReactNode;\n signInButton: React.ReactNode;\n modalToggle: React.ReactNode;\n reviewModal: IReviewModalViewProps;\n moduleProps: IModuleProps;\n heading: React.ReactNode;\n}\n\n/**\n * This module is enables user's to leave ratings and reviews on a specific product\n * WriteReview module.\n * @extends {React.PureComponent<IWriteReviewProps<IWriteReviewData>>}\n */\nclass WriteReview extends React.PureComponent<IWriteReviewProps<IWriteReviewData>, IWriteReviewState> {\n private readonly _modalToggleRef: React.RefObject<HTMLButtonElement> | undefined;\n\n private readonly telemetryContent: ITelemetryContent;\n\n public constructor(props: IWriteReviewProps<IWriteReviewData>) {\n super(props);\n const { userReview: { result: userReview } } = this.props.data;\n this._toggleReviewModal = this._toggleReviewModal.bind(this);\n this._modalToggleRef = React.createRef<HTMLButtonElement>();\n const rating = userReview ? userReview.rating : 0;\n const reviewTitle = userReview ? userReview.title : '';\n const reviewText = userReview ? userReview.reviewText : '';\n\n this.state = {\n isReviewModalOpen: false,\n rating,\n reviewTitle,\n reviewText,\n hasReviewError: false\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public render(): JSX.Element {\n const { resources } = this.props;\n const { className, heading } = this.props.config;\n const { product: { result: product }, userReview: { result: userReview } } = this.props.data;\n\n const userInfo = this.props.context && this.props.context.request && this.props.context.request.user;\n const completeClass = classnames('ms-write-review', 'msc-modal-input-required', className);\n const viewProps = {\n ...this.props,\n state: this.state,\n className: completeClass,\n moduleProps: {\n moduleProps: this.props,\n className: completeClass,\n id: null\n },\n callbacks: this.writeReviewCallbacks,\n signInMessage: <SignInMessage text={resources.signInMessage} />,\n signInButton: <SignInButton\n text={resources.signInLabel} ariaLabel={resources.signInAriaLabel} href={userInfo.signInUrl!}\n telemetryContent={this.telemetryContent} />,\n modalToggle: product && (\n <ModalToggle\n text={userReview ? resources.editReviewButtonText : resources.reviewButtonLabel}\n ariaLabel={resources.reviewButtonLabel}\n innerRef={this._modalToggleRef}\n onClick={this._toggleReviewModal}\n id={TOGGLE_REVIEW_MODAL_BUTTON_ID}\n telemetryContent={this.telemetryContent}\n />\n ),\n reviewModal: this._buildUserReviewModal(),\n heading: heading && heading.text && (\n <Msdyn365.Text\n className='ms-write-review__heading'\n tag={heading.tag || 'h2'}\n text={heading.text}\n editProps={{ onEdit: this.handleHeadingChange, requestContext: this.props.context.request }}\n />\n )\n } as IWriteReviewViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\n\n private readonly _onTitleChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n this.writeReviewCallbacks.updateReviewTitle(event.target.value);\n };\n\n private readonly _onTextChange = (event: React.ChangeEvent<HTMLTextAreaElement>): void => {\n this.writeReviewCallbacks.updateReviewText(event.target.value);\n };\n\n private readonly _onRatingChange = (value: number): void => {\n this.writeReviewCallbacks.updateRating(value);\n };\n\n private readonly _toggleReviewModal = (): void => {\n const userReview = this.props.data.userReview.result;\n if (this.state.isReviewModalOpen) {\n this.setState({ isReviewModalOpen: false, hasReviewError: false });\n } else if (userReview) {\n this.setState({\n isReviewModalOpen: true,\n reviewText: userReview.reviewText,\n reviewTitle: userReview.title,\n rating: userReview.rating\n });\n } else {\n this.setState({\n isReviewModalOpen: true,\n reviewText: '',\n reviewTitle: '',\n rating: 0\n });\n }\n };\n\n /**\n * This method builds the user review modal.\n * @param config The module config.\n */\n private _buildUserReviewModal(): IReviewModalViewProps {\n return ReviewModal({\n userReview: this.props.data.userReview.result,\n product: this.props.data.product.result,\n resources: { ...this.props.resources },\n context: this.props.context,\n parentId: this.props.id,\n parentType: this.props.typeName,\n isOpen: this.state.isReviewModalOpen,\n rating: this.state.rating,\n reviewTitle: this.state.reviewTitle,\n reviewText: this.state.reviewText,\n onModalToggle: this._toggleReviewModal,\n onTitleChange: this._onTitleChange,\n onTextChange: this._onTextChange,\n onRatingChange: this._onRatingChange,\n onReviewComplete: this.writeReviewCallbacks.onReviewSubmitted,\n renderContextId: 'writeReview',\n returnRef: this._modalToggleRef,\n hasError: this.state.hasReviewError,\n telemetryContent: this.telemetryContent\n });\n }\n\n private readonly writeReviewCallbacks: IWriteReviewCallbacks = {\n toggleModal: this._toggleReviewModal,\n updateReviewTitle: (title: string): void => {\n this.setState({ reviewTitle: title });\n },\n updateReviewText: (text: string): void => {\n this.setState({ reviewText: text });\n },\n updateRating: (rating: number): void => {\n this.setState({ rating });\n },\n onReviewSubmitted: (isSuccessful: boolean): void => {\n if (isSuccessful) {\n this.setState({ isReviewModalOpen: false, hasReviewError: false });\n } else {\n this.setState({ hasReviewError: true });\n }\n },\n submitReview\n };\n}\n\nexport default WriteReview;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent, RatingComponent } from '@msdyn365-commerce/components';\nimport { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * IActiveProductProps interface.\n */\nexport interface IActiveProductProps extends IComponentProps<{ product?: ProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n}\n\n/**\n * IActiveProduct interface.\n */\nexport interface IActiveProduct extends IComponent<IActiveProductProps> { }\n\n/**\n * RenderDescription function.\n * @param description - Product description string.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderDescription(description?: string): JSX.Element | null {\n return (\n <p className='msc-active-image-product__text'>\n {description}\n </p>\n );\n}\n\n/**\n * GetRatingAriaLabel function.\n * @param rating - Product rating number.\n * @param ratingAriaLabel - Product rating aria label.\n * @returns - Returns string.\n */\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\n const numberTwo: number = 2;\n if (rating && ratingAriaLabel) {\n const roundedRating = rating.toFixed(numberTwo);\n return format(ratingAriaLabel || '', roundedRating, '5');\n }\n return '';\n}\n\n/**\n * RenderRating function.\n * @param context - The core context.\n * @param typeName - The type name of the module.\n * @param ratingId - The rating id.\n * @param avgRating - The average rating.\n * @param totalRatings - The total ratings.\n * @param ariaLabel - The rating aria label.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderRating(context: ICoreContext, typeName: string, ratingId: string,\n avgRating?: number, totalRatings?: number, ariaLabel?: string): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = (totalRatings?.toString()) ?? undefined;\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\n\n return (\n <RatingComponent\n context={context}\n id={ratingId}\n typeName={typeName}\n avgRating={avgRating}\n ratingCount={numberRatings}\n readOnly\n ariaLabel={ratingAriaLabel}\n data={{}}\n />\n );\n}\n\n/**\n * RenderPrice function.\n * @param context - The core context.\n * @param typeName - The type name of the module.\n * @param productId - The product id.\n * @param basePrice - The base price of the product.\n * @param adjustedPrice - The adjusted price of the product.\n * @param savingsText - The savings text of the product.\n * @param freePriceText - The free price text.\n * @param originalPriceText - The original price text.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderPrice(context: ICoreContext, typeName: string, productId: string,\n basePrice?: number, adjustedPrice?: number, savingsText?: string, freePriceText?: string,\n originalPriceText?: string): JSX.Element | null {\n const price: ProductPrice = {\n BasePrice: basePrice,\n AdjustedPrice: adjustedPrice,\n CustomerContextualPrice: adjustedPrice\n };\n\n return (\n <PriceComponent\n context={context}\n id={productId}\n typeName={typeName}\n data={{ price }}\n savingsText={savingsText}\n freePriceText={freePriceText}\n originalPriceText={originalPriceText}\n />\n );\n}\n\n/**\n * RenderProductPlacementImage function.\n * @param requestContext - RequestContext.\n * @param imageSettings - The product image settings.\n * @param gridSettings - The viewport gird settings.\n * @param imageUrl - The product image url.\n * @param altText - The product image alt text.\n * @returns - Returns JSX.Element | null.\n */\nfunction renderProductPlacementImage(\n requestContext: IRequestContext,\n imageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n altText?: string): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n const imgData: IImageData = {\n src: imageUrl,\n altText: altText ? altText : ''\n };\n const imageProps = {\n gridSettings,\n imageSettings\n };\n imageProps.imageSettings.cropFocalRegion = true;\n return (\n <Image\n {...imgData}\n {...imageProps}\n requestContext={requestContext}\n loadFailureBehavior='empty' />\n );\n}\n\n/**\n * ActiveProduct constant.\n * @param props - The active product props.\n * @param props.data - The product search result data.\n * @param props.context - The core context.\n * @param props.imageSettings - The prodcut image settings.\n * @param props.savingsText - The product savings text.\n * @param props.freePriceText - The free price text.\n * @param props.originalPriceText - The original price text.\n * @param props.ratingAriaLabel - The product rating aria label.\n * @param props.typeName - The type name of the module.\n * @param props.id - The id of the product.\n * @returns - Returns JSX.Element | null.\n */\nexport const ActiveProductComponent: React.FC<IActiveProductProps> = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n ratingAriaLabel,\n typeName,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Do not need naming convention check for library prameters\n id\n}) => {\n const product = data.product;\n if (!product) {\n return null;\n }\n\n return (\n <>\n <div className='msc-active-image-product'>\n <div className='msc-active-image-product__image'>\n {renderProductPlacementImage(\n context.actionContext.requestContext,\n imageSettings, context.request.gridSettings,\n product.PrimaryImageUrl,\n product.Name)}\n </div>\n <div className='msc-active-image-product__details'>\n <h4 className='msc-active-image-product__title'>\n {product.Name}\n </h4>\n {renderPrice(context, typeName, id, product.BasePrice, product.Price, savingsText, freePriceText, originalPriceText)}\n {renderDescription(product.Description)}\n {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n !context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)\n }\n </div>\n </div>\n </>\n );\n};\n\nexport default ActiveProductComponent;\n\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\n/**\n * ILinksData: Interface for\n * Additional content.\n */\ninterface ILinksData {\n linkText?: string;\n linkUrl: Msdyn365.ILinkData;\n ariaLabel?: string;\n isOpenInNewTab?: boolean;\n}\n\n/**\n * IAdditionalContentData: Interface for\n * Active content.\n */\ninterface IAdditionalContentData {\n heading?: string;\n subtext?: string;\n links?: ILinksData[];\n}\n\n/**\n * IActiveImageAdditionalContentProps: Interface for\n * Active Image Additional Content Component props.\n */\nexport interface IActiveImageAdditionalContentProps {\n requestContext: Msdyn365.IRequestContext;\n additionalContent: IAdditionalContentData | undefined;\n handleAdditionalTextChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalParagraphChange(event: Msdyn365.ContentEditableEvent): void;\n handleAdditionalLinkTextChange(linkIndex: number, event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * IActiveImageAdditionalContentViewProps: Interface for\n * Active Image Additional Content view props.\n */\nexport interface IActiveImageAdditionalContentViewProps {\n additionalContentNode: INodeProps;\n heading: React.ReactNode;\n text: React.ReactNode;\n links: React.ReactNode;\n additionalContentContainer: INodeProps;\n additionalContentItemLinks: INodeProps;\n}\n\n/**\n * Renders additional content heading.\n * @param additionalContentHeading - Additional content heading.\n * @param props - Active Image Additional content component props.\n * @returns Heading Node.\n */\nconst renderHeading = (additionalContentHeading: string, props: IActiveImageAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n <Msdyn365.Text\n text={additionalContentHeading}\n tag='p'\n className='msc-active-image__details__additional-content__text'\n editProps={{\n /**\n * On edit event for heading text change.\n * @param event - Change event.\n */\n onEdit: (event) => {\n props.handleAdditionalTextChange(event);\n }, requestContext\n }}\n />);\n};\n\n/**\n * Renders additional content heading.\n * @param additionalContentParagraphText - Additional content paragraph text.\n * @param props - Active Image Additional content component props.\n * @returns Paragraph Node.\n */\nconst renderParagraph = (additionalContentParagraphText: string, props: IActiveImageAdditionalContentProps) => {\n const requestContext = props.requestContext;\n return (\n <Msdyn365.Text\n text={additionalContentParagraphText}\n tag='p'\n className='msc-active-image__details__additional-content__paragraph'\n editProps={{\n /**\n * On edit event for heading text change.\n * @param event - Change event.\n */\n onEdit: (event) => {\n props.handleAdditionalTextChange(event);\n }, requestContext\n }}\n />);\n};\n\n/**\n * Renders additional content heading.\n * @param ctaLink - Additional content link.\n * @param props - Active Image Additional content component props.\n * @param linkIndex - Additional content link index.\n * @returns Link Node.\n */\nconst renderLinks = (ctaLink: ILinksData, props: IActiveImageAdditionalContentProps, linkIndex: number) => {\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: ctaLink.ariaLabel,\n className: 'msc-active-image__details__additional-content__cta__links',\n linkText: ctaLink.linkText,\n linkUrl: ctaLink.linkUrl.destinationUrl,\n openInNewTab: ctaLink.isOpenInNewTab,\n role: 'button'\n };\n const requestContext = props.requestContext;\n return (\n <Msdyn365.Link\n key={linkIndex}\n link={editableLink}\n editProps={{\n /**\n * Handle additional Link Text change.\n * @param event - The keyboard event.\n */\n onTextChange: (event) => {\n props.handleAdditionalLinkTextChange(linkIndex, event);\n },\n requestContext\n }}\n />\n );\n};\n\n/**\n * Create node for each additonal content item.\n * @param item - Active Image additonal content item props.\n * @param props - Active Image Additional content component props.\n * @returns IActiveImageAdditionalContentItemViewProps.\n */\nconst assembleNode = (\n item: IAdditionalContentData,\n props: IActiveImageAdditionalContentProps\n): IActiveImageAdditionalContentViewProps => {\n const headingNode = item.heading && renderHeading(item.heading, props);\n const paragraphNode = item.subtext && renderParagraph(item.subtext, props);\n const linksNode = item.links?.map((ctaLink: ILinksData, index: number) => {\n return renderLinks(ctaLink, props, index);\n });\n\n return {\n additionalContentNode: { className: 'msc-active-image__details__additional-content' },\n heading: headingNode,\n text: paragraphNode,\n links: linksNode,\n additionalContentContainer: { className: 'msc-active-image__details__additional-content__container' },\n additionalContentItemLinks: { className: 'msc-active-image__details__additional__content__cta' }\n };\n};\n\n/**\n * ActiveImageAdditionalContent component.\n * @param props - Active Image Additional content component props.\n * @returns Active Image Additional content view props.\n */\nexport const activeImageAdditionalContent = (props: IActiveImageAdditionalContentProps): IActiveImageAdditionalContentViewProps | undefined => {\n const { additionalContent } = props;\n if (!additionalContent) {\n return undefined;\n }\n\n return assembleNode(additionalContent, props);\n};\n\nexport default activeImageAdditionalContent;\n\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { IImageData, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport React from 'react';\n\n/**\n * @type AreaEvent for active points\n */\ntype AreaEvent = Event | React.MouseEvent<HTMLAreaElement, MouseEvent> | React.FocusEvent<HTMLAreaElement>;\n\n/**\n * @interface IRgbColor\n * @description - The IRgbColor interface contract.\n */\nexport interface IRgbColor {\n rValue: number;\n gValue: number;\n bValue: number;\n}\n\n/**\n * @interface IArea\n * @description - The IArea interface contract.\n */\nexport interface IArea {\n areaId: string;\n coords: number[];\n href?: string;\n center?: number[];\n primaryImageUrl?: string;\n productUrl: string;\n productSearchResult?: ProductSearchResult;\n}\n\n/**\n * @interface IArea\n * @description - The IArea interface contract.\n */\nexport interface IAreaMap {\n name: string;\n areas: IArea[];\n}\n\n/**\n * @enum CanvasCalculations\n * @description - The canvas calculations enum.\n */\nexport enum CanvasCalculations {\n defaultWidth = 0,\n defaultHeight = 0,\n defaultPositionX = 0,\n defaultPositionY = 0,\n defaultScale = 1,\n halfDivisor = 2,\n doubleMultiplier = 2,\n buttonHeight = 30,\n buttonPadding = 30,\n paddingAdjustment = 3,\n expandAnimationStartWidth = 10,\n expandAnimationEndWidth = 40,\n collapseAnimationStartWidth = 40,\n collapseAnimationEndWidth = 8,\n expandRadius = 12,\n collapseRadius = 8,\n rotation = 1.57,\n startAngle = 0,\n endAngle = 7,\n clearMargin = 50,\n clearHeight = 100,\n clearWidth = 100,\n textFadeInStartValue = 0,\n textFadeOutStartValue = 0.5,\n textFadeInterval = 0.01\n}\n\n/**\n * @enum CanvasStyles\n * @description - The canvas styles enum.\n */\nexport enum CanvasStyles {\n color = '#FFFFFF',\n buttonTextClor = '#000000'\n}\n\n/**\n * @enum\n * @description - The canvas styles enum.\n */\nexport interface IImageMapperResources {\n buttonText?: string;\n altText?: string;\n}\n\n/**\n * @interface IImageMapperProps\n * @description - The IImageMapperProps interface contract.\n */\nexport interface IImageMapperProps {\n imageData: IImageData;\n areaMap: IAreaMap;\n viewPort: string;\n requestContext: IRequestContext;\n color?: string;\n buttonTextClor?: string;\n width?: number;\n imgWidth?: number;\n activeImageRefs: React.RefObject<HTMLDivElement>;\n imageMapperResources?: IImageMapperResources;\n onLoad?(): void;\n onClick?(area: IArea, index: number, event: AreaEvent): void;\n onFocus?(area: IArea, index: number, event: AreaEvent): void;\n onMouseEnter?(area: IArea, index: number, event: AreaEvent): void;\n onMouseLeave?(area: IArea, index: number, event: AreaEvent): void;\n}\n\n/**\n * ImageMapper.\n */\nexport class ImageMapper extends React.Component<IImageMapperProps> {\n private readonly _backgroundImage: React.RefObject<Image>;\n\n private readonly _container: React.RefObject<HTMLDivElement>;\n\n private readonly _canvas: React.RefObject<HTMLCanvasElement>;\n\n private _isDesktopViewPort: boolean = false;\n\n private _context: CanvasRenderingContext2D | null | undefined = null;\n\n public constructor(props: IImageMapperProps) {\n super(props);\n this._backgroundImage = React.createRef();\n this._container = React.createRef();\n this._canvas = React.createRef();\n }\n\n /**\n * ComponentDidMount method.\n */\n public componentDidMount(): void {\n const { viewPort } = this.props;\n this.initCanvas();\n this._isDesktopViewPort = viewPort === 'lg' || viewPort === 'xl';\n this.renderAreas();\n this._context = null;\n }\n\n /**\n * ComponentDidUpdate method.\n */\n public componentDidUpdate(): void {\n const { viewPort } = this.props;\n this.initCanvas();\n this._isDesktopViewPort = viewPort === 'lg' || viewPort === 'xl';\n }\n\n /**\n * ShouldComponentUpdate method.\n * @param nextProps - Next props.\n * @returns Returns boolean.\n */\n public shouldComponentUpdate(nextProps: IImageMapperProps): boolean {\n let shouldRender = false;\n if (nextProps !== this.props) {\n shouldRender = true;\n }\n return shouldRender;\n }\n\n /**\n * GetActiveImageWidth method - Gets the active image width.\n * @returns Returns number | undefined.\n */\n public getActiveImageWidth = (): number | undefined => {\n if (MsDyn365.isBrowser) {\n const activeImageReferenceValue = this.props.activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientWidth;\n }\n }\n return undefined;\n };\n\n /**\n * GetActiveImageHeight method - Gets the active image height.\n * @returns Returns number | undefined.\n */\n public getActiveImageHeight = (): number | undefined => {\n if (MsDyn365.isBrowser) {\n const activeImageReferenceValue = this.props.activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientHeight;\n }\n }\n return undefined;\n };\n\n /**\n * ConvertHexToRgb method - This method takes color in HEX format and returns IRgbColor color object.\n * @param hexColor -The color hex value.\n * @returns -Returns IRgbColor object.\n */\n public convertHexToRgb = (hexColor: string): IRgbColor => {\n // RegEx used to execute the conversion of the hex color to rgb value.\n const regEx = new RegExp('^#?([a-f\\\\d]{2})([a-f\\\\d]{2})([a-f\\\\d]{2})$', 'u');\n\n // RegEx.exec method executes a search for a match in a specified string. Returns a result array, or null.\n const result = regEx.exec(hexColor);\n const defaultValue = 0;\n return result ? {\n rValue: Number.parseInt(result[1], 16),\n gValue: Number.parseInt(result[2], 16),\n bValue: Number.parseInt(result[3], 16)\n } : {\n rValue: defaultValue,\n gValue: defaultValue,\n bValue: defaultValue\n };\n };\n\n /**\n * ApplyFadingTransition method - Applys fading transition to button text.\n * @param text -The button text.\n * @param coords -The coordinates.\n * @param rgbColor -The RGB color object.\n * @param alpha -The alpha value of the button text.\n */\n public applyFadingTransition = (text: string, coords: number[], rgbColor: IRgbColor, alpha: number): void => {\n const halfDivisor: number = CanvasCalculations.halfDivisor;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (context && this._isDesktopViewPort) {\n const buttonPadding = CanvasCalculations.buttonPadding;\n const paddingAdjustment = CanvasCalculations.paddingAdjustment;\n const buttonWidth = context.measureText(text).width + buttonPadding;\n context.fillStyle = `rgba(${rgbColor.rValue}, ${rgbColor.gValue}, ${rgbColor.bValue}, ${alpha} )`;\n if (MsDyn365.isBrowser && document.body.parentElement && document.body.parentElement.getAttribute('dir') === 'rtl') {\n context.fillText(text, coords[0] + (buttonWidth / halfDivisor) - (buttonPadding / halfDivisor), coords[1] + paddingAdjustment);\n } else {\n context.fillText(text, coords[0] - (buttonWidth / halfDivisor) + (buttonPadding / halfDivisor), coords[1] + paddingAdjustment);\n }\n }\n };\n\n /**\n * Draw button method - Draws button and contains fixed hight, padding values.\n * @param text -The button text.\n * @param coords -The coordinates.\n */\n public drawButton = (text: string, coords: number[]): void => {\n const {\n color = CanvasStyles.color,\n buttonTextClor = CanvasStyles.buttonTextClor\n } = this.props;\n const halfDivisor: number = CanvasCalculations.halfDivisor;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (context && this._isDesktopViewPort) {\n const buttonHeight = CanvasCalculations.buttonHeight;\n const buttonPadding = CanvasCalculations.buttonPadding;\n const paddingAdjustment = CanvasCalculations.paddingAdjustment;\n const buttonWidth = context.measureText(text).width + buttonPadding;\n const buttonPositionX = coords[0] - (buttonWidth / halfDivisor);\n const buttonPositionY = coords[1] - (buttonHeight / halfDivisor);\n const arcsize = buttonHeight / halfDivisor;\n\n context.beginPath();\n context.moveTo(buttonPositionX + arcsize, buttonPositionY);\n context.lineTo(buttonPositionX + buttonWidth - arcsize, buttonPositionY);\n context.arcTo(buttonPositionX + buttonWidth, buttonPositionY, buttonPositionX + buttonWidth, buttonPositionY + arcsize, arcsize);\n context.lineTo(buttonPositionX + buttonWidth, buttonPositionY + buttonHeight - arcsize);\n context.arcTo(buttonPositionX + buttonWidth, buttonPositionY + buttonHeight,\n buttonPositionX + buttonWidth - arcsize, buttonPositionY + buttonHeight, arcsize);\n context.lineTo(buttonPositionX + arcsize, buttonPositionY + buttonHeight);\n context.arcTo(buttonPositionX, buttonPositionY + buttonHeight, buttonPositionX, buttonPositionY - arcsize, arcsize);\n context.lineTo(buttonPositionX, buttonPositionY + arcsize);\n context.arcTo(buttonPositionX, buttonPositionY, buttonPositionX + arcsize, buttonPositionY, arcsize);\n context.lineTo(buttonPositionX + arcsize, buttonPositionY);\n context.stroke();\n context.closePath();\n context.fillStyle = color;\n context.fill();\n context.fillStyle = buttonTextClor;\n if (MsDyn365.isBrowser && document.body.parentElement && document.body.parentElement.getAttribute('dir') === 'rtl') {\n context.fillText(text, coords[0] + (buttonWidth / halfDivisor) - (buttonPadding / halfDivisor), coords[1] + paddingAdjustment);\n } else {\n context.fillText(text, coords[0] - (buttonWidth / halfDivisor) + (buttonPadding / halfDivisor), coords[1] + paddingAdjustment);\n }\n }\n };\n\n /**\n * ExpandAnimation method - Shows expand animation and contains fixed values to draw the circle and ellipse shapes.\n * @param coords -Coordinates.\n */\n public expandAnimation = (coords: number[]): void => {\n const {\n color = CanvasStyles.color,\n buttonTextClor = CanvasStyles.buttonTextClor\n } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText;\n let animationStartWidth = CanvasCalculations.expandAnimationStartWidth;\n const pointPositionX = coords[0];\n const pointPositionY = coords[1];\n const animationEndWidth = CanvasCalculations.expandAnimationEndWidth;\n const radius = CanvasCalculations.expandRadius;\n const rotation = CanvasCalculations.rotation;\n const startAngle = CanvasCalculations.startAngle;\n const endAngle = CanvasCalculations.endAngle;\n let textFadeInValue = CanvasCalculations.textFadeInStartValue;\n const buttonTextClorInRgb = this.convertHexToRgb(buttonTextClor.toLocaleLowerCase());\n\n /**\n * Animate method - Reders expand animation.\n */\n const animate = () => {\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.beginPath();\n context.ellipse(pointPositionX, pointPositionY, radius, animationStartWidth, rotation, startAngle, endAngle);\n context.fillStyle = color;\n context.fill();\n context.fillStyle = color;\n if (buttonText) {\n if (animationStartWidth < animationEndWidth) {\n requestAnimationFrame(animate);\n this.applyFadingTransition(buttonText, coords, buttonTextClorInRgb, textFadeInValue);\n textFadeInValue += CanvasCalculations.textFadeInterval;\n animationStartWidth++;\n } else {\n this.drawButton(buttonText, [pointPositionX, pointPositionY]);\n }\n }\n };\n\n if (this._isDesktopViewPort) {\n animate();\n }\n\n };\n\n /**\n * CollapseAnimation method - Shows collapse animation and contains fixed values to draw the circle and ellipse shapes.\n * @param coords -Coordinates.\n */\n public collapseAnimation = (coords: number[]): void => {\n const {\n color = CanvasStyles.color,\n buttonTextClor = CanvasStyles.buttonTextClor\n } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText;\n let animationStartWidth = CanvasCalculations.collapseAnimationStartWidth;\n const pointPositionX = coords[0];\n const pointPositionY = coords[1];\n const animationEndWidth = CanvasCalculations.collapseAnimationEndWidth;\n const rotation = CanvasCalculations.rotation;\n const clearMargin = CanvasCalculations.clearMargin;\n const clearHeight = CanvasCalculations.clearHeight;\n const clearWidth = CanvasCalculations.clearWidth;\n const radius = CanvasCalculations.collapseRadius;\n const startAngle = CanvasCalculations.startAngle;\n const endAngle = CanvasCalculations.endAngle;\n let textFadeOutValue = CanvasCalculations.textFadeOutStartValue;\n const buttonTextClorInRgb = this.convertHexToRgb(buttonTextClor.toLocaleLowerCase());\n\n /**\n * Animate method - Renders collapse animation.\n */\n const animate = () => {\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.beginPath();\n context.clearRect(pointPositionX - clearMargin, pointPositionY - clearMargin, clearWidth, clearHeight);\n context.ellipse(pointPositionX, pointPositionY, radius, animationStartWidth, rotation, startAngle, endAngle);\n context.fillStyle = color;\n context.fill();\n if (animationEndWidth < animationStartWidth && buttonText) {\n requestAnimationFrame(animate);\n this.applyFadingTransition(buttonText, coords, buttonTextClorInRgb, textFadeOutValue);\n textFadeOutValue -= CanvasCalculations.textFadeInterval;\n animationStartWidth--;\n }\n };\n\n if (this._isDesktopViewPort) {\n animate();\n }\n\n };\n\n /**\n * DrawCircle method - Renders active points.\n * @param coords -Coordinates.\n */\n public drawCircle = (coords: number[]): void => {\n const {\n color = CanvasStyles.color,\n viewPort\n } = this.props;\n const doubleMultiplier: number = CanvasCalculations.doubleMultiplier;\n const startAngle: number = CanvasCalculations.startAngle;\n const context = this._canvas.current?.getContext('2d') ?? this._context;\n const radius = (viewPort === 'xs' || viewPort === 'sm') ? coords[2] * doubleMultiplier : coords[2];\n if (!context) {\n return;\n }\n context.fillStyle = color;\n context.beginPath();\n context.strokeStyle = color;\n context.arc(coords[0], coords[1], radius, startAngle, Math.PI * doubleMultiplier);\n context.closePath();\n context.stroke();\n context.fill();\n };\n\n /**\n * ScaleCoords method - To scale the active point coordinates based on the window size.\n * @param coords -Coordinates.\n * @returns -Returns number[].\n */\n public scaleCoords = (coords: number[]): number[] => {\n const {\n imgWidth\n } = this.props;\n const defaultWidth: number = CanvasCalculations.defaultWidth;\n const defaultScale: number = CanvasCalculations.defaultScale;\n\n // Calculate scale based on current 'width' and the original 'imgWidth'\n const width = this.getActiveImageWidth();\n const scale = width && imgWidth && imgWidth > defaultWidth ? width / imgWidth : defaultScale;\n return coords.map(coord => coord * scale);\n };\n\n /**\n * RenderPrefilledAreas method - To render active points in case of events.\n */\n public renderPrefilledAreas = (): void => {\n const {\n areaMap\n } = this.props;\n areaMap.areas.map(area => {\n this.drawCircle(this.scaleCoords(area.coords));\n return null;\n });\n };\n\n /**\n * ComputeCenter method - To re-calculate the center of active point based on window size.\n * @param area -IArea.\n * @returns -Returns number[].\n */\n public computeCenter = (area: IArea): number[] => {\n const scaledCoords = this.scaleCoords(area.coords);\n return [scaledCoords[0], scaledCoords[1]];\n };\n\n /**\n * HandleHoverOn method - To handle mouse hover on event.\n * @param area -IArea.\n */\n public handleHoverOn = (area: IArea): void => {\n if (area.center && this._canvas.current) {\n this.drawCircle(this.scaleCoords(area.coords));\n this.expandAnimation(area.center);\n }\n };\n\n /**\n * HandleHoverOff method - To handle mouse hover off event.\n * @param area -IArea.\n */\n public handleHoverOff = (area: IArea): void => {\n if (this._canvas.current) {\n const context = this._canvas.current.getContext('2d') ?? this._context;\n const canvasPositionX: number = CanvasCalculations.defaultPositionX;\n const canvasPositionY: number = CanvasCalculations.defaultPositionY;\n\n if (!context) {\n return;\n }\n context.clearRect(canvasPositionX, canvasPositionY, this._canvas.current.width, this._canvas.current.height);\n this.renderPrefilledAreas();\n if (area.center) {\n this.collapseAnimation(area.center);\n }\n }\n };\n\n /**\n * Click method - Mouse click event.\n * @param area -IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public click = (area: IArea, index: number) => (event: AreaEvent): void => {\n const {\n onClick\n } = this.props;\n if (onClick) {\n event.preventDefault();\n onClick(area, index, event);\n }\n };\n\n /**\n * HoverOn method - Mouse hover on event.\n * @param area -IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public hoverOn = (area: IArea, index: number) => (event: AreaEvent): void => {\n const {\n onMouseEnter\n } = this.props;\n this.handleHoverOn(area);\n if (onMouseEnter) {\n onMouseEnter(area, index, event);\n }\n };\n\n /**\n * HoverOff method - Mouse hover off event.\n * @param area - IArea.\n * @param index - Number.\n * @returns - Void.\n */\n public hoverOff = (area: IArea, index: number) => (event: AreaEvent): void => {\n const {\n onMouseLeave\n } = this.props;\n\n this.handleHoverOff(area);\n\n if (onMouseLeave) {\n onMouseLeave(area, index, event);\n }\n };\n\n /**\n * RenderAreas method - Renders active points at given coordinates.\n * @returns -Returns JSX.Element[].\n */\n public renderAreas = (): JSX.Element[] => {\n const {\n areaMap,\n viewPort\n } = this.props;\n const buttonText = this.props.imageMapperResources?.buttonText ? this.props.imageMapperResources.buttonText : '';\n const altText = this.props.imageMapperResources?.altText ? this.props.imageMapperResources.altText : '';\n const doubleMultiplier: number = CanvasCalculations.doubleMultiplier;\n\n return areaMap.areas.map((area, index) => {\n const scaledCoords = this.scaleCoords(area.coords);\n const xsRadius = area.coords[2] * doubleMultiplier;\n if (viewPort === 'xs') {\n scaledCoords[2] = xsRadius;\n }\n const center = this.computeCenter(area);\n const extendedArea = { ...area, scaledCoords, center };\n const areaKey = `area-${index}`;\n const altTextWithProductName = altText.replace('{buttonText}', buttonText ? buttonText : '')\n .replace('{productName}', area.productSearchResult?.Name ? area.productSearchResult.Name : '');\n return (\n <area\n key={areaKey}\n shape='circle'\n coords={scaledCoords.join(',')}\n onMouseEnter={this.hoverOn(extendedArea, index)}\n onMouseLeave={this.hoverOff(extendedArea, index)}\n onClick={this.click(extendedArea, index)}\n onFocus={this.hoverOn(extendedArea, index)}\n onBlur={this.hoverOff(extendedArea, index)}\n href={area.productUrl}\n tabIndex={0}\n alt={altTextWithProductName}\n aria-label={altTextWithProductName}\n />\n );\n });\n };\n\n /**\n * InitCanvas method - To render the canvas.\n */\n public initCanvas = (): void => {\n if (!this._canvas.current || !this._backgroundImage.current || !this._container.current) {\n return;\n }\n\n const {\n color,\n onLoad\n } = this.props;\n const defaultWidth: number = CanvasCalculations.defaultWidth;\n const defaultHeight: number = CanvasCalculations.defaultHeight;\n\n const canvasWidth = this.getActiveImageWidth() ?? defaultWidth;\n const canvasHeight = this.getActiveImageHeight() ?? defaultHeight;\n\n this._canvas.current.width = canvasWidth;\n this._canvas.current.height = canvasHeight;\n this._container.current.style.width = `${canvasWidth}px`;\n\n const context = this._canvas.current.getContext('2d') ?? this._context;\n if (!context) {\n return;\n }\n context.fillStyle = color ?? '';\n\n if (onLoad) {\n onLoad();\n }\n\n this.renderPrefilledAreas();\n };\n\n /**\n * Render method - To render the image mapper component with active image, canvas and active points.\n * @returns -Returns JSX.Element | null.\n */\n public render(): JSX.Element | null {\n\n const {\n imageData,\n areaMap,\n requestContext\n } = this.props;\n\n return (\n <div className='msc-active-image-container' ref={this._container}>\n <Image\n src={imageData.src}\n useMap={`#${areaMap.name}`}\n alt={areaMap.name}\n ref={this._backgroundImage}\n height={imageData.height}\n width={imageData.width}\n className='msc-active-image-img'\n imageSettings={imageData.imageSettings}\n gridSettings={requestContext.gridSettings ?? {}}\n requestContext={requestContext}\n />\n <canvas ref={this._canvas} className='msc-active-image-canvas' />\n <map name={areaMap.name} className='msc-active-image-map'>\n {this.renderAreas()}\n </map>\n </div>\n );\n }\n}\n\nexport default ImageMapper;\n\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, getTelemetryObject,\n IModuleProps, INodeProps, isMobile, ITelemetryContent, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { activeImageAdditionalContent,\n ActiveProductComponent,\n IActiveImageAdditionalContentViewProps,\n IArea,\n IAreaMap,\n IImageMapperProps,\n ImageMapper } from '../active-image-utilities';\nimport { IActiveImageData } from './active-image.data';\nimport { IActiveImageProps } from './active-image.props.autogenerated';\n\n/**\n * @type AreaEvent for active points\n */\ntype AreaEvent = Event | React.MouseEvent<HTMLAreaElement, MouseEvent> | React.FocusEvent<HTMLAreaElement>;\n\n/**\n * @interface IActiveImageViewProps\n * @classdesc - The IActiveImageViewProps interface contract.\n */\nexport interface IActiveImageViewProps extends IActiveImageProps<{}>, IImageMapperProps {\n activePointContainer: IModuleProps;\n activePointDetailsContainer: INodeProps;\n imageMapper: React.ReactNode;\n overlay: React.ReactNode;\n productCard: React.ReactNode;\n title?: React.ReactNode;\n text?: React.ReactNode;\n links?: React.ReactNode;\n detailsContainer?: INodeProps;\n detailsContainerCta?: INodeProps;\n additionalContent?: IActiveImageAdditionalContentViewProps;\n productCardleftPosition: number;\n productCardtopPosition: number;\n handleAdditionalText?(event: MsDyn365.ContentEditableEvent): void;\n handleAdditionalParagraph?(event: MsDyn365.ContentEditableEvent): void;\n handleAdditionalLinkText?(event: MsDyn365.ContentEditableEvent): void;\n}\n\n/**\n * @interface IActiveImageLinksData\n * @classdesc - The IActiveImageLinksData interface contract.\n */\nexport interface IActiveImageLinksData {\n linkText?: string;\n linkUrl: MsDyn365.ILinkData;\n ariaLabel?: string;\n willOpenInNewTab?: boolean;\n}\n\n/**\n * @interface IActiveImageState\n * @classdesc - The IActiveImageState interface contract.\n */\ninterface IActiveImageState {\n clientWidth: number;\n area: IArea | null;\n viewport: string;\n overlayClass: string;\n}\n\n/**\n * @enum ActiveImageConstants\n * @description - The active image constants enum.\n */\nexport enum ActiveImageConstants {\n timeoutInterval = 200,\n enterKey = 'Enter',\n escKey = 'Escape'\n}\n\n/**\n *\n * ActiveImage class.\n * @extends {React.PureComponent<IActiveImageProps<{}> & IImageMapperProps, IActiveImageState>}\n */\nexport class ActiveImage extends React.PureComponent<IActiveImageProps<IActiveImageData> & IImageMapperProps, IActiveImageState> {\n private readonly _telemetryContent: ITelemetryContent;\n\n private _isDesktopViewPort: boolean;\n\n private readonly _defaultProductCardWidth: number = 315;\n\n private readonly _defaultProdutCardHight: number = 490;\n\n private readonly _activePoints: IArea[] = [];\n\n private readonly _activeImageRefs: React.RefObject<HTMLDivElement>;\n\n private readonly _activeImageClass: string;\n\n private readonly _productCardDivRef: React.RefObject<HTMLDivElement>;\n\n public constructor(props: IActiveImageProps<IActiveImageData> & IImageMapperProps) {\n super(props);\n this._telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n this._activeImageClass = `msc-active-image-${this.getActiveImageId()}`;\n this.state = {\n clientWidth: 0,\n area: null,\n viewport,\n overlayClass: ''\n };\n this._isDesktopViewPort = viewport === 'lg' || viewport === 'xl';\n this._activeImageRefs = React.createRef();\n this._productCardDivRef = React.createRef();\n }\n\n public componentDidMount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.addEventListener('resize', this.updateClientWidth);\n document.addEventListener('keydown', this.keyDown, false);\n document.addEventListener('mousedown', this._handleOutsideClick);\n }\n setTimeout(() => {\n this.updateClientWidth();\n }, ActiveImageConstants.timeoutInterval);\n\n if (MsDyn365.msdyn365Commerce.isBrowser && this._activeImageRefs.current) {\n const images: HTMLCollectionOf<Element> =\n this._activeImageRefs.current.getElementsByClassName('msc-thumbnail_image msc-active-image-img');\n if (ArrayExtensions.hasElements(Array.from(images))) {\n images[0].removeAttribute('usemap');\n }\n }\n }\n\n /**\n * AddActivePoints method - To handle add Active Points.\n * @param area - IArea.\n * @param product - ProductSearchResult.\n * @param coords - Coords.\n * @param productUrl - String.\n */\n public addActivePoints = (area: IArea | undefined, product: ProductSearchResult, coords: number[], productUrl: string): void => {\n if (!area) {\n this._activePoints.push({\n areaId: product.RecordId.toString(),\n coords,\n primaryImageUrl: product.PrimaryImageUrl ?? '',\n productUrl,\n productSearchResult: product\n });\n }\n };\n\n /**\n * ComponentWillUnmount method.\n */\n public componentWillUnmount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.removeEventListener('resize', this.updateClientWidth);\n document.removeEventListener('keydown', (this.keyDown as unknown) as EventListener, false);\n document.removeEventListener('mousedown', this._handleOutsideClick, false);\n }\n }\n\n /**\n * UpdateClientWidth method to update client width in state.\n */\n public updateClientWidth = (): void => {\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n this.setState({ clientWidth: this.getActiveImageWidth(), viewport });\n this._isDesktopViewPort = viewport === 'lg' || viewport === 'xl';\n };\n\n /**\n * Render method.\n * @returns - Returns JSX.Element | null.\n */\n public render(): JSX.Element | null {\n const viewProps: IActiveImageViewProps = {\n ...(this.props as IImageMapperProps & IActiveImageProps<{}>),\n activePointContainer: {\n moduleProps: this.props,\n className: classnames('msc-active-image', this._activeImageClass, this.props.config.className)\n },\n activePointDetailsContainer: {\n tag: 'div',\n className: classnames('msc-active-image-wrapper', this._activeImageClass, this.props.config.className),\n ref: this._activeImageRefs\n },\n imgWidth: this.props.config.canvasWidth,\n imageMapper: this.renderImageMapper(),\n overlay: this.renderOverlay(),\n productCard: this.renderProductCard(),\n productCardleftPosition: this.getProductCardPositionX(),\n productCardtopPosition: this.getProductCardPositionY(),\n title: this.renderActiveImageDetailsHeading(),\n text: this.renderActiveImageDetailsParagraph(),\n links: this.renderActiveImageDetailsLinks(),\n detailsContainer: { className: 'msc-active-image__details' },\n detailsContainerCta: { className: 'msc-active-image__details__cta' },\n additionalContent: activeImageAdditionalContent({\n requestContext: this.props.context.request,\n additionalContent: this.props.config.additionalContent,\n handleAdditionalTextChange: this.handleAdditionalTextChange,\n handleAdditionalParagraphChange: this.handleAdditionalParagraphChange,\n handleAdditionalLinkTextChange: this.handleAdditionalLinkTextChange\n }),\n handleAdditionalText: this.handleAdditionalTextChange,\n handleAdditionalParagraph: this.handleAdditionalParagraphChange,\n handleAdditionalLinkText: this.handleAdditionalTextChange\n };\n\n return this.props.renderView(viewProps);\n }\n\n /**\n * RenderImageMapper method - To render image mapper.\n * @returns - Returns React.ReactNode | null.\n */\n public renderImageMapper = (): React.ReactNode | null => {\n const { config, context } = this.props;\n const defaultPosition: number = 0;\n const defaultLength: number = 0;\n const productResults = this.props.data.products.result;\n if (config.activePoints && productResults) {\n for (const product of productResults) {\n for (const configProduct of config.activePoints) {\n if (product.ItemId === configProduct.itemId) {\n const productUrl = getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined);\n const coords = [\n configProduct.xPosition ?? defaultPosition,\n configProduct.yPosition ?? defaultPosition,\n configProduct.radius ?? defaultPosition\n ];\n const area = this._activePoints.find((activePoint) => JSON.stringify(activePoint.coords) === JSON.stringify(coords));\n this.addActivePoints(area, product, coords, productUrl);\n }\n }\n }\n }\n const mappedArea: IAreaMap = {\n name: `map-${this._activeImageClass}`,\n areas: this._activePoints.length > defaultLength ? this._activePoints : []\n };\n\n // If image is null, we want to render the placeholder SVG - by passing image data with empty src\n return (\n <ImageMapper\n viewPort={this.state.viewport}\n requestContext={this.props.context.actionContext.requestContext}\n width={this.state.clientWidth}\n imgWidth={this.props.config.canvasWidth}\n onClick={this.enterArea}\n onFocus={this.enterArea}\n onMouseEnter={this.enterArea}\n onMouseLeave={this.leaveArea}\n imageData={this.props.config.activeImage ?? {}}\n areaMap={mappedArea}\n activeImageRefs={this._activeImageRefs}\n imageMapperResources={{\n altText: this.props.resources.altTextForSeeMoreButtonWithProductName,\n buttonText: this.props.resources.seeMoreButtonText\n }}\n />\n );\n };\n\n /**\n * EnterArea method - To handle mouse enter event.\n * @param area - Active point area.\n * @param index - Active point index.\n * @param event - Active point AreaEvent.\n */\n public enterArea = (area: IArea, index: number, event: AreaEvent): void => {\n this.setState({ area, overlayClass: 'msc-active-image-overlay' });\n if (this.props.onMouseEnter) {\n this.props.onMouseEnter(area, index, event);\n }\n if (event.type.toLocaleLowerCase() === 'click' && this._isDesktopViewPort) {\n window.open(area.productUrl, '_self');\n }\n };\n\n /**\n * LeaveArea method - To handle mouse leave event.\n */\n public leaveArea = (): void => {\n if (this._isDesktopViewPort) {\n this.resetState();\n }\n };\n\n /**\n * ResetState method - To reset the state for area and overlayclass.\n */\n public resetState = (): void => {\n this.setState({ area: null, overlayClass: '' });\n };\n\n /**\n * RenderProductComponent method - To render the product card with product information.\n * @returns - Returns React.ReactNode.\n */\n public renderProductComponent = (): React.ReactNode => {\n if (this.state.area?.productSearchResult) {\n const baseImageUrl: string = this.props.context.request.apiSettings.baseImageUrl;\n const imageUrl: string = this.state.area.primaryImageUrl ?? '';\n const primaryImageUrl: string = `${baseImageUrl}${imageUrl}`;\n const product: ProductSearchResult = this.state.area.productSearchResult;\n product.PrimaryImageUrl = primaryImageUrl;\n\n return (\n <ActiveProductComponent\n context={this.props.context}\n imageSettings={this.props.config.productImageSettings}\n id={product.ItemId ?? ''}\n typeName={this.props.typeName || ''}\n data={{ product }}\n />\n );\n }\n return React.Fragment;\n };\n\n /**\n * RenderProductCard method - To render product cards.\n * @returns - Returns React.ReactNode.\n */\n public renderProductCard = (): React.ReactNode => {\n const { area } = this.state;\n\n return (\n <>\n {area?.center && (\n <div className='msc-active-image-product-card' ref={this._productCardDivRef}>\n <div className='msc-active-image-product-card-wrapper' key={area.areaId}>\n {!this._isDesktopViewPort && <button onClick={this.resetState} className='close-button' />}\n {area.productSearchResult && this.renderProductComponent()}\n {!this._isDesktopViewPort && <a href={area.productUrl} className='see-more-button'>\n {this.props.resources.seeMoreButtonText}\n </a>}\n </div>\n </div>\n )}\n </>\n );\n };\n\n /**\n * RenderOverlay method - To render overlay for non desktop viewports.\n * @returns - Returns React.ReactNode.\n */\n public renderOverlay = (): React.ReactNode => {\n return (\n <>\n {!this._isDesktopViewPort && <div className={this.state.overlayClass} />}\n </>\n );\n };\n\n /**\n * GetProductCardPositionX method - Provides product card x position to the left or right of active point based on available space.\n * For xs, sm and md viewports it provides x position for the center alignment.\n * @returns - Returns number.\n */\n public getProductCardPositionX = (): number => {\n const defaultImageSettings = this.getDefaultImageSettings();\n const productImageSettingsWidth =\n this.props.config.productImageSettings?.viewports ? this.props.config.productImageSettings.viewports.lg?.w : defaultImageSettings.viewports.lg?.w;\n const defaultPositionX: number = 0;\n const halfDivisor: number = 2;\n const productCardWidth: number =\n productImageSettingsWidth ? productImageSettingsWidth : this._defaultProductCardWidth;\n const { area, clientWidth, viewport } = this.state;\n const pointPositionX = area?.center?.[0] ?? clientWidth / halfDivisor;\n const leftAllignPosition = pointPositionX - productCardWidth - (productCardWidth / halfDivisor);\n const rightAllignPosition = pointPositionX + (productCardWidth / halfDivisor);\n let position: number = (clientWidth - productCardWidth) / halfDivisor;\n if (viewport !== 'xs' && viewport !== 'sm' && viewport !== 'md') {\n if (leftAllignPosition < defaultPositionX) {\n position = rightAllignPosition;\n } else {\n position = leftAllignPosition;\n }\n }\n return position;\n };\n\n /**\n * GetProductCardPositionY method - Provides product card y position in center with respect to active point.\n * For xs, sm and md viewports it provides y position for the center alignment.\n * @returns - Returns number.\n */\n public getProductCardPositionY = (): number => {\n const defaultImageSettings = this.getDefaultImageSettings();\n const productImageSettingsHeight =\n this.props.config.productImageSettings?.viewports ? this.props.config.productImageSettings.viewports.lg?.h : defaultImageSettings.viewports.lg?.h;\n const halfDivisor: number = 2;\n const { area, viewport } = this.state;\n const produtCardHight: number =\n productImageSettingsHeight ? productImageSettingsHeight : this._defaultProdutCardHight;\n const pointPositionY = (this.getActiveImageHeight() - produtCardHight) / halfDivisor;\n let position: number = pointPositionY;\n if (viewport !== 'xs' && viewport !== 'sm' && viewport !== 'md') {\n position = (area?.center?.[1] ?? this.getActiveImageHeight() / halfDivisor) - (produtCardHight / halfDivisor);\n }\n return position;\n };\n\n /**\n * GetDefaultImageSettings method.\n * @returns MsDyn365.IImageSettings.\n */\n public getDefaultImageSettings = (): MsDyn365.IImageSettings => {\n const defaultImageSettings: MsDyn365.IImageSettings = {\n viewports: {\n xs: { q: 'w=275&h=275&m=6', w: 275, h: 275 },\n lg: { q: 'w=275&h=275&m=6', w: 275, h: 275 },\n xl: { q: 'w=275&h=275&m=6', w: 275, h: 275 }\n },\n lazyload: true\n };\n\n return defaultImageSettings;\n };\n\n /**\n * KeyDown method - To handle keydown event.\n * @param event - KeyboardEvent.\n */\n public keyDown = (event: KeyboardEvent): void => {\n if (event.key === ActiveImageConstants.enterKey) {\n const target: HTMLElement = event.target as HTMLElement;\n if (target.nodeName === 'AREA') {\n const area: HTMLAreaElement = target as HTMLAreaElement;\n if (area.href) {\n window.open(area.href, '_self');\n }\n }\n }\n if (event.key === ActiveImageConstants.escKey) {\n this.resetState();\n }\n };\n\n /**\n * GetActiveImageWidth method - To get active image width.\n * @returns Returns number.\n */\n public getActiveImageWidth = (): number => {\n const defaultWidth: number = 0;\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const activeImageReferenceValue = this._activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientWidth;\n }\n }\n return defaultWidth;\n };\n\n /**\n * GetActiveImageHeight method - To get active image height.\n * @returns Returns number.\n */\n public getActiveImageHeight = (): number => {\n const defaultHeight: number = 0;\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const activeImageReferenceValue = this._activeImageRefs;\n if (activeImageReferenceValue.current !== null) {\n return activeImageReferenceValue.current.clientHeight;\n }\n }\n return defaultHeight;\n };\n\n /**\n * HandleLinkTextChange method - To handle link text change event.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.links && this.props.config.links[Number(linkIndex)]) {\n this.props.config.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * HandleTextChange method - To handle text change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleTextChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n /**\n * HandleParagraphChange method - To handle paragraph change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleParagraphChange = (event: MsDyn365.ContentEditableEvent): void => {\n this.props.config.paragraph = event.target.value;\n };\n\n /**\n * HandleAdditionalTextChange method - To handle additional text change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalTextChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.heading = event.target.value;\n }\n }\n\n /**\n * HandleAdditionalLinkTextChange method - To handle additional link text change event.\n * @param linkIndex - The link index.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalLinkTextChange(linkIndex: number, event: MsDyn365.ContentEditableEvent): void {\n const additionalContent = this.props.config.additionalContent ?? {};\n if (additionalContent.links) {\n additionalContent.links[Number(linkIndex)].linkText = event.target.value;\n }\n }\n\n /**\n * HandleAdditionalParagraphChange method - To handle additional paragraph change event.\n * @param event - The dialog that is allowed to remain open.\n */\n public handleAdditionalParagraphChange(event: MsDyn365.ContentEditableEvent): void {\n if (this.props.config.additionalContent) {\n this.props.config.additionalContent.subtext = event.target.value;\n }\n }\n\n /**\n * RenderActiveImageDetailsLinks method - To render active image details links.\n * @returns - React node.\n */\n public renderActiveImageDetailsLinks = (): React.ReactNode[] | undefined => {\n const { links } = this.props.config;\n const payLoad = getPayloadObject('click', this._telemetryContent, '');\n\n return (\n links?.map((linkData: IActiveImageLinksData, index: number) => {\n payLoad.contentAction.etext = linkData.linkText;\n const attributes = getTelemetryAttributes(this._telemetryContent, payLoad);\n const linkId = index;\n const editableLink: MsDyn365.ILinksData = {\n ariaLabel: linkData.ariaLabel,\n className: 'msc-active-image__details__cta__link',\n linkText: linkData.linkText,\n linkUrl: linkData.linkUrl.destinationUrl,\n openInNewTab: linkData.willOpenInNewTab,\n role: 'button',\n additionalProperties: attributes\n };\n\n return (\n <MsDyn365.Link\n key={linkId}\n link={editableLink}\n editProps={{\n /**\n * Handle additional paragraph change.\n * @param event - The keyboard event.\n */\n onTextChange: (event) => {\n this.handleLinkTextChange(index, event);\n }, requestContext: this.props.context.request }}\n />\n );\n })\n );\n };\n\n /**\n * RenderActiveImageDetailsHeading method - To render active image details heading.\n * @returns - React.ReactNode | undefined.\n */\n public renderActiveImageDetailsHeading = (): React.ReactNode | undefined => {\n const { heading } = this.props.config;\n\n return (\n heading && (\n <MsDyn365.Text\n className='msc-active-image__details__title'\n tag={heading.tag ?? 'h1'}\n text={heading.text}\n editProps={{ onEdit: this.handleTextChange, requestContext: this.props.context.request }}\n />\n )\n );\n };\n\n /**\n * RenderActiveImageDetailsParagraph method - To render active image details paragraph.\n * @returns - React.ReactNode | undefined.\n */\n public renderActiveImageDetailsParagraph = (): React.ReactNode | undefined => {\n const { paragraph } = this.props.config;\n\n return (\n paragraph && (\n <MsDyn365.RichTextComponent\n text={paragraph}\n className='msc-active-image__details__text'\n editProps={{ onEdit: this.handleParagraphChange, requestContext: this.props.context.request }}\n />\n )\n );\n };\n\n /**\n * GetActiveImageId - To get active image id from src.\n * @returns - String.\n */\n public getActiveImageId = (): string => {\n const { activeImage } = this.props.config;\n let activeImageId: string = '';\n if (activeImage?.src) {\n const activeImageSource = activeImage.src.split('/');\n const decrementOne: number = 1;\n const activeImageIdPart = (activeImageSource[activeImageSource.length - decrementOne]).split('?');\n activeImageId = activeImageIdPart[0] ?? '';\n }\n return activeImageId;\n };\n\n /**\n * Handle outside click method - To handle outside click of the active image product.\n * @param event - Mouse event.\n */\n private readonly _handleOutsideClick = (event: MouseEvent) => {\n if (this._productCardDivRef.current?.contains(event.target as Node)) {\n return;\n }\n this.resetState();\n };\n}\nexport default ActiveImage;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, IActionInput } from '@msdyn365-commerce/core';\n\nexport enum ReviewConcernCategory {\n OffensiveContent = '1',\n ReviewResponse = '7',\n SpamAdvertising = '8',\n Profanity = '9'\n}\n\n/**\n * ReportReviewConcern Input Action.\n */\nexport class ReportReviewConcernInput implements IActionInput {\n public reviewId: string;\n\n public tenantId: string;\n\n public locale: string;\n\n public serviceEndpoint: string;\n\n public concernCategory: string;\n\n public authToken: string;\n\n constructor(\n reviewId: string,\n tenantId: string,\n locale: string,\n concernCategory: string,\n authToken: string,\n serviceEndpoint: string\n ) {\n this.reviewId = reviewId;\n this.tenantId = tenantId;\n this.locale = locale;\n this.concernCategory = concernCategory;\n this.authToken = authToken;\n this.serviceEndpoint = serviceEndpoint;\n }\n\n public getCacheKey = () => 'ReportReviewConcern';\n\n public getCacheObjectType = () => 'ReportReviewConcern';\n\n public dataCacheType = (): CacheType => 'none';\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISocialShareItemViewProps } from './social-share-item';\n\nexport const SocialShareItemView: React.FC<ISocialShareItemViewProps> = props => {\n const { SocialShareItem, SocialShareItemElement } = props;\n\n if (!SocialShareItemElement) {\n props.context.telemetry.error('Social media is not valid, module wont render');\n return null;\n }\n return (\n <Module {...SocialShareItem}>\n {SocialShareItemElement}\n </Module>\n );\n};\n\nexport default SocialShareItemView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport {\n format,\n INodeProps,\n Progress\n} from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface IHistogramItemsProps {\n ratingsSummary: RatingsSummary;\n resources: IHistogramItemsResources;\n locale: string;\n onClick(stars: number): void;\n}\n\nexport interface IHistogramItemsResources {\n barItemAriaLabel: string;\n}\n\nexport interface IHistogramItemViewProps {\n starLabel: React.ReactElement;\n bar: React.ReactElement;\n percentage: React.ReactElement;\n buttonProps: INodeProps;\n}\n\n/**\n * CartLineItems component.\n */\n\nexport const HistogramItems = (props: IHistogramItemsProps): IHistogramItemViewProps[] => {\n const { ratingsSummary } = props;\n const totalRatingsCount: number = ratingsSummary.totalRatingsCount || 0;\n if (totalRatingsCount === 0) {\n return [];\n }\n return [\n renderItem(props, 5, ratingsSummary.star5Count, totalRatingsCount),\n renderItem(props, 4, ratingsSummary.star4Count, totalRatingsCount),\n renderItem(props, 3, ratingsSummary.star3Count, totalRatingsCount),\n renderItem(props, 2, ratingsSummary.star2Count, totalRatingsCount),\n renderItem(props, 1, ratingsSummary.star1Count, totalRatingsCount)\n ];\n};\n\nconst renderItem = (props: IHistogramItemsProps, stars: number, count?: number, totalCount?: number): IHistogramItemViewProps => {\n count = count || 0;\n totalCount = totalCount || 0;\n const percentage = totalCount === 0 ? 0 : count / totalCount;\n const formattedPercent = new Intl.NumberFormat(props.locale, { style: 'percent' }).format(percentage);\n const ariaLabel = format(props.resources.barItemAriaLabel, stars, formattedPercent);\n\n return {\n starLabel: <span aria-hidden='true' className='ms-ratings-histogram__star'>\n {stars}\n </span>,\n percentage: <span aria-hidden='true' className='ms-ratings-histogram__percentage'>\n {formattedPercent}\n </span>,\n bar: <Progress\n value={percentage * 100} max={100} ariaLabel={ariaLabel}\n className='ms-ratings-histogram__bar' />,\n buttonProps: { tag: 'button', className: 'ms-ratings-histogram__item', onClick: () => {\n props.onClick(stars);\n } }\n };\n};\n\nexport const AverageRatingNumber: React.FC<{ summary: RatingsSummary }> = (props: { summary: RatingsSummary }) => {\n return (<p className='ms-ratings-histogram__average'>\n {props.summary.averageRating}\n {' '}\n / 5\n </p>);\n};\n\nexport const TotalReviews: React.FC<{ summary: RatingsSummary }> = (props: { summary: RatingsSummary }) => {\n return (<p className='ms-ratings-histogram__total'>\n {props.summary.totalRatingsCount}\n </p>);\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ISliderLabel, ISliderThumbProps, Slider } from '@msdyn365-commerce-modules/utilities';\nimport debounce from 'lodash/debounce';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IRefineItemProps, IRefineItemState } from './refine-item';\n\ntype InputType = 'Min' | 'Max';\n\nexport type RangeRefineItemType = 'slider' | 'input';\n\n/**\n * Range refine item properties.\n */\nexport interface IRangeRefineItemProps extends IRefineItemProps {\n rangeType: RangeRefineItemType;\n minValueSliderThumbAriaLabel?: string;\n maxValueSliderThumbAriaLabel?: string;\n sliderKey?: string;\n}\n\n/**\n * Range refine item state.\n */\nexport interface IRangeRefineItemState extends IRefineItemState {\n validationErrorMin: string | undefined;\n validationErrorMax: string | undefined;\n selectedMin: string | undefined;\n selectedMax: string | undefined;\n touchedMin: boolean;\n touchedMax: boolean;\n sliderId: string;\n minValue: string | undefined;\n maxValue: string | undefined;\n labels: ISliderLabel[];\n sliderThumbs: ISliderThumbProps[];\n}\n\n/**\n * RangeRefineItem component (controlled by RefineSubmenu).\n */\n@observer\nexport default class RangeRefineItem extends React.Component<IRangeRefineItemProps, IRangeRefineItemState> {\n private readonly _formattedPriceReverseLookup: Map<string, string> = new Map();\n\n private readonly minInput: React.RefObject<HTMLInputElement>;\n\n private readonly maxInput: React.RefObject<HTMLInputElement>;\n\n @computed get currencyCode(): string {\n return this.props.productRefinerValue.UnitText || '';\n }\n\n public constructor(props: IRangeRefineItemProps) {\n super(props);\n this._onRangeUpdate = this._onRangeUpdate.bind(this);\n this._onRangeUpdateEnd = this._onRangeUpdateEnd.bind(this);\n this._handleRangeTooltipText = this._handleRangeTooltipText.bind(this);\n this._changeMin = this._changeMin.bind(this);\n this._changeMax = this._changeMax.bind(this);\n this._finishChangeMin = this._finishChangeMin.bind(this);\n this._finishChangeMax = this._finishChangeMax.bind(this);\n\n this.minInput = React.createRef<HTMLInputElement>();\n this.maxInput = React.createRef<HTMLInputElement>();\n\n const { selectedRefinementCriterion } = this.props;\n const initialMin = selectedRefinementCriterion?.LeftValueBoundString ?? '0';\n const initialMax = selectedRefinementCriterion?.RightValueBoundString;\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(this.props.productRefinerValue.RefinerRecordId)}`;\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\n const minPrice = this._formatPrice(minValue);\n const maxPrice = this._formatPrice(maxValue);\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\n const selectedMin = this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\n const selectedMax = this.props.selectedRefinementCriterion?.RightValueBoundString ??\n this.props.productRefinerValue.RightValueBoundString ?? maxValue;\n const selectedMinPrice = this._formatPrice(selectedMin);\n const selectedMaxPrice = this._formatPrice(selectedMax);\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(sliderId,\n sliderKeyString, selectedMin, selectedMinPrice, selectedMax, selectedMaxPrice, maxPrice);\n this.state = {\n isChecked: false,\n validationErrorMin: undefined,\n validationErrorMax: undefined,\n selectedMin: initialMin,\n selectedMax: initialMax,\n touchedMin: false,\n touchedMax: false,\n sliderId,\n minValue,\n maxValue,\n labels,\n sliderThumbs\n };\n }\n\n public shouldComponentUpdate(nextProps: IRangeRefineItemProps,\n nextState: IRangeRefineItemState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public componentDidUpdate(previousProps: IRangeRefineItemProps): void {\n if (previousProps !== this.props) {\n this.updateSliderProps();\n }\n }\n\n public render(): JSX.Element | undefined {\n const { productRefinerValue, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\n\n if (!productRefinerValue || !parentProductRefinerHierarchy) {\n refineItemCommonProps.telemetry.error('Cannot render refine value range without productRefinerValue and parentProductRefinerHierarchy');\n return undefined;\n }\n\n if (this.props.rangeType === 'input') {\n return this._renderInputFields();\n }\n\n return this._renderSlider();\n }\n\n /**\n * Function to update slider props.\n */\n private updateSliderProps(): void {\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(this.props.productRefinerValue.RefinerRecordId)}`;\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\n const minPrice = this._formatPrice(minValue);\n const maxPrice = this._formatPrice(maxValue);\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\n const selectedMin = this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\n const selectedMax = this.props.selectedRefinementCriterion?.RightValueBoundString ??\n this.props.productRefinerValue.RightValueBoundString ?? maxValue;\n const selectedMinPrice = this._formatPrice(selectedMin);\n const selectedMaxPrice = this._formatPrice(selectedMax);\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(sliderId,\n sliderKeyString, selectedMin, selectedMinPrice, selectedMax, selectedMaxPrice, maxPrice);\n this.setState({ sliderId, minValue, maxValue, labels, sliderThumbs });\n }\n\n /**\n * Function to create the labels for slider.\n * @param sliderId - Slider element id for the DOM.\n * @param minPrice - Slider min value.\n * @param maxPrice - Slider max value.\n * @returns Array labels.\n */\n private readonly getLabels = (sliderId: string, minPrice: string, maxPrice: string): ISliderLabel[] => {\n return ([\n {\n labelId: `${sliderId}_start`,\n labelString: `${minPrice}`,\n labelPositioning: 'start'\n },\n {\n labelId: `${sliderId}_end`,\n labelString: `${maxPrice}`,\n labelPositioning: 'end'\n }\n ]);\n };\n\n /**\n * Function to create the slider thumbs for slider.\n * @param sliderId - Slider element id for the DOM.\n * @param sliderKey - Unique key for slider.\n * @param selectedMin - Slider selected min value.\n * @param selectedMinPrice - Slider selected min price.\n * @param selectedMax - Slider selected max value.\n * @param selectedMaxPrice - Slider selected max price..\n * @param maxPrice - Slider max price..\n * @returns Slider Thumb Props.\n */\n private readonly getSliderThumbs = (sliderId: string,\n sliderKey: string,\n selectedMin: string,\n selectedMinPrice: string,\n selectedMax: string | undefined,\n selectedMaxPrice: string,\n maxPrice: string): ISliderThumbProps[] => {\n const sliderThumbDefaultValue = 0;\n return ([\n {\n id: `${sliderId}${sliderKey}_slider_thumb_start`,\n value: (selectedMin && Number(selectedMin)) || sliderThumbDefaultValue,\n ariaLabel: `${this.props.minValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\n ariaValueText: `${selectedMinPrice}`\n },\n {\n id: `${sliderId}${sliderKey}_slider_thumb_end`,\n value: Number(selectedMax) || Number(maxPrice),\n ariaLabel: `${this.props.maxValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\n ariaValueText: `${selectedMaxPrice}`\n }\n ]);\n };\n\n private _renderInputFields(): JSX.Element | undefined {\n const { isDisabled, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\n const { selectedMin, selectedMax, touchedMin, touchedMax, validationErrorMin, validationErrorMax } = this.state;\n\n const rangeAriaLabel = (refineItemCommonProps.rangeNameFormat || '{0}').replace('{0}', (parentProductRefinerHierarchy.KeyName || ''));\n const formAttrs = {\n 'aria-label': rangeAriaLabel,\n 'aria-disabled': isDisabled\n };\n\n // To enable price formatting of selected fields, this is the approach:\n // initial value: min=0 formatted as price, max=undefined\n // onFocus/onChange: convert to number (unformat) and mark as touched to indicate value is being edited\n // onBlur: validate and format entered value as price\n const minInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-min ${validationErrorMin ? 'refine-submenu__input-range--error' : ''}`;\n const maxInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-max ${validationErrorMax ? 'refine-submenu__input-range--error' : ''}`;\n const minLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-min';\n const maxLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-max';\n const formattedSelectedMin = this._getFormattedSelectedValue(selectedMin, touchedMin, validationErrorMin);\n const formattedSelectedMax = this._getFormattedSelectedValue(selectedMax, touchedMax, validationErrorMax);\n return (\n <form className='ms-refine-submenu__input-range-refiner' {...formAttrs}>\n <label className={minLabelClassName}>\n {refineItemCommonProps.minLabel}\n <input\n className={minInputClassName}\n onChange={this._changeMin}\n onFocus={this._changeMin}\n onBlur={this._finishChangeMin}\n value={formattedSelectedMin}\n ref={this.minInput}\n />\n </label>\n <label className={maxLabelClassName}>\n {refineItemCommonProps.maxLabel}\n <input\n className={maxInputClassName}\n placeholder={formattedSelectedMax ? undefined : refineItemCommonProps.placeholderTextMax}\n onChange={this._changeMax}\n onFocus={this._changeMax}\n onBlur={this._finishChangeMax}\n value={formattedSelectedMax}\n ref={this.maxInput}\n />\n </label>\n {validationErrorMin &&\n <span className='ms-refine-submenu__input-range-error-text refine-submenu__input-range-min-error-text'>\n {validationErrorMin}\n </span>}\n {validationErrorMax && validationErrorMin !== validationErrorMax &&\n <span className='ms-refine-submenu__input-range-error-text refine-submenu__input-range-max-error-text'>\n {validationErrorMax}\n </span>}\n </form>\n );\n }\n\n private _renderSlider(): JSX.Element | undefined {\n const { isDisabled, sliderKey } = this.props;\n const ariaAttributes = {\n 'aria-disabled': isDisabled\n };\n\n return (\n <Slider\n className='ms-refine-submenu__range-refiner'\n key={this.state.sliderId}\n sliderKey={sliderKey}\n id={this.state.sliderId}\n inForm={false}\n min={(this.state.minValue && Number(this.state.minValue)) || undefined}\n max={(this.state.maxValue && Number(this.state.maxValue)) || undefined}\n step={1}\n orientation='horizontal'\n labels={this.state.labels}\n showLabels\n showTooltip\n sliderThumbs={this.state.sliderThumbs}\n onChangeEnd={this._onRangeUpdateEnd}\n onChange={debounce(this._onRangeUpdate, 500)}\n handleTooltipText={this._handleRangeTooltipText}\n {...ariaAttributes}\n />\n );\n }\n\n private _changeMin(event: React.FocusEvent<HTMLInputElement>): void {\n this._changeValue(event, 'Min');\n }\n\n private _changeMax(event: React.FocusEvent<HTMLInputElement>): void {\n this._changeValue(event, 'Max');\n }\n\n private _changeValue(event: React.FocusEvent<HTMLInputElement>, inputType: InputType): void {\n const selectedKey = `selected${inputType}`;\n const touchedKey = `touched${inputType}`;\n this.setState({\n [selectedKey]: this._getInputWithoutFormatting(event.currentTarget.value),\n [touchedKey]: true\n });\n }\n\n private _finishChangeMin(event: React.FocusEvent<HTMLInputElement>): boolean {\n const selectedMinValue = this._getInputWithoutFormatting(event.currentTarget.value);\n this.setState({\n selectedMin: selectedMinValue,\n minTouched: false\n });\n const minInput = Number(selectedMinValue);\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue, refineItemCommonProps, selectedRefinementCriterion } = this.props;\n const max = selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString || undefined;\n\n const maxNum = max ? Number(max) : undefined;\n\n if (isNaN(minInput)) {\n this.setState({ validationErrorMin: refineItemCommonProps.validationErrorNaN });\n this._focus('Min');\n return false;\n }\n\n if (this._validateRange(minInput, maxNum)) {\n onToggle({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: true,\n rangeStart: minInput,\n rangeEnd: maxNum\n });\n return true;\n }\n this._focus('Min');\n\n return false;\n }\n\n private _finishChangeMax(event: React.FocusEvent<HTMLInputElement>): boolean {\n const selectedMaxValue = this._getInputWithoutFormatting(event.currentTarget.value);\n this.setState({\n selectedMax: selectedMaxValue,\n maxTouched: false\n });\n const maxInput = Number(selectedMaxValue);\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue, refineItemCommonProps, selectedRefinementCriterion } = this.props;\n const min = selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString || '0';\n\n const minNum = Number(min);\n\n if (isNaN(maxInput)) {\n this.setState({ validationErrorMax: refineItemCommonProps.validationErrorNaN });\n this._focus('Max');\n return false;\n }\n\n if (this._validateRange(minNum, maxInput)) {\n if (productRefinerValue) {\n onToggle({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: true,\n rangeStart: minNum,\n rangeEnd: maxInput\n });\n } else {\n this._focus('Max');\n }\n return true;\n }\n\n return false;\n }\n\n private _focus(inputType: InputType): void {\n const ref = inputType === 'Max' ? this.maxInput : this.minInput;\n\n setTimeout(() => {\n if (ref && ref.current) {\n ref.current.focus();\n }\n }, 50);\n }\n\n private _getFormattedSelectedValue(selected: string | undefined, touched: boolean, validationError: string | undefined): string | undefined {\n if (touched || validationError || selected === undefined) {\n return selected;\n }\n return this._formatPrice(selected);\n }\n\n private _validateRange(min: number, max: number | undefined): boolean {\n const { refineItemCommonProps } = this.props;\n if (max === undefined) {\n return true;\n }\n\n if (min > max) {\n this.setState({\n validationErrorMin: refineItemCommonProps.validationErrorRange,\n validationErrorMax: refineItemCommonProps.validationErrorRange\n });\n return false;\n }\n\n return true;\n }\n\n private _formatPrice(amount: string | undefined): string {\n const result = this.props.context.cultureFormatter.formatCurrency(Number(amount), this.currencyCode);\n return result;\n }\n\n private _getInputWithoutFormatting(input: string): string {\n // First try to cast raw input to a number\n const inputAsNum = Number(input);\n if (!isNaN(inputAsNum)) {\n return input;\n }\n\n // Otherwise try a reverse lookup and fall back to the raw input if all else fails\n const reverseLookupResult = this._formattedPriceReverseLookup.get(input);\n return reverseLookupResult || input;\n }\n\n // NOTE: Fix types once Shared Components build pipeline bug fixed\n private _onRangeUpdate(sliderChangeNotification: any): void {\n // Need to filter out mousemove events as these cause errors after the menu updates and slider re-renders\n if (sliderChangeNotification.eventType !== 'mousemove') {\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\n if (productRefinerValue && sliderChangeNotification) {\n onToggle({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: true,\n rangeStart: sliderChangeNotification.firstThumbValue,\n rangeEnd: sliderChangeNotification.secondThumbValue\n });\n\n this._focusOnSliderThumb(sliderChangeNotification);\n }\n }\n }\n\n private _onRangeUpdateEnd(sliderChangeNotification: any): void {\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\n if (productRefinerValue && sliderChangeNotification) {\n onToggle({\n parentProductRefinerHierarchy,\n productRefinerValue,\n isSelecting: true,\n rangeStart: sliderChangeNotification.firstThumbValue,\n rangeEnd: sliderChangeNotification.secondThumbValue\n });\n\n this._focusOnSliderThumb(sliderChangeNotification);\n }\n }\n\n private _focusOnSliderThumb(sliderChangeNotification: any): void {\n if (sliderChangeNotification.id) {\n const element = document.getElementById(`${sliderChangeNotification.id}range`);\n if (element) {\n setTimeout(\n () => {\n element.focus();\n }, 0);\n }\n }\n }\n\n private _handleRangeTooltipText(tooltip: number): string {\n return this._formatPrice(`${tooltip}`);\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModuleProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IReviewModalViewProps } from '../../common/review-modal';\nimport { IReportReviewModalViewProps } from './components/report-review-modal';\nimport { IReviewCardViewProps } from './components/review-card';\nimport { IReviewsListState, IReviewsListViewProps } from './reviews-list';\n\nconst ReviewsListview: React.FC<IReviewsListViewProps> = props => {\n const {\n averageRating,\n filterByDropdown,\n heading,\n moduleProps,\n noReviewsMessage,\n noReviewsWithFilterMessage,\n pageControls,\n refineReviewsProps,\n reportReviewModal,\n reviewsListProps,\n reviewCards,\n reviewCount,\n reviewModal,\n sortByDropdown,\n state,\n userReview\n } = props;\n\n if (!userReview && reviewCards.length === 0 && !state.isFilterApplied) {\n return (<Module {...moduleProps}>\n {noReviewsMessage}\n </Module>);\n }\n\n return (\n <Module {...moduleProps}>\n {heading}\n {averageRating}\n {reviewCount}\n <Node {...refineReviewsProps} >\n {sortByDropdown}\n {filterByDropdown}\n </Node>\n <Node {...reviewsListProps}>\n {userReview && buildReviewCard(userReview)}\n {reviewCards.map(review => {\n return buildReviewCard(review);\n })}\n </Node>\n { reviewCards.length === 0 && state.isFilterApplied && noReviewsWithFilterMessage}\n {pageControls}\n {createReviewModal(reviewModal, moduleProps)}\n {createReportModal(reportReviewModal, state)}\n </Module>\n );\n};\n\nconst buildReviewCard = (props: IReviewCardViewProps) => {\n return (\n <Node {...props.cardProps}>\n <Node {...props.headerProps}>\n {props.rating}\n {props.name}\n </Node>\n <Node {...props.cardBodyProps}>\n <Node {...props.reviewProps}>\n {props.reviewTitle}\n {props.date}\n {props.reviewText}\n </Node>\n <Node {...props.responseProps}>\n {props.responseName}\n {props.responseDate}\n {props.responseText}\n </Node>\n <Node {...props.controlsProps}>\n {props.ratingHelpfulLabel}\n {props.like}\n {props.dislike}\n {props.edit}\n {props.report}\n </Node>\n </Node>\n </Node>\n );\n};\n\nconst createReviewModal = (props: IReviewModalViewProps, moduleProps: IModuleProps): JSX.Element => {\n return (\n <Module {...props.modal} {...moduleProps}>\n {props.modalHeader}\n <Node {...props.modalBody}>\n <Node {...props.form}>\n <Node {...props.inputRow}>\n {props.rating}\n {props.ratingLabel}\n </Node>\n <Node {...props.inputRow}>\n {props.titleLabel}\n {props.titleInput}\n </Node>\n <Node {...props.inputRow}>\n {props.textLabel}\n {props.textInput}\n </Node>\n {props.privacyPolicyUrl}\n {props.error}\n </Node>\n </Node>\n <Node {...props.modalFooter}>\n {props.submitButton}\n {props.cancelButton}\n </Node>\n </Module>\n );\n};\n\nconst createReportModal = (props: IReportReviewModalViewProps, state: IReviewsListState): JSX.Element => {\n return (\n <Node {...props.modal}>\n <Node {...props.modalHeader}>\n {state.reported ? props.headerSubmitted : props.header}\n </Node>\n <Node {...props.modalBody}>\n {state.reported ? props.reportSubmittedMessage : [props.reportMessage, props.radioButtons, props.error]}\n </Node>\n <Node {...props.modalFooter}>\n {state.reported ? props.succesfulButton : [props.submitButton, props.cancelButton]}\n </Node>\n </Node>\n );\n};\n\nexport default ReviewsListview;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './get-product-reviews';\nexport * from './get-user-review';\nexport * from './inputs/get-product-reviews-input';\nexport * from './inputs/get-user-review-input';\nexport * from './inputs/report-review-concern-input';\nexport * from './inputs/submit-helpfulness-vote-input';\nexport * from './inputs/submit-user-review-input';\nexport * from './inputs/submit-user-review-input-data';\nexport * from './ratings-reviews-state-data-action';\nexport * from './report-review-concern';\nexport * from './submit-helpfulness-vote';\nexport * from './submit-user-review';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface IAlertProps {\n message: string;\n}\n\nconst CheckoutAlert: React.FC<IAlertProps> = ({ message }) => (\n <p className='ms-checkout__error-message' role='alert' aria-live='assertive'>\n {message}\n </p>\n);\n\nexport default CheckoutAlert;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IWishlistItemViewProps } from '../..';\nimport { IWishlistItemsViewProps } from './wishlist-items';\n\nconst WishlistItemsView: React.FC<IWishlistItemsViewProps> = props => {\n const { WishlistItems, status, statusMessage, heading, Products, products, Product, ProductDetails, ProductDimensions, telemetryContent } = props;\n\n return (\n <Module {...WishlistItems}>\n {heading}\n {status !== 'SUCCESS' && statusMessage}\n { Products && products && products.length > 0 &&\n <Node {...Products}>\n {products && products.map((product) => {\n return _renderItem(product, Product, ProductDimensions, ProductDetails, telemetryContent);\n })}\n </Node>}\n </Module>\n );\n};\n\nconst _renderItem = (product: IWishlistItemViewProps, Product?: INodeProps, ProductDimensions?: INodeProps, ProductDetails?: INodeProps, telemetryContent?: ITelemetryContent): JSX.Element | null => {\n\n const { key, productImage, productLink, productPrice, productDimensions, addToCartButton, removeButton,\n productStatusMessage, entireProductLink, productName, productAriaLabel, inventoryInformation, productUnitOfMeasure } = product;\n const payLoad = getPayloadObject('click', telemetryContent!, '', key);\n const productAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\n if (entireProductLink) {\n return (\n <Node key={key} className={Product!.className} {...Product}>\n <Node\n href={entireProductLink} className={classnames('entire-product-link ', ProductDetails!.className)} {...productAttributes}\n aria-label={productAriaLabel} tag={ProductDetails!.tag}>\n {productImage}\n {productName}\n {productDimensions && ProductDimensions &&\n <Node {...ProductDimensions}>\n {\n productDimensions.map((dimension) => {\n return dimension;\n })\n }\n </Node>}\n {productPrice}\n {productUnitOfMeasure}\n </Node>\n {inventoryInformation}\n {addToCartButton}\n {removeButton}\n {productStatusMessage}\n </Node>\n );\n }\n return (\n <Node key={key} className={Product!.className} {...Product}>\n { productImage }\n { productLink }\n { productDimensions && ProductDimensions &&\n <Node {...ProductDimensions}>\n {\n productDimensions.map((dimension) => {\n return dimension;\n })\n }\n </Node>}\n { productPrice }\n { addToCartButton }\n { removeButton }\n { productStatusMessage }\n </Node>\n );\n\n};\n\nexport default WishlistItemsView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddResource, ICheckoutGiftCardViewProps, IForm, IItem, IList, IShowResource } from './checkout-gift-card';\n\nexport const From: React.FC<IForm> = ({ formProps, label, inputPinLabel, inputExpLabel, alert, inputProps, inputNumProps,\n inputPinProps, inputExpProps, inputNumber, inputPin, inputExp, applyButton, supportExternalGiftCard, showGiftCardPinInput, showGiftCardExpInput, alertFieldLabel }) => (\n <Node {...formProps}>\n {alert}\n {supportExternalGiftCard ? <Node {...inputProps}>\n <Node {...inputNumProps}>\n {label}\n {inputNumber}\n </Node>\n {showGiftCardPinInput &&\n <Node {...inputPinProps}>\n {inputPinLabel}\n {inputPin}\n </Node>}\n {showGiftCardExpInput &&\n <Node {...inputExpProps}>\n {inputExpLabel}\n {inputExp}\n </Node>}\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\n </Node> : <>\n {label}\n {inputNumber}\n </>}\n {applyButton}\n </Node>\n);\n\nexport const SelectedGiftCard: React.FC<IItem> = ({ itemProps, selectedGiftCard, removeButton }) => (\n <Node {...itemProps}>\n {selectedGiftCard}\n {removeButton}\n </Node>\n);\n\nexport const GiftCardList: React.FC<IList> = ({ listProps, list }) => (\n <Node {...listProps}>\n {list.map(({ id, ...item }) => (\n <SelectedGiftCard key={id} {...item} />\n ))}\n </Node>\n);\n\nexport const AddResource: React.FC<IAddResource> = ({ form, list }) => (\n <>\n {form && <From {...form} />}\n {list && <GiftCardList {...list} />}\n </>\n);\n\nexport const ShowResource: React.FC<IShowResource> = ({ title, list }) => (\n <>\n {title}\n {list && <GiftCardList {...list} />}\n </>\n);\n\nconst CheckoutGiftCardView: React.FC<ICheckoutGiftCardViewProps> = props => {\n const { checkoutGiftCardProps, showGiftCard, addGiftCard } = props;\n return (\n <Module {...checkoutGiftCardProps}>\n {showGiftCard && <ShowResource {...showGiftCard} />}\n {addGiftCard && <AddResource {...addGiftCard} />}\n </Module>\n );\n};\n\nexport default CheckoutGiftCardView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\ninterface ILink {\n className?: string;\n text?: string;\n href?: string;\n ariaLabel?: string;\n}\n\nexport const Link: React.FC<ILink> = ({ text, className, href, ariaLabel }) => (<a className={className} href={href} aria-label={ariaLabel}>\n {' '}\n {text}\n {' '}\n</a>);\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\nimport { ProductDimensionsMatrix } from '@msdyn365-commerce/components';\nimport { RichTextComponent } from '@msdyn365-commerce/core';\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions, IDimensionsApp } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Collapse, IModuleProps, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IBulkPurchaseData } from './bulk-purchase.data';\nimport { IBulkPurchaseProps } from './bulk-purchase.props.autogenerated';\n\n/**\n * Additional optional props for the bulk purchase.\n */\nexport interface IBulkPurchaseExtendedProps extends IBulkPurchaseProps<IBulkPurchaseData> {\n productDimensions?: IProductDimensionsWithAvailabilitiesFull[];\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseViewProps extends IBulkPurchaseProps<IBulkPurchaseData> {\n container: IModuleProps;\n content: React.ReactElement;\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseState {\n isExpanded: boolean;\n}\n\n/**\n * Bulk-purchase module.\n */\nexport class BulkPurchase extends React.PureComponent<IBulkPurchaseExtendedProps, IBulkPurchaseState> {\n public static readonly className = 'ms-bulk-purchase';\n\n public constructor(props: IBulkPurchaseExtendedProps) {\n super(props);\n\n this.state = {\n isExpanded: false\n };\n }\n\n public render(): React.ReactElement | null {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const hasDimensionsInData = ArrayExtensions.hasElements(this.props.data.productDimensions?.result);\n if (!hasDimensionsInProps && !hasDimensionsInData) {\n return null;\n }\n\n const viewProps: IBulkPurchaseViewProps = {\n ...this.props,\n container: {\n moduleProps: this.props,\n className: classnames(BulkPurchase.className, this.props.config.className)\n },\n content: this._renderCollapseContent(`${BulkPurchase.className}__content`)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _renderCollapseContent(className: string): React.ReactElement {\n return (\n <div className={className}>\n {this._renderCollapseButton(`${className}__collapse-button`)}\n {this._renderCollapse(`${className}__collapse`)}\n </div>\n );\n }\n\n private _renderCollapseButton(className: string): React.ReactElement {\n return (\n <Button\n className={className}\n onClick={this._toggleCollapse}\n aria-expanded={this.state.isExpanded}\n title={this.props.resources.bulkPurchaseHeaderTitle}\n >\n {this.props.resources.bulkPurchaseHeaderTitle}\n </Button>\n );\n }\n\n private _renderCollapse(className: string): React.ReactElement {\n return (\n <Collapse\n className={className}\n isOpen={this.state.isExpanded}\n >\n {this._renderMainContent(`${className}__main-content`)}\n </Collapse>\n );\n }\n\n private _renderMainContent(className: string): React.ReactElement {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n return (\n <div className={className}>\n {\n !isMobileDevice &&\n <div className={`${className}__description`}>\n <RichTextComponent\n text={this.props.resources.bulkPurchaseDescriptionText}\n />\n </div>\n }\n {this._renderMatrix(`${className}__matrix-container`)}\n </div>\n );\n }\n\n private _renderMatrix(className: string): React.ReactElement {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n\n return (\n <ProductDimensionsMatrix\n className={className}\n context={this.props.context as ICoreContext<IDimensionsApp>}\n data={{\n dimensions: hasDimensionsInProps ? this.props.productDimensions! : this.props.data.productDimensions!.result!,\n orderTemplates: this.props.data.orderTemplates?.result,\n customerInformation: this.props.data.customerInformation?.result\n }}\n resources={this.props.resources}\n />\n );\n }\n\n /**\n * Callback which toggles collapse mode.\n */\n private readonly _toggleCollapse = () => {\n this.setState(state => ({\n isExpanded: !state.isExpanded\n }));\n };\n}\n\nexport default BulkPurchase;\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\n/* eslint-disable no-duplicate-imports */\r\nimport { IInvoiceSummaryLines } from '@msdyn365-commerce-modules/invoice-payment-summary';\r\nimport { IOrderSummaryLines } from '@msdyn365-commerce-modules/order-summary-utilities';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICartViewProps, IOrderSummaryErrors } from './poc-cart';\r\nimport { ICartlinesViewProps } from './components/poc-cart-line-items';\r\nimport { ICartLineItemViewProps } from './components/poc-cart-line-items-promotion';\r\n\r\nconst _renderCartlines = (\r\n cartLines: ICartlinesViewProps[] | undefined,\r\n cartEmptyText: string,\r\n CartlinesWrapper: INodeProps,\r\n storeSelector: React.ReactNode | undefined,\r\n backToShoppingButton: React.ReactNode,\r\n waitingComponent: React.ReactNode,\r\n cartLoadingStatus: string,\r\n cartDataResult: boolean\r\n): JSX.Element[] | JSX.Element => {\r\n if (cartLoadingStatus) {\r\n return <>{cartLoadingStatus}</>;\r\n }\r\n if (cartLines) {\r\n return cartLines.map(cartLine => {\r\n return (\r\n <div className='msc-cart-lines-item' key={cartLine.cartlineId}>\r\n {cartLine.cartline}\r\n {storeSelector && cartLine.pickUpInStore ? (\r\n <Node {...cartLine.pickUpInStore.ContainerProps}>{cartLine.pickUpInStore.defaultComponent}</Node>\r\n ) : null}\r\n {cartLine.addToOrderTemplate ? (\r\n <Node className='msc-cart-line__extra-actions'>\r\n {cartLine.remove}\r\n {cartLine.addToWishlist}\r\n {cartLine.addToOrderTemplate}\r\n {/* Experlogix components */}\r\n {cartLine.experlogixModify}\r\n </Node>\r\n ) : (\r\n <>\r\n {cartLine.remove}\r\n {cartLine.addToWishlist}\r\n {/* Experlogix components */}\r\n {cartLine.experlogixModify}\r\n </>\r\n )}\r\n </div>\r\n );\r\n });\r\n }\r\n return cartDataResult ? (\r\n <div className='msc-cart__empty-cart'>\r\n <p className='msc-cart-line'>{cartEmptyText}</p>\r\n {backToShoppingButton}\r\n </div>\r\n ) : (\r\n <>{waitingComponent}</>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render error block.\r\n * @param errorData -The order summary errors interface.\r\n * @returns Jsx element.\r\n */\r\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\r\n if (!errorData || ArrayExtensions.hasElements(errorData.errors)) {\r\n return null;\r\n }\r\n return (\r\n <Node {...errorData.Wrapper}>\r\n {errorData.header}\r\n {errorData.errors}\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render invoice summary lines.\r\n * @param invoiceSummaryLines -The invoicesummary lines interface.\r\n * @param OrderSummaryItems -The order summary items props.\r\n * @param props -The cartview props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderInvoiceSummarylines = (\r\n invoiceSummaryLines: IInvoiceSummaryLines | undefined,\r\n OrderSummaryItems: INodeProps,\r\n props: ICartViewProps\r\n): JSX.Element | null => {\r\n if (!invoiceSummaryLines) {\r\n props.context.telemetry.error('InvoiceSummary content is empty, module wont render');\r\n return null;\r\n }\r\n return (\r\n <Node {...OrderSummaryItems}>\r\n {invoiceSummaryLines.invoices}\r\n {invoiceSummaryLines.giftCard}\r\n {invoiceSummaryLines.loyalty}\r\n {invoiceSummaryLines.orderTotal}\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render order summary lines.\r\n * @param orderSummaryLines -The ordersummary lines interface.\r\n * @param OrderSummaryItems -The order summary items props.\r\n * @param props -The cartview props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderOrderSummarylines = (\r\n orderSummaryLines: IOrderSummaryLines | undefined,\r\n OrderSummaryItems: INodeProps,\r\n props: ICartViewProps\r\n): JSX.Element | null => {\r\n if (!orderSummaryLines) {\r\n props.context.telemetry.error('OrderSummary content is empty, module wont render');\r\n return null;\r\n }\r\n return (\r\n <Node {...OrderSummaryItems}>\r\n {props.promoCode}\r\n {orderSummaryLines.subtotal}\r\n {orderSummaryLines.shipping}\r\n {orderSummaryLines.otherCharge}\r\n {orderSummaryLines.tax}\r\n {orderSummaryLines.totalDiscounts ? orderSummaryLines.totalDiscounts : null}\r\n {orderSummaryLines.orderTotal}\r\n </Node>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render cart promotions.\r\n * @param promotions -The cartline item view props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\r\n return (\r\n <>\r\n <Node {...promotions.promotionMessageWrapper}>\r\n {promotions.promotionMessage}\r\n {promotions.promotionSeeAllLink}\r\n {promotions.promotionDialog}\r\n </Node>\r\n </>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines group title.\r\n * @param cartLine -The cartline view props.\r\n * @param titleSeparate -The title separate.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroupTitle = (cartLine: ICartlinesViewProps, titleSeparate: string) => {\r\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\r\n return (\r\n <>\r\n <Node className='msc-cart-lines-group-wraper__bopis-heading-title'>\r\n {isBopisSelected ? (\r\n <p className='msc-cart-lines-group-wraper__bopis-heading-title-st'>\r\n {cartLine.pickUpInStore?.deliveryOption}\r\n {titleSeparate}\r\n {cartLine.pickUpInStore?.orgUnitName}\r\n </p>\r\n ) : null}\r\n </Node>\r\n </>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines groups header title.\r\n * @param pickUpText -The pickup text for group.\r\n * @param shippingText -The shipping text for group.\r\n * @param emailShippingText -The email shipping text for group.\r\n * @param titleSeparate -The title separator.\r\n * @param cartLine -The cartline view props.\r\n * @param emailDeliveryModeCode -The email delivery code from channel.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroupHeader = (\r\n pickUpText: string,\r\n shippingText: string,\r\n emailShippingText: string,\r\n titleSeparate: string,\r\n cartLine: ICartlinesViewProps,\r\n emailDeliveryModeCode?: string\r\n) => {\r\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\r\n let groupTitle: string;\r\n\r\n groupTitle = isBopisSelected ? pickUpText : shippingText;\r\n groupTitle = cartLine.data && cartLine.data.cartline.DeliveryMode === emailDeliveryModeCode ? emailShippingText : groupTitle;\r\n\r\n return (\r\n <>\r\n <div className='msc-cart-lines-group-wraper__bopis-heading'>\r\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}-icon`} />\r\n <p className={`msc-cart-lines-group-wraper__bopis-heading-${groupTitle.toLowerCase()}`}>{groupTitle}</p>\r\n {renderCartLinesGroupTitle(cartLine, titleSeparate)}\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines in groups.\r\n * @param props -The cartline.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroup = (props: ICartViewProps): JSX.Element | undefined => {\r\n if (props.cartLinesGroup && ArrayExtensions.hasElements(props.cartLinesGroup)) {\r\n return (\r\n <div className='msc-cart-lines-group'>\r\n {props.cartLinesGroup.map(cartlines => {\r\n return (\r\n <div key={cartlines[0].cartlineId} className='msc-cart-lines-group-wraper'>\r\n {renderCartLinesGroupHeader(\r\n props.resources.pickUpText,\r\n props.resources.shippingText,\r\n props.resources.emailshippingText,\r\n props.resources.titleSeparate,\r\n cartlines[0],\r\n props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode\r\n )}\r\n {_renderCartlines(\r\n cartlines,\r\n props.resources.emptyCartText,\r\n props.CartlinesWrapper,\r\n props.storeSelector,\r\n props.backToShoppingButton,\r\n props.waitingComponent,\r\n props.cartLoadingStatus,\r\n props.cartDataResult\r\n )}\r\n </div>\r\n );\r\n })}\r\n </div>\r\n );\r\n }\r\n return props.cartDataResult ? (\r\n <div className='msc-cartline-wraper'>\r\n <div className='msc-cart__empty-cart'>\r\n <p className='msc-cart-line'>{props.resources.emptyCartText}</p>\r\n {props.backToShoppingButton}\r\n </div>\r\n </div>\r\n ) : (\r\n <>{props.waitingComponent}</>\r\n );\r\n};\r\n\r\nconst CartView: React.FC<ICartViewProps> = (props: ICartViewProps) => (\r\n <div className={props.className} id={props.id} {...props.renderModuleAttributes(props)}>\r\n {props.title}\r\n {!props.cart?.hasInvoiceLine && props.promotionOptions && _renderPromotions(props.promotionOptions)}\r\n {props.multiplePickUpEnabled ? (\r\n renderCartLinesGroup(props)\r\n ) : (\r\n <Node {...props.CartlinesWrapper}>\r\n {_renderCartlines(\r\n props.cartlines,\r\n props.resources.emptyCartText,\r\n props.CartlinesWrapper,\r\n props.storeSelector,\r\n props.backToShoppingButton,\r\n props.waitingComponent,\r\n props.cartLoadingStatus,\r\n props.cartDataResult\r\n )}\r\n </Node>\r\n )}\r\n {props.orderSummaryHeading && (\r\n <Node {...props.OrderSummaryWrapper}>\r\n {props.orderSummaryHeading}\r\n {props.cart?.hasInvoiceLine\r\n ? _renderInvoiceSummarylines(props.invoiceSummaryLineitems, props.OrderSummaryItems, props)\r\n : _renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props)}\r\n {_renderErrorBlock(props.OrderSummaryErrors)}\r\n {props.checkoutAsSignInUserButton}\r\n {props.checkoutAsGuestButton}\r\n {props.backToShoppingButton}\r\n {props.createTemplateFromCartButton}\r\n </Node>\r\n )}\r\n {props.storeSelector}\r\n </div>\r\n);\r\n\r\nexport default CartView;\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { TelemetryEvent } from '@msdyn365-commerce/core';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\ninterface ICheckoutPlaceOrderButtonProps {\n canPlaceOrder: boolean;\n checkoutBtnText: string;\n telemetryContent?: ITelemetryContent;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n isPlaceOrderLoading?: boolean;\n isExpressCheckoutApplied?: boolean;\n placeOrder(): Promise<void>;\n}\n\nconst buttonsStates: React.Dispatch<React.SetStateAction<boolean>>[] = [];\n\n/**\n * On place order function.\n * @param isBusy -Check is busy.\n * @param canPlaceOrder -Check can place order.\n * @param placeOrder -Place order function.\n * @returns Set state of button.\n */\nconst onPlaceOrderHandler = (isBusy: boolean, canPlaceOrder: boolean, placeOrder: () => Promise<void>) => async () => {\n if (isBusy || !canPlaceOrder) {\n return;\n }\n buttonsStates.map(buttonSetState => {\n buttonSetState(true);\n return true;\n });\n await placeOrder();\n buttonsStates.map(buttonSetState => {\n buttonSetState(false);\n return true;\n });\n};\n\nconst CheckoutPlaceOrderButton: React.FC<ICheckoutPlaceOrderButtonProps> = ({\n checkoutBtnText, canPlaceOrder, placeOrder, telemetryContent,\n shouldEnableSinglePaymentAuthorizationCheckout, isPlaceOrderLoading, isExpressCheckoutApplied }) => {\n const [isBusy, setIsBusy] = useState(false);\n buttonsStates.push(setIsBusy);\n const payload = getPayloadObject(TelemetryEvent.Purchase, telemetryContent!, checkoutBtnText, '');\n const attributes = getTelemetryAttributes(telemetryContent!, payload);\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && !isExpressCheckoutApplied) {\n return (\n <Button\n className={classnames('ms-checkout__btn-place-order', { 'is-busy': isPlaceOrderLoading ?? false })}\n color='primary'\n onClick={placeOrder}\n title={checkoutBtnText}\n {...attributes}\n disabled={!canPlaceOrder || isPlaceOrderLoading}\n >\n {checkoutBtnText}\n </Button>\n );\n }\n\n return (\n <Button\n className={classnames('ms-checkout__btn-place-order', { 'is-busy': isBusy })}\n color='primary'\n onClick={onPlaceOrderHandler(isBusy, canPlaceOrder, placeOrder)}\n title={checkoutBtnText}\n {...attributes}\n disabled={!canPlaceOrder || isBusy}\n >\n {checkoutBtnText}\n </Button>\n );\n};\n\nexport default CheckoutPlaceOrderButton;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport withModuleState from './with-module-state';\n\nexport * from './module-state';\nexport * from './module-state.data';\n\nexport { withModuleState };\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ICarouselData } from './carousel.data';\nimport { ICarouselProps } from './carousel.props.autogenerated';\nimport { ICarouselState } from './carousel.state';\n\nexport interface ICarouselViewProps extends ICarouselProps<{}>, ICarouselState {\n closeAnimation: string;\n carouselContainer: IModuleProps;\n telemetryContent: ITelemetryContent;\n next(): void;\n previous(): void;\n onIndicatorsClickHandler(): void;\n handleDismissCarousel(): void;\n handleOnExited(): void;\n handleOnExiting(): void;\n}\n\n/**\n *\n * CarouselModule component.\n * @extends {React.PureComponent<ICarouselProps<ICarouselData>>}\n */\nclass CarouselModule extends React.PureComponent<ICarouselProps<ICarouselData>, ICarouselState> {\n private animating: boolean;\n\n private readonly telemetryContent: ITelemetryContent;\n\n constructor(props: ICarouselProps<ICarouselData>, state: ICarouselState) {\n super(props);\n this.state = { activeIndex: 0, closeNow: false, dismissCarousel: false };\n this.animating = false;\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry);\n }\n\n public componentDidMount(): void {\n if (this.props.context && this.props.context.request && this.props.context.request.cookies) {\n if (this.props.context.request.cookies.get(`CarouselDismiss_${this.props.id}`) === undefined) {\n this.props.context.request.cookies.set(`CarouselDismiss_${this.props.id}`, 'false');\n this.setState({ dismissCarousel: false });\n }\n }\n }\n\n public render(): JSX.Element | null {\n if (this.state.dismissCarousel) {\n return null;\n }\n\n const { className } = this.props.config;\n\n const viewProps = {\n // Context for telemetry and raw data for C1 to do customization\n // Including computed data, state data and methods\n ...this.props,\n ...this.state,\n telemetryContent: this.telemetryContent,\n carouselContainer: {\n moduleProps: this.props,\n className: classnames('ms-carousel', className)\n },\n closeAnimation: this.state.closeNow ? 'close-now' : '',\n next: this._next,\n previous: this._previous,\n onIndicatorsClickHandler: this._goToIndex,\n handleDismissCarousel: this._handleDismissCarousel,\n handleOnExited: this._onExited,\n handleOnExiting: this._onExiting };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Function implementation to dismiss the Carousel.\n */\n private readonly _handleDismissCarousel = (): void => {\n if (this.props.context && this.props.context.request && this.props.context.request.cookies) {\n this.props.context.request.cookies.set(`CarouselDismiss_${this.props.id}`, 'true');\n this.setState({ dismissCarousel: true });\n }\n };\n\n /**\n * Function implementation to move to next slide.\n */\n private readonly _next = (): void => {\n const { slots } = this.props;\n const nextIndex = this.state.activeIndex === (slots && slots.content && slots.content.length - 1) ? 0 : this.state.activeIndex + 1;\n\n if (this.animating) {\n this.setState({ closeNow: true, activeIndex: nextIndex });\n } else {\n this.setState({ activeIndex: nextIndex });\n }\n };\n\n /**\n * Function implementation to move to previous slide.\n */\n private readonly _previous = (): void => {\n const slots = this.props.slots && this.props.slots.content;\n const nextIndex = this.state.activeIndex === 0 ? (slots ? slots.length - 1 : 0) : this.state.activeIndex - 1;\n\n if (this.animating) {\n this.setState({ closeNow: true, activeIndex: nextIndex });\n } else {\n this.setState({ activeIndex: nextIndex });\n }\n };\n\n private readonly _onExiting = (): void => {\n this.animating = true;\n };\n\n private readonly _onExited = (): void => {\n this.animating = false;\n this.setState({ closeNow: false });\n };\n\n /**\n * Function implementation to move to a given slide.\n * @param newIndex\n */\n private readonly _goToIndex = (newIndex: number): void => {\n if (this.animating) {\n return;\n }\n this.setState({ activeIndex: newIndex });\n };\n}\n\nexport default CarouselModule;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IHistogramItemViewProps } from './component/components';\nimport { IRatingsHistogramViewProps } from './ratings-histogram';\n\nconst RatingsHistogramView: React.FC<IRatingsHistogramViewProps> = props => {\n const { heading, histogramItems, histogramProps, moduleProps } = props;\n\n return (\n <Module {...moduleProps}>\n {heading}\n <Node {...histogramProps}>\n {histogramItems.map(item => {\n return histogramItem(item);\n })}\n </Node>\n </Module>\n );\n};\n\nconst histogramItem = (props: IHistogramItemViewProps) => {\n return (\n <Node {...props.buttonProps} >\n {props.starLabel}\n {props.bar}\n {props.percentage}\n </Node>\n );\n};\n\nexport default RatingsHistogramView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport getCollectionProducts, {\n GetFullProductsByCollectionInput, IFullProductsSearchResultsWithCount, ProductListInventoryFilteringOptions\n} from './get-full-products-by-collection';\nimport getMappedSearchConfiguration, { MappedSearchConfiguration, MappedSearchInput, sortOptions } from './get-mapped-search-configuration';\nimport getCollectionRefinersAction, { RefinersByCollectionInput } from './get-refiners-for-collection';\n\nexport * from './base-collection-action';\nexport * from './url-utils';\n\nexport {\n getCollectionProducts,\n getCollectionRefinersAction,\n GetFullProductsByCollectionInput,\n getMappedSearchConfiguration,\n IFullProductsSearchResultsWithCount,\n MappedSearchConfiguration,\n MappedSearchInput,\n ProductListInventoryFilteringOptions,\n RefinersByCollectionInput,\n sortOptions\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport get from 'lodash/get';\nimport * as React from 'react';\n\nimport { ICheckoutData } from '../checkout.data';\nimport { ICheckoutProps } from '../checkout.props.autogenerated';\n\nexport interface IOrderSummary {\n orderSummaryProps: INodeProps;\n heading?: React.ReactNode;\n lines?: IOrderSummaryLines;\n}\nexport const getOrderSummary = (input: ICheckoutProps<ICheckoutData>): IOrderSummary => {\n const {\n config: { orderSummaryHeading },\n data: { checkout },\n resources: {\n subTotalLabel,\n shippingLabel,\n taxLabel,\n orderTotalLabel,\n loyaltyLabel,\n giftcardLabel,\n totalDiscountsLabel,\n freeText,\n toBeCalculatedText,\n otherCharges\n },\n context,\n typeName,\n id,\n telemetry\n } = input;\n\n const checkoutState = get(checkout, 'result');\n const cart = get(checkout, 'result.checkoutCart.cart');\n const showLineItems = cart.CartLines && cart.CartLines.length > 0;\n const channelConfiguration = context.request.channel!;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = input.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const handleOrderSummaryHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\n const {\n config: { orderSummaryHeading }\n } = input;\n orderSummaryHeading!.text = event.target.value;\n };\n\n return {\n orderSummaryProps: { className: 'ms-checkout-guest-profile__selected-item' },\n heading: orderSummaryHeading && orderSummaryHeading.text && (\n <Msdyn365.Text\n className='msc-order-summary__heading'\n {...orderSummaryHeading}\n tag={orderSummaryHeading.tag || 'h2'}\n text={orderSummaryHeading.text}\n editProps={{ onEdit: handleOrderSummaryHeadingChange, requestContext: context.request }}\n />\n ),\n lines: showLineItems ? OrderSummary({\n checkoutState,\n cart,\n subTotalLabel,\n shippingLabel,\n taxLabel,\n orderTotalLabel,\n loyaltyLabel,\n giftcardLabel,\n totalDiscountsLabel,\n freeText,\n toBeCalculatedText,\n context,\n typeName,\n id,\n channelConfiguration,\n telemetry,\n otherChargeLabel: otherCharges,\n retailMultiplePickUpOptionEnabled,\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result\n }) : undefined\n };\n\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport * from './checkout';\nexport * from './empty-active-cart';\nexport * from './place-order';\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport RatingsHistogram from './ratings-histogram';\nimport RatingsHistogramView from './ratings-histogram.view';\n\nexport * from './component/components';\nexport * from './ratings-histogram';\nexport * from './ratings-histogram.data';\nexport { IRatingsHistogramConfig, IRatingsHistogramProps, IRatingsHistogramResources } from './ratings-histogram.props.autogenerated';\nexport * from './ratings-histogram.view';\n\nexport {\n RatingsHistogram,\n RatingsHistogramView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n Button,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader\n} from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface ISearchResultModalViewProps {\n modal: React.ReactElement;\n modalHeader: React.ReactElement;\n modalFooter: React.ReactElement;\n modalBody: React.ReactElement;\n}\n\ninterface IModalToggleProps {\n innerRef: React.RefObject<HTMLButtonElement> | undefined;\n id: string;\n text: string;\n ariaLabel: string;\n onClick(): void;\n}\n\nexport interface ISearchResultModalResources {\n modalTitle: string;\n modalCloseButtonText: string;\n}\n\nexport interface ISearchResultModalProps {\n resources: ISearchResultModalResources;\n isOpen: boolean;\n returnRef: React.RefObject<HTMLButtonElement> | undefined;\n onModalToggle(): void;\n}\n\nexport const ModalToggle: React.FC<IModalToggleProps> = (props: IModalToggleProps) => {\n const { text, onClick, ariaLabel, innerRef, id } = props;\n return (<button\n id={id} className='msc-button' aria-label={ariaLabel}\n onClick={onClick} ref={innerRef}>\n {text}\n </button>);\n};\n\nexport const SearchResultModal = (props: ISearchResultModalProps): ISearchResultModalViewProps => {\n return {\n modal: modalNode(props),\n modalHeader: modalHeaderNode(props),\n modalFooter: modalFooterNode(props),\n modalBody: <ModalBody className='msc-review-modal-body' />\n };\n};\n\nconst modalNode = (props: ISearchResultModalProps) => {\n return (\n <Modal\n autoFocus\n applicationNode='renderPage'\n returnFocusRef={props.returnRef}\n isOpen={props.isOpen}\n toggle={props.onModalToggle}\n className='msc-search-result-modal'\n zIndex={1050}\n />\n );\n};\n\nconst modalHeaderNode = (props: ISearchResultModalProps) => {\n return (\n <ModalHeader toggle={props.onModalToggle}>\n {props.resources.modalTitle}\n </ModalHeader>\n );\n};\n\nconst modalFooterNode = (props: ISearchResultModalProps) => {\n return (\n <ModalFooter>\n <Button onClick={props.onModalToggle} className='ms-sort-and-filter-modal-close'>\n {props.resources.modalCloseButtonText}\n </Button>\n </ModalFooter>\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IForm, IItem } from './components';\nimport { IGiftCardBalanceCheckViewProps } from './gift-card-balance-check';\n\nexport const Form: React.FC<IForm> = ({ formProps, label, inputPinLabel, inputExpLabel, alert, inputProps, inputNumProps,\n inputPinProps, inputExpProps, inputNumber, inputPin, inputExp, applyButton, supportExternalGiftCard, showGiftCardPinInput, showGiftCardExpInput, alertFieldLabel }) => (\n <Node {...formProps}>\n {alert}\n {supportExternalGiftCard ? <Node {...inputProps}>\n <Node {...inputNumProps}>\n {label}\n {inputNumber}\n </Node>\n {showGiftCardPinInput &&\n <Node {...inputPinProps}>\n {inputPinLabel}\n {inputPin}\n </Node>}\n {showGiftCardExpInput &&\n <Node {...inputExpProps}>\n {inputExpLabel}\n {inputExp}\n </Node>}\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\n </Node> : <>\n {label}\n {inputNumber}\n </>}\n {applyButton}\n </Node>\n);\n\nexport const Item: React.FC<IItem> = ({ itemProps, selectedGiftCard }) => (\n <Node {...itemProps}>\n {selectedGiftCard}\n </Node>\n);\n\nconst GiftCardBalanceCheckView: React.FC<IGiftCardBalanceCheckViewProps> = props => {\n const { giftCardBalanceCheckProps, form, item } = props;\n return (\n <Module {...giftCardBalanceCheckProps}>\n {form && <Form {...form} />}\n {item && <Item {...item} />}\n </Module>\n );\n};\n\nexport default GiftCardBalanceCheckView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICoreContext, IGridSettings, IImageData, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchResultContainerResources } from '../search-result-container.props.autogenerated';\n\n// Import { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\n\ninterface IFeatureSearchResultItem {\n product: SimpleProduct | null;\n context: ICoreContext;\n resources: ISearchResultContainerResources;\n imageSettings?: IImageSettings;\n moduleType: string;\n moduleId: string;\n telemetryContent?: ITelemetryContent;\n recommendation?: string;\n}\n\nexport const FeatureSearchResultItem: React.FC<IFeatureSearchResultItem> = ({\n product,\n context,\n imageSettings,\n resources,\n telemetryContent,\n recommendation\n}) => {\n if (product === null) {\n return null;\n }\n\n const productName = product.Name;\n const productRecordId = product && product.RecordId ? product.RecordId : 0;\n const productUrl = getProductPageUrlSync(product.Name || '', productRecordId, context && context.actionContext, undefined);\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\n const heading = recommendation && recommendation === 'descriptions' ? resources.featureSimilarDescriptionTitle : resources.featureSimilarLooksTitle;\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, productName!, productRecordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n <div className='ms-feature-search-result__item'>\n <a\n href={productUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)} {...attribute}\n aria-label={product.Name}>\n <div className='msc-feature-search-result__item__image'>\n {renderProductPlacementImage(\n imageSettings, context.request.gridSettings, product.PrimaryImageUrl,\n product.Name, fallbackImage, context.actionContext.requestContext)}\n </div>\n </a>\n <div className='msc-feature-search-result__item__detail'>\n <p className='msc-feature-search-result__item__heading'>\n {heading}\n </p>\n {renderProductTitle(product?.Name)}\n </div>\n </div>\n );\n\n};\n\nfunction renderProductPlacementImage(\n imageSettings?: IImageSettings, gridSettings?: IGridSettings, imageUrl?: string,\n altText?: string, fallbackImage?: string, context?: IRequestContext): JSX.Element | null {\n\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n const img: IImageData = {\n src: imageUrl,\n altText: altText ? altText : ''\n };\n const imageProps = {\n gridSettings,\n imageSettings,\n fallBackSrc: fallbackImage\n };\n return (\n <Image\n {...img} {...imageProps} loadFailureBehavior='empty'\n requestContext={context}\n />\n );\n}\n\nfunction renderProductTitle(title?: string): JSX.Element | null {\n return (<h1 className='msc-feature-search-result__item__product-title'>\n {title}\n </h1>);\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Heading as HeadingType } from '@msdyn365-commerce-modules/data-types';\nimport { Button, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport * as React from 'react';\n\nexport interface ICheckoutGuidedCardProps {\n step: number;\n title?: HeadingType;\n disabled?: boolean; // Module is not available\n isActive?: boolean; // Step === currentStep\n isVisted?: boolean; // Step < currentStep\n isExpanded?: boolean;\n isReady?: boolean;\n isPending?: boolean;\n isUpdating?: boolean;\n isSubmitting?: boolean;\n isCancelAllowed?: boolean;\n isMobile?: boolean;\n hasInitialized?: boolean;\n hasControlGroup?: boolean;\n children: React.ReactNode;\n resource: {\n checkoutStepTitleFormat: string;\n saveBtnLabel: string;\n changeBtnLabel: string;\n cancelBtnLabel: string;\n saveAndContinueBtnLabel: string;\n };\n telemetryContent?: ITelemetryContent;\n onEdit?(): void;\n onCancel?(): void;\n onSubmit?(): void;\n onNext(): void;\n}\n\n/**\n *\n * CheckoutGuidedCard component.\n * @extends {React.Component<ICheckoutGuidedCardProps>}\n */\nclass CheckoutGuidedCard extends React.PureComponent<ICheckoutGuidedCardProps> {\n private readonly editButtonRef: React.RefObject<HTMLButtonElement> = React.createRef();\n\n private readonly formCardRef: React.RefObject<HTMLDivElement> = React.createRef();\n\n private readonly payLoad: IPayLoad;\n\n constructor(props: ICheckoutGuidedCardProps) {\n super(props);\n this.payLoad = getPayloadObject('click', props.telemetryContent!, '');\n }\n\n public componentDidUpdate(prevProps: ICheckoutGuidedCardProps): void {\n /**\n * Move to next step when current step is ready.\n */\n const { isActive, isReady, onNext, isVisted, onEdit } = this.props;\n\n // Move to next step after completing the current step\n if (isActive && isReady) {\n onNext();\n }\n\n // Set the focus to Edit button once edit button appear\n // (It happens when current step switch to isReady status)\n const prevCanEdit = prevProps.isReady && prevProps.isVisted && !!prevProps.onEdit;\n const canEdit = isReady && isVisted && !!onEdit;\n if (!prevCanEdit && canEdit) {\n this.focusOnEditButton();\n this.scrollToTitle();\n }\n\n // Set the focus to the first focusable element\n // (It happens when current step switch to isUpdating status)\n if (prevProps.isReady && !isReady) {\n this.focusOnFirstFocusableElement();\n }\n }\n\n public render(): JSX.Element | null {\n const {\n title,\n disabled,\n isExpanded,\n isActive,\n isVisted,\n children,\n isReady,\n isPending,\n isUpdating,\n hasInitialized,\n hasControlGroup,\n onEdit,\n resource\n } = this.props;\n const { changeBtnLabel } = resource;\n\n this.payLoad.contentAction.etext = TelemetryConstant.CheckoutChange;\n const changeBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n const canEdit = hasControlGroup && isReady && isVisted && onEdit;\n\n return (\n <div\n className={classname('ms-checkout__guided-card', {\n active: isActive,\n expanded: isExpanded,\n closed: !isExpanded,\n visted: isVisted,\n hidden: disabled,\n initialized: hasInitialized,\n disabled,\n ready: isReady,\n pending: isPending,\n updating: isUpdating\n })}\n ref={this.formCardRef}\n >\n <div className='ms-checkout__guided-card-header'>\n {this.getTitle()}\n\n {canEdit && (\n <Button\n innerRef={this.editButtonRef}\n className='ms-checkout__guided-card-btn-edit'\n title={changeBtnLabel}\n color='link'\n onClick={onEdit}\n role='link'\n aria-label={title && title.text ? `${changeBtnLabel} ${title.text}` : ''}\n {...changeBtnAttributes}\n >\n {changeBtnLabel}\n </Button>\n )}\n </div>\n\n <div\n className={classname('ms-checkout__guided-card-body', {\n hidden: !isExpanded\n })}\n >\n <div className='ms-checkout__guided-card-content'>\n {children}\n </div>\n\n {this.renderFooder()}\n </div>\n </div>\n );\n }\n\n private readonly renderFooder = (): JSX.Element | null => {\n const { isVisted, isReady, isSubmitting, isCancelAllowed, hasControlGroup, onCancel, onSubmit, resource } = this.props;\n const { saveBtnLabel, cancelBtnLabel, saveAndContinueBtnLabel } = resource;\n\n const canSubmit = !isReady && onSubmit;\n const canCancel = !isReady && isVisted && isCancelAllowed && onCancel;\n\n if (!hasControlGroup || (!canSubmit && !canCancel)) {\n return null;\n }\n\n this.payLoad.contentAction.etext = isVisted ? TelemetryConstant.Save : TelemetryConstant.SaveContinue;\n const saveBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n this.payLoad.contentAction.etext = TelemetryConstant.Cancel;\n const cancelBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <div className='ms-checkout__guided-card-footer'>\n {canSubmit && (\n <Button\n className={classname('ms-checkout__guided-card-btn-save', { 'is-submitting': isSubmitting })}\n title={isVisted ? saveBtnLabel : saveAndContinueBtnLabel}\n color='primary'\n disabled={isSubmitting}\n onClick={onSubmit}\n {...saveBtnAttributes}\n >\n {isVisted && isCancelAllowed ? saveBtnLabel : saveAndContinueBtnLabel}\n </Button>\n )}\n {canCancel && (\n <Button\n className='ms-checkout__guided-card-btn-cancel'\n title={cancelBtnLabel}\n color='secondary'\n onClick={onCancel}\n {...cancelBtnAttributes}\n >\n {cancelBtnLabel}\n </Button>\n )}\n </div>\n );\n };\n\n private readonly focusOnFirstFocusableElement = (): void => {\n const node = this.formCardRef.current as HTMLElement;\n const focussableElements = `\n a:not([disabled]),\n button:not([disabled]),\n input[type=submit]:not([disabled]),\n input[type=checkbox]:not([disabled]),\n input[type=text]:not([disabled]),\n input[type=radio]:not([disabled]),\n input[type=password]:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n [tabindex]:not([disabled]):not([tabindex=\"-1\"])\n `;\n\n const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);\n child && child.focus && child.focus();\n };\n\n private readonly focusOnEditButton = (): void => {\n // Focus on edit button\n const editButton =\n this.editButtonRef &&\n this.editButtonRef.current &&\n this.editButtonRef.current.focus &&\n (this.editButtonRef.current as HTMLElement);\n editButton && editButton.focus();\n };\n\n private readonly scrollToTitle = (): void => {\n // Scroll window to the title of the step that was just completed only in mobile viewport\n const formCard = this.props.isMobile && this.formCardRef && this.formCardRef.current && (this.formCardRef.current as HTMLElement);\n formCard && formCard.scrollIntoView();\n };\n\n private readonly getTitle = (): JSX.Element => {\n const { step, title } = this.props;\n const { headingTag: Tag = 'h2', text = '' } = title || {};\n return (\n <Tag className='ms-checkout__guided-card-title'>\n <span className='ms-checkout__guided-card-title-step'>\n {step + 1}\n .\n {' '}\n </span>\n {text && <span className='ms-checkout__guided-card-title-text'>\n {text}\n </span>}\n </Tag>\n );\n };\n}\n\nexport default CheckoutGuidedCard;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a autosuggest.\n */\nexport class SearchState {\n @observable public searchText?: string;\n\n @observable public defaultBasicSearchUrl?: string;\n\n @observable public searchQueryStringParameter?: string;\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\nimport {\n CacheType, createObservableDataAction, getCatalogId, IAction, IActionContext, IActionInput,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { SearchSuggestion, SearchSuggestionCriteria } from '@msdyn365-commerce/retail-proxy';\nimport {\n getSearchSuggestionsAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\n\nexport enum SuggestionType {\n Category = 'ScopedCategory',\n Keyword = 'Keyword',\n Product = 'Product',\n None = 'None'\n}\n\n/**\n * Input class for auto suggest search input.\n */\nexport class AutoSuggestInput implements IActionInput {\n public searchQuery?: string;\n\n public topResultsCount?: number;\n\n public suggestionType?: string;\n\n public hitPrefix?: string;\n\n public hitSuffix?: string;\n\n public constructor(searchText?: string, top?: number, suggestionType?: string, hitPrefix?: string, hitSuffix?: string) {\n this.searchQuery = searchText;\n this.topResultsCount = top;\n this.suggestionType = suggestionType;\n this.hitPrefix = hitPrefix;\n this.hitSuffix = hitSuffix;\n }\n\n public getCacheKey = () => 'AutoSuggestSearchSuggestions';\n\n public getCacheObjectType = () => 'AutoSuggestSearchSuggestions';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new AutoSuggestInput();\n};\n\n/**\n * Calls the Retail API and returns a auto-suggest suggestions.\n * @param input\n * @param ctx\n */\nexport async function getSearchSuggestionsAction(input: AutoSuggestInput, ctx: IActionContext): Promise<Autosuggestions | null> {\n // If no input is provided fail out\n if (!input || !input.searchQuery) {\n throw new Error('[getSearchSuggestionsAction]No valid Input was provided, failing');\n }\n\n const autosuggest: Autosuggestions = {};\n\n const autoSuggestPromises = [_getAutoSuggest(input, autosuggest, ctx)];\n return Promise.all(autoSuggestPromises).then(() => {\n return autosuggest;\n });\n}\n\nasync function _getAutoSuggest(\n input: AutoSuggestInput,\n autosuggest: Autosuggestions,\n ctx: IActionContext\n): Promise<void> {\n const catalogId = getCatalogId(ctx.requestContext);\n const searchCriteria: SearchSuggestionCriteria = {\n ProductSearchCriteria: {\n SearchCondition: input.searchQuery && input.searchQuery.length > 0 ? input.searchQuery : '',\n Context: {\n ChannelId: +ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n }\n },\n HitPrefix: input.hitPrefix,\n HitSuffix: input.hitSuffix,\n SuggestionType: input.suggestionType\n };\n\n const searchSuggestions = await getSearchSuggestionsAsync(\n { callerContext: ctx, queryResultSettings: { Paging: { Top: input.topResultsCount } } },\n searchCriteria\n );\n\n if (searchSuggestions && searchSuggestions.length > 0) {\n // Generate image url\n searchSuggestions.map(\n (item: SearchSuggestion) => (item.ImageUrl = item.ImageUrl ? generateImageUrl(item.ImageUrl, ctx.requestContext.apiSettings) : '')\n );\n\n autosuggest.AllSearchResults = searchSuggestions;\n } else {\n ctx.telemetry.error(`[getSearchSuggestionsAction] unable to get availabilites for search with suggestion type ${searchCriteria.SuggestionType}`);\n }\n}\n\nexport const getSearchSuggestionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/search/get-auto-suggest-suggestions',\n action: <IAction<Autosuggestions>>getSearchSuggestionsAction,\n input: createInput\n});\n\nexport default getSearchSuggestionsActionDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { getRichTextHtml } from '@msdyn365-commerce/core';\nimport { ProductRefiner, ProductRefinerSource, ProductRefinerValue, SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\nexport interface ISearchCategorySuggestProps {\n searchCategorySuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps<ISearchData>;\n searchText: string;\n searchRefiners: ProductRefiner[] | undefined;\n suggestions: SearchSuggestion[] | undefined;\n telemetryContent?: ITelemetryContent;\n shouldShowFullPath?: boolean;\n}\n\nexport interface ISearchCategoryViewProps {\n title: React.ReactNode;\n text: React.ReactNode[];\n}\n\nlet payLoad: IPayLoad;\n\n/**\n * CategorySuggestionsComponent.\n * @param props\n */\nexport const CategorySuggestionsComponent = (props: ISearchCategorySuggestProps): ISearchCategoryViewProps | undefined => {\n const {\n suggestions,\n searchText,\n autoSuggestProps: {\n resources: { categorySuggestionHeading }\n }\n } = props;\n\n const reactNodes: React.ReactNode[] = [];\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, props));\n });\n\n const titleNode = _renderTitle(categorySuggestionHeading, searchText);\n\n return { title: titleNode, text: reactNodes };\n};\n\nconst _renderTitle = (categorySuggestionHeading: string, searchText: string) => {\n const categoryAutoSuggestionHeading = categorySuggestionHeading ? format(categorySuggestionHeading, searchText) : `Search \"${searchText}\" in categories`;\n\n return (<li className='msc-autoSuggest__categoryResults-title'>\n {categoryAutoSuggestionHeading}\n </li>);\n};\n\nconst _assembleNode = (item: SearchSuggestion, props: ISearchCategorySuggestProps) => {\n const { searchText, hitPrefix, hitSuffix, shouldShowFullPath } = props;\n\n const splitValue = shouldShowFullPath ? item.Value : item.Value && item.Value.split('|').pop();\n const ariaLabel = splitValue ? splitValue.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '') : item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n payLoad.contentAction.etext = item.Value;\n const attribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n return (\n <li className='msc-autoSuggest__categoryResults-item' key={item.Id}>\n <a aria-label={ariaLabel} href={_generateLink(item, searchText, props)} {...attribute}>\n {_generateLink(item, searchText, props) && _getHighlightedText(splitValue ? splitValue : '', hitPrefix, hitSuffix)}\n </a>\n </li>\n );\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, searchText: string, props: ISearchCategorySuggestProps): string => {\n return suggestion && suggestion.Id ? _getCategoryLink(suggestion.Id, searchText, props) : '';\n};\n\nconst _getCategoryLink = (id: string, searchText: string, props: ISearchCategorySuggestProps): string => {\n const { searchPageURL, searchQsp, searchRefiners } = props;\n\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(searchPageURL, window.location.href);\n\n if (searchQsp && searchText) {\n queryUrl.searchParams.set(searchQsp, searchText);\n }\n\n const categoryRefiners = searchRefiners?.find(refiners => {\n return refiners.SourceValue === ProductRefinerSource.Category;\n });\n const refiner = categoryRefiners?.Values?.find(item => {\n return item.RefinerRecordId === Number.parseInt(id, 10);\n });\n\n const encodedRefiner = refiner && JSON.stringify(compressRefiners([refiner]));\n if (encodedRefiner) {\n queryUrl.searchParams.set('refiners', encodedRefiner);\n }\n\n return queryUrl.href;\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '<strong>')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '</strong>');\n\n return <span dangerouslySetInnerHTML={getRichTextHtml(formattedText)} />;\n};\n\n// TODO: This code is currently duplicated in categoryautosuggest need to either remove one of these files\n// or move this code to a common place\nconst compressedRefinerKeys = ['DataTypeValue', 'LeftValueBoundString', 'RefinerRecordId', 'RefinerSourceValue', 'RightValueBoundString', 'UnitText'];\n\n/**\n * Compressed a list of refiners for use in URLs.\n * @param refiners The uncompressed refiners.\n */\nconst compressRefiners = (refiners: ProductRefinerValue[]) => {\n const compressedRefiners: (string | number)[][] = [];\n\n refiners.forEach((refiner) => {\n const compressedRefiner: (string | number)[] = [];\n compressedRefinerKeys.forEach((refinerKey) => {\n compressedRefiner.push(refiner[refinerKey]);\n });\n compressedRefiners.push(compressedRefiner);\n });\n\n return compressedRefiners;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ISearchFormProps {\n hideSearchLabel: boolean | undefined;\n isSearchFormExpanded?: boolean | undefined;\n disableSubmitSearch: boolean | undefined;\n searchTextInput: React.RefObject<HTMLInputElement>;\n maxChars: number;\n searchQsp: string;\n searchPlaceholder: string;\n query: string;\n ariaLabelCancel: string;\n ariaLabelSearch: string;\n ariaLabelSubmit: string;\n handleCancelSearchChange(): void;\n handleInputChange(query: string): void;\n}\n\nexport interface ISearchFormViewProps {\n input: React.ReactNode;\n submitBtn: React.ReactNode;\n cancelBtn: React.ReactNode;\n\n}\n\n/**\n * On Input Change functionality.\n * @param handleInputChange -Input change function.\n * @returns Set updated input value.\n */\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent<HTMLInputElement>) => {\n handleInputChange(event.target.value || '');\n};\nexport const FormComponent = (props: ISearchFormProps): ISearchFormViewProps => {\n const {\n searchQsp,\n searchPlaceholder,\n hideSearchLabel,\n searchTextInput,\n handleInputChange,\n maxChars,\n disableSubmitSearch,\n handleCancelSearchChange,\n query,\n ariaLabelCancel,\n ariaLabelSearch,\n ariaLabelSubmit\n } = props;\n\n const onInputChange = onInputChangeFunction(handleInputChange);\n\n const inputNode = !hideSearchLabel ? (\n <input\n className='ms-search__form-control'\n type='text'\n aria-label={ariaLabelSearch}\n name={searchQsp}\n placeholder={searchPlaceholder}\n ref={searchTextInput}\n onChange={onInputChange}\n maxLength={maxChars}\n value={query}\n />\n ) : (\n <input\n className='ms-search__form-control'\n type='text'\n aria-label={ariaLabelSearch}\n name={searchQsp}\n placeholder={searchPlaceholder}\n ref={searchTextInput}\n onChange={onInputChange}\n value={query}\n />\n );\n\n const submitBtnNode = !disableSubmitSearch && (\n <Button className='ms-search__form-submitSearch' aria-label={ariaLabelSubmit} />\n );\n\n const cancelBtNoden = (\n <Button\n className={!disableSubmitSearch ? 'ms-search__form-cancelSearch' : 'ms-search__form-cancelSearchNoSumbit'}\n aria-label={ariaLabelCancel}\n onClick={handleCancelSearchChange}\n type='button'\n />\n );\n\n return { input: inputNode, cancelBtn: cancelBtNoden, submitBtn: submitBtnNode };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport MsDyn365, { getRichTextHtml } from '@msdyn365-commerce/core';\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\nexport interface ISearchKeywordSuggestProps {\n searchKeywordSuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps<ISearchData>;\n searchText: string;\n suggestions: SearchSuggestion[] | undefined;\n telemetryContent?: ITelemetryContent;\n}\n\nexport interface ISearchKeywordViewProps {\n text: React.ReactNode[];\n}\n\nlet payLoad: IPayLoad;\n\n/**\n * KeywordSuggestionsComponent.\n * @param props\n */\nexport const KeywordSuggestionsComponent = (props: ISearchKeywordSuggestProps): ISearchKeywordViewProps | undefined => {\n const {\n suggestions,\n hitPrefix,\n hitSuffix\n } = props;\n\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n const reactNodes: React.ReactNode[] = [];\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, props));\n });\n\n return { text: reactNodes };\n};\n\nconst _assembleNode = (item: SearchSuggestion, hitPrefix: string, hitSuffix: string, props: ISearchKeywordSuggestProps) => {\n const ariaLabel = item.Value &&\n (item.Value).replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n payLoad.contentAction.etext = ariaLabel;\n const attribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n return (\n <li className='msc-autoSuggest__keywordResults-item' key={item.Id}>\n <a\n aria-label={ariaLabel}\n href={_generateLink(item, hitPrefix, hitSuffix, props)}\n {...attribute}\n >\n {_generateLink(item, hitPrefix, hitSuffix, props) &&\n _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix)}\n </a>\n </li>\n );\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, props: ISearchKeywordSuggestProps): string => {\n const { searchPageURL, searchQsp } = props;\n\n const formattedLink = (suggestion.Value as string)\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(searchPageURL, window.location.href);\n if (searchQsp && formattedLink) {\n queryUrl.searchParams.set(searchQsp, formattedLink);\n }\n\n return queryUrl.href;\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '<strong>')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '</strong>');\n\n return <span dangerouslySetInnerHTML={getRichTextHtml(formattedText)} />;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ISearchLabelProps {\n isSearchFormExpanded: boolean;\n searchLabelClass: string;\n searchLabelArialLabel: string;\n searchtext: string;\n searchCollapsedLabel: React.RefObject<HTMLButtonElement>;\n hideSearchLabel?: boolean;\n telemetryContent: ITelemetryContent;\n handleCancelSearchChange(): void;\n}\n\nexport const LabelComponent = (props: ISearchLabelProps) => {\n const { searchLabelClass, searchLabelArialLabel, isSearchFormExpanded, searchtext, searchCollapsedLabel, hideSearchLabel, handleCancelSearchChange, telemetryContent } = props;\n const payLoad = getPayloadObject('click', telemetryContent, searchtext, '');\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\n\n return (\n <div className={searchLabelClass}>\n <Button\n className='ms-search__icon'\n aria-expanded={isSearchFormExpanded}\n aria-label={searchLabelArialLabel}\n onClick={handleCancelSearchChange}\n innerRef={searchCollapsedLabel}\n {...attributes}\n >\n {!hideSearchLabel && <span className='ms-search__icon-text' aria-hidden>\n {searchtext}\n </span>}\n </Button>\n </div>\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { getRichTextHtml, IActionContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { getProductPageUrlSync, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, INodeProps, IPayLoad, ITelemetryContent, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\n/**\n * Search product suggest resources.\n */\nexport interface ISearchProductSuggestResources {\n freePriceText: string;\n}\n\nexport interface ISearchProductSuggestProps {\n searchProductSuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps<ISearchData>;\n searchText: string;\n suggestions: SearchSuggestion[] | undefined;\n telemetry: ITelemetry;\n moduleType: string;\n moduleId: string;\n telemetryContent?: ITelemetryContent;\n resources?: ISearchProductSuggestResources;\n}\n\nexport interface ISearchProductViewProps {\n title: React.ReactNode;\n items: ISearchProductItemViewProps[];\n}\n\nexport interface ISearchProductItemViewProps {\n text: React.ReactNode;\n thumbnail: React.ReactNode;\n price: React.ReactNode;\n LiProduct: INodeProps;\n AProduct: INodeProps;\n id: string | undefined;\n}\n\nlet payLoad: IPayLoad;\nlet telemetryContent: ITelemetryContent | undefined;\n\n/**\n * ProductSuggestionsComponent.\n * @param props\n */\nexport const ProductSuggestionsComponent = (props: ISearchProductSuggestProps): ISearchProductViewProps | undefined => {\n const {\n suggestions,\n hitSuffix,\n hitPrefix,\n autoSuggestProps: {\n context: { actionContext },\n resources: { productSuggestionHeading }\n },\n moduleType,\n moduleId\n } = props;\n const reactNodes: ISearchProductItemViewProps[] = [];\n telemetryContent = props.telemetryContent;\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, actionContext, props, moduleType, moduleId));\n });\n\n const titleNode = _renderTitle(productSuggestionHeading);\n\n return { title: titleNode, items: reactNodes };\n};\n\nconst _renderTitle = (productSuggestionHeading: string) => {\n const productAutoSuggestionHeading = productSuggestionHeading ? productSuggestionHeading : 'Go to products';\n\n return (<li className='msc-autoSuggest__productResults-title'>\n {productAutoSuggestionHeading}\n </li>);\n};\n\nconst _assembleNode = (\n item: SearchSuggestion,\n hitPrefix: string,\n hitSuffix: string,\n actionContext: IActionContext,\n props: ISearchProductSuggestProps,\n moduleType: string,\n moduleId: string\n): ISearchProductItemViewProps => {\n const altText =\n item.Value &&\n (item.Value).replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n const price = item.Value3?.Value?.DecimalValue;\n return {\n text: _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix),\n thumbnail: _renderThumbnail(item, altText ? altText : '', props),\n price: !ObjectExtensions.isNullOrUndefined(price) &&\n _renderPrice(price, price, moduleId, moduleType, props),\n LiProduct: _getLiWrapper(),\n AProduct: _getAWrapper(item, hitPrefix, hitSuffix, actionContext, props),\n id: item.Id\n };\n};\n\nconst _getLiWrapper = () => {\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'li' as NodeTag\n };\n};\n\nconst _getAWrapper = (item: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext, props: ISearchProductSuggestProps) => {\n const {\n autoSuggestProps: { context }\n } = props;\n const ariaLabel = item.Value &&\n (item.Value).replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n payLoad.contentAction.recid = item.Id;\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n const productPrice = context.cultureFormatter.formatCurrency(item.Value3!.Value!.DecimalValue!);\n\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'a' as NodeTag,\n 'aria-label': `${ariaLabel!} ${productPrice}`,\n href: _generateLink(item, hitPrefix, hitSuffix, actionContext),\n ...attribute\n };\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext) => {\n const formattedLink = (suggestion.Value as string).replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n return suggestion.Value && suggestion.Id ? getProductPageUrlSync(formattedLink, suggestion.Id as unknown as number, actionContext, undefined) : '';\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '<strong>')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '</strong>');\n\n return <span className='msc-price msc-autoSuggest__productResults-item-text' dangerouslySetInnerHTML={getRichTextHtml(formattedText)} />;\n};\n\nconst _renderPrice = (adjustedPrice: number, basePrice: number, moduleId: string, moduleType: string, props: ISearchProductSuggestProps): JSX.Element | null => {\n const {\n autoSuggestProps: { context }\n } = props;\n\n return (\n <PriceComponent\n id={moduleId}\n typeName={moduleType}\n context={context}\n data={{\n price: {\n CustomerContextualPrice: adjustedPrice,\n BasePrice: basePrice\n }\n }}\n className='msc-autoSuggest__productResults-item-price'\n freePriceText={props.resources?.freePriceText}\n />\n );\n};\n\nconst _renderThumbnail = (suggestion: SearchSuggestion, altText: string, props: ISearchProductSuggestProps): JSX.Element | null => {\n const {\n autoSuggestProps: {\n context: {\n request: { gridSettings }\n },\n config: { imageSettings }\n }\n } = props;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n if (!suggestion || !suggestion.ImageUrl) {\n props.telemetry.error('Search suggestion content is empty, module wont render.');\n return null;\n }\n\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n lg: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n xl: { q: 'w=40&h=40&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n return (\n <Image\n requestContext={props.autoSuggestProps.context.actionContext.requestContext}\n altText={altText}\n className='msc-autoSuggest__productResults-item-img'\n src={suggestion.ImageUrl}\n gridSettings={gridSettings!}\n imageSettings={imageSettings ? imageSettings : defaultImageSettings}\n loadFailureBehavior='empty'\n />\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\nimport MsDyn365, { getCatalogId, getUrlSync } from '@msdyn365-commerce/core';\nimport { ProductRefiner, ProductRefinerSource, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { createSearchStateInput } from '@msdyn365-commerce-modules/search-utilities';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\nimport * as React from 'react';\n\nimport getSearchSuggestionsAction, { AutoSuggestInput, SuggestionType } from './actions/get-auto-suggest-suggestions';\nimport {\n CategorySuggestionsComponent,\n FormComponent,\n ISearchCategoryViewProps,\n ISearchKeywordViewProps,\n ISearchProductViewProps,\n KeywordSuggestionsComponent,\n LabelComponent,\n ProductSuggestionsComponent\n} from './components';\nimport { ISearchData } from './search.data';\nimport { ISearchProps, ISuggestionTypeCriterionData } from './search.props.autogenerated';\n\nexport interface ISearchState {\n isSearchFormExpanded: boolean;\n searchText: string;\n searchKeywordSuggestClass: string;\n searchProductSuggestClass: string;\n searchCategorySuggestClass: string;\n suggestions: Autosuggestions | undefined;\n searchRefiners?: ProductRefiner[] | undefined;\n autoSuggestAriaLabel: string;\n isInitialState: boolean;\n isLoadingAutoSuggest?: boolean;\n}\n\nexport interface ISearchViewProps extends ISearchProps<ISearchData> {\n Search: IModuleProps;\n AutoSuggestAriaLabel: INodeProps;\n AutoSuggestAriaLabelText: string;\n searchText: string;\n AutoSuggest: INodeProps;\n KeywordSuggest: INodeProps;\n ProductSuggest: INodeProps;\n CategorySuggest: INodeProps;\n SearchForm: INodeProps;\n FormWrapper: INodeProps;\n UlKeyword: INodeProps;\n UlProduct: INodeProps;\n UlCategory: INodeProps;\n label: React.ReactNode;\n form: React.ReactNode;\n autosuggestKeyword?: ISearchKeywordViewProps;\n autosuggestProduct?: ISearchProductViewProps;\n autosuggestCategory?: ISearchCategoryViewProps;\n callbacks: {\n handleCancelSearchChange(): void;\n };\n isSearchFormExpanded: boolean;\n isLoadingAutoSuggest?: boolean;\n isLoadingNode?: React.ReactNode;\n}\n\n/**\n *\n * Search module.\n * @extends {React.Component<ISearchProps<ISearchData>, ISearchState>}\n */\nclass Search extends React.Component<ISearchProps<ISearchData>, ISearchState> {\n private readonly searchTextInput: React.RefObject<HTMLInputElement>;\n\n private readonly searchCollapsedLabel: React.RefObject<HTMLButtonElement>;\n\n private readonly formReference: React.RefObject<HTMLButtonElement>;\n\n private readonly maxChars: number;\n\n private readonly inputSuggestionType?: ISuggestionTypeCriterionData[];\n\n private readonly topResultsCount?: number;\n\n private readonly hitPrefix: string = '{';\n\n private readonly hitSuffix: string = '}';\n\n private readonly waitTime: number = 500;\n\n private readonly autoSuggestResultScreenReaderDiv: React.RefObject<HTMLDivElement>;\n\n private readonly autoSuggestResultDiv: React.RefObject<HTMLDivElement>;\n\n private readonly searchFormClass: string;\n\n private readonly searchLabelClass: string;\n\n private readonly telemetryContent: ITelemetryContent;\n\n // @ts-expect-error\n private cancellabelDebounce: debounce;\n\n constructor(props: ISearchProps<ISearchData>) {\n super(props);\n this.searchTextInput = React.createRef();\n this.searchCollapsedLabel = React.createRef();\n this.autoSuggestResultScreenReaderDiv = React.createRef();\n this.autoSuggestResultDiv = React.createRef();\n this.formReference = React.createRef();\n this.state = {\n isSearchFormExpanded: false,\n searchText: '',\n searchKeywordSuggestClass: 'ms-search__autoSuggest__keyword',\n searchProductSuggestClass: 'ms-search__autoSuggest__product',\n searchCategorySuggestClass: 'ms-search__autoSuggest__category',\n suggestions: undefined,\n searchRefiners: undefined,\n autoSuggestAriaLabel: '',\n isInitialState: true,\n isLoadingAutoSuggest: false\n };\n this.maxChars =\n (this.props.context &&\n this.props.context.app &&\n this.props.context.app.config &&\n this.props.context.app.config.searchInputMaxLength) ||\n 50;\n this.inputSuggestionType = this.props.config && this.props.config.suggestionTypeCriterion;\n this.topResultsCount = this.props.config && this.props.config.topResultsCount ? this.props.config.topResultsCount : 5;\n this.searchFormClass = 'ms-search__form';\n this.searchLabelClass = 'ms-search__label';\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public async componentDidMount(): Promise<void> {\n document.body && document.body.addEventListener('mousedown', this._focusOutTarget);\n window && window.addEventListener('keyup', this._keyup);\n }\n\n public componentWillUnmount(): void {\n document.body && document.body.removeEventListener('mousedown', this._focusOutTarget, false);\n window && window.removeEventListener('keyup', this._keyup, false);\n }\n\n public componentDidUpdate(): void {\n const {\n config: { hideSearchLabel }\n } = this.props;\n const { isSearchFormExpanded, isInitialState } = this.state;\n\n if (!this.props.context.request.params.isEditor) {\n if (!hideSearchLabel && isSearchFormExpanded) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else if (!isInitialState) {\n this.searchCollapsedLabel && this.searchCollapsedLabel.current && this.searchCollapsedLabel.current.focus();\n }\n }\n }\n\n public shouldComponentUpdate(nextProps: ISearchProps<ISearchData>,\n nextState: ISearchState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- ignore complexity.\n public render(): JSX.Element {\n const {\n context,\n resources: { searchtext, searchLabelArialLabel, cancelBtnAriaLabel, searchBtnAriaLabel, submitBtnAriaLabel },\n config: { hideSearchLabel, disableSubmitSearch, searchplaceholderText, shouldShowFullCategoryPath, className = '' }\n } = this.props;\n\n const {\n isSearchFormExpanded,\n searchText,\n searchKeywordSuggestClass,\n searchProductSuggestClass,\n searchCategorySuggestClass,\n suggestions,\n searchRefiners,\n isLoadingAutoSuggest\n } = this.state;\n\n const searchQsp = (context && context.app && context.app.config && context.app.config.searchQueryStringParameter) || 'q';\n const searchPageURL = getUrlSync('search', context && context.actionContext) || '';\n const searchURL = this._appendQueryParams(searchPageURL, searchText, searchQsp);\n const searchPlaceholder = searchplaceholderText && searchplaceholderText.length > 0 ? searchplaceholderText : 'Search in Fabrikam';\n\n const keywordSuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => suggestion.SuggestionType === SuggestionType.Keyword || suggestion.SuggestionType === SuggestionType.None\n );\n const productSuggestions = suggestions?.AllSearchResults?.filter(suggestion => suggestion.SuggestionType === SuggestionType.Product);\n const categoryRefiners = searchRefiners?.find(refiner => {\n return refiner.SourceValue === ProductRefinerSource.Category;\n });\n const categorySuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => {\n if (suggestion.SuggestionType !== SuggestionType.Category) {\n return false;\n }\n const refiner = categoryRefiners?.Values?.find(item => {\n return `${item.RefinerRecordId ?? 0}` === suggestion.Id;\n });\n\n return !ObjectExtensions.isNullOrUndefined(refiner);\n });\n\n const viewProps: ISearchViewProps = {\n ...(this.props as ISearchProps<ISearchData>),\n\n Search: {\n moduleProps: this.props,\n className: `${classnames('ms-search', className)} ${disableSubmitSearch ? 'no-submit' : 'with-submit'}`\n },\n AutoSuggestAriaLabel: {\n tag: 'div',\n className: 'msc-autoSuggest__screen-reader',\n 'aria-live': 'assertive',\n ref: this.autoSuggestResultScreenReaderDiv\n },\n AutoSuggestAriaLabelText: this.state.autoSuggestAriaLabel,\n searchText: this.state.searchText,\n AutoSuggest: {\n ref: this.autoSuggestResultDiv,\n className: 'ms-search__autoSuggest'\n },\n KeywordSuggest: {\n className: searchKeywordSuggestClass\n },\n ProductSuggest: {\n className: searchProductSuggestClass\n },\n CategorySuggest: {\n className: searchCategorySuggestClass\n },\n SearchForm: {\n className: `${this.searchFormClass} ${isSearchFormExpanded ? 'bx-show' : 'bx-hide'}`\n },\n FormWrapper: {\n tag: 'form',\n ref: this.formReference,\n className: 'ms-search__searchForm',\n 'aria-label': 'Search',\n name: 'searchForm',\n role: 'search',\n action: searchURL,\n autoComplete: 'off',\n onSubmit: this._handleSubmit\n },\n UlKeyword: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__keywordResults-items', className)\n },\n UlProduct: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__productResults-items', className)\n },\n UlCategory: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__categoryResults-items', className)\n },\n label: LabelComponent({\n isSearchFormExpanded,\n searchLabelClass: `${this.searchLabelClass} ${isSearchFormExpanded ? 'bx-hide' : 'bx-show'}`,\n searchtext,\n searchLabelArialLabel,\n searchCollapsedLabel: this.searchCollapsedLabel,\n hideSearchLabel,\n handleCancelSearchChange: this._handleCancelSearchChange,\n telemetryContent: this.telemetryContent\n }),\n form: FormComponent({\n ariaLabelCancel: cancelBtnAriaLabel,\n ariaLabelSearch: searchBtnAriaLabel,\n ariaLabelSubmit: submitBtnAriaLabel,\n hideSearchLabel,\n searchTextInput: this.searchTextInput,\n disableSubmitSearch,\n handleInputChange: this._handleInputChange,\n handleCancelSearchChange: this._handleCancelSearchChange,\n maxChars: this.maxChars,\n searchQsp,\n searchPlaceholder,\n query: searchText\n }),\n autosuggestKeyword:\n searchText && searchText.length > 0 &&\n (isLoadingAutoSuggest || (keywordSuggestions && ArrayExtensions.hasElements(keywordSuggestions))) ? KeywordSuggestionsComponent({\n searchKeywordSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: keywordSuggestions,\n telemetryContent: this.telemetryContent\n }) : undefined,\n autosuggestProduct:\n searchText && searchText.length > 0 &&\n (isLoadingAutoSuggest || (productSuggestions && ArrayExtensions.hasElements(productSuggestions))) ? ProductSuggestionsComponent({\n searchProductSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: productSuggestions,\n telemetry: this.props.telemetry,\n moduleType: this.props.typeName,\n moduleId: this.props.id,\n telemetryContent: this.telemetryContent,\n resources: this.props.resources\n }) : undefined,\n autosuggestCategory:\n searchText && searchText.length > 0 &&\n (isLoadingAutoSuggest || (categorySuggestions && ArrayExtensions.hasElements(categorySuggestions))) ? CategorySuggestionsComponent({\n searchCategorySuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: categorySuggestions,\n searchRefiners,\n telemetryContent: this.telemetryContent,\n shouldShowFullPath: shouldShowFullCategoryPath\n }) : undefined,\n callbacks: {\n handleCancelSearchChange: this._handleCancelSearchChange\n },\n isSearchFormExpanded: this.state.isSearchFormExpanded,\n isLoadingAutoSuggest,\n isLoadingNode: this._isLoadingNode()\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Function to create the ReactNode for loading Autosuggest result.\n * @returns ReachNode for loading Autosuggest result.\n */\n private readonly _isLoadingNode = (): React.ReactNode => {\n const loadingText = this.props.resources.autoSuggestResultLoadingMessage;\n return (<Spinner\n className='msc-autoSuggest__loadingResult'\n label={loadingText}\n size={SpinnerSize.medium}\n labelPosition='right'\n />);\n };\n\n private readonly _focusOutTarget = (e: any): void => {\n const { suggestions } = this.state;\n\n if (\n suggestions &&\n suggestions.AllSearchResults &&\n e.target.closest('.ms-search') === null\n ) {\n this._clearAutoSuggestState();\n }\n };\n\n private readonly _keyup = (e: KeyboardEvent): void => {\n const { suggestions } = this.state;\n\n if (suggestions && suggestions.AllSearchResults && e.keyCode === KeyCodes.Escape) {\n this._clearAutoSuggestState();\n } else if (this.state.isSearchFormExpanded && e.keyCode === KeyCodes.Escape) {\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n\n if (!((this.formReference.current && this.formReference.current.contains(e.target as unknown as Node)) ||\n (this.autoSuggestResultDiv.current && this.autoSuggestResultDiv.current.contains(e.target as unknown as Node)))) {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n };\n\n private readonly _clearAutoSuggestState = (): void => {\n const {\n context: { actionContext },\n data: { searchState }\n } = this.props;\n\n if (this.searchTextInput.current && this.searchTextInput.current.value.length > 0) {\n searchState.searchText = '';\n searchState.defaultBasicSearchUrl = '';\n searchState.searchQueryStringParameter = '';\n actionContext ? actionContext.update(createSearchStateInput(searchState), searchState) : null;\n this.searchTextInput.current.value = '';\n }\n\n this.setState({ searchText: '', suggestions: undefined, searchRefiners: undefined });\n };\n\n private readonly _handleInputChange = (query: string): void => {\n if (!query || query.length <= this.maxChars) {\n this.setState({ searchText: query });\n }\n\n if (this.cancellabelDebounce) {\n this.cancellabelDebounce.cancel();\n }\n\n const {\n telemetry,\n context,\n data: { searchState }\n } = this.props;\n\n if (context) {\n if (query && query.length > 0) {\n if (query.length > this.maxChars) {\n return;\n }\n\n this.cancellabelDebounce = debounce(() => {\n this.setState({ isLoadingAutoSuggest: true });\n getSearchSuggestionsAction(\n new AutoSuggestInput(\n query,\n this.topResultsCount,\n this._getSuggestionType(this.inputSuggestionType),\n this.hitPrefix,\n this.hitSuffix\n ),\n context.actionContext\n )\n .then(results => {\n this._getSearchRefiners(query)\n .then(refiners => {\n this.setState({ suggestions: results, searchRefiners: refiners,\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(results), isLoadingAutoSuggest: false });\n })\n .catch(error => {\n this.setState({ suggestions: results, searchRefiners: undefined,\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(results) });\n telemetry.exception(error);\n telemetry.debug('Unable to get refiners results');\n });\n })\n .catch(error => {\n this.setState({ suggestions: undefined, searchRefiners: undefined,\n autoSuggestAriaLabel: this._setAutoSuggestResultCount() });\n telemetry.exception(error);\n telemetry.debug('Unable to get auto suggest results');\n });\n }, this.waitTime);\n\n setTimeout(() => {\n this.cancellabelDebounce();\n }, 0);\n\n searchState.searchText = query;\n } else {\n this.setState({ suggestions: undefined, searchRefiners: undefined });\n searchState.searchText = '';\n }\n context.actionContext.update(createSearchStateInput(searchState), searchState);\n }\n };\n\n private readonly _getSuggestionType = (suggestionTypes?: ISuggestionTypeCriterionData[]): string => {\n if (suggestionTypes && suggestionTypes.length > 0) {\n const distinctSuggestionTypes: string[] = [];\n suggestionTypes && suggestionTypes.forEach((suggestionTypeItem, index) => {\n suggestionTypeItem.SuggestionType && distinctSuggestionTypes.push(suggestionTypeItem.SuggestionType.charAt(0).toUpperCase() + suggestionTypeItem.SuggestionType.slice(1));\n });\n return distinctSuggestionTypes.join(',');\n }\n return 'Keyword, Product, ScopedCategory';\n };\n\n private async _getSearchRefiners(searchText: string): Promise<ProductRefiner[]> {\n const { actionContext: ctx } = this.props.context;\n const catalogId = getCatalogId(ctx.requestContext);\n return ProductsDataActions.getProductSearchRefinersAsync(\n { callerContext: ctx },\n {\n SearchCondition: searchText,\n Context: {\n ChannelId: +ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n }\n }\n );\n }\n\n private readonly _handleSubmit = (\n e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.FormEvent<HTMLFormElement>\n ): void => {\n const {\n config: { disableSubmitSearch },\n context: {\n actionContext,\n app: {\n config: { searchQueryStringParameter }\n }\n }\n } = this.props;\n\n const query = this.searchTextInput.current && this.searchTextInput.current.value;\n e.preventDefault();\n\n if (!query || (query && query.length === 0) || disableSubmitSearch) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else {\n const searchQsp = searchQueryStringParameter || 'q';\n const searchURL = this._appendQueryParams(getUrlSync('search', actionContext) || '', query, searchQsp);\n document.location.href = searchURL;\n }\n };\n\n private readonly _handleCancelSearchChange = (): void => {\n const { isSearchFormExpanded, suggestions } = this.state;\n\n if (!isSearchFormExpanded) {\n this.setState({\n isSearchFormExpanded: true,\n searchText: '',\n isInitialState: false\n });\n } else {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n\n this.setState({ isSearchFormExpanded: false });\n }\n };\n\n private readonly _appendQueryParams = (route: string, query: string, qsp: string): string => {\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(route, window.location.href);\n if (qsp && query) {\n queryUrl.searchParams.set(qsp, query);\n }\n\n return queryUrl.href;\n };\n\n private readonly _setAutoSuggestResultCount = (result?: Autosuggestions) => {\n if (this.autoSuggestResultScreenReaderDiv.current !== null) {\n const ariaLiveRegion = this.autoSuggestResultScreenReaderDiv.current;\n const suggestResultString = this.props.resources.autoSuggestFoundMessage;\n const emptyResultString = this.props.resources.noAutoSuggestionMessage;\n ariaLiveRegion.innerText = result && (result.AllSearchResults && result.AllSearchResults.length > 0) ? suggestResultString : emptyResultString;\n ariaLiveRegion.setAttribute('aria-live', 'assertive');\n return ariaLiveRegion.innerText;\n }\n return '';\n\n };\n}\n\nexport default Search;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport get from 'lodash/get';\nimport { computed } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport GuidedCard from './guided-card';\n\nexport interface ICheckoutGuidedFormProps {\n items: React.ReactNode[];\n moduleState: IModuleStateManager;\n disableGuidedCheckoutFlow?: boolean;\n isMobile?: boolean;\n isEditor?: boolean;\n resource: {\n checkoutStepTitleFormat: string;\n saveBtnLabel: string;\n changeBtnLabel: string;\n cancelBtnLabel: string;\n saveAndContinueBtnLabel: string;\n };\n telemetryContent?: ITelemetryContent;\n isPaymentVerificationRedirection?: boolean;\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n hasError?: boolean;\n hasShippingAddress?: boolean | undefined;\n hasCartDeliveryMode?: boolean | undefined;\n hasGuestCheckoutEmail?: boolean | undefined;\n isTermsAndConditionAccepted?: boolean | undefined;\n}\n\ninterface ICheckoutGuidedFormState {\n currentStep: number;\n}\n\nconst paymentInstrumentModuleId = 'payment-instrument';\n\n/**\n *\n * CheckoutGuidedForm component.\n * @extends {React.Component<ICheckoutGuidedFormProps>}\n */\n@observer\nclass CheckoutGuidedForm extends React.PureComponent<ICheckoutGuidedFormProps> {\n\n @computed public get hasMissingInfo(): boolean {\n if (this.props.hasShippingAddress === false || this.props.hasCartDeliveryMode === false ||\n this.props.hasGuestCheckoutEmail === false || this.props.isTermsAndConditionAccepted === false) {\n return true;\n }\n\n return false;\n }\n\n @computed public get hasOrderError(): boolean {\n for (const item of this.props.items) {\n const childId = this.getId(item);\n const state = this.props.moduleState.getModule(childId);\n\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n state.childIds?.filter(currentId => currentId?.includes(paymentInstrumentModuleId)));\n\n if (!isPaymentSectionContainer && !state.isDisabled && state.hasError) {\n return true;\n }\n }\n\n return false;\n }\n\n public state: ICheckoutGuidedFormState = {\n currentStep: 0\n };\n\n public componentDidMount(): void {\n /**\n * Append child modules.\n */\n const childIds = this.props.items.map((item: React.ReactNode) => get(item, 'props.id'));\n this.props.moduleState.init({ childIds });\n }\n\n public render(): JSX.Element | null {\n const { moduleState, items, resource } = this.props;\n if (!items || !moduleState) {\n return null;\n }\n\n const shouldCollapseAfterRedirect = this.props.isPaymentVerificationRedirection &&\n this.props.shouldEnableSinglePaymentAuthorizationCheckout &&\n !this.props.hasError && !this.hasMissingInfo && !this.hasOrderError;\n\n return (\n <div className='ms-checkout__guided-form'>\n {items.map((item: React.ReactNode) => {\n const childId = this.getId(item);\n const step = this.getStep(childId);\n const title = this.getHeading(item);\n const state = this.props.moduleState.getModule(childId);\n const { isReady, isPending, isUpdating, isDisabled, isCancelAllowed, onEdit, onCancel, onSubmit, hasModuleState, hasInitialized } =\n state || ({} as IModuleStateManager);\n return (\n\n <GuidedCard\n key={childId}\n step={step}\n title={title}\n resource={resource}\n disabled={!hasModuleState || isDisabled}\n isActive={!shouldCollapseAfterRedirect && this.isActive(step)}\n isVisted={!shouldCollapseAfterRedirect && this.isVisted(step)}\n isExpanded={!shouldCollapseAfterRedirect && this.isExpanded(step)}\n isSubmitting={isPending}\n isMobile={this.props.isMobile}\n isPending={isPending}\n isUpdating={isUpdating}\n hasInitialized={hasInitialized}\n isReady={isReady}\n isCancelAllowed={isCancelAllowed}\n onSubmit={onSubmit}\n onCancel={onCancel}\n onEdit={onEdit}\n onNext={this.onNext}\n hasControlGroup={!this.props.disableGuidedCheckoutFlow && hasInitialized}\n telemetryContent={this.props.telemetryContent}\n >\n {React.cloneElement(item as React.ReactElement, { enableControl: true })}\n </GuidedCard>\n );\n })}\n </div>\n );\n }\n\n private readonly getEnabledModules = (): string[] => {\n const {\n moduleState: { childIds, getModule }\n } = this.props;\n return childIds.filter((childId: string) => {\n const state = getModule(childId);\n return !!state && !state.isDisabled;\n });\n };\n\n private readonly getStep = (id: string): number => {\n return this.getEnabledModules().indexOf(id);\n };\n\n private readonly getId = (item: React.ReactNode): string => {\n return get(item, 'props.id') || '';\n };\n\n private readonly getHeading = (item: React.ReactNode): Heading => {\n return get(item, 'props.config.heading') || '';\n };\n\n private readonly isExpanded = (step: number): boolean => {\n if (this.props.isEditor) {\n // Editorial mode: Expand all the drawers\n return true;\n }\n return step > -1 && step <= this.state.currentStep;\n };\n\n private readonly isActive = (step: number): boolean => {\n return step === this.state.currentStep;\n };\n\n private readonly isVisted = (step: number): boolean => {\n return step > -1 && step < this.state.currentStep;\n };\n\n private readonly onNext = (): void => {\n this.setState({\n currentStep: this.state.currentStep + 1\n });\n };\n}\n\nexport default CheckoutGuidedForm;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC<IInvoiceSummaryLineProps> = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n <p className={`msc-invoice-summary__line-${cssLabel}`}>\n <span className='msc-invoice-summary__label'>\n {label}\n </span>\n {price || price === 0 ? (\n <PriceComponent\n data={{\n price: { CustomerContextualPrice: price }\n }}\n freePriceText={freeText}\n context={context}\n id={id}\n typeName={typeName}\n className='msc-invoice-summary__value'\n />\n ) : (\n <span className='msc-invoice-summary__value'>\n {toBeCalculatedText}\n </span>\n )}\n </p>\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n <InvoiceSummaryLine\n price={price}\n label={label}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n toBeCalculatedText={props.toBeCalculatedText}\n freeText={props.freeText}\n telemetry={props.telemetry}\n cssLabel={cssLabel}\n />\n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(props, invoiceLine.InvoiceAmount, format(props.invoiceLabel, invoiceLine.InvoiceId), 'invoice');\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(props, -giftCardAmount, props.giftcardLabel || 'Gift card amount', 'gift-card');\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection({ ...props, freeText: undefined }, totalAmountAfterGiftCard, props.orderTotalLabel, 'total');\n }\n\n return reactNodes;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { CheckoutState } from './checkout-state';\n\n/**\n * CheckoutState - action input.\n */\nexport class CheckoutStateInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('CheckoutState', this.apiSettings);\n\n public getCacheObjectType = () => 'CheckoutState';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CheckoutState - action.\n * @param input\n * @param ctx\n */\nexport async function checkoutStateAction(input: CheckoutStateInput, ctx: IActionContext): Promise<CheckoutState> {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext<IGeneric<IAny>>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction<CheckoutState>({\n action: <IAction<CheckoutState>>checkoutStateAction,\n input: createInput\n});\n\nexport default checkoutStateActionDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { createObservableDataAction, IAction, IActionContext, sendRequest } from '@msdyn365-commerce/core';\n\nimport { SubmitUserReviewInput } from './inputs/submit-user-review-input';\n\n/**\n * This data action allows submitting review to the reviews service.\n * @param input This user review submission text.\n * @param ctx The data action context.\n */\nasync function submitReview(input: SubmitUserReviewInput, ctx: IActionContext): Promise<string> {\n if (!inputIsValid(input)) {\n ctx.trace(`[SubmitUserReview] Failed to submit reviews for product due to bad input ${input}`);\n return '';\n }\n\n const requestUrl = `${input.serviceEndpoint}/v2.0/reviews/product/${input.productId}/user?` +\n `tenantId=${input.tenantId}&` +\n `channelId=${input.channelId}&` +\n `locale=${input.locale}`;\n\n return sendRequest<string>(requestUrl, 'post', input.userReviewData, { headers: { Authorization: `id_token ${input.authorization}` } }).then((response) => {\n if (response.status !== 200 && response.status !== 201) {\n ctx.trace('[SubmitUserReview] Failed to submit reviews for product');\n ctx.trace(response.data);\n return '';\n }\n return response.data;\n }).catch((error) => {\n ctx.trace('[SubmitUserReview] Failed to submit reviews for product');\n ctx.telemetry.exception(error);\n ctx.telemetry.debug('[SubmitUserReview] Failed to submit reviews for product');\n ctx.trace(error);\n return '';\n });\n}\n\nfunction inputIsValid(input: SubmitUserReviewInput): boolean {\n return input && !!input.productId && !!input.tenantId;\n}\n\nexport const submitReviewDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/ratings-reviews/submit-user-review',\n action: <IAction<string>>submitReview\n});\n\nexport default submitReviewDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport { AsyncResult, CartLine, CartLineValidationResults, CartsDataActions, LineDataValidationFailure, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Validate the cart.\n * @param isQuantityLimitsFeatureEnabled -- Is the quantity limits feature enabled.\n * @param cart -- The cart state to validate.\n * @param telemetry -- The telemetry.\n * @param propsContext -- The props context.\n * @param shouldRetry -- Should retry.\n * @returns A list of line data validation failures.\n */\nexport async function validateCartAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cart: AsyncResult<ICartState>,\n telemetry: ITelemetry,\n propsContext: ICoreContext,\n shouldRetry: boolean = true): Promise<LineDataValidationFailure[] | undefined> {\n\n if (!isQuantityLimitsFeatureEnabled) {\n return AsyncResult.resolve();\n }\n\n let cartResult: ICartState;\n let cartVersion: number | undefined;\n try {\n cartResult = await cart;\n cartVersion = cartResult.cart.Version;\n } catch (error) {\n telemetry.warning(error);\n telemetry.debug('Unable to get cart or cart version.');\n return AsyncResult.resolve();\n }\n\n if (cartVersion) {\n try {\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: propsContext.actionContext, bypassCache: 'none' },\n cartResult.cart.Id, cartVersion\n );\n\n return await AsyncResult.resolve(validationResult.ValidationFailuresByCartLines ?? []);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- error type is not defined.\n if (shouldRetry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\n try {\n await cartResult.refreshCart({});\n } catch (refreshError) {\n telemetry.warning(refreshError);\n telemetry.debug('Unable to refresh Cart');\n return AsyncResult.resolve();\n }\n try {\n await validateCartAsync(isQuantityLimitsFeatureEnabled, cart, telemetry, propsContext, false);\n return AsyncResult.resolve();\n } catch (validateError) {\n telemetry.warning(validateError);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n }\n\n telemetry.warning(error);\n telemetry.debug('Unable to validate Cart');\n return AsyncResult.resolve();\n }\n } else {\n telemetry.warning('Cart version not found for Cart validation request.');\n return AsyncResult.resolve();\n }\n}\n\n/**\n * Check if cart line quantity update is success.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function isCartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number): Promise<boolean> {\n\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find((product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId);\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult.status === 'SUCCESS');\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve(false);\n}\n\n/**\n * Update cart line with cart action result.\n * @param isQuantityLimitsFeatureEnabled -- Is quantity limits feature enabled.\n * @param cartResult -- The cart result.\n * @param telemetry -- The telemetry.\n * @param products -- The products.\n * @param cartLineToUpdate -- The cart line to update.\n * @param quantity -- The quantity.\n * @returns Boolean to indicate if the cart line quantity is updated.\n */\nexport async function cartLineQuantityUpdatedAsync(\n isQuantityLimitsFeatureEnabled: boolean | undefined,\n cartResult: ICartState | undefined,\n telemetry: ITelemetry,\n products: SimpleProduct[] | undefined,\n cartLineToUpdate: CartLine,\n quantity: number): Promise<ICartActionResult | undefined> {\n\n if (cartResult) {\n let isUsingDefaultOrderSettingsMax: boolean = false;\n if (ArrayExtensions.hasElements(products) && isQuantityLimitsFeatureEnabled) {\n const modifiedProduct: SimpleProduct | undefined = products.find((product: SimpleProduct) => product.RecordId === cartLineToUpdate.ProductId);\n isUsingDefaultOrderSettingsMax = !!modifiedProduct && !!modifiedProduct.Behavior?.MaximumQuantity;\n } else {\n isUsingDefaultOrderSettingsMax = false;\n }\n\n const input = {\n cartLineId: cartLineToUpdate.LineId!.toString(),\n newQuantity: quantity,\n additionalProperties: { isUsingDefaultOrderSettingsMax }\n };\n\n try {\n const updateLineResult: ICartActionResult = await cartResult.updateCartLineQuantity(input);\n return await AsyncResult.resolve(updateLineResult);\n } catch (error) {\n telemetry.warning((error as Error).message);\n telemetry.debug('Unable to update Cart Line quantity');\n }\n }\n\n return AsyncResult.resolve();\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { SalesOrder, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\nimport checkout from './checkout';\nimport emptyActiveCart from './empty-active-cart';\n\nexport default async (ctx: IActionContext, checkoutState: ICheckoutState | undefined, orderedProducts: SimpleProduct[] | undefined,\n redirect: boolean, updatedCartVersion?: number, isPaymentVerificationRedirection?: boolean) => {\n return new Promise(async (resolve: () => void, reject: (reason?: Error) => void) => {\n let salesOrder: SalesOrder;\n\n // Proceed checkout\n try {\n salesOrder = await checkout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\n } catch (error) {\n reject(error); return;\n }\n\n // Remove purchased items from the active cart\n try {\n await emptyActiveCart(ctx);\n } catch (error) {\n reject(error); return;\n }\n\n if (redirect) {\n // Redirect to the order confirmation page\n const orderConfirmationUrl = getUrlSync('orderConfirmation', ctx) || '';\n if (!orderConfirmationUrl) {\n reject(new Error('Error: No orderConfirmationUrl')); return;\n }\n\n const separator = orderConfirmationUrl.includes('?') ? '&' : '?';\n const url = `${orderConfirmationUrl}${separator}transactionId=${salesOrder.Id}`;\n window.location.assign(url);\n } else {\n if (checkoutState) {\n const result = await checkoutState.updateSalesOrder({ newSalesOrder: salesOrder, newOrderedProducts: orderedProducts || [] });\n\n if (result.status === 'FAILED') {\n reject(new Error('Error: Updating error state failed')); return;\n }\n } else {\n reject(new Error('Error: No checkout state')); return;\n }\n resolve();\n }\n });\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModuleProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IReviewModalViewProps } from '../../common/review-modal';\nimport { IWriteReviewViewProps } from './write-review';\n\nconst WriteReviewView: React.FC<IWriteReviewViewProps> = props => {\n const { heading, signInMessage, signInButton, modalToggle, reviewModal, moduleProps } = props;\n const isAuthenticated = props.context.request.user.isAuthenticated;\n return (\n <Module {...moduleProps}>\n {heading}\n {!isAuthenticated ? <>\n {signInMessage}\n {signInButton}\n </> : <>\n {modalToggle}\n {createReviewModal(reviewModal, moduleProps)}\n </>}\n </Module>\n );\n};\n\nconst createReviewModal = (props: IReviewModalViewProps, moduleProps: IModuleProps): JSX.Element => {\n return (\n <Module {...props.modal} {...moduleProps}>\n {props.modalHeader}\n <Node {...props.modalBody}>\n <Node {...props.form}>\n <Node {...props.inputRow}>\n {props.rating}\n {props.ratingLabel}\n </Node>\n <Node {...props.inputRow}>\n {props.titleLabel}\n {props.titleInput}\n </Node>\n <Node {...props.inputRow}>\n {props.textLabel}\n {props.textInput}\n </Node>\n {props.privacyPolicyUrl}\n {props.error}\n </Node>\n </Node>\n <Node {...props.modalFooter}>\n {props.submitButton}\n {props.cancelButton}\n </Node>\n </Module>\n );\n};\n\nexport default WriteReviewView;\n"],"sourceRoot":""}