{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/shared/assets/types.ts","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css?5a6e","webpack:///./ClientApp/styles/node-modules/react-toggle/style.css","webpack:///./ClientApp/features/commerce/shopping-cart/OrderMessages.tsx","webpack:///./ClientApp/shared/polyfills/customEvent.js","webpack:///./ClientApp/shared/components/svg/LeftChevronSVG.tsx","webpack:///./ClientApp/shared/components/svg/DownChevronSVG.tsx","webpack:///./ClientApp/shared/components/svg/UpChevronSVG.tsx","webpack:///./ClientApp/features/commerce/shopping-cart/useShoppingCart.ts","webpack:///./ClientApp/shared/hooks/useInViewOnce.ts","webpack:///./ClientApp/shared/assets/LazyImage.tsx","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/shared/components/svg/ShoppingCartSVG.tsx","webpack:///./ClientApp/styles/node-modules/@reach/dialog/styles.css?d0c1","webpack:///./ClientApp/services/ServerData.ts","webpack:///./ClientApp/features/commerce/pricing/pricing-result.ts","webpack:///./ClientApp/shared/components/svg/QuestionMarkCircleSVG.tsx","webpack:///./ClientApp/features/commerce/store/AddedToCartAlert.tsx","webpack:///./ClientApp/styles/node-modules/@reach/dialog/styles.css","webpack:///./ClientApp/shared/components/svg/RightChevronSVG.tsx","webpack:///./ClientApp/shared/components/svg/LockSVG.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/types.ts","webpack:///./ClientApp/features/commerce/shopping-cart/ProductSelectionsList.tsx","webpack:///./ClientApp/shared/hooks/useAxiosLoader.ts","webpack:///./ClientApp/shared/hooks/useAxiosPaginatedLoader.ts","webpack:///./ClientApp/shared/components/Spinner.tsx","webpack:///./ClientApp/features/commerce/product-details/data.ts","webpack:///./ClientApp/shared/components/svg/PlusSVG.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/shared/components/Breadcrumbs.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductPricingLines.tsx","webpack:///./ClientApp/shared/components/Alert.tsx","webpack:///./ClientApp/shared/components/svg/InfoSVGAlternative.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAddOns.tsx","webpack:///./ClientApp/shared/components/svg/MinusSVG.tsx","webpack:///./ClientApp/shared/components/svg/PlayMediaSVG.tsx","webpack:///./ClientApp/shared/components/svg/FilePDFSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileWithTextSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileWordDocSVG.tsx","webpack:///./ClientApp/shared/components/svg/FileExcelSVG.tsx","webpack:///./ClientApp/shared/assets/AssetIcon.tsx","webpack:///./ClientApp/shared/components/svg/DownloadSVG.tsx","webpack:///./ClientApp/shared/assets/AssetDownloadIcon.tsx","webpack:///./ClientApp/shared/assets/ExternalMediaIFrame.tsx","webpack:///./ClientApp/shared/components/svg/HclZoomSVG.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductImageModal.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAssets.tsx","webpack:///./ClientApp/shared/hooks/useSmoothScrollingPolyfill.tsx","webpack:///./ClientApp/features/commerce/organization/orders lazy ^\\.\\/.*$ namespace object","webpack:///./ClientApp/shared/components/Pagination.tsx","webpack:///./ClientApp/shared/components/svg/FileSVG.tsx","webpack:///./ClientApp/shared/edit/fields/FieldInputErrorWrapper.tsx","webpack:///./ClientApp/shared/assets/lazy.ts","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/useShoppingListLoader.ts","webpack:///./ClientApp/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/shared/edit/fields/CheckBoxField.tsx","webpack:///./ClientApp/shared/edit/fields/DropdownField.tsx","webpack:///./ClientApp/shared/edit/fields/StarRatingField.tsx","webpack:///./ClientApp/shared/edit/fields/TextAreaField.tsx","webpack:///./ClientApp/shared/edit/fields/InputField.tsx","webpack:///./ClientApp/shared/edit/fields/TextBoxField.tsx","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/useShoppingLists.ts","webpack:///./ClientApp/shared/hooks/useRocEventHandler.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItemFields.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItemBody.tsx","webpack:///./ClientApp/features/commerce/my-account/shopping-lists/ShoppingListEditItem.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/services/UserData.ts","webpack:///../Roc.SharedClientApp/types/model-status.ts","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/util/AccountUrls.ts","webpack:///./ClientApp/features/commerce/shopping-cart/types.ts","webpack:///./ClientApp/features/commerce/store/MultipleItemsAddedToCartAlert.tsx","webpack:///./ClientApp/shared/edit/OptionalFieldMarker.tsx","webpack:///./ClientApp/shared/polyfills/getAttributeNames.js","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./ClientApp/shared/components/hawksearch/helpers/Cookies.ts","webpack:///./ClientApp/shared/edit/fields/ValidationMessages.tsx","webpack:///./ClientApp/shared/components/commerce/ProductPricing.tsx","webpack:///./ClientApp/features/my-account/routes.roc.tsx","webpack:///./ClientApp/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/shared/components/svg/CheckCircleSVG.tsx","webpack:///./ClientApp/shared/util/Misc.ts","webpack:///./ClientApp/shared/util/events/rocEventUtils.ts","webpack:///./ClientApp/shared/components/svg/StarEmptySVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/DashCircleSVG.tsx","webpack:///../Roc.SharedClientApp/types/commerce/display-price.ts","webpack:///./ClientApp/shared/components/Modal.tsx","webpack:///./ClientApp/shared/components/svg/PencilSVG.tsx","webpack:///./ClientApp/features/commerce/product-details/types.ts","webpack:///./ClientApp/shared/components/svg/CircleExclamationSVG.tsx","webpack:///./ClientApp/features/my-account/routes.commerce.tsx","webpack:///./ClientApp/shared/components/CircleButton.tsx","webpack:///./ClientApp/shared/edit/fields/CheckboxInputField.tsx","webpack:///./ClientApp/shared/components/svg/StarSVG.tsx","webpack:///./ClientApp/shared/components/star-rating/StarRating.tsx","webpack:///./ClientApp/shared/components/star-rating/useStarRating.ts","webpack:///./ClientApp/shared/edit/RocForm.tsx","webpack:///../Roc.SharedClientApp/types/commerce/tabs.ts","webpack:///./ClientApp/shared/components/roc-options-table/RocOptionsTable.tsx","webpack:///./ClientApp/shared/components/roc-options-table/RocOptionsTableTitle.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductSelectableAttributesList.tsx","webpack:///./ClientApp/features/commerce/product-details/BulkAddToList.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductDetailsContext.ts","webpack:///./ClientApp/features/commerce/product-details/AlternateProductDetails.tsx","webpack:///./ClientApp/util/type-assertions.ts","webpack:///./ClientApp/features/commerce/product-details/ProductAvailabilityHCL.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAddToCart.tsx","webpack:///./ClientApp/features/commerce/store/AddedToListAlert.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAddToListModal.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductAddToList.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductRating.tsx","webpack:///./ClientApp/util/console.ts","webpack:///./ClientApp/features/commerce/product-details/ProductSelections.tsx","webpack:///./ClientApp/shared/data/usePartialDataLoader.tsx","webpack:///./ClientApp/features/commerce/product-details/useProductDetails.ts","webpack:///./ClientApp/features/commerce/product-details/ProductLists.tsx","webpack:///./ClientApp/features/commerce/product-details/data.HCL.ts","webpack:///./ClientApp/features/commerce/product-details/ProductPriceBreaks.tsx","webpack:///./ClientApp/features/commerce/product-details/ProductDetails.tsx","webpack:///./ClientApp/features/commerce/product-details/index.tsx","webpack:///./ClientApp/shared/hooks/useLoader.ts","webpack:///./ClientApp/shared/components/svg/FolderSVG.tsx","webpack:///./ClientApp/shared/components/svg/GarbageCanCircleSVG.tsx","webpack:///./ClientApp/shared/components/StatusDisplay.tsx","webpack:///./ClientApp/features/commerce/organization/OrganizationUIComponents.ts","webpack:///./ClientApp/features/commerce/organization/routes.tsx"],"names":["LocalizerResources","isAlreadyLogged","initializeLocalizerResources","windowWithResources","window","__ROC_LOCALIZER_RESOURCES__","Array","isArray","forEach","obj","Object","keys","key","Localizer","replaceStrings","length","console","warn","resource","replace","match","index","LocalizedSpan","props","resourceKey","args","localizedString","data-testid","toKebabCase","dangerouslySetInnerHTML","__html","AssetType","api","content","__esModule","default","module","i","options","exports","locals","___CSS_LOADER_API_IMPORT___","push","OrderMessageAction","OrderMessages","orderMessages","actions","messages","filter","orderMessage","includes","messageAction","className","map","message","CustomEvent","event","params","bubbles","cancelable","detail","undefined","evt","document","createEvent","initCustomEvent","prototype","Event","LeftChevronSVG","rest","viewBox","classnames","focusable","aria-hidden","d","DownChevronSVG","UpChevronSVG","useShoppingCart","useShoppingCartParams","order","setOrder","savedProducts","setSavedProducts","setCartSummary","setOrderMessages","useState","updatingOrderItemId","setUpdatingOrderItemId","orderItemBeingRemovedId","setOrderItemBeingRemovedId","cartTotalItemCount","setCartTotalItemCount","updatingSavedProductId","setUpdatingSavedProductId","updatingSavedProductPricingLineId","setUpdatingSavedProductPricingLineId","savedProductBeingRemovedId","setSavedProductBeingRemovedId","savedProductBeingRemovedPricingLineId","setSavedProductBeingRemovedPricingLineId","storedForUndoItem","setStoredForUndoItem","storedForUndoItemIndex","setStoredForUndoItemIndex","lastMoveStatus","setLastMoveStatus","isUndoClicked","isUndoClickedState","setIsUndoClickedState","error","setError","errorMessage","setErrorMessage","errorType","setErrorType","orderIsUpdating","clearUndoState","dispatchAddToCartEvent","result","dispatchRocEvent","items","id","productId","adjustedQuantity","name","price","snapshotSalePrice","snapshotBasePrice","sku","currency","snapshotCurrencyISO","productGroupId","selections","updateCartState","response","cart","cartSummary","updateOrderMessages","useEffect","itemsCount","recipients","reduce","itemsQty","orderRecipient","recipientQty","orderItem","quantity","addToCart","itemId","AxiosHelper","post","productPricingLineId","savedProductsPageNumber","pagination","pageNumber","savedProductsPageSize","pageSize","addOns","validateAddOns","data","axiosError","exceptionCode","bulkAddToCart","element","request","productInfo","item","processedItems","addAllFromListToCurrentCart","shoppingListId","displayedItemsCount","shoppingListProductIds","selectedShoppingListProductIds","addAllFromListToNewCart","moveItemToSaved","itemToMove","product","pricingLine","recipient","recipientId","itemIndex","indexOf","MoveStatus","MovedToSaved","changeOrderItemQuantity","itemToUpdate","newQuantity","updateOrderItemAddOns","updatedAddOns","requestToken","Axios","CancelToken","source","cancelToken","token","removeOrderItem","itemToRemove","RemovedFromCart","addToSavedProducts","itemToAdd","moveSavedProductToCart","productToMoveId","productName","results","savedProductIndex","findIndex","addToOrderResult","lastMovedItem","find","MovedToCart","removeSavedProduct","productToRemoveId","productToRemoveName","savedProduct","delete","toString","orderItemFromSaved","totalPrice","unitPrice","RemovedFromSaved","handleUndo","state","actor","updateOrder","newCart","useInViewOnce","makeIterator","inViewHookResponse","useInView","viewed","setViewed","inView","newResponse","Symbol","iterator","LazyImage","placeholderImg","src","alt","backgroundImg","delay","inactiveClassName","loadedClassName","threshold","ref","loadedClassDisplayed","setLoadedClassDisplayed","setTimeout","imageSrc","classes","style","backgroundImage","value","trim","toLocaleLowerCase","toCamelCase","word","toLowerCase","toUpperCase","stripHtml","html","tmp","createElement","innerHTML","textContent","innerText","addEllipsis","text","cutoff","substring","trimString","ShoppingCartSVG","defaultProps","ServerData","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","ParseQuantityRange","quantityRange","s","split","parseInt","Infinity","GetPriceForQuantity","prices","Error","min","max","GetPricingLine","pricingResult","pricingLineId","line","products","pricingLines","isDefault","QuestionMarkCircleSVG","stroke","strokeWidth","fill","fillRule","transform","AddedToCartAlert","displayAlert","setDisplayAlert","imageUrl","inline","displayPrice","selection","label","subtotal","type","onClick","location","href","RightChevronSVG","LockSVG","PrivacyType","PrivacyTypeOptions","ProductSelectionsList","cache","useAxiosLoader","axiosParams","active","callback","cacheKey","method","useLoader","loading","setLoading","setResponse","reloadTimes","setReloadTimes","useRef","current","isCancel","cancel","values","reload","useAxiosPaginatedLoader","query","initialPageSize","initialSortByName","initialSortDirection","initialResults","setPageSizeState","setPageNumber","sortByName","setSortByName","sortDirection","setSortDirection","dataLoaderActive","setDataLoaderActive","customQuery","setCustomQuery","paginationQuery","url","page","goToPage","totalPages","goToNextPage","goToPreviousPage","setSorting","sortBy","direction","setPageSize","size","setQuery","Spinner","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","partialDataCache","partialProductsDataCache","getPartialProductData","missingKeys","sort","join","additionalParams","paramValue","Promise","resolve","get","getBulkPartialProductsData","productIds","PlusSVG","axios","create","defaults","headers","common","interceptors","use","config","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","history","status","AccountUrls","Login","encodeURIComponent","pathname","reject","Breadcrumbs","breadcrumbPath","backToPage","renderPathLink","back","entry","Fragment","NoPricingLine","isInitialization","checked","getCheckedPricingLine","checkedUnit","uom","ProductPricingLines","setPricingLines","details","selected","available","statefulPricingLines","onPricingLineChange","handleOnChangeAndBlur","e","newLine","updatedPricingLines","newValue","currentTarget","htmlFor","onChange","onBlur","unitOfMeasure","displayName","getPricingLineDropdownText","LazyDialog","React","lazy","then","Dialog","Alert","isOpen","theme","onConfirm","onCancel","renderTitle","cancelButtonText","confirmButtonText","renderActions","renderProps","headerDivider","subTitle","children","Suspense","fallback","onDismiss","as","InfoSVGAlternative","points","DefaultProductAddOnsComponent","formApi","childAddOnNames","setProductAddOns","hideAddOnsDetails","fields","availableAddOns","availableChildAddOns","_fieldName","_childName","fieldName","ProductAddOnField","getFieldState","getProductAddOnsComponent","input","required","meta","CheckboxInputField","defaultValue","disabled","description","attributes","ProductAddOnAttributeField","attributeIndex","attribute","addOnIndex","inputAttributeType","InputAttributeType","Single","SingleLineAttributeComponent","customComponent","DefaultSingleLineAttributeComponent","getSingleLineAttributeComponent","Multiline","MultiLineAttributeComponent","DefaultMultiLineAttributeComponent","getMultilineAttributeComponent","MultiValueAttributeComponent","DefaultMultiValueAttributeComponent","getMultiValueAttributeComponent","AttributeValueLengthMessage","minimumLength","maximumLength","maximumLines","FieldLabel","isRequired","instructions","testId","limitMultiline","maximumNumberOfLines","newLines","parse","rowLimit","rows","multiple","maxLength","batch","change","selectionValue","valueIndex","MinusSVG","PlayMediaSVG","FilePDFSVG","FileWithTextSVG","FileWordDocSVG","FileExcelSVG","AssetIcon","asset","assetIconClasses","assetType","Media","YouTube","color","Document","assetUrl","pop","FileSVG","DownloadSVG","AssetDownloadIcon","downloadIconClasses","ExternalMediaIFrame","embeddedUrl","title","frameBorder","allow","allowFullScreen","HclZoomSVG","ProductImageModal","closeModal","aria-label","XSVG","LazyMediaQuery","productAssetPlaceholder","altText","sortOrder","thumbnailUrl","mainImageUrl","enlargedImageUrl","Image","compareAssets","a","b","ProductAssets","mainAsset","setMainAsset","altAssets","setAltAssets","isImageSliderModalOpen","setIsImageSliderModalOpen","carousel","nodes","Map","scrollCarousel","up","from","node","innerWidth","scrollBy","clientHeight","smoothscroll","polyfill","assets","newMainAsset","assetsWithoutDocs","initAltAssets","it","assetScroller","maxWidth","minWidth","altAsset","c","set","preventDefault","download","mainImageContent","saleDiscount","isNewProduct","webpackAsyncContext","req","__webpack_require__","o","code","ids","all","slice","t","Pagination","flush","uniqueId","createGuid","localPageNumber","setLocalPageNumber","timerRef","attemptGoToPage","newPageNumber","clearTimeout","onKeyDown","toLocaleString","FieldInputErrorWrapper","hideIcon","useField","invalid","submitError","dirtySinceLastSubmit","submitting","touched","lazyLoadImages","lazyImages","call","querySelectorAll","lazyImageObserver","IntersectionObserver","entries","isIntersecting","lazyImage","target","dataset","attributeDelay","Number","getAttribute","classList","remove","add","unobserve","observe","lazyElements","elements","stopAfterIntersecting","lazyElementObserver","lazyElement","readyState","addEventListener","useShoppingListLoader","CheckBoxField","readOnly","afterSubmit","allowNull","beforeSubmit","formatOnBlur","initialValue","isEqual","subscription","DropdownField","addSelectOption","validateFields","onFocus","dirty","aria-describedby","option","ValidationMessages","StarRatingField","maxRating","OptionalFieldMarker","StarRating","readonly","TextAreaField","placeholder","validate","component","format","render","InputField","forwardRef","step","TextBoxField","InlineAlert","isTitleOnOwnRow","isCollapsed","onCollapse","isAxiosError","useShoppingLists","shoppingListBeingEdited","setShoppingListBeingEdited","isSaving","setIsSaving","shoppingList","setShoppingList","isDeleting","setIsDeleting","saveShoppingList","formValues","MY_ACCOUNT_SHOPPING_LISTS_URL","handleAxiosErrorWithValidation","beginCreateShoppingList","beginEditShoppingList","stopEditingShoppingList","addProductToList","bulkAddProductToList","removeShoppingList","eventType","dispatchEvent","useRocEventHandler","eventHandler","deps","removeHandlerCallback","addRocEventHandler","ShoppingListEditItemFields","ShoppingListEditItemBody","isAlertOpen","setIsAlertOpen","displayCancelButton","displaySaveButton","onRemoveShoppingList","dirtySaveButtonText","saveButtonText","ShoppingListEditItem","onSaveShoppingList","onSubmit","form","getState","pristine","initialValues","handleSubmit","userDataPromise","getUserData","getUserDataNoCache","userData","ModelStatus","ErrorBoundary","lastRefreshedTimestamp","Date","localStorage","getItem","getTime","setItem","this","setState","renderError","Component","BaseUrl","ACCOUNT_URL_BASE","ACCOUNT_LOGIN_URL","Login2fa","ACCOUNT_LOGIN_WITH_2FA_URL","Register","ACCOUNT_REGISTER_URL","ForgotPassword","ACCOUNT_FORGOT_PASSWORD_URL","LoginWithRecoveryCode","ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL","Logout","ACCOUNT_LOGOUT_URL","OrganizationReview","ACCOUNT_ORGANIZATION_REVIEW_URL","OrganizationSelector","ACCOUNT_ORGANIZATION_SELECTOR_URL","ExternalLogout","OrderStatus","PaymentTypeEnum","CreditCardType","ExportStatus","MultipleItemsAddedToCartAlert","responseItem","AddedToCartLineItem","rowIndex","height","role","width","memo","Element","getAttributeNames","getDataPropsFromAttributes","startsWith","attributeName","initReactApp","getReactElement","elementId","getElementById","ReactDOM","initReactAppByAttribute","getVisitorExpiry","setTime","toUTCString","getVisitExpiry","substr","Math","floor","random","getCookie","nameEQ","ca","cookie","charAt","setCookie","expiry","expires","getErrorArray","errorOrSubmitError","errors","concat","ProductPricing","roundValue","renderResult","css","priceClass","base","normalPrice","crossedOutPrice","highlightedPrice","GetCssClasses","displayRule","PriceDisplayRule","Missing","Normal","basePriceClass","salePrice","VariantPriceComponent","basePrice","renderNormalPrice","AmbiguousRange","roundedPrice","rawValue","toFixed","FormatAmbiguousPriceSpan","unitName","unit","renderAmbiguousPrice","FormatPrice","FormatPriceSpan","priceRange","to","MY_ACCOUNT_PATH_PREFIX","MY_ACCOUNT_AUTHENTICATOR_URL","MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL","MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL","MY_ACCOUNT_LOGIN_URL","MY_ACCOUNT_WALLET_URL","MY_ACCOUNT_WALLET_CREATE_URL","MY_ACCOUNT_ADDRESS_BOOK_URL","MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL","MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL","MY_ACCOUNT_SETTINGS_URL","rocRoutes","exact","path","display","setDisplay","timeout","CheckCircleSVG","ms","sleep","validationErrorCallback","genericErrorCallback","globalErrors","errorsWithModifiedArrayIndex","acc","newValidationState","unflatten","FORM_ERROR","getQueryParam","paramName","decodeParam","urlParams","URLSearchParams","search","decodeURIComponent","handler","removeEventListener","StarEmptySVG","DashCircleSVG","class","LazyDialogContent","DialogContent","LazyDialogOverlay","DialogOverlay","Modal","hideCloseButton","renderSubtitle","titleIcon","bypassFocusLock","innerModal","ariaLabel","dangerouslyBypassFocusLock","PencilSVG","getInitialProductDetailsState","__ROC_COMMERCE_PRODUCT_DETAILS__","ProductType","AddToCartExceptionCode","CircleExclamationSVG","MY_ACCOUNT_ORDERS_URL","MY_ACCOUNT_STORE_URL","MY_ACCOUNT_SAVED_FOR_LATER_URL","MY_ACCOUNT_SAVED_CARTS_URL","MY_ACCOUNT_BUY_AGAIN_URL","MY_ACCOUNT_ORGANIZATION_REVIEW_URL","MY_ACCOUNT_ORGANIZATION_SELECTOR_URL","MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL","MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL","MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL","MY_ACCOUNT_REVIEWS_URL","MY_ACCOUNT_CUSTOMER_ACCOUNT_APPLICATIONS_URL","MY_ACCOUNT_CUSTOMER_CREDIT_APPLICATIONS_URL","MY_ACCOUNT_SHOPPER_APPLICATIONS_URL","OrdersComponent","ORGANIZATION_ORDERS_URL","OrderDetailsComponent","StoreComponent","AddressBookComponent","AddressBookEditComponent","SavedForLaterComponent","SavedCartsComponent","BuyAgainComponent","AccountOverviewComponent","ShoppingListsComponent","ShoppingListsCreateComponent","ShoppingListDetailsComponent","OrganizationReviewComponent","OrganizationSelectorComponent","UserShippingAccountsComponent","ReviewsComponent","CustomerAccountApplicationsComponent","CustomerAccountApplicationsEditComponent","CustomerCreditApplicationsComponent","CustomerCreditApplicationsEditComponent","ShopperApplicationsComponent","ordersRoute","orderDetailsRoute","storeRoute","addressBookRoute","addressBookCreateRoute","addressBookEditRoute","savedForLaterRoute","savedCartsRoute","exect","buyAgainRoute","shoppingListsRoute","shoppingListsCreateRoute","shoppingListDetailsRoute","userShippingAccountsRoute","reviewsRoute","customerAccountApplicationsRoute","customerAccountApplicationsEditRoute","customerCreditApplicationsRoute","customerCreditApplicationsEditRoute","commerceRoutes","CircleButton","icon","otherProps","defaultChecked","StarSVG","ratingStars","setRatingStars","ratingHovered","setRatingHovered","newState","isFull","isPending","isHighlighted","isChecked","ratingValue","useStarRating","onInputChange","modifierClasses","onMouseEnter","onMouseLeave","focusOnError","createDecorator","RocForm","debug","destroyOnUnregister","initialValuesEqual","keepDirtyOnReinitialize","validateOnBlur","decorators","mutators","getTabDivElement","tabId","divElements","querySelector","HTMLDivElement","getTabLiElement","listElements","HTMLLIElement","RocOptionsTable","RocOptionsTableTitle","ProductSelectableAttributesList","simpleSelections","field","classNamePrefix","BulkAddToList","openListModal","setOpenListModal","modalOpen","setModalOpen","addToListResponse","setAddToListResponse","confirmationPopupOpen","setConfirmationPopupOpen","addingToList","setAddingToList","triggerRef","validationResult","handleListModal","isUserSignedIn","handleAddToList","useCallback","itemsToAddToList","clearSelectedItems","summary","organization","organizationOption","Organization","splice","every","BulkAddedToListAlert","setPopupOpen","errorMessages","ProductDetailsContext","createContext","useProductDetailsContext","context","useContext","SimpleProductsListing","productDetails","userIsSignedIn","isPurchaseable","selectedItems","setSelectedItems","childrenData","setChildrenData","fetchChildrenData","p","alternateProductDetailsDom","updateSelectedItem","selectedPricingLineId","newItems","simplesListing","child","SimpleProductsListingRow","BulkAddToCartButton","itemsToAdd","createPortal","setSelectedPricingLineId","setQuantity","defaultAsset","mainImage","productUrl","displayPricing","displayPriceLine","getDetail","SimpleProductQtyUOM","selectedPricingLine","onQuantityUpdate","itemName","availability","selectedProductPricingLineId","setSelectedProductPricingLineId","autoComplete","tabIndex","isNaN","updateQuantity","addingToCart","setAddingToCart","isViewCartActive","setIsViewCartActive","setErrorMessages","bulkAddToCartResponse","setBulkAddToCartResponse","UseShoppingCartResult","errorTitle","cartFull","productOutOfStock","productUnavailable","handleBulkAddToCart","orderErrorMessages","om","RedirectToCart","AssertionError","m","setPrototypeOf","ProductAvailabilityHCL","backOrder","outOfStock","callForAvailability","ProductAddToCart","UseProductDetailsResult","setSelectedPricingLine","isPricingLineUnavailable","addToCartResponse","setAddToCartResponse","numberOfItems","setNumberOfItems","cartErrorMessage","allSelectionsSelected","Simple","handleAddToCart","addOnsHandleSubmitWithError","handleUpdateQuantity","qty","arg","assertNotNullish","print","xlinkHref","AddedToListAlert","ProductAddToListModal","ProductAddToList","displaySelectionsErrorMessage","setDisplaySelectionsErrorMessage","TabType","callLocations","ProductRating","reviewsSummary","standardReviewsSummary","tabs","hasReviewTab","some","tabViewChunk","tab","tabType","Reviews","reviewTabs","model","trace","stack","optionalParams","warnOnce","averageRating","reviewCount","setUserIsSignedIn","getUserIsSignedIn","isSignedIn","rating","round","reviewText","reviewsTabs","getElementsByClassName","reviews","HTMLElement","scrollTo","offsetTop","getCheckedLabel","checkedValue","ProductSelections","setSelections","isInitialLoad","setIsInitialLoad","initialSelectionsValidated","setInitialSelectionsValidated","checkedSelections","checkedSelectionValueIds","checkedSelection","checkedSelectionValueMatch","checkedSelectionValue","checkedSelectionValueId","simpleProducts","simpleProductMatch","simpleProduct","simpleProductSelection","updateValidSelections","onSimpleProductSelected","onSimpleProductCleared","autoSelectFirstProduct","hasMatchingSimpleProduct","matchingSelectionValue","firstValidSelectionValue","v","valid","searchParams","firstSimple","matchingSelection","matchingValue","handleSelection","selectionsToUpdate","newSelections","checkedValues","currSelection","currSelectionValue","newSelection","newSelectionValue","hasValidPath","permutationSelection","valuesToCheck","currentList","hasMatch","clickedSelectionValueIsValid","selectionIndex","selectionLabel","useSwatches","swatchUrl","selectionClassNames","usePartialDataLoader","initialState","partialData","setPartialData","isLoading","setIsLoading","hasError","setHasError","isKeyLoading","dataLoaderFn","missingData","providedKeys","literal","valueOf","loadData","isLoadingAny","useProductDetails","loaderOptions","simpleProductLoading","setSimpleProductLoading","loggedInUserFirstName","setLoggedInUserFirstName","productStateOverride","setInternalProductStateOverride","productQuantity","setProductQuantity","productData","groupId","Group","setProductStateOverride","originalState","fixedNewState","newTabs","newTabsMap","oldTab","foldTabs","unavailabilityReason","ProductLists","GetSalePercentageSummary","discount","getSimpleDiscount","getAmbiguousDiscount","ProductPriceBreaks","qtyRanges","availablePricing","getAvailablePrices","qtyRange","pricing","ProductBreadcrumbs","headerDom","breadcrumbComponent","canGoBack","ProductMedia","mainLeftDom","productAssets","ProductHeader","mainInfoHeaderDom","productHeaderInfo","ProductSelectionsRegion","productAddOns","childProductAddOnNames","setChildProductAddOnNames","productAddOnData","availableChildProductAddOns","productSelectionsDom","ProductAddOnsComponent","productSelections","simpleProductData","newProductData","UpdateSSRData","groupProductData","newGroupProductData","arrayMutators","unitOfMeasureId","updateTabContents","tabChunk","rawHtml","div","li","hidden","outerHTML","mutatedDiv","contains","brand","pageTitle","PageTitleSuffix","replaceState","brandDiv","getElementByTestId","brandName","brandLogo","logoUrl","getElementsByTestId","productSkuContainer","productSkuText","productSkuValue","productMpnContainer","productMpnText","productMpnValue","manufacturerPartNumber","productGroupName","ProductDetails","setCanGoBack","getLoggedInUserFirstName","firstName","widgetGuid","hasItems","el","tabDiv","closest","visible","toggle","updateTabVisibility","sessionStorage","removeItem","Provider","useAlternateProductDetails","FolderSVG","GarbageCanCircleSVG","StatusDisplay","Published","Inactive","Deleted","Draft","Archived","OrganizationUIComponents","ORGANIZATION_PREFIX","ORGANIZATION_USERS_URL","ORGANIZATION_USERS_CREATE_URL","UPDATE_ORGANIZATION_USER_URL","UPDATE_USER_ORGANIZATION_STATUS_URL","UPDATE_USER_DEFAULT_ORGANIZATION_URL","INVALIDATE_USER_ORGANIZATION_NOTIFICATION_CACHE_URL","ORGANIZATION_SHIPTOS_URL","ORGANIZATION_ORDER_DETAILS","OrganizationOrderDetailsComponent","orderDetailsComponent","OrderDetailsUIComponent","DefaultOrganizationOrderDetails","ShiptosComponent","UsersComponent","OrganizationOrdersComponent","OrganizationUsersCreateComponent"],"mappings":"y/BA0JA,IAAMA,EAAwC,GAKxCC,EAA2C,GAKjD,SAASC,IACR,IAAMC,EAAsBC,OAG3BD,GACAA,EAAoBE,6BACpBC,MAAMC,QAAQJ,EAAoBE,8BAElCF,EAAoBE,4BAA4BG,SAAQ,SAACC,GACxD,cAAkBC,OAAOC,KAAKF,GAA9B,eAAoC,CAA/B,IAAMG,EAAG,KACbZ,EAAmBY,GAAOH,EAAIG,OAc3B,SAASC,EACfD,GAEC,2BADEE,EACF,iCADEA,EACF,kBAKD,GAJ+C,IAA3CJ,OAAOC,KAAKX,GAAoBe,QACnCb,KAGIF,IAAuBA,EAAmBY,GAQ9C,OALMX,EAAgBW,KACpBI,QAAQC,KAAKL,EAAK,2DAClBX,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AAK,kBAAM,8EAEpCs4B,EAAiBv4B,IAAMC,MAAK,kBAAM,+EAElCu4B,EAA8Bx4B,IAAMC,MACzC,kBAAM,6EAGDw4B,EAAmCz4B,IAAMC,MAC9C,kBAAM,8EAIN,sBAAC,IAAMgB,SAAP,CAAgBC,SAAU,kBAAC5F,EAAA,EAAD,OAGzB,kBAAC,IAAD,CAAO0e,OAAK,EAACC,KAAM+d,EAA0B/oB,UAAWqpB,IACxD,kBAAC,IAAD,CAAOte,OAAK,EAACC,KAAMyd,EAAwBzoB,UAAWspB,IACtD,kBAAC,IAAD,CAAOve,OAAK,EAACC,KAAM4D,EAAyB5O,UAAWupB,IACvD,kBAAC,IAAD,CAAOxe,OAAK,EAACC,KAAMge,EAA4BhpB,UAAWipB,IAC1D,kBAAC,IAAD,CAAOle,OAAK,EAACC,KAAM0d,EAA+B1oB,UAAWwpB,O","file":"product-details.18918a93.js","sourcesContent":["import { AddressResourceKeys } from 'features/address-book/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { CreatePasswordResourceKeys } from 'features/create-password/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport * as React from 'react';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n// #region Commerce\r\nimport { CommerceResourceKeys } from 'features/commerce/CommerceResourceKeys';\r\n// #endregion\r\n\r\n// #region HCL\r\nimport { QuickBagsResourceKeys } from 'features/hcl/quick-bags/resources';\r\nimport { QuickLabelsResourceKeys } from 'features/hcl/quick-labels/resources';\r\nimport { ProductCatalogsResourceKeys } from 'features/hcl/product-catalogs/resources';\r\nimport { FileUploadResourceKeys } from 'features/hcl/file-upload/resources';\r\nimport { NewsletterKeys } from 'features/hcl/newsletter-signup/resources';\r\n// #endregion\r\n\r\n/**\r\n * Type that will hold all the global localization keys\r\n */\r\ntype LocalizerGlobalResourceKeys =\r\n\t| 'Success'\r\n\t| 'OfTotalPages'\r\n\t| 'Cancel'\r\n\t| 'Confirm'\r\n\t| 'FirstName'\r\n\t| 'LastName'\r\n\t| 'Email'\r\n\t| 'Username'\r\n\t| 'Amount'\r\n\t| 'NameOnCard'\r\n\t| 'CardNumber'\r\n\t| 'ExpDate'\r\n\t| 'ExpMonth'\r\n\t| 'ExpYear'\r\n\t| 'Expires'\r\n\t| 'Expired'\r\n\t| 'SecurityCode'\r\n\t| 'Submit'\r\n\t| 'Save'\r\n\t| 'ZipCode'\r\n\t| 'Remove'\r\n\t| 'Removed'\r\n\t| 'Update'\r\n\t| 'Undo'\r\n\t| 'Cancel'\r\n\t| 'Enter'\r\n\t| 'Close'\r\n\t| 'SortBy'\r\n\t| 'PleaseWait'\r\n\t| 'Unknown'\r\n\t| 'Yes'\r\n\t| 'No'\r\n\t| 'Delete'\r\n\t| 'Update'\r\n\t| 'SaveAndContinueButtonText'\r\n\t| 'SaveAndContinue'\r\n\t| 'Continue'\r\n\t| 'SaveErrorMessage'\r\n\t| 'Edit'\r\n\t| 'ErrorMessageGenericTitle'\r\n\t| 'CheckEnteredValues'\r\n\t| 'ErrorMessageForbidden'\r\n\t| 'ErrorMessageNetwork'\r\n\t| 'ErrorOccurredSubmittingTheForm'\r\n\t| 'UnexpectedErrorOccurred'\r\n\t| 'Login'\r\n\t| 'ReturnToShipping'\r\n\t| 'BreadcrumbsLabel'\r\n\t| 'Other'\r\n\t| 'RememberMe'\r\n\t| 'ForgotYourPassword'\r\n\t| 'RegisterNewUserLinkText'\r\n\t| 'LoginPageTitleText'\r\n\t| 'ForgotPasswordPageTitle'\r\n\t| 'ForgotPasswordConfirmationPageTitle'\r\n\t| 'ForgotPasswordConfirmation'\r\n\t| 'Optional'\r\n\t| 'SearchBoxPlaceholder'\r\n\t| 'XOutOfYStars'\r\n\t| 'XToYOfZ'\r\n\t| 'ModalLabel'\r\n\t| 'RequiredFields'\r\n\t| 'Status'\r\n\t| 'Version'\r\n\t| 'CreatedOn'\r\n\t| 'CreatedBy'\r\n\t| 'ModifiedOn'\r\n\t| 'ModifiedBy'\r\n\t| 'OpenStatusInformation'\r\n\t| 'CloseStatusInformation'\r\n\t| 'SearchFilter'\r\n\t| 'Pagination'\r\n\t| 'Previous'\r\n\t| 'Next'\r\n\t| 'ClearFilter';\r\n\r\n/**\r\n * Type that will hold all the localization keys\r\n */\r\nexport type LocalizerResourceKey =\r\n\t| LocalizerGlobalResourceKeys\r\n\t| LoginResourceKeys\r\n\t| ContactFormResourceKeys\r\n\t// #region Commerce\r\n\t| CommerceResourceKeys\r\n\t// #endregion\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys\r\n\t| AddressResourceKeys\r\n\t// #region HCL\r\n\t| QuickBagsResourceKeys\r\n\t| QuickLabelsResourceKeys\r\n\t| ProductCatalogsResourceKeys\r\n\t| NewsletterKeys\r\n\t| FileUploadResourceKeys;\r\n// #endregion\r\n\r\n/**\r\n * Interface for the resources\r\n *\r\n * @export\r\n * @interface LocalizerResource\r\n */\r\ninterface LocalizerResource {\r\n\t[id: string]: string;\r\n}\r\n\r\n/**\r\n * Extends Window with a property that will hold the localizer resources\r\n *\r\n * @interface WindowWithResources\r\n * @extends {Window}\r\n */\r\nexport interface WindowWithResources extends Window {\r\n\t__ROC_LOCALIZER_RESOURCES__?: LocalizerResource[];\r\n}\r\n\r\n/**\r\n * Main object that will hold all the localized resources\r\n */\r\nconst LocalizerResources: LocalizerResource = {};\r\n\r\n/**\r\n * To prevent redundant logging\r\n */\r\nconst isAlreadyLogged: Record = {};\r\n\r\n/**\r\n * Initializer function that will populate the main localized resources object\r\n */\r\nfunction initializeLocalizerResources() {\r\n\tconst windowWithResources = window as WindowWithResources;\r\n\r\n\tif (\r\n\t\twindowWithResources &&\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__ &&\r\n\t\tArray.isArray(windowWithResources.__ROC_LOCALIZER_RESOURCES__)\r\n\t) {\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__.forEach((obj) => {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tLocalizerResources[key] = obj[key];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that can be used to load the localized strings with support to parameter replacements\r\n *\r\n * @export\r\n * @param {string} key\r\n * @param {...string[]} replaceStrings\r\n * @returns\r\n */\r\nexport function Localizer(\r\n\tkey: TResourceKey,\r\n\t...replaceStrings: string[]\r\n) {\r\n\tif (Object.keys(LocalizerResources).length === 0) {\r\n\t\tinitializeLocalizerResources();\r\n\t}\r\n\r\n\tif (!LocalizerResources || !LocalizerResources[key]) {\r\n\t\t// if running in a test environment, just skip any warnings.\r\n\t\tif (process.env.NODE_ENV !== 'test') {\r\n\t\t\tif (!isAlreadyLogged[key]) {\r\n\t\t\t\tconsole.warn(key, 'Localizer Resource not found. Key will be used instead.');\r\n\t\t\t\tisAlreadyLogged[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn key;\r\n\t}\r\n\r\n\tconst resource = LocalizerResources[key];\r\n\r\n\tif (!replaceStrings) {\r\n\t\treturn resource;\r\n\t}\r\n\r\n\treturn resource.replace(/{(\\d+)}/g, (match: string, index: number) => {\r\n\t\treturn replaceStrings[index] ? replaceStrings[index] : '';\r\n\t});\r\n}\r\n\r\n/**\r\n * Interface for the LocalizedSpan component\r\n *\r\n * @interface LocalizedSpanProps\r\n */\r\ninterface LocalizedSpanProps {\r\n\tresourceKey: LocalizerResourceKey;\r\n\targs?: string[];\r\n}\r\n\r\n/**\r\n * Component responsible for the initialization of the react app\r\n */\r\nexport function LocalizedSpan(props: LocalizedSpanProps) {\r\n\tconst { resourceKey, args = [] } = props;\r\n\tconst localizedString = Localizer(resourceKey, ...args);\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","export interface Asset {\r\n\t/**\r\n\t * The asset's type\r\n\t */\r\n\tassetType: AssetType;\r\n\t/**\r\n\t * The asset's url\r\n\t */\r\n\tassetUrl: string;\r\n}\r\n\r\nexport enum AssetType {\r\n\tImage = 'Image',\r\n\tMedia = 'Media',\r\n\tDocument = 'Document',\r\n\tYouTube = 'YouTube',\r\n}\r\n\r\n/**\r\n * Image Dimension\r\n */\r\nexport interface AssetDimension {\r\n\t/**\r\n\t * The label of image dimension\r\n\t */\r\n\tLabel: string;\r\n\tWidth: number;\r\n\tHeight: number;\r\n}\r\n","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!./style.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".react-toggle {\\n touch-action: pan-x;\\n\\n display: inline-block;\\n position: relative;\\n cursor: pointer;\\n background-color: transparent;\\n border: 0;\\n padding: 0;\\n\\n -webkit-touch-callout: none;\\n -webkit-user-select: none;\\n -khtml-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n\\n -webkit-tap-highlight-color: rgba(0,0,0,0);\\n -webkit-tap-highlight-color: transparent;\\n}\\n\\n.react-toggle-screenreader-only {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n margin: -1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px;\\n}\\n\\n.react-toggle--disabled {\\n cursor: not-allowed;\\n opacity: 0.5;\\n -webkit-transition: opacity 0.25s;\\n transition: opacity 0.25s;\\n}\\n\\n.react-toggle-track {\\n width: 50px;\\n height: 24px;\\n padding: 0;\\n border-radius: 30px;\\n background-color: #4D4D4D;\\n -webkit-transition: all 0.2s ease;\\n -moz-transition: all 0.2s ease;\\n transition: all 0.2s ease;\\n}\\n\\n.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #000000;\\n}\\n\\n.react-toggle--checked .react-toggle-track {\\n background-color: #19AB27;\\n}\\n\\n.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {\\n background-color: #128D15;\\n}\\n\\n.react-toggle-track-check {\\n position: absolute;\\n width: 14px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n left: 8px;\\n opacity: 0;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-check {\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle-track-x {\\n position: absolute;\\n width: 10px;\\n height: 10px;\\n top: 0px;\\n bottom: 0px;\\n margin-top: auto;\\n margin-bottom: auto;\\n line-height: 0;\\n right: 10px;\\n opacity: 1;\\n -webkit-transition: opacity 0.25s ease;\\n -moz-transition: opacity 0.25s ease;\\n transition: opacity 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-track-x {\\n opacity: 0;\\n}\\n\\n.react-toggle-thumb {\\n transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;\\n position: absolute;\\n top: 1px;\\n left: 1px;\\n width: 22px;\\n height: 22px;\\n border: 1px solid #4D4D4D;\\n border-radius: 50%;\\n background-color: #FAFAFA;\\n\\n -webkit-box-sizing: border-box;\\n -moz-box-sizing: border-box;\\n box-sizing: border-box;\\n\\n -webkit-transition: all 0.25s ease;\\n -moz-transition: all 0.25s ease;\\n transition: all 0.25s ease;\\n}\\n\\n.react-toggle--checked .react-toggle-thumb {\\n left: 27px;\\n border-color: #19AB27;\\n}\\n\\n.react-toggle--focus .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 3px 2px #0099E0;\\n -moz-box-shadow: 0px 0px 3px 2px #0099E0;\\n box-shadow: 0px 0px 2px 3px #0099E0;\\n}\\n\\n.react-toggle:active:not(.react-toggle--disabled) .react-toggle-thumb {\\n -webkit-box-shadow: 0px 0px 5px 5px #0099E0;\\n -moz-box-shadow: 0px 0px 5px 5px #0099E0;\\n box-shadow: 0px 0px 5px 5px #0099E0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * An alert sent to users regarding products or promotions\r\n */\r\nexport interface OrderMessage {\r\n\tmessage: string;\r\n\tmessageAction: OrderMessageAction;\r\n}\r\n\r\n/**\r\n * The level of action to be taken with an order message\r\n */\r\nexport enum OrderMessageAction {\r\n\tInfo = 'Info',\r\n\tWarning = 'Warning',\r\n\tError = 'Error',\r\n\tRedirectToCart = 'RedirectToCart',\r\n}\r\n\r\ninterface OrderMessagesProps {\r\n\torderMessages?: OrderMessage[];\r\n\tactions?: OrderMessageAction[];\r\n}\r\n\r\n/**\r\n * Custom component to notify the customer if cart has been updated which includes :\r\n * 1- Cart items pricing has been updated\r\n * 2- Cart Items availability has been updated\r\n * 3- Cart applied promotion expired\r\n */\r\nfunction OrderMessages(props: OrderMessagesProps) {\r\n\tconst { orderMessages, actions } = props;\r\n\r\n\tconst messages =\r\n\t\tactions == null\r\n\t\t\t? orderMessages\r\n\t\t\t: orderMessages?.filter((orderMessage) => actions?.includes(orderMessage.messageAction));\r\n\r\n\t// Component is omitted if actions filtered out all the messages or there were none to begin with\r\n\tif (messages == null || messages.length === 0) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{Localizer('OrderMessagesText')}\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t{messages.map((orderMessage, index) => (\r\n\t\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default OrderMessages;\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\r\n(function () {\r\n\tif (typeof window.CustomEvent === 'function') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction CustomEvent(event, params) {\r\n\t\tparams = params || { bubbles: false, cancelable: false, detail: undefined };\r\n\t\t// eslint-disable-next-line\r\n\t\tvar evt = document.createEvent('CustomEvent');\r\n\t\tevt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n\t\treturn evt;\r\n\t}\r\n\r\n\tCustomEvent.prototype = window.Event.prototype;\r\n\r\n\twindow.CustomEvent = CustomEvent;\r\n})();\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Left chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction LeftChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default LeftChevronSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction DownChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DownChevronSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction UpChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default UpChevronSVG;\r\n","import Axios, { AxiosError, CancelTokenSource } from 'axios';\r\nimport { useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { Localizer } from 'services/Localizer';\r\nimport {\r\n\tAddAllToCartResponse,\r\n\tAddToCartResponse,\r\n\tBulkAddToCartResponse,\r\n\tCartSummary,\r\n\tGetCartResult,\r\n\tMoveSavedProductToCartResult,\r\n} from 'services/UserData.Commerce';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { AddToCartExceptionCode, ProductAddOnDto } from '../product-details/types';\r\nimport { OrderMessage } from './OrderMessages';\r\nimport {\r\n\tAddAllToCartProps as AddAllToCartParams,\r\n\tAddToCartProps as AddToCartParams,\r\n\tBulkAddToCartProps,\r\n\tGetSavedProductsResult,\r\n\tMoveStatus,\r\n\tOrder,\r\n\tOrderItem,\r\n\tOrderRecipient,\r\n} from './types';\r\n\r\nexport interface UseShoppingCart {\r\n\tstate: UseShoppingCartState;\r\n\tactor: UseShoppingCartActor;\r\n}\r\n\r\nexport interface UseShoppingCartState {\r\n\torder?: Order | null;\r\n\tsavedProducts?: GetSavedProductsResult | null;\r\n\tcartTotalItemCount: number;\r\n\r\n\torderIsUpdating: boolean;\r\n\tupdatingOrderItemId: string | null;\r\n\torderItemBeingRemovedId: string | null;\r\n\tupdatingSavedProductId: string | null;\r\n\tupdatingSavedProductPricingLineId: string | null;\r\n\tsavedProductBeingRemovedId: string | null;\r\n\tsavedProductBeingRemovedPricingLineId: string | null;\r\n\r\n\tstoredForUndoItem: OrderItem | null;\r\n\tstoredForUndoItemIndex: {\r\n\t\trecipientId: string;\r\n\t\titemIndex: number;\r\n\t} | null;\r\n\tlastMoveStatus: MoveStatus | null;\r\n\tisUndoClickedState: boolean;\r\n\r\n\terrorMessage: string | null;\r\n\terror: Error | AxiosError | null;\r\n\terrorType: AddToCartExceptionCode | null;\r\n}\r\n\r\nexport interface UseShoppingCartActor {\r\n\taddToCart: (props: AddToCartParams) => Promise;\r\n\tbulkAddToCart: (props: BulkAddToCartProps) => Promise;\r\n\taddAllFromListToCurrentCart: (props: AddAllToCartParams) => Promise;\r\n\taddAllFromListToNewCart: (props: AddAllToCartParams) => Promise;\r\n\tchangeOrderItemQuantity: (itemToUpdate: OrderItem, newQuantity: number) => Promise;\r\n\tupdateOrderItemAddOns: (itemToUpdate: OrderItem, updatedAddOns: ProductAddOnDto[]) => Promise;\r\n\tmoveItemToSaved: (itemToMove: OrderItem) => Promise;\r\n\tremoveOrderItem: (itemToRemove: OrderItem) => Promise;\r\n\r\n\taddToSavedProducts: (itemToAdd: OrderItem) => Promise;\r\n\tmoveSavedProductToCart: (\r\n\t\tproductToMoveId: string,\r\n\t\tproductName: string,\r\n\t\tpricingLineId: string,\r\n\t\tquantity: number,\r\n\t\taddOns?: ProductAddOnDto[],\r\n\t) => Promise;\r\n\tremoveSavedProduct: (\r\n\t\tproductToRemoveId: string,\r\n\t\tproductToRemoveName: string,\r\n\t\tpricingLineId: string,\r\n\t\taddOns?: ProductAddOnDto[],\r\n\t) => Promise;\r\n\r\n\tsetErrorMessage: (errorMessage: string | null) => void;\r\n\tsetError: (error: Error | AxiosError | null) => void;\r\n\thandleUndo: () => Promise;\r\n\r\n\tupdateOrder: (newCart: Order) => void;\r\n\t/**\r\n\t * Sets order messages to displayed whenever the server returns order related ajax requests\r\n\t * within any component tgat is using this hook.\r\n\t */\r\n\tupdateOrderMessages: (orderMessages: OrderMessage[]) => void;\r\n\tsetUpdatingOrderItemId: (orderItemId: string | null) => void;\r\n}\r\n\r\nexport interface UseShoppingCartParams {\r\n\torder?: Order | null;\r\n\tsetOrder?: (order: Order) => void;\r\n\tsavedProducts?: GetSavedProductsResult | null;\r\n\tsetSavedProducts?: (savedProducts: GetSavedProductsResult) => void;\r\n\tcartSummary?: CartSummary | null;\r\n\tsetCartSummary?: (cartSummary: CartSummary) => void;\r\n\torderMessages?: OrderMessage[];\r\n\tsetOrderMessages?: (orderMessages: OrderMessage[]) => void;\r\n}\r\n\r\n/**\r\n * Reusable hook to access ShoppingCart-related endpoints on the server, as well as helping manage\r\n * the items inside the shopping cart.\r\n */\r\nexport default function useShoppingCart(useShoppingCartParams?: UseShoppingCartParams): UseShoppingCart {\r\n\tconst params = useShoppingCartParams || {};\r\n\tconst { order, setOrder, savedProducts, setSavedProducts, setCartSummary, setOrderMessages } = params;\r\n\r\n\t// to indicate that a cart is being updated after its item has been removed/updated\r\n\tconst [updatingOrderItemId, setUpdatingOrderItemId] = useState(null);\r\n\r\n\t// to store the id of the order item being removed\r\n\tconst [orderItemBeingRemovedId, setOrderItemBeingRemovedId] = useState(null);\r\n\r\n\t// total items count in the cart\r\n\tconst [cartTotalItemCount, setCartTotalItemCount] = useState(0);\r\n\r\n\t// to store the id and the unit of measure id of the item being moved\r\n\tconst [updatingSavedProductId, setUpdatingSavedProductId] = useState(null);\r\n\tconst [updatingSavedProductPricingLineId, setUpdatingSavedProductPricingLineId] = useState(null);\r\n\r\n\t// to store the id and the unit of measure id of the item being removed\r\n\tconst [savedProductBeingRemovedId, setSavedProductBeingRemovedId] = useState(null);\r\n\tconst [savedProductBeingRemovedPricingLineId, setSavedProductBeingRemovedPricingLineId] = useState(\r\n\t\tnull,\r\n\t);\r\n\r\n\t// stores the last removed item and item index to be able to undo the last move or removal\r\n\tconst [storedForUndoItem, setStoredForUndoItem] = useState(null);\r\n\tconst [storedForUndoItemIndex, setStoredForUndoItemIndex] = useState<{\r\n\t\trecipientId: string;\r\n\t\titemIndex: number;\r\n\t} | null>(null);\r\n\r\n\t// stores what the last action was, such as removing an item from the cart or moving an item to the saved products list\r\n\tconst [lastMoveStatus, setLastMoveStatus] = useState(null);\r\n\r\n\t// stores whether the undo button was clicked, to decide whether to clear the undo state when running a function or not\r\n\tlet isUndoClicked: boolean = false;\r\n\tconst [isUndoClickedState, setIsUndoClickedState] = useState(false);\r\n\r\n\t// stores the error message and error type to display\r\n\tconst [error, setError] = useState(null);\r\n\tconst [errorMessage, setErrorMessage] = useState(null);\r\n\tconst [errorType, setErrorType] = useState(null);\r\n\r\n\t// whether the order is updating\r\n\tconst orderIsUpdating =\r\n\t\t(orderItemBeingRemovedId ||\r\n\t\t\tupdatingOrderItemId ||\r\n\t\t\tupdatingSavedProductId ||\r\n\t\t\tupdatingSavedProductPricingLineId ||\r\n\t\t\tsavedProductBeingRemovedId ||\r\n\t\t\tsavedProductBeingRemovedPricingLineId) != null || isUndoClickedState;\r\n\r\n\tconst clearUndoState = () => {\r\n\t\tsetStoredForUndoItem(null);\r\n\t\tsetStoredForUndoItemIndex(null);\r\n\t\tsetLastMoveStatus(null);\r\n\t};\r\n\r\n\tconst dispatchAddToCartEvent = (result: AddToCartResponse) => {\r\n\t\tdispatchRocEvent('added-to-cart', {\r\n\t\t\titems: [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: result.productId,\r\n\t\t\t\t\tadjustedQuantity: result.adjustedQuantity,\r\n\t\t\t\t\tname: result.name,\r\n\t\t\t\t\tprice: result.snapshotSalePrice ? result.snapshotSalePrice : result.snapshotBasePrice,\r\n\t\t\t\t\tsku: result.sku,\r\n\t\t\t\t\tcurrency: result.snapshotCurrencyISO,\r\n\t\t\t\t\tproductGroupId: result.productGroupId,\r\n\t\t\t\t\tselections: result.selections,\r\n\t\t\t\t},\r\n\t\t\t],\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the cart, saved products, and cart summary\r\n\t * @param response\r\n\t * @param cartSummary\r\n\t */\r\n\tconst updateCartState = (response?: GetCartResult | null) => {\r\n\t\tif (!response) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (response.cart) {\r\n\t\t\tif (!setOrder) {\r\n\t\t\t\tconsole.warn('setOrder called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetOrder(response.cart);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (response.savedProducts) {\r\n\t\t\tif (!setSavedProducts) {\r\n\t\t\t\tconsole.warn('setSavedProducts called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetSavedProducts(response.savedProducts);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (response.cartSummary) {\r\n\t\t\tif (!setCartSummary) {\r\n\t\t\t\tconsole.warn('setCartSummary called but not defined.');\r\n\t\t\t} else {\r\n\t\t\t\tsetCartSummary(response.cartSummary);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdateOrderMessages(response.orderMessages);\r\n\t};\r\n\r\n\t// this runs when the component is mounted and every time the order changes because we want\r\n\t// to recalculate cart total item count\r\n\tuseEffect(() => {\r\n\t\tif (!order) {\r\n\t\t\tsetCartTotalItemCount(0);\r\n\t\t} else {\r\n\t\t\tconst itemsCount = order.recipients.reduce((itemsQty: number, orderRecipient: OrderRecipient) => {\r\n\t\t\t\titemsQty += orderRecipient.items.reduce((recipientQty: number, orderItem: OrderItem) => {\r\n\t\t\t\t\trecipientQty += orderItem.quantity;\r\n\t\t\t\t\treturn recipientQty;\r\n\t\t\t\t}, 0);\r\n\t\t\t\treturn itemsQty;\r\n\t\t\t}, 0);\r\n\r\n\t\t\tsetCartTotalItemCount(itemsCount);\r\n\t\t}\r\n\t\tclearUndoState();\r\n\t}, [order]);\r\n\r\n\t//#region Shopping Cart\r\n\r\n\t/**\r\n\t * Adds the last removed item to the cart\r\n\t */\r\n\tconst addToCart = async (props: AddToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(props.itemId);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart', {\r\n\t\t\t\tproductId: props.itemId,\r\n\t\t\t\tquantity: props.quantity,\r\n\t\t\t\tproductPricingLineId: props.productPricingLineId,\r\n\t\t\t\tsavedProductsPageNumber: savedProducts?.pagination?.pageNumber || 1,\r\n\t\t\t\tsavedProductsPageSize: savedProducts?.pagination?.pageSize || 1000000,\r\n\t\t\t\taddOns: props.addOns,\r\n\t\t\t\tvalidateAddOns: props.validateAddOns ?? false,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data) {\r\n\t\t\t\tdispatchAddToCartEvent(response.data);\r\n\t\t\t}\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when undoing a remove from cart action', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthrow error;\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Adds multiple items to cart\r\n\t */\r\n\tconst bulkAddToCart = async (props: BulkAddToCartProps) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tprops.items.forEach((element) => {\r\n\t\t\tsetUpdatingOrderItemId(element.itemId);\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tconst request = {\r\n\t\t\t\tproductInfo: props.items.map((item, index) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tproductId: item.itemId,\r\n\t\t\t\t\t\tproductPricingLineId: item.productPricingLineId,\r\n\t\t\t\t\t\tquantity: item.quantity,\r\n\t\t\t\t\t\tindex: index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}),\r\n\t\t\t};\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/bulk', request);\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data.processedItems && response.data.processedItems.length > 0) {\r\n\t\t\t\tdispatchRocEvent('added-to-cart', {\r\n\t\t\t\t\titems: response.data.processedItems.map((item) => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tadjustedQuantity: item.adjustedQuantity,\r\n\t\t\t\t\t\t\tid: item.productId,\r\n\t\t\t\t\t\t\tname: item.name,\r\n\t\t\t\t\t\t\tsku: item.sku,\r\n\t\t\t\t\t\t\tprice: item.snapshotSalePrice ? item.snapshotSalePrice : item.snapshotBasePrice,\r\n\t\t\t\t\t\t\tcurrency: item.snapshotCurrencyISO,\r\n\t\t\t\t\t\t\tproductGroupId: item.productGroupId,\r\n\t\t\t\t\t\t\tselections: item.selections,\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}),\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when undoing a remove from cart action', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Add all items from the specified shopping list to the cart\r\n\t */\r\n\tconst addAllFromListToCurrentCart = async (props: AddAllToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}/to-cart`,\r\n\t\t\t\t{\r\n\t\t\t\t\tdisplayedItemsCount: 3,\r\n\t\t\t\t\tshoppingListProductIds: props.selectedShoppingListProductIds,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding all products to cart', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Add all items from the specified shopping list to the new cart\r\n\t */\r\n\tconst addAllFromListToNewCart = async (props: AddAllToCartParams) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}/to-new-cart`,\r\n\t\t\t\t{\r\n\t\t\t\t\tdisplayedItemsCount: 3,\r\n\t\t\t\t\tshoppingListProductIds: props.selectedShoppingListProductIds,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding all products to cart', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t\tif (axiosError.response.data.exceptionCode) {\r\n\t\t\t\t\tsetErrorType(axiosError.response.data.exceptionCode);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Moves a product from the shopping cart to the user's saved products list\r\n\t * @param itemToMove\r\n\t */\r\n\tconst moveItemToSaved = async (itemToMove: OrderItem) => {\r\n\t\tif (!setSavedProducts || !setOrder || !order) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Saved product move to cart requested with one or more of the following undefined:\\n' +\r\n\t\t\t\t\t'setSavedProducts, setOrder, order',\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(itemToMove.id);\r\n\r\n\t\ttry {\r\n\t\t\tif (!order || !order.recipients) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/from-cart', {\r\n\t\t\t\tproductId: itemToMove.product.id,\r\n\t\t\t\titemId: itemToMove.id,\r\n\t\t\t\tproductPricingLineId: itemToMove.pricingLine.id,\r\n\t\t\t\tquantity: itemToMove.quantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t\taddOns: itemToMove.addOns,\r\n\t\t\t});\r\n\r\n\t\t\t// Find and save the moved item index\r\n\t\t\torder.recipients.map((recipient) => {\r\n\t\t\t\tsetStoredForUndoItemIndex({\r\n\t\t\t\t\trecipientId: recipient.id,\r\n\t\t\t\t\titemIndex: recipient.items.indexOf(itemToMove),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetStoredForUndoItem(itemToMove);\r\n\t\t\tsetLastMoveStatus(MoveStatus.MovedToSaved);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when saving order item for later', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenSavingItem', itemToMove.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the quantity of the requested item with the new one\r\n\t * @param itemToUpdate\r\n\t * @param newQuantity\r\n\t */\r\n\tconst changeOrderItemQuantity = async (itemToUpdate: OrderItem, newQuantity: number) => {\r\n\t\tif (!setOrder) {\r\n\t\t\tconsole.warn('Item order quantity change requested with no setOrder function defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(itemToUpdate.id);\r\n\r\n\t\ttry {\r\n\t\t\tif (!order) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/update', {\r\n\t\t\t\titemId: itemToUpdate.id,\r\n\t\t\t\tquantity: newQuantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn(`Error when updating ${itemToUpdate.name}' quantity`, error);\r\n\r\n\t\t\tsetError(error);\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenUpdatingItem', itemToUpdate.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingOrderItemId(null);\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the add ons of the requested item with the new ones\r\n\t */\r\n\tconst updateOrderItemAddOns = async (itemToUpdate: OrderItem, updatedAddOns: ProductAddOnDto[]) => {\r\n\t\tif (!setOrder) {\r\n\t\t\tconsole.warn('Item order add ons change requested with no setOrder function defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingOrderItemId(itemToUpdate.id);\r\n\r\n\t\tif (!order) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\t\tconst response = await AxiosHelper.post(\r\n\t\t\t'/ajax/cart/edit-add-ons',\r\n\t\t\t{ itemId: itemToUpdate.id, addOns: updatedAddOns },\r\n\t\t\t{\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\tupdateCartState(response.data);\r\n\r\n\t\tsetUpdatingOrderItemId(null);\r\n\t\tclearUndoState();\r\n\t};\r\n\r\n\t/**\r\n\t * Removes the requested item from the cart\r\n\t * @param itemToRemove\r\n\t */\r\n\tconst removeOrderItem = async (itemToRemove: OrderItem) => {\r\n\t\tif (!setOrder || !order) {\r\n\t\t\tconsole.warn('Order item removal requested with no order or setOrder defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetOrderItemBeingRemovedId(itemToRemove.id);\r\n\r\n\t\ttry {\r\n\t\t\t// Find and save the moved item index\r\n\t\t\torder.recipients.map((recipient) => {\r\n\t\t\t\tsetStoredForUndoItemIndex({\r\n\t\t\t\t\trecipientId: recipient.id,\r\n\t\t\t\t\titemIndex: recipient.items.indexOf(itemToRemove),\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/cart/remove', {\r\n\t\t\t\titemId: itemToRemove.id,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetStoredForUndoItem(itemToRemove);\r\n\t\t\tsetLastMoveStatus(MoveStatus.RemovedFromCart);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\r\n\t\t\tsetErrorMessage(Localizer('ProblemWhenRemovingItem', itemToRemove.name));\r\n\t\t\tsetError(error);\r\n\t\t} finally {\r\n\t\t\tsetOrderItemBeingRemovedId(null);\r\n\t\t}\r\n\t};\r\n\t//#endregion\r\n\r\n\t//#region Save For Later\r\n\r\n\t/**\r\n\t * Handles adding an item to a saved products list\r\n\t * @param itemToAdd\r\n\t */\r\n\tconst addToSavedProducts = async (itemToAdd: OrderItem) => {\r\n\t\tif (!setSavedProducts) {\r\n\t\t\tconsole.warn('Add to saved products requested with no setSavedProducts defined.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingSavedProductId(itemToAdd.product.id);\r\n\r\n\t\ttry {\r\n\t\t\t// Don't need to set undo info here as there is no way to run this function unless you are undoing a removal\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/save-for-later', {\r\n\t\t\t\tproductId: itemToAdd.product.id,\r\n\t\t\t\tproductPricingLineId: itemToAdd.pricingLine.id,\r\n\t\t\t\tquantity: itemToAdd.quantity,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t\taddOns: itemToAdd.addOns,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenSavingItem', itemToAdd.name));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingSavedProductId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Moves a user's saved product to the shopping cart\r\n\t * @param productToMoveId\r\n\t * @param productName\r\n\t * @param productPricingLineId\r\n\t * @param quantity\r\n\t */\r\n\tconst moveSavedProductToCart = async (\r\n\t\tproductToMoveId: string,\r\n\t\tproductName: string,\r\n\t\tproductPricingLineId: string,\r\n\t\tquantity: number,\r\n\t\taddOns?: ProductAddOnDto[],\r\n\t) => {\r\n\t\tif (!setSavedProducts || !setOrder || !savedProducts) {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t'Saved product move to cart requested with one or more of the following undefined:\\n' +\r\n\t\t\t\t\t'setSavedProducts, setOrder, savedProducts.',\r\n\t\t\t);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(error);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetUpdatingSavedProductId(productToMoveId);\r\n\t\tsetUpdatingSavedProductPricingLineId(productPricingLineId);\r\n\r\n\t\ttry {\r\n\t\t\tif (!savedProducts || !savedProducts.results) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// find the index of the moved item in the saved products list\r\n\t\t\tconst savedProductIndex = savedProducts.results.findIndex(\r\n\t\t\t\t(product) => product.productId === productToMoveId,\r\n\t\t\t);\r\n\r\n\t\t\tconst response = await AxiosHelper.post('/ajax/saved-products/to-cart', {\r\n\t\t\t\tproductId: productToMoveId,\r\n\t\t\t\tquantity,\r\n\t\t\t\tproductPricingLineId: productPricingLineId,\r\n\t\t\t\tsavedProductsPageNumber:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageNumber) || 1,\r\n\t\t\t\tsavedProductsPageSize:\r\n\t\t\t\t\t(savedProducts && savedProducts.pagination && savedProducts.pagination.pageSize) || 1000000,\r\n\t\t\t\taddOns: addOns,\r\n\t\t\t});\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\r\n\t\t\tif (response.data.addToOrderResult) {\r\n\t\t\t\tdispatchAddToCartEvent(response.data.addToOrderResult);\r\n\t\t\t}\r\n\r\n\t\t\t// Find and save the moved item\r\n\t\t\tconst recipients = response.data.cart.recipients;\r\n\r\n\t\t\tfor (const recipient of recipients) {\r\n\t\t\t\tconst lastMovedItem = recipient.items.find(\r\n\t\t\t\t\t(item) => item.product.id === productToMoveId && item.pricingLine.id === productPricingLineId,\r\n\t\t\t\t);\r\n\t\t\t\tif (lastMovedItem) {\r\n\t\t\t\t\tsetStoredForUndoItem({ ...lastMovedItem, quantity });\r\n\t\t\t\t\tsetStoredForUndoItemIndex({ recipientId: recipient.id, itemIndex: savedProductIndex });\r\n\t\t\t\t\tconsole.log('Found last moved item');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsetLastMoveStatus(MoveStatus.MovedToCart);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when moving the saved product to the cart.', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data && axiosError.response.data.message) {\r\n\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t} else {\r\n\t\t\t\tsetErrorMessage(Localizer('ProblemWhenMovingSavedItemToCart', productName));\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tsetUpdatingSavedProductId(null);\r\n\t\t\tsetUpdatingSavedProductPricingLineId(null);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a user's saved product from their saved products list\r\n\t * @param productToRemoveId\r\n\t * @param productPricingLineId\r\n\t */\r\n\tconst removeSavedProduct = async (\r\n\t\tproductToRemoveId: string,\r\n\t\tproductToRemoveName: string,\r\n\t\tproductPricingLineId: string,\r\n\t\taddOns?: ProductAddOnDto[],\r\n\t) => {\r\n\t\tif (!setSavedProducts || !savedProducts) {\r\n\t\t\tconsole.warn('Saved product removal requested with savedProducts or setSavedProducts undefined');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!isUndoClicked) {\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\r\n\t\tsetSavedProductBeingRemovedId(productToRemoveId);\r\n\t\tsetSavedProductBeingRemovedPricingLineId(productPricingLineId);\r\n\r\n\t\ttry {\r\n\t\t\tif (!savedProducts.results) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst savedProductIndex = savedProducts.results.findIndex(\r\n\t\t\t\t(product) => product.productId === productToRemoveId,\r\n\t\t\t);\r\n\t\t\tconst savedProduct = savedProducts.results[savedProductIndex];\r\n\t\t\tconst response = await AxiosHelper.delete(\r\n\t\t\t\t'/ajax/saved-products/' +\r\n\t\t\t\t\tproductToRemoveId +\r\n\t\t\t\t\t'/' +\r\n\t\t\t\t\tproductPricingLineId +\r\n\t\t\t\t\t'?savedProductsPageNumber=' +\r\n\t\t\t\t\tsavedProducts.pagination.pageNumber.toString() +\r\n\t\t\t\t\t'&savedProductsPageSize=' +\r\n\t\t\t\t\tsavedProducts.pagination.pageSize.toString(),\r\n\t\t\t\t{\r\n\t\t\t\t\tdata: { addOns: addOns },\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\tif (savedProduct) {\r\n\t\t\t\t// Convert the SavedProduct into an OrderItem\r\n\t\t\t\tconst orderItemFromSaved: OrderItem = {\r\n\t\t\t\t\t...savedProduct,\r\n\t\t\t\t\tproduct: { ...savedProduct, id: savedProduct.productId },\r\n\t\t\t\t\ttotalPrice: savedProduct.totalPrice,\r\n\t\t\t\t\tunitPrice: savedProduct.unitPrice,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tsetStoredForUndoItem(orderItemFromSaved);\r\n\t\t\t\tsetStoredForUndoItemIndex({ recipientId: '', itemIndex: savedProductIndex });\r\n\t\t\t}\r\n\r\n\t\t\tupdateCartState(response.data);\r\n\t\t\tsetLastMoveStatus(MoveStatus.RemovedFromSaved);\r\n\t\t} catch (error) {\r\n\t\t\tclearUndoState();\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when removing the saved product.', error);\r\n\r\n\t\t\tsetErrorMessage(Localizer('ProblemWhenRemovingSavedItem', productToRemoveName));\r\n\t\t} finally {\r\n\t\t\tsetSavedProductBeingRemovedId(null);\r\n\t\t\tsetSavedProductBeingRemovedPricingLineId(null);\r\n\t\t}\r\n\t};\r\n\t//#endregion\r\n\r\n\t/**\r\n\t * Handle what happens when the Undo button is pressed\r\n\t */\r\n\tconst handleUndo = async () => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\tif (!lastMoveStatus == null || !storedForUndoItem) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tisUndoClicked = true;\r\n\t\tsetIsUndoClickedState(true);\r\n\r\n\t\ttry {\r\n\t\t\tswitch (lastMoveStatus) {\r\n\t\t\t\tcase MoveStatus.RemovedFromCart:\r\n\t\t\t\t\tawait addToCart({\r\n\t\t\t\t\t\titemId: storedForUndoItem.product.id,\r\n\t\t\t\t\t\tquantity: storedForUndoItem.quantity,\r\n\t\t\t\t\t\tproductPricingLineId: storedForUndoItem.pricingLine.id,\r\n\t\t\t\t\t\taddOns: storedForUndoItem.addOns,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.MovedToCart:\r\n\t\t\t\t\tawait moveItemToSaved(storedForUndoItem);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.MovedToSaved:\r\n\t\t\t\t\tawait moveSavedProductToCart(\r\n\t\t\t\t\t\tstoredForUndoItem.product.id,\r\n\t\t\t\t\t\tstoredForUndoItem.name,\r\n\t\t\t\t\t\tstoredForUndoItem.pricingLine.id,\r\n\t\t\t\t\t\tstoredForUndoItem.quantity,\r\n\t\t\t\t\t\tstoredForUndoItem.addOns,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase MoveStatus.RemovedFromSaved:\r\n\t\t\t\t\tawait addToSavedProducts(storedForUndoItem);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tisUndoClicked = false;\r\n\t\t\tsetIsUndoClickedState(false);\r\n\t\t\tclearUndoState();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Handles updating order\r\n\t * @param newCart\r\n\t */\r\n\tconst updateOrder = (newCart: Order) => {\r\n\t\tif (setOrder) {\r\n\t\t\tsetOrder(newCart);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Handles updating order messages\r\n\t * @param orderMessages Updated order messages\r\n\t */\r\n\tconst updateOrderMessages = (orderMessages: OrderMessage[]) => {\r\n\t\tif (!setOrderMessages) {\r\n\t\t\tconsole.warn('setOrderMessages called but not defined.');\r\n\t\t} else {\r\n\t\t\tsetOrderMessages(orderMessages);\r\n\t\t}\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\torderIsUpdating,\r\n\t\t\torder: useShoppingCartParams ? useShoppingCartParams.order : null,\r\n\t\t\tsavedProducts: useShoppingCartParams ? useShoppingCartParams.savedProducts : null,\r\n\t\t\tcartTotalItemCount,\r\n\r\n\t\t\tupdatingOrderItemId,\r\n\t\t\torderItemBeingRemovedId,\r\n\t\t\tupdatingSavedProductId,\r\n\t\t\tupdatingSavedProductPricingLineId,\r\n\t\t\tsavedProductBeingRemovedId,\r\n\t\t\tsavedProductBeingRemovedPricingLineId,\r\n\r\n\t\t\tstoredForUndoItem,\r\n\t\t\tstoredForUndoItemIndex,\r\n\t\t\tlastMoveStatus,\r\n\t\t\tisUndoClickedState,\r\n\r\n\t\t\terror,\r\n\t\t\terrorMessage,\r\n\t\t\terrorType,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\taddToCart,\r\n\t\t\tbulkAddToCart,\r\n\t\t\taddAllFromListToCurrentCart,\r\n\t\t\taddAllFromListToNewCart,\r\n\t\t\tchangeOrderItemQuantity,\r\n\t\t\tupdateOrderItemAddOns,\r\n\t\t\tmoveItemToSaved,\r\n\t\t\tremoveOrderItem,\r\n\r\n\t\t\taddToSavedProducts,\r\n\t\t\tmoveSavedProductToCart,\r\n\t\t\tremoveSavedProduct,\r\n\r\n\t\t\thandleUndo,\r\n\t\t\tsetErrorMessage,\r\n\t\t\tsetError,\r\n\r\n\t\t\tupdateOrder,\r\n\t\t\tupdateOrderMessages,\r\n\t\t\tsetUpdatingOrderItemId,\r\n\t\t},\r\n\t};\r\n}\r\n","import { useInView, IntersectionOptions, InViewHookResponse } from 'react-intersection-observer';\r\nimport { useEffect, useState } from 'react';\r\n\r\n/**\r\n * Wrapper hook to useInView so that it only triggers once. Useful for lazy-loaded content that\r\n * doesn't need to change once it's out of view.\r\n */\r\nexport function useInViewOnce(options: IntersectionOptions = {}): InViewHookResponse {\r\n\tconst inViewHookResponse = useInView(options);\r\n\tconst [viewed, setViewed] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (inViewHookResponse.inView) {\r\n\t\t\tsetViewed(true);\r\n\t\t}\r\n\t}, [inViewHookResponse.inView]);\r\n\r\n\tconst newResponse: InViewHookResponse = {\r\n\t\t...inViewHookResponse,\r\n\t\tinView: viewed,\r\n\t\t[0]: inViewHookResponse[0],\r\n\t\t[1]: viewed,\r\n\t\t[2]: inViewHookResponse[2],\r\n\t};\r\n\r\n\tfunction* makeIterator() {\r\n\t\tyield newResponse[0];\r\n\t\tyield newResponse[1];\r\n\t\tyield newResponse[2];\r\n\t}\r\n\r\n\tnewResponse[Symbol.iterator] = makeIterator;\r\n\r\n\treturn newResponse;\r\n}\r\n","import classnames from 'classnames';\r\nimport React, { ImgHTMLAttributes, useEffect, useState } from 'react';\r\nimport { useInViewOnce } from 'shared/hooks/useInViewOnce';\r\n\r\ninterface LazyImageProps extends ImgHTMLAttributes {\r\n\tplaceholderImg?: string;\r\n\tbackgroundImg?: boolean;\r\n\tclassName?: string;\r\n\tinactiveClassName?: string;\r\n\tloadedClassName?: string;\r\n\tdelay?: number;\r\n\talt: string;\r\n\tsrc: string;\r\n}\r\n\r\n/**\r\n * Component that will render an tag that will have its source image lazily loaded only once\r\n * the element is visible in the viewport.\r\n * @param props\r\n */\r\nexport default function LazyImage({\r\n\tplaceholderImg = '/images/placeholder/placeholder-image.png',\r\n\tsrc,\r\n\talt,\r\n\tbackgroundImg = false,\r\n\tdelay = 0,\r\n\tclassName,\r\n\tinactiveClassName = 'roc-lazy-image--inactive',\r\n\tloadedClassName = 'roc-lazy-image--loaded',\r\n\t...rest\r\n}: LazyImageProps) {\r\n\tconst [ref, viewed] = useInViewOnce({\r\n\t\tthreshold: 0,\r\n\t});\r\n\r\n\tconst [loadedClassDisplayed, setLoadedClassDisplayed] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (viewed) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tsetLoadedClassDisplayed(true);\r\n\t\t\t}, delay);\r\n\t\t}\r\n\t}, [viewed, delay]);\r\n\r\n\tconst imageSrc = viewed ? src : placeholderImg;\r\n\r\n\tconst classes = classnames(className, {\r\n\t\t[inactiveClassName]: !viewed,\r\n\t\t[loadedClassName]: loadedClassDisplayed,\r\n\t});\r\n\r\n\tif (backgroundImg) {\r\n\t\treturn
;\r\n\t} else {\r\n\t\treturn {alt};\r\n\t}\r\n}\r\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\n\r\n/**\r\n * Shopping Cart SVG\r\n *\r\n * @returns\r\n */\r\nfunction ShoppingCartSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nShoppingCartSVG.defaultProps = { className: '' };\r\n\r\nexport default ShoppingCartSVG;\r\n","var api = require(\"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../../node_modules/css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { ExternalLoginProvider } from 'features/login/ExternalLogins';\r\n\r\n/**\r\n * Extends Window with a property that will hold the client data\r\n *\r\n * @interface WindowWithClientData\r\n * @extends {Window}\r\n */\r\ninterface WindowWithServerData extends Window {\r\n\t__ROC_SERVER_DATA__?: Array<{\r\n\t\t[name: string]: string;\r\n\t}>;\r\n}\r\n\r\n/**\r\n * This type will hold all the keys that are used by ServerData\r\n */\r\ninterface ServerData {\r\n\tIsReCaptchaEnabled?: boolean;\r\n\tReCaptchaV3Key?: string;\r\n\tTimeZone?: string;\r\n\tUSE_EMAIL_AS_USERNAME?: boolean;\r\n\tRegistrationThankYouTitle?: string;\r\n\tRegistrationThankYouMessage?: string;\r\n\tForgotPasswordConfirmationTitle?: string;\r\n\tForgotPasswordConfirmationMessage?: string;\r\n\tPageTitleSuffix?: string;\r\n\tRequireConfirmEmail?: boolean;\r\n\tACCOUNT_URL_BASE?: string;\r\n\tACCOUNT_LOGIN_URL?: string;\r\n\tACCOUNT_LOGOUT_URL?: string;\r\n\tACCOUNT_REGISTER_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_2FA_URL?: string;\r\n\tACCOUNT_FORGOT_PASSWORD_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL?: string;\r\n\tEXTERNAL_LOGIN_PROVIDERS?: ExternalLoginProvider[];\r\n\t// #region Commerce\r\n\tACCOUNT_ORGANIZATION_REVIEW_URL?: string;\r\n\tACCOUNT_ORGANIZATION_SELECTOR_URL?: string;\r\n\tGoogleMapsApiKey?: string; // used in Store Locator\r\n\tMinimumTimeBeforeRecentlyViewedProductsAreValidated?: number;\r\n\tQuickOrderItemMinumumSearchCharacters?: number;\r\n\tMaxAllowedQuickOrderItems?: number;\r\n\tMaxNumberForQuantityDropdown?: number;\r\n\tOrderDetailsUIComponent?: string;\r\n\tGuestCheckoutEnabled?: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Main object that will hold all the client data\r\n */\r\nexport const ServerData: ServerData = {};\r\n\r\n/**\r\n * Initializer function that will populate the main settings object\r\n */\r\nfunction initializeServerData() {\r\n\tconst windowWithServerData = window as WindowWithServerData;\r\n\r\n\tif (\r\n\t\twindowWithServerData &&\r\n\t\twindowWithServerData.__ROC_SERVER_DATA__ &&\r\n\t\tArray.isArray(windowWithServerData.__ROC_SERVER_DATA__)\r\n\t) {\r\n\t\tfor (const obj of windowWithServerData.__ROC_SERVER_DATA__) {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tServerData[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ninitializeServerData();\r\n","/**\r\n * THIS HAS A COPY ON ROC.ADMIN. DO NOT MAKE CHANGES HERE WITHOUT ALSO MAKING THEM IN THE OTHER FILE.\r\n */\r\n\r\nimport { Prices, PricingResult } from 'shared-client/types/commerce/pricing-result';\r\n\r\n/**\r\n * Splits a quantity range of format `\"min:max\"` into a two dimensional array in the form of `[min: number, max: number]`.\r\n * It is illegal for quantity ranges to be fractional.\r\n * @param quantityRange A quantity range string in the form of `\"min:max\"`\r\n */\r\nexport function ParseQuantityRange(quantityRange: string): [number, number] {\r\n\tconst s = quantityRange.split(':');\r\n\treturn [parseInt(s[0]), s[1] === 'Infinity' ? Infinity : parseInt(s[1])];\r\n}\r\n\r\n/**\r\n * Retrieves a price detail of type T from a quantity range index for the specified quantity.\r\n * For example an index with the values `{[1:49]:\"$4.99\", [50:Infinity]:\"$3.99\"}` would return\r\n * \"$4.99\" for the quantity 1 or 25 but \"3.99\" for quantities above 49.\r\n * @param prices\r\n * @param quantity\r\n */\r\nexport function GetPriceForQuantity(prices: Prices, quantity: number): T {\r\n\tif (quantity == null || quantity <= 0) {\r\n\t\tthrow new Error('Erroneous quantity passed to GetPriceForQuantity');\r\n\t}\r\n\r\n\tfor (const quantityRange in prices) {\r\n\t\tconst [min, max] = ParseQuantityRange(quantityRange);\r\n\t\tif (quantity >= min && quantity <= max) {\r\n\t\t\treturn prices[quantityRange];\r\n\t\t}\r\n\t}\r\n\r\n\tthrow new Error('Price not found. Is the prices object well formed?');\r\n}\r\n\r\n/** Retrieves a pricing line for a given pricing result by the specified pricing line ID */\r\nexport function GetPricingLine(pricingResult: PricingResult, productId: string, pricingLineId?: string | null) {\r\n\tconst line = pricingResult.products[productId];\r\n\tif (!line) {\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\tif (pricingLineId == null) {\r\n\t\tfor (const id in line.pricingLines) {\r\n\t\t\tconst pricingLine = line.pricingLines[id];\r\n\t\t\tif (pricingLine && pricingLine.isDefault) {\r\n\t\t\t\treturn pricingLine;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (const id in line.pricingLines) {\r\n\t\t\tconst pricingLine = line.pricingLines[id];\r\n\t\t\tif (pricingLine) {\r\n\t\t\t\treturn pricingLine;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\treturn line.pricingLines[pricingLineId];\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Question Mark within a Circle SVG\r\n */\r\nfunction QuestionMarkCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default QuestionMarkCircleSVG;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse } from 'services/UserData.Commerce';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport LockSVG from 'shared/components/svg/LockSVG';\r\nimport OrderMessages from '../shopping-cart/OrderMessages';\r\n\r\ninterface AddedToCartAlertProps {\r\n\tresponse: AddToCartResponse;\r\n}\r\n\r\n/**\r\n * Displays Added to Cart confirmation\r\n */\r\nexport default function AddedToCartAlert(props: AddedToCartAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{response.imageUrl ? (\r\n\t\t\t\t\t\t\t{response.name}\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{response.name}\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t{/* #region HCL - replace SKU to ItemNumber */}\r\n\t\t\t\t\t\t\t{Localizer('ItemNumber')}:  \r\n\t\t\t\t\t\t\t{/* #endregion */}\r\n\t\t\t\t\t\t\t{response.sku}\r\n\t\t\t\t\t\t

\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{response.selections !== null && response.selections.length > 0\r\n\t\t\t\t\t\t\t\t\t? response.selections.map((selection) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t ))\r\n\t\t\t\t\t\t\t\t\t: null}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{selection.name}:\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{selection.label}\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t{Localizer('Qty')} \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{response.adjustedQuantity}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('InCart')} {response.cartSummary.items}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Subtotal')}:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t (window.location.href = '/cart')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn-secondary roc-btn-secondary--big roc-btn-secondary--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"view-cart-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ViewCart')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t (window.location.href = '/checkout')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"checkout-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('CheckoutNow')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\r\n\t\t//
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t

Added to Cart

\r\n\t\t// \t\t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t\r\n\t\t// \t\t
\r\n\t\t// \t
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t{response.imageUrl ? (\r\n\t\t// \t\t\t\t\r\n\t\t// \t\t\t) : (\r\n\t\t// \t\t\t\t\r\n\t\t// \t\t\t)}\r\n\t\t// \t\t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t
{response.name}
\r\n\t\t// \t\t\t
\r\n\t\t// \t\t\t\t{response.salePrice != null ? (\r\n\t\t// \t\t\t\t\t<>\r\n\t\t// \t\t\t\t\t\t\r\n\t\t// \t\t\t\t\t\t\t${formatPrice(response.basePrice)}\r\n\t\t// \t\t\t\t\t\t\r\n\t\t// \t\t\t\t\t\t${formatPrice(response.salePrice)}\r\n\t\t// \t\t\t\t\t\r\n\t\t// \t\t\t\t) : (\r\n\t\t// \t\t\t\t\t${formatPrice(response.basePrice)}\r\n\t\t// \t\t\t\t)}\r\n\t\t// \t\t\t
\r\n\t\t// \t\t\t{response.selections !== null &&\r\n\t\t// \t\t\t\tresponse.selections.length > 0 &&\r\n\t\t// \t\t\t\tresponse.selections.map(selection => (\r\n\t\t// \t\t\t\t\t
\r\n\t\t// \t\t\t\t\t\t{selection.name}: {selection.label}\r\n\t\t// \t\t\t\t\t
\r\n\t\t// \t\t\t\t))}\r\n\t\t// \t\t\t
Qty: {response.adjustedQuantity}
\r\n\t\t// \t\t
\r\n\t\t// \t
\r\n\r\n\t\t// \t
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t{response.cartSummary.items} {response.cartSummary.items === 1 ? 'item' : 'items'} in cart\r\n\t\t// \t\t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\tSubtotal: ${formatPrice(response.cartSummary.subtotal)}\r\n\t\t// \t\t
\r\n\t\t// \t
\r\n\t\t// \t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t\r\n\t\t// \t\t
\r\n\t\t// \t\t
\r\n\t\t// \t\t\t\r\n\t\t// \t\t
\r\n\t\t// \t
\r\n\t\t//
\r\n\t);\r\n}\r\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/* This code is subject to LICENSE in root of this repository */\\n\\n/* Used to detect in JavaScript if apps have loaded styles or not. */\\n:root {\\n --reach-dialog: 1;\\n}\\n\\n[data-reach-dialog-overlay] {\\n background: hsla(0, 0%, 0%, 0.33);\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n overflow: auto;\\n}\\n\\n[data-reach-dialog-content] {\\n width: 50vw;\\n margin: 10vh auto;\\n background: white;\\n padding: 2rem;\\n outline: none;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Right chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction RightChevronSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default RightChevronSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Lock SVG component\r\n *\r\n * @returns\r\n */\r\nfunction LockSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default LockSVG;\r\n","import {\r\n\tSimpleSelectionDto,\r\n\tProductPricingLine,\r\n\tAvailability,\r\n\tProductAddOnDto,\r\n} from 'features/commerce/product-details/types';\r\nimport { BaseDto } from 'shared/types';\r\nimport { SimpleDisplayPrice, Price } from '../../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { DropdownOption } from '../../../../../../Roc.SharedClientApp/types/fields';\r\nimport { ModelStatus } from '../../../../../../Roc.SharedClientApp/types/model-status';\r\n\r\n/**\r\n * Represents a single addable to list product info\r\n */\r\nexport interface ItemToAddToList {\r\n\titemId: string;\r\n\tquantity: number;\r\n\tproductPricingLineId: string | null;\r\n\taddOns?: ProductAddOnDto[];\r\n}\r\n\r\n/**\r\n * Represents data needed for adding a single item to list\r\n */\r\nexport interface AddToListProps extends ItemToAddToList {\r\n\tshoppingListId: string;\r\n}\r\n\r\n/**\r\n * Represents data needed for adding multiple items to list\r\n */\r\nexport interface BulkAddToListProps {\r\n\tshoppingListId: string;\r\n\titems: ItemToAddToList[];\r\n}\r\n\r\n/**\r\n * List DTO interface for my account shopping lists\r\n */\r\nexport interface ShoppingListDto extends BaseDto {\r\n\tid: string;\r\n\tname: string;\r\n\tprivacy: PrivacyType;\r\n}\r\n\r\nexport interface ShoppingListResponse extends ShoppingListDto {\r\n\tproductId: string | null;\r\n\tquantity: number | null;\r\n}\r\n\r\n/**\r\n * Shopping List Privacy Type\r\n */\r\nexport enum PrivacyType {\r\n\tPrivate = 'Private',\r\n\tPublic = 'Public',\r\n\tOrganization = 'Organization',\r\n}\r\n\r\n/**\r\n * Privacy Type Dropdown Options\r\n */\r\nexport const PrivacyTypeOptions = Object.keys(PrivacyType).map(\r\n\t(key) => ({ value: key, text: PrivacyType[key] } as DropdownOption),\r\n);\r\n\r\nexport interface ShoppingListProductDto extends BaseDto {\r\n\tid: string;\r\n\r\n\tshoppingListId: string;\r\n\r\n\tproductId: string;\r\n\r\n\tsku: string;\r\n\r\n\tname: string;\r\n\r\n\turl: string;\r\n\r\n\tgroupUrl: string;\r\n\r\n\tunitPrice: SimpleDisplayPrice;\r\n\r\n\tselections?: SimpleSelectionDto[];\r\n\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\tquantity: number;\r\n\r\n\tthumbnailUrl: string | null;\r\n\r\n\tbrandName: string | null;\r\n\r\n\taltText?: string;\r\n\r\n\tstatus?: ModelStatus;\r\n\r\n\tavailability?: Availability;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string;\r\n\r\n\t/**\r\n\t * The list of available product add ons for the shopping list item.\r\n\t */\r\n\taddOns?: ProductAddOnDto[];\r\n}\r\n","import React from 'react';\r\nimport { SimpleSelectionDto } from '../product-details/types';\r\n\r\ninterface ProductAttributeListprops {\r\n\tselections?: SimpleSelectionDto[];\r\n\tclassNamePrefix?: string;\r\n}\r\n\r\nexport default function ProductSelectionsList(props: ProductAttributeListprops) {\r\n\tconst { selections = '' } = props;\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{selections !== undefined &&\r\n\t\t\t\tArray.isArray(selections) &&\r\n\t\t\t\tselections.length > 0 &&\r\n\t\t\t\tselections.map((selection, i) => (\r\n\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{selection.name}:{' '}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{selection.label}\r\n\t\t\t\t\t
  • \r\n\t\t\t\t))}\r\n\t\t
\r\n\t);\r\n}\r\n","import Axios, { AxiosRequestConfig, AxiosError, AxiosResponse, CancelTokenSource } from 'axios';\r\nimport { useLoader } from './useLoader';\r\nimport { useRef, useEffect, useState } from 'react';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\n\r\n/**\r\n * Use Axios Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosLoaderParams {\r\n\taxiosParams: AxiosRequestConfig;\r\n\tactive?: boolean;\r\n\tcallback?: (error: Error | AxiosError | undefined) => any;\r\n\tcacheKey?: string;\r\n}\r\n\r\nconst cache = {};\r\n\r\n/**\r\n * A reusable hook that facilitates executing axios requests.\r\n */\r\nexport function useAxiosLoader({ axiosParams, active = true, callback, cacheKey }: UseAxiosLoaderParams) {\r\n\tif (axiosParams.method === undefined) {\r\n\t\taxiosParams.method = 'GET';\r\n\t}\r\n\r\n\tconst { ...rest } = axiosParams;\r\n\tconst { loading, setLoading, error, setError, response, setResponse } = useLoader>();\r\n\tconst [reloadTimes, setReloadTimes] = useState(0);\r\n\tconst cancelToken = useRef();\r\n\r\n\tconst reload = () => {\r\n\t\tsetReloadTimes(reloadTimes + 1);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tif (!active) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcancelToken.current = Axios.CancelToken.source();\r\n\r\n\t\t\t\tsetLoading(true);\r\n\t\t\t\tsetError(undefined);\r\n\r\n\t\t\t\tlet response: AxiosResponse;\r\n\r\n\t\t\t\tif (cacheKey && cache[cacheKey]) {\r\n\t\t\t\t\tresponse = cache[cacheKey];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresponse = await AxiosHelper(rest);\r\n\t\t\t\t\tif (cacheKey) {\r\n\t\t\t\t\t\tcache[cacheKey] = response;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetResponse(response);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(undefined);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetError(error);\r\n\r\n\t\t\t\tif (callback !== undefined) {\r\n\t\t\t\t\treturn callback(error);\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\treturn () => {\r\n\t\t\t// cleanup\r\n\t\t\tif (cancelToken.current) {\r\n\t\t\t\tcancelToken.current.cancel();\r\n\t\t\t}\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [active, reloadTimes, ...Object.values(axiosParams)]); // this may be overkill? this means that if ANY axios params change, a new request will execute\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresponse,\r\n\t\tcancelToken: cancelToken.current,\r\n\t\treload,\r\n\t};\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { SortByDirection } from 'shared-client/types/index';\r\nimport { BaseDto, PaginatedResult } from 'shared/types';\r\nimport { useAxiosLoader, UseAxiosLoaderParams } from './useAxiosLoader';\r\n\r\n/**\r\n * Use Axios Paginated Loader Params\r\n * @param axiosParams The parameters for the request being passed into axios. This includes the method, url, data, etc.\r\n * @param callback A function that is called after a form is posted. It'll include a parameter with the error if something went wrong.\r\n */\r\nexport interface UseAxiosPaginatedLoaderParams>\r\n\textends UseAxiosLoaderParams {\r\n\tquery?: string;\r\n\tinitialPageSize?: number;\r\n\tinitialSortByName?: string;\r\n\tinitialSortDirection?: SortByDirection;\r\n\tinitialResults?: T;\r\n\tcache?: boolean;\r\n\t//#region HCL\t\r\n\tinitialFilterValues?: Record;\r\n\t////#endregion\r\n}\r\n\r\n/**\r\n * The useAxiosPaginatedLoader hook result object\r\n */\r\nexport interface UseAxiosPaginatedLoaderResult> {\r\n\t/**\r\n\t * Current page number\r\n\t */\r\n\tpage: number;\r\n\t/**\r\n\t * Go to page and load results\r\n\t */\r\n\tgoToPage: (page: number) => void;\r\n\t/**\r\n\t * Go to next page and load results\r\n\t */\r\n\tgoToNextPage: () => void;\r\n\t/**\r\n\t * Go to previous page and load results\r\n\t */\r\n\tgoToPreviousPage: () => void;\r\n\t/**\r\n\t * Set sorting and load the results\r\n\t */\r\n\tsetSorting: (sortBy: string, direction: SortByDirection) => void;\r\n\t/**\r\n\t * Set page size and load the results\r\n\t */\r\n\tsetPageSize: (pageSize: number) => void;\r\n\t/**\r\n\t * Sets the custom query\r\n\t */\r\n\tsetQuery?: (query: string) => void;\r\n\t/**\r\n\t * Sets the sort by name\r\n\t */\r\n\tsetSortByName?: (sortBy: string) => void;\r\n\t/**\r\n\t * Sets the sort direction\r\n\t */\r\n\tsetSortDirection?: (direction: SortByDirection) => void;\r\n\t/**\r\n\t * Current sort by name\r\n\t */\r\n\tsortByName: string | undefined;\r\n\t/**\r\n\t * Current sort by direction\r\n\t */\r\n\tsortDirection: SortByDirection | undefined;\r\n\t/**\r\n\t * True if loading results\r\n\t */\r\n\tloading: boolean;\r\n\t/**\r\n\t * Error object if an error occurred while loading the results\r\n\t */\r\n\terror: Error | undefined;\r\n\t/**\r\n\t * Current paginated results object\r\n\t */\r\n\tresults: T | null | undefined;\r\n\r\n\t/**\r\n\t * Custom query string that includes\r\n\t * all the other parameters other than pagination and sorting ones\r\n\t */\r\n\tcustomQuery?: string | undefined;\r\n\r\n\t/**\r\n\t * If this function has been called another request will be triggered to get fresh results\r\n\t */\r\n\treload?: () => void;\r\n}\r\n\r\n/**\r\n * A reusable hook for pagination (data is loaded with axios).\r\n */\r\nexport function useAxiosPaginatedLoader>({\r\n\taxiosParams,\r\n\tactive = true,\r\n\tcallback,\r\n\tquery,\r\n\tinitialPageSize,\r\n\tinitialSortByName,\r\n\tinitialSortDirection,\r\n\tinitialResults,\r\n\tcache,\r\n}: UseAxiosPaginatedLoaderParams): UseAxiosPaginatedLoaderResult {\r\n\tconst [pageSize, setPageSizeState] = useState(initialPageSize);\r\n\tconst [pageNumber, setPageNumber] = useState(1);\r\n\tconst [sortByName, setSortByName] = useState(initialSortByName);\r\n\tconst [sortDirection, setSortDirection] = useState(initialSortDirection);\r\n\tconst [dataLoaderActive, setDataLoaderActive] = useState(initialResults === undefined);\r\n\tconst [customQuery, setCustomQuery] = useState(query);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDataLoaderActive(true);\r\n\t}, [pageNumber, sortByName, sortDirection, pageSize]);\r\n\r\n\tconst goToPage = (page: number) => {\r\n\t\tif (results && page > 0 && page <= results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(page);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToNextPage = () => {\r\n\t\tif (results && pageNumber < results.pagination.totalPages) {\r\n\t\t\tsetPageNumber(pageNumber + 1);\r\n\t\t}\r\n\t};\r\n\r\n\tconst goToPreviousPage = () => {\r\n\t\tif (pageNumber === 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetPageNumber(pageNumber - 1);\r\n\t};\r\n\r\n\tconst setSorting = (sortBy: string, direction: SortByDirection) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetSortByName(sortBy);\r\n\t\tsetSortDirection(direction);\r\n\t};\r\n\r\n\tconst setQuery = (customQuery: string | undefined) => {\r\n\t\tsetPageNumber(1);\r\n\t\tsetCustomQuery(customQuery);\r\n\t};\r\n\r\n\tconst paginationQuery = `${pageSize ? `pagesize=${pageSize}` : ''}&pageNumber=${pageNumber}${\r\n\t\tsortByName ? `&sortBy=${sortByName}` : ''\r\n\t}${sortDirection ? `&sortDirection=${sortDirection}` : ''}`;\r\n\r\n\tconst url = `${axiosParams.url}${customQuery ? `?${customQuery}&${paginationQuery}` : `?${paginationQuery}`}`;\r\n\r\n\tconst { loading, error, response, reload } = useAxiosLoader({\r\n\t\taxiosParams: {\r\n\t\t\t...axiosParams,\r\n\t\t\turl: url,\r\n\t\t},\r\n\t\tactive: active && dataLoaderActive,\r\n\t\tcallback,\r\n\t\tcacheKey: cache ? url : undefined,\r\n\t});\r\n\r\n\tconst results = active && dataLoaderActive ? response && response.data : initialResults;\r\n\r\n\tconst setPageSize = (size: number) => {\r\n\t\tsetPageSizeState(size);\r\n\t};\r\n\r\n\treturn {\r\n\t\tpage: pageNumber,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\tsetQuery,\r\n\t\tsetSortByName,\r\n\t\tsetSortDirection,\r\n\t\treload,\r\n\t\tcustomQuery,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t\tloading,\r\n\t\terror,\r\n\t\tresults,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport useDelayedDisplay from 'shared/hooks/useDelayedDisplay';\r\nimport classnames from 'classnames';\r\n\r\ntype SpinnerAlignment = 'left' | 'right' | 'none';\r\n\r\ninterface SpinnerProps {\r\n\tlight?: boolean;\r\n\twaitMs?: number;\r\n\talign?: SpinnerAlignment;\r\n\tblock?: boolean;\r\n\tparentCentered?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable roc-spinner component with color, alignment and wait time props.\r\n *\r\n * @export\r\n * @param {SpinnerProps} { light = false, waitMs = 200, align = 'right', block }\r\n * @returns\r\n */\r\nexport default function Spinner({\r\n\tlight = false,\r\n\twaitMs = 200,\r\n\talign = 'right',\r\n\tblock,\r\n\tparentCentered = false,\r\n}: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(waitMs);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinner = (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n\r\n\tif (parentCentered) {\r\n\t\treturn
{spinner}
;\r\n\t}\r\n\r\n\treturn spinner;\r\n}\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { BasePartialDataOptions } from 'shared/types';\r\nimport { BaseBulkPartialProductsDataOptions, ProductDetailsState } from './types';\r\n\r\nconst partialDataCache: { [index: string]: Partial } = {};\r\nconst partialProductsDataCache: { [index: string]: BulkProductsPartialDataResponse } = {};\r\n\r\nexport async function getPartialProductData(\r\n\toptions: BasePartialDataOptions,\r\n) {\r\n\tlet cacheKey = `${options.id}_${options.missingKeys.sort().join('_')}`;\r\n\r\n\t// include additional params in the cache key and preserve their order by param name\r\n\tconst additionalParams = options.additionalParams;\r\n\tif (additionalParams) {\r\n\t\tconst additionalKeys = Object.keys(additionalParams).sort();\r\n\t\tadditionalKeys.forEach((name) => {\r\n\t\t\tconst paramValue = additionalParams[name];\r\n\t\t\tif (paramValue) {\r\n\t\t\t\tcacheKey += `_${name}=${paramValue}`;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tif (partialDataCache[cacheKey]) {\r\n\t\treturn Promise.resolve(partialDataCache[cacheKey]);\r\n\t}\r\n\r\n\tconst response = await AxiosHelper.get>(`/ajax/products/${options.id}`, {\r\n\t\tparams: {\r\n\t\t\t...options.additionalParams,\r\n\t\t\tkeys: options.missingKeys.join(','),\r\n\t\t},\r\n\t});\r\n\r\n\tpartialDataCache[cacheKey] = response.data;\r\n\r\n\t// if the key is requested, always return the value as null. this is important\r\n\t// on the client undefined vs null can have different meanings\r\n\t// undefined means nothing has even tried to set it, the data is simply missing.\r\n\t// null means we tried to load something, but there's no value associated.\r\n\treturn Promise.resolve(response.data);\r\n}\r\n\r\n/**\r\n * Dictionary of bulk products data , key is product id\r\n */\r\nexport interface BulkProductsPartialDataResponse {\r\n\t[key: string]: Partial;\r\n}\r\n\r\n/**\r\n * Gets partial data for bulk products using the product ids and the missing keys\r\n */\r\nexport async function getBulkPartialProductsData(options: BaseBulkPartialProductsDataOptions) {\r\n\tconst cacheKey = `${options.productIds?.sort().join('_')}___${options.missingKeys.sort().join('_')}`;\r\n\tif (partialProductsDataCache[cacheKey]) {\r\n\t\treturn Promise.resolve(partialProductsDataCache[cacheKey]);\r\n\t}\r\n\r\n\tconst response = await AxiosHelper.post(`/ajax/products`, {\r\n\t\tproductIds: options.productIds,\r\n\t\tmissingKeys: options.missingKeys.join(','),\r\n\t});\r\n\r\n\tpartialProductsDataCache[cacheKey] = response.data;\r\n\r\n\t// if the key is requested, always return the value as null. this is important\r\n\t// on the client undefined vs null can have different meanings\r\n\t// undefined means nothing has even tried to set it, the data is simply missing.\r\n\t// null means we tried to load something, but there's no value associated.\r\n\treturn Promise.resolve(response.data);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Plus SVG\r\n *\r\n * @returns\r\n */\r\nfunction PlusSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PlusSVG;\r\n","import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';\r\nimport AccountUrls from 'shared/util/AccountUrls';\r\nimport { getCsrfToken } from './UserData';\r\n\r\n/**\r\n * Helper that creates an instance of Axios to be used throughout the client application\r\n * and adds a default X-Requested-With header to all requests.\r\n *\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create();\r\nAxiosHelper.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\r\n\r\n// Add CSRF tokens to all commands that are not GET, HEAD, or OPTIONS\r\nAxiosHelper.interceptors.request.use(async (config) => {\r\n\tif (\r\n\t\tconfig.method?.toLowerCase() !== 'get' &&\r\n\t\tconfig.method?.toLowerCase() !== 'head' &&\r\n\t\tconfig.method?.toLowerCase() !== 'options'\r\n\t) {\r\n\t\tconst csrfToken = await getCsrfToken();\r\n\t\tconfig.headers = { RequestVerificationToken: csrfToken, ...config.headers };\r\n\t}\r\n\treturn config;\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const addUnauthorizedAccessInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace(\r\n\t\t\t\t\t`${AccountUrls.Login}?ReturnUrl=${encodeURIComponent(window.location.pathname)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","import React from 'react';\r\nimport UpChevronSVG from 'shared/components/svg/LeftChevronSVG';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Represents one breadcrumb item in a list of breadcrumb items that defines the breadcrumb trail\r\n */\r\nexport interface BreadcrumbItem {\r\n\tlabel: string;\r\n\turl?: string;\r\n}\r\n\r\ninterface BreadcrumbProps {\r\n\tbreadcrumbPath?: BreadcrumbItem[];\r\n\tbackToPage?: BreadcrumbItem;\r\n\trenderPathLink?: (item: BreadcrumbItem) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Renders a set of links that represent breadcrumbs for the current location.]\r\n * It can optionally render a \"back to page\" link when this is set in sessionStorage.\r\n */\r\nexport default function Breadcrumbs(props: BreadcrumbProps) {\r\n\tconst {\r\n\t\tbreadcrumbPath,\r\n\t\tbackToPage,\r\n\t\trenderPathLink = (item) => (\r\n\t\t\t\r\n\t\t\t\t{item.label}\r\n\t\t\t\r\n\t\t),\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{backToPage && backToPage.url && window.history.length > 2 ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t window.history.back()}\r\n\t\t\t\t\t\tclassName=\"roc-breadcrumbs-bar__back-link roc-btn-link\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{backToPage.label}\r\n\t\t\t\t\t\r\n\t\t\t\t\t|\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\t{breadcrumbPath ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Home')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t
/
\r\n\t\t\t\t\t{breadcrumbPath.map((entry, i) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderPathLink(entry)}\r\n\t\t\t\t\t\t\t{i + 1 < breadcrumbPath.length ? (\r\n\t\t\t\t\t\t\t\t
/
\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
\r\n\t);\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ProductPricingLine, ProductPricingLinesDetails } from './types';\r\n\r\ninterface ProductPricingLinesProps {\r\n\tdetails?: ProductPricingLinesDetails;\r\n\tonPricingLineChange: (productPricingLine: CheckableLine) => void;\r\n\tclassName?: string;\r\n}\r\n\r\nexport type CheckableLine =\r\n\t| {\r\n\t\t\t/**\r\n\t\t\t * This is always populated if the product is for sale.\r\n\t\t\t * Under certain circumstances, it may be undefined/null.\r\n\t\t\t * This isn't desirable and will probably change in the future.\r\n\t\t\t */\r\n\t\t\treadonly pricingLine: ProductPricingLine | undefined;\r\n\t\t\treadonly isInitialization: boolean;\r\n\t\t\treadonly checked: boolean;\r\n\t }\r\n\t| {\r\n\t\t\treadonly pricingLine: undefined;\r\n\t\t\treadonly isInitialization: true;\r\n\t\t\treadonly checked: false;\r\n\t };\r\n\r\nexport const NoPricingLine: CheckableLine = {\r\n\tpricingLine: undefined,\r\n\tisInitialization: true,\r\n\tchecked: false,\r\n};\r\n\r\ninterface Checkable {\r\n\tchecked: boolean;\r\n}\r\n\r\ntype CheckablePricingLine = ProductPricingLine & Checkable;\r\n\r\nconst getCheckedPricingLine = (pricingLines: CheckablePricingLine[]): CheckablePricingLine => {\r\n\tconst checkedUnit = pricingLines.find((uom) => uom.checked);\r\n\r\n\tif (!checkedUnit) {\r\n\t\tthrow new Error('Unable to determine the selected unit of measure');\r\n\t}\r\n\r\n\treturn checkedUnit;\r\n};\r\n\r\nconst getPricingLineDropdownText = (pricingLine: ProductPricingLine) => {\r\n\tconst result = `${pricingLine.label} (${pricingLine.quantity} in ${pricingLine.unitOfMeasure.displayName})`;\r\n\r\n\treturn result;\r\n};\r\n\r\n/**\r\n * Displays items required to Add To Cart\r\n */\r\nexport default function ProductPricingLines(props: ProductPricingLinesProps) {\r\n\tconst [pricingLines, setPricingLines] = useState([]);\r\n\r\n\tconst handlePricingLineChange = (newLine: CheckablePricingLine): void => {\r\n\t\tconst updatedPricingLines: CheckablePricingLine[] = pricingLines.map((line) => {\r\n\t\t\treturn {\r\n\t\t\t\t...line,\r\n\t\t\t\tchecked: line.id === newLine.id,\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tsetPricingLines(updatedPricingLines);\r\n\r\n\t\tprops.onPricingLineChange({\r\n\t\t\tchecked: newLine.checked,\r\n\t\t\tisInitialization: false,\r\n\t\t\tpricingLine: newLine,\r\n\t\t});\r\n\t};\r\n\r\n\tconst { details, className } = props;\r\n\r\n\tuseEffect(() => {\r\n\t\tif (details?.selected == null || !Array.isArray(details.available) || details.available.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst statefulPricingLines: CheckablePricingLine[] = details.available.map((line) => {\r\n\t\t\tconst statefulLine: CheckablePricingLine = {\r\n\t\t\t\t...line,\r\n\t\t\t\tchecked: line.id === details.selected!.id, // pre-select unit that was already loaded on the server-side\r\n\t\t\t};\r\n\t\t\treturn statefulLine;\r\n\t\t});\r\n\r\n\t\tsetPricingLines(statefulPricingLines);\r\n\t\tconst line = getCheckedPricingLine(statefulPricingLines);\r\n\t\tprops.onPricingLineChange({\r\n\t\t\tchecked: true,\r\n\t\t\tisInitialization: false,\r\n\t\t\tpricingLine: line,\r\n\t\t});\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [props.details]);\r\n\r\n\t/**\r\n\t * Event handler for blur and on change.\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst handleOnChangeAndBlur = (e) => {\r\n\t\tconst newValue = e.currentTarget.value;\r\n\t\tconst match = pricingLines.find((line) => line.id === newValue);\r\n\r\n\t\tif (match) {\r\n\t\t\tif (match.checked) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tmatch.checked = true;\r\n\t\t\thandlePricingLineChange(match);\r\n\t\t}\r\n\t};\r\n\r\n\tif (pricingLines.length <= 1) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst pricingLine = getCheckedPricingLine(pricingLines);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import type { Dialog } from '@reach/dialog';\r\nimport 'styles/node-modules/@reach/dialog/styles.css';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { ModalSize } from './Modal';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Spinner from './Spinner';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\n\r\ninterface AlertProps {\r\n\tisOpen: boolean;\r\n\trenderTitle: () => React.ReactNode;\r\n\tchildren: React.ReactNode;\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n\tsize?: ModalSize;\r\n\ttheme?: AlertTheme;\r\n\tcancelButtonText?: string;\r\n\tconfirmButtonText?: string;\r\n\trenderActions?: () => React.ReactNode;\r\n\theaderDivider?: boolean;\r\n\tsubTitle?: string;\r\n}\r\n\r\ntype AlertTheme = 'default' | 'info' | 'success' | 'warning' | 'danger';\r\n\r\ninterface ActionsRenderProps {\r\n\ttheme?: AlertTheme;\r\n\tcancelButtonText?: string;\r\n\tconfirmButtonText?: string;\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n}\r\n\r\n/**\r\n * Reusuable alert component with raised open state, takes size, theme, title and contents as props.\r\n *\r\n * @export\r\n * @param {AlertProps} props\r\n * @returns\r\n */\r\nexport default function Alert(props: AlertProps) {\r\n\tconst {\r\n\t\tisOpen,\r\n\t\tsize = 'md',\r\n\t\ttheme = 'default',\r\n\t\tonConfirm,\r\n\t\tonCancel,\r\n\t\trenderTitle,\r\n\t\tcancelButtonText = Localizer('Cancel'),\r\n\t\tconfirmButtonText = Localizer('Confirm'),\r\n\t\trenderActions = (renderProps: ActionsRenderProps) => (\r\n\t\t\t<>\r\n\t\t\t\t\r\n\t\t\t\t\t{renderProps.cancelButtonText}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{renderProps.confirmButtonText}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t),\r\n\t\theaderDivider = false,\r\n\t\tsubTitle,\r\n\t\tchildren,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t onCancel()}\r\n\t\t\t\tas={'div'}\r\n\t\t\t>\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t

{renderTitle()}

\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t onCancel()}\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"roc-modal-close-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('Close')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t\t{subTitle ?

{subTitle}

: null}\r\n\t\t\t\t
\r\n\t\t\t\t
{children}
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{renderActions({ theme, cancelButtonText, confirmButtonText, onCancel, onConfirm })}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n/**\r\n * Info SVG component\r\n *\r\n * @returns\r\n */\r\nfunction InfoSVGAlternative({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\nexport default InfoSVGAlternative;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React from 'react';\r\nimport { AddOnAttributeDto, InputAttributeType, ProductAddOnDto } from './types';\r\nimport { Field } from 'react-final-form';\r\nimport { OnChange } from 'react-final-form-listeners';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { FieldArray } from 'react-final-form-arrays';\r\nimport { FormApi } from 'final-form';\r\nimport { TextAreaField, TextBoxField, ValidationMessages } from 'shared/edit/fields';\r\nimport {\r\n\tgetCustomMultilineAttributeComponent,\r\n\tgetCustomMultipleValueAttributeComponent,\r\n\tgetCustomProductAddOnsComponent,\r\n\tgetCustomSingleLineAttributeComponent,\r\n} from './strategy';\r\nimport classnames from 'classnames';\r\nimport FieldLabel from 'shared/edit/fields/FieldLabel';\r\n// #region HCL\r\n// import ProductPricing from 'shared/components/commerce/ProductPricing';\r\n// #endregion\r\nimport CheckboxInputField from 'shared/edit/fields/CheckboxInputField';\r\nimport InfoSVGAlternative from 'shared/components/svg/InfoSVGAlternative';\r\nimport { AxiosError } from 'axios';\r\n\r\nexport interface AddOnsFormValues {\r\n\taddOns: ProductAddOnDto[];\r\n\r\n\t/**\r\n\t * The possible network error that occurred when submitting the form. This is stored in the form so it can be synchronously set\r\n\t * and then used by the `onSubmit` function as part of the form values passed into it, so that it can handle them and set the correct\r\n\t * validation state on the form.\r\n\t */\r\n\taxiosError?: AxiosError;\r\n}\r\n\r\n/**\r\n * Product Add Ons Component props\r\n */\r\nexport interface ProductAddOnsProps {\r\n\t/**\r\n\t * The list of product add Ons\r\n\t */\r\n\taddOns: ProductAddOnDto[];\r\n\r\n\t/**\r\n\t * The names of add-ons available for child products, if this is a group product\r\n\t */\r\n\tchildAddOnNames: string[];\r\n\r\n\t/**\r\n\t * The product add ons formApi\r\n\t */\r\n\tformApi: FormApi;\r\n\r\n\t/**\r\n\t * Updates product add ons\r\n\t */\r\n\tsetProductAddOns: (addOns: ProductAddOnDto[]) => void;\r\n\r\n\t/**\r\n\t * Defines if we need to hide the add ons details (attributes)\r\n\t * Used for group products\r\n\t */\r\n\thideAddOnsDetails?: boolean;\r\n}\r\n\r\n/**\r\n * Single product add on component props\r\n */\r\ninterface ProductAddOnFieldProps {\r\n\t/**\r\n\t * The product add on field name\r\n\t */\r\n\tfieldName: string;\r\n\t/**\r\n\t * The index of the current ad on\r\n\t */\r\n\tindex: number;\r\n\t/**\r\n\t * The product add ons formApi\r\n\t */\r\n\tformApi: FormApi;\r\n}\r\n\r\n/**\r\n * Product Add Ons Component\r\n */\r\nexport default function DefaultProductAddOnsComponent(props: ProductAddOnsProps) {\r\n\tconst { formApi, childAddOnNames, setProductAddOns, hideAddOnsDetails } = props;\r\n\r\n\tif (!formApi) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn hideAddOnsDetails ? (\r\n\t\t\r\n\t\t\t{({ fields }) => {\r\n\t\t\t\tconst availableAddOns: string[] = [];\r\n\t\t\t\tconst availableChildAddOns: string[] = [];\r\n\r\n\t\t\t\tfields.forEach((_fieldName, index) =>\r\n\t\t\t\t\tavailableAddOns.push(Localizer('PDPAddOnAvailableForItemMessage', fields.value[index].label)),\r\n\t\t\t\t);\r\n\t\t\t\tchildAddOnNames.forEach((_childName, index) =>\r\n\t\t\t\t\tavailableChildAddOns.push(\r\n\t\t\t\t\t\tLocalizer('PDPAddOnAvailableForSomeItemsMessage', childAddOnNames[index]),\r\n\t\t\t\t\t),\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn availableAddOns.length + childAddOnNames.length == 0 ? null : (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{availableAddOns.join(', ')}\r\n\t\t\t\t\t\t\t{availableAddOns.length > 0 && availableChildAddOns.length > 0 ? ', ' : null}\r\n\t\t\t\t\t\t\t{availableChildAddOns.join(', ')}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t
\r\n\t) : (\r\n\t\t\r\n\t\t\t{({ fields }) =>\r\n\t\t\t\tfields.map((fieldName, index) => (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{() => {\r\n\t\t\t\t\t\t\t\tconst addOns = formApi.getFieldState('addOns')?.value ?? [];\r\n\t\t\t\t\t\t\t\tsetProductAddOns([...addOns]);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t))\r\n\t\t\t}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * This is the default strategy for picking out a single line attribute component. It only checks if a custom one has been defined,\r\n * and if that returns anything, that component is returned. Otherwise, we just return the default component.\r\n * If you need to customize this, change `getCustomSingleLineAttributeComponent`\r\n */\r\nexport function getProductAddOnsComponent(): React.ComponentType {\r\n\tconst customComponent = getCustomProductAddOnsComponent();\r\n\r\n\tif (customComponent !== undefined) {\r\n\t\treturn customComponent;\r\n\t}\r\n\r\n\treturn DefaultProductAddOnsComponent;\r\n}\r\n\r\n/**\r\n * Displays a single add on\r\n */\r\nexport function ProductAddOnField(props: ProductAddOnFieldProps) {\r\n\tconst { fieldName, index, formApi } = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value } }: { input: { value: ProductAddOnDto } }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{/* #region HCL - do not show checked checkbox if add on is required */}\r\n\t\t\t\t\t\t\t\t\t{!value.required ? (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{/* #endregion*/}\r\n\r\n\t\t\t\t\t\t\t\t\t{value.description ? (\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t

\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{/* #region HCL - do not show add-on price */}\r\n\t\t\t\t\t\t\t\t\t{/**/}\r\n\t\t\t\t\t\t\t\t\t{/*// #endregion*/}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{value.selected && value.attributes && value.attributes.length > 0 ? (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t{/* #region HCL*/}\r\n\t\t\t\t\t\t\t\t\t\t{index === 0 &&

{Localizer('RequiredFields')}

}\r\n\t\t\t\t\t\t\t\t\t\t{/* #endregion*/}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{({ fields }) =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tfields.map((fieldName, index) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinput: { value },\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}: {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinput: { value: AddOnAttributeDto };\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmeta;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n\r\n/**\r\n * Single product add on attribute component props\r\n */\r\nexport interface ProductAddOnAttributeFieldProps {\r\n\t/**\r\n\t * The add on attribute fieldname\r\n\t */\r\n\tfieldName: string;\r\n\t/**\r\n\t * The add on attribute index\r\n\t */\r\n\tattributeIndex: number;\r\n\t/**\r\n\t * The add ons formapi\r\n\t */\r\n\tformApi: FormApi;\r\n\t/**\r\n\t * The attribute data\r\n\t */\r\n\tattribute: AddOnAttributeDto;\r\n\t/**\r\n\t * The add on index\r\n\t */\r\n\taddOnIndex: number;\r\n}\r\n\r\n/**\r\n * Single product add on attribute component\r\n */\r\nfunction ProductAddOnAttributeField(props: ProductAddOnAttributeFieldProps) {\r\n\tconst { fieldName, attributeIndex, formApi, attribute, addOnIndex } = props;\r\n\r\n\tif (!attribute) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (attribute.inputAttributeType == InputAttributeType.Single) {\r\n\t\tconst SingleLineAttributeComponent = getSingleLineAttributeComponent();\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tif (attribute.inputAttributeType == InputAttributeType.Multiline) {\r\n\t\tconst MultiLineAttributeComponent = getMultilineAttributeComponent();\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tconst MultiValueAttributeComponent = getMultiValueAttributeComponent();\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Attribute value length constraint message component props\r\n */\r\ninterface ProductAddOnAttributeValueLengthProps {\r\n\t/**\r\n\t * The minimum allowed value length\r\n\t */\r\n\tminimumLength?: number | null;\r\n\t/**\r\n\t * The maximum allowed value length\r\n\t */\r\n\tmaximumLength?: number | null;\r\n\t/**\r\n\t * The maximum allowed number of lines\r\n\t */\r\n\tmaximumLines?: number | null;\r\n}\r\n\r\nfunction AttributeValueLengthMessage(props: ProductAddOnAttributeValueLengthProps) {\r\n\tconst { minimumLength, maximumLength, maximumLines } = props;\r\n\treturn (\r\n\t\t
\r\n\t\t\t{minimumLength && maximumLength && (\r\n\t\t\t\t

{Localizer('MinimumAndMaximumLengthMessage', minimumLength.toString(), maximumLength.toString())}

\r\n\t\t\t)}\r\n\t\t\t{minimumLength && !maximumLength &&

{Localizer('MinimumLengthMessage', minimumLength.toString())}

}\r\n\t\t\t{!minimumLength && maximumLength &&

{Localizer('MaximumLengthMessage', maximumLength.toString())}

}\r\n\t\t\t{maximumLines &&

{Localizer('MaximumLinesMessage', maximumLines.toString())}

}\r\n\t\t
\r\n\t);\r\n}\r\n\r\n/**\r\n * Default rendering for an individual Single Line attribute\r\n */\r\nfunction DefaultSingleLineAttributeComponent(props: ProductAddOnAttributeFieldProps) {\r\n\tconst { attributeIndex, attribute, fieldName, addOnIndex } = props;\r\n\treturn (\r\n\t\t\r\n\t\t\t{({}) => (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{attribute.instructions && {attribute.instructions}}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{({}) => (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{/* #region HCL -do not show the built-in field description */}\r\n\t\t\t\t\t\t\t\t\t{/**/}\r\n\t\t\t\t\t\t\t\t\t{/* #endregion*/}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * This is the default strategy for picking out a single line attribute component. It only checks if a custom one has been defined,\r\n * and if that returns anything, that component is returned. Otherwise, we just return the default component.\r\n * If you need to customize this, change `getCustomSingleLineAttributeComponent`\r\n */\r\nfunction getSingleLineAttributeComponent(): React.ComponentType {\r\n\tconst customComponent = getCustomSingleLineAttributeComponent();\r\n\r\n\tif (customComponent !== undefined) {\r\n\t\treturn customComponent;\r\n\t}\r\n\r\n\treturn DefaultSingleLineAttributeComponent;\r\n}\r\n\r\n/**\r\n * Default rendering for an individual Multiline attribute\r\n */\r\nfunction DefaultMultiLineAttributeComponent(props: ProductAddOnAttributeFieldProps) {\r\n\tconst { attributeIndex, attribute, fieldName, addOnIndex } = props;\r\n\r\n\t/**\r\n\t * Limit the number of lines if multiline max given.\r\n\t *\r\n\t * @param {*} value\r\n\t * @return {*}\r\n\t */\r\n\tconst limitMultiline = (value) => {\r\n\t\tif (attribute.maximumNumberOfLines) {\r\n\t\t\tconst newLines = value.split('\\n').length - 1;\r\n\t\t\tconst lastChar = value[value.length - 1];\r\n\r\n\t\t\tif (lastChar === '\\n' && newLines >= attribute.maximumNumberOfLines) {\r\n\t\t\t\treturn value.substring(0, value.length - 1);\r\n\t\t\t}\r\n\r\n\t\t\treturn value;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { name } }) => (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t{attribute.instructions && {attribute.instructions}}\r\n\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * This is the default strategy for picking out a multiline attribute component. It only checks if a custom one has been defined,\r\n * and if that returns anything, that component is returned. Otherwise, we just return the default component.\r\n * If you need to customize this, change `getCustomMultipleLineAttributeComponent`\r\n */\r\nfunction getMultilineAttributeComponent(): React.ComponentType {\r\n\tconst customComponent = getCustomMultilineAttributeComponent();\r\n\r\n\tif (customComponent !== undefined) {\r\n\t\treturn customComponent;\r\n\t}\r\n\r\n\treturn DefaultMultiLineAttributeComponent;\r\n}\r\n\r\n/**\r\n * Default rendering for an individual selection attribute\r\n */\r\nfunction DefaultMultiValueAttributeComponent(props: ProductAddOnAttributeFieldProps) {\r\n\tconst { attributeIndex, attribute, fieldName, addOnIndex, formApi } = props;\r\n\r\n\tconst resetSelectedValues = () => {\r\n\t\tformApi.batch(() => {\r\n\t\t\t// Set `selected` to false for all attributes\r\n\t\t\tfor (let i = 0; i < attribute.values.length; i++) {\r\n\t\t\t\tformApi.change(`${fieldName}.values[${i}].selected`, false);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t{attribute.required ? null : (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('ClearPDPAddOnSelection')}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\r\n\t\t\t{attribute.instructions ? {attribute.instructions} : null}\r\n\r\n\t\t\t\r\n\t\t\t\t{({ meta }) => (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{attribute.values\r\n\t\t\t\t\t\t\t\t? attribute.values.map((selectionValue, valueIndex) => (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{selectionValue.label}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{({ input: { name, onChange } }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{(selected: boolean) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (selected) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst addOns = formApi.getFieldState('addOns')?.value;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (addOns) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst attribute =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddOns[addOnIndex].attributes[attributeIndex];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < attribute.values.length; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tattribute.values[i].selected = i === valueIndex;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddOns[addOnIndex].attributes[attributeIndex] = {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...attribute,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (addOns) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tformApi.change('addOns', [...addOns]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t ))\r\n\t\t\t\t\t\t\t\t: null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * This is the default strategy for picking out a selection attribute component. It only checks if a custom one has been defined,\r\n * and if that returns anything, that component is returned. Otherwise, we just return the default component.\r\n * If you need to customize this, change `getCustomMultipleValueAttributeComponent`\r\n */\r\nfunction getMultiValueAttributeComponent(): React.ComponentType {\r\n\tconst customComponent = getCustomMultipleValueAttributeComponent();\r\n\r\n\tif (customComponent !== undefined) {\r\n\t\treturn customComponent;\r\n\t}\r\n\r\n\treturn DefaultMultiValueAttributeComponent;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Minus SVG\r\n *\r\n * @returns\r\n */\r\nfunction MinusSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default MinusSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Play Media Button SVG\r\n */\r\nfunction PlayMediaSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PlayMediaSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * PDF file SVG\r\n */\r\nfunction FilePDFSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FilePDFSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Text file SVG\r\n */\r\nfunction FileWithTextSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileWithTextSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Word Document file SVG\r\n */\r\nfunction FileWordDocSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileWordDocSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Excel file SVG\r\n */\r\nfunction FileExcelSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileExcelSVG;\r\n","import React from 'react';\r\nimport { Asset, AssetType } from './types';\r\nimport PlayMediaSVG from 'shared/components/svg/PlayMediaSVG';\r\nimport FilePDFSVG from 'shared/components/svg/FilePDFSVG';\r\nimport FileWithTextSVG from 'shared/components/svg/FileWithTextSVG';\r\nimport FileWordDocSVG from 'shared/components/svg/FileWordDocSVG';\r\nimport FileExcelSVG from 'shared/components/svg/FileExcelSVG';\r\nimport FileSVG from 'shared/components/svg/FileSVG';\r\nimport QuestionMarkCircleSVG from 'shared/components/svg/QuestionMarkCircleSVG';\r\n\r\ninterface AssetDownloadIconProps {\r\n\tasset: Asset;\r\n\tassetIconClasses?: string;\r\n}\r\n\r\n/**\r\n * Icon for an asset based on its file type.\r\n */\r\nexport default function AssetIcon(props: AssetDownloadIconProps) {\r\n\tconst { asset, assetIconClasses } = props;\r\n\r\n\tif (asset.assetType === AssetType.Media || asset.assetType === AssetType.YouTube) {\r\n\t\treturn ;\r\n\t} else if (asset.assetType === AssetType.Document) {\r\n\t\tconst fileExtension = asset.assetUrl.split('.').pop();\r\n\r\n\t\tswitch (fileExtension) {\r\n\t\t\tcase 'pdf':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'txt':\r\n\t\t\tcase 'html':\r\n\t\t\tcase 'htm':\r\n\t\t\tcase 'xml':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'docx':\r\n\t\t\tcase 'doc':\r\n\t\t\tcase 'docm':\r\n\t\t\tcase 'dot':\r\n\t\t\tcase 'dotm':\r\n\t\t\tcase 'dotx':\r\n\t\t\t\treturn ;\r\n\t\t\tcase 'csv':\r\n\t\t\tcase 'xls':\r\n\t\t\tcase 'xlsx':\r\n\t\t\tcase 'xlsb':\r\n\t\t\tcase 'xlsm':\r\n\t\t\tcase 'xlt':\r\n\t\t\tcase 'xltm':\r\n\t\t\tcase 'xltx':\r\n\t\t\tcase 'xlw':\r\n\t\t\t\treturn ;\r\n\t\t\tdefault:\r\n\t\t\t\treturn ;\r\n\t\t}\r\n\t} else {\r\n\t\treturn ;\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Download SVG\r\n *\r\n * @returns\r\n */\r\nfunction DownloadSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DownloadSVG;\r\n","import React from 'react';\r\nimport { Asset } from './types';\r\nimport AssetIcon from './AssetIcon';\r\nimport DownloadSVG from 'shared/components/svg/DownloadSVG';\r\n\r\ninterface AssetDownloadIconProps {\r\n\tasset: Asset;\r\n\tassetIconClasses?: string;\r\n\tdownloadIconClasses?: string;\r\n}\r\n\r\n/**\r\n * Icon for downloading assets.\r\n */\r\nexport default function AssetDownloadIcon(props: AssetDownloadIconProps) {\r\n\tconst { asset, assetIconClasses, downloadIconClasses } = props;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\n\r\ninterface ExternalMediaIFrameProps {\r\n\tembeddedUrl: string;\r\n\ttitle: string;\r\n}\r\n/**\r\n * This component display external media videos on front end\r\n */\r\nexport default function ExternalMediaIFrame(props: ExternalMediaIFrameProps) {\r\n\tconst { embeddedUrl, title } = props;\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * HCL Zoom SVG\r\n *\r\n * @returns\r\n */\r\nfunction HclZoomSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default HclZoomSVG;\r\n","import React from 'react';\r\nimport type { Dialog } from '@reach/dialog';\r\nimport { Localizer } from 'services/Localizer';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\nimport Spinner from 'shared/components/Spinner';\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\n\r\ninterface ModalProps {\r\n\tisOpen: boolean;\r\n\tcloseModal: () => void;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\nexport default function ProductImageModal(props: ModalProps) {\r\n\tconst { isOpen, closeModal, children } = props;\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\taria-label={Localizer('ProductImageModal')}\r\n\t\t\t\tas={'div'}\r\n\t\t\t>\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
{children}
\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import classnames from 'classnames';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport type MediaQuery from 'react-responsive';\r\nimport AssetDownloadIcon from 'shared/assets/AssetDownloadIcon';\r\nimport AssetIcon from 'shared/assets/AssetIcon';\r\nimport ExternalMediaIFrame from 'shared/assets/ExternalMediaIFrame';\r\nimport LazyImage from 'shared/assets/LazyImage';\r\nimport { AssetType } from 'shared/assets/types';\r\nimport DownChevronSVG from 'shared/components/svg/DownChevronSVG';\r\n// #region HCL\r\nimport HclZoomSVG from 'shared/components/svg/HclZoomSVG';\r\n//#endregion\r\nimport LeftChevronSVG from 'shared/components/svg/LeftChevronSVG';\r\nimport RightChevronSVG from 'shared/components/svg/RightChevronSVG';\r\nimport UpChevronSVG from 'shared/components/svg/UpChevronSVG';\r\nimport useSmoothScrollingPolyfill from 'shared/hooks/useSmoothScrollingPolyfill';\r\nimport ProductImageModal from './ProductImageModal';\r\nimport Spinner from 'shared/components/Spinner';\r\nconst LazyMediaQuery = React.lazy(() => import('react-responsive'));\r\n\r\n// #region HCL\r\nimport { ProductAsset } from './types';\r\nimport { Localizer } from 'services/Localizer';\r\n// #endregion\r\n\r\ninterface ProductAssetsProps {\r\n\tassets?: ProductAsset[] | null;\r\n\t// #region HCL\r\n\tsaleDiscount: number;\r\n\tisNewProduct: boolean;\r\n\t//#endregion\r\n}\r\n\r\nexport const productAssetPlaceholder: ProductAsset = {\r\n\taltText: 'Image not available',\r\n\tsortOrder: 1,\r\n\tthumbnailUrl: '/images/image-not-found-thumb.png',\r\n\tmainImageUrl: '/images/image-not-found.png',\r\n\tenlargedImageUrl: '/images/image-not-found.png',\r\n\tassetType: AssetType.Image,\r\n\tassetUrl: '/images/image-not-found.png',\r\n\tembeddedUrl: '',\r\n};\r\n\r\n/**\r\n * Returns the first asset from the set of provided assets or null if no default found\r\n */\r\nfunction initMainProductAsset(assets?: ProductAsset[] | null): ProductAsset | null {\r\n\tif (assets == null || assets.length === 0) {\r\n\t\treturn null;\r\n\t}\r\n\tconst defaultAsset = assets\r\n\t\t.sort(compareAssets)\r\n\t\t.find((asset) => asset.assetType === AssetType.Image || asset.assetType === AssetType.YouTube);\r\n\treturn defaultAsset || null;\r\n}\r\n\r\n/**\r\n * Returns list of alternative assets (including the main asset).\r\n */\r\nfunction initAltAssets(assets?: ProductAsset[] | null): ProductAsset[] {\r\n\tif (!assets || assets === null || assets.length === 0) {\r\n\t\treturn [productAssetPlaceholder];\r\n\t}\r\n\treturn assets.sort(compareAssets);\r\n}\r\n\r\nconst compareAssets = (a: ProductAsset, b: ProductAsset) => a.sortOrder - b.sortOrder;\r\n\r\n/**\r\n * Displays assets for a product, including alternate assets, and handles swapping\r\n */\r\nexport default function ProductAssets(props: ProductAssetsProps) {\r\n\tconst [mainAsset, setMainAsset] = useState(productAssetPlaceholder);\r\n\tconst [altAssets, setAltAssets] = useState([]);\r\n\tconst [isImageSliderModalOpen, setIsImageSliderModalOpen] = useState(false);\r\n\r\n\tconst carousel = useRef(null);\r\n\r\n\tconst nodes = new Map();\r\n\tuseSmoothScrollingPolyfill();\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newMainAsset = initMainProductAsset(props.assets);\r\n\r\n\t\tif (newMainAsset) {\r\n\t\t\tsetMainAsset(newMainAsset);\r\n\t\t} else {\r\n\t\t\tsetMainAsset(productAssetPlaceholder);\r\n\t\t}\r\n\r\n\t\tconst initialThumbnails = initAltAssets(props.assets);\r\n\t\t// #region HCL\r\n\t\tconst assetsWithoutDocs = initialThumbnails.filter((it) => it.assetType !== AssetType.Document);\r\n\t\t// #endregion\r\n\t\tsetAltAssets(assetsWithoutDocs);\r\n\t}, [props.assets]);\r\n\r\n\t/**\r\n\t * Replaces the main image with the provided one\r\n\t * @param e\r\n\t * @param asset\r\n\t */\r\n\tfunction changeMainImage(e: React.MouseEvent, asset: ProductAsset): void {\r\n\t\te.preventDefault();\r\n\t\tsetMainAsset(asset);\r\n\t}\r\n\r\n\t/**\r\n\t * Scrolsl the carousel\r\n\t *\r\n\t * @param {boolean} up\r\n\t * @returns\r\n\t */\r\n\tfunction scrollCarousel(up: boolean) {\r\n\t\tif (Array.from(nodes.values()).length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!carousel || !carousel.current) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst item = Array.from(nodes.values()).filter((node) => node != null)[0];\r\n\r\n\t\tif (window.innerWidth > 767) {\r\n\t\t\tcarousel.current.scrollBy(0, up ? -item.clientHeight : item.clientHeight);\r\n\t\t} else {\r\n\t\t\tcarousel.current.scrollBy(up ? -item.clientHeight : item.clientHeight, 0);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Handle previous button click\r\n\t *\r\n\t */\r\n\tfunction handlePreviousButton() {\r\n\t\tscrollCarousel(true);\r\n\t}\r\n\r\n\t/**\r\n\t * Handle next button click\r\n\t *\r\n\t */\r\n\tfunction handleNextButton() {\r\n\t\tscrollCarousel(false);\r\n\t}\r\n\r\n\tconst assetScroller = (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t
    \r\n\t\t\t\t\t{altAssets.map((altAsset, i) => (\r\n\t\t\t\t\t\t nodes.set(i, c)}\r\n\t\t\t\t\t\t\tclassName=\"roc-pdp-asset-scroller__item\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{altAsset.assetType === AssetType.Image || altAsset.assetType === AssetType.YouTube ? (\r\n\t\t\t\t\t\t\t\t changeMainImage(event, altAsset)}\r\n\t\t\t\t\t\t\t\t\taria-label=\"Select image\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{altAsset.assetType === AssetType.Image ? (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n\r\n\tconst mainImageContent = (\r\n\t\t
\r\n\t\t\t{mainAsset.assetType !== AssetType.YouTube ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\t{props.saleDiscount > 0 ? (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{Localizer('Sale')}\r\n\t\t\t\t\t\t\t{props.saleDiscount}%\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{props.isNewProduct ? (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{Localizer('New')}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{/* #endregion */}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t setIsImageSliderModalOpen(true)}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{/* #endregion */}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t<>\r\n\t\t\t\t{\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tsetIsImageSliderModalOpen(false);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{mainImageContent}\r\n\t\t\t\t\t\t{assetScroller}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{assetScroller}\r\n\t\t\t\t\t\t{mainImageContent}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import { useEffect } from 'react';\r\nimport smoothscroll from 'smoothscroll-polyfill';\r\n\r\nexport default function useSmoothScrollingPolyfill() {\r\n\tuseEffect(() => {\r\n\t\tsmoothscroll.polyfill();\r\n\t}, []);\r\n}\r\n","var map = {\n\t\"./DefaultOrganizationOrderDetails\": [\n\t\t198,\n\t\t9,\n\t\t9,\n\t\t13\n\t],\n\t\"./DefaultOrganizationOrderDetails.tsx\": [\n\t\t198,\n\t\t9,\n\t\t9,\n\t\t13\n\t],\n\t\"./OrganizationOrderListing\": [\n\t\t239,\n\t\t9,\n\t\t18\n\t],\n\t\"./OrganizationOrderListing.tsx\": [\n\t\t239,\n\t\t9,\n\t\t18\n\t],\n\t\"./OrganizationOrders\": [\n\t\t241,\n\t\t9,\n\t\t3,\n\t\t4,\n\t\t5,\n\t\t6,\n\t\t14\n\t],\n\t\"./OrganizationOrders.tsx\": [\n\t\t241,\n\t\t9,\n\t\t3,\n\t\t4,\n\t\t5,\n\t\t6,\n\t\t14\n\t],\n\t\"./RocOrganizationOrderDetails\": [\n\t\t240,\n\t\t9,\n\t\t9\n\t],\n\t\"./RocOrganizationOrderDetails.tsx\": [\n\t\t240,\n\t\t9,\n\t\t9\n\t],\n\t\"./types\": [\n\t\t242,\n\t\t7,\n\t\t19\n\t],\n\t\"./types.ts\": [\n\t\t242,\n\t\t7,\n\t\t19\n\t],\n\t\"./useOrganizationOrderDetails\": [\n\t\t238,\n\t\t9,\n\t\t17\n\t],\n\t\"./useOrganizationOrderDetails.ts\": [\n\t\t238,\n\t\t9,\n\t\t17\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(2).map(__webpack_require__.e)).then(function() {\n\t\treturn __webpack_require__.t(id, ids[1])\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 244;\nmodule.exports = webpackAsyncContext;","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Pagination as PaginationType } from 'shared/types';\r\nimport LeftChevronSVG from './svg/LeftChevronSVG';\r\nimport RightChevronSVG from './svg/RightChevronSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport classnames from 'classnames';\r\nimport { createGuid } from './hawksearch/helpers/Cookies';\r\n\r\ninterface PaginationProps {\r\n\tpagination: PaginationType;\r\n\tgoToNextPage: () => void;\r\n\tgoToPreviousPage: () => void;\r\n\tgoToPage: (page: number) => void;\r\n\tflush?: boolean;\r\n}\r\n\r\nexport default function Pagination(props: PaginationProps) {\r\n\tconst {\r\n\t\tflush,\r\n\t\t// #region HCL\r\n\t\tpagination: { totalPages, pageNumber },\r\n\t\t// #endregion\r\n\t\tgoToNextPage,\r\n\t\tgoToPage,\r\n\t\tgoToPreviousPage,\r\n\t} = props;\r\n\r\n\tconst [uniqueId] = useState(`pagination-input-${createGuid()}`);\r\n\r\n\tconst [localPageNumber, setLocalPageNumber] = useState(undefined);\r\n\r\n\tconst timerRef = useRef(null);\r\n\r\n\t// make sure that the local page number state override is cleared out whenever the pagination page number\r\n\t// changes. this happens whenever a server request is completed and the lifted pagination state is updated\r\n\tuseEffect(() => {\r\n\t\tsetLocalPageNumber(undefined);\r\n\t}, [pageNumber]);\r\n\r\n\tfunction attemptGoToPage(newPageNumber: number) {\r\n\t\tif (newPageNumber < 1 || newPageNumber > totalPages) {\r\n\t\t\t// an invalid page number was entered, so clear out the user entry and do nothing.\r\n\t\t\tsetLocalPageNumber(undefined);\r\n\t\t} else {\r\n\t\t\tgoToPage(newPageNumber);\r\n\t\t}\r\n\t}\r\n\r\n\t// debounce the pager updates\r\n\tuseEffect(() => {\r\n\t\tif (timerRef.current) {\r\n\t\t\tclearTimeout(timerRef.current);\r\n\t\t}\r\n\r\n\t\ttimerRef.current = setTimeout(() => {\r\n\t\t\tif (localPageNumber) {\r\n\t\t\t\tattemptGoToPage(parseInt(localPageNumber));\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [localPageNumber]);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\r\n\t\t\t{Localizer('OfTotalPages', totalPages.toLocaleString())}\r\n\r\n\t\t\t= totalPages}\r\n\t\t\t\t// #endregion\r\n\t\t\t\tdata-testid=\"pagination-right-btn\"\r\n\t\t\t\taria-label={Localizer('Next')}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Generic file SVG\r\n */\r\nfunction FileSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FileSVG;\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport CircleExclamationSVG from 'shared/components/svg/CircleExclamationSVG';\r\nimport { useField } from 'react-final-form';\r\n\r\ninterface FieldInputErrorWrapperProps {\r\n\thideIcon?: boolean;\r\n\tchildren: React.ReactNode;\r\n\tinline?: boolean;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Component for handling the invalid styles for inputs.\r\n *\r\n * @export\r\n * @param {FieldInputErrorWrapperProps} props\r\n * @returns\r\n */\r\nexport default function FieldInputErrorWrapper(props: FieldInputErrorWrapperProps) {\r\n\tconst { hideIcon = false, children, inline = false, name } = props;\r\n\tconst { meta } = useField(name);\r\n\tconst invalid =\r\n\t\t(meta.error || (meta.submitError && !meta.dirtySinceLastSubmit && !meta.submitting)) &&\r\n\t\tmeta.touched &&\r\n\t\tmeta.invalid\r\n\t\t\t? meta.invalid\r\n\t\t\t: false;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\t{invalid && !hideIcon ? : null}\r\n\t\t\r\n\t);\r\n}\r\n","import 'intersection-observer';\r\n\r\nif (document.readyState !== 'loading') {\r\n\tlazyLoadImages();\r\n} else {\r\n\tdocument.addEventListener('DOMContentLoaded', function () {\r\n\t\tlazyLoadImages();\r\n\t});\r\n}\r\n\r\n/**\r\n * Initializes lazy loading for image assets.\r\n * Example usage:\r\n * \"\"\r\n */\r\nexport function lazyLoadImages() {\r\n\t// Get our lazy-loaded images\r\n\tconst lazyImages = [].slice.call(document.querySelectorAll('.roc-lazy-image'));\r\n\r\n\tconst defaultDelay = 10;\r\n\t// Create new observer object\r\n\tconst lazyImageObserver = new IntersectionObserver(function (entries) {\r\n\t\t// Loop through IntersectionObserverEntry objects\r\n\t\tentries.forEach(function (entry) {\r\n\t\t\t// Do these if the target intersects with the root\r\n\t\t\tif (entry.isIntersecting) {\r\n\t\t\t\tconst lazyImage = entry.target as HTMLImageElement;\r\n\r\n\t\t\t\tif (lazyImage.dataset.src) {\r\n\t\t\t\t\tlazyImage.src = lazyImage.dataset.src;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst attributeDelay = Number(lazyImage.getAttribute('data-roc-lazy-delay')) || defaultDelay;\r\n\t\t\t\tlazyImage.classList.remove('roc-lazy-image--inactive');\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tlazyImage.classList.add('roc-lazy-image--loaded');\r\n\t\t\t\t\tlazyImageObserver.unobserve(lazyImage);\r\n\t\t\t\t}, attributeDelay);\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t// Loop through and observe each image\r\n\tlazyImages.forEach(function (lazyImage) {\r\n\t\tlazyImageObserver.observe(lazyImage);\r\n\t});\r\n}\r\n\r\ninterface LazyElementsArgs {\r\n\t/**\r\n\t * The elements to observe\r\n\t */\r\n\telements: HTMLElement[];\r\n\r\n\t/**\r\n\t * The callback function called when the intersection observer fires.\r\n\t */\r\n\tcallback: (isIntersecting: boolean) => void;\r\n\r\n\t/**\r\n\t * The amount of time to delay before calling the callback. Defaults to 0.\r\n\t */\r\n\tdelay?: number;\r\n\r\n\t/**\r\n\t * Stop listening to changes once the element has been in the viewport.\r\n\t */\r\n\tstopAfterIntersecting?: boolean;\r\n}\r\n\r\n/**\r\n * Helper to receive a callback when an element becomes visible in a viewport, or when it leaves the viewport.\r\n * This is useful if you need to do a vanilla JS implementation (without React).\r\n */\r\nexport function lazyElements({ elements, callback, delay = 0, stopAfterIntersecting = true }: LazyElementsArgs) {\r\n\tconst lazyElementObserver = new IntersectionObserver(function (entries) {\r\n\t\tentries.forEach((entry) => {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcallback(entry.isIntersecting);\r\n\t\t\t}, delay);\r\n\r\n\t\t\tif (stopAfterIntersecting && entry.isIntersecting) {\r\n\t\t\t\tlazyElementObserver.unobserve(entry.target);\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\telements.forEach((lazyElement) => {\r\n\t\tlazyElementObserver.observe(lazyElement);\r\n\t});\r\n}\r\n","import { UseAxiosPaginatedLoaderResult, useAxiosPaginatedLoader } from 'shared/hooks/useAxiosPaginatedLoader';\r\nimport { PaginatedResult } from 'shared/types';\r\nimport { ShoppingListDto } from './types';\r\n\r\n/**\r\n * useShoppingLists hook result object\r\n */\r\ninterface UseShoppingListsResult\r\n\textends UseAxiosPaginatedLoaderResult> {}\r\n\r\ninterface UseShoppingListsParams {\r\n\tinitialPageSize?: number;\r\n\t// #region HCL\r\n\tproductId?: string;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Custom hook for my account Shopping Lists\r\n */\r\nexport function useShoppingListLoader({ initialPageSize, productId }: UseShoppingListsParams): UseShoppingListsResult {\r\n\tconst {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t} = useAxiosPaginatedLoader>({\r\n\t\taxiosParams: {\r\n\t\t\turl: `/ajax/shopping-lists`,\r\n\t\t},\r\n\t\tinitialPageSize: initialPageSize || 20,\r\n\t\t// #region HCL\r\n\t\tquery: `productId=${productId || ''}`,\r\n\t\t// #endregion\r\n\t});\r\n\r\n\treturn {\r\n\t\tpage,\r\n\t\tgoToPage,\r\n\t\tgoToNextPage,\r\n\t\tgoToPreviousPage,\r\n\t\tsetSorting,\r\n\t\tsetPageSize,\r\n\t\terror,\r\n\t\tloading,\r\n\t\tresults,\r\n\t\tsortByName,\r\n\t\tsortDirection,\r\n\t};\r\n}\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\nimport React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\n\r\nexport interface FieldLabelProps extends WithTestIdOptional {\r\n\tlabel: string;\r\n\tname: string;\r\n\tid?: string;\r\n\tisRequired: boolean;\r\n\thtmlFor?: string;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Wrapper component for all field labels for ease of use.\r\n */\r\nexport default function FieldLabel(props: FieldLabelProps) {\r\n\tconst { label, id, isRequired, htmlFor, children, testId } = props;\r\n\r\n\tif (!label || !label.trim()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{label}\r\n\t\t\t{!isRequired ? : null}\r\n\t\t\t{children ? children : null}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport CheckboxInputField from './CheckboxInputField';\r\nimport { BaseInputProps } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a checkbox field\r\n */\r\nexport default function CheckBoxField({\r\n\tname,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tsubscription,\r\n\tdefaultValue,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\nexport type DropdownProps = FormFieldProps & {\r\n\taddSelectOption?: boolean;\r\n\toptions: DropdownOption[];\r\n\t// #region HCL\r\n\tdefaultValue?: any;\r\n\t// #endregion\r\n};\r\n\r\nexport type DropdownFieldProps = DropdownProps &\r\n\tFieldProps>;\r\n\r\n/**\r\n * Component that renders a Dropdown field component\r\n */\r\nexport default function DropdownField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\taddSelectOption = true,\r\n\toptions,\r\n\tlabel = '',\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tformatOnBlur,\r\n\tisEqual,\r\n\tsubscription,\r\n\tvalidateFields,\r\n\ttestId,\r\n\t// #region HCL\r\n\tdefaultValue\r\n\t// #endregion\r\n}: DropdownFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange, onFocus, onBlur }, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{addSelectOption ? \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport StarRating from '~/shared/components/star-rating/StarRating';\r\nimport { Field } from 'react-final-form';\r\nimport OptionalFieldMarker from '../OptionalFieldMarker';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FormFieldProps } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { LocalizedSpan } from 'services/Localizer';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface StarRatingFieldProps extends FormFieldProps {\r\n\t/**\r\n\t * The maximum number of stars to display (default is 5)\r\n\t */\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * Reusable RFF-compatible field that displays a star rating input\r\n * @param props\r\n */\r\nexport default function StarRatingField({\r\n\tname,\r\n\tlabel = '',\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tmaxRating = 5,\r\n\tisRequired = true,\r\n\ttestId,\r\n}: StarRatingFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input: { value, onChange }, meta }) => (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{label} {!isRequired ? : null}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t${value}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t\t`${maxRating}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { ValidationMessages, FormFieldProps } from '.';\r\nimport { FieldProps, Field, FieldRenderProps } from 'react-final-form';\r\nimport FieldLabel from './FieldLabel';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport classnames from 'classnames';\r\n\r\nexport type TextAreaFieldProps = FieldProps> &\r\n\tFormFieldProps & {\r\n\t\trows?: number;\r\n\t\tplaceholder?: string;\r\n\t\tmaxLength?: number;\r\n\t};\r\n\r\n/**\r\n * Component that renders a textarea input component.\r\n */\r\nexport default function TextAreaField({\r\n\tname,\r\n\tisRequired = true,\r\n\treadOnly = false,\r\n\tdisabled = false,\r\n\tplaceholder = '',\r\n\tlabel = '',\r\n\trows = 5,\r\n\tvalidate,\r\n\tafterSubmit,\r\n\tallowNull,\r\n\tbeforeSubmit,\r\n\tcomponent,\r\n\tdefaultValue,\r\n\tformat,\r\n\tformatOnBlur,\r\n\tinitialValue,\r\n\tisEqual,\r\n\tparse,\r\n\trender,\r\n\tsubscription,\r\n\tvalue,\r\n\ttestId,\r\n\tmaxLength,\r\n}: TextAreaFieldProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { FormFieldProps, ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport FieldLabel from './FieldLabel';\r\n\r\nexport interface BaseInputProps extends FormFieldProps {\r\n\ttype?: string;\r\n\tstep?: string;\r\n}\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\nexport type HTMLInputRef = React.MutableRefObject;\r\n/**\r\n * Component that renders an input with form field.\r\n */\r\nconst InputField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tinput: { name, onChange, value },\r\n\t\tmeta,\r\n\t\ttype,\r\n\t\tlabel = '',\r\n\t\tisRequired = true,\r\n\t\tdisabled = false,\r\n\t\treadOnly = false,\r\n\t\tplaceholder = '',\r\n\t\tstep,\r\n\t\ttestId,\r\n\t\t// #region HCL\r\n\t\tmaxLength,\r\n\t\t// #endregion\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n});\r\n\r\nexport default InputField;\r\n","import React from 'react';\r\nimport { Field, FieldProps, FieldRenderProps } from 'react-final-form';\r\nimport InputField, { BaseInputProps, HTMLInputRef } from './InputField';\r\n\r\nexport type InputFieldProps = FieldProps> & BaseInputProps;\r\n\r\n/**\r\n * Component that renders a text box component, of the specified type\r\n */\r\nconst TextBoxField = React.forwardRef((props: InputFieldProps, ref: HTMLInputRef) => {\r\n\tconst {\r\n\t\tname,\r\n\t\ttype = 'text',\r\n\t\tisRequired = true,\r\n\t\treadOnly = false,\r\n\t\tdisabled = false,\r\n\t\tplaceholder = '',\r\n\t\tlabel = '',\r\n\t\tvalidate,\r\n\t\tafterSubmit,\r\n\t\tallowNull,\r\n\t\tbeforeSubmit,\r\n\t\tcomponent,\r\n\t\tdefaultValue,\r\n\t\tformat,\r\n\t\tformatOnBlur,\r\n\t\tinitialValue,\r\n\t\tisEqual,\r\n\t\tparse,\r\n\t\trender,\r\n\t\tsubscription,\r\n\t\tvalue,\r\n\t\ttestId,\r\n\t\t// #region HCL\r\n\t\tmaxLength,\r\n\t\t// # endregion\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n});\r\n\r\nexport default TextBoxField;\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AxiosError } from 'axios';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\t/**\r\n\t * The title of the error message such as \"Uh Oh!\" or \"An Unexpected Error has Occurred!\"\r\n\t */\r\n\ttitle: string;\r\n\r\n\t/**\r\n\t * The error message to display if an error object doesn't have a more appropriate message.\r\n\t */\r\n\tmessage: React.ReactNode | string;\r\n\r\n\tchildren?: any;\r\n\r\n\ttheme?: Theme;\r\n\r\n\tisTitleOnOwnRow?: boolean;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n\r\n\t/**\r\n\t * Method from parent that handles collapse state.\r\n\t */\r\n\tonCollapse?: (collased: boolean) => void;\r\n\r\n\t/**\r\n\t * Controlled collapse state from parent.\r\n\t */\r\n\tisCollapsed?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable Error Alert Component.\r\n */\r\nexport default function InlineAlert(props: ErrorAlertProps) {\r\n\tconst {\r\n\t\ttitle = InlineAlert.defaultProps.title,\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t\terror = InlineAlert.defaultProps.error,\r\n\t\tisCollapsed = false,\r\n\t\tonCollapse,\r\n\t} = props;\r\n\r\n\tlet { message = InlineAlert.defaultProps.message } = props;\r\n\r\n\tconst axiosError = error as AxiosError | null;\r\n\tif (axiosError?.isAxiosError && axiosError != null && axiosError.response == null && axiosError.request != null) {\r\n\t\tmessage = Localizer('ErrorMessageNetwork');\r\n\t}\r\n\r\n\tif (axiosError?.isAxiosError && (axiosError?.response?.status === 401 || axiosError?.response?.status === 403)) {\r\n\t\tmessage = Localizer('ErrorMessageForbidden');\r\n\t}\r\n\r\n\tif (axiosError?.response?.data?.message) {\r\n\t\tmessage = axiosError.response.data.message;\r\n\t}\r\n\r\n\tif (isCollapsed) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{onCollapse ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{title ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{title}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{message ? {message} : null}\r\n\r\n\t\t\t{children ? <> {children} : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Error Alert Default Props\r\n */\r\nInlineAlert.defaultProps = {\r\n\ttitle: Localizer('ErrorMessageGenericTitle'),\r\n\tmessage: Localizer('UnexpectedErrorOccurred'),\r\n\terror: null,\r\n};\r\n","import { useState } from 'react';\r\nimport Axios, { CancelTokenSource, AxiosError } from 'axios';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { MY_ACCOUNT_SHOPPING_LISTS_URL } from 'features/my-account/routes.commerce';\r\nimport { AddToListProps, BulkAddToListProps, ShoppingListDto } from './types';\r\nimport { AddToListResponse, BulkAddToListResponse } from 'services/UserData.Commerce';\r\n\r\nexport interface ShoppingListsState {\r\n\tisSaving: boolean;\r\n\tshoppingListBeingEdited: ShoppingListDto | null;\r\n\tshoppingList: ShoppingListDto | null;\r\n\terror: Error | AxiosError | null;\r\n\terrorMessage: string | null;\r\n\tisDeleting: boolean;\r\n}\r\n\r\nexport interface ShoppingListsActor {\r\n\tbeginCreateShoppingList: () => void;\r\n\tbeginEditShoppingList: (shopingList: ShoppingListDto) => void;\r\n\tsaveShoppingList: (formValues: ShoppingListDto) => FormValidationPromise;\r\n\tstopEditingShoppingList: () => void;\r\n\taddProductToList: (props: AddToListProps) => Promise;\r\n\tbulkAddProductToList: (props: BulkAddToListProps) => Promise;\r\n\tremoveShoppingList: (shoppingList: ShoppingListDto) => Promise;\r\n}\r\n\r\nexport interface UseShoppingLists {\r\n\tstate: ShoppingListsState;\r\n\tactor: ShoppingListsActor;\r\n}\r\n\r\nexport function useShoppingLists(): UseShoppingLists {\r\n\tconst [shoppingListBeingEdited, setShoppingListBeingEdited] = useState(null);\r\n\tconst [error, setError] = useState(null);\r\n\tconst [errorMessage, setErrorMessage] = useState(null);\r\n\tconst [isSaving, setIsSaving] = useState(false);\r\n\tconst [shoppingList, setShoppingList] = useState(null);\r\n\tconst [isDeleting, setIsDeleting] = useState(false);\r\n\r\n\t/**\r\n\t * Begin creating an shopping list\r\n\t */\r\n\tconst beginEditShoppingList = (shoppingList: ShoppingListDto) => {\r\n\t\tsetShoppingListBeingEdited(shoppingList);\r\n\t};\r\n\r\n\tconst beginCreateShoppingList = () => {\r\n\t\tsetShoppingListBeingEdited({} as ShoppingListDto);\r\n\t};\r\n\r\n\tconst stopEditingShoppingList = () => {\r\n\t\tsetError(null);\r\n\t\tsetShoppingListBeingEdited(null);\r\n\t};\r\n\r\n\t/**\r\n\t * Creates an shopping list associated to the current user on the server\r\n\t */\r\n\tconst saveShoppingList = async (formValues: ShoppingListDto): FormValidationPromise => {\r\n\t\t// sanity check\r\n\t\tif (!shoppingListBeingEdited) {\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\r\n\t\tsetIsSaving(true);\r\n\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\tconst shoppingList: ShoppingListDto = {\r\n\t\t\t...formValues,\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax${MY_ACCOUNT_SHOPPING_LISTS_URL}/edit`,\r\n\t\t\t\tshoppingList,\r\n\t\t\t\t{\r\n\t\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\tsetShoppingListBeingEdited(null);\r\n\t\t\tsetShoppingList(response.data);\r\n\t\t\tsetError(null);\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetError(error);\r\n\r\n\t\t\treturn handleAxiosErrorWithValidation(error, Localizer('SaveErrorMessage'));\r\n\t\t} finally {\r\n\t\t\tsetIsSaving(false);\r\n\t\t}\r\n\t};\r\n\r\n\tconst addProductToList = async (props: AddToListProps) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}/products/${props.itemId}`,\r\n\t\t\t\t{\r\n\t\t\t\t\tquantity: props.quantity,\r\n\t\t\t\t\tproductPricingLineId: props.productPricingLineId,\r\n\t\t\t\t\taddOns: props.addOns,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding product to list', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t};\r\n\r\n\tconst bulkAddProductToList = async (props: BulkAddToListProps) => {\r\n\t\tsetErrorMessage(null);\r\n\t\tsetError(null);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(\r\n\t\t\t\t`/ajax/shopping-lists/${props.shoppingListId}`,\r\n\t\t\t\t{\r\n\t\t\t\t\titems: props.items,\r\n\t\t\t\t},\r\n\t\t\t);\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tsetError(error);\r\n\r\n\t\t\tconsole.warn('Error when adding products to list', error);\r\n\r\n\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.data) {\r\n\t\t\t\tif (axiosError.response.data.message) {\r\n\t\t\t\t\tsetErrorMessage(axiosError.response.data.message);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t};\r\n\r\n\tconst removeShoppingList = async (shoppingList: ShoppingListDto): Promise => {\r\n\t\tconst requestToken: CancelTokenSource = Axios.CancelToken.source();\r\n\r\n\t\tsetIsDeleting(true);\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.delete(`/ajax/shopping-lists/${shoppingList.id}`, {\r\n\t\t\t\tcancelToken: requestToken.token,\r\n\t\t\t});\r\n\r\n\t\t\tif (response) {\r\n\t\t\t\tdocument.location.href = MY_ACCOUNT_SHOPPING_LISTS_URL;\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetError(error);\r\n\t\t\tconsole.error('An error occurred while deleting.', error);\r\n\t\t} finally {\r\n\t\t\tsetIsDeleting(false);\r\n\t\t}\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\tisSaving,\r\n\t\t\terror: error,\r\n\t\t\tshoppingListBeingEdited,\r\n\t\t\tshoppingList: shoppingList,\r\n\t\t\terrorMessage: errorMessage,\r\n\t\t\tisDeleting,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tbeginCreateShoppingList,\r\n\t\t\tbeginEditShoppingList,\r\n\t\t\tsaveShoppingList,\r\n\t\t\tstopEditingShoppingList,\r\n\t\t\taddProductToList,\r\n\t\t\tbulkAddProductToList,\r\n\t\t\tremoveShoppingList,\r\n\t\t},\r\n\t};\r\n}\r\n","import { useEffect } from 'react';\r\nimport 'shared/polyfills/customEvent';\r\nimport { RocEventType, ExtractEventParameters, RocEvent } from 'shared/events';\r\nimport addRocEventHandler from 'shared/util/events/rocEventUtils';\r\n\r\n/**\r\n * Helper function for dispatching ROC events.\r\n *\r\n * @param eventType The event type for the dispatcher\r\n */\r\nexport function dispatchRocEvent(eventType: T, data: ExtractEventParameters) {\r\n\tconst event = new CustomEvent(eventType, {\r\n\t\tdetail: data,\r\n\t});\r\n\tdocument.dispatchEvent(event);\r\n}\r\n\r\n/**\r\n * Reusable hook for handling ROC events\r\n *\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @param deps List of dependencies\r\n */\r\nexport default function useRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n\tdeps?: any[],\r\n) {\r\n\tuseEffect(() => {\r\n\t\tconst removeHandlerCallback = addRocEventHandler(eventType, eventHandler);\r\n\r\n\t\treturn () => {\r\n\t\t\tremoveHandlerCallback();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, deps);\r\n}\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { DropdownField, TextBoxField } from 'shared/edit/fields';\r\nimport { PrivacyTypeOptions } from './types';\r\n\r\nexport function ShoppingListEditItemFields() {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import React, { useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Alert from 'shared/components/Alert';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { ShoppingListEditItemFields } from './ShoppingListEditItemFields';\r\nimport { ShoppingListEditItemBodyProps } from './ShoppingListEditItem';\r\n\r\nexport default function ShoppingListEditItemBody(props: ShoppingListEditItemBodyProps) {\r\n\tconst [isAlertOpen, setIsAlertOpen] = useState(false);\r\n\r\n\tconst {\r\n\t\tdisplayCancelButton,\r\n\t\tdisplaySaveButton,\r\n\t\tstopEditingShoppingList,\r\n\t\tonRemoveShoppingList,\r\n\t\tisSaving,\r\n\t\tdirty,\r\n\t\tdirtySaveButtonText,\r\n\t\tsaveButtonText,\r\n\t\tshoppingListBeingEdited,\r\n\t\tisDeleting,\r\n\t} = props;\r\n\treturn (\r\n\t\t<>\r\n\t\t\t

{Localizer('RequiredFields')}

\r\n\r\n\t\t\t\r\n\r\n\t\t\t
\r\n\t\t\t\t{onRemoveShoppingList ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tsetIsAlertOpen(true);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tdata-testid=\"shopping-list-delete-button\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{isDeleting && }\r\n\t\t\t\t\t\t\t\t{Localizer('Delete')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t Localizer('DeleteShoppingList')}\r\n\t\t\t\t\t\t\tonCancel={() => setIsAlertOpen(false)}\r\n\t\t\t\t\t\t\tonConfirm={() => {\r\n\t\t\t\t\t\t\t\tsetIsAlertOpen(false);\r\n\r\n\t\t\t\t\t\t\t\tonRemoveShoppingList(shoppingListBeingEdited);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\ttheme=\"danger\"\r\n\t\t\t\t\t\t\tconfirmButtonText={Localizer('Delete')}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('DeleteShoppingListConfirmationQuestion')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t\t{displayCancelButton ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tstopEditingShoppingList();\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('Cancel')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\t\t\t\t{displaySaveButton ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{dirty ? dirtySaveButtonText : saveButtonText}\r\n\r\n\t\t\t\t\t\t\t{isSaving && }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t) : null}\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n\r\nShoppingListEditItemBody.defaultProps = {\r\n\tdisplayCancelButton: true,\r\n\tdisplaySaveButton: true,\r\n\tsaveButtonText: Localizer('Save'),\r\n\tdirtySaveButtonText: Localizer('Save'),\r\n};\r\n","import * as React from 'react';\r\nimport { Form } from 'react-final-form';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { FormValidationPromise } from 'shared/types';\r\nimport ShoppingListEditItemBody from './ShoppingListEditItemBody';\r\nimport { ShoppingListDto } from './types';\r\n\r\ninterface ShoppingListEditItemProps {\r\n\tshoppingListBeingEdited: ShoppingListDto;\r\n\tonSaveShoppingList: (formValues: ShoppingListDto, hasChanges: boolean) => FormValidationPromise;\r\n\tonRemoveShoppingList?: (shoppingList: ShoppingListDto) => void;\r\n\tstopEditingShoppingList: () => void;\r\n\tisSaving: boolean;\r\n\tdisplayCancelButton: boolean;\r\n\tdisplaySaveButton: boolean;\r\n\tsaveButtonText: string;\r\n\tdirtySaveButtonText: string;\r\n\tshoppingList?: ShoppingListDto[];\r\n\tisDeleting?: boolean;\r\n}\r\n\r\nexport interface ShoppingListEditItemBodyProps {\r\n\tshoppingListBeingEdited: ShoppingListDto;\r\n\tstopEditingShoppingList: () => void;\r\n\tonRemoveShoppingList?: (shoppingList: ShoppingListDto) => void;\r\n\tisSaving: boolean;\r\n\tdisplayCancelButton: boolean;\r\n\tdisplaySaveButton: boolean;\r\n\tsaveButtonText: string;\r\n\tdirtySaveButtonText: string;\r\n\t/** Whether to prevent the \"Set as Default\" checkbox from rendering */\r\n\tshoppingList?: ShoppingListDto[];\r\n\tdirty: boolean;\r\n\tisDeleting?: boolean;\r\n}\r\n\r\n/**\r\n * Handles loading the create/edit component.\r\n * Contains a form with the shopping list fields for add an shopping list.\r\n * Form validation, callbacks and data functions are handled in the containing component (ShoppingList).\r\n */\r\nexport default function ShoppingListEditItem(props: ShoppingListEditItemProps) {\r\n\tconst { onSaveShoppingList, shoppingListBeingEdited } = props;\r\n\r\n\treturn (\r\n\t\t {\r\n\t\t\t\treturn onSaveShoppingList(values, form.getState().dirty);\r\n\t\t\t}}\r\n\t\t\tsubscription={{ pristine: true, dirty: true, submitError: true }}\r\n\t\t\tinitialValues={{\r\n\t\t\t\t...shoppingListBeingEdited,\r\n\t\t\t}}\r\n\t\t\trender={({ handleSubmit, dirty }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nShoppingListEditItem.defaultProps = {\r\n\tdisplayCancelButton: true,\r\n\tdisplaySaveButton: true,\r\n\tsaveButtonText: Localizer('Save'),\r\n\tdirtySaveButtonText: Localizer('Save'),\r\n};\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * X SVG\r\n *\r\n * @returns\r\n */\r\nfunction XSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default XSVG;\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosResponse } from 'axios';\r\n\r\nexport interface UserSummary {\r\n\tisSignedIn: boolean;\r\n\tuserName: string | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\temail: string | null;\r\n\tphoneNumber: string | null;\r\n\ttwoFactorEnabled: boolean;\r\n\thasRecoveryCodes: boolean;\r\n\tisMachineRemembered: boolean;\r\n\tannouncements: UserAnnouncement[];\r\n\tisExternalLoginUser: boolean;\r\n\t// #region HCL\r\n\tversaPayEnabled: boolean;\r\n\tversaPayRedirectUrl: string | null;\r\n\tazureUserId: string | null;\r\n\t// #endregion\r\n}\r\n\r\n/** Represents the details about an admin impersonation session of the logged in user. */\r\nexport interface Impersonation {\r\n\t/** The id of the admin impersonating the front end user. */\r\n\timpersonatorId: string;\r\n\r\n\t/** The name of the admin impersonating the front end user. */\r\n\timpersonatorName: string;\r\n\r\n\t/** The id of the active user impersonation session. */\r\n\tsessionId: string;\r\n}\r\n\r\nexport interface UserData {\r\n\t/**\r\n\t * Summary of user-specific details\r\n\t */\r\n\tsummary?: UserSummary;\r\n\r\n\t/**\r\n\t * CSRF validation token generated by the server\r\n\t */\r\n\trequestToken?: string;\r\n\r\n\t/**\r\n\t * The information on an impersonation session if one is active.\r\n\t * If an impersonation session isn't active this field will be undefined.\r\n\t */\r\n\timpersonation?: Impersonation;\r\n}\r\n\r\nexport interface UserAnnouncement {\r\n\t/** The id used as the primary key for the announcement in the database */\r\n\tid: string;\r\n\r\n\t/** An announcement to be displayed to the user */\r\n\tmessage: string;\r\n\r\n\t/** A list of pages where the announcement will be displayed. This will be an empty array if it is to be displayed on all pages. */\r\n\tpages: string[];\r\n}\r\n\r\nlet userDataPromise: Promise> | null = null;\r\n\r\n/**\r\n * Returns details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserData = () => {\r\n\tif (userDataPromise === null) {\r\n\t\tuserDataPromise = AxiosHelper.get('/ajax/user');\r\n\t}\r\n\r\n\treturn userDataPromise;\r\n};\r\n\r\n/**\r\n * Returns non-cached details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserDataNoCache = () => {\r\n\treturn AxiosHelper.get('/ajax/user');\r\n};\r\n\r\n/**\r\n * Returns a promise that will contain the CSRF token generated on the server to be used to validate\r\n * forms being posted via AJAX.\r\n */\r\nexport async function getCsrfToken() {\r\n\ttry {\r\n\t\tconst userData = await getUserData();\r\n\t\treturn userData.data.requestToken;\r\n\t} catch (error) {\r\n\t\tconsole.warn('Unable to load CSRF token.');\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\n// #region Commerce\r\nimport { CartSummary } from './UserData.Commerce';\r\nimport { LocationDto } from 'features/commerce/store-locator/types';\r\nimport { OrganizationInvite, OrganizationShipTo } from 'shared-client/types/commerce/organization';\r\nimport { AutoSuggestOption } from '../../../Roc.SharedClientApp/types/fields';\r\n\r\n// Commerce extensions to the UserData interface\r\nexport interface UserData {\r\n\t// #region HCL - allows null\r\n\tcartSummary?: CartSummary | null;\r\n\t// #endregion\r\n\r\n\t/***\r\n\t * The customer's default store location or null if not set\r\n\t */\r\n\tdefaultStoreLocation?: LocationDto | null;\r\n\r\n\t/**\r\n\t * If store is enabled for this site\r\n\t */\r\n\tenableStoreLocation?: boolean;\r\n}\r\n\r\n/***\r\n * Organization data and permissions\r\n */\r\nexport interface Organization {\r\n\tid: string;\r\n\tpurchaseOrderNumberRequired: boolean;\r\n\tcreditCardAllowed: boolean;\r\n\tgiftCardAllowed: boolean;\r\n\torganizationName: string;\r\n\tcorpAccountAllowed: boolean;\r\n}\r\n\r\n/***\r\n * Organization dto data\r\n */\r\nexport interface OrganizationDto extends AutoSuggestOption {}\r\n\r\n/***\r\n * User's organization and permissions data\r\n */\r\nexport interface UserSummary {\r\n\t/***\r\n\t * User's current default organization\r\n\t */\r\n\torganization: Organization | null;\r\n\r\n\t/***\r\n\t * The list of organizations the user is part of\r\n\t */\r\n\tuserOrganizations?: OrganizationDto[] | null;\r\n\r\n\t/***\r\n\t * The selected organization ship to\r\n\t */\r\n\tselectedShipTo: OrganizationShipTo | null;\r\n\r\n\t/***\r\n\t * Defines if the user has multiple shiptos to select from\r\n\t */\r\n\thasMultipleShipTos: boolean | null;\r\n\r\n\t/***\r\n\t * Defines if the user has saved payment methods\r\n\t */\r\n\thasSavedPaymentMethods: boolean | null;\r\n\r\n\t/***\r\n\t * The list of user permissions\r\n\t */\r\n\tpermissions?: UserPermissions;\r\n\r\n\t/***\r\n\t * The list of organizations the user is invited to join\r\n\t */\r\n\torganizationInvites?: OrganizationInvite[];\r\n\r\n\t/***\r\n\t * The user organization removal notification\r\n\t * Used to notify the user if he is no more part of his default organization\r\n\t */\r\n\tuserOrganizationRemovalNotification?: string;\r\n}\r\n\r\n/***\r\n * User's permissions\r\n */\r\nexport interface UserPermissions {\r\n\t/***\r\n\t * Defines if the current user can see organization users\r\n\t */\r\n\tcanSeeOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can assign roles to organization users\r\n\t */\r\n\tcanAssignRolesToOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can remove users from an organization\r\n\t */\r\n\tremoveUserFromOrganization?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can create organization users\r\n\t */\r\n\tcreateOrganizationUser?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can enable/disable ShipTos for organization users\r\n\t */\r\n\tmanageShipTosAssociation?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can see status of the organization users\r\n\t */\r\n\tcanSeePendingOrganizationUsers?: boolean;\r\n}\r\n// #endregion\r\n","export enum ModelStatus {\r\n\tPublished = 'Published',\r\n\tInactive = 'Inactive',\r\n\tDeleted = 'Deleted',\r\n\tDraft = 'Draft',\r\n\tArchived = 'Archived',\r\n}\r\n","import React from 'react';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\n\r\n// eslint-disable-next-line\r\n// tslint:disable-next-line\r\nexport interface ErrorBoundaryRenderProps extends ErrorBoundaryState {}\r\n\r\nexport interface ErrorBoundaryProps {\r\n\tchildren: React.ReactNode;\r\n\trenderError?: (renderProps: ErrorBoundaryRenderProps) => React.ReactNode;\r\n}\r\n\r\nexport interface ErrorBoundaryState {\r\n\terror?: Error;\r\n}\r\n\r\n/**\r\n * Default Error Boundary component for frontend components, so that in case a JS error occurs, we show\r\n * something instead of nothing.\r\n */\r\nexport default class ErrorBoundary extends React.Component {\r\n\tpublic static defaultProps = {\r\n\t\trenderError: (renderProps: ErrorBoundaryRenderProps) => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\r\n\t\tif (error.name === 'ChunkLoadError') {\r\n\t\t\tconst lastRefreshedTimestamp = new Date(\r\n\t\t\t\tparseInt(window.localStorage.getItem('force-refresh-timestamp') || '0'),\r\n\t\t\t);\r\n\t\t\tconst pageAlreadyRefreshedLessThan30SecondsAgo =\r\n\t\t\t\tnew Date(lastRefreshedTimestamp.getTime() + 30 * 1000) > new Date();\r\n\r\n\t\t\tif (!pageAlreadyRefreshedLessThan30SecondsAgo) {\r\n\t\t\t\t// Assuming that the user is not on the latest version of the application. Refresh the page immediately.\r\n\t\t\t\twindow.localStorage.setItem('force-refresh-timestamp', new Date().getTime().toString());\r\n\t\t\t\treturn window.location.reload();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\terror,\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.error) {\r\n\t\t\treturn this.props.renderError!(this.state);\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\n\r\nexport default {\r\n\tBaseUrl: ServerData.ACCOUNT_URL_BASE ?? '/my-account',\r\n\tLogin: ServerData.ACCOUNT_LOGIN_URL ?? '/my-account/login',\r\n\tLogin2fa: ServerData.ACCOUNT_LOGIN_WITH_2FA_URL ?? '/my-account/login-with-2fa',\r\n\tRegister: ServerData.ACCOUNT_REGISTER_URL ?? '/my-account/register',\r\n\tForgotPassword: ServerData.ACCOUNT_FORGOT_PASSWORD_URL ?? '/my-account/forgot-password',\r\n\tLoginWithRecoveryCode: ServerData.ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL ?? '/my-account/login-with-recovery-code',\r\n\tLogout: ServerData.ACCOUNT_LOGOUT_URL ?? '/my-account/logout',\r\n\t// #region Commerce\r\n\tOrganizationReview: ServerData.ACCOUNT_ORGANIZATION_REVIEW_URL ?? '/my-account/organization-review',\r\n\tOrganizationSelector: ServerData.ACCOUNT_ORGANIZATION_SELECTOR_URL ?? '/my-account/organization-selector',\r\n\t// #endregion\r\n\t// #region HCL - hardcoded same way as external login is\r\n\tExternalLogout: '/my-account/external-logout',\r\n\t// #endregion\r\n};\r\n","import { Address } from 'shared-client/types/address';\r\nimport {\r\n\tHasNoSalePrice,\r\n\tMissingDisplayPrice,\r\n\tPrice,\r\n\tSimpleDisplayPrice,\r\n} from 'shared-client/types/commerce/display-price';\r\nimport { OrderItemAddOn } from 'shared-client/types/commerce/add-ons';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport { BasicDto, PaginatedResult } from 'shared/types';\r\nimport { ShippingMethod, ShippingOption } from '../checkout/types/shipping';\r\nimport { ProductAddOnDto, ProductPricingLine, ProductSelection, SimpleSelectionDto } from '../product-details/types';\r\n\r\n/**\r\n * Represents a single line item on an order\r\n *\r\n */\r\nexport interface OrderItem {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The order line item name\r\n\t */\r\n\tname: string;\r\n\r\n\t/**\r\n\t * The order line item Sku\r\n\t */\r\n\tsku: string;\r\n\r\n\t/**\r\n\t * The line item's quantity\r\n\t */\r\n\tquantity: number;\r\n\r\n\t/**\r\n\t *\r\n\t * The order line item product URL\r\n\t */\r\n\turl: string;\r\n\r\n\t/**\r\n\t * The order line item product group URL\r\n\t */\r\n\tgroupUrl: string;\r\n\r\n\t/**\r\n\t * The list of selectable attributes and their values for this line item\r\n\t */\r\n\tselections?: ProductSelection[];\r\n\r\n\t/**\r\n\t * The order line item related product entity\r\n\t */\r\n\tproduct: OrderItemProduct;\r\n\r\n\t/**\r\n\t * The product unit of measure for this line item\r\n\t */\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\t/**\r\n\t * The amount of tax applied to this line item.\r\n\t */\r\n\ttax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The total discount amount applied to this line item across all quantities.\r\n\t */\r\n\tdiscount?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The part of the order-level discount that is being spread to this line item.\r\n\t */\r\n\torderDiscount?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The displayable price of a single unit of this line item.\r\n\t */\r\n\tunitPrice?: SimpleDisplayPrice;\r\n\r\n\t/**\r\n\t * The displayable total price of this line item.\r\n\t */\r\n\ttotalPrice?: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\t/**\r\n\t * The status of the line item\r\n\t */\r\n\tstatus?: OrderStatus;\r\n\r\n\t/**\r\n\t * The list cart item attached add ons.\r\n\t */\r\n\taddOns?: CartProductAddOnDto[];\r\n\r\n\t/**\r\n\t * The addon order item data needed for displaying.\r\n\t */\r\n\torderItemAddOns?: OrderItemAddOn[];\r\n\r\n\t// #region HCL\r\n\t/**\r\n\t * The line item's quantity ordered\r\n\t */\r\n\tquantityShipped?: number;\r\n\tquantityOrdered?: number;\r\n\tquantityOnBackorder?: number;\r\n\t// #endregion\r\n}\r\n\r\nexport interface CartProductAddOnDto extends ProductAddOnDto {\r\n\ttotalPrice?: SimpleDisplayPrice;\r\n}\r\n\r\n/**\r\n * Represents a product related to the order line item\r\n */\r\nexport interface OrderItemProduct {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The main image thumbnail url\r\n\t */\r\n\tthumbnailUrl: string | null;\r\n\r\n\t/**\r\n\t * The related brand name\r\n\t */\r\n\tbrandName: string | null;\r\n\r\n\t/**\r\n\t * The alt text for thumbnail\r\n\t */\r\n\taltText?: string;\r\n\r\n\t/**\r\n\t * Status of the Product\r\n\t */\r\n\tstatus?: ModelStatus;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string;\r\n\r\n\t// #region HCL\r\n\tsku?: string;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Represents a single recipient on an order\r\n */\r\nexport interface OrderRecipient extends Address {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The order line items\r\n\t */\r\n\titems: OrderItem[];\r\n\t/**\r\n\t * The available shipping options for this recipient\r\n\t */\r\n\tshippingOptions: ShippingOption[];\r\n\t/**\r\n\t * The shipping service selected for this recipient\r\n\t */\r\n\tshippingMethodId: string | null;\r\n\t/**\r\n\t * The shipping service name selected for this recipient\r\n\t */\r\n\tshippingMethod: ShippingMethod;\r\n\t/**\r\n\t * The addressId of the selected address from the address book (if any)\r\n\t */\r\n\taddressId: string | null;\r\n\t/**\r\n\t * The order recepient's Recipient Name, used for organization orders\r\n\t */\r\n\trecipientName?: string;\r\n\r\n\t//#region HCL\r\n\t/**\r\n\t * The shipping account selected for this recipient\r\n\t */\r\n\tshippingAccountId: string | null;\r\n\tisCollectShippingMethod: boolean | null;\r\n\t//#endregion\r\n}\r\n\r\n/**\r\n * Represents totals on an order\r\n */\r\nexport interface OrderTotals {\r\n\t/**\r\n\t * The merchandise subtotal for the order, without consideration of discounts, tax, or shipping\r\n\t */\r\n\tbaseSubtotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total discount amount applied to the order line items. Some discounts are applied at the order level\r\n\t */\r\n\tlineDiscount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The baseSubtotal amount less the lineDiscount amount\r\n\t */\r\n\tsubtotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients Discount\r\n\t */\r\n\tdiscount: (SimpleDisplayPrice & HasNoSalePrice) | MissingDisplayPrice;\r\n\t/**\r\n\t * The sum of the recipients shipping discount amounts\r\n\t */\r\n\tshippingDiscount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients shipping amounts\r\n\t */\r\n\tshipping?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients tax amounts\r\n\t */\r\n\ttax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients line tax amounts\r\n\t */\r\n\tlineTax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The sum of the recipients shipping tax amounts\r\n\t */\r\n\tshippingTax?: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total shipping charges determined by subtracting the shipping discount shipping amount then adding the shipping tax\r\n\t */\r\n\tshippingTotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total order charges, which is the sum of the subtotal, the shipping reduced by the shipping discount, and the tax\r\n\t */\r\n\ttotal: SimpleDisplayPrice & HasNoSalePrice;\r\n\t/**\r\n\t * The total order charges after gift cards are applied\r\n\t */\r\n\tmodifiedOrderTotal: SimpleDisplayPrice & HasNoSalePrice;\r\n}\r\n\r\n/**\r\n * Represents a single customer order or shopping cart\r\n */\r\nexport interface Order extends OrderTotals, Address {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The ID of the organizationShipTo associated with this order.\r\n\t * Null when the order is not created by a user in an organization, or there are no ship-tos available for the user\r\n\t */\r\n\torganizationShipToId: string | null;\r\n\t/**\r\n\t * The shopping cart or completed order recipients\r\n\t */\r\n\trecipients: OrderRecipient[];\r\n\t/**\r\n\t * The shopping cart or completed order unique cart code\r\n\t */\r\n\torderCode: string;\r\n\t/**\r\n\t * The email associated to the order.\r\n\t */\r\n\temail: string;\r\n\t/**\r\n\t * If the billing address is the same as the shipping address of a recipient,\r\n\t * this field will contain the ID of that recipient.\r\n\t */\r\n\tsameAsRecipientId: string | null;\r\n\r\n\t/**\r\n\t * The shopping cart or completed order promtions\r\n\t */\r\n\tpromotions: OrderPromotion[];\r\n\r\n\t/**\r\n\t * The unique order number of the completed order\r\n\t */\r\n\torderNo: string | null;\r\n\r\n\t/**\r\n\t * The date and time that the order was successfully placed. If null, this is still a pending shopping cart.\r\n\t */\r\n\tprocessDate: Date | null;\r\n\r\n\t/**\r\n\t * Modify date\r\n\t */\r\n\tmodifyDate: Date;\r\n\r\n\t/**\r\n\t * The current order status\r\n\t */\r\n\torderStatus: OrderStatus;\r\n\r\n\t/**\r\n\t * The localized order date string, used for display purposes\r\n\t */\r\n\tlocalizedOrderDate: string;\r\n\r\n\t/**\r\n\t * The authorization or sale payment for the current order\r\n\t */\r\n\tpaymentLogs: PaymentLog[];\r\n\r\n\t/**\r\n\t * The gift cards saved on the order.\r\n\t */\r\n\tpaymentMethods: PaymentMethod[];\r\n\r\n\t/**\r\n\t * If the order is locked\r\n\t */\r\n\tisLocked: boolean;\r\n\r\n\t/**\r\n\t * The list of notes associated to the order.\r\n\t */\r\n\tnotes: OrderNote[];\r\n\r\n\t/**\r\n\t * The 3-character ISO 4217 code representing currency of the order\r\n\t */\r\n\tsnapshotCurrencyISO: string;\r\n\r\n\t/**\r\n\t * The purchase order number\r\n\t */\r\n\tpurchaseOrderNumber: string;\r\n\r\n\t/**\r\n\t * Count of all the items in the order\r\n\t */\r\n\ttotalItemsCount: number;\r\n\r\n\t/**\r\n\t * The user specified name of saved cart.\r\n\t * Undefined if the user has not named the cart.\r\n\t */\r\n\tname?: string;\r\n\r\n\t// #region HCL\r\n\texportStatus?: ExportStatus;\r\n\ttrackingLink?: string;\r\n\ttrackingNo?: string;\r\n\tpaymentTypes: PaymentTypeEnum[];\r\n\tisP21Order: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Represents a single order note on an order\r\n */\r\nexport interface OrderNote {\r\n\t// #region HCL - nullable values\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string | null;\r\n\r\n\t/**\r\n\t * The user who created the note.\r\n\t */\r\n\tcreateUser: string | null;\r\n\t// #endregion\r\n\r\n\t/**\r\n\t * The localized date note was created used for display purpose.\r\n\t */\r\n\tcreateDate: string | null;\r\n\r\n\t/**\r\n\t * Indicates the type of note.\r\n\t */\r\n\tnoteType: string;\r\n\r\n\t/**\r\n\t * The note entered in the admin.\r\n\t */\r\n\tnote: string;\r\n}\r\n\r\n/**\r\n * Represents a single promotion on an order\r\n */\r\nexport interface OrderPromotion {\r\n\t/**\r\n\t * The primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The identifier for the promotion (Guid)\r\n\t */\r\n\tpromotionId: string;\r\n\r\n\t/**\r\n\t * The coupon code associated with this cart or order promotion\r\n\t */\r\n\tcouponCode: string;\r\n}\r\n\r\n/**\r\n * Represents a list of user saved products\r\n */\r\nexport interface GetSavedProductsResult extends PaginatedResult {}\r\n\r\n/**\r\n * Represents what an item's last action was in the cart\r\n */\r\nexport enum MoveStatus {\r\n\tMovedToCart,\r\n\tMovedToSaved,\r\n\tRemovedFromSaved,\r\n\tRemovedFromCart,\r\n}\r\n\r\n/**\r\n * Represents a single user saved product\r\n * Contains only the information needed to display a product's basic information and move it to the cart\r\n */\r\nexport interface SavedProduct {\r\n\t/**\r\n\t * The UserSavedProduct primary key (Guid)\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The ID of the product represented by this SavedProduct\r\n\t */\r\n\tproductId: string;\r\n\r\n\tsku: string;\r\n\r\n\tname: string;\r\n\r\n\turl: string;\r\n\r\n\tgroupUrl: string;\r\n\r\n\tunitPrice: SimpleDisplayPrice;\r\n\r\n\ttotalPrice: SimpleDisplayPrice & HasNoSalePrice;\r\n\r\n\tselections?: SimpleSelectionDto[];\r\n\r\n\tisVirtual: boolean;\r\n\r\n\tthumbnailUrl: string | null;\r\n\r\n\tbrandName: string | null;\r\n\r\n\t/**\r\n\t * The pricing line for this line item\r\n\t */\r\n\tpricingLine: ProductPricingLine;\r\n\r\n\tsnapshotPricingLineId: string;\r\n\r\n\tsnapshotUnitOfMeasureId: string;\r\n\r\n\tquantity: number;\r\n\r\n\taltText?: string;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string;\r\n\r\n\t/**\r\n\t * Information about add-ons for this saved product, if it has any\r\n\t */\r\n\taddOns?: ProductAddOnDto[];\r\n}\r\n\r\nexport interface AddToCartProps {\r\n\t/**\r\n\t * The product id to add to cart.\r\n\t */\r\n\titemId: string;\r\n\r\n\t/**\r\n\t * The quantity to be added\r\n\t */\r\n\tquantity: number | null;\r\n\r\n\t/**\r\n\t * The selected pricing line\r\n\t */\r\n\tproductPricingLineId: string | null;\r\n\r\n\t/**\r\n\t * The product add ons selected\r\n\t */\r\n\taddOns?: ProductAddOnDto[];\r\n\r\n\t/**\r\n\t * Defines if we need to validate the product add ons before adding to cart\r\n\t */\r\n\tvalidateAddOns?: boolean;\r\n}\r\n\r\nexport interface AddAllToCartProps {\r\n\tshoppingListId: string;\r\n\r\n\t/**\r\n\t * List of selected products ids to be added to cart\r\n\t */\r\n\tselectedShoppingListProductIds: string[];\r\n}\r\n\r\n/**\r\n * The request used for bulk add to cart\r\n */\r\nexport interface BulkAddToCartProps {\r\n\titems: AddToCartProps[];\r\n}\r\n\r\n/**\r\n * Order status enum\r\n */\r\nexport enum OrderStatus {\r\n\tNew = 'New',\r\n\tSaved = 'Saved',\r\n\tDiscarded = 'Discarded',\r\n\tOrdered = 'Ordered',\r\n\tShipped = 'Shipped',\r\n\tPartiallyShipped = 'PartiallyShipped',\r\n\tCredited = 'Credited',\r\n\tCanceled = 'Canceled',\r\n\tPartiallyCanceled = 'PartiallyCanceled',\r\n\tReturned = 'Returned',\r\n\tCompleted = 'Completed',\r\n}\r\n\r\n/**\r\n * Payment Log DTO\r\n */\r\nexport type PaymentLog =\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.CreditCard;\r\n\t\t\tlast4: string;\r\n\t\t\tcreditCardType: CreditCardType | null;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t }\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.GiftCard;\r\n\t\t\tgiftCardNumber: string;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t }\r\n\t| {\r\n\t\t\tpaymentType: PaymentTypeEnum.CorporateAccount;\r\n\t\t\tamount: SimpleDisplayPrice & HasNoSalePrice;\r\n\t };\r\n\r\nexport enum PaymentTypeEnum {\r\n\tCreditCard = 'CreditCard',\r\n\tGiftCard = 'GiftCard',\r\n\t//TODO(Paradigm): do we comment these out? Also check why 'GiftCard' wasn't here already?\r\n\t// Not implemented yet:\r\n\tApplePay = 'ApplePay',\r\n\tGooglePay = 'GooglePay',\r\n\tPayPal = 'PayPal',\r\n\tPurchaseOrder = 'PurchaseOrder',\r\n\tCorporateAccount = 'CorporateAccount',\r\n}\r\n\r\n/**\r\n * Credit card type enum\r\n */\r\nexport enum CreditCardType {\r\n\tAMERICAN_EXPRESS = 'AMERICAN_EXPRESS',\r\n\tVISA = 'VISA',\r\n\tMASTERCARD = 'MASTERCARD',\r\n\tDISCOVER = 'DISCOVER',\r\n\tOTHER = 'OTHER',\r\n}\r\n\r\nexport interface PaymentMethod extends BasicDto {\r\n\tchargeAmount: SimpleDisplayPrice & HasNoSalePrice;\r\n\tbalanceAmount: SimpleDisplayPrice & HasNoSalePrice;\r\n\tpaymentType: PaymentTypeEnum;\r\n\tcardNumber: string;\r\n}\r\n\r\nexport interface AddToCartEvent {\r\n\t/**\r\n\t * The id of the product\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The name of the product\r\n\t */\r\n\tname: string;\r\n\t/**\r\n\t * The product SKU\r\n\t */\r\n\tsku: string;\r\n\t/**\r\n\t * The price of a product\r\n\t */\r\n\tprice: number;\r\n\t/**\r\n\t * The quantity of a product that actually got added to the cart\r\n\t */\r\n\tadjustedQuantity: number;\r\n\t/**\r\n\t * The 3-character ISO 4217 code representing currency of the item\r\n\t */\r\n\tcurrency: string;\r\n\r\n\t/**\r\n\t * The associated group product Id of a simple product, if applicable.\r\n\t */\r\n\tproductGroupId: string | null;\r\n\r\n\t/**\r\n\t * The list of selectable attributes and their values for the product that was added to cart\r\n\t */\r\n\tselections: ProductSelection[] | null;\r\n}\r\n\r\n/**\r\n * Represents the saved shopping cart\r\n */\r\nexport interface SavedCart {\r\n\torderId: string;\r\n\tname: string;\r\n\torderCode: string;\r\n\titemCount: number;\r\n\tlastModifiedDate: string;\r\n}\r\n\r\n// #region HCL\r\nexport enum ExportStatus {\r\n\tQueued = 'Queued',\r\n\tProcessing = 'Processing',\r\n\tSuccess = 'Success',\r\n\tFailed = 'Failed',\r\n}\r\n// #endregion\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse, BulkAddToCartResponse } from 'services/UserData.Commerce';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport OrderMessages from '../shopping-cart/OrderMessages';\r\n\r\ninterface AddedToCartAlertProps {\r\n\tresponse: BulkAddToCartResponse;\r\n}\r\n\r\n/**\r\n * Displays confirmation when adding multiple items to cart\r\n */\r\nexport default function MultipleItemsAddedToCartAlert(props: AddedToCartAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t{response.processedItems &&\r\n\t\t\t\tresponse.processedItems.map((responseItem, index) => {\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t})}\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('InCart')} {response.cartSummary?.items}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{Localizer('Subtotal')}:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t (window.location.href = '/cart')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn-secondary roc-btn-secondary--big roc-btn-secondary--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"view-cart-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ViewCart')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t (window.location.href = '/checkout')}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"checkout-modal-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Localizer('CheckoutNow')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\ninterface addedToCartLineItemProps {\r\n\titem: AddToCartResponse;\r\n\trowIndex?: number;\r\n}\r\n\r\n/**\r\n * Displays a single line item on the alert when adding multiple items to cart\r\n */\r\nfunction AddedToCartLineItem(props: addedToCartLineItemProps) {\r\n\tconst { item, rowIndex } = props;\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{item.imageUrl ? (\r\n\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t

\r\n\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t

\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.selections !== null &&\r\n\t\t\t\t\t\t\t\titem.selections.length > 0 &&\r\n\t\t\t\t\t\t\t\titem.selections.map((selection) => (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t))}\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t{selection.name}:\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{selection.label}\r\n\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{Localizer('Qty')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{item.adjustedQuantity}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\n/**\r\n * Reusable component for the optional field marker\r\n */\r\nfunction OptionalFieldMarker() {\r\n\treturn ({Localizer('Optional')});\r\n}\r\n\r\nexport default React.memo(OptionalFieldMarker);\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames\r\n/* eslint-disable no-var */\r\n(function () {\r\n\tif (Element.prototype.getAttributeNames == undefined) {\r\n\t\tElement.prototype.getAttributeNames = function () {\r\n\t\t\tvar attributes = this.attributes;\r\n\t\t\tvar length = attributes.length;\r\n\t\t\tvar result = new Array(length);\r\n\t\t\tfor (var i = 0; i < length; i++) {\r\n\t\t\t\tresult[i] = attributes[i].name;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n})();\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { toCamelCase } from 'util/StringUtil';\r\nimport 'shared/polyfills/getAttributeNames';\r\nimport Spinner from 'shared/components/Spinner';\r\n\r\ninterface AttributeProps {\r\n\t[index: string]: string;\r\n}\r\n\r\nfunction getDataPropsFromAttributes(element: Element): AttributeProps {\r\n\tconst props: AttributeProps = {};\r\n\r\n\tconst dataAttributePrefix = 'data-';\r\n\r\n\tconst attributeNames = element.getAttributeNames().filter((s) => s.startsWith(dataAttributePrefix));\r\n\tfor (const attributeName of attributeNames) {\r\n\t\tconst strippedName = toCamelCase(attributeName.substring(dataAttributePrefix.length));\r\n\t\tprops[strippedName] = element.getAttribute(attributeName) ?? '';\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\n/**\r\n * A helper function to facilitate initializing react applications on top of server-side rendered elements.\r\n * @param getReactElement Function that returns the react component to render.\r\n * @param elementId The ID of the DOM element being targeted.\r\n */\r\nexport const initReactApp = (getReactElement: (props: unknown) => React.ReactElement, elementId: string) => {\r\n\tif (typeof getReactElement !== 'function' || !elementId) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst element = document.getElementById(elementId);\r\n\r\n\tif (!element) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Element with ID '${elementId}' was not found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render(\r\n\t\t\t}>\r\n\t\t\t\t{getReactElement(props)}\r\n\t\t\t,\r\n\t\t\telement,\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const initReactAppByAttribute = (\r\n\tgetReactElement: (props: unknown, domElement: Element) => React.ReactElement,\r\n\tattribute: string,\r\n) => {\r\n\tif (typeof getReactElement !== 'function' || !attribute) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst elements = document.querySelectorAll(`[${attribute}]`);\r\n\r\n\tif (!elements || elements.length == 0) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`No elements with data attribute '${attribute}' were found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tfor (let i = 0; i < elements.length; ++i) {\r\n\t\t\tconst element = elements[i];\r\n\t\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\t\tconsole.debug(`Rendering application inside element with attribute ${attribute}.`);\r\n\t\t\tReactDOM.render(\r\n\t\t\t\t}>\r\n\t\t\t\t\t{getReactElement(props, element)}\r\n\t\t\t\t,\r\n\t\t\t\telement,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n};\r\n","/**\r\n * Returns visitor expiry date for hawksearch visitor id stored in the cookie for the user.\r\n */\r\nexport function getVisitorExpiry() {\r\n\tconst d = new Date();\r\n\t// 1 year\r\n\td.setTime(d.getTime() + 360 * 24 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Returns visitor expiry date for hawksearch visit id stored in the cookie for the user.\r\n */\r\nexport function getVisitExpiry() {\r\n\tconst d = new Date();\r\n\t// 4 hours\r\n\td.setTime(d.getTime() + 4 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Creates GUID.\r\n */\r\nexport function createGuid() {\r\n\tconst s: string[] = [];\r\n\tconst hexDigits = '0123456789abcdef';\r\n\tfor (let i = 0; i < 36; i++) {\r\n\t\ts[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n\t}\r\n\ts[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010\r\n\ts[19] = hexDigits.substr(((s[19] as any) & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n\ts[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n\treturn s.join('');\r\n}\r\n\r\n/**\r\n * Returns the cookie.\r\n */\r\nexport function getCookie(name) {\r\n\tconst nameEQ = name + '=';\r\n\tconst ca = document.cookie.split(';');\r\n\r\n\tfor (let i = 0; i < ca.length; i++) {\r\n\t\tlet cookie = ca[i];\r\n\r\n\t\twhile (cookie.charAt(0) == ' ') {\r\n\t\t\tcookie = cookie.substring(1, cookie.length);\r\n\t\t}\r\n\r\n\t\tif (cookie.indexOf(nameEQ) == 0) {\r\n\t\t\treturn cookie.substring(nameEQ.length, cookie.length);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Sets the cookie.\r\n */\r\nexport function setCookie(name: string, value: string, expiry?: string) {\r\n\tlet expires = '';\r\n\r\n\tif (expiry) {\r\n\t\texpires = '; expires=' + expiry;\r\n\t}\r\n\r\n\tdocument.cookie = name + '=' + value + expires + '; path=/';\r\n}\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\n\r\ntype ValidationMessagesProps = Pick, 'meta'> & {\r\n\tid: string;\r\n};\r\n\r\nfunction getErrorArray(errorOrSubmitError) {\r\n\tlet errors: string[] = [];\r\n\tif (typeof errorOrSubmitError === 'string') {\r\n\t\terrors.push(errorOrSubmitError);\r\n\t} else if (Array.isArray(errorOrSubmitError)) {\r\n\t\terrors = errorOrSubmitError.filter((error) => !Array.isArray(error) && typeof error === 'string');\r\n\t}\r\n\r\n\treturn errors;\r\n}\r\n\r\n/**\r\n * Displays validation errors for fields\r\n *\r\n * @class ValidationMessages\r\n * @extends {React.Component}\r\n */\r\nfunction ValidationMessages(props: ValidationMessagesProps) {\r\n\tconst { meta } = props;\r\n\r\n\tif (!meta) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet errors: string[] = [];\r\n\r\n\t/* \r\n\t almost all validation comes from the server, so we only need to check `submitError` despite there being `error`\r\n\t there are 3 kinds of values for submitError, string, string[] and [string|[]|object]\r\n\t the third type happens when you're using FieldArray, so we're going to filter those out and only\r\n\t take the strings if submitError is an array. this is due to a bug (possibly feature?) of final form\r\n\t where the submit errors for field array fields bubble up into the parent field.\r\n\t */\r\n\tif (meta.submitError) {\r\n\t\terrors = errors.concat(getErrorArray(meta.submitError));\r\n\r\n\t\t// for server-side validation, we need to stop showing these after any changes are made.\r\n\t\tif (meta.dirtySinceLastSubmit || meta.submitting) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (meta.error) {\r\n\t\t// sometimes we validate on the client, so we need to support these as well.\r\n\t\terrors = errors.concat(getErrorArray(meta.error));\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{(meta.submitError || meta.error) &&\r\n\t\t\t\tmeta.touched &&\r\n\t\t\t\terrors.length > 0 &&\r\n\t\t\t\terrors.map((error, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{error}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t))}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default ValidationMessages;\r\n","/**\r\n * THIS HAS A COPY ON ROC.WEB. DO NOT MAKE CHANGES HERE WITHOUT ALSO MAKING THEM IN THE OTHER FILE.\r\n *\r\n * THIS MUST ALSO BE KEPT IN SYNC WITH THE \"RazorDisplayPrice\" VIEW COMPONENT.\r\n *\r\n * DIVERGENCES:\r\n * - The style \"visually-hidden\" DOES NOT EXIST ON ROC.WEB. Change this to \"roc-visually-hidden\"\r\n */\r\n\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { CssClasses, ProductPricingProps } from 'shared-client/types/commerce/product-details';\r\nimport {\r\n\tAmbiguousDisplayPrice,\r\n\tMissingDisplayPrice,\r\n\tPartialDisplayPrice,\r\n\tPrice,\r\n\tPriceDisplayRule,\r\n\tPriceSpan,\r\n\tSimpleDisplayPrice,\r\n} from 'shared-client/types/commerce/display-price';\r\n\r\nimport { PricingResourceKeys } from 'features/commerce/pricing/resources';\r\n\r\nconst GetCssClasses = (className: string | undefined, inline: boolean) => {\r\n\tconst priceClass = ['roc-pricing__price', className ? className + '__price' : null];\r\n\r\n\treturn {\r\n\t\tbase: ['roc-pricing', { 'roc-pricing--inline': inline }, className ? className : null],\r\n\t\tnormalPrice: ['roc-pricing__price', className ? className + '__price' : null],\r\n\t\tcrossedOutPrice: [\r\n\t\t\tpriceClass,\r\n\t\t\t'roc-pricing__price--original',\r\n\t\t\tclassName ? className + '__price--original' : null,\r\n\t\t],\r\n\t\thighlightedPrice: [priceClass, 'roc-pricing__price--sale', className ? className + '__price--sale' : null],\r\n\t};\r\n};\r\n\r\n/**\r\n * Renders a product price. This could be a simple price \"$4.99\", a price that's on sale \"~~$4.99~~ $3.99\",\r\n * a range of prices, an ambiguous price or potentially others.\r\n *\r\n * The pricing information is expected to have come from the server where it has already been validated.\r\n * It is the responsibility of the caller to verify pricing objects passed to ProductPricing are valid.\r\n */\r\nexport default function ProductPricing(props: ProductPricingProps) {\r\n\t// #region HCL\r\n\tconst { displayPrice, className, inline = false, testId = 'product-price', roundValue } = props;\r\n\t// #endregion\r\n\r\n\t// The server/caller is trusted to have provided valid props.\r\n\t// Do no validation here.\r\n\r\n\tif (displayPrice == null) {\r\n\t\t// Missing price. Remove this if MissingPrice functionality is ever needed beyond \"don't render\"\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst css = GetCssClasses(className, inline);\r\n\r\n\tlet renderResult: JSX.Element | null;\r\n\tswitch (displayPrice.displayRule) {\r\n\t\tcase PriceDisplayRule.Missing:\r\n\t\t\trenderResult = renderMissingPrice(css, displayPrice);\r\n\t\t\tbreak;\r\n\r\n\t\tcase PriceDisplayRule.Normal:\r\n\t\t\trenderResult = renderNormalPrice(css, displayPrice, testId);\r\n\t\t\tbreak;\r\n\r\n\t\tcase PriceDisplayRule.AmbiguousRange:\r\n\t\t\t// #region HCL\r\n\t\t\trenderResult = renderAmbiguousPrice(css, displayPrice, testId, roundValue);\r\n\t\t\t// #endregion\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tthrow new Error('Erroneous price display rule');\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{renderResult}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders a missing price, eg nothing. This currently renders nothing but could be updated to render \"Not For Sale\" for example.\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\n// eslint-disable-next-line no-unused-vars\r\nfunction renderMissingPrice(css: CssClasses, price: MissingDisplayPrice) {\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Renders a normal price. This is a price that might be on sale and may either be a unit price (eg $4.99) or a\r\n * range (eg $3.99 - $7.99).\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\nfunction renderNormalPrice(css: CssClasses, price: SimpleDisplayPrice, testId: string) {\r\n\t// conditionally cross out the base price\r\n\tconst basePriceClass = price.salePrice != null ? css.crossedOutPrice : css.normalPrice;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{Localizer('OriginalPrice')}\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{price.salePrice != null ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{Localizer('SalePrice')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders an ambiguous price. This is a compound price representing multiple different products where the upperbound of the price\r\n * can't be reported in a useful way. The units of measure between the base and sale price may be different.\r\n * @param css The set of css rules that can be applied.\r\n * @param price The price object\r\n */\r\n// #region HCL\r\nfunction renderAmbiguousPrice(css: CssClasses, price: AmbiguousDisplayPrice, testId: string, roundValue?: boolean) {\r\n\t// #endregion\r\n\t// conditionally cross out the base price\r\n\tconst basePriceClass = price.salePrice != null ? css.crossedOutPrice : css.normalPrice;\r\n\t// #region HCL\r\n\tconst roundedPrice = roundValue ? price.basePrice.rawValue.toFixed(2) : price.basePrice.value;\r\n\t// #endregion\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{Localizer('OriginalPrice')}\r\n\t\t\t\t\r\n\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\t\r\n\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{price.salePrice != null ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{Localizer('SalePrice')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\n/**\r\n * Renders a partial display price (eg it may be either a simple price or a range price)\r\n */\r\nfunction VariantPriceComponent({ price }: { price: PartialDisplayPrice }) {\r\n\tconst label = price.unit?.label;\r\n\r\n\tswitch (typeof price.value) {\r\n\t\tcase 'string':\r\n\t\t\treturn ;\r\n\r\n\t\tcase 'object':\r\n\t\t\treturn ;\r\n\t}\r\n}\r\n\r\nfunction FormatAmbiguousPriceSpan(props: { price: Price; unitName: string }) {\r\n\t// Ambiguous prices always have a unit of measure. It is never optional.\r\n\treturn <>{Localizer('AmbiguousPriceRangeWithUnit', props.price, props.unitName)};\r\n}\r\n\r\n/**\r\n * Renders a price range (eg $14.99 - $19.99) with an optional unit of measure\r\n */\r\nfunction FormatPriceSpan(props: { priceRange: PriceSpan; unitName: string | undefined }) {\r\n\treturn props.unitName != null ? (\r\n\t\t<>\r\n\t\t\t{Localizer(\r\n\t\t\t\t'PriceRangeWithUnit',\r\n\t\t\t\tprops.priceRange.from,\r\n\t\t\t\tprops.priceRange.to,\r\n\t\t\t\tprops.unitName,\r\n\t\t\t)}\r\n\t\t\r\n\t) : (\r\n\t\t<>{Localizer('PriceRangeWithoutUnit', props.priceRange.from, props.priceRange.to)}\r\n\t);\r\n}\r\n\r\n/** Formats the price with the unit of measure (if present) appended. */\r\nfunction FormatPrice(props: { price: Price; unitName?: string }) {\r\n\treturn props.unitName != null ? (\r\n\t\t<>{Localizer('PriceWithUnit', props.price, props.unitName)}\r\n\t) : (\r\n\t\t<>{Localizer('PriceWithoutUnit', props.price)}\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { RouteProps } from 'react-router';\r\n\r\n//#region URLs\r\nexport const MY_ACCOUNT_PATH_PREFIX = '/my-account';\r\nexport const MY_ACCOUNT_PERSONAL_DATA_URL = `${MY_ACCOUNT_PATH_PREFIX}/personal-data`;\r\nexport const MY_ACCOUNT_AUTHENTICATOR_URL = `${MY_ACCOUNT_PATH_PREFIX}/settings/authenticator`;\r\nexport const MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL = `${MY_ACCOUNT_AUTHENTICATOR_URL}/generate-recovery-codes`;\r\nexport const MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL = `${MY_ACCOUNT_AUTHENTICATOR_URL}/configure`;\r\nexport const MY_ACCOUNT_LOGIN_URL = `${MY_ACCOUNT_PATH_PREFIX}/login`;\r\nexport const MY_ACCOUNT_LOGOUT_URL = `${MY_ACCOUNT_PATH_PREFIX}/logout`;\r\nexport const MY_ACCOUNT_WALLET_URL = `${MY_ACCOUNT_PATH_PREFIX}/wallet`;\r\nexport const MY_ACCOUNT_WALLET_CREATE_URL = `${MY_ACCOUNT_WALLET_URL}/create`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_URL = `${MY_ACCOUNT_PATH_PREFIX}/address-book`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL = `${MY_ACCOUNT_ADDRESS_BOOK_URL}/create`;\r\nexport const MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL = `${MY_ACCOUNT_ADDRESS_BOOK_URL}/edit`;\r\n//#region Commerce\r\nexport const MY_ACCOUNT_SETTINGS_URL = `${MY_ACCOUNT_PATH_PREFIX}/settings`;\r\n//#endregion Commerce\r\n//#endregion URLs\r\n\r\n//#region Components\r\n// #region HCL\r\n// const SettingsComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-settings\" */ './settings/Settings'));\r\n// #region\r\n\r\nconst GenerateRecoveryCodesComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-generate-recovery-codes\" */ './generate-recovery-codes/GenerateRecoveryCodesContainer'\r\n\t\t),\r\n);\r\nconst ConfigureAuthenticatorComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-configure-authenticator\" */ './configure-authenticator/ConfigureAuthenticator'\r\n\t\t),\r\n);\r\n\r\nconst WalletComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-wallet\" */ './wallet/Wallet'));\r\nconst WalletEditComponent = React.lazy(() => import(/* webpackChunkName: \"my-account-wallet\" */ './wallet/WalletEdit'));\r\n\r\n//#endregion Components\r\n\r\n//#region Routes\r\nconst generateRecoverCodesRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_GENERATE_RECOVERY_CODES_URL,\r\n\tcomponent: GenerateRecoveryCodesComponent,\r\n};\r\n\r\nconst configureAuthenticatorRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_CONFIGURE_AUTHENTICATOR_URL,\r\n\tcomponent: ConfigureAuthenticatorComponent,\r\n};\r\n\r\nconst walletRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_WALLET_URL,\r\n\tcomponent: WalletComponent,\r\n};\r\n\r\nconst walletCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_WALLET_CREATE_URL,\r\n\tcomponent: WalletEditComponent,\r\n};\r\n\r\n//#region Commerce\r\n// Note: in Framework we want MY_ACCOUNT_PATH_PREFIX to point to SettingsComponent,\r\n// but in Commerce we want it to point to AccountOverviewComponent\r\n//#region HCL\r\n// const settingsRoute = {\r\n// \texact: true,\r\n// \tpath: MY_ACCOUNT_SETTINGS_URL,\r\n// \tcomponent: SettingsComponent,\r\n// };\r\n//#endregion Commerce\r\n//#endregion Routes\r\n\r\nexport const rocRoutes: RouteProps[] = [\r\n\tgenerateRecoverCodesRoute,\r\n\tconfigureAuthenticatorRoute,\r\n\twalletRoute,\r\n\twalletCreateRoute,\r\n];\r\n//#endregion HCL\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Check circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CheckCircleSVG;\r\n","import { AxiosError } from 'axios';\r\nimport { FORM_ERROR } from 'final-form';\r\nimport { unflatten } from 'flat';\r\n\r\nexport const getFormattedPageTitle = (subTitle: string = ''): string => {\r\n\t// load from config?\r\n\tconst siteName = 'ROC';\r\n\r\n\tif (!subTitle || !subTitle.trim()) {\r\n\t\treturn siteName;\r\n\t}\r\n\r\n\treturn `${subTitle.trim()} - ${siteName}`;\r\n};\r\n\r\n/**\r\n * Promise version of setTimeout.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const timeout = (ms) => {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n};\r\n\r\n/**\r\n * Allows you to await on a timeout, useful for avoiding setTimeout callbacks and for troubleshooting.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const sleep = async (ms: number = 0) => {\r\n\tawait timeout(ms);\r\n};\r\n\r\n/**\r\n * Handles Axios error for React Final Form. If the error is a validation error, the error is transformed into React\r\n * Final Form field validation object. If the error is a generic error, the error is rethrown instead.\r\n *\r\n * @param error - The Axios Error object to handle errors for.\r\n * @param errorMessage - The form error message to provide back to React Final Form.\r\n * @param validationErrorCallback - Optional callback that is triggered right before the validation object is returned\r\n * to Final Form, so that you can run logic that should occur during validation errors.\r\n * @param genericErrorCallback - Optional callback that is triggered right before the generic error is rethrown, so that\r\n * you can run logic that should occur during generic errors.\r\n */\r\nexport const handleAxiosErrorWithValidation = (\r\n\terror: AxiosError,\r\n\terrorMessage: string | null = 'An error occurred while saving.',\r\n\tvalidationErrorCallback?: () => void,\r\n\tgenericErrorCallback?: () => void,\r\n): { [index: string]: string } => {\r\n\tif (error?.response?.status === 400 && error.response.data) {\r\n\t\tlet globalErrors;\r\n\r\n\t\tconst errors = error.response.data;\r\n\r\n\t\tconst errorsWithModifiedArrayIndex = Object.keys(errors).reduce((acc, value) => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\t// in case we are getting back a non field specific error store it in the global errors\r\n\t\t\t\tglobalErrors = errors[value];\r\n\t\t\t} else {\r\n\t\t\t\tconst newKey = value.replace(/\\[([0-9]+)\\]/g, '.$1');\r\n\t\t\t\tacc[newKey] = errors[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tconst newValidationState = { ...unflatten(errorsWithModifiedArrayIndex) };\r\n\r\n\t\tconsole.debug('newValidationState:', newValidationState);\r\n\r\n\t\tif (validationErrorCallback) {\r\n\t\t\tvalidationErrorCallback();\r\n\t\t}\r\n\r\n\t\treturn { ...newValidationState, [FORM_ERROR]: globalErrors ? globalErrors : errorMessage };\r\n\t} else {\r\n\t\t// generic error.\r\n\t\tif (genericErrorCallback) {\r\n\t\t\tgenericErrorCallback();\r\n\t\t}\r\n\r\n\t\tif (error?.response?.data?.message) {\r\n\t\t\treturn { [FORM_ERROR]: error.response.data.message };\r\n\t\t}\r\n\r\n\t\tif (errorMessage) {\r\n\t\t\treturn { [FORM_ERROR]: errorMessage };\r\n\t\t} else {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Get an html class or ID safe string from provided string.\r\n *\r\n * @function getHtmlSafeName\r\n */\r\nexport const getHtmlSafeName = (name: string = ''): string => {\r\n\treturn name.replace(/[^a-z0-9]/g, (s) => {\r\n\t\tconst c = s.charCodeAt(0);\r\n\t\tif (c === 32) {\r\n\t\t\treturn '-';\r\n\t\t}\r\n\t\tif (c >= 65 && c <= 90) {\r\n\t\t\treturn '_' + s.toLowerCase();\r\n\t\t}\r\n\t\treturn '__' + ('000' + c.toString(16)).slice(-4);\r\n\t});\r\n};\r\n\r\n/**\r\n * Gets the specified param value from the querystring\r\n *\r\n * @param paramName the name of the query string parameter\r\n * @param decodeParam specifies if the param value should be decoded before returning it\r\n */\r\nexport const getQueryParam = (paramName: string = '', decodeParam: boolean = false): string | null => {\r\n\tconst urlParams = new URLSearchParams(window.location.search);\r\n\tconst paramValue = urlParams.get(paramName);\r\n\r\n\tif (!paramValue) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (decodeParam) {\r\n\t\treturn decodeURIComponent(paramValue);\r\n\t} else {\r\n\t\treturn paramValue;\r\n\t}\r\n};\r\n","import { RocEventType, RocEvent, ExtractEventParameters } from 'shared/events';\r\n\r\n/**\r\n * Helper function for handling ROC events from non React functions.\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @returns The callback function to remove this handler\r\n */\r\nexport default function addRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n): () => void {\r\n\tconst handler = (evt: CustomEvent): void => {\r\n\t\teventHandler(evt.detail);\r\n\t};\r\n\r\n\tdocument.addEventListener(eventType, handler);\r\n\r\n\treturn () => document.removeEventListener(eventType, handler);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star Empty SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarEmptySVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarEmptySVG;\r\n","import * as React from 'react';\r\n\r\ninterface DashCircleSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(props: DashCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DashCircleSVG;\r\n","import { PricingResult } from './pricing-result';\r\n\r\n/**\r\n * Represents a display pricing service result containing all necessary details to render a set of product prices.\r\n */\r\nexport type DisplayPricingResult = PricingResult;\r\n\r\n/**\r\n * Represents a simple price intended to be rendered.\r\n * Comparisons and arithmetic between prices is illegal besides !== and ===.\r\n * This is not suitable for transactions and attempting to use this for transactions is erroneous.\r\n */\r\nexport type Price = string;\r\n\r\n/**\r\n * Represents an inclusive range of prices. It is erroneous for a price span no length (eg the\r\n * from and to field are the same), as this should be represented by a @see Price instead.\r\n *\r\n * PriceSpan is typically used for ambiguous ranges\r\n */\r\nexport type PriceSpan = {\r\n\t/**\r\n\t * The lower bound of the price. If this is associated with a group of products, this\r\n\t * is the price of the cheapest associated product.\r\n\t */\r\n\tfrom: Price;\r\n\r\n\t/**\r\n\t * The upper bound of the price. If this is associated with a group of products, this\r\n\t * is the price of the most expensive associated product.\r\n\t */\r\n\tto: Price;\r\n};\r\n\r\n/**\r\n * Represents a displayable price of unknown type.\r\n */\r\nexport type VariantPrice = Price | PriceSpan;\r\n\r\n/**\r\n * The display rules for rendering a price on the frontend.\r\n */\r\nexport enum PriceDisplayRule {\r\n\t/**\r\n\t * Represents a lack of a price. This is typically used for a product\r\n\t * that isn't purchaseable. Distinct from free.\r\n\t *\r\n\t * If a price is missing, it is illegal to use any display price type besides @see MissingPrice\r\n\t */\r\n\tMissing = 'Missing',\r\n\r\n\t/**\r\n\t * Represents a normal price or price range. Expected price types are @see PriceSpan and @see Price\r\n\t */\r\n\tNormal = 'Normal',\r\n\r\n\t/**\r\n\t * Represents a price without a clearly defined upperbound. This can happen if multiple products in a group product\r\n\t * do not share a common unit of measure. Expected price types are @see Price\r\n\t */\r\n\tAmbiguousRange = 'AmbiguousRange',\r\n}\r\n\r\n/**\r\n * Represents a pricing object that is guaranteed to have a base price\r\n */\r\nexport interface HasBasePrice {\r\n\t/** The price of the product if it isn't on sale. */\r\n\tbasePrice: PartialDisplayPrice;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that is guaranteed to have a sale price\r\n */\r\nexport interface HasSalePrice {\r\n\t/** The sale price of the product. This is always less than the base price. */\r\n\tsalePrice: PartialDisplayPrice;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that has no base price, that is, it cannot be purchased.\r\n */\r\nexport interface HasNoBasePrice {\r\n\t/** The item in question has no base price and as such, it is illegal to access it. */\r\n\tbasePrice?: never;\r\n}\r\n\r\n/**\r\n * Represents a pricing object that has no sale price\r\n */\r\nexport interface HasNoSalePrice {\r\n\t/** The item in question has no sale price and as such, it is illegal to access it. */\r\n\tsalePrice?: never;\r\n}\r\n\r\n/**\r\n * Represents a \"primitive\" price object that would be displayed.\r\n * A product that has a base price and a sale price would have two unit display prices for example.\r\n */\r\nexport type PartialDisplayPrice = TPrice extends Price\r\n\t? UnitPrice & HasRawValue\r\n\t: UnitPrice;\r\n\r\ninterface UnitPrice {\r\n\t/** The unit of measure of the item/product being sold. This is typically appended to a price to yield a value like \"$2.99/ea\" */\r\n\tunit?: { label: string };\r\n\r\n\t/** The price value to be displayed. */\r\n\tvalue: TPrice;\r\n\r\n\t// #region HCL - added availability to pass rawValue\r\n\trawValue?: number;\r\n\t// #endregion\r\n}\r\n\r\ninterface HasRawValue {\r\n\t/**\r\n\t * The raw price value for use in comparing prices to eachother or checking if they are zero or negative.\r\n\t * It is not safe to assume this value for display purposes or price calculations.\r\n\t */\r\n\trawValue: number;\r\n}\r\n\r\n/**\r\n * Constrains a VariantPrice to a more specific price type\r\n */\r\ntype Filter = T extends U ? T : never;\r\n\r\n/**\r\n * Represents a price object that can be displayed.\r\n */\r\nexport type DisplayPrice<\r\n\tTBasePrice extends VariantPrice = VariantPrice,\r\n\tTSalePrice extends VariantPrice = TBasePrice\r\n> =\r\n\t| SimpleDisplayPrice\r\n\t| AmbiguousDisplayPrice, Filter>\r\n\t| MissingDisplayPrice;\r\n\r\n/**\r\n * Represents a missing price, typically if used on an object not for a sale or an erroneous object.\r\n * This would either not be rendered or be rendered as \"Not For Sale\"\r\n */\r\nexport interface MissingDisplayPrice {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * A \"missing\" or \"invisible\" price is for a product that is not on sale and thus should not have\r\n\t * a price rendered on screen */\r\n\tdisplayRule: PriceDisplayRule.Missing;\r\n}\r\n\r\n/**\r\n * Represents a simple price, that is a price that might be on sale with fixed upper and lower bounds. The unit\r\n * of measure for the base and sale price (if present) is expected to be the same\r\n */\r\nexport interface SimpleDisplayPrice<\r\n\tTBasePrice extends VariantPrice = VariantPrice,\r\n\tTSalePrice extends VariantPrice = TBasePrice\r\n> extends HasBasePrice,\r\n\t\tPartial> {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * A normal price is either a simple price like \"$3.12/ea\" or a range like \"$2.00-$5.00/ea\"\r\n\t */\r\n\tdisplayRule: PriceDisplayRule.Normal;\r\n}\r\n\r\n/**\r\n * Represents a price without a predictable upperbound for the price. This would typically be used if a group of products\r\n * didn't have a common unit of measure.\r\n */\r\nexport interface AmbiguousDisplayPrice\r\n\textends HasBasePrice,\r\n\t\tPartial> {\r\n\t/** The display rules for rendering a price on the frontend.\r\n\t *\r\n\t * An ambiguous price doesn't have a a specifiable upperbound because there isn't a common unit of measure\r\n\t * to use as a baseline for what the most expensive unit of measure is. This is will appear like \"From $2.00\"\r\n\t */\r\n\tdisplayRule: PriceDisplayRule.AmbiguousRange;\r\n}\r\n","import type { Dialog, DialogContent } from '@reach/dialog';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport 'styles/node-modules/@reach/dialog/styles.css';\r\nimport Spinner from './Spinner';\r\nimport XSVG from './svg/XSVG';\r\n\r\nconst LazyDialog = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.Dialog })),\r\n);\r\nconst LazyDialogContent = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.DialogContent })),\r\n);\r\n\r\n// TODO: the types are currently out of date so they don't include the definition for dangerouslyBypassFocusLock. Add the types here once they are updated\r\n// https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/reach__dialog\r\nconst LazyDialogOverlay = React.lazy(() =>\r\n\timport('@reach/dialog').then((module) => ({ default: module.DialogOverlay } as any)),\r\n);\r\n\r\nexport type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xlg' | 'full_width';\r\n\r\ninterface ModalProps {\r\n\tisOpen: boolean;\r\n\thideCloseButton?: boolean;\r\n\tchildren: React.ReactNode;\r\n\ttitleIcon?: React.ReactNode;\r\n\tsize?: ModalSize;\r\n\theaderDivider?: boolean;\r\n\tbypassFocusLock?: boolean;\r\n\tsubTitle?: string;\r\n\tclassName?: string;\r\n\trenderActions?: () => React.ReactNode;\r\n\tcloseModal: () => void;\r\n\trenderTitle: () => React.ReactNode;\r\n\trenderSubtitle?: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Reusuable modal component with raised open state, takes title and children as props.\r\n *\r\n * @export\r\n * @param {ModalProps} props\r\n * @returns\r\n */\r\nexport default function Modal(props: ModalProps) {\r\n\tconst {\r\n\t\tisOpen,\r\n\t\thideCloseButton,\r\n\t\tsize = 'md',\r\n\t\tcloseModal,\r\n\t\trenderTitle,\r\n\t\trenderSubtitle,\r\n\t\ttitleIcon,\r\n\t\trenderActions,\r\n\t\tchildren,\r\n\t\theaderDivider = false,\r\n\t\tbypassFocusLock = false,\r\n\t\tsubTitle,\r\n\t\tclassName,\r\n\t} = props;\r\n\r\n\tconst innerModal = (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{titleIcon && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{titleIcon}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderTitle()}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{renderSubtitle && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{renderSubtitle()}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t\t{hideCloseButton ? null : (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t closeModal()}\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"close-modal-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('Close')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\r\n\t\t\t\t{subTitle ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{subTitle}\r\n\t\t\t\t\t

\r\n\t\t\t\t) : null}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t{children}\r\n\t\t\t\r\n\t\t\t{renderActions ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{renderActions()}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n\r\n\tconst ariaLabel = Localizer('ModalLabel');\r\n\r\n\treturn bypassFocusLock ? (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\tdangerouslyBypassFocusLock={bypassFocusLock}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\t\t{innerModal}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t) : (\r\n\t\t}>\r\n\t\t\t closeModal()}\r\n\t\t\t\taria-label={ariaLabel}\r\n\t\t\t\tas={'div'}\r\n\t\t\t>\r\n\t\t\t\t{innerModal}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Pencil SVG\r\n *\r\n * @returns\r\n */\r\nfunction PencilSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PencilSVG;\r\n","import { DisplayPricingResult, Price, SimpleDisplayPrice } from 'shared-client/types/commerce/display-price';\r\nimport { UnitOfMass } from 'shared-client/types/commerce/product-details';\r\nimport { BreadcrumbItem } from 'shared/components/Breadcrumbs';\r\nimport { PartialDataLoaderOptions } from 'shared/data/usePartialDataLoader';\r\nimport { BasePartialDetailsState } from 'shared/types';\r\nimport { Asset } from 'shared/assets/types';\r\n\r\nexport function getInitialProductDetailsState(): ProductDetailsState {\r\n\treturn window.__ROC_COMMERCE_PRODUCT_DETAILS__ ?? {};\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\t__ROC_COMMERCE_PRODUCT_DETAILS__: ProductDetailsState;\r\n\t}\r\n}\r\n\r\nexport interface ProductDetailsState extends BasePartialDetailsState {\r\n\tsummary: Summary;\r\n\r\n\tassets?: ProductAsset[] | null;\r\n\r\n\tavailability?: Availability | null;\r\n\r\n\tbrand?: Brand | null;\r\n\r\n\t/**\r\n\t * Represents the visible tabs for the current product\r\n\t */\r\n\ttabs?: TabViewChunk[];\r\n\r\n\tselections?: ProductDetailSelection[];\r\n\r\n\tchildren?: SimpleProduct[];\r\n\r\n\trelatedProducts?: RelatedProduct[];\r\n\r\n\treviewsSummary: ReviewSummaryDto;\r\n\r\n\t/**\r\n\t * The available pricing lines for the product as well as the selected pricing line state\r\n\t */\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\r\n\t/**\r\n\t * The pricing result tree containing renderable prices for the product.\r\n\t */\r\n\tdisplayPricing?: DisplayPricingResult;\r\n\r\n\tbreadcrumbPath?: BreadcrumbItem[];\r\n\r\n\t/**\r\n\t * Information about the available product add ons for the product, and for child products, if this is a group\r\n\t */\r\n\taddOns?: AddOnsPdpDto;\r\n\r\n\tisNewProduct: boolean;\r\n}\r\n\r\n/**\r\n * Single add on data.\r\n */\r\nexport interface ProductAddOnDto {\r\n\t/**\r\n\t * The id of the product add on.\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The name of the product add on.\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The SKU of the product add on.\r\n\t */\r\n\tsku: string;\r\n\r\n\t/**\r\n\t * The description of the product add on.\r\n\t */\r\n\tdescription: string;\r\n\r\n\t/**\r\n\t * Represents if the current add on is required to add a product to cart.\r\n\t */\r\n\trequired: boolean;\r\n\r\n\t/**\r\n\t * Represents if the current add on is selected\r\n\t */\r\n\tselected: boolean;\r\n\r\n\t/**\r\n\t * Represents if the current add on is updated\r\n\t */\r\n\tisModified: boolean;\r\n\r\n\t/**\r\n\t * Represents the add on attributes\r\n\t */\r\n\tattributes: AddOnAttributeDto[];\r\n\r\n\t/**\r\n\t * The add on main image thumbnail.\r\n\t */\r\n\tthumbnailUrl: string;\r\n\r\n\t/**\r\n\t * The add on main image alt text.\r\n\t */\r\n\taltText: string;\r\n\r\n\t/**\r\n\t * The displayable price of a single unit of this line item.\r\n\t */\r\n\tunitPrice?: SimpleDisplayPrice;\r\n}\r\n\r\n/**\r\n * Product add on single attribute data\r\n */\r\nexport interface AddOnAttributeDto {\r\n\t/**\r\n\t * Product add on attribute id\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * Product add on attribute name\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * Represents if the add on attribute value is required\r\n\t */\r\n\trequired: boolean;\r\n\r\n\t/**\r\n\t * Product add on attribute instruction\r\n\t */\r\n\tinstructions: string;\r\n\r\n\t/**\r\n\t * Product add on attribute input type\r\n\t */\r\n\tinputAttributeType: InputAttributeType | null;\r\n\r\n\t/**\r\n\t * The maximum length constraint for the add on attribute value\r\n\t */\r\n\tmaximumLength: number | null;\r\n\r\n\t/**\r\n\t * The minimum length constraint for the add on attribute value\r\n\t */\r\n\tminimumLength: number | null;\r\n\r\n\t/**\r\n\t * The maximum number of line constraint for the add on attribute value\r\n\t * used for multiline attributes\r\n\t */\r\n\tmaximumNumberOfLines: number | null;\r\n\r\n\t/**\r\n\t * The default value of the add on attribute value\r\n\t */\r\n\tdefaultValue: string;\r\n\r\n\t/**\r\n\t * The entered value for the current attribute\r\n\t */\r\n\tdata: string;\r\n\r\n\t/**\r\n\t * The add on attribute selectable values\r\n\t */\r\n\tvalues: AttributeValueDto[];\r\n}\r\n\r\n/**\r\n * The add on attribute input type\r\n */\r\nexport enum InputAttributeType {\r\n\tSingle = 'Single',\r\n\tMultiline = 'Multiline',\r\n}\r\n\r\n/**\r\n * Single add on attribute selectable value\r\n */\r\nexport interface AttributeValueDto {\r\n\t/**\r\n\t * The add on attribute selectable value id\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The add on attribute selectable value label\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * Represents if the current selectable value is selected\r\n\t */\r\n\tselected: boolean;\r\n}\r\n\r\nexport interface Summary {\r\n\tname: string;\r\n\ttype: ProductType;\r\n\tsku?: string;\r\n\tmanufacturerPartNumber?: string;\r\n\tproductUrl: string;\r\n\tdescription?: string;\r\n\tmeta?: Meta;\r\n\tproductGroupId: string | null;\r\n\t/**\r\n\t * \tFlag defining if the current product should use the alternate product details.\r\n\t */\r\n\tuseAlternateProductDetails?: boolean;\r\n\t// #region HCL\r\n\tproductGroupName?: string;\r\n\t// #endregion\r\n}\r\n\r\nexport interface Meta {\r\n\turl: string;\r\n\tpageTitle?: string;\r\n\tmetaKeywords?: string;\r\n\tmetaDescription?: string;\r\n\tnoIndex: boolean;\r\n\tnoFollow: boolean;\r\n}\r\n\r\nexport interface Availability {\r\n\tbackOrder: boolean;\r\n\toutOfStock: boolean;\r\n\t// #region HCL\r\n\tcallForAvailability: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Product Review Summary DTO\r\n */\r\nexport interface ReviewSummaryDto {\r\n\t/**\r\n\t * The average rating of the product. If undefined, the product has no reviews with ratings.\r\n\t */\r\n\taverageRating?: number;\r\n\r\n\t/**\r\n\t * The number of public reviews for the product\r\n\t */\r\n\treviewCount: number;\r\n}\r\n\r\nexport interface ProductAsset extends Asset {\r\n\t/**\r\n\t * The alternate text associated with the image\r\n\t */\r\n\taltText: string;\r\n\t/**\r\n\t * The main image URL\r\n\t */\r\n\tmainImageUrl: string;\r\n\t/**\r\n\t * The thumbnail URL\r\n\t */\r\n\tthumbnailUrl: string;\r\n\t/**\r\n\t * The enlarged image URL\r\n\t */\r\n\tenlargedImageUrl: string;\r\n\t/**\r\n\t * The sort order for this image\r\n\t */\r\n\tsortOrder: number;\r\n\t/**\r\n\t * Embedded URL for external media asset\r\n\t */\r\n\tembeddedUrl: string;\r\n}\r\n\r\nexport interface Brand {\r\n\tname: string;\r\n\tlogoUrl: string | null;\r\n}\r\n\r\nexport interface TabViewChunk {\r\n\ttab: Tab;\r\n\tmodel: T;\r\n\trawHtml?: string;\r\n}\r\n\r\nexport interface Tab {\r\n\tid: string;\r\n\tdisplayName: string;\r\n\ttabType: string;\r\n\tsortOrder: number;\r\n\tname: string;\r\n}\r\n\r\nexport interface TabViewModel {\r\n\tviewName: string;\r\n\tmodel: T;\r\n}\r\n\r\nexport interface ProductDetailSelection {\r\n\tlabel: string;\r\n\tvalues: SelectionValue[];\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Represents a simple selection DTO object\r\n */\r\nexport interface SimpleSelectionDto {\r\n\t/**\r\n\t * The Code of the product attribute\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t * The Name of the product attribute\r\n\t */\r\n\tname: string;\r\n\r\n\t/**\r\n\t * The Id of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The Name of the attribute value\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\nexport interface SelectionValue {\r\n\tvalue: string;\r\n\tlabel: string;\r\n\tvalid: boolean;\r\n\tchecked: boolean;\r\n\t// #region HCL\r\n\tswatchUrl: string;\r\n\t// #endregion\r\n}\r\n\r\nexport interface SimpleProduct {\r\n\tid: string;\r\n\tname: string;\r\n\t//#region HCL\r\n\tsku: string;\r\n\t//#endregion\r\n\tselections: string[];\r\n}\r\n\r\nexport interface RelatedProduct {\r\n\tid: string;\r\n\tname: string;\r\n\tdescription: string | null;\r\n\turl: string;\r\n\tmainImage: ProductAsset | null;\r\n}\r\n\r\nexport interface ProductSelectionDispatcherDto {\r\n\tproductId: string;\r\n\tproductDetails: ProductDetailsState;\r\n}\r\n\r\nexport interface AddOnsPdpDto {\r\n\t/**\r\n\t * The list of available product add-ons for the product.\r\n\t */\r\n\tproductAddOnData?: ProductAddOnDto[];\r\n\t/**\r\n\t * A list of add-ons available for child products, if this is a group product\r\n\t */\r\n\tavailableChildProductAddOns?: string[];\r\n}\r\n\r\n/*\r\n\tShirt Size: Small, Large\r\n\tColor: Red, Green\r\n\r\n\tScenario #1: All selections match\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\tLarge, Green\r\n\r\n\t1. Pick Size\r\n\t2. Pick Color\r\n\t3. Find match and load child\r\n\r\n\tScenario #2: Selections mismatch\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Size (Small/Large)\r\n\t2. if Large, mark green as invalid\r\n\t3. if Small, show all colors\r\n\t4. Find match and load child\r\n\r\n\tScenario #3: Selections mismatch 2\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Size\r\n\t3. Find match and load child\r\n\r\n\tScenario #4: Selections mismatch 3\r\n\r\n\tValid selections:\r\n\tSmall, Red\r\n\tSmall, Green\r\n\tLarge, Red\r\n\r\n\t1. Pick Green, mark large as invalid\r\n\t2. Pick Large anyway, remove color selection\r\n\t3. ...\r\n\t4. Find match and load child\r\n\r\n*/\r\n\r\n/**\r\n * All available product types\r\n *\r\n * @export\r\n */\r\nexport enum ProductType {\r\n\tSimple = 'Simple',\r\n\tGroup = 'Group',\r\n\tKit = 'Kit',\r\n\tGiftCard = 'GiftCard',\r\n}\r\n\r\nexport type ProductPartialDataLoaderOptions = Pick<\r\n\tPartialDataLoaderOptions,\r\n\t'initialState' | 'dataLoaderFn'\r\n>;\r\n\r\nexport interface ProductSelection {\r\n\t/**\r\n\t * The code of the product attribute\r\n\t */\r\n\tid: string;\r\n\t/**\r\n\t * The name of the product attribute\r\n\t */\r\n\tname: string;\r\n\t/**\r\n\t * The attribute value name (if available), otherwise attribute value value\r\n\t */\r\n\tlabel: string;\r\n\t/**\r\n\t * The id (Guid) of the attribute value\r\n\t */\r\n\tvalue: string;\r\n\r\n\t/**\r\n\t * The selected attribute field name used for adding info to hawk context\r\n\t */\r\n\tfield: string;\r\n}\r\n\r\n/**\r\n * Base unit of measure\r\n */\r\nexport interface UnitOfMeasure {\r\n\tname: string;\r\n\tdisplayName: string;\r\n}\r\n\r\n/**\r\n * Represents a single pricing line for a product (one of potentially many choices for purchasing a product)\r\n */\r\nexport type ProductPricingLine = {\r\n\t/**\r\n\t * The pricing line's id\r\n\t */\r\n\tid: string;\r\n\r\n\t/**\r\n\t *\r\n\t * Unit of measure id\r\n\t */\r\n\tunitOfMeasureId: string;\r\n\r\n\t/**\r\n\t * Base Unit of measure\r\n\t */\r\n\tunitOfMeasure: UnitOfMeasure;\r\n\r\n\t/**\r\n\t * The unit's of measure display name\r\n\t */\r\n\tlabel: string;\r\n\r\n\t/**\r\n\t * The unit's of measure quantity\r\n\t */\r\n\tquantity: number;\r\n\r\n\t/**\r\n\t * If this pricing line isn't available for purchase, this will contain a string-localizer-key explaining the reason why.\r\n\t */\r\n\tunavailabilityReason: string | undefined;\r\n} & MassPricingLineOptions;\r\n\r\ntype MassPricingLineOptions =\r\n\t| {\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight unit\r\n\t\t\t */\r\n\t\t\tunitOfMass: UnitOfMass;\r\n\r\n\t\t\t/**\r\n\t\t\t * The unit's of measure weight\r\n\t\t\t */\r\n\t\t\tweight: number;\r\n\t }\r\n\t| {\r\n\t\t\tunitOfMass?: never;\r\n\t\t\tweight?: never;\r\n\t };\r\n\r\n/**\r\n * Represents state details pricing lines and pricing line selections for a product on a product details page.\r\n */\r\nexport interface ProductPricingLinesDetails {\r\n\t/**\r\n\t * The selected pricing lines\r\n\t */\r\n\tselected?: ProductPricingLine;\r\n\t/**\r\n\t * The array of available pricing lines\r\n\t */\r\n\tavailable: ProductPricingLine[];\r\n}\r\n\r\n/**\r\n * Reason that the exception was thrown when adding an item to the cart\r\n */\r\nexport enum AddToCartExceptionCode {\r\n\tgeneric = 'Generic',\r\n\tcartFull = 'CartFull',\r\n\tproductUnavailable = 'ProductUnavailable',\r\n\tproductOutOfStock = 'ProductOutOfStock',\r\n}\r\n\r\n/**\r\n * Interface used as request for getting bulk products partial data\r\n */\r\nexport interface BaseBulkPartialProductsDataOptions {\r\n\tproductIds: string[] | undefined;\r\n\tmissingKeys: Array;\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Circle Exclaimation SVG component\r\n *\r\n * @returns\r\n */\r\nfunction CircleExclamationSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleExclamationSVG;\r\n","import React from 'react';\r\nimport { RouteProps } from 'react-router';\r\nimport {\r\n\tMY_ACCOUNT_ADDRESS_BOOK_CREATE_URL,\r\n\tMY_ACCOUNT_ADDRESS_BOOK_EDIT_URL,\r\n\tMY_ACCOUNT_ADDRESS_BOOK_URL,\r\n\tMY_ACCOUNT_PATH_PREFIX,\r\n} from './routes.roc';\r\n// #region HCL\r\nimport { ORGANIZATION_ORDERS_URL } from 'features/commerce/organization/routes';\r\n// #endregion\r\n\r\n//#region URLs\r\nexport const MY_ACCOUNT_ORDERS_URL = `${MY_ACCOUNT_PATH_PREFIX}/orders`;\r\nexport const MY_ACCOUNT_STORE_URL = `${MY_ACCOUNT_PATH_PREFIX}/store`;\r\nexport const MY_ACCOUNT_SAVED_FOR_LATER_URL = `${MY_ACCOUNT_PATH_PREFIX}/saved-for-later`;\r\nexport const MY_ACCOUNT_SAVED_CARTS_URL = `${MY_ACCOUNT_PATH_PREFIX}/saved-carts`;\r\nexport const MY_ACCOUNT_BUY_AGAIN_URL = `${MY_ACCOUNT_PATH_PREFIX}/buy-again`;\r\nexport const MY_ACCOUNT_SHOPPING_LISTS_URL = `${MY_ACCOUNT_PATH_PREFIX}/shopping-lists`;\r\nexport const MY_ACCOUNT_ORGANIZATION_REVIEW_URL = `${MY_ACCOUNT_PATH_PREFIX}/organization-review`;\r\nexport const MY_ACCOUNT_ORGANIZATION_SELECTOR_URL = `${MY_ACCOUNT_PATH_PREFIX}/organization-selector`;\r\nexport const MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL = `${MY_ACCOUNT_SHOPPING_LISTS_URL}/create`;\r\n//#endregion URLs\r\n\r\n//#region Components\r\n\r\n//#region HCL\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL = `${MY_ACCOUNT_PATH_PREFIX}/shipping-accounts`;\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_CREATE_URL = `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL}/create`;\r\nexport const MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL = `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL}/edit`;\r\nexport const MY_ACCOUNT_REVIEWS_URL = `${MY_ACCOUNT_PATH_PREFIX}/reviews`;\r\nexport const MY_ACCOUNT_CUSTOMER_ACCOUNT_APPLICATIONS_URL = `/customer-account-application`;\r\nexport const MY_ACCOUNT_CUSTOMER_CREDIT_APPLICATIONS_URL = `https://nuvo.com/customer/gohcl`;\r\nexport const MY_ACCOUNT_SHOPPER_APPLICATIONS_URL = `${MY_ACCOUNT_PATH_PREFIX}/shopper-applications`;\r\nexport const ORGANIZATION_ORDER_DETAILS = `${ORGANIZATION_ORDERS_URL}/:orderNo`;\r\n//#endregion URLs\r\n\r\n// #region HCL\r\n//const OrdersComponent = React.lazy(\r\n//\t() => import(/* webpackChunkName: \"my-account-orders\" */ '../commerce/my-account/orders/OrderListing'),\r\n//);\r\n\r\n//const OrderDetailsComponent = React.lazy(\r\n//\t() =>\r\n//\t\timport(\r\n//\t\t\t/* webpackChunkName: \"my-account-order-details\" */ '../commerce/my-account/orders/MyAccountOrderDetails'\r\n//\t\t),\r\n//);\r\n\r\nconst OrdersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-orders\" */ '../commerce/my-account/orders/hcl/Orders'),\r\n);\r\n\r\nconst OrderDetailsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-order-details\" */ '../commerce/organization/orders/DefaultOrganizationOrderDetails'\r\n\t\t),\r\n);\r\n// #endregion\r\n\r\nconst StoreComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-store\" */ '../commerce/my-account/store/Store'),\r\n);\r\n\r\nconst AddressBookComponent = React.lazy(\r\n\t// #region HCL\r\n\t// () => import(/* webpackChunkName: \"my-account-address-book\" */ '../address-book/AddressBook'),\r\n\t() => import(/* webpackChunkName: \"my-account-address-book\" */ '../address-book/AddressBook.HCL'),\r\n\t// #endregion\r\n);\r\n\r\nconst AddressBookEditComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-address-book-edit\" */ '../address-book/AddressBookEdit'),\r\n);\r\n\r\nconst SavedForLaterComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-saved-for-later\" */ '../commerce/my-account/saved-for-later/SavedForLaterListingWrapper'\r\n\t\t),\r\n);\r\n\r\nconst SavedCartsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-saved-carts\" */ '../commerce/my-account/saved-carts/SavedCartsListingWrapper'\r\n\t\t),\r\n);\r\n\r\nconst BuyAgainComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"buy-again\" */ '../commerce/my-account/buy-again/BuyAgain'),\r\n);\r\n\r\nconst AccountOverviewComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-account-overview\" */ '../commerce/my-account/account-overview/AccountOverview'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-lists\" */ '../commerce/my-account/shopping-lists/ShoppingListListing'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListsCreateComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-lists-create\" */ '../commerce/my-account/shopping-lists/ShoppingListsCreate'\r\n\t\t),\r\n);\r\n\r\nconst ShoppingListDetailsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopping-list-details\" */ '../commerce/my-account/shopping-lists/MyAccountShoppingListDetails'\r\n\t\t),\r\n);\r\n\r\nconst OrganizationReviewComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-organization-approval\" */ '../commerce/my-account/organization/OrganizationReview'\r\n\t\t),\r\n);\r\n\r\nconst OrganizationSelectorComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-organization-selector\" */ '../commerce/my-account/organization/OrganizationSelector'\r\n\t\t),\r\n);\r\n//#region HCL\r\nconst UserShippingAccountsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-address-book\" */ '../commerce/user-shipping-account/UserShippingAccounts'\r\n\t\t),\r\n);\r\n\r\nconst ReviewsComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"my-account-reviews\" */ '../hcl/my-account/reviews/ReviewsListing'),\r\n);\r\n\r\nconst CustomerAccountApplicationsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-customer-account-applications\" */ '../hcl/my-account/account-applications/AccountApplicationsListing'\r\n\t\t),\r\n);\r\n\r\nconst CustomerAccountApplicationsEditComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-customer-account-applications-create\" */ '../hcl/my-account/account-applications/MyAccountApplicationLoader'\r\n\t\t),\r\n);\r\n\r\nconst CustomerCreditApplicationsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-customer-account-applications\" */ '../hcl/my-account/credit-applications/CreditApplicationsListing'\r\n\t\t),\r\n);\r\n\r\nconst CustomerCreditApplicationsEditComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-customer-account-applications-create\" */ '../hcl/my-account/credit-applications/MyAccountCreditApplicationLoader'\r\n\t\t),\r\n);\r\n\r\nconst ShopperApplicationsComponent = React.lazy(\r\n\t() =>\r\n\t\timport(\r\n\t\t\t/* webpackChunkName: \"my-account-shopper-applications\" */ '../hcl/my-account/shopper-applications/ShopperApplicationsListing'\r\n\t\t),\r\n);\r\n\r\n// const UserShippingAccountsEditComponent = React.lazy(() =>\r\n// \timport(\r\n// \t\t/* webpackChunkName: \"my-account-address-book-edit\" */ '../commerce/user-shipping-account/UserShippingAccountsEdit'\r\n// \t),\r\n// );\r\n//#endregion\r\n\r\n//#endregion Components\r\n\r\n//#region Routes\r\nconst ordersRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORDERS_URL,\r\n\tcomponent: OrdersComponent,\r\n};\r\n\r\nconst orderDetailsRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_ORDERS_URL}/:orderNo`,\r\n\tcomponent: OrderDetailsComponent,\r\n};\r\n\r\nconst storeRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_STORE_URL,\r\n\tcomponent: StoreComponent,\r\n};\r\n\r\nconst addressBookRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ADDRESS_BOOK_URL,\r\n\tcomponent: AddressBookComponent,\r\n};\r\n\r\nconst addressBookCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ADDRESS_BOOK_CREATE_URL,\r\n\tcomponent: AddressBookEditComponent,\r\n};\r\n\r\nconst addressBookEditRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_ADDRESS_BOOK_EDIT_URL}/:addressId`,\r\n\tcomponent: AddressBookEditComponent,\r\n};\r\n\r\nconst savedForLaterRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SAVED_FOR_LATER_URL,\r\n\tcomponent: SavedForLaterComponent,\r\n};\r\n\r\nconst savedCartsRoute = {\r\n\texect: true,\r\n\tpath: MY_ACCOUNT_SAVED_CARTS_URL,\r\n\tcomponent: SavedCartsComponent,\r\n};\r\n\r\nconst buyAgainRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_BUY_AGAIN_URL,\r\n\tcomponent: BuyAgainComponent,\r\n};\r\n\r\nconst shoppingListsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SHOPPING_LISTS_URL,\r\n\tcomponent: ShoppingListsComponent,\r\n};\r\n\r\nconst shoppingListsCreateRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SHOPPING_LISTS_CREATE_URL,\r\n\tcomponent: ShoppingListsCreateComponent,\r\n};\r\n\r\nconst shoppingListDetailsRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_SHOPPING_LISTS_URL}/:shoppingListId`,\r\n\tcomponent: ShoppingListDetailsComponent,\r\n};\r\n\r\n//#region HCL\r\nconst userShippingAccountsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_USER_SHIPPING_ACCOUNT_URL,\r\n\tcomponent: UserShippingAccountsComponent,\r\n};\r\n\r\nconst reviewsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_REVIEWS_URL,\r\n\tcomponent: ReviewsComponent,\r\n};\r\n\r\nconst customerAccountApplicationsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_CUSTOMER_ACCOUNT_APPLICATIONS_URL,\r\n\tcomponent: CustomerAccountApplicationsComponent,\r\n};\r\n\r\nconst customerAccountApplicationsEditRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_CUSTOMER_ACCOUNT_APPLICATIONS_URL}/:accountApplicationId`,\r\n\tcomponent: CustomerAccountApplicationsEditComponent,\r\n};\r\n\r\nconst customerCreditApplicationsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_CUSTOMER_CREDIT_APPLICATIONS_URL,\r\n\tcomponent: CustomerCreditApplicationsComponent,\r\n};\r\n\r\nconst customerCreditApplicationsEditRoute = {\r\n\texact: true,\r\n\tpath: `${MY_ACCOUNT_CUSTOMER_CREDIT_APPLICATIONS_URL}/:creditApplicationId`,\r\n\tcomponent: CustomerCreditApplicationsEditComponent,\r\n};\r\n\r\nconst shopperApplicationsRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_SHOPPER_APPLICATIONS_URL,\r\n\tcomponent: ShopperApplicationsComponent,\r\n};\r\n\r\n// const userShippingAccountsCreateRoute = {\r\n// \texact: true,\r\n// \tpath: MY_ACCOUNT_USER_SHIPPING_ACCOUNT_CREATE_URL,\r\n// \tcomponent: UserShippingAccountsEditComponent,\r\n// };\r\n\r\n// const userShippingAccountsEditRoute = {\r\n// \texact: true,\r\n// \tpath: `${MY_ACCOUNT_USER_SHIPPING_ACCOUNT_EDIT_URL}/:shippingAccountId`,\r\n// \tcomponent: UserShippingAccountsEditComponent,\r\n// };\r\n//#endregion\r\n\r\nconst defaultRoute = {\r\n\texact: false,\r\n\tpath: '*',\r\n\tcomponent: AccountOverviewComponent,\r\n};\r\n\r\nconst organizationReviewRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORGANIZATION_REVIEW_URL,\r\n\tcomponent: OrganizationReviewComponent,\r\n};\r\n\r\nconst organizationSelectorRoute = {\r\n\texact: true,\r\n\tpath: MY_ACCOUNT_ORGANIZATION_SELECTOR_URL,\r\n\tcomponent: OrganizationSelectorComponent,\r\n};\r\n//#endregion Routes\r\n\r\nexport const commerceRoutes: RouteProps[] = [\r\n\tordersRoute,\r\n\torderDetailsRoute,\r\n\tstoreRoute,\r\n\taddressBookRoute,\r\n\taddressBookCreateRoute,\r\n\taddressBookEditRoute,\r\n\tsavedForLaterRoute,\r\n\tsavedCartsRoute,\r\n\tbuyAgainRoute,\r\n\tshoppingListsRoute,\r\n\tshoppingListsCreateRoute,\r\n\tshoppingListDetailsRoute,\r\n\torganizationReviewRoute,\r\n\torganizationSelectorRoute,\r\n\t//#region HCL\r\n\treviewsRoute,\r\n\tuserShippingAccountsRoute,\r\n\tcustomerAccountApplicationsRoute,\r\n\tcustomerAccountApplicationsEditRoute,\r\n\tcustomerCreditApplicationsRoute,\r\n\tcustomerCreditApplicationsEditRoute,\r\n\tshopperApplicationsRoute,\r\n\t// userShippingAccountsCreateRoute,\r\n\t// userShippingAccountsEditRoute,\r\n\t//#endregion\r\n\tdefaultRoute,\r\n];\r\n","import React from 'react';\r\nimport XSVG from './svg/XSVG';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { WithTestIdOptional } from '../../../../Roc.SharedClientApp/types/test';\r\n\r\ninterface CircleButtonProps extends WithTestIdOptional {\r\n\ticon?: React.ReactNode;\r\n}\r\n\r\nfunction CircleButton(props: React.HTMLProps & CircleButtonProps) {\r\n\tconst { icon, testId, ...otherProps } = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CircleButton;\r\n","import React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { ValidationMessages } from '.';\r\nimport FieldInputErrorWrapper from './FieldInputErrorWrapper';\r\nimport { BaseInputProps } from './InputField';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport type InputFieldProps = FieldRenderProps &\r\n\tBaseInputProps & {\r\n\t\tplaceholder?: string;\r\n\t};\r\n\r\n/**\r\n * Component that renders a checkbox input with form field.\r\n */\r\nexport default function CheckboxInputField({\r\n\tinput: { name, onChange, value },\r\n\tmeta,\r\n\ttype,\r\n\tlabel = '',\r\n\tdisabled = false,\r\n\treadOnly = false,\r\n\tplaceholder = '',\r\n\tstep,\r\n\ttestId,\r\n\tdefaultValue = false,\r\n}: InputFieldProps) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Star SVG\r\n *\r\n * @returns\r\n */\r\nfunction StarSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default StarSVG;\r\n","/* eslint-disable jsx-a11y/label-has-for */\r\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport StarEmptySVG from 'shared/components/svg/StarEmptySVG';\r\nimport StarSVG from 'shared/components/svg/StarSVG';\r\nimport useStarRating from './useStarRating';\r\n\r\n/**\r\n * Product Rating Props\r\n */\r\ninterface RatingProps extends WithTestId {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\treadonly?: boolean;\r\n\tonChange?: (rating: number) => void;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * If readonly, displays the rating with blank and filled stars (1-maxRating)\r\n * If not readonly, displays the rating picker with blank and filled stars (1-maxRating)\r\n * @param props\r\n */\r\nexport default function StarRating(props: RatingProps) {\r\n\tconst { value, name, readonly = false, onChange, maxRating = 5, testId } = props;\r\n\r\n\tconst { ratingStars, setRatingHovered } = useStarRating({\r\n\t\tvalue,\r\n\t\tname,\r\n\t\tmaxRating,\r\n\t});\r\n\r\n\tif (!readonly && !onChange) {\r\n\t\tthrow new Error('Rating component is set to non-readonly, yet onChange is not defined.');\r\n\t}\r\n\r\n\t/**\r\n\t * Handle changes to the radio button that backs the star rating selection\r\n\t *\r\n\t * @param {*} e\r\n\t */\r\n\tconst onInputChange = (e) => {\r\n\t\tif (onChange) {\r\n\t\t\tonChange(parseInt(e.currentTarget.value));\r\n\t\t}\r\n\t};\r\n\r\n\tif (readonly) {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{ratingStars.map(({ id, isFull }) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{ratingStars.map(({ id, isFull, isChecked, isPending, isHighlighted, ratingValue }) => {\r\n\t\t\t\tconst modifierClasses = classnames({\r\n\t\t\t\t\t'roc-rating__input--full': isFull,\r\n\t\t\t\t\t'roc-rating__input--pending': isPending,\r\n\t\t\t\t\t'roc-rating__label--highlighted': isHighlighted,\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setRatingHovered(ratingValue)}\r\n\t\t\t\t\t\t\tonMouseLeave={() => setRatingHovered(null)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isFull ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\n\r\n/**\r\n * The state of all of the stars being displayed, these change together frequently\r\n * so lets store them together. This is also slightly better than calculating\r\n * on every single render. Makes it easier to reuse as well.\r\n */\r\ninterface RatingStarState {\r\n\tid: string;\r\n\tisFull: boolean;\r\n\tisPending: boolean;\r\n\tisHighlighted: boolean;\r\n\tisChecked: boolean;\r\n\tratingValue: number;\r\n}\r\n\r\n/**\r\n * The params for the useStarRating hook.\r\n */\r\ninterface UseStarRatingParams {\r\n\tvalue: number | null;\r\n\tname: string;\r\n\tmaxRating?: number;\r\n}\r\n\r\n/**\r\n * The values returned by the custom star rating hook\r\n */\r\ninterface UseStarRatingResult {\r\n\tratingStars: RatingStarState[];\r\n\tsetRatingHovered: (value: number | null) => void;\r\n}\r\n\r\n/**\r\n * Custom hook that manages state for simple star rating implementations\r\n * @param params\r\n */\r\nexport default function useStarRating(params: UseStarRatingParams): UseStarRatingResult {\r\n\tconst { value, name, maxRating = 5 } = params;\r\n\tconst [ratingStars, setRatingStars] = useState([]);\r\n\tconst [ratingHovered, setRatingHovered] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newState: RatingStarState[] = [];\r\n\r\n\t\tfor (let i = 1; i <= maxRating; i++) {\r\n\t\t\tconst id = 'rating-group-' + name + '-' + i;\r\n\t\t\tconst isFull = value !== null && value >= i;\r\n\t\t\tconst isPending = ratingHovered ? i > ratingHovered && isFull : false;\r\n\t\t\tconst isHighlighted = ratingHovered ? i <= ratingHovered : false;\r\n\t\t\tconst isChecked = value === i;\r\n\r\n\t\t\tnewState.push({\r\n\t\t\t\tid,\r\n\t\t\t\tisFull,\r\n\t\t\t\tisPending,\r\n\t\t\t\tisHighlighted,\r\n\t\t\t\tisChecked,\r\n\t\t\t\tratingValue: i,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetRatingStars(newState);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [value, ratingHovered]);\r\n\r\n\treturn { ratingStars, setRatingHovered };\r\n}\r\n","import React from 'react';\r\nimport { FormProps, Form } from 'react-final-form';\r\nimport createDecorator from 'final-form-focus';\r\nimport { AnyObject } from 'final-form';\r\n\r\ntype RocFormProps = FormProps;\r\n\r\nconst focusOnError = createDecorator();\r\n\r\n/**\r\n * Wrapper component for react-final-form so that we can add useful defaults across the board.\r\n * @param props props\r\n */\r\nexport default function RocForm({\r\n\tonSubmit,\r\n\trender,\r\n\tdebug,\r\n\tdestroyOnUnregister,\r\n\tform,\r\n\tcomponent,\r\n\tinitialValues,\r\n\tinitialValuesEqual,\r\n\tkeepDirtyOnReinitialize,\r\n\tvalidate,\r\n\tvalidateOnBlur,\r\n\tdecorators = [focusOnError],\r\n\tmutators,\r\n\tsubscription,\r\n}: RocFormProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\tonSubmit={onSubmit}\r\n\t\t\tdecorators={decorators}\r\n\t\t\trender={render}\r\n\t\t\tdebug={debug}\r\n\t\t\tdestroyOnUnregister={destroyOnUnregister}\r\n\t\t\tform={form}\r\n\t\t\tcomponent={component}\r\n\t\t\tinitialValues={initialValues}\r\n\t\t\tinitialValuesEqual={initialValuesEqual}\r\n\t\t\tkeepDirtyOnReinitialize={keepDirtyOnReinitialize}\r\n\t\t\tmutators={mutators}\r\n\t\t\tsubscription={subscription}\r\n\t\t\tvalidate={validate}\r\n\t\t\tvalidateOnBlur={validateOnBlur}\r\n\t\t/>\r\n\t);\r\n}\r\n","/**\r\n * Retrieves an
HTMLElement representing a specified tab by its ID.\r\n * @param tabId The ID of the tab to retrieve.\r\n */\r\nexport function getTabDivElement(tabId: string): HTMLDivElement | null {\r\n\tconst divElements = document.querySelector(`div[data-tab-id=\"${tabId}\"]`);\r\n\r\n\treturn divElements instanceof HTMLDivElement ? divElements : null;\r\n}\r\n\r\n/**\r\n * Retrieves an
  • HTMLElement representing a specified tab by its ID.\r\n * @param tabId The ID of the tab to retrieve.\r\n */\r\nexport function getTabLiElement(tabId: string): HTMLLIElement | null {\r\n\tconst listElements = document.querySelector(`li[data-tab-id=\"${tabId}\"]`);\r\n\r\n\treturn listElements instanceof HTMLLIElement ? listElements : null;\r\n}\r\n","import React from 'react';\r\n\r\ninterface RocOptionsTableProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Placeholder component to display simple listing table\r\n */\r\nexport default function RocOptionsTable(props: RocOptionsTableProps) {\r\n\tconst { children } = props;\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t{children}
    \r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n","import React from 'react';\r\n\r\ninterface RocOptionsTableTitleProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Placeholder component to display the title for simple listing tables @see RocOptionsTable\r\n */\r\nexport default function RocOptionsTableTitle(props: RocOptionsTableTitleProps) {\r\n\tconst { children, ...rest } = props;\r\n\r\n\treturn (\r\n\t\t

    \r\n\t\t\t{children}\r\n\t\t

    \r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { ProductDetailSelection, SimpleSelectionDto } from './types';\r\nimport ProductSelectionsList from '../shopping-cart/ProductSelectionsList';\r\n\r\ninterface ProductAttributeListprops {\r\n\tselections?: ProductDetailSelection[];\r\n}\r\n\r\n/**\r\n * Renders a product selectable attributes\r\n */\r\nexport default function ProductSelectableAttributesList(props: ProductAttributeListprops) {\r\n\tconst { selections } = props;\r\n\r\n\tif (!selections) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst simpleSelections = selections\r\n\t\t.filter((s) => s.values?.length > 0)\r\n\t\t.map((selection) => ({\r\n\t\t\tname: selection.label,\r\n\t\t\tid: selection.values[0].value,\r\n\t\t\tlabel: selection.values[0].label,\r\n\t\t\tvalue: selection.values[0].label,\r\n\t\t\tfield: selection.field,\r\n\t\t}));\r\n\r\n\treturn ;\r\n}\r\n","import { MY_ACCOUNT_SHOPPING_LISTS_URL } from 'features/my-account/routes.commerce';\r\nimport { MY_ACCOUNT_LOGIN_URL } from 'features/my-account/routes.roc';\r\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { getUserData } from 'services/UserData';\r\nimport { BulkAddToListResponse } from 'services/UserData.Commerce';\r\nimport Modal from 'shared/components/Modal';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport ShoppingListEditItem from '../my-account/shopping-lists/ShoppingListEditItem';\r\nimport { ItemToAddToList, PrivacyType, PrivacyTypeOptions, ShoppingListDto } from '../my-account/shopping-lists/types';\r\nimport { useShoppingListLoader } from '../my-account/shopping-lists/useShoppingListLoader';\r\nimport { useShoppingLists } from '../my-account/shopping-lists/useShoppingLists';\r\n\r\ninterface BulkAddToListProps {\r\n\t/**\r\n\t * defines if the current user is signed in.\r\n\t */\r\n\tisUserSignedIn: boolean;\r\n\t/**\r\n\t * Represents the list of products to add to list.\r\n\t */\r\n\titemsToAddToList: ItemToAddToList[];\r\n\t/**\r\n\t * Function to clear selected items after adding them to list.\r\n\t */\r\n\tclearSelectedItems: () => void;\r\n}\r\n\r\n/**\r\n * Represents the component on a product details page that adds multiple products to the user's shopping list.\r\n */\r\nexport default function BulkAddToList(props: BulkAddToListProps) {\r\n\tconst [openListModal, setOpenListModal] = useState(false);\r\n\tconst [modalOpen, setModalOpen] = useState(false);\r\n\tconst [addToListResponse, setAddToListResponse] = useState(null);\r\n\tconst [confirmationPopupOpen, setConfirmationPopupOpen] = useState(false);\r\n\tconst [addingToList, setAddingToList] = useState(false);\r\n\r\n\tconst triggerRef = useRef(null);\r\n\r\n\tconst { results } = useShoppingListLoader({\r\n\t\tinitialPageSize: 15,\r\n\t});\r\n\r\n\tconst {\r\n\t\tstate: { isSaving, shoppingListBeingEdited, shoppingList, error, errorMessage },\r\n\t\tactor: { stopEditingShoppingList, saveShoppingList, beginCreateShoppingList, bulkAddProductToList },\r\n\t} = useShoppingLists();\r\n\r\n\tconst cancelEditShoppingList = () => {\r\n\t\tstopEditingShoppingList();\r\n\t\tsetModalOpen(false);\r\n\t};\r\n\r\n\tconst onSaveShoppingList = async (formValues: ShoppingListDto) => {\r\n\t\tconst validationResult = await saveShoppingList(formValues);\r\n\t\tif (validationResult) {\r\n\t\t\treturn validationResult;\r\n\t\t} else {\r\n\t\t\tsetModalOpen(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleListModal = async () => {\r\n\t\tif (props.isUserSignedIn) {\r\n\t\t\tif (openListModal) {\r\n\t\t\t\tsetOpenListModal(false);\r\n\t\t\t} else {\r\n\t\t\t\tsetOpenListModal(true);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twindow.location.href = MY_ACCOUNT_LOGIN_URL + '?ReturnUrl=' + encodeURIComponent(window.location.pathname);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleAddToList = useCallback(\r\n\t\tasync (shoppingListId) => {\r\n\t\t\tsetConfirmationPopupOpen(false);\r\n\r\n\t\t\ttry {\r\n\t\t\t\tsetOpenListModal(false);\r\n\t\t\t\tsetAddingToList(true);\r\n\r\n\t\t\t\tconst response = await bulkAddProductToList({\r\n\t\t\t\t\tshoppingListId: shoppingListId,\r\n\t\t\t\t\titems: props.itemsToAddToList,\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsetConfirmationPopupOpen(true);\r\n\r\n\t\t\t\tif (!response) {\r\n\t\t\t\t\tsetAddToListResponse(null);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetAddToListResponse(response);\r\n\t\t\t\tif (props.clearSelectedItems) {\r\n\t\t\t\t\tprops.clearSelectedItems();\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tsetAddToListResponse(null);\r\n\t\t\t}\r\n\r\n\t\t\tsetAddingToList(false);\r\n\t\t},\r\n\t\t[props, bulkAddProductToList],\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tconst data = (await getUserData()).data;\r\n\r\n\t\t\t\tif (!data?.summary?.organization) {\r\n\t\t\t\t\tconst organizationOption = PrivacyTypeOptions.find((s) => s.text === PrivacyType.Organization);\r\n\r\n\t\t\t\t\tif (organizationOption != undefined) {\r\n\t\t\t\t\t\tPrivacyTypeOptions.splice(PrivacyTypeOptions.indexOf(organizationOption));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Unable to load user data.', error);\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\tif (!shoppingListBeingEdited) {\r\n\t\t\tbeginCreateShoppingList();\r\n\t\t}\r\n\t}, [shoppingListBeingEdited, beginCreateShoppingList]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (shoppingList) {\r\n\t\t\tresults?.results.push(shoppingList);\r\n\t\t\thandleAddToList(shoppingList.id);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [shoppingList, results]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t handleListModal()}\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tclassName=\"roc-btn roc-btn--big\"\r\n\t\t\t\tdisabled={\r\n\t\t\t\t\taddingToList || !props.itemsToAddToList || props.itemsToAddToList.every((e) => e.quantity == null)\r\n\t\t\t\t}\r\n\t\t\t\tdata-testid=\"bulk-add-to-list-button\"\r\n\t\t\t\tref={triggerRef}\r\n\t\t\t>\r\n\t\t\t\t{Localizer('AddToList')}\r\n\t\t\t\t{addingToList && }\r\n\t\t\t\r\n\r\n\t\t\t{addToListResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToList')}\r\n\t\t\t\t\tcloseModal={() => setConfirmationPopupOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{openListModal && (\r\n\t\t\t\t Localizer('ShoppingLists')}\r\n\t\t\t\t\tcloseModal={() => setOpenListModal(false)}\r\n\t\t\t\t>\r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t{results &&\r\n\t\t\t\t\t\t\tresults.results &&\r\n\t\t\t\t\t\t\tresults.results.map((shoppingList, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t\t\t handleAddToList(shoppingList.id)}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{shoppingList.name}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t (setModalOpen(true), setOpenListModal(false))}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t+ {Localizer('AddNewShoppingList')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t)}\r\n\r\n\t\t\t Localizer('AddNewShoppingList')}\r\n\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t{error != null || errorMessage ? : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\ninterface BulkAddedToListAlertProps {\r\n\tresponse: BulkAddToListResponse;\r\n\tsetPopupOpen: (value: boolean) => void;\r\n}\r\n\r\n/**\r\n * Displays Added to List confirmation for bulk add to list\r\n */\r\nfunction BulkAddedToListAlert(props: BulkAddedToListAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{response && response.errorMessages && (\r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t
      \r\n\t\t\t\t\t\t\t{response.errorMessages.map((message, index) => (\r\n\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t)}\r\n\r\n\t\t\t
    \r\n\t\t\t\t{response &&\r\n\t\t\t\t\tresponse.items &&\r\n\t\t\t\t\tresponse.items.map((item, index) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t{item.imageUrl ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t\t\t\t\t{/* #region HCL - replace SKU to ItemNumber */}\r\n\t\t\t\t\t\t\t\t\t\t\t{Localizer('ItemNumber')}:{/* #endregion */}\r\n\t\t\t\t\t\t\t\t\t\t\t{item.sku}\r\n\t\t\t\t\t\t\t\t\t\t

    \r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{Localizer('Qty')} \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.quantity}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t props.setPopupOpen(false)}\r\n\t\t\t\t\t\t\t\tclassName=\"roc-btn-secondary roc-btn-secondary--big roc-btn-secondary--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"continue-shopping-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('ContinueShopping')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t(window.location.href = `${MY_ACCOUNT_SHOPPING_LISTS_URL}/${response.shoppingListId}`)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"view-list-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{Localizer('ViewList')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n","import React, { useContext } from 'react';\r\nimport { UseProductDetailsState, UseProductDetailsActor } from './useProductDetails';\r\n\r\n/**\r\n * Context for product details\r\n */\r\nexport interface ProductDetailsContext {\r\n\tstate: UseProductDetailsState;\r\n\tactor: UseProductDetailsActor;\r\n}\r\n\r\nconst ProductDetailsContext = React.createContext(null);\r\n\r\nexport default ProductDetailsContext;\r\n\r\n/**\r\n * Custom hook for product details context\r\n */\r\nexport function useProductDetailsContext() {\r\n\tconst context = useContext(ProductDetailsContext);\r\n\r\n\tif (context === null) {\r\n\t\tthrow new Error('No ProductDetailsContext.Provider found.');\r\n\t}\r\n\r\n\treturn context;\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { BulkAddToCartResponse } from 'services/UserData.Commerce';\r\nimport LazyImage from 'shared/assets/LazyImage';\r\nimport { AssetType } from 'shared/assets/types';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Modal from 'shared/components/Modal';\r\nimport RocOptionsTable from 'shared/components/roc-options-table/RocOptionsTable';\r\nimport RocOptionsTableTitle from 'shared/components/roc-options-table/RocOptionsTableTitle';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport MultipleItemsAddedToCartAlert from '../store/MultipleItemsAddedToCartAlert';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { productAssetPlaceholder } from './ProductAssets';\r\nimport ProductSelectableAttributesList from './ProductSelectableAttributesList';\r\nimport BulkAddToList from './BulkAddToList';\r\nimport { ItemToAddToList } from '../my-account/shopping-lists/types';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { GetPriceForQuantity, GetPricingLine } from '../pricing/pricing-result';\r\nimport { OrderMessageAction } from '../shopping-cart/OrderMessages';\r\nimport { AddToCartProps } from '../shopping-cart/types';\r\nimport useShoppingCart, { UseShoppingCart } from '../shopping-cart/useShoppingCart';\r\nimport { BulkProductsPartialDataResponse, getBulkPartialProductsData } from './data';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport ProductPricingLines, { CheckableLine } from './ProductPricingLines';\r\nimport {\r\n\tAddToCartExceptionCode,\r\n\tAvailability,\r\n\tProductAsset,\r\n\tProductDetailsState,\r\n\tProductPricingLine,\r\n\tProductPricingLinesDetails,\r\n} from './types';\r\n\r\n/**\r\n * Keys that will be requested from the server when requesting group product simples data\r\n */\r\nconst missingKeys: Array = [\r\n\t'summary',\r\n\t'assets',\r\n\t'availability',\r\n\t'brand',\r\n\t'pricingLines',\r\n\t'displayPricing',\r\n\t'selections',\r\n];\r\n\r\n/**\r\n * Group Product Simples Listing Component\r\n */\r\nexport function SimpleProductsListing() {\r\n\tconst {\r\n\t\tstate: { productDetails, userIsSignedIn },\r\n\t\tactor: { isPurchaseable },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst [selectedItems, setSelectedItems] = useState([]);\r\n\tconst [childrenData, setChildrenData] = useState(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (productDetails.children && productDetails.children?.length > 0) {\r\n\t\t\tasync function fetchChildrenData(productIds: string[]) {\r\n\t\t\t\tconst results = await getBulkPartialProductsData({\r\n\t\t\t\t\tproductIds: productIds,\r\n\t\t\t\t\tmissingKeys: missingKeys,\r\n\t\t\t\t});\r\n\t\t\t\tsetChildrenData(results);\r\n\t\t\t}\r\n\r\n\t\t\tfetchChildrenData(productDetails.children.map((p) => p.id));\r\n\t\t} else {\r\n\t\t\tsetChildrenData(null);\r\n\t\t}\r\n\t}, [productDetails.children]);\r\n\r\n\tconst alternateProductDetailsDom = document.getElementById('alternate-product-details-simples');\r\n\tif (!alternateProductDetailsDom) {\r\n\t\tconsole.warn('alternate product details DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * update the list of items addable to cart or to list when updating qty or unit of measure\r\n\t */\r\n\tconst updateSelectedItem = (itemId?: string, name?: string, selectedPricingLineId?: string, quantity?: number) => {\r\n\t\tif (!itemId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst itemIndex = selectedItems.findIndex((i) => i.itemId == itemId);\r\n\r\n\t\tif (!quantity || quantity === 0) {\r\n\t\t\tif (itemIndex > -1) {\r\n\t\t\t\tsetSelectedItems(\r\n\t\t\t\t\tselectedItems?.filter(function (i) {\r\n\t\t\t\t\t\treturn i.itemId !== itemId;\r\n\t\t\t\t\t}),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst newItems = [...selectedItems];\r\n\t\tif (itemIndex > -1) {\r\n\t\t\tnewItems[itemIndex].quantity = quantity;\r\n\t\t\tnewItems[itemIndex].productPricingLineId = selectedPricingLineId ?? null;\r\n\t\t} else {\r\n\t\t\tnewItems.push({\r\n\t\t\t\titemId: itemId,\r\n\t\t\t\tproductPricingLineId: selectedPricingLineId ?? null,\r\n\t\t\t\tquantity: quantity,\r\n\t\t\t});\r\n\t\t}\r\n\t\tsetSelectedItems(newItems);\r\n\t};\r\n\r\n\tconst clearSelectedItems = () => setSelectedItems([]);\r\n\r\n\tconst itemsToAddToList: ItemToAddToList[] = selectedItems.map((i) => {\r\n\t\treturn {\r\n\t\t\titemId: i.itemId,\r\n\t\t\tproductPricingLineId: i.productPricingLineId,\r\n\t\t\tquantity: i.quantity ?? 1,\r\n\t\t};\r\n\t});\r\n\r\n\tconst simplesListing = (\r\n\t\t
    \r\n\t\t\t\r\n\t\t\t\t{childrenData\r\n\t\t\t\t\t? productDetails.children?.map((child, index) => {\r\n\t\t\t\t\t\t\tchildrenData[child.id].id = child.id;\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t })\r\n\t\t\t\t\t: null}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
    \r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(simplesListing, alternateProductDetailsDom);\r\n}\r\n\r\ninterface SimpleProductsListingRowProps {\r\n\tindex: number;\r\n\titem: Partial;\r\n\tupdateSelectedItem: (\r\n\t\titemId?: string,\r\n\t\tproductname?: string,\r\n\t\tselectedPricingLineId?: string,\r\n\t\tquantity?: number | null,\r\n\t) => void;\r\n\tselectedItems: AddToCartProps[];\r\n\tisPurchaseable: (availability?: Availability | null, pricingLine?: ProductPricingLine) => boolean;\r\n}\r\n\r\n/**\r\n * Single simple product row\r\n */\r\nfunction SimpleProductsListingRow(props: SimpleProductsListingRowProps) {\r\n\tconst { item, index, updateSelectedItem, selectedItems, isPurchaseable } = props;\r\n\tconst [selectedPricingLineId, setSelectedPricingLineId] = useState();\r\n\tconst [quantity, setQuantity] = useState();\r\n\r\n\tconst compareAssets = (a: ProductAsset, b: ProductAsset) => a.sortOrder - b.sortOrder;\r\n\tconst defaultAsset = item?.assets?.sort(compareAssets).find((asset) => asset.assetType === AssetType.Image);\r\n\tconst mainImage = defaultAsset ?? productAssetPlaceholder;\r\n\r\n\tuseEffect(() => {\r\n\t\tconst selectedPricingLineId = item.pricingLines && item.pricingLines.selected && item.pricingLines.selected.id;\r\n\t\tsetSelectedPricingLineId(selectedPricingLineId);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tconst getDetail = () => {\r\n\t\tif (item.displayPricing == null) {\r\n\t\t\tthrow new Error(\"Display pricing was rendered when it wasn't ready!\");\r\n\t\t}\r\n\t\tconst displayPriceLine = GetPricingLine(item.displayPricing, item.id ?? '', selectedPricingLineId);\r\n\r\n\t\treturn displayPriceLine && GetPriceForQuantity(displayPriceLine.prices, 1);\r\n\t};\r\n\r\n\tif (!item) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{item.summary ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t{mainImage !== null ? (\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{item.summary.productUrl ? (\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (item.id) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-clicked', {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tproductId: item.id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: item.summary?.productUrl ?? '#',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tproductName: item.summary?.name ?? '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tproductGroupId: item.summary?.productGroupId ?? null,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t// #endregion\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{item.summary.name}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t{item.summary.name}\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t{item.summary.sku ? (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t{/* #region HCL - replace SKU for ItemNumber */}\r\n\t\t\t\t\t\t\t\t\t\t{Localizer('ItemNumber')}:{/* #endregion */}\r\n\t\t\t\t\t\t\t\t\t\t{item.summary.sku}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\t {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tconst selectedPricingLine =\r\n\t\t\t\t\t\t\t\titem.pricingLines &&\r\n\t\t\t\t\t\t\t\titem.pricingLines.available.find((line) => line.id === pricingLineId);\r\n\r\n\t\t\t\t\t\t\tif (!selectedPricingLine) {\r\n\t\t\t\t\t\t\t\tupdateSelectedItem(item.id, item.summary?.name, undefined, quantity);\r\n\t\t\t\t\t\t\t\tthrow new Error('Invalid unit of measure selected');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsetSelectedPricingLineId(selectedPricingLine.id);\r\n\t\t\t\t\t\t\tupdateSelectedItem(item.id, item.summary?.name, selectedPricingLineId, quantity);\r\n\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\tupdateSelectedItem(item.id, item.summary?.name, selectedPricingLineId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tonQuantityUpdate={(quantity) => {\r\n\t\t\t\t\t\tsetQuantity(quantity);\r\n\t\t\t\t\t\tupdateSelectedItem(item.id, item.summary?.name, selectedPricingLineId, quantity);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tselectedItems={selectedItems}\r\n\t\t\t\t\titemId={item.id}\r\n\t\t\t\t\titemName={item.summary?.name}\r\n\t\t\t\t\tisPurchaseable={isPurchaseable(item.availability, item.pricingLines?.selected)}\r\n\t\t\t\t/>\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\ninterface SimpleProductQtyUOMProps {\r\n\trowIndex?: number;\r\n\titemId?: string;\r\n\titemName?: string;\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\tonPricingLineChange: (pricingLineId: string) => void;\r\n\tonQuantityUpdate?: (newQuantity: number | null) => void;\r\n\tselectedItems: AddToCartProps[];\r\n\tisPurchaseable: boolean;\r\n}\r\n\r\n/**\r\n * Simple products quantity and unit of measure inputs\r\n * those inputs will be used on adding multiple products to cart or to lists\r\n */\r\nfunction SimpleProductQtyUOM(props: SimpleProductQtyUOMProps) {\r\n\tconst [quantity, setQuantity] = useState();\r\n\tconst [selectedProductPricingLineId, setSelectedProductPricingLineId] = useState();\r\n\tconst {\r\n\t\titemName,\r\n\t\tpricingLines,\r\n\t\tisPurchaseable,\r\n\t\tonPricingLineChange,\r\n\t\tonQuantityUpdate,\r\n\t\tselectedItems,\r\n\t\titemId,\r\n\t} = props;\r\n\r\n\t//set quantity to null if the currenct item is no more selected\r\n\tuseEffect(() => {\r\n\t\tif (!selectedItems || selectedItems.length == 0 || !selectedItems.find((e) => e.itemId == itemId)) {\r\n\t\t\tsetQuantity(null);\r\n\t\t}\r\n\t}, [selectedItems, itemId]);\r\n\r\n\tconst handleUnitOfMeasure = (line: CheckableLine) => {\r\n\t\tif (selectedProductPricingLineId === line.pricingLine?.id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetSelectedProductPricingLineId(line.pricingLine?.id);\r\n\r\n\t\t// trigger unit of measure change on the parent component only in case it is not an initialization process\r\n\t\t// because this will reload the data like pricing, availability, etc.\r\n\t\tif (!line.isInitialization && line.pricingLine) {\r\n\t\t\tonPricingLineChange(line.pricingLine.id);\r\n\t\t}\r\n\t};\r\n\r\n\tconst updateQuantity = (e: React.ChangeEvent): void => {\r\n\t\tconst newQuantity = parseInt(e.currentTarget.value);\r\n\r\n\t\tif (isNaN(newQuantity)) {\r\n\t\t\tsetQuantity(null);\r\n\t\t\tif (onQuantityUpdate) {\r\n\t\t\t\tonQuantityUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (newQuantity > 0) {\r\n\t\t\tsetQuantity(newQuantity);\r\n\t\t\tif (onQuantityUpdate) {\r\n\t\t\t\tonQuantityUpdate(newQuantity);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tif (!isPurchaseable) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{/* If a product doesn't have any units of measure it either cannot be purchased or it is a group product.\r\n\t\t\t\t\tEither way, we do not want to render the quantity controls in this case */}\r\n\t\t\t\r\n\t\t\t{pricingLines && pricingLines.available && pricingLines.available.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\ninterface BulkAddToCartButtonProps {\r\n\titemsToAdd: AddToCartProps[];\r\n\tclearSelectedItems: () => void;\r\n}\r\n\r\n/**\r\n * Add to cart button that will be used to add multiple items to cart at once\r\n */\r\nfunction BulkAddToCartButton(props: BulkAddToCartButtonProps) {\r\n\tconst { itemsToAdd, clearSelectedItems } = props;\r\n\tconst [modalOpen, setModalOpen] = useState(true);\r\n\tconst [addingToCart, setAddingToCart] = useState(false);\r\n\tconst [isViewCartActive, setIsViewCartActive] = useState(false);\r\n\tconst [errorMessages, setErrorMessages] = useState>([]);\r\n\r\n\tconst [bulkAddToCartResponse, setBulkAddToCartResponse] = useState(null);\r\n\r\n\tconst UseShoppingCartResult: UseShoppingCart = useShoppingCart();\r\n\tconst {\r\n\t\tstate: { error, errorType },\r\n\t\tactor: { bulkAddToCart },\r\n\t} = UseShoppingCartResult;\r\n\r\n\tconst errorTitle =\r\n\t\terrorType === AddToCartExceptionCode.cartFull\r\n\t\t\t? Localizer('CartFull')\r\n\t\t\t: errorType === AddToCartExceptionCode.productOutOfStock\r\n\t\t\t? Localizer('OutOfStock')\r\n\t\t\t: errorType === AddToCartExceptionCode.productUnavailable\r\n\t\t\t? Localizer('ProductUnavailable')\r\n\t\t\t: Localizer('ErrorMessageGenericTitle');\r\n\r\n\tconst handleBulkAddToCart = async () => {\r\n\t\tsetErrorMessages([]);\r\n\t\tsetBulkAddToCartResponse(null);\r\n\r\n\t\ttry {\r\n\t\t\tsetAddingToCart(true);\r\n\t\t\tconst response = await bulkAddToCart({ items: itemsToAdd });\r\n\r\n\t\t\tif (!response) {\r\n\t\t\t\tsetBulkAddToCartResponse(null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetBulkAddToCartResponse(response);\r\n\t\t\tclearSelectedItems();\r\n\r\n\t\t\tconst orderErrorMessages = response.orderMessages?.filter(\r\n\t\t\t\t(om) =>\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.Error ||\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.RedirectToCart,\r\n\t\t\t);\r\n\r\n\t\t\tif (orderErrorMessages && orderErrorMessages.length > 0) {\r\n\t\t\t\tsetErrorMessages(orderErrorMessages.map((orderMessages) => orderMessages.message));\r\n\t\t\t\tsetModalOpen(false);\r\n\t\t\t\tsetIsViewCartActive(true);\r\n\t\t\t} else {\r\n\t\t\t\tsetModalOpen(true);\r\n\t\t\t}\r\n\r\n\t\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary: response.cartSummary });\r\n\t\t} catch (error) {\r\n\t\t\tsetBulkAddToCartResponse(null);\r\n\t\t}\r\n\r\n\t\tsetAddingToCart(false);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t handleBulkAddToCart()}\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tclassName=\"roc-btn roc-btn--block roc-btn--big\"\r\n\t\t\t\tdisabled={\r\n\t\t\t\t\taddingToCart ||\r\n\t\t\t\t\t!itemsToAdd ||\r\n\t\t\t\t\titemsToAdd.length == 0 ||\r\n\t\t\t\t\titemsToAdd.every((e) => e.productPricingLineId == undefined)\r\n\t\t\t\t}\r\n\t\t\t\tdata-testid=\"add-to-cart-button\"\r\n\t\t\t>\r\n\t\t\t\t{Localizer('AddToCart')}\r\n\t\t\t\t{addingToCart && }\r\n\t\t\t\r\n\r\n\t\t\t{bulkAddToCartResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToCart')}\r\n\t\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\r\n\t\t\t\t>\r\n\t\t\t\t\t{}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{error != null || errorMessages.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t{errorMessages.map((orderMessage, index) => (\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t{isViewCartActive ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('ViewCart')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\terror={error}\r\n\t\t\t\t/>\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n","// This is the Roc.Web variant of type-assertions.ts\r\n// The contents of this file should be identical to the version living in Roc.Admin\r\n// This currently cannot be moved to Roc.SharedClientApp (shared-client) because of transpilation issues with babel and webpack.\r\n// Working around this issue is currently not viable at this time but may be resolved in the future.\r\n// Please see https://github.com/babel/babel/issues/8309\r\n\r\n/**\r\n * Represents an assertion failure, meaning that an invariant that is supposed to always hold true, failed\r\n * Assertion failures should never be handled as they should never happen. They represent a programmer error.\r\n */\r\nexport class AssertionError extends Error {\r\n\tconstructor(m: string) {\r\n\t\tsuper(m);\r\n\r\n\t\t// Set the prototype explicitly.\r\n\t\tObject.setPrototypeOf(this, AssertionError.prototype);\r\n\t}\r\n}\r\n\r\n/**\r\n * Asserts that the specified condition is true and throws an assertion error if it is not.\r\n *\r\n * This is an assertion function and use of this function will impact TypeScript's flow analysis.\r\n */\r\nexport function assert(condition: any, message: string = ''): asserts condition {\r\n\tif (!condition) {\r\n\t\tif (message.length > 0) {\r\n\t\t\tthrow new AssertionError(`Assertion Failure: ${message}`);\r\n\t\t} else {\r\n\t\t\tthrow new AssertionError(`Assertion Failure`);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Asserts that the specified arguments is not null or undefined and throws an assertion error if it is.\r\n *\r\n * This is an assertion function and use of this function will impact TypeScript's flow analysis.\r\n */\r\nexport function assertNotNullish(arg: T): asserts arg is NonNullable {\r\n\tif (arg === null || arg === undefined) {\r\n\t\tthrow new AssertionError(`Assertion Failure: The specified argument was null or undefined`);\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport { Availability } from './types';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\ninterface ProductAvailabilityProps {\r\n\tavailability?: Availability | null;\r\n}\r\n\r\n/**\r\n * Custom, HCL product availability display\r\n */\r\nexport default function ProductAvailabilityHCL(props: ProductAvailabilityProps) {\r\n\tconst { availability } = props;\r\n\r\n\tlet status = '';\r\n\tif (!availability) {\r\n\t\tstatus = Localizer('Call') + ' 1-800-848-1633';\r\n\t} else if (availability.backOrder) {\r\n\t\tstatus = Localizer('Backordered');\r\n\t} else if (availability.outOfStock) {\r\n\t\tstatus = Localizer('OutOfStock');\r\n\t} else if (availability.callForAvailability) {\r\n\t\tstatus = Localizer('Call') + ' 1-800-848-1633';\r\n\t} else {\r\n\t\tstatus = Localizer('InStock');\r\n\t}\r\n\r\n\treturn (\r\n\t\t

    \r\n\t\t\t{Localizer('StockStatus')}:  \r\n\t\t\t{status}\r\n\t\t

    \r\n\t);\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToCartResponse } from 'services/UserData.Commerce';\r\nimport Modal from 'shared/components/Modal';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { assertNotNullish } from 'util/type-assertions';\r\nimport { OrderMessageAction } from '../shopping-cart/OrderMessages';\r\nimport useShoppingCart, { UseShoppingCart } from '../shopping-cart/useShoppingCart';\r\nimport AddedToCartAlert from '../store/AddedToCartAlert';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { CheckableLine, default as ProductPricingLines } from './ProductPricingLines';\r\nimport {\r\n\tAddToCartExceptionCode,\r\n\tAvailability,\r\n\tProductAddOnDto,\r\n\tProductPricingLinesDetails,\r\n\tProductType,\r\n\tSummary,\r\n} from './types';\r\nimport { UseProductDetails } from './useProductDetails';\r\nimport MinusSVG from 'shared/components/svg/MinusSVG';\r\nimport PlusSVG from 'shared/components/svg/PlusSVG';\r\nimport ShoppingCartSVG from 'shared/components/svg/ShoppingCartSVG';\r\nimport ProductAvailabilityHCL from './ProductAvailabilityHCL';\r\n\r\n/** The component props for the ProductAddToCart component. */\r\ninterface ProductAddToCartProps {\r\n\tid: string;\r\n\tsummary?: Summary;\r\n\tavailability?: Availability | null;\r\n\tpricingLines?: ProductPricingLinesDetails;\r\n\tonPricingLineChange: (pricingLineId: string) => void;\r\n\r\n\tquantity: number | null;\r\n\tsetQuantity: (qty: number | null) => void;\r\n\r\n\tsetSelectedProductPricingLineId: (id: string | null) => void;\r\n\r\n\taddOns?: ProductAddOnDto[];\r\n\taddOnsHandleSubmitWithError?: (error: AxiosError) => void;\r\n}\r\n\r\n/**\r\n * Represents the component on a product details page that manages pricing line selections,\r\n * quantities, and of coursing, adding a product to the user's shopping cart.\r\n */\r\nexport default function ProductAddToCart(props: ProductAddToCartProps) {\r\n\tconst UseProductDetailsResult: UseProductDetails = useProductDetailsContext();\r\n\r\n\tconst {\r\n\t\tstate: { selectedPricingLine, productDetails },\r\n\t\tactor: { setSelectedPricingLine, isPricingLineUnavailable, isPurchaseable },\r\n\t} = UseProductDetailsResult;\r\n\r\n\tconst [modalOpen, setModalOpen] = useState(true);\r\n\tconst [addingToCart, setAddingToCart] = useState(false);\r\n\tconst [addToCartResponse, setAddToCartResponse] = useState(null);\r\n\tconst [errorMessages, setErrorMessages] = useState>([]);\r\n\tconst [isViewCartActive, setIsViewCartActive] = useState(false);\r\n\tconst [numberOfItems, setNumberOfItems] = useState(props.quantity || 1);\r\n\r\n\tconst UseShoppingCartResult: UseShoppingCart = useShoppingCart();\r\n\r\n\tconst {\r\n\t\tstate: { error, errorMessage: cartErrorMessage, errorType },\r\n\t\tactor: { addToCart },\r\n\t} = UseShoppingCartResult;\r\n\r\n\tconst allSelectionsSelected = props.summary && props.summary.type === ProductType.Simple;\r\n\tconst errorTitle =\r\n\t\terrorType === AddToCartExceptionCode.cartFull\r\n\t\t\t? Localizer('CartFull')\r\n\t\t\t: errorType === AddToCartExceptionCode.productOutOfStock\r\n\t\t\t? Localizer('OutOfStock')\r\n\t\t\t: errorType === AddToCartExceptionCode.productUnavailable\r\n\t\t\t? Localizer('ProductUnavailable')\r\n\t\t\t: Localizer('ErrorMessageGenericTitle');\r\n\r\n\tuseEffect(() => {\r\n\t\tif (allSelectionsSelected) {\r\n\t\t\tsetErrorMessages([]);\r\n\t\t\tsetAddingToCart(false);\r\n\t\t}\r\n\r\n\t\tif (cartErrorMessage) {\r\n\t\t\tsetErrorMessages([cartErrorMessage]);\r\n\t\t}\r\n\t}, [props.summary, allSelectionsSelected, cartErrorMessage]);\r\n\r\n\t//#region Render method \"subcomponent\" helpers\r\n\r\n\t//#region AddToCartButton Subcomponent\r\n\t// The \"Add to Cart\" button. When pressed, the selected product will be added to the cart.\r\n\t// Manages its own visibility and \"clickability\", disabling itself if the selected option is\r\n\t// erroneous such as if it's not for sale.\r\n\r\n\t/** Event fired when the \"add to cart\" button is clicked. */\r\n\tconst handleAddToCart = async () => {\r\n\t\tsetErrorMessages([]);\r\n\t\tif (!allSelectionsSelected || !selectedPricingLine.checked || isPricingLineUnavailable()) {\r\n\t\t\tsetErrorMessages([Localizer('AddToCartSelectionErrorMessage')]);\r\n\t\t\tsetIsViewCartActive(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetAddToCartResponse(null);\r\n\r\n\t\ttry {\r\n\t\t\tconsole.debug('Adding to cart:', props.id, props.quantity);\r\n\t\t\tsetAddingToCart(true);\r\n\r\n\t\t\tconst response = await addToCart({\r\n\t\t\t\titemId: props.id,\r\n\t\t\t\tquantity: props.quantity,\r\n\t\t\t\tproductPricingLineId: selectedPricingLine.pricingLine?.id ?? '',\r\n\t\t\t\taddOns: props.addOns,\r\n\t\t\t\tvalidateAddOns: true,\r\n\t\t\t});\r\n\r\n\t\t\tif (!response) {\r\n\t\t\t\tsetAddToCartResponse(null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetAddToCartResponse(response);\r\n\r\n\t\t\tconst orderErrorMessages = response.orderMessages?.filter(\r\n\t\t\t\t(om) =>\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.Error ||\r\n\t\t\t\t\tom.messageAction === OrderMessageAction.RedirectToCart,\r\n\t\t\t);\r\n\r\n\t\t\tif (orderErrorMessages && orderErrorMessages.length > 0) {\r\n\t\t\t\tsetErrorMessages(orderErrorMessages.map((orderMessages) => orderMessages.message));\r\n\t\t\t\tsetModalOpen(false);\r\n\t\t\t\tsetIsViewCartActive(true);\r\n\t\t\t} else {\r\n\t\t\t\tsetModalOpen(true);\r\n\t\t\t}\r\n\r\n\t\t\tdispatchRocEvent('roc-cart-summary-updated', { cartSummary: response.cartSummary });\r\n\t\t} catch (error) {\r\n\t\t\tsetAddToCartResponse(null);\r\n\r\n\t\t\tconst axiosError: AxiosError = error;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.status === 400 && axiosError.response.data) {\r\n\t\t\t\t//notify the add ons form with the validation errors\r\n\t\t\t\tif (props.addOnsHandleSubmitWithError) {\r\n\t\t\t\t\tprops.addOnsHandleSubmitWithError(axiosError);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsetAddingToCart(false);\r\n\t};\r\n\t//#endregion\r\n\r\n\t//#region PricingLineControls Subcomponent\r\n\t// Represents the pricing line and quantity controls, dictating the number or quantity of products added to the\r\n\t// end user's cart and which pricing line is selected.\r\n\r\n\t/** Callback when a pricing line's quantity is changed in PricingLineControls */\r\n\tconst updateQuantity = (e: React.ChangeEvent): void => {\r\n\t\tconst newQuantity = parseInt(e.currentTarget.value);\r\n\t\t// #region HCL\r\n\t\tsetNumberOfItems(newQuantity);\r\n\t\t// #endregion\r\n\r\n\t\tif (isNaN(newQuantity)) {\r\n\t\t\tprops.setQuantity(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (newQuantity > 0) {\r\n\t\t\tprops.setQuantity(newQuantity);\r\n\t\t}\r\n\t};\r\n\r\n\t/** Callback when a pricing line is changed in PricingLineControls */\r\n\tconst handlePricingLineChange = (line: CheckableLine) => {\r\n\t\tif (selectedPricingLine.pricingLine?.id === line.pricingLine?.id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetSelectedPricingLine(line);\r\n\t\tprops.setSelectedProductPricingLineId(line.pricingLine?.id ?? '');\r\n\r\n\t\t// trigger unit of measure change on the parent component only in case it is not an initialization process\r\n\t\t// because this will reload the data like pricing, availability, etc.\r\n\t\tif (!line.isInitialization) {\r\n\t\t\tassertNotNullish(line.pricingLine);\r\n\t\t\tprops.onPricingLineChange(line.pricingLine.id);\r\n\t\t}\r\n\t\t// #region HCL: Reset quantity to 1 when pricing line is changed\r\n\t\tsetNumberOfItems(1);\r\n\t\t// #endregion\r\n\t};\r\n\r\n\tfunction handleUpdateQuantity(qty: number) {\r\n\t\tsetNumberOfItems(qty);\r\n\t\tif (qty > 0) {\r\n\t\t\tprops.setQuantity(qty);\r\n\t\t}\r\n\t}\r\n\r\n\t//#endregion\r\n\r\n\t//#region ErrorAlerts Subcomponent\r\n\t/**\r\n\t * Represents the conditional inline error alerts subcomponent that may display if an unexpected error occured during operation.\r\n\t * This component manages its own visibility.\r\n\t */\r\n\t//#endregion\r\n\t//#endregion\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{/* PricingLineControls Subcomponent */}\r\n\t\t\t
    \r\n\t\t\t\t{props.pricingLines != null ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{isPurchaseable(productDetails.availability, selectedPricingLine.pricingLine) ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t
    \r\n\r\n\t\t\t{/* AddToCart Subcomponent */}\r\n\t\t\t
    \r\n\t\t\t\t{/* #region HCL - add component to display inventory status */}\r\n\t\t\t\t\r\n\t\t\t\t{/* #endregion */}\r\n\t\t\t\t handleAddToCart()}\r\n\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\tclassName=\"roc-btn roc-btn--block roc-btn--big\"\r\n\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\taddingToCart ||\r\n\t\t\t\t\t\tprops.quantity == null ||\r\n\t\t\t\t\t\t!isPurchaseable(productDetails.availability, selectedPricingLine.pricingLine)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata-testid=\"add-to-cart-button\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{Localizer('AddToCart')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t{addingToCart && }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
    \r\n\r\n\t\t\t{/* AddToCartModal Subcomponent */}\r\n\t\t\t{addToCartResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToCart')}\r\n\t\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{error != null || errorMessages.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t{errorMessages && errorMessages.length > 0 ? (\r\n\t\t\t\t\t\t\t\terrorMessages.map((orderMessage, index) => (\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t{isViewCartActive ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{Localizer('ViewCart')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\terror={error}\r\n\t\t\t\t/>\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n","import { MY_ACCOUNT_SHOPPING_LISTS_URL } from 'features/my-account/routes.commerce';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AddToListResponse } from 'services/UserData.Commerce';\r\n\r\ninterface AddedToListAlertProps {\r\n\tresponse: AddToListResponse;\r\n\tsetPopupOpen: (value: boolean) => void;\r\n}\r\n\r\n/**\r\n * Displays Added to List confirmation\r\n */\r\nexport default function AddedToListAlert(props: AddedToListAlertProps) {\r\n\tconst { response } = props;\r\n\tconst [displayAlert, setDisplayAlert] = useState(true);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDisplayAlert(true);\r\n\t}, [response]);\r\n\r\n\tif (!displayAlert) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t{response.imageUrl ? (\r\n\t\t\t\t\t\t\t{response.name}\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t{response.name}\r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t{/* #region HCL - replace SKU to ItemNumber */}\r\n\t\t\t\t\t\t\t{Localizer('ItemNumber')}:  \r\n\t\t\t\t\t\t\t{/* #endregion */}\r\n\t\t\t\t\t\t\t{response.sku}\r\n\t\t\t\t\t\t

    \r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{response.selections !== null && response.selections.length > 0\r\n\t\t\t\t\t\t\t\t\t? response.selections.map((selection) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t ))\r\n\t\t\t\t\t\t\t\t\t: null}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{selection.name}:\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{selection.label}\r\n\t\t\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t{Localizer('Qty')} \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{response.quantity}\r\n\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t props.setPopupOpen(false)}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn-secondary roc-btn-secondary--big roc-btn-secondary--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"continue-shopping-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ContinueShopping')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t(window.location.href = `${MY_ACCOUNT_SHOPPING_LISTS_URL}/${response.shoppingListId}`)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tclassName=\"roc-btn roc-btn--big roc-btn--block roc-item-summary__btn\"\r\n\t\t\t\t\t\t\tdata-testid=\"view-list-btn\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{Localizer('ViewList')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport Modal from 'shared/components/Modal';\r\nimport Pagination from 'shared/components/Pagination';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { useShoppingListLoader } from '../my-account/shopping-lists/useShoppingListLoader';\r\n\r\ninterface ProductAddToListModalProps {\r\n\t/**\r\n\t * State for whether the modal is open or not.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof ProductAddToListModalProps\r\n\t */\r\n\topenListModal: boolean;\r\n\r\n\t/**\r\n\t * Method for changing the open state of the modal.\r\n\t *\r\n\t * @memberof ProductAddToListModalProps\r\n\t */\r\n\tsetOpenListModal: (isOpen: boolean) => void;\r\n\r\n\t/**\r\n\t * Method for setting the 'add new list' modal open state.\r\n\t *\r\n\t * @memberof ProductAddToListModalProps\r\n\t */\r\n\tsetModalOpen: (open: boolean) => void;\r\n\r\n\t/**\r\n\t * Method that is called when a list is selected.\r\n\t *\r\n\t * @memberof ProductAddToListModalProps\r\n\t */\r\n\thandleAddToList: (shoppingListId: any) => Promise;\r\n}\r\n\r\nconst resultsPageSize = 15;\r\n\r\n/**\r\n * Component that houses the modal and the list results.\r\n *\r\n * @export\r\n * @param {ProductAddToListModalProps} props\r\n * @returns\r\n */\r\nexport default function ProductAddToListModal(props: ProductAddToListModalProps) {\r\n\tconst { openListModal, setModalOpen, setOpenListModal, handleAddToList } = props;\r\n\r\n\tconst { results, goToNextPage, goToPage, goToPreviousPage } = useShoppingListLoader({\r\n\t\tinitialPageSize: resultsPageSize,\r\n\t});\r\n\r\n\treturn (\r\n\t\t Localizer('ShoppingLists')}\r\n\t\t\trenderActions={() => (\r\n\t\t\t\t
    \r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t (setModalOpen(true), setOpenListModal(false))}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t+ {Localizer('AddNewShoppingList')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
    \r\n\r\n\t\t\t\t\t{results && results.results && results.pagination.totalPages > 1 ? (\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t) : null}\r\n\t\t\t\t
    \r\n\t\t\t)}\r\n\t\t\tcloseModal={() => setOpenListModal(false)}\r\n\t\t>\r\n\t\t\t
      \r\n\t\t\t\t{results &&\r\n\t\t\t\t\tresults.results &&\r\n\t\t\t\t\tresults.results.map((shoppingList, index) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t handleAddToList(shoppingList.id)}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{shoppingList.name}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t
    \r\n\t\t\r\n\t);\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport { MY_ACCOUNT_LOGIN_URL } from 'features/my-account/routes.roc';\r\nimport React, { useEffect, useRef, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { getUserData } from 'services/UserData';\r\nimport { AddToListResponse } from 'services/UserData.Commerce';\r\nimport Modal from 'shared/components/Modal';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport CheckCircleSVG from 'shared/components/svg/CheckCircleSVG';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\nimport ShoppingListEditItem from '../my-account/shopping-lists/ShoppingListEditItem';\r\nimport { PrivacyType, PrivacyTypeOptions, ShoppingListDto } from '../my-account/shopping-lists/types';\r\nimport { useShoppingLists } from '../my-account/shopping-lists/useShoppingLists';\r\nimport AddedToListAlert from '../store/AddedToListAlert';\r\nimport ProductAddToListModal from './ProductAddToListModal';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { ProductAddOnDto, ProductType, Summary } from './types';\r\nimport { UseProductDetails } from './useProductDetails';\r\n\r\ninterface ProductAddToListProps {\r\n\tsummary?: Summary;\r\n\tid: string;\r\n\tisUserSignedIn: boolean;\r\n\tquantity: number | null;\r\n\tselectedProductPricingLineId: string | null;\r\n\taddOns?: ProductAddOnDto[];\r\n\taddOnsHandleSubmitWithError?: (error: AxiosError) => void;\r\n}\r\n\r\n/**\r\n * Represents the component on a product details page that adding a product to the user's shopping list.\r\n */\r\nexport default function ProductAddToList(props: ProductAddToListProps) {\r\n\tconst UseProductDetailsResult: UseProductDetails = useProductDetailsContext();\r\n\r\n\tconst {\r\n\t\tstate: { productDetails, selectedPricingLine },\r\n\t\tactor: { isPurchaseable },\r\n\t} = UseProductDetailsResult;\r\n\r\n\tconst [displaySelectionsErrorMessage, setDisplaySelectionsErrorMessage] = useState(false);\r\n\tconst [openListModal, setOpenListModal] = useState(false);\r\n\tconst [modalOpen, setModalOpen] = useState(false);\r\n\tconst [addToListResponse, setAddToListResponse] = useState(null);\r\n\tconst [confirmationPopupOpen, setConfirmationPopupOpen] = useState(false);\r\n\tconst [addingToList, setAddingToList] = useState(false);\r\n\r\n\tconst triggerRef = useRef(null);\r\n\r\n\tconst {\r\n\t\tstate: { isSaving, shoppingListBeingEdited, shoppingList, error, errorMessage },\r\n\t\tactor: { stopEditingShoppingList, saveShoppingList, beginCreateShoppingList, addProductToList },\r\n\t} = useShoppingLists();\r\n\r\n\tconst allSelectionsSelected = props.summary && props.summary.type === ProductType.Simple;\r\n\r\n\tconst cancelEditShoppingList = () => {\r\n\t\tstopEditingShoppingList();\r\n\t\tsetModalOpen(false);\r\n\t};\r\n\r\n\tconst onSaveShoppingList = async (formValues: ShoppingListDto) => {\r\n\t\tconst validationResult = await saveShoppingList(formValues);\r\n\t\tif (validationResult) {\r\n\t\t\treturn validationResult;\r\n\t\t} else {\r\n\t\t\tsetModalOpen(false);\r\n\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleListModal = async () => {\r\n\t\tif (!allSelectionsSelected) {\r\n\t\t\tsetDisplaySelectionsErrorMessage(true);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetDisplaySelectionsErrorMessage(false);\r\n\r\n\t\tif (props.isUserSignedIn) {\r\n\t\t\tif (openListModal) {\r\n\t\t\t\tsetOpenListModal(false);\r\n\t\t\t} else {\r\n\t\t\t\tsetOpenListModal(true);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twindow.location.href =\r\n\t\t\t\tMY_ACCOUNT_LOGIN_URL + '?ReturnUrl=' + encodeURIComponent(props.summary?.productUrl ?? '');\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleAddToList = async (shoppingListId) => {\r\n\t\tsetConfirmationPopupOpen(false);\r\n\r\n\t\ttry {\r\n\t\t\tconsole.debug('Adding to list:', props.id, shoppingListId);\r\n\t\t\tsetOpenListModal(false);\r\n\t\t\tsetAddingToList(true);\r\n\r\n\t\t\tconst response = await addProductToList({\r\n\t\t\t\titemId: props.id,\r\n\t\t\t\tquantity: props.quantity ?? 1,\r\n\t\t\t\tshoppingListId: shoppingListId,\r\n\t\t\t\tproductPricingLineId: props.selectedProductPricingLineId,\r\n\t\t\t\taddOns: props.addOns,\r\n\t\t\t});\r\n\r\n\t\t\tsetConfirmationPopupOpen(true);\r\n\r\n\t\t\tif (!response) {\r\n\t\t\t\tsetAddToListResponse(null);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tsetAddToListResponse(response);\r\n\t\t} catch (error) {\r\n\t\t\tsetAddToListResponse(null);\r\n\r\n\t\t\tconst axiosError: AxiosError = error;\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.status === 400 && axiosError.response.data) {\r\n\t\t\t\t//notify the add ons form with the validation errors\r\n\t\t\t\tif (props.addOnsHandleSubmitWithError) {\r\n\t\t\t\t\tprops.addOnsHandleSubmitWithError(axiosError);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsetAddingToList(false);\r\n\t\treturn;\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (allSelectionsSelected && displaySelectionsErrorMessage) {\r\n\t\t\tsetDisplaySelectionsErrorMessage(false);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [props.summary, displaySelectionsErrorMessage]);\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\ttry {\r\n\t\t\t\tconst data = (await getUserData()).data;\r\n\r\n\t\t\t\tif (!data?.summary?.organization) {\r\n\t\t\t\t\tconst organizationOption = PrivacyTypeOptions.find((s) => s.text === PrivacyType.Organization);\r\n\r\n\t\t\t\t\tif (organizationOption != undefined) {\r\n\t\t\t\t\t\tPrivacyTypeOptions.splice(PrivacyTypeOptions.indexOf(organizationOption));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Unable to load user data.', error);\r\n\t\t\t}\r\n\t\t})();\r\n\r\n\t\tif (!shoppingListBeingEdited) {\r\n\t\t\tbeginCreateShoppingList();\r\n\t\t}\r\n\t}, [shoppingListBeingEdited, beginCreateShoppingList]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (shoppingList) {\r\n\t\t\thandleAddToList(shoppingList.id);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [shoppingList]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t handleListModal()}\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tclassName=\"roc-btn roc-btn--big\"\r\n\t\t\t\tdisabled={\r\n\t\t\t\t\taddingToList ||\r\n\t\t\t\t\tprops.quantity == null ||\r\n\t\t\t\t\t!isPurchaseable(productDetails.availability, selectedPricingLine.pricingLine)\r\n\t\t\t\t}\r\n\t\t\t\tdata-testid=\"add-to-list-button\"\r\n\t\t\t\tref={triggerRef}\r\n\t\t\t>\r\n\t\t\t\t{Localizer('AddToList')}\r\n\t\t\t\t{addingToList && }\r\n\t\t\t\r\n\r\n\t\t\t{addToListResponse !== null ? (\r\n\t\t\t\t Localizer('AddedToList')}\r\n\t\t\t\t\tcloseModal={() => setConfirmationPopupOpen(false)}\r\n\t\t\t\t\ttitleIcon={}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{openListModal ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t Localizer('AddNewShoppingList')}\r\n\t\t\t\tcloseModal={() => setModalOpen(false)}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t{error != null || errorMessage ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{displaySelectionsErrorMessage ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport StarRating from 'shared/components/star-rating/StarRating';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { ReviewSummaryDto } from './types';\r\nimport { warnOnce } from 'util/console';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n//#region HCL\r\nimport { getUserData } from 'services/UserData';\r\n//#endregion\r\n\r\nenum TabType {\r\n\tReviews = 'Reviews',\r\n}\r\n\r\n/**\r\n * Placeholder for product review display\r\n */\r\nexport default function ProductRating() {\r\n\tlet reviewsSummary: ReviewSummaryDto;\r\n\tlet displayName: string = '';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\treviewsSummary: standardReviewsSummary,\r\n\t\t\tproductDetails: { tabs },\r\n\t\t},\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst hasReviewTab = tabs?.some((tabViewChunk) => tabViewChunk.tab.tabType === TabType.Reviews) === true;\r\n\r\n\tif (hasReviewTab && tabs) {\r\n\t\tconst reviewTabs = tabs.filter((t) => t.tab.tabType === TabType.Reviews);\r\n\t\treviewsSummary = (reviewTabs[0].model as any).reviewsSummary as ReviewSummaryDto;\r\n\t\tdisplayName = reviewTabs[0].tab.displayName;\r\n\t\tif (reviewTabs.length > 1) {\r\n\t\t\twarnOnce('Found more than one product reviews tab!');\r\n\t\t}\r\n\t} else {\r\n\t\treviewsSummary = standardReviewsSummary;\r\n\t}\r\n\r\n\tconst { averageRating, reviewCount } = reviewsSummary;\r\n\r\n\t//#region HCL\r\n\tconst [userIsSignedIn, setUserIsSignedIn] = useState(false);\r\n\r\n\tconst getUserIsSignedIn = async (): Promise => {\r\n\t\ttry {\r\n\t\t\tconst data = (await getUserData()).data;\r\n\t\t\treturn (data && data.summary && data.summary.isSignedIn) || false;\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Unable to load user data', error);\r\n\t\t}\r\n\t\treturn Promise.resolve(false);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tgetUserIsSignedIn().then((isSignedIn) => {\r\n\t\t\tsetUserIsSignedIn(isSignedIn);\r\n\t\t});\r\n\t}, []);\r\n\t//#endregion HCL\r\n\r\n\t/**\r\n\t * Handle clicking write a review button.\r\n\t */\r\n\tfunction handleBtnClick() {\r\n\t\tdispatchRocEvent('roc-reviews-write-review', {});\r\n\r\n\t\tconst reviewsTabs = document?.getElementsByClassName('roc-pdp-reviews-listing');\r\n\r\n\t\tconst reviews = reviewsTabs != null && reviewsTabs.length > 0 ? reviewsTabs[0] : null;\r\n\r\n\t\tif (reviews == null || !(reviews instanceof HTMLElement)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\twindow.scrollTo(0, reviews.offsetTop);\r\n\t}\r\n\r\n\tconst rating = Math.round(averageRating ?? 0);\r\n\r\n\tconst reviewText = hasReviewTab ? (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{reviewCount}{' '}\r\n\t\t\t\t{reviewCount === 0 || reviewCount > 1\r\n\t\t\t\t\t? Localizer('Reviews').toLowerCase()\r\n\t\t\t\t\t: Localizer('Review').toLowerCase()}\r\n\t\t\t\r\n\t\t\r\n\t) : (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t{reviewCount}{' '}\r\n\t\t\t\t{reviewCount === 0 || reviewCount > 1\r\n\t\t\t\t\t? Localizer('Reviews').toLowerCase()\r\n\t\t\t\t\t: Localizer('Review').toLowerCase()}\r\n\t\t\t\r\n\t\t\r\n\t);\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t{reviewText}\r\n\t\t\t\t{/* //#region HCL */}\r\n\t\t\t\t{hasReviewTab && userIsSignedIn ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{Localizer('WriteAReview')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t\t{/* //#endregion */}\r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n","const callLocations: { [index: string]: true | undefined } = {};\r\n\r\n/**\r\n * Logs a warning to the console once and ignores subsequent request from the same caller.\r\n */\r\nexport function warnOnce(message?: any, ...optionalParams: any[]): void {\r\n\tconst trace = (new Error().stack ?? 'Error\\n\\n').split('\\n')[2].trim();\r\n\r\n\tif (!callLocations[trace]) {\r\n\t\tcallLocations[trace] = true;\r\n\t\tconsole.warn(message, ...optionalParams);\r\n\t}\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { SimpleProduct, SelectionValue, ProductDetailSelection } from './types';\r\nimport { Localizer } from 'services/Localizer';\r\nimport classnames from 'classnames';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\nimport { NoPricingLine } from './ProductPricingLines';\r\n\r\ninterface ProductSelectionsProps {\r\n\tselections?: ProductDetailSelection[] | null;\r\n\tsimpleProducts?: SimpleProduct[] | null;\r\n\tonSimpleProductSelected: (simpleProduct: SimpleProduct) => void;\r\n\tonSimpleProductCleared: () => void;\r\n}\r\n\r\nconst getCheckedLabel = (selection: ProductDetailSelection) => {\r\n\tconst checkedValue = selection.values.find((value) => value.checked);\r\n\tif (!checkedValue) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn checkedValue.label;\r\n};\r\n\r\n/**\r\n * Handles all selections rendering and logic\r\n */\r\nexport default function ProductSelections(props: ProductSelectionsProps) {\r\n\tconst [selections, setSelections] = useState(props.selections || []);\r\n\tconst [isInitialLoad, setIsInitialLoad] = useState(true);\r\n\tconst [initialSelectionsValidated, setInitialSelectionsValidated] = useState(false);\r\n\r\n\tconst {\r\n\t\tactor: { setSelectedPricingLine },\r\n\t} = useProductDetailsContext();\r\n\r\n\tuseEffect(() => {\r\n\t\tconsole.debug('Selections Changed');\r\n\r\n\t\t// all selections picked?\r\n\t\t// determine child product match\r\n\t\tconst checkedSelections = selections.filter((selection) => {\r\n\t\t\treturn (\r\n\t\t\t\tselection.values.filter((selectionValue) => {\r\n\t\t\t\t\treturn selectionValue.checked;\r\n\t\t\t\t}).length > 0\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\tif (checkedSelections.length === selections.length) {\r\n\t\t\t// get all values selected by the user. ignore any that aren't selected to easily\r\n\t\t\t// determine by array length if all selections have been picked\r\n\t\t\tconst checkedSelectionValueIds = checkedSelections\r\n\t\t\t\t.map((checkedSelection) => {\r\n\t\t\t\t\tconst checkedSelectionValueMatch = checkedSelection.values.find(\r\n\t\t\t\t\t\t(checkedSelectionValue) => checkedSelectionValue.checked,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (!checkedSelectionValueMatch) {\r\n\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn checkedSelectionValueMatch.value;\r\n\t\t\t\t})\r\n\t\t\t\t.filter((checkedSelectionValueId) => checkedSelectionValueId);\r\n\r\n\t\t\tif (Array.isArray(props.simpleProducts)) {\r\n\t\t\t\tconst simpleProductMatch = props.simpleProducts.find((simpleProduct) => {\r\n\t\t\t\t\treturn simpleProduct.selections.every((simpleProductSelection) =>\r\n\t\t\t\t\t\tcheckedSelectionValueIds.includes(simpleProductSelection),\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (isInitialLoad) {\r\n\t\t\t\t\t// Need to update the selections to disable invalid selections, which causes this useEffect to run again\r\n\t\t\t\t\tif (!initialSelectionsValidated) {\r\n\t\t\t\t\t\tupdateValidSelections(selections);\r\n\t\t\t\t\t\tsetInitialSelectionsValidated(true);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// useEffect is running again after validating selections, don't need to do anything here\r\n\t\t\t\t\t\tsetIsInitialLoad(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (simpleProductMatch) {\r\n\t\t\t\t\tconsole.debug('Simple Product:', simpleProductMatch);\r\n\t\t\t\t\tprops.onSimpleProductSelected(simpleProductMatch);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprops.onSimpleProductCleared();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (isInitialLoad) {\r\n\t\t\t\t// #region HCL\r\n\t\t\t\tautoSelectFirstProduct();\r\n\t\t\t\t// #endregion\r\n\t\t\t\tsetInitialSelectionsValidated(true);\r\n\t\t\t\tsetIsInitialLoad(false);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tprops.onSimpleProductCleared();\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [selections, props.simpleProducts]);\r\n\r\n\tif (!Array.isArray(selections)) {\r\n\t\treturn null;\r\n\t}\r\n\t// checks for a matching path only, doesn't check for other factors, such as availability\r\n\tconst hasMatchingSimpleProduct = (values: string[], simpleProducts: SimpleProduct[]) => {\r\n\t\treturn simpleProducts.some((simpleProduct) => {\r\n\t\t\treturn values.every((matchingSelectionValue) => {\r\n\t\t\t\treturn simpleProduct.selections.includes(matchingSelectionValue);\r\n\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\t// #region HCL\r\n\tconst autoSelectFirstProduct = () => {\r\n\t\tif (Array.isArray(props.simpleProducts) && props.simpleProducts.length > 0 && selections.length > 0) {\r\n\t\t\tconst firstValidSelectionValue = selections[0].values.find((v) => v.valid);\r\n\r\n\t\t\tconst searchParams = new URLSearchParams(document.location.search);\r\n\t\t\tconst firstSimple =\r\n\t\t\t\tprops.simpleProducts.find((p) => p.sku === searchParams.get('keyword')) ??\r\n\t\t\t\tprops.simpleProducts.find((p) => p.selections.some((s) => s === firstValidSelectionValue?.value));\r\n\r\n\t\t\tif (firstSimple) {\r\n\t\t\t\tconsole.debug('Auto-selecting product:', firstSimple);\r\n\r\n\t\t\t\tfirstSimple.selections.forEach((selection) => {\r\n\t\t\t\t\tconst matchingSelection = selections.find((s) => s.values.some((v) => v.value === selection));\r\n\t\t\t\t\tif (matchingSelection) {\r\n\t\t\t\t\t\tconst matchingValue = matchingSelection.values.find((v) => v.value === selection);\r\n\t\t\t\t\t\tif (matchingValue) {\r\n\t\t\t\t\t\t\thandleSelection(matchingSelection, matchingValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t// #endregion\r\n\r\n\t/**\r\n\t * Update the valid/selectable product selections based on the selection state\r\n\t * @param selectionsToUpdate\r\n\t */\r\n\tconst updateValidSelections = (selectionsToUpdate: ProductDetailSelection[]) => {\r\n\t\tconst newSelections = [...selectionsToUpdate];\r\n\r\n\t\t// Store the currently chosen values\r\n\t\tconst checkedValues: Map = new Map();\r\n\t\tfor (const currSelection of newSelections) {\r\n\t\t\tfor (const currSelectionValue of currSelection.values) {\r\n\t\t\t\tif (currSelectionValue.checked) {\r\n\t\t\t\t\tcheckedValues.set(currSelection.label, currSelectionValue.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (const newSelection of newSelections) {\r\n\t\t\tfor (const newSelectionValue of newSelection.values) {\r\n\t\t\t\t// check if newSelectionValue + selected values from other selections has a matching child\r\n\t\t\t\tconsole.debug('Checking', newSelectionValue.value);\r\n\r\n\t\t\t\tlet hasValidPath: boolean | null = null;\r\n\r\n\t\t\t\tfor (const permutationSelection of newSelections) {\r\n\t\t\t\t\tif (permutationSelection === newSelection) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (const permutationSelectionValue of permutationSelection.values) {\r\n\t\t\t\t\t\tif (!permutationSelectionValue.checked) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check if adding the current selection to the list of selected values will still result in a valid product,\r\n\t\t\t\t\t\t// ignoring already selected values for the current selection\r\n\t\t\t\t\t\tconst valuesToCheck = new Map(checkedValues).set(newSelection.label, newSelectionValue.value);\r\n\t\t\t\t\t\tconst currentList = Array.from(valuesToCheck.values());\r\n\t\t\t\t\t\tconst hasMatch = hasMatchingSimpleProduct(currentList, props.simpleProducts || []);\r\n\t\t\t\t\t\thasValidPath = hasMatch;\r\n\r\n\t\t\t\t\t\tif (hasMatch) {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (hasValidPath !== null) {\r\n\t\t\t\t\tconsole.debug('Valid Path:', hasValidPath);\r\n\t\t\t\t\tnewSelectionValue.valid = hasValidPath;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnewSelectionValue.valid = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// updates state for all selections\r\n\t\tsetSelections(newSelections);\r\n\t};\r\n\r\n\tconst handleSelection = (selection: ProductDetailSelection, selectionValue: SelectionValue) => {\r\n\t\tif (selectionValue.checked) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetSelectedPricingLine(NoPricingLine);\r\n\t\tconst newSelections = [...selections];\r\n\t\tconst clickedSelectionValueIsValid = selectionValue.valid;\r\n\r\n\t\tconsole.debug('Selecting', selectionValue.label);\r\n\t\tconsole.debug('Clicked Valid Selection:', clickedSelectionValueIsValid);\r\n\r\n\t\t// 1. mark clicked selection as checked.\r\n\t\t// 2. if clicked selection is not valid, uncheck all other selections\r\n\t\t// 3. update all other selections for validity\r\n\t\tfor (const newSelection of newSelections) {\r\n\t\t\tfor (const newSelectionValue of newSelection.values) {\r\n\t\t\t\tif (selection === newSelection) {\r\n\t\t\t\t\t// matching selection of selection value clicked\r\n\t\t\t\t\tif (newSelectionValue === selectionValue) {\r\n\t\t\t\t\t\t// matching selection value clicked\r\n\t\t\t\t\t\tnewSelectionValue.checked = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnewSelectionValue.checked = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// if we clicked on a possibly invalid path, uncheck all other selections\r\n\t\t\t\t\tif (!clickedSelectionValueIsValid) {\r\n\t\t\t\t\t\tnewSelectionValue.checked = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconsole.debug('Simple Products:', props.simpleProducts);\r\n\r\n\t\t// check validity of all permutations\r\n\t\tupdateValidSelections(newSelections);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
    \r\n\t\t\t\t{Localizer('Selections')}\r\n\t\t\t\t{selections.map((selection, selectionIndex) => {\r\n\t\t\t\t\tconst selectionLabel = getCheckedLabel(selection);\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t\t{selection.label}{' '}\r\n\t\t\t\t\t\t\t\t{selectionLabel && ' - ' + getCheckedLabel(selection)}\r\n\t\t\t\t\t\t\t

    \r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t{selection.values.map((selectionValue, index) => {\r\n\t\t\t\t\t\t\t\t\t// #region HCL - swatch handling\r\n\t\t\t\t\t\t\t\t\tconst useSwatches = selection.values.some((v) => v.swatchUrl);\r\n\t\t\t\t\t\t\t\t\tconst selectionClassNames = useSwatches\r\n\t\t\t\t\t\t\t\t\t\t? 'roc-pdp-selections__item-label roc-pdp-selections__color roc-pdp-selections__color--' +\r\n\t\t\t\t\t\t\t\t\t\t selectionValue.label.toLowerCase()\r\n\t\t\t\t\t\t\t\t\t\t: 'roc-pdp-selections__item-label';\r\n\t\t\t\t\t\t\t\t\t// #endregion\r\n\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{/* #region HCL - swatches */}\r\n\t\t\t\t\t\t\t\t\t\t\t{useSwatches ? '' : selectionValue.label}\r\n\t\t\t\t\t\t\t\t\t\t\t{/* #endregion HCL */}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst match = selection.values.find(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t(value) => value.value === selectionValue.value,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (match) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleSelection(selection, match);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t
    \r\n\t\t\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { BasePartialDataOptions, BasePartialDetailsState, AvailableKeys, AdditionalParams } from 'shared/types';\r\n\r\ntype InitialStateLoader = () => unknown;\r\ntype PartialDataLoaderFn = (options: BasePartialDataOptions) => Promise>;\r\n\r\nexport interface PartialDataLoaderOptions {\r\n\tkeys: AvailableKeys;\r\n\tinitialState: unknown | InitialStateLoader;\r\n\tdataLoaderFn: PartialDataLoaderFn;\r\n}\r\n\r\nexport interface PartialDataLoaderState {\r\n\tpartialData: T;\r\n\tisLoading: boolean;\r\n}\r\n\r\nexport default function usePartialDataLoader(options: PartialDataLoaderOptions) {\r\n\tconst initialState = typeof options.initialState === 'function' ? options.initialState() : options.initialState;\r\n\tconst [partialData, setPartialData] = useState(initialState);\r\n\tconst [isLoading, setIsLoading] = useState(true);\r\n\tconst [hasError, setHasError] = useState(false);\r\n\r\n\t/**\r\n\t * Helper function to determine if the given chunk of partial (by key) data has been already loaded or if it is still loading.\r\n\t */\r\n\tfunction isKeyLoading(key: keyof T): boolean {\r\n\t\tif (partialData === undefined || partialData === null) {\r\n\t\t\treturn isLoading;\r\n\t\t}\r\n\r\n\t\tif (Object.keys(partialData).includes(key.toString()) && partialData[key] !== undefined) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn isLoading;\r\n\t}\r\n\r\n\t// we'd then make a request to the server to get the data for the missing keys.\r\n\tuseEffect(() => {\r\n\t\tconst providedKeys = Object.keys(partialData);\r\n\t\tconst requiredKeys = options.keys.map((literal) => literal.valueOf().toString()) as Array;\r\n\t\tconst missingKeys = requiredKeys.filter((value) => providedKeys.indexOf(value.valueOf().toString()) === -1);\r\n\t\tloadData(partialData.id, missingKeys, partialData.additionalParams);\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tasync function loadData(id: string, missingKeys: Array, additionalParams: AdditionalParams | undefined) {\r\n\t\ttry {\r\n\t\t\t// await timeout(1000);\r\n\t\t\tconsole.debug('Fetching missing data:', missingKeys);\r\n\t\t\tconst missingData = await options.dataLoaderFn({ id, missingKeys, additionalParams });\r\n\r\n\t\t\tconsole.debug('Missing data loaded:', missingData);\r\n\t\t\tsetPartialData({\r\n\t\t\t\t...partialData,\r\n\t\t\t\t...missingData,\r\n\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Unable to fetch remaining data.');\r\n\t\t\tsetHasError(true);\r\n\t\t} finally {\r\n\t\t\tsetIsLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tpartialData,\r\n\t\tisLoading: isKeyLoading,\r\n\t\tisLoadingAny: (keys: Array = []) => keys.some((key) => isKeyLoading(key)),\r\n\t\thasError,\r\n\t\tsetHasError,\r\n\t};\r\n}\r\n","import { useState } from 'react';\r\nimport usePartialDataLoader from 'shared/data/usePartialDataLoader';\r\nimport { CheckableLine, NoPricingLine } from './ProductPricingLines';\r\nimport {\r\n\tAvailability,\r\n\tgetInitialProductDetailsState,\r\n\tProductDetailsState,\r\n\tProductPartialDataLoaderOptions,\r\n\tProductPricingLine,\r\n\tProductType,\r\n\tReviewSummaryDto,\r\n\tTabViewChunk,\r\n} from './types';\r\n\r\nexport interface UseProductDetails {\r\n\tstate: UseProductDetailsState;\r\n\tactor: UseProductDetailsActor;\r\n}\r\n\r\n/**\r\n * Use Product Details Context State\r\n */\r\nexport interface UseProductDetailsState {\r\n\tloggedInUserFirstName: string;\r\n\tproductId: string;\r\n\tgroupId: string;\r\n\treviewsSummary: ReviewSummaryDto;\r\n\tsimpleProductLoading: boolean;\r\n\thasError: boolean;\r\n\tproductDetails: ProductDetailsState;\r\n\tproductStateOverride: Partial | null;\r\n\tuserIsSignedIn: boolean;\r\n\tproductQuantity: number | null;\r\n\tselectedPricingLine: CheckableLine;\r\n}\r\n\r\n/**\r\n * Use Product Details Context Actor\r\n */\r\nexport interface UseProductDetailsActor {\r\n\tsetLoggedInUserFirstName: (name: string) => void;\r\n\tsetSimpleProductLoading: (prop: boolean) => void;\r\n\tsetProductStateOverride: (data: Partial | null) => void;\r\n\tisLoadingAny: (keys: Array) => boolean;\r\n\tsetHasError: (hasError: boolean) => void;\r\n\tsetUserIsSignedIn: (isSignIn: boolean) => void;\r\n\tsetProductQuantity: (qty: number | null) => void;\r\n\tsetSelectedPricingLine: (CheckableLine: CheckableLine) => void;\r\n\tisPricingLineUnavailable: () => boolean;\r\n\tisPurchaseable: (availability?: Availability | null, pricingLine?: ProductPricingLine) => boolean;\r\n}\r\n\r\nexport interface UseProductDetailsProps {\r\n\tloaderOptions: ProductPartialDataLoaderOptions;\r\n}\r\n\r\n/**\r\n * Reusable hook to access product detail related endpoints on the server, as well as helping manage\r\n * product detail information.\r\n */\r\nexport default function useProductDetails(props: UseProductDetailsProps): UseProductDetails {\r\n\tconst { loaderOptions } = props;\r\n\r\n\t// to indicate that a simple product details are being loaded after selections are made\r\n\tconst [simpleProductLoading, setSimpleProductLoading] = useState(false);\r\n\tconst [loggedInUserFirstName, setLoggedInUserFirstName] = useState('');\r\n\r\n\t// defines state that can be used to override the existing state defined by initial state + partial loader\r\n\t// this is primarily used for group products, where a simple product takes over after a selection is made\r\n\tconst [productStateOverride, setInternalProductStateOverride] = useState | null>(null);\r\n\r\n\tconst [userIsSignedIn, setUserIsSignedIn] = useState(false);\r\n\tconst [productQuantity, setProductQuantity] = useState(1);\r\n\r\n\tconst [selectedPricingLine, setSelectedPricingLine] = useState(NoPricingLine);\r\n\r\n\tconst setProductStateOverride = (data: Partial | null) => {\r\n\t\tif (data == null) {\r\n\t\t\tsetInternalProductStateOverride(null);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst originalState = getInitialProductDetailsState();\r\n\r\n\t\tconst foldTabs = () => {\r\n\t\t\tconst newTabs = data.tabs != null ? [...data.tabs] : [];\r\n\t\t\tconst newTabsMap = newTabs.reduce(function (map: { [index: string]: TabViewChunk }, obj) {\r\n\t\t\t\tmap[obj.tab.id] = obj;\r\n\t\t\t\treturn map;\r\n\t\t\t}, {});\r\n\r\n\t\t\tfor (const oldTab of originalState?.tabs ?? []) {\r\n\t\t\t\tif (!newTabsMap[oldTab.tab.id]) {\r\n\t\t\t\t\tnewTabs.push(oldTab);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newTabs;\r\n\t\t};\r\n\r\n\t\tconst fixedNewState: Partial = {\r\n\t\t\t...data,\r\n\t\t\ttabs: foldTabs(),\r\n\t\t};\r\n\r\n\t\tsetInternalProductStateOverride(fixedNewState);\r\n\t};\r\n\r\n\t// this will grab the details from the server for you, and get you the state necessary\r\n\t// normally, we would just have all of the missing fields here, but sometimes, if we have multiple\r\n\t// integration calls, it may be good to be able to split this up. in this case, this is an example\r\n\t// of splitting up pricing/images and availability into separate calls.\r\n\t// this would apply if you have user-specific pricing, and the availability service is\r\n\t// really slow. you'd want to show pricing right away, and take time before showing availability\r\n\tconst productData = usePartialDataLoader({\r\n\t\tkeys: [\r\n\t\t\t'summary',\r\n\t\t\t'displayPricing',\r\n\t\t\t'pricingLines',\r\n\t\t\t'assets',\r\n\t\t\t'availability',\r\n\t\t\t'brand',\r\n\t\t\t'tabs',\r\n\t\t\t'selections',\r\n\t\t\t'relatedProducts',\r\n\t\t\t'reviewsSummary',\r\n\t\t\t'breadcrumbPath',\r\n\t\t\t'reviewsSummary',\r\n\t\t\t'addOns',\r\n\t\t],\r\n\t\t...loaderOptions,\r\n\t});\r\n\r\n\tconst { isLoadingAny, hasError, setHasError } = productData;\r\n\r\n\tconst productDetails = { ...productData.partialData, ...productStateOverride };\r\n\r\n\tconst groupId =\r\n\t\tproductDetails.summary.type === ProductType.Group\r\n\t\t\t? productDetails.id\r\n\t\t\t: productDetails.summary.productGroupId || '';\r\n\r\n\t/** Returns true if the selected pricing line is unavailable and can't be purchased. */\r\n\tconst isPricingLineUnavailable = () =>\r\n\t\tselectedPricingLine.pricingLine == null || selectedPricingLine.pricingLine?.unavailabilityReason != null;\r\n\r\n\tconst isPurchaseable = (availability?: Availability | null, pricingLine?: ProductPricingLine) => {\r\n\t\treturn availability?.outOfStock != true && pricingLine != null && pricingLine?.unavailabilityReason == null;\r\n\t};\r\n\r\n\treturn {\r\n\t\tstate: {\r\n\t\t\tloggedInUserFirstName,\r\n\t\t\tproductId: productDetails.id,\r\n\t\t\tgroupId,\r\n\t\t\treviewsSummary: productDetails.reviewsSummary,\r\n\t\t\tsimpleProductLoading,\r\n\t\t\tproductDetails,\r\n\t\t\tproductStateOverride,\r\n\t\t\thasError,\r\n\t\t\tuserIsSignedIn,\r\n\t\t\tproductQuantity,\r\n\t\t\tselectedPricingLine,\r\n\t\t},\r\n\t\tactor: {\r\n\t\t\tsetLoggedInUserFirstName,\r\n\t\t\tsetSimpleProductLoading,\r\n\t\t\tisLoadingAny,\r\n\t\t\tsetProductStateOverride,\r\n\t\t\tsetHasError,\r\n\t\t\tsetUserIsSignedIn,\r\n\t\t\tsetProductQuantity,\r\n\t\t\tsetSelectedPricingLine,\r\n\t\t\tisPricingLineUnavailable,\r\n\t\t\tisPurchaseable,\r\n\t\t},\r\n\t};\r\n}\r\n","import { MY_ACCOUNT_SHOPPING_LISTS_URL } from 'features/my-account/routes.commerce';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { useShoppingListLoader } from '../my-account/shopping-lists/useShoppingListLoader';\r\n\r\ninterface ProductListsProps {\r\n\tproductId: string;\r\n}\r\n\r\nexport default function ProductLists(props: ProductListsProps) {\r\n\tconst { results } = useShoppingListLoader({\r\n\t\tproductId: props.productId,\r\n\t});\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{/* #region HCL */}\r\n\t\t\t{results && results.results && results.results.length > 0 ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t

    {Localizer('DisplayListsLabel')}

    \r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t{results &&\r\n\t\t\t\t\t\t\tresults.results &&\r\n\t\t\t\t\t\t\tresults.results.map((shoppingList, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t(window.location.href = `${MY_ACCOUNT_SHOPPING_LISTS_URL}/${shoppingList.id}`)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{shoppingList.name}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t
    \r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\t{/* #endregion */}\r\n\t\t\r\n\t);\r\n}\r\n","import {\r\n\tPriceDisplayRule,\r\n\tSimpleDisplayPrice,\r\n\tAmbiguousDisplayPrice,\r\n} from '../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { GetPricingLine, GetPriceForQuantity } from '../pricing/pricing-result';\r\nimport { ProductDetailsState } from './types';\r\n\r\nexport const GetSalePercentageSummary = (productDetails: ProductDetailsState) => {\r\n\tif (productDetails.displayPricing == null) {\r\n\t\tthrow new Error(\"Display pricing was rendered when it wasn't ready!\");\r\n\t}\r\n\tconst selectedPricingLineId =\r\n\t\tproductDetails.pricingLines && productDetails.pricingLines.selected && productDetails.pricingLines.selected.id;\r\n\r\n\tconst displayPriceLine = GetPricingLine(productDetails.displayPricing, productDetails.id, selectedPricingLineId);\r\n\r\n\tconst displayPrice = displayPriceLine && GetPriceForQuantity(displayPriceLine.prices, 1);\r\n\r\n\tlet discount: number = 0;\r\n\r\n\tif (!displayPrice) {\r\n\t\treturn discount;\r\n\t}\r\n\tswitch (displayPrice.displayRule) {\r\n\t\tcase PriceDisplayRule.Normal:\r\n\t\t\tdiscount = getSimpleDiscount(displayPrice);\r\n\t\t\tbreak;\r\n\r\n\t\tcase PriceDisplayRule.AmbiguousRange:\r\n\t\t\tdiscount = getAmbiguousDiscount(displayPrice);\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn discount;\r\n};\r\n\r\nexport const getSimpleDiscount = (price: SimpleDisplayPrice) => {\r\n\tlet discount: number = 0;\r\n\tif (price.salePrice?.rawValue) {\r\n\t\tconst basePrice = Number(price.basePrice.rawValue);\r\n\t\tconst salePrice = Number(price.salePrice.rawValue);\r\n\r\n\t\tdiscount = 100 - (100 * salePrice) / basePrice;\r\n\t}\r\n\treturn Math.round(discount);\r\n};\r\n\r\nexport const getAmbiguousDiscount = (price: AmbiguousDisplayPrice) => {\r\n\tlet discount: number = 0;\r\n\tif (price.salePrice?.rawValue) {\r\n\t\tconst basePrice = Number(price.basePrice.rawValue);\r\n\t\tconst salePrice = Number(price.salePrice.rawValue);\r\n\r\n\t\tdiscount = 100 - (100 * salePrice) / basePrice;\r\n\t}\r\n\treturn Math.round(discount);\r\n};\r\n","import { GetPricingLine, ParseQuantityRange } from 'features/commerce/pricing/pricing-result';\r\nimport React from 'react';\r\nimport { Localizer } from 'services/Localizer';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport { DisplayPrice, VariantPrice } from '../../../../../Roc.SharedClientApp/types/commerce/display-price';\r\nimport { useProductDetailsContext } from './ProductDetailsContext';\r\n\r\ninterface QuantityBreak {\r\n\tmin: number;\r\n\tmax: number;\r\n\tprice: DisplayPrice;\r\n}\r\nexport function ProductPriceBreaks() {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst getAvailablePrices = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\t\tif (displayPriceLine == undefined) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn displayPriceLine.prices;\r\n\t};\r\n\tconst qtyRanges = new Array();\r\n\tconst availablePricing = getAvailablePrices();\r\n\tif (availablePricing == null || Object.keys(availablePricing).length == 1) {\r\n\t\treturn null;\r\n\t}\r\n\tfor (const qtyRange in availablePricing) {\r\n\t\tconst [min, max] = ParseQuantityRange(qtyRange);\r\n\t\tconst pricing = availablePricing[qtyRange];\r\n\t\tqtyRanges.push({ min: min, max: max, price: pricing });\r\n\t}\r\n\treturn (\r\n\t\t
    \r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{qtyRanges.map((qtyRange) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t
    {Localizer('MinimumBreak')}{Localizer('MaximumBreak')}{Localizer('NetPricePerUnit')}
    {qtyRange.max == Infinity ? <>{qtyRange.min + '+'} : <>{qtyRange.min}}{qtyRange.max == Infinity ? null : <>{qtyRange.max}}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport { GetPriceForQuantity, GetPricingLine } from 'features/commerce/pricing/pricing-result';\r\nimport arrayMutators from 'final-form-arrays';\r\nimport React, { useEffect, useState } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { ServerData } from 'services/ServerData';\r\nimport { getUserData, UserData } from 'services/UserData';\r\nimport { getTabDivElement, getTabLiElement } from 'shared-client/types/commerce/tabs';\r\nimport { lazyLoadImages } from 'shared/assets/lazy';\r\nimport Breadcrumbs from 'shared/components/Breadcrumbs';\r\nimport ProductPricing from 'shared/components/commerce/ProductPricing';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport RocForm from 'shared/edit/RocForm';\r\nimport useRocEventHandler, { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { handleAxiosErrorWithValidation } from 'shared/util/Misc';\r\nimport { SimpleProductsListing } from './AlternateProductDetails';\r\nimport { getPartialProductData } from './data';\r\nimport { AddOnsFormValues, getProductAddOnsComponent } from './ProductAddOns';\r\nimport ProductAddToCart from './ProductAddToCart';\r\nimport ProductAddToList from './ProductAddToList';\r\nimport ProductAssets from './ProductAssets';\r\nimport ProductDetailsContext, { useProductDetailsContext } from './ProductDetailsContext';\r\nimport ProductRating from './ProductRating';\r\nimport ProductSelections from './ProductSelections';\r\nimport {\r\n\tgetInitialProductDetailsState,\r\n\tProductAddOnDto,\r\n\tProductDetailsState,\r\n\tProductPartialDataLoaderOptions,\r\n\tProductType,\r\n\tTabViewChunk,\r\n} from './types';\r\nimport useProductDetails, { UseProductDetails } from './useProductDetails';\r\n// #region HCL\r\nimport ProductLists from './ProductLists';\r\nimport { GetSalePercentageSummary } from './data.HCL';\r\nimport { ProductPriceBreaks } from './ProductPriceBreaks';\r\n// #endregion\r\n\r\nconst loaderOptions: ProductPartialDataLoaderOptions = {\r\n\tinitialState: getInitialProductDetailsState,\r\n\tdataLoaderFn: getPartialProductData,\r\n};\r\n\r\n/**\r\n * Keys that will be requested from the server when the active product is changed (eg, the user changed selections)\r\n */\r\nconst missingKeys: Array = [\r\n\t'summary',\r\n\t'assets',\r\n\t'availability',\r\n\t'brand',\r\n\t'pricingLines',\r\n\t'displayPricing',\r\n\t'breadcrumbPath',\r\n\t'reviewsSummary',\r\n\t'tabs',\r\n\t'addOns',\r\n];\r\n\r\n/**\r\n * Main component that renders the product details using react portals\r\n */\r\nfunction ProductDetails() {\r\n\tconst UseProductDetailsResult: UseProductDetails = useProductDetails({ loaderOptions });\r\n\tconst [canGoBack, setCanGoBack] = useState('');\r\n\tconst {\r\n\t\tstate: { productDetails, groupId },\r\n\t\tactor: { setLoggedInUserFirstName, setUserIsSignedIn },\r\n\t} = UseProductDetailsResult;\r\n\r\n\tconst getLoggedInUserFirstName = async (): Promise => {\r\n\t\ttry {\r\n\t\t\tconst data = (await getUserData()).data;\r\n\t\t\tgetUserIsSignedIn(data);\r\n\t\t\treturn (data && data.summary && data.summary.firstName) || '';\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('Unable to load user data', error);\r\n\t\t}\r\n\t\treturn Promise.resolve('');\r\n\t};\r\n\r\n\tconst getUserIsSignedIn = (data: UserData) => {\r\n\t\tsetUserIsSignedIn((data && data.summary && data.summary.isSignedIn) || false);\r\n\t};\r\n\r\n\tuseRocEventHandler(\r\n\t\t'hawk-recs-widget-loaded',\r\n\t\t({ widgetGuid, hasItems }) => {\r\n\t\t\t// update tab visibility\r\n\t\t\tif (productDetails.tabs === undefined) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// select based on data attributes to prevent this from breaking due to customizations\r\n\t\t\tconst elements = document.querySelectorAll(`[data-tab-id] [data-widgetguid=\"${widgetGuid}\"]`);\r\n\r\n\t\t\tif (elements.length === 0) {\r\n\t\t\t\tconsole.warn(`No matches found for Widget Guid: ${widgetGuid}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\telements.forEach((el) => {\r\n\t\t\t\t// have to check for this again inside this closure\r\n\t\t\t\tif (productDetails.tabs === undefined) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// closest attempts to find the tab parent node.\r\n\t\t\t\tconst tabDiv = el.closest(`[data-tab-id]`);\r\n\t\t\t\tif (!tabDiv) {\r\n\t\t\t\t\tconsole.warn('Unable to find tab parent!');\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// grab the tab-id rendered by the server and find the matching tabChunk\r\n\t\t\t\tconst tabId = tabDiv.getAttribute('data-tab-id');\r\n\t\t\t\tconst tabChunk = productDetails.tabs.find((t) => t.tab.id === tabId);\r\n\r\n\t\t\t\tif (!tabChunk) {\r\n\t\t\t\t\tconsole.warn(`Unable to find tab (${tabId})`);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// let the magic happen\r\n\t\t\t\tupdateTabVisibility(tabChunk, hasItems);\r\n\t\t\t});\r\n\t\t},\r\n\t\t[],\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tgetLoggedInUserFirstName().then((firstName) => {\r\n\t\t\tsetLoggedInUserFirstName(firstName);\r\n\t\t});\r\n\r\n\t\tsetCanGoBack(sessionStorage.getItem('canGoBack') || '');\r\n\t\tsessionStorage.removeItem('canGoBack');\r\n\r\n\t\tdispatchRocEvent('product-viewed', {\r\n\t\t\tproductName: productDetails.summary.name,\r\n\t\t\tsku: productDetails.summary.sku,\r\n\t\t\tproductId: productDetails.id,\r\n\t\t\tproductGroupId: groupId !== '' ? groupId : null,\r\n\t\t\tselections: productDetails.selections ?? null,\r\n\t\t});\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t{productDetails.summary && productDetails.summary.useAlternateProductDetails ? (\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n\r\n//#region React Portals\r\n\r\n/**\r\n * Product page header containing the breadcrumbs\r\n * @param props\r\n */\r\nexport function ProductBreadcrumbs(props: { canGoBack: string }) {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst headerDom = document.getElementById('product-details-header');\r\n\tif (!headerDom) {\r\n\t\tconsole.warn('Header DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst breadcrumbComponent = (\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(breadcrumbComponent, headerDom);\r\n}\r\n\r\n/**\r\n * Product page media component, containing the product images\r\n */\r\nexport function ProductMedia() {\r\n\tconst {\r\n\t\tstate: { productDetails },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst mainLeftDom = document.getElementById('product-details-product-media');\r\n\tif (!mainLeftDom) {\r\n\t\tconsole.warn('Product media DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst productAssets = (\r\n\t\t<>\r\n\t\t\t{!isLoadingAny(['assets']) ? (\r\n\t\t\t\t// #region HCL\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t// #endregion\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productAssets, mainLeftDom);\r\n}\r\n\r\n/**\r\n * Product page main info header, containing the pricing and rating components\r\n */\r\nexport function ProductHeader() {\r\n\t// #region HCL -- added productQuantity\r\n\tconst {\r\n\t\tstate: { productDetails, hasError, productQuantity },\r\n\t\tactor: { isLoadingAny },\r\n\t} = useProductDetailsContext();\r\n\t// #endregion\r\n\r\n\tconst mainInfoHeaderDom = document.getElementById('product-details-main-info-header');\r\n\tif (!mainInfoHeaderDom) {\r\n\t\tconsole.warn('Main info header DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst getDetail = () => {\r\n\t\tif (productDetails.displayPricing == null) {\r\n\t\t\tthrow new Error(\"Display pricing was rendered when it wasn't ready!\");\r\n\t\t}\r\n\t\tconst selectedPricingLineId =\r\n\t\t\tproductDetails.pricingLines &&\r\n\t\t\tproductDetails.pricingLines.selected &&\r\n\t\t\tproductDetails.pricingLines.selected.id;\r\n\r\n\t\tconst displayPriceLine = GetPricingLine(\r\n\t\t\tproductDetails.displayPricing,\r\n\t\t\tproductDetails.id,\r\n\t\t\tselectedPricingLineId,\r\n\t\t);\r\n\r\n\t\t// #region HCL\r\n\t\treturn displayPriceLine && GetPriceForQuantity(displayPriceLine.prices, productQuantity ?? 1);\r\n\t\t// #endregion HCL\r\n\t};\r\n\r\n\tconst productHeaderInfo = (\r\n\t\t<>\r\n\t\t\t{!isLoadingAny(['displayPricing']) ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\t\r\n\t\t\t\t\t{/* #endregion */}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t) : !hasError ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{!isLoadingAny(['reviewsSummary']) ? : }\r\n\t\t\r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productHeaderInfo, mainInfoHeaderDom);\r\n}\r\n\r\n/**\r\n * Product page product selection component, which takes care of the logic and display\r\n * of the product selections and pricing lines / units of measure\r\n */\r\nexport function ProductSelectionsRegion() {\r\n\tconst [selectedProductPricingLineId, setSelectedProductPricingLineId] = useState(null);\r\n\tconst {\r\n\t\tstate: { productDetails, groupId, hasError, productStateOverride, userIsSignedIn, productQuantity },\r\n\t\tactor: { isLoadingAny, setSimpleProductLoading, setProductStateOverride, setHasError, setProductQuantity },\r\n\t} = useProductDetailsContext();\r\n\r\n\tconst [productAddOns, setProductAddOns] = useState();\r\n\tconst [childProductAddOnNames, setChildProductAddOnNames] = useState();\r\n\r\n\tuseEffect(() => {\r\n\t\tif (productDetails.addOns) {\r\n\t\t\tsetProductAddOns([...(productDetails.addOns.productAddOnData ?? [])]);\r\n\t\t\tsetChildProductAddOnNames([...(productDetails.addOns.availableChildProductAddOns ?? [])]);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [productDetails.addOns]);\r\n\r\n\tconst productSelectionsDom = document.getElementById('product-details-selections');\r\n\tif (!productSelectionsDom) {\r\n\t\tconsole.warn('Product selections DOM element not found.');\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst ProductAddOnsComponent = getProductAddOnsComponent();\r\n\r\n\tconst productSelections = (\r\n\t\t
    \r\n\t\t\t{!hasError ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!isLoadingAny(['selections']) && productDetails.selections && productDetails.children ? (\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tconsole.debug('Simple Product Selected:', simpleProduct.name);\r\n\r\n\t\t\t\t\t\t\t\tsetSimpleProductLoading(true);\r\n\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tconst simpleProductData = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\tid: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\tmissingKeys: missingKeys,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tconsole.debug('Simple Product Data:', simpleProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tconst newProductData: ProductDetailsState = {\r\n\t\t\t\t\t\t\t\t\t\t...productStateOverride,\r\n\t\t\t\t\t\t\t\t\t\t...productDetails,\r\n\t\t\t\t\t\t\t\t\t\t...simpleProductData,\r\n\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\tid: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\t...simpleProductData,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t// Function to change the url, title, product name, brand information, sku and manufacturer part number\r\n\t\t\t\t\t\t\t\t\tUpdateSSRData(newProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-selection-updated', {\r\n\t\t\t\t\t\t\t\t\t\tproduct: {\r\n\t\t\t\t\t\t\t\t\t\t\tproductId: simpleProduct.id,\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails: newProductData,\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\tsetHasError(error);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\tsetSimpleProductLoading(false);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tonSimpleProductCleared={async () => {\r\n\t\t\t\t\t\t\t\tsetSimpleProductLoading(true);\r\n\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\tconst groupProductData = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\tid: groupId,\r\n\t\t\t\t\t\t\t\t\t\tmissingKeys: missingKeys,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\tid: groupId,\r\n\t\t\t\t\t\t\t\t\t\t...groupProductData,\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t// Function to change the url, title, product name, brand information, and sku\r\n\t\t\t\t\t\t\t\t\tUpdateSSRData(groupProductData);\r\n\r\n\t\t\t\t\t\t\t\t\tconst newGroupProductData = {\r\n\t\t\t\t\t\t\t\t\t\t...productDetails,\r\n\t\t\t\t\t\t\t\t\t\t...groupProductData,\r\n\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\tdispatchRocEvent('product-selection-updated', {\r\n\t\t\t\t\t\t\t\t\t\tproduct: {\r\n\t\t\t\t\t\t\t\t\t\t\tproductId: groupId,\r\n\t\t\t\t\t\t\t\t\t\t\tproductDetails: newGroupProductData,\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\tsetHasError(error);\r\n\t\t\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\t\t\tsetSimpleProductLoading(false);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tinitialValues={{ addOns: productAddOns }}\r\n\t\t\t\t\t\tonSubmit={(values) => {\r\n\t\t\t\t\t\t\tif (values.axiosError) {\r\n\t\t\t\t\t\t\t\treturn handleAxiosErrorWithValidation(values.axiosError);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tmutators={{\r\n\t\t\t\t\t\t\t...arrayMutators,\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tsubscription={{\r\n\t\t\t\t\t\t\tsubmitting: true,\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tvalidateOnBlur={true}\r\n\t\t\t\t\t\trender={({ form, handleSubmit }) => {\r\n\t\t\t\t\t\t\tconst addOnsHandleSubmitWithError = (error: AxiosError) => {\r\n\t\t\t\t\t\t\t\t// `form.change` is synchronous, and we don't have access to anything except field values in the `onSubmit` function for the form,\r\n\t\t\t\t\t\t\t\t// so we store the error in the `axiosError` field, so we have access to it inside the `onSubmit` function and can handle it there\r\n\t\t\t\t\t\t\t\tform.change('axiosError', error);\r\n\t\t\t\t\t\t\t\thandleSubmit();\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{!isLoadingAny(['addOns']) && (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\t\t{!isLoadingAny(['pricingLines']) && (\r\n\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reload availability for the selected Unit of Measure\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst availability = await getPartialProductData({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid: productDetails.id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingKeys: ['availability'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tadditionalParams: {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tunitOfMeasureId: selectedPricingLineId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst selectedPricingLine =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tproductDetails.pricingLines &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tproductDetails.pricingLines.available.find(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(line) => line.id === selectedPricingLineId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!selectedPricingLine) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new Error('Invalid unit of measure selected');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// override state with and availability from the server\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// and selected unit of measure\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetProductStateOverride({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...productStateOverride,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...availability,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselections: productDetails.selections,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchildren: productDetails.children,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpricingLines: {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselected: selectedPricingLine,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tavailable: productDetails.pricingLines\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? productDetails.pricingLines.available\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: [],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetHasError(error);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\taddOns={productAddOns}\r\n\t\t\t\t\t\t\t\t\t\t\t\taddOnsHandleSubmitWithError={addOnsHandleSubmitWithError}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{/* #region HCL */}\r\n\t\t\t\t\t\t\t\t\t\t\t{userIsSignedIn && }\r\n\t\t\t\t\t\t\t\t\t\t\t{/* //#endregion */}\r\n\t\t\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t
    {Localizer('ErrorOccurredLoadingProductData')}
    \r\n\t\t\t)}\r\n\t\t
    \r\n\t);\r\n\r\n\treturn ReactDOM.createPortal(productSelections, productSelectionsDom);\r\n}\r\n\r\n//#endregion\r\n\r\nfunction updateTabContents(tabChunk: TabViewChunk) {\r\n\tconsole.debug('Updating tab contents:', tabChunk.tab.id);\r\n\r\n\t// Update SSR rendered HTML\r\n\tif (tabChunk.rawHtml == null) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst div = getTabDivElement(tabChunk.tab.id);\r\n\tconst li = getTabLiElement(tabChunk.tab.id);\r\n\tlet hidden = false;\r\n\r\n\tif (div != null) {\r\n\t\tdiv.outerHTML = tabChunk.rawHtml;\r\n\t\tconst mutatedDiv = getTabDivElement(tabChunk.tab.id);\r\n\t\tif (mutatedDiv?.classList.contains('roc-hidden')) {\r\n\t\t\thidden = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif (li != null) {\r\n\t\tli.className = hidden ? 'roc-hidden' : 'roc-pdp-sections__nav-item'; // This should match the values set in \\Roc.Web\\Features\\Commerce\\Products\\Index.cshtml\r\n\t}\r\n}\r\n\r\nfunction updateTabVisibility(tabChunk: TabViewChunk, visible: boolean) {\r\n\tconsole.debug('Updating tab visbility:', tabChunk.tab.id);\r\n\r\n\tconst div = getTabDivElement(tabChunk.tab.id);\r\n\tconst li = getTabLiElement(tabChunk.tab.id);\r\n\r\n\tif (div != null) {\r\n\t\tdiv.classList.toggle('roc-hidden', !visible);\r\n\t}\r\n\r\n\tif (li != null) {\r\n\t\tli.classList.toggle('roc-hidden', !visible);\r\n\t\tli.classList.toggle('roc-pdp-sections__nav-item', visible);\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that updates the data on the page that has been server-side rendered when a simple product is chosen\r\n * @param productData\r\n */\r\nfunction UpdateSSRData(productData: Partial) {\r\n\tconst { summary, brand } = productData;\r\n\r\n\t// update URL and page title\r\n\tif (summary?.meta?.pageTitle && ServerData.PageTitleSuffix) {\r\n\t\t// update the url and page title\r\n\t\twindow.history.replaceState('', summary.meta.pageTitle + ServerData.PageTitleSuffix, summary.productUrl);\r\n\r\n\t\t// replace state title is not working in chrome\r\n\t\tdocument.title = summary.meta.pageTitle + ServerData.PageTitleSuffix;\r\n\t}\r\n\r\n\t// Handle updating the product branding\r\n\tconst brandDiv = getElementByTestId('product-page-brand-div');\r\n\tconst brandName = getElementByTestId('product-page-brand-name');\r\n\tconst brandLogo = getElementByTestId('product-page-brand-logo') as HTMLImageElement;\r\n\r\n\tif (!brandDiv || !brandName || !brandLogo) {\r\n\t\tconsole.warn(\r\n\t\t\t'Could not find one of the following DOM elements to change:',\r\n\t\t\t'Brand enclosing div, Brand name, Brand logo',\r\n\t\t);\r\n\t} else {\r\n\t\tif (brand && brand.name) {\r\n\t\t\tbrandDiv.classList.remove('roc-hidden');\r\n\t\t\tbrandName.textContent = brand.name;\r\n\t\t\tif (brand.logoUrl) {\r\n\t\t\t\tbrandLogo.src = brand.logoUrl;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tbrandDiv.classList.add('roc-hidden');\r\n\t\t\tbrandName.textContent = '';\r\n\t\t\tbrandLogo.src = '';\r\n\t\t}\r\n\t}\r\n\r\n\t// update tabs with new ssr'd contents\r\n\tconst tabs = productData.tabs ?? [];\r\n\tif (tabs.length > 0) {\r\n\t\tfor (const tabChunk of tabs) {\r\n\t\t\tupdateTabContents(tabChunk);\r\n\t\t}\r\n\t}\r\n\r\n\t// Handle updating the product name, SKU text and Manufacturer Part Number text\r\n\tconst productName = getElementsByTestId('product-page-product-name');\r\n\r\n\tconst productSkuContainer = getElementByTestId('product-page-sku-container');\r\n\tconst productSkuText = getElementByTestId('product-page-sku-text');\r\n\tconst productSkuValue = getElementByTestId('product-page-sku-value');\r\n\r\n\tconst productMpnContainer = getElementByTestId('product-page-mpn-container');\r\n\tconst productMpnText = getElementByTestId('product-page-mpn-text');\r\n\tconst productMpnValue = getElementByTestId('product-page-mpn-value');\r\n\r\n\tif (!productName) {\r\n\t\tconsole.warn('Could not find the Product Name DOM element to change');\r\n\t} else if (summary != null) {\r\n\t\tproductName.forEach((element) => {\r\n\t\t\telement.textContent = summary.name;\r\n\t\t});\r\n\t}\r\n\r\n\tif (!productSkuContainer || !productSkuText || !productSkuValue) {\r\n\t\tconsole.warn('Could not find the Product SKU Container, Text, or Value DOM elements to change');\r\n\t} else {\r\n\t\tif (summary?.sku && summary.type != 'Group') {\r\n\t\t\tproductSkuContainer.classList.remove('roc-hidden');\r\n\t\t\t// #region HCL - replace SKU for ItemNumber\r\n\t\t\tproductSkuText.textContent = `${Localizer('ItemNumber')}:`;\r\n\t\t\t// #endregion\r\n\t\t\tproductSkuValue.textContent = summary.sku;\r\n\t\t} else {\r\n\t\t\tproductSkuContainer.classList.add('roc-hidden');\r\n\t\t\tproductSkuText.textContent = '';\r\n\t\t\tproductSkuValue.textContent = '';\r\n\t\t}\r\n\t}\r\n\r\n\tif (!productMpnContainer || !productMpnText || !productMpnValue) {\r\n\t\tconsole.warn(\r\n\t\t\t'Could not find the Product Manufacturer Part Number Container, Text, or Value DOM elements to change',\r\n\t\t);\r\n\t} else {\r\n\t\tif (summary?.manufacturerPartNumber) {\r\n\t\t\tproductMpnContainer.classList.remove('roc-hidden');\r\n\t\t\tproductMpnText.textContent = `${Localizer('ManufacturerPartNumber')}:`;\r\n\t\t\tproductMpnValue.textContent = summary.manufacturerPartNumber;\r\n\t\t} else {\r\n\t\t\tproductMpnContainer.classList.add('roc-hidden');\r\n\t\t\tproductMpnText.textContent = '';\r\n\t\t\tproductMpnValue.textContent = '';\r\n\t\t}\r\n\t}\r\n\r\n\t// #region HCL\r\n\tconst productGroupName = getElementsByTestId('product-page-parent-product-name');\r\n\r\n\tif (!productName) {\r\n\t\tconsole.warn('Could not find the Product Name DOM element to change');\r\n\t} else if (summary != null) {\r\n\t\tproductName.forEach((element) => {\r\n\t\t\telement.textContent = summary.name;\r\n\t\t});\r\n\t}\r\n\r\n\tif (!productGroupName) {\r\n\t\tconsole.warn('Could not find the Parent Product Name Container');\r\n\t} else if (summary != null) {\r\n\t\tproductGroupName.forEach((element) => {\r\n\t\t\tif (summary?.productGroupName) {\r\n\t\t\t\telement.classList.remove('roc-hidden');\r\n\t\t\t\telement.textContent = summary.productGroupName;\r\n\t\t\t} else {\r\n\t\t\t\telement.classList.add('roc-hidden');\r\n\t\t\t\telement.textContent = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t// #endregion\r\n\r\n\tlazyLoadImages();\r\n}\r\n\r\n/**\r\n * Simple helper function to get a DOM element by its data-testid attribute\r\n * @param testId\r\n */\r\nfunction getElementByTestId(testId: string): Element | null {\r\n\treturn document.querySelector(`[data-testid=\"${testId}\"]`);\r\n}\r\n\r\n/**\r\n * Simple helper function to get DOM elements by its data-testid attribute\r\n * @param testId\r\n */\r\nfunction getElementsByTestId(testId: string): NodeListOf | null {\r\n\treturn document.querySelectorAll(`[data-testid=\"${testId}\"]`);\r\n}\r\n\r\nexport default ProductDetails;\r\n","import React from 'react';\r\nimport { initReactApp } from 'shared/util/ApplicationInit';\r\nimport ProductDetails from './ProductDetails';\r\n\r\nconst render = initReactApp(() => , 'product-details');\r\n\r\nrender();\r\n\r\n// optional, use this to enable hot reloading\r\nif ((module as any).hot) {\r\n\t(module as any).hot.accept('./ProductDetails', () => {\r\n\t\trender();\r\n\t});\r\n}\r\n","import { useState } from 'react';\r\n\r\n/**\r\n * Custom hook for commonly used loading states.\r\n */\r\nexport function useLoader() {\r\n\tconst [loading, setLoading] = useState(false);\r\n\tconst [error, setError] = useState(undefined);\r\n\tconst [response, setResponse] = useState(null);\r\n\r\n\treturn {\r\n\t\tloading,\r\n\t\tsetLoading,\r\n\t\terror,\r\n\t\tsetError,\r\n\t\tresponse,\r\n\t\tsetResponse,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Folder SVG\r\n *\r\n * @returns\r\n */\r\nfunction FolderSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default FolderSVG;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\nfunction GarbageCanCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default GarbageCanCircleSVG;\r\n","import React from 'react';\r\nimport { ModelStatus } from '../../../../Roc.SharedClientApp/types/model-status';\r\nimport DashCircleSVG from './hawksearch/components/svg/DashCircleSVG';\r\nimport CheckCircleSVG from './svg/CheckCircleSVG';\r\nimport FolderSVG from './svg/FolderSVG';\r\nimport GarbageCanCircleSVG from './svg/GarbageCanCircleSVG';\r\nimport PencilSVG from './svg/PencilSVG';\r\n\r\ninterface PageEditorStatusDisplayProps {\r\n\tstatus: ModelStatus;\r\n}\r\n\r\nexport function StatusDisplay(props: PageEditorStatusDisplayProps) {\r\n\tconst { status } = props;\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{status === ModelStatus.Published ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Inactive ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Deleted ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Draft ? (\r\n\t\t\t\t\r\n\t\t\t) : status === ModelStatus.Archived ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t
    \r\n\t);\r\n}\r\n","/**\r\n * Organizations ui components enum\r\n */\r\nexport enum OrganizationUIComponents {\r\n\t//#region orders\r\n\tDefaultOrganizationOrderDetails = 'DefaultOrganizationOrderDetails',\r\n\t//#endregion\r\n}\r\n","import React from 'react';\r\nimport { Route } from 'react-router';\r\nimport { ServerData } from 'services/ServerData';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport { OrganizationUIComponents } from './OrganizationUIComponents';\r\n\r\nexport const ORGANIZATION_PREFIX = '/organization';\r\nexport const ORGANIZATION_OVERVIEW_URL = `${ORGANIZATION_PREFIX}`;\r\nexport const ORGANIZATION_USERS_URL = `${ORGANIZATION_PREFIX}/users`;\r\nexport const ORGANIZATION_USERS_CREATE_URL = `${ORGANIZATION_USERS_URL}/create`;\r\nexport const UPDATE_ORGANIZATION_USER_URL = `${ORGANIZATION_PREFIX}/user`;\r\nexport const UPDATE_USER_ORGANIZATION_STATUS_URL = `${UPDATE_ORGANIZATION_USER_URL}/organization-status`;\r\nexport const UPDATE_USER_DEFAULT_ORGANIZATION_URL = `/user/organization`;\r\nexport const INVALIDATE_USER_ORGANIZATION_NOTIFICATION_CACHE_URL = `${UPDATE_USER_DEFAULT_ORGANIZATION_URL}/cache`;\r\nexport const ORGANIZATION_ORDERS_URL = `${ORGANIZATION_PREFIX}/orders`;\r\nexport const ORGANIZATION_SHIPTOS_URL = `${ORGANIZATION_PREFIX}/ship-to`;\r\nexport const ORGANIZATION_ORDER_DETAILS = `${ORGANIZATION_ORDERS_URL}/:orderNo`;\r\nexport const ORGANIZATION_MANAGE_SHIPTOS_URL = ''; // TBD\r\n\r\nconst OrganizationOrderDetailsComponent = React.lazy(() => {\r\n\tconst orderDetailsComponent =\r\n\t\tServerData?.OrderDetailsUIComponent && ServerData?.OrderDetailsUIComponent in OrganizationUIComponents\r\n\t\t\t? ServerData.OrderDetailsUIComponent\r\n\t\t\t: OrganizationUIComponents.DefaultOrganizationOrderDetails;\r\n\treturn import(/* webpackChunkName: \"organization-order-details\" */ `./orders/${orderDetailsComponent}`);\r\n});\r\n\r\nconst ShiptosComponent = React.lazy(() => import(/* webpackChunkName: \"ship-to\" */ './ship-to/OrganizationShipTos'));\r\n\r\nconst UsersComponent = React.lazy(() => import(/* webpackChunkName: \"org-users\" */ './users/OrganizationUsers'));\r\n\r\nconst OrganizationOrdersComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-orders\" */ './orders/OrganizationOrders'),\r\n);\r\n\r\nconst OrganizationUsersCreateComponent = React.lazy(\r\n\t() => import(/* webpackChunkName: \"org-users-create\" */ './users/OrganizationUsersCreate'),\r\n);\r\n\r\nexport default (\r\n\t}>\r\n\t\t{/* ROC-3667 temporary hidden\r\n\t\t */}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\r\n);\r\n"],"sourceRoot":""}