{"version":3,"sources":["components/Localization/keys.js","components/UI/LoadingPage.js","components/Localization/LocalizationInit.js","api.js","util/Convert.js","components/data/makeConnectTo.js","components/data/CustomerIDStore.js","components/UI/BooksellerLogo/LogoShape.js","components/data/BooksellerLogoStore.js","components/data/BooksellerContentDataStore.js","unsubscribe/index.js","components/data/combineConnectors.js","components/data/CustomerSummaryDataStore.js","util/index.js","components/data/SectionsDataStore.js","components/data/OrganizationDataStore.js","dateFormats/index.js","components/data/TransactionsDataStore.js","components/Navigation/HeaderLayout.js","assets/images/login_page_image.jpg","components/data/BooksellerPreferencesDataStore.js","components/Bag/data/BagDataStore.js","components/context/ContextAggregator.js","components/data/RatingsAndReviewsDataStore.js","components/data/GlobalDataStoresLoader.js","components/Auth/AuthProvider.js","components/data/GlobalDataStores.js","components/context/WindowSize.js","components/UI/Error/ErrorBoundary.js","auth/authOptions.js","components/AppFrame.js","title/TitleAggregateParser.js","components/Collection/data/CollectionStore.js","components/hoc/withIsMobile.js","components/UI/PageTitle.js","components/Collection/UI/CollectionHeader.js","components/Collection/UI/CollectionOverview.js","components/Wishlist/data/WishlistSkusDataStore.js","entity/CustomerListType.js","components/data/CustomerEntitiesController.js","entity/RecommendableEntity.js","author/author.utils.js","components/CustomerFavorites/data/CustomerFavoritesDataStoreBase.js","components/CustomerFavorites/data/CustomerFavoritesDataStore.js","components/Collection/UI/CollectionTitleSkeletons.js","components/Collection/UI/CollectionTitlesWrapper.js","types/Review.js","components/hooks/useImage.js","types/Title.js","types/Series.js","types/Author.js","types/TitleAttributes.js","types/RecommendableEntity.js","components/hooks/useMounted.js","components/Title/UI/TitleSkeleton.js","assets/images/no_image_jacket.png","components/Title/UI/NoJacketImage.js","components/Title/UI/TitleJacketImage.js","components/UI/TextTruncator.js","components/CustomerFavorites/UI/FavoriteEntityIndicator.js","components/CustomerFavorites/UI/FavoriteButton.js","components/CustomerFavorites/UI/FavoriteEntityAnchor.js","components/Title/UI/TitleCard.js","components/UI/DrawerAnchor.js","components/UI/DetailDrawerAnchor.js","components/UI/LaneContainer.js","components/Title/UI/PublisherContent.js","components/Title/data/TitleDataStore.js","components/Wishlist/WishlistController.js","util/delay.js","components/Title/TitleFormatDescription.js","util/titleUtility.js","components/data/TitleLanesDataStore.js","entity/RetailTitleLaneType.js","components/UI/ArrowUpIcon.js","components/Wishlist/UI/CopyLinkToWishlistAnchor.js","components/Wishlist/data/WishlistLaneDataStore.js","components/Wishlist/WishlistButton.js","components/context/DrawerContext.js","paths.js","components/Bag/UI/BagBuyNowButton.js","components/Title/Buy/BuyFromThirdPartyButton.js","components/Bag/data/useRemoveFromBag.js","components/Bag/UI/BagControllerButton.js","components/Title/Buy/BuyTitleButton.js","components/Title/UI/BuyOrReviewButton.js","components/Title/UI/CopyLinkToTitleAnchor.js","components/Title/UI/TitleActionButtons.js","components/StaffPicks/UI/StaffReview.js","components/StaffPicks/data/StaffPicksDataStore.js","components/StaffPicks/UI/StaffProfile.js","components/Title/UI/TitleDescription.js","components/Wishlist/UI/WishlistEntityIndicator.js","components/Rewards/UI/PurchasedEntityIndicator.js","components/Bag/UI/BagEntityIndicator.js","components/UI/TitleJacketImageWithIconBadges.js","components/TitleLanes/AllAvailableTitles.js","components/StaffPicks/Drawers/StaffPicksDetail.js","components/StaffPicks/UI/StaffUserAvatar.js","components/Title/data/TitleIndiePicksDataStore.js","components/StaffPicks/UI/IndieReview.js","components/Title/UI/TitleIndiePicks.js","components/UI/Scroller/ScrollerType.js","components/UI/Scroller/ScrollerConfigContext.js","components/UI/Scroller/Scroller.js","components/TitleLanes/TitleSkeletons.js","components/TitleLanes/TitleScroller.js","components/TitleLanes/ShowingTitlesCount.js","components/TitleLanes/index.js","components/Title/Related/data/RelatedDataStore.js","components/Title/Related/RelatedTitlesLane.js","components/RateAndReview/ReviewDisplay.js","components/RateAndReview/ReviewInput.js","components/RateAndReview/RateAndReview.js","components/Rewards/UI/TitleInset.js","components/RecentlyViewed/data/RecentlyViewedDataStoreBase.js","components/RecentlyViewed/data/RecentlyViewedDataStore.js","components/RecentlyViewed/RecentlyViewedEntity.js","components/Title/TitleDetail.js","components/Title/TitleDetailDrawer.js","components/Title/UI/TitleListPrice.js","components/Title/UI/FamilyTitlesDropdown/FamilyTitlesDropdown.js","components/Title/UI/TitleSummary.js","components/Collection/UI/CollectionTitleCard.js","components/Collection/UI/CollectionTitle.js","components/Collection/CollectionLanding.js","components/Unsubscribe/UI/UpdateConfirmation.js","components/Unsubscribe/Services/UnsubscribeService.js","messageFrequency/index.js","components/Unsubscribe/data/MessageFrequencyDataStore.js","components/Unsubscribe/Services/EmailFrequencyService.js","components/Series/UI/SeriesAutocompleteRow.js","components/Series/UI/SeriesAutocomplete.js","components/CustomerFavorites/FavoriteType.js","components/CustomerFavorites/UI/FavoriteTitlesDrawer.js","components/Series/UI/SeriesScroller.js","components/CustomerFavorites/RemoveFavoriteController.js","components/CustomerFavorites/SeriesFavorites/SeriesFavoritesLane.js","entity/SectionLevel.js","components/Section/UI/SectionAutocomplete.js","components/CustomerFavorites/UI/RemoveGenreFavoriteButton.js","components/Section/UI/SectionsScroller.js","components/CustomerFavorites/ShelfFavorites/ShelfFavoritesLane.js","components/Title/UI/TitleAutocomplete.js","components/CustomerFavorites/TitleFavorites/TitleFavoritesLane.js","components/Authors/UI/AuthorAutocompleteRow.js","components/Authors/UI/AuthorsAutocomplete.js","components/Authors/UI/AuthorCard.js","components/Authors/UI/AuthorsScroller.js","components/CustomerFavorites/AuthorFavorites/AuthorFavoritesLane.js","components/CustomerFavorites/CustomerFavoritesService.js","components/Unsubscribe/UnsubscribePage.js","components/Unsubscribe/UnsubscribePageRoot.js","components/RecentShelves/RecentShelvesTitleLanes.js","entity/StaffPickLaneType.js","components/StaffPicks/StaffPicksBySectionLane.js","components/StaffPicks/StaffPicksByMemberLane.js","components/StaffPicks/StaffPicksSummary.js","title/TitleStatus.js","components/Title/Search/BrowseTitleAutocompleteRow.js","components/Title/Search/BrowseTitleAutocomplete.js","components/Title/Search/SearchResultsTitleScroller.js","components/Title/Search/TitleLanesByStatus.js","components/Title/Search/DetailedTitleSearch.js","components/Title/Search/TitleSearchService.js","components/Section/data/SectionTitleLanesDataStore.js","components/BrowseShelves/Shelves.js","components/BrowseShelves/BrowseShelvesPage.js","components/UI/Overlay.js","components/FileUpload/Image/ImageUploadDataStore.js","components/FileUpload/Image/ImageUploadAnchor.js","components/FileUpload/SplashImage/SplashUploadAnchor.js","components/FileUpload/SplashImage/hooks/useSplashImageController.js","components/FileUpload/SplashImage/SaveUploadedSplashButton.js","components/FileUpload/SplashImage/DeleteSplashButton.js","components/FileUpload/SplashImage/SplashImageUpload.js","components/FileUpload/SplashImage/index.js","components/UI/BooksellerSplashImage.js","components/Wishlist/WishlistTitlesLane.js","components/Organization/StoreLocationInfoEnum.js","components/Organization/StoreLocationInfo.js","components/Organization/OrganizationInfo.js","components/Rewards/RewardsProgress.js","components/RecentlyViewed/RecentlyViewedLane.js","components/Home/HomePage.js","components/Home/HomePageRoot.js","components/Section/SectionHeader.js","components/Section/SectionPopover.js","components/Section/SectionHome.js","components/Rewards/data/TransactionDetailsDataStore.js","components/Rewards/TransactionsList.js","components/Rewards/RewardsPage.js","components/Wishlist/UI/WishlistCollectionPageHeader.js","components/Wishlist/data/WishlistCollectionPageDataStores.js","components/Wishlist/UI/WishlistPageError.js","components/Wishlist/WishlistCollectionPage.js","components/Wishlist/data/useReferralWishlistTitles.js","components/Bag/data/useBagDataTotalAmount.js","components/Localization/useLocalizedCurrencyCode.js","components/Localization/LocalizedPrice.js","components/Bag/UI/RemoveFromBagAnchor.js","components/Bag/UI/BagTitleFormat.js","components/Bag/UI/BagItemQuantitySelect.js","components/Bag/UI/BagOrderTitleSummary.js","components/Bag/UI/BagOrderTitleSummaries.js","components/Bag/UI/BagTotal.js","components/Bag/UI/AddTitlesAutocomplete.js","components/Order/UI/OrderLaneContainer.js","orders/DeliveryMode.js","components/Order/OrderTotalBreakdown.js","components/hooks/useTaxes.js","orders/OrderProvider.js","orders/AddressType.js","orders/PreferredContactMethod.js","components/Order/data/usePayPalOrders.js","components/Order/PayPalOrderButton.js","components/Order/OrderPage.js","components/Auth/Login.js","components/Auth/Logout.js","components/CustomerAccount/Purchases/PurchaseDetail.js","components/CustomerAccount/Purchases/MyPurchases.js","components/CustomerAccount/Purchases/MyPurchasesDrawerAnchor.js","components/CustomerAccount/Auth/AuthAnchor.js","components/CustomerAccount/UI/CustomerAvatar.js","components/CustomerAccount/UI/CustomerHeader.js","components/CustomerAccount/Reviews/ReviewDetail.js","components/CustomerAccount/Reviews/MyReviews.js","components/CustomerAccount/Reviews/MyReviewsDrawerAnchor.js","components/CustomerAccount/OrderPerferences/MyOrderPreferences.js","components/CustomerAccount/OrderPerferences/MyOrderPerferencesDrawerAnchor.js","components/CustomerAccount/UI/AccountAnchor.js","components/CustomerAccount/AccountPage.js","components/Campaign/UI/IFrameRenderer.js","components/UI/PreviewModeAlert.js","components/Bag/UI/BagAnchor.js","components/Navigation/NavigationAnchorRoot.js","components/hooks/useActiveRoute.js","assets/images/stacked_books.png","components/UI/SignUpModal.js","components/Navigation/SignUpPopover.js","components/Navigation/NavigationAnchor.js","components/Navigation/NavigationItems.js","components/UI/BooksellerLogo/BooksellerLogo.js","components/Navigation/ClassicHeaderLayout.js","components/Navigation/OverlapHeaderLayout.js","components/Navigation/HeaderMargin.js","components/UI/RetailerMessage.js","components/Navigation/LandingHeader.js","components/Navigation/LandingFooter.js","components/Navigation/Page.js","components/Campaign/CampaignEmailPreviewPage.js","components/Campaign/data/useCampaign.js","components/Subscribe/SubscribeForm/SubscribeForm.tsx","components/Subscribe/SubscribePage/SubscribePage.tsx","components/AppSwitch.js","App.js","serviceWorker.js","index.js"],"names":["coreKeys","LoadingPage","style","spinning","marginLeft","defaultProps","padding","fontSize","WrappedInit","withRouter","withLocalize","LocalizationInitializer","LocalizationInit","getLocalizationApiUrl","process","url","this","localizationKeys","keys","localizationApiUrl","isLoadingTranslations","props","children","React","Component","setupApiFetcher","urlPrefix","config","ApiFetcher","api","e360Api","Convert","input","toString","asNum","parseInt","Number","isNaN","Context","nameOfDataStore","mapStoreToProps","Consumer","dataStore","storeProps","fallbackProps","CustomerIDContext","createContext","connectToCustomerID","makeConnectTo","useCustomerID","useContext","notifyUserOfPreviewMode","translate","notification","info","message","connectToPreviewMode","customerState","previewMode","notify","isActive","isPreviewMode","withIsUnknownCustomer","isUnknownCustomer","isValidReferralSource","state","referralSourceOrgId","referralSourceCustomerId","withIsDemoBookstore","isDemoBookstore","orgId","unknownCustomerId","CustomerIDStore","customerId","emailAddress","messageId","isLoading","domainSourceOrgId","referralSourceEmailAddress","getDataStore","toNumber","referralSource","email","isValidReferral","setCustomerId","setState","handleDecryptedIds","decryptedStr","queryString","parse","getCustomerIdToSet","hasStoredRefferalSourceToken","localStorage","getItem","handleParsedReferralSourceToken","encryptedToken","a","identityIsStored","localStorageHasIdentityToken","hasIdentityInUrl","urlContainsValidIdentityTokenParameter","isKnownCustomer","getNextState","setItem","identityDataToken","getIdentityTokenToDecrypt","post","decrypted","identity","Provider","value","retrieveOrgId","retrieveCustomerId","retrieveMessageIdAndSetInState","getOrgFromUrl","hasEncodedIdValuesInUrl","hasReferralSourceToken","urlHasReferralSourceToken","parseIdValuesInUrl","parseReferralSourceFromUrl","getIdentityTokenFromLocalStorage","deriveIdentityFromStoredReferralSource","Error","hasValidLocation","toDecrypt","getIdentityTokenToDecryptFromUrl","decryptEncodedIdentityAndSetInState","searchString","location","search","urlHasIdentityToken","isInUrl","indexOf","isStored","id","data","loc","length","urlContainsParameter","then","parsedOrgId","parsedCustomerId","domain","window","hostname","store","catch","error","referralsource","setStateWithReferralSource","refSourceToken","param","LogoShape","LogoContext","connectToLogo","useBooksellerLogoDataStore","ImageType","BooksellerLogoStore","logoUri","splashUri","isLoadingSplash","splashPreviewSource","logoShape","splashIsVisible","getLogoUri","getSplashImage","setSplashUri","uri","getSplashPreviewSource","hasSplashImage","setSplashPreviewSource","base64","clearSplashPreview","hasSplashPreview","setLogoShape","dimensions","getLogoShape","setSplashVisbility","bool","getSplashVisibility","cacheLogoUri","cacheSplashUri","fetchLogoCancelable","imageType","cancelableGet","height","width","Math","abs","fetchBooksellerLogo","fetchBooksellerSplash","logoFetch","splashFetch","forEach","r","revoke","promise","err","console","ContentContext","useBooksellerContentDataStore","connectToSellerContent","bcs","booksellerContentStore","contentTypes","storeInfo","customerApp","BooksellerContentDataStore","location1","locationName","address","hours","phoneNumber","links","retailerMessageBody","retailerMessageTitle","staffBios","getStoreLocations","Object","filter","key","includes","map","fetchBooksellerContent","booksellerContent","values","contentType","endpoint","contentFetch","get","Promise","all","contentPairs","pairs","i","parseContentIntoState","contentTypeName","split","content","parsedContent","parseStoreLocations","parseContentPairs","c","reduce","acc","set","cp","JSON","cancel","UnsubscribeScope","UnsubscribeEventType","combineConnectors","connectors","WrappedComponent","connect","CustomerSummaryContext","connectToCustomer","useCustomerSummaryDataStore","CustomerSummaryDataStore","customerSummary","unsubscribes","getFullName","getFirstName","firstName","getLastName","lastName","getEmailAddress","saveUnsubscribe","reason","saveReSubscribe","isUnsubscribedFromRecommendationEmails","fetchCustomerSummary","summary","request","nextEndpoint","dto","makeUnsubscribeDTO","updateSubscriptionState","makeReSubscribeDTO","subscribeDTO","scope","method","eventType","Array","isArray","getPreviewModeCustomerSummary","emailAdd","favorites","firstPurchase","hasEmail","lastPurchase","loyaltyExpiration","recencySegment","recommendationExclusions","transactions","volumeSegment","getUnknownCustomerSummary","setPreviewModeCustomer","setUnknownCustomer","prevProps","groupBy","sourceArray","property","accumulator","nextItemInSourceArray","valueAtProperty","push","SectionsContext","connectToSections","useSectionsDataStore","SectionsDataStore","isLoadingRecent","sections","departments","sectionsById","departmentsById","recentSectionIds","getSections","getDepartments","getRecentSectionIds","secId","getSection","sectionId","getSectionFromSectionCode","sectionCode","find","s","getDepartment","deptId","isSection","entityId","isDepartment","fetchRecentSectionIds","rs","fetchSections","response","nextState","buildSectionsAndDepartments","topSectionIds","getSectionsWithMostTransactions","section","nSectionsRequired","sortSectionsByBestSelling","slice","res","sortSectionsByName","buildSectionsById","buildDepartments","getOtherDepartment","departmentId","departmentName","sectionsStore","ensureAllSectionsHaveDeptId","sectionsGroupedByDeptId","Util","depts","countOfSections","sort","b","localeCompare","sec","sectionName","cloneDeep","OrgContext","connectToOrg","useOrganizationDataStore","OrganizationDataStore","organization","preferenceData","ordersSettings","shippingMethods","getOrgName","getOrgCountry","country","getOrgShippingMethods","hasOrgName","displayName","name","preferredName","isValidOrgName","fetchOrg","fetchPreferenceData","fetchShippingMethods","prevState","prevHasOrgName","thisHasOrgName","document","title","FullDateFormatNoDayOfWeek","year","month","day","TransactionsContext","connectToTransactions","useTransactionsDataStore","TransactionsDataStore","transactionsData","skus","skuPosData","skuUris","sku","purchasesIncludeSku","getSkuTransactions","countTransactions","getSkus","fetchTransactions","transactionsFetch","cacheApiResponse","apiResponse","getTransactionsData","t","productImageUrisBySku","copies","recentPurchase","Date","purchaseDate","toLocaleDateString","transaction","qty","date","number","tr","HeaderLayout","customerAppPrefType","PreferencesContext","connectToSellerPreferences","useBooksellerPreferencesDataStore","useBooksellerAppSettings","getAppSettings","defaultLoginPageImage","origin","loginPageImage","appSettingsByKey","initialAppSettings","appHeaderLogo","doIncludeCommerce","doShowBookstoreLoyaltyPopup","doShowBrowseShelvesPage","doShowMessageOnExplorePageOnly","gradientColor","headerColor","headerLayout","iconColor","paypalEmailAdddress","primaryFont","primaryColor","staffReviewers","textColor","BooksellerPreferencesDataStore","customerAppSettings","getAppSettingAtKey","getGradient","getStaffReviewerIds","fetchCustomerAppPreferences","fetchPreferencesOfType","preferenceDTOs","buildPreferencePairs","preferencesByName","addCustomStyling","type","preferenceDTO","parseOneSettingValue","settingValue","isNumeric","getFontFamily","fontFamily","e","varsToModify","require","load","google","families","less","modifyVars","sellerGradient","join","reviewerIds","BagContext","useBagDataStore","connectToBag","shoppingCartGuidKey","BagDataStore","bagItems","getTitles","hasItems","save","recommendableEntity","remove","refresh","fetchCustomerCheckoutBag","getTotalEntitiesCount","getQuantitiesBySku","updateQuantity","item","quantity","getShoppingCartGuid","product","author","imageUri","productImageUri","entity","guid","shoppingCart","items","newShoppingCart","shoppingCartItem","shoppingCartGuid","getBagItem","cartItemToDelete","call","getBagItemCount","removeItem","nextQuantity","itemToUpdate","put","updatedItem","nextBagItems","quantitiesBySku","bagDataStore","appSettings","hasShoppingCart","didCompleteOrder","ContextAggregator","componentConfigs","WrappedChild","componentConfig","component","C","RatingsAndReviewsContext","connectToRatingsAndReviews","RatingsAndReviewsDataStore","reviews","fetchAllReviewsByCustomer","review","saveOneRatingOrReview","update","updateOneRatingOrReview","deleteOneRatingOrReview","getRating","getReview","customerReviewDTO","getRatingOrReviewDTOFromEntity","requestDelete","entityType","ratings","customerRatings","entityRating","rating","customerReviews","entityReview","GlobalDataStoresLoader","logoDataStore","contentsDataStore","customerSummaryDataStore","sectionsDataStore","organizationDataStore","preferencesDataStore","dataStores","dataStoresDidLoad","AuthContext","AuthProvider","authOptions","oidcClientOptions","useState","isAuthenticating","setIsAuthenticating","isAuthenticated","setIsAuthenticated","user","setUser","UserManager","userManager","useEffect","initAuth","debug","events","addUserLoaded","oidcClientLoggerOptions","Log","logger","level","signinSilent","profile","setFetchOptions","mode","headers","Headers","Authorization","access_token","customer","getIdToken","id_token","getAccessToken","getProfile","loginWithRedirect","signinParams","returnUri","clearStaleState","signinRedirect","logoutWithRedirect","idToken","signoutParams","logoutId","signoutRedirect","useAuth","GlobalDataStores","WindowSizeContext","WindowSizeProvider","withWindowSize","ErrorBoundary","hasError","details","Fallback","FallbackComponent","defaultFallback","componentStack","paddingTop","whiteSpace","paddingBottom","authority","client_id","redirect_uri","post_logout_redirect_uri","response_type","filterProtocolClaims","loadUserInfo","automaticSilentRenew","silent_redirect_uri","AppFrame","className","WindowSize","TitleAggregateParser","aggregate","getSkuList","productsBySku","buildOneTitle","getTitleProductData","pos","getTitlePOSData","getTitleReviews","getTitleImageUri","offers","getOffersForOneTitle","currentRecs","getCurrentRecsForSku","hasImageUri","eCommerceUri","getEcommerceUri","hasPrice","listPrice","retailPrice","addUserDataToReview","skuReview","userAvatarsByAppUserId","usersById","userId","appUserId","av","avatar","recsBySku","currentRecommendationsBySku","offersBySku","staffPicksBySku","eCommerceUrisBySku","CollectionContext","CollectionStore","titles","catalog","getCatalog","fetchCollection","match","params","catalogId","handleResponse","aggregateResponse","parser","getCatalogFromAggregate","buildTitles","mapToProps","collectionStore","WithIsMobileContext","withIsMobile","mobileThreshold","initIsMobile","target","windowSize","isMobile","PageTitle","styleOverrides","backgroundImage","fontWeight","CollectionHeader","getHeaderContent","marginBottom","catalogName","getDefaultContent","CollectionOverview","overview","size","loading","ReactHtmlParser","WishlistSkusContext","connectToWishlistSkus","actions","WishlistSkusDataStore","count","add","addSkuAction","removeSkuAction","wishlistIncludesSku","fetchWishlistSkus","wishlistData","payload","action","resolveNextStateFromAction","addSku","removeSku","targetSku","CustomerListType","recentlyViewed","wishlist","CustomerEntitiesController","getController","fetchCustomerEntities","entities","findOneEntity","listType","customerListType","entityDTO","buildCustomerEntityDTO","getCustomerId","customerEntityDTOs","result","customerEntitiesController","customerEntityDTO","RecommendableEntity","toLowerCase","department","event","series","getAuthorDisplayNameAndInitials","authorName","initials","nameTokens","trim","charAt","FavoritesContext","CustomerFavoritesDataStoreBase","authors","getFavoriteGenres","saveOneEntityAsFavorite","deleteOneEntityAsFavorite","getFavoriteTitles","getFavoriteSeries","getFavoriteAuthors","findEntity","fetchCustomerFavorites","organizeFavoritesByEntityType","customerFavorites","current","titleEntity","entityName","entityImageUri","authorEntity","authorUtils","skuCount","seriesEntity","idx","getFavoriteEntities","renderChildren","connectToFavorites","useFavoritesDataStore","CustomerFavoritesDataStore","CollectionTitleSkeletons","skeletons","CollectionTitleSkeleton","Fragment","flexWrap","justifyContent","Review","PropTypes","shape","abstract","string","object","overallAssessment","submissions","updatedDate","useImage","supplier","ean","familyItem","formatDescription","pubDate","arrayOf","authorBio","dateAdded","isActiveTitle","quotes","src","hasLoaded","setHasLoaded","setHasError","hasStartedInitialFetch","setHasStartedInitialFetch","isMounted","useRef","useMounted","image","Image","handleError","handleLoad","onerror","onload","removeEventListener","isTitleDetail","skeletonSize","NoJacketImage","titleDetails","noJacketRef","createRef","setDimensions","updateDimensions","offsetHeight","offsetWidth","ref","alt","noImagePlaceholder","onLoad","defaultJacketUris","mobile","JacketImage","some","TitleJacketImage","onClick","getImageUri","small","medium","large","pick","fillwidth","fixedwidth","TextTruncator","text","canUseTooltip","handleTruncateText","resultText","isTruncated","maxLength","fallBackText","truncate","ending","substring","FavoriteEntityIndicator","isInTitleLane","tooltip","backgroundColor","placement","bottom","right","FavoriteButton","isFavoriteEntity","handleToggle","FavoriteEntityAnchor","didInitialize","handleToggleAsFavorite","toggleEntityAsCustomerFavorite","success","duration","renderFavoriteButton","customerFavoritesDataStore","getTooltip","renderIcon","isActiveInDataStore","TitleCard","gradient","margin","position","favoritesDataStoreIsPresent","renderFavoriteEntityAnchor","titleNameFontSize","shouldTruncateName","doShowSection","preferences","favoritesDataStore","DrawerAnchor","isDrawerVisible","showDrawer","closeDrawer","onCloseHook","closable","overflowY","renderDrawerContent","parentStyle","ControlledDrawerAnchor","getInstance","isVisible","open","close","renderAnchorChild","bodyStyle","border","onClose","visible","destroyOnClose","DetailDrawerAnchor","drawer","SeeAllAnchor","renderAllEntities","LaneContainer","backgroundClass","renderLaneHeaders","majorHeader","subHeader","icon","getLanePrimaryHeader","extra","headerValue","shouldRenderIcons","PublisherContent","attributes","titleAttributes","keyNote","TitleContext","connectToTitle","TitleDataStore","reviewerUsersById","getTitle","hasReviews","getReviewer","getFormatDescription","fetchTitle","buildStateFromTitleAggregate","isCanceled","log","reviewer","titleAggregate","buildTitle","buildReviewerUsersById","isOnWishlist","avatarsById","titleDataStore","WishlistController","addToWishlist","makeEntityDTO","cancelablePost","removeFromWishlist","cancelableCall","mapCustomerToProps","delay","v","resolve","setTimeout","bind","cancelableDelay","makeCancelable","TitleFormatDescription","paperback","hardcover","audioCassette","audioCD","unknown","findUniqueFamilyTitles","getFormatDescriptionDisplayName","format","TitleLanesDataStore","lanesByLaneKey","fetchCalls","getLaneConfigs","laneConfigs","getLane","laneKey","getLaneHeader","getOneLaneConfig","getLaneSubtitle","subtitle","updateLane","fetchMoreTitles","hasTitlesInLane","fetchAllAvailableTitles","hasTitlesInAnyLane","laneNameKey","totalAvailableCount","fetchTitleLanes","laneConfig","fetchOneTitleLane","buildLaneState","total","getEndpoint","laneTitles","findTitlesToParse","uniqueTitles","filterTitlesWithTitleName","countOfRemovedTitles","totalAvailableTitles","titleName","laneName","lane","availableCt","nextTotal","parseNextStateFromResponse","nextLane","laneUpdateRequests","requestLaneRefresh","setNewStateWithLaneRefreshes","laneRequests","lanes","nextLanesByKey","RetailTitleLaneType","frontlist","recentPub","staffReviews","sectionHighlights","deeperBacklist","wishList","relatedComps","relatedSection","relatedSeries","ArrowUpIcon","renderShareButton","wishlistLink","host","protocol","buildLinkToWishlist","onCopy","WishlistContext","connectToWishlist","WishlistLaneDataStore","isUpdating","titleLanesDataStore","wishlistLaneDataStore","getWishlistLaneDataStore","laneType","lvl","sectionLevel","link","WishlistButton","originalState","wasWishlistUpdated","renderAddButton","renderWishlistButton","renderRemoveButton","disabled","onRemoveSuccess","wishlistSkusDataStore","confirmWishlistWasUpdated","onAddSuccess","isOnList","renderButton","isAlreadyOnWishlist","DrawerContext","useDrawer","DrawerContextProvider","paths","pathname","authPages","BagBuyNowButton","label","block","history","useHistory","routeMatch","useRouteMatch","setIsLoading","getTitleAsEntity","handleAddToBag","redirectToOrderPage","getButtonType","path","BuyFromThirdPartyButton","href","getHref","skuDisplay","isbn13","replace","isFrontList","useRemoveFromBag","removeFromBag","setIsVisible","isRedirecting","setIsRedirecting","addToBag","handleRemoveFromBag","isMobileSize","isInBag","okText","cancelText","onOk","onCancel","status","BuyTitleButton","doRenderBagControllerButton","buyFromThirdPartyButtonWidth","ratingsAndReviewsDataStore","transactionsDataStore","purchases","didUserPurchaseSku","p","didUserReviewSku","buttonWidth","marginRight","undefined","buildLinkToTitle","baseUrl","linkUrl","concat","TitleActionButtons","StaffReview","reviewerFullName","reviewText","doShowActionButtons","textAlign","renderHeader","renderReviewText","reviewerFirstName","lines","more","anchorClass","expanded","StaffPicksContext","connectToStaffPicks","StaffPicksDataStore","staffPicksData","selectedStaffReviewers","getSelectedStaffReviewerIds","getStaffUser","getTitleReviewsByStaffUser","getCountOfReviewsByStaffUser","getStaffPickSections","getCountOfTitlesBySection","getTitlesBySection","reviewsById","getTitlesWithProductInfoBySection","fetchStaffPicks","fetchStaffPicksBySection","getStaffPicksData","getSelectedStaffReviewers","titlesBySectionCode","getSkusBySectionCode","avatarUri","reviewsByUser","getUniqueReviewsByStaffUser","staffReviewerIds","staffKeys","assessmentId","sectionTitles","titlesForSelectedReviews","getTitlesBySkuForSelectedReviews","matchingTitle","sectionCodesForSectionsWithSelectedReviews","getSectionCodesForSectionsWithSelectedReviews","skusForSelectedReviews","rows","index","sectionCodes","posData","staffUser","staffBio","shelfType","shelves","shelfTypeId","nameType","favoriteShelves","validShelfIds","shelf","shelfDetails","Panel","renderShelfButton","isValid","isValidShelf","to","expandIcon","rotate","header","aboutText","TitleDescription","setExpanded","publisherDescription","renderMoreButton","prev","FamilyTitlesDropdown","maxHeight","overflow","WishlistEntityIndicator","PurchasedEntityIndicator","BagEntityIndicator","TitleJacketImageWithIconBadges","titleIsInBag","titleIsFavorite","titleIsInWishlist","titleWasPurchased","renderIconBadges","renderFavoritesBadge","jacketSize","renderTitleJacketImage","mapWishlistToProps","mapFavoritesToProps","mapTransactionsToProps","AllAvailableTitles","loadMoreTitlesAmount","scrollRefToLastViewedTitle","allTitles","canLoadMoreTitles","hasLoadedMoreTitles","currentMaxTitles","handleLoadMoreTitles","newMaxTitles","renderTitles","titlesToRender","renderTitleCount","renderOneTitle","getNewState","handleScrollToLastViewedTitle","scrollIntoView","behavior","getTitleWrapperStyle","display","flexDirection","renderReviewOrDescription","renderLoading","titleData","firstVisibleReview","findFirstVisibleReview","findStaffReviewer","staffPicksDataStore","staffReviewer","renderStaffReview","doShowStaffAvatar","fullName","UserAvatar","isLastViewedTitle","renderSubtitle","newState","StaffPicksDetail","renderReviewedTitles","shouldRenderStaffDetails","getHeaderTitle","shelfName","getSectionLink","staffName","staffUserBio","hasStaffBio","findStaffBioStatus","titleReviews","renderDrawerHeader","renderStaffBio","StaffUserAvatar","renderUserAvatar","avatarSizeClass","userInitials","getInitials","first","toUpperCase","last","isInLane","TitleIndiePicksContext","TitleIndiePicksDataStore","getTitleIndiePicks","getReviewers","fetchTitleIndiePicks","titleIndiePicksDataStore","IndieReview","orgName","orgCity","orgState","reviewers","options","renderInnerHtml","renderReviews","renderReview","ScrollerType","simpleBar","carousel","ScrollerConfigContext","ScrollerConfigProvider","scrollerConfig","scrollerType","desktop","ScrollerConfigConsumer","CustomButtonGroup","next","previous","rest","carouselState","totalItems","currentSlide","itemWidth","visibility","Scroller","getScrollerType","renderSimplebarScroller","getSimplebarProps","forceVisible","autoHide","renderCarouselScroller","arrows","responsive","tablet","breakpoint","max","min","slidesToSlide","customTransition","draggable","renderButtonGroupOutside","customButtonGroup","swipeable","partialVisible","getChildren","Children","toArray","TitleSkeletons","isRenderedInDrawer","titleIdx","ViewMore","alignItems","paddingRight","borderRadius","TitleScroller","minWidth","canFetchMoreTitles","ShowingTitlesCount","numberOfTitles","TitleLanes","renderOneLane","renderExtra","renderLaneTitleScroller","getShowingTitlesTotal","getBottomContainerClassNames","base","extraBottom","renderAllAvailableTitlesInLane","renderOneTitleInDrawer","laneKeyName","getLaneConfigsToRender","canRenderSeeAllAnchor","doRenderSeeAllAnchor","isFunc","x","hasRequiredFuncs","hasRequiredTitleCt","shouldRenderLaneTitlesWithIcons","RelatedContext","RelatedDataStore","relatedDataStore","getRelatedDataStore","retailTitleLaneType","RelatedTitlesLane","renderRelatedTitleLane","ReviewDisplay","TextArea","confirm","ReviewInput","initialReview","onChange","cancelEdits","leaveEditMode","saveReview","currentReview","deleteReview","getPlaceholder","setInitialReview","placeholder","autosize","minRows","float","clear","RateAndReview","isEditingReview","handleChange","previousValue","editReview","flex","allowHalf","allowClear","setInitialValue","userHasPurchased","marginTop","color","flexGrow","RecentlyViewedContext","RecentlyViewedDataStoreBase","any","hasAnyEntities","saveEntityAsRecentlyViewed","fetchRecentlyViewedEntities","connectToRecentlyViewed","RecentlyViewedDataStore","RecentlyViewedEntity","doSaveEntityToRecentlyViewedForCustomer","saveEntityToRecentlyViewed","recentlyViewedDataStore","postRecentlyViewedEntity","TitleDetail","renderTitleUI","renderTitleCard","ds","userReviewer","mapSettingsToProps","TitleDetailDrawer","renderTitleDetail","TitleListPrice","orgCountry","price","hasTitlePosData","toLocaleString","currency","familyTitles","setFamilyTitles","getTitleWithDisplayFormat","useCallback","formatDisplayName","sortFamilyByFormatAndPrice","getTitlePrice","formatOrder","sortBy","matchingFormat","compareTitlesByFormatAndPrice","familyDropdownItems","sortedFamily","renderOneDropdownItem","overlay","alternativeTitleFormats","onSelect","Item","getFamilyTitlesMenu","getPopupContainer","trigger","parentNode","overlayClassName","onVisibleChange","val","defaultValue","currentTitle","renderCurrentTitle","transform","formattedTitle","renderDescriptionWithoutDropdown","TitleSummary","renderTitleSummary","sz","secDisplayName","getSectionDisplayName","withSections","CollectionTitleCard","onTitleJacketClick","renderViewTitleButton","CollectionLanding","renderCollectionLandingUI","UpdateConfirmation","UnsubscribeService","didUpdate","isUnsubscribeModalOpen","unsubscribeReason","updateReason","evt","currentTarget","getOnClick","isUnsubscribed","showUnsubscribeModal","customerDataStore","resetUIState","closeModal","getMessagePrompt","getButtonLabel","mapOrgToProps","orgStore","MessageFrequencyType","FrequencyContext","MessageFrequencyDataStore","messageFrequencyPreferences","savePreference","saveFrequencyPreference","getPreference","getEmailFrequencyPreferenceValue","fetchFrequencyPreferences","getRecommendationEmailFrequencyPreference","hasPreference","parseValue","frequencyPreference","frequencyValue","body","makeMessageFrequencyPreferenceDTO","httpMethod","preferenceValue","getNumberOfEmails","prefs","tokens","EmailFrequencyService","didSaveNewFrequency","numberOfEmailsPrefence","saveNewPreference","pref","messageFrequencyDataStore","getNotification","getSingularLabel","updatePreferenceNumber","getRootClassNames","renderNumberInput","getButtonStyle","setInitialNumberOfEmailsFrequencyPreference","baseName","preference","mfds","SeriesAutocompleteRow","SeriesAutocomplete","handleOptionsResponse","getURLForOptions","userInput","onSelectHook","autocompleteState","selectedId","selected","selectedOption","onSelectOption","getFeedback","optionIdName","optionDisplayNameKey","canShowSuccess","hasSearchIcon","getOptionLabel","renderOption","inputRequiredFeedback","FavoriteType","FavoriteTitlesDrawer","typeOfFavorite","FavoriteTitles","isFavoriteAuthor","SeriesScroller","SeriesItem","RemoveFavoriteController","handleRemove","SeriesFavoritesLane","handleRenderFavorites","renderLoadingFavorites","renderSeriesFavorites","onSelectSeries","makeEmptyPromise","getSeriesAsEntity","renderOneSeries","SectionLevel","SectionAutocompleteRow","getSectionLevel","SectionAutocomplete","sectionKey","buildSection","minCharsRequired","selectedSection","getEntityIdFromSectionKey","getSectionLevelFromSectionKey","RemoveGenreFavoriteButton","SectionsScrollerItem","genreCount","doLinkToSectionRoute","renderNameWithLinkToSectionOrDepartment","renderNameWithOnClick","sectionLvl","hasOnClick","onClickOnName","baseClassNames","SectionsScroller","SectionAnchor","getSearchBoxPlaceholder","onSelectSection","renderGenreFavorites","genres","renderOneFavoriteGenre","genreEntity","isValidSectionOrDepartment","TitleAutocompleteRow","TitleAutocomplete","aggregateDTO","retailTitles","isClearable","renderTitleOption","selectedTitleOption","TitleFavoritesLane","isRefreshingTitles","renderTitleFavorites","onSelectTitle","renderSeeAllTitles","AuthorAutocompleteRow","renderAuthorOption","AuthorsAutocomplete","AuthorCard","authorTitles","fetchAuthorTitles","parseTitlesByAuthor","AuthorContent","WorksCount","ViewAuthorTitlesButton","titleCount","opacity","AuthorsScroller","AuthorItem","AuthorFavoritesLane","renderAuthorFavorites","onSelectAuthor","getAuthorAsEntity","renderOneAuthorInScroller","CustomerFavoritesService","doShowSeriesLane","UnsubscribePage","PageDivider","renderSubscriptionModifiers","UnsubscribePageRoot","renderPageContent","RecentShelvesTitleLanes","getRecentSectionLaneConfigs","getOneSection","getLaneNameKeyFromSectionId","getRecentSectionTitlesEndpoint","titleLaneKey","getSectionIdFromLaneKey","isLoadingFavorites","renderRecentSectionHighlightLanes","sectionIds","getRecentSectionIdsToDisplay","maxLanes","topFavSectionIds","getTopFavoriteSectionIds","sectionIdsToShow","idsOfFavoriteSections","isInRecentIds","hasSection","mapSectionsDataStore","mapFavoritesDataStore","StaffPickLaneType","byStaffMember","bySection","StaffPicksBySectionLane","staffPickSections","renderOneStaffPickSectionAnchor","sectionType","StaffPicksByMemberLane","renderStaffAvatars","staffUserIds","staffUserId","renderOneStaffAvatarAnchor","reviewsCt","StaffPicksSummary","renderStaffPicksLane","renderLane","staffPickLaneType","isNotYetPublished","BrowseTitleAutocompleteRow","fontStyle","onHand","TitleStatus","BrowseTitleAutocomplete","getEndpointBase","instance","getTitleAutocompleteInstance","shouldResetInternalState","apiCallDelay","searchTitles","includeProductImagesInResults","SearchResultsTitleScroller","maxVisibleTitles","setMaxVisible","totalTitlesCount","currentMax","TitleLanesByStatus","titlesByStatus","titleStatusHeaders","onShelf","comingSoon","availableForOrder","renderAllTitles","doShowResults","onSearchResultsReceived","setTitles","setUserInput","didExecuteSearch","setDidExecute","doResetInternalState","setDoResetInternalState","onTitleOptions","productInfo","imageKey","titleInfo","resetSearch","getTitlesByStatus","drawerHeader","pagePlaceholder","drawerPlaceholder","renderSearchLane","hasNoResults","description","renderResults","useTitleSearchService","isCancelingSearch","setIsCancelingSearch","isTitleSearchActive","setIsTitleSearchActive","cancelSearch","renderTitleSearch","TitleSearchService","propTypes","func","SectionTitleLanesDataStore","getEndpointForTitleLanes","Shelves","booksellerHasDefinedEnoughDepartments","renderAllDepartments","renderDepartmentOrSectionWithDataStore","renderAllSections","renderOneDepartment","renderOneSection","bordered","linkToDepartment","hasEnoughDepartments","paddingLeft","BrowseShelvesPage","renderContent","wishlistSkus","renderWithTitleSearchService","titleSearchService","getHeader","OverlayItem","top","left","zIndex","Overlay","ImageUploadContext","connectToImageUpload","ImageUploadDataStore","initialState","fileType","fileName","base64Image","croppedImageBase64Source","didChooseImage","isCropActive","reset","getUploadedImageAsBase64","setBase64ImageResult","uploadResult","setCroppedImageBase64","getUploadedFileType","getOriginalBase64","getImageSourceForPreview","cropped","normalizeBase64","ImageUploadAnchor","transformFileOnDrop","uploadInstance","readImageFileOnDrop","handleTransformedImage","file","reject","reader","FileReader","readAsDataURL","imageUploadDataStore","onUpload","accept","showUploadList","customRequest","UploadButton","logoStore","useSplashImageController","isDeleting","setIsDeleting","clearPreviewAndReset","saveUploadedSplash","imgDTO","didUpdateSucceed","deleteCurrentSplashImage","del","SaveUploadedSplashButton","DeleteSplashButton","splashController","onConfirm","onIgnore","hasUploadedPreview","BooksellerSplashImage","isUploadVisible","renderPreviewModeEmptySplash","doAllowSplashUpload","renderUploadService","splashPreviewSrc","isOverlapLayout","splashImageUploadContainerClasses","classNames","SplashImage","WishlistTitlesLane","renderCopyLinkToWishlistAnchor","StoreLocationInfoEnum","StoreLocationInfo","getStoreInfoProperties","properties","storeLocations","RewardsProgress","percent","HomePage","renderHomePageContent","background","doRenderSplash","doRenderRecentlyViewedLane","hasValidCustomer","doRenderRewardsProgressLane","onDidMount","HomePageRoot","renderHomeWithTitleDetail","isLoadingOrgData","renderPage","isLoadingLogos","exact","render","orgDataStore","SectionHeader","SectionPopover","getSectionName","getSectionList","setShelfName","getHeaderForDepartment","getHeaderForSection","findDepartment","renderPageWithDataStore","getDisplayName","TransactionDetailsContext","TransactionDetailsDataStore","fetchTransactionDetails","transactionDetailsFetch","getTransactionDetailsData","buildBrowseableTransactions","getTitleForTransaction","getAuthorForTransaction","transactionsAggregate","TransactionsList","renderTransactions","transactionDetailsDataStore","pagination","pageSize","simple","columns","buildColumns","dataSource","sorter","RewardsPage","getPageTitle","refFullName","refLastName","refFirstName","referralName","hasSplash","WishlistCollectionPageDataStores","WishlistPageError","WishlistCollectionPage","WishlistCollectionPageContent","wishlistTitles","setWishlistTitles","isInvalidReferral","setIsInvalidReferral","buildWishlistTitles","referral","skusEndpoint","ct","isBadRequest","useReferralWishlistTitles","renderWishlistTitles","minHeight","useBagDataTotalAmount","bag","amountsBySku","setAmountsForSkus","getTotal","quantitesBySku","totalPrice","getPrice","getFixedTotal","toFixed","LocalizedPrice","getCultureAndCurrencyCodes","culture","useLocalizedCurrencyCode","displayPrice","onModalOk","BagTitleFormat","getFormatDisplay","Option","BagItemQuantitySelect","layout","renderOptions","renderPrice","justify","span","align","column","BagOrderTitleSummaries","BagTotal","AddTitlesAutocomplete","addTitleToBag","chosenOption","OrderLaneContainer","totalEntitiesCount","itemCountDisplay","renderSubHeader","DeliveryMode","OrderTotalBreakdown","isShipping","getShippingPrice","doShowTax","getTax","getOrderTotal","useTaxes","getLocationTaxRate","addressQueryParams","URLSearchParams","OrderProvider","AddressType","PreferredContactMethod","usePayPalOrders","deliveryMode","buildLineItems","paypalOrderDetails","purchase_units","hasValidLineItems","amount","unit_amount","currencyCode","currency_code","buildShippingAddress","shipping","full_name","addressType","streetAddress1","address_line_1","streetAddress2","address_line_2","region","admin_area_1","locality","admin_area_2","postalCode","postal_code","countryCode","country_code","homePhone","mobilePhone","buildAddresses","buildOrderDTO","isGift","doWrap","referenceId","payer","email_address","surname","given_name","orderProvider","preferredContactMethod","addresses","lineItems","createOrders","orderDTO","didSucceed","createPayPalOrders","PayPalOrderButton","deliveryChoice","orgSalesTax","orgUseTax","setError","bagDataTotalAmount","booksellerAppSettings","orgDataStoreState","stateAbbreviation","useScript","isError","PayPalButton","paypal","Buttons","driver","ReactDOM","getPurchaseUnits","getPurchaseUnitsItems","breakdown","item_total","shippingPrice","getAmount","payee","getPayee","getPayer","taxRate","itemTotal","totalRate","tax_total","titleAmount","category","getNewTaxRate","shippingAddress","destinationTaxRates","salesTax","useTax","originDestination","getShippingAddressCountryCode","createOrder","order","application_context","brand_name","shipping_preference","create","onApprove","capture","exists","onShippingChange","shipping_address","city","stateProvince","locationTaxRate","patch","op","zip","orgTaxRate","setOrgTaxRate","hasShippingMethods","firstShippingMethod","shippingMethod","setShippingMethod","defaultDeliveryChoice","setDeliveryChoice","shippingItemFee","shippingItemFees","fee","itemType","itemCount","shippingFee","getSelectedShippingPrice","sm","onChangeDelivery","onChangeShipping","taxCost","isFreightTaxable","orderTotal","bagHasItems","radioStyle","lineHeight","required","Group","renderDeliveryOrPickupRadios","so","renderShippingMethodRadio","subTitle","Login","goToSignUp","tenant","logoImage","acr_values","login_hint","extraQueryParams","btoa","stringify","signup","Logout","PurchaseDetail","renderPurchaseDetailUI","MyPurchases","purchasePosData","purchaseUris","purchase","AuthConsumer","MyPurchasesDrawerAnchor","renderRegistrationModal","redirectToLoginPage","auth","renderDrawerAnchor","CustomerAvatar","ReviewDetail","MyReviews","reviewSkus","withUserReviews","MyReviewsDrawerAnchor","MyOrderPreferences","handleSubmit","preventDefault","form","validateFieldsAndScroll","getFieldDecorator","onSubmit","rules","htmlType","MyOrderPreferencesDrawerAnchor","AccountAnchor","AccountPage","MyOrderPerferencesDrawerAnchor","defaultActiveKey","expandIconPosition","IframeRenderer","_updateIframe","refs","iframe","contentDocument","innerHTML","addEventListener","PreviewModeAlert","banner","afterClose","totalCount","getCountDisplay","goToCheckout","bagLabel","labelWithCount","renderForDesktop","NavigationAnchorRoot","routes","routesToCheck","alsoMatches","useLocation","isAnyRouteActive","isAnyMatchActive","test","route","useActiveRoute","SignUpModal","doRenderLearnMoreButton","isVisibleAtRender","isAuthPage","footer","stackedBooksImage","translationId","SignUpPopover","onMouseOver","NavigationAnchor","linkTo","renderNavigationLink","LinkName","Home","Events","Account","SignUp","NavigationItems","HomeNav","ShelvesNav","RegExp","EventsNav","AccountNav","SignUpNav","LogoImage","logoRef","isMobileClassicLayout","naturalHeight","naturalWidth","BooksellerLogo","getLogoHeight","appHeaderLogoPreferenceUri","isLoadingPreferences","uriKey","layoutKey","ClassicHeaderLayout","scrollPosition","setScrollPosition","handleScroll","pageYOffset","passive","doUseExplorePageDisplay","findMaxScrollPosition","headerLogoClass","isPreviewModeBannerVisible","findMarginTop","flexShrink","RetailerMessage","isExplorePage","sessionStorage","hasViewedRetailerMessage","LandingHeader","didClosePreviewModeAlert","onCloseAlert","renderPreviewModeAlert","doShowRetailerBrandLogo","isClassicHeader","hasMessageBody","shouldShowAlert","HeaderContainer","getJustifyContentValue","getHeaderHeight","renderNavItem","renderDesktopHeaderItems","renderBagAnchor","navItem","bagAnchorWrapperClasses","LandingFooter","Page","doShowAppHeader","scrollTo","campaignId","useParams","doShowCustomerAppBrandingWhenSharingCampaign","campaign","setCampaign","fetchCampaign","isLoadingCampaign","useCampaign","campaignHtml","setCampaignHtml","fetchCampaignPreview","html","subject","renderCampaignHeader","WrappedSubscribeForm","isFormTouched","isFieldsTouched","alert","setAlert","onResponse","postCustomer","orgID","isSuccessful","ok","json","resetFields","validateFields","tags","SubscribePage","isLogoLoading","isOrgLoading","AppSwitch","renderSectionPage","router","routerProps","Appcues","page","sellerPreferencesStore","App","anonymous","Boolean","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"y2CAEc,wBACVA,KADJ,CAEC,2CACA,UACA,UACA,aACA,0BACA,mBACA,mCACA,uBACA,wBACA,qBACA,yBACA,sBACA,cACA,cACA,kBACA,cACA,0BACA,uCACA,yCACA,mDACA,uCACA,sBACA,mBACA,MACA,eACA,yCACA,+BACA,SACA,yBACA,4BACA,qBACA,2BACA,kBACA,MACA,YACA,UACA,oBACA,KACA,cACA,kCACA,SACA,eACA,kBACA,OACA,QACA,gBACA,wBACA,6BACA,sBACA,cACA,wBACA,0CACA,oBACA,oBACA,gCACA,SACA,OACA,yBACA,6BACA,4BACA,oBACA,mBACA,+BACA,SACA,wBACA,UACA,8BACA,cACA,QACA,mBACA,oBACA,sCACA,4BACA,gBACA,kBACA,SACA,UACA,UACA,WACA,mBACA,iBACA,kBACA,mBACA,gBACA,eACA,iBACA,aACA,SACA,mCACA,sCACA,0CACA,yCACA,0BACA,QACA,uCACA,uCACA,mBACA,OACA,uBACA,YACA,aACA,qBACA,uCACA,4CACA,uCACA,YACA,UACA,SACA,UACA,uBACA,4BACA,yBACA,eACA,uBACA,YACA,eACA,aACA,eACA,mBACA,6CACA,KACA,aACA,sBACA,oBACA,qBACA,sBACA,mBACA,sBACA,qBACA,iCACA,KACA,iCACA,iBACA,mBACA,0BACA,WACA,iBACA,eACA,gBACA,UACA,qBACA,0BACA,sBACA,mCACA,0BACA,4BACA,+BACA,8BACA,6BACA,WACA,6CACA,kCACA,QACA,eACA,YACA,wBACA,YACA,OACA,kBACA,gDACA,uBACA,mCACA,WACA,SACA,iCACA,kBACA,mBACA,yBACA,6BACA,yCACA,cACA,SACA,mBACA,OACA,4BACA,4CACA,SACA,qBACA,mBACA,sCACA,oBACA,yBACA,oBACA,qBACA,kCACA,yCACA,UACA,UACA,qCACA,8CACA,QACA,aACA,iBACA,sCACA,UACA,WACA,oBACA,mBACA,UACA,mCACA,4DACA,6BACA,uBACA,wBACA,oBACA,cACA,uBACA,qBACA,SACA,4BACA,UACA,oCACA,WACA,gBACA,gCACA,uCACA,oBACA,aACA,yBACA,YACA,kCACA,qBACA,cACA,wBACA,UACA,iBACA,kBACA,kBACA,SACA,oBACA,OACA,WACA,uCACA,uCACA,6BACA,OACA,QACA,UACA,4BACA,WACA,aACA,iCACA,eACA,WACA,+BACA,gBACA,UACA,UACA,iBACA,WACA,sBACA,WACA,eACA,cACA,aACA,MACA,aACA,sCACA,6DACA,oBACA,aACA,0BACA,wBACA,0BACA,qBACA,0BACA,yB,uBC3Qc,SAASC,EAAT,GAAiC,IAAVC,EAAS,EAATA,MACrC,OACC,sBAAKA,MAAOA,EAAZ,UACC,mBAAMC,UAAQ,IACd,sBAAMD,MAAO,CAAEE,WAAY,QAA3B,2BAKHH,EAAYI,aAAe,CAC1BH,MAAO,CAAEI,QAAS,OAAQC,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ACC,cAACr7B,GAAD,UACC,cAAC,GAAD,QCDgBs7B,QACW,cAA7BjiE,OAAOf,SAASgB,UAEe,UAA7BD,OAAOf,SAASgB,UAEhBD,OAAOf,SAASgB,SAAS8gB,MACvB,2D,wCCPNuxC,IAASpK,OACR,cAAC,KAAD,UACC,cAAC6Z,GAAD,MAED5yD,SAAS+yD,eAAe,SDkHnB,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMziE,MAAK,SAAA0iE,GACjCA,EAAaC,iB","file":"static/js/main.7a0b68e2.chunk.js","sourcesContent":["import coreKeys from 'treeline-react-core-components/localizationKeys'; // These keys are referenced by components in the lib\r\n\r\nexport default [\r\n\t...coreKeys,\r\n\t'a_colorful_illustration_of_several_books',\r\n\t'about_x',\r\n\t'account',\r\n\t'add_to_bag',\r\n\t'add_to_bag_and_checkout',\r\n\t'add_to_favorites',\r\n\t'add_to_your_favorites_collection',\r\n\t'add_to_your_wishlist',\r\n\t'added_to_checkout_bag',\r\n\t'added_to_favorites',\r\n\t'added_to_your_wishlist',\r\n\t'added_x_to_your_bag',\r\n\t'address_one',\r\n\t'address_two',\r\n\t'advanced_search',\r\n\t'all_shelves',\r\n\t'already_have_an_account',\r\n\t'an_email_was_sent_with_order_details',\r\n\t'are_you_sure_you_want_to_delete_review',\r\n\t'are_you_sure_you_want_to_delete_the_splash_image',\r\n\t'are_you_sure_you_want_to_unsubscribe',\r\n\t'available_for_order',\r\n\t'back_to_browsing',\r\n\t'bag',\r\n\t'bag_is_empty',\r\n\t'books_that_staff_members_have_reviewed',\r\n\t'books_youd_like_to_read_next',\r\n\t'browse',\r\n\t'browse_new_top_sellers',\r\n\t'browse_one_available_work',\r\n\t'browse_our_shelves',\r\n\t'browse_x_available_works',\r\n\t'browse_x_titles',\r\n\t'buy',\r\n\t'buy_again',\r\n\t'buy_now',\r\n\t'buy_now_uppercase',\r\n\t'by',\r\n\t'by_author_x',\r\n\t'can_we_do_something_to_keep_you',\r\n\t'cancel',\r\n\t'checkout_now',\r\n\t'choose_shipping',\r\n\t'city',\r\n\t'clear',\r\n\t'clear_results',\r\n\t'click_to_pin_favorite',\r\n\t'click_to_read_staff_review',\r\n\t'click_yes_to_remove',\r\n\t'coming_soon',\r\n\t'complete_registration',\r\n\t'complete_registration_to_view_purchases',\r\n\t'contains_x_titles',\r\n\t'continue_browsing',\r\n\t'copied_link_to_your_clipboard',\r\n\t'copies',\r\n\t'copy',\r\n\t'copy_link_to_clipboard',\r\n\t'copy_wishlist_to_clipboard',\r\n\t'could_you_let_us_know_why',\r\n\t'create_a_wishlist',\r\n\t'currently_in_bag',\r\n\t'currently_pinned_as_favorite',\r\n\t'delete',\r\n\t'deliver_to_my_address',\r\n\t'dismiss',\r\n\t'do_you_want_to_checkout_now',\r\n\t'edit_review',\r\n\t'email',\r\n\t'email_is_invalid',\r\n\t'email_is_required',\r\n\t'enter_the_title_of_a_book_to_search',\r\n\t'enter_the_title_of_a_book',\r\n\t'estimated_tax',\r\n\t'estimated_total',\r\n\t'events',\r\n\t'explore',\r\n\t'failure',\r\n\t'favorite',\r\n\t'favorite_authors',\r\n\t'favorite_books',\r\n\t'favorite_series',\r\n\t'favorite_shelves',\r\n\t'find_a_series',\r\n\t'find_a_title',\r\n\t'find_an_author',\r\n\t'first_name',\r\n\t'format',\r\n\t'get_better_title_recommendations',\r\n\t'get_it_shipped_to_you_in_a_few_days',\r\n\t'given_much_love_by_one_indie_bookseller',\r\n\t'given_much_love_by_x_indie_booksellers',\r\n\t'hallelujah_welcome_back',\r\n\t'hours',\r\n\t'how_would_you_like_to_get_your_order',\r\n\t'i_only_want_to_receive_1_email_every',\r\n\t'in_our_x_section',\r\n\t'info',\r\n\t'invalid_wishlist_url',\r\n\t'last_name',\r\n\t'learn_more',\r\n\t'learn_more_about_x',\r\n\t'let_us_know_what_books_you_love_most',\r\n\t'let_us_know_what_your_favorite_series_are',\r\n\t'let_us_know_where_you_like_to_browse',\r\n\t'load_more',\r\n\t'loading',\r\n\t'log_in',\r\n\t'log_out',\r\n\t'more_books_like_this',\r\n\t'most_actions_are_disabled',\r\n\t'much_loves_given_for_x',\r\n\t'my_favorites',\r\n\t'my_order_preferences',\r\n\t'my_orders',\r\n\t'my_purchases',\r\n\t'my_reviews',\r\n\t'my_take_on_x',\r\n\t'new_and_trending',\r\n\t'new_or_upcoming_titles_recommended_for_you',\r\n\t'no',\r\n\t'no_content',\r\n\t'no_favorite_authors',\r\n\t'no_favorite_books',\r\n\t'no_favorite_series',\r\n\t'no_favorite_shelves',\r\n\t'no_results_found',\r\n\t'no_thanks_uppercase',\r\n\t'no_upcoming_events',\r\n\t'not_applicable_in_preview_mode',\r\n\t'ok',\r\n\t'older_books_that_are_in_demand',\r\n\t'on_our_shelves',\r\n\t'on_your_wishlist',\r\n\t'one_copy_purchased_on_x',\r\n\t'one_item',\r\n\t'order_complete',\r\n\t'our_location',\r\n\t'our_locations',\r\n\t'pick_up',\r\n\t'pinned_as_favorite',\r\n\t'please_double_check_url',\r\n\t'please_enter_a_city',\r\n\t'please_enter_a_state_or_province',\r\n\t'please_enter_a_zip_code',\r\n\t'please_enter_your_address',\r\n\t'please_enter_your_first_name',\r\n\t'please_enter_your_last_name',\r\n\t'preference_saved_thank_you',\r\n\t'preorder',\r\n\t'preorder_books_and_we_will_have_them_ready',\r\n\t'preorder_these_hot_titles_today',\r\n\t'price',\r\n\t'preview_mode',\r\n\t'published',\r\n\t'publisher_description',\r\n\t'purchased',\r\n\t'rate',\r\n\t'rate_and_review',\r\n\t'recently_released_books_that_are_selling_well',\r\n\t'recently_viewed_full',\r\n\t'redirecting_you_in_a_few_seconds',\r\n\t'register',\r\n\t'remove',\r\n\t'remove_this_item_from_your_bag',\r\n\t'remove_from_bag',\r\n\t'removed_from_bag',\r\n\t'removed_from_favorites',\r\n\t'removed_from_your_wishlist',\r\n\t'reserve_a_copy_for_pick_up_or_delivery',\r\n\t'results_for',\r\n\t'review',\r\n\t'rewards_progress',\r\n\t'save',\r\n\t'saved_x_to_your_favorites',\r\n\t'save_your_order_preferences_for_next_time',\r\n\t'search',\r\n\t'search_for_authors',\r\n\t'search_for_books',\r\n\t'search_for_books_by_title_or_author',\r\n\t'search_for_genres',\r\n\t'search_for_more_titles',\r\n\t'search_for_series',\r\n\t'search_for_shelves',\r\n\t'search_results_will_appear_here',\r\n\t'search_to_add_more_books_to_your_order',\r\n\t'section',\r\n\t'see_all',\r\n\t'see_what_our_booksellers_recommend',\r\n\t'see_what_x_titles_our_booksellers_recommend',\r\n\t'share',\r\n\t'share_book',\r\n\t'share_wishlist',\r\n\t'share_your_favorite_authors_with_us',\r\n\t'shelves',\r\n\t'shipping',\r\n\t'showing_one_title',\r\n\t'showing_x_titles',\r\n\t'sign_up',\r\n\t'sign_up_and_access_more_features',\r\n\t'sign_up_and_start_personalizing_your_bookstore_experience',\r\n\t'sign_up_for_a_free_account',\r\n\t'splash_image_deleted',\r\n\t'splash_image_uploaded',\r\n\t'state_or_province',\r\n\t'staff_picks',\r\n\t'staff_picks_by_shelf',\r\n\t'still_selling_well',\r\n\t'submit',\r\n\t'subscribe_to_x_newsletter',\r\n\t'success',\r\n\t'successfully_processed_your_order',\r\n\t'subtotal',\r\n\t'tb_author_bio',\r\n\t'the_recommended_image_size_is',\r\n\t'there_was_an_error_with_your_request',\r\n\t'this_is_a_preview',\r\n\t'this_title',\r\n\t'titles_in_the_x_series',\r\n\t'too_short',\r\n\t'top_sellers_on_the_same_shelves',\r\n\t'try_another_search',\r\n\t'unavailable',\r\n\t'undo_sign_me_up_again',\r\n\t'unknown',\r\n\t'unknown_format',\r\n\t'unsubscribe_now',\r\n\t'upcoming_events',\r\n\t'upload',\r\n\t'upload_successful',\r\n\t'view',\r\n\t'view_all',\r\n\t'view_your_reviews_and_past_purchases',\r\n\t'view_more_details_and_buy_this_title',\r\n\t'we_are_sorry_to_see_you_go',\r\n\t'week',\r\n\t'weeks',\r\n\t'welcome',\r\n\t'what_did_you_think_review',\r\n\t'wishlist',\r\n\t'works_by_x',\r\n\t'written_by_staff_member_x_on_y',\r\n\t'written_on_x',\r\n\t'x_copies',\r\n\t'x_copies_last_purchased_on_y',\r\n\t'x_from_y_in_z',\r\n\t'x_items',\r\n\t'x_picks',\r\n\t'x_recommends_y',\r\n\t'x_titles',\r\n\t'xs_favorite_shelves',\r\n\t'xs_picks',\r\n\t'xs_take_on_y',\r\n\t'xs_wishlist',\r\n\t'xs_y_picks',\r\n\t'yes',\r\n\t'yes_delete',\r\n\t'you_have_been_part_of_a_new_service',\r\n\t'you_have_been_unsubscribed_from_our_recommendation_service',\r\n\t'your_bag_is_empty',\r\n\t'your_order',\r\n\t'your_x_has_been_removed',\r\n\t'your_x_has_been_saved',\r\n\t'your_x_has_been_updated',\r\n\t'zip_or_postal_code',\r\n\t'see_more_reviews_from_x',\r\n\t'newsletter_subscribe',\r\n]; // Add any other localization keys you need for your app here.\r\n","import React from 'react';\r\nimport { Spin } from 'antd';\r\n\r\nexport default function LoadingPage({ style }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\tLoading...\r\n\t\t
\r\n\t);\r\n}\r\n\r\nLoadingPage.defaultProps = {\r\n\tstyle: { padding: '5rem', fontSize: 20 },\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withRouter } from 'react-router-dom';\r\nimport { LocalizeProvider, withLocalize } from 'react-localize-redux';\r\nimport LocalizationInitializer from 'treeline-react-core-components/LocalizationInitializer';\r\nimport keys from './keys';\r\nimport LoadingPage from '../UI/LoadingPage';\r\n\r\nconst WrappedInit = withRouter(withLocalize(LocalizationInitializer));\r\n\r\nexport default class LocalizationInit extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.element,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst url = this.getLocalizationApiUrl();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{({ isLoadingTranslations }) => {\r\n\t\t\t\t\t\tif (isLoadingTranslations) {\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn this.props.children;\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\tgetLocalizationApiUrl = () => {\r\n\t\tconst { REACT_APP_LOCALIZATION_API_URL: url } = process.env;\r\n\t\treturn url;\r\n\t};\r\n}\r\n","import { ApiFetcher } from 'api-fetcher-treeline/dist';\r\n\r\nconst setupApiFetcher = (urlPrefix, config) => {\r\n\tconst api = new ApiFetcher(urlPrefix, config);\r\n\r\n\treturn api;\r\n};\r\n\r\nexport const urlPrefix = `${process.env.REACT_APP_API_URL}/api/customer360`;\r\nexport const eventsApiUrlPrefix = process.env.REACT_APP_EVENTS_API_URL;\r\n\r\nconst api = setupApiFetcher(urlPrefix);\r\n\r\nexport default api;\r\n\r\nexport const isBadRequest = err => {\r\n\treturn err && typeof err.message && err.message.indexOf('400') > -1;\r\n};\r\n\r\nexport const eventsApi = setupApiFetcher(`${eventsApiUrlPrefix}/api/events`);\r\n\r\nexport const e360Api = config =>\r\n\tsetupApiFetcher(`${process.env.REACT_APP_API_URL}/api/e360Mobile`, config);\r\n","export default class Convert {\r\n\tstatic toString(input) {\r\n\t\treturn typeof input === 'number' ? input.toString() : input;\r\n\t}\r\n\r\n\tstatic toNumber(input) {\r\n\t\tif (!input) return 0;\r\n\t\tif (typeof input === 'number') return input;\r\n\t\tconst asNum = parseInt(input);\r\n\t\treturn Number.isNaN(asNum) ? 0 : asNum;\r\n\t}\r\n}\r\n","import React from 'react';\r\n\r\n/**\r\n * @param {Element} Context\r\n * @param {String} nameOfDataStore\r\n * @returns {Function}\r\n */\r\nexport default (Context, nameOfDataStore) => (Component, mapStoreToProps) => {\r\n\treturn props => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{dataStore => {\r\n\t\t\t\t\tif (typeof mapStoreToProps === 'function') {\r\n\t\t\t\t\t\tconst storeProps = mapStoreToProps(dataStore, props);\r\n\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst fallbackProps = {\r\n\t\t\t\t\t\t[nameOfDataStore]: dataStore,\r\n\t\t\t\t\t\t...props,\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\treturn ;\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 PropTypes from 'prop-types';\r\nimport { withRouter } from 'react-router-dom';\r\nimport api from '../../api';\r\nimport queryString from 'query-string';\r\nimport Convert from '../../util/Convert';\r\nimport { notification } from 'antd';\r\nimport makeConnectTo from './makeConnectTo';\r\nimport { withLocalize } from 'react-localize-redux';\r\n\r\nexport const CustomerIDContext = React.createContext();\r\n\r\nexport const connectToCustomerID = makeConnectTo(\r\n\tCustomerIDContext,\r\n\t'customerState',\r\n);\r\n\r\nexport const useCustomerID = () => useContext(CustomerIDContext);\r\nexport const useReferralSource = () =>\r\n\tuseContext(CustomerIDContext).referralSource;\r\n\r\nconst notifyUserOfPreviewMode = translate => {\r\n\tnotification.info({ message: translate('not_applicable_in_preview_mode') });\r\n};\r\n\r\nexport const connectToPreviewMode = Component => {\r\n\treturn props => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{customerState => {\r\n\t\t\t\t\tconst previewMode = {\r\n\t\t\t\t\t\tnotify: () => customerState.notifyUserOfPreviewMode(),\r\n\t\t\t\t\t\tisActive: () => customerState.isPreviewMode,\r\n\t\t\t\t\t};\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const withIsUnknownCustomer = Component => {\r\n\treturn connectToCustomerID(Component, customerState => ({\r\n\t\tisUnknownCustomer: customerState.isUnknownCustomer,\r\n\t}));\r\n};\r\n\r\nconst isValidReferralSource = state => {\r\n\treturn (\r\n\t\ttypeof state.referralSourceOrgId === 'string' &&\r\n\t\tstate.referralSourceCustomerId !== null\r\n\t);\r\n};\r\n\r\nexport const withIsDemoBookstore = Component => {\r\n\treturn connectToCustomerID(Component, ({ orgId }) => ({\r\n\t\tisDemoBookstore: orgId === 'IBSG',\r\n\t}));\r\n};\r\n\r\nconst unknownCustomerId = '0';\r\n\r\nclass CustomerIDStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tmatch: PropTypes.object,\r\n\t\thistory: PropTypes.object,\r\n\t\tlocation: PropTypes.object,\r\n\t\tchildren: PropTypes.func,\r\n\t\ttranslate: PropTypes.func,\r\n\t};\r\n\r\n\tstate = {\r\n\t\torgId: null,\r\n\t\tcustomerId: unknownCustomerId,\r\n\t\temailAddress: '',\r\n\t\tmessageId: null,\r\n\t\tisLoading: true,\r\n\t\tdomainSourceOrgId: null,\r\n\t\treferralSourceOrgId: null,\r\n\t\treferralSourceCustomerId: null,\r\n\t\treferralSourceEmailAddress: null,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children(this.state)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tasync componentDidMount() {\r\n\t\tawait this.retrieveOrgId();\r\n\t\tthis.retrieveCustomerId();\r\n\t\tthis.retrieveMessageIdAndSetInState();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\torgId: state.orgId ? state.orgId : state.referralSourceOrgId,\r\n\t\tcustomerId: state.customerId,\r\n\t\tmessageId: state.messageId,\r\n\t\temailAddress: state.emailAddress,\r\n\t\tisPreviewMode: Convert.toNumber(state.customerId) === -1,\r\n\t\tisUnknownCustomer: Convert.toNumber(state.customerId) === 0,\r\n\t\treferralSource: {\r\n\t\t\torgId: state.referralSourceOrgId,\r\n\t\t\tcustomerId: state.referralSourceCustomerId,\r\n\t\t\temail: state.referralSourceEmailAddress,\r\n\t\t\tisValidReferral: isValidReferralSource(state),\r\n\t\t\tisUnknownCustomer:\r\n\t\t\t\tConvert.toNumber(state.referralSourceCustomerId) === 0,\r\n\t\t},\r\n\t\tsetCustomerId: customerId => {\r\n\t\t\tthis.setState({ customerId });\r\n\t\t},\r\n\t\tnotifyUserOfPreviewMode: () =>\r\n\t\t\tnotifyUserOfPreviewMode(this.props.translate),\r\n\t});\r\n\r\n\tasync retrieveOrgId() {\r\n\t\tawait this.getOrgFromUrl();\r\n\t}\r\n\r\n\tretrieveCustomerId() {\r\n\t\tconst hasIdentityInUrl = this.hasEncodedIdValuesInUrl();\r\n\t\tconst identityIsStored = this.localStorageHasIdentityToken();\r\n\r\n\t\tconst isKnownCustomer = hasIdentityInUrl || identityIsStored;\r\n\t\tconst hasReferralSourceToken = this.urlHasReferralSourceToken();\r\n\r\n\t\tif (hasIdentityInUrl) {\r\n\t\t\tthis.parseIdValuesInUrl();\r\n\t\t} else if (hasReferralSourceToken) {\r\n\t\t\tthis.parseReferralSourceFromUrl();\r\n\t\t} else if (identityIsStored && !hasIdentityInUrl) {\r\n\t\t\tthis.getIdentityTokenFromLocalStorage();\r\n\t\t} else if (!isKnownCustomer && this.hasStoredRefferalSourceToken()) {\r\n\t\t\tthis.deriveIdentityFromStoredReferralSource();\r\n\t\t} else {\r\n\t\t\tif (process.env.NODE_ENV === 'development') {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\torgId: `${process.env.REACT_APP_ORG_ID}`,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tthis.setState(state => {\r\n\t\t\t\tif (!state.orgId) {\r\n\t\t\t\t\tthrow new Error('No organization for the given hostname');\r\n\t\t\t\t}\r\n\t\t\t\treturn { ...state, isLoading: false };\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\thasEncodedIdValuesInUrl() {\r\n\t\treturn (\r\n\t\t\tthis.hasValidLocation() &&\r\n\t\t\tthis.urlContainsValidIdentityTokenParameter()\r\n\t\t);\r\n\t}\r\n\r\n\tparseIdValuesInUrl() {\r\n\t\tconst toDecrypt = this.getIdentityTokenToDecryptFromUrl();\r\n\t\tlocalStorage.setItem('data', toDecrypt);\r\n\t\tthis.decryptEncodedIdentityAndSetInState(toDecrypt);\r\n\t}\r\n\r\n\t// If there's a messgeId, there must also be an identityToken\r\n\tretrieveMessageIdAndSetInState() {\r\n\t\tconst { search: searchString } = this.props.location;\r\n\r\n\t\tconst identityIsStored = this.localStorageHasIdentityToken();\r\n\t\tconst urlHasIdentityToken = this.urlContainsValidIdentityTokenParameter();\r\n\r\n\t\tconst isInUrl = searchString.indexOf('&messageId=') > -1;\r\n\t\tconst isStored = typeof localStorage.getItem('messageId') === 'string';\r\n\r\n\t\tif (isInUrl && urlHasIdentityToken) {\r\n\t\t\tconst { messageId } = queryString.parse(searchString);\r\n\t\t\tlocalStorage.setItem('messageId', messageId);\r\n\t\t\tthis.setState({ messageId });\r\n\t\t} else if (isStored && identityIsStored) {\r\n\t\t\tconst id = localStorage.getItem('messageId');\r\n\t\t\tthis.setState({ messageId: id });\r\n\t\t}\r\n\t}\r\n\r\n\tgetIdentityTokenToDecryptFromUrl() {\r\n\t\tconst { location } = this.props;\r\n\t\tconst { data } = queryString.parse(location.search);\r\n\t\treturn data;\r\n\t}\r\n\r\n\tlocalStorageHasIdentityToken() {\r\n\t\treturn typeof localStorage.getItem('data') === 'string';\r\n\t}\r\n\r\n\tgetIdentityTokenFromLocalStorage() {\r\n\t\tconst toDecrypt = localStorage.getItem('data');\r\n\t\tthis.decryptEncodedIdentityAndSetInState(toDecrypt);\r\n\t}\r\n\r\n\thasValidLocation() {\r\n\t\tconst { location: loc } = this.props;\r\n\t\treturn loc && typeof loc.search === 'string' && loc.search.length > 0;\r\n\t}\r\n\r\n\turlContainsValidIdentityTokenParameter() {\r\n\t\treturn this.urlContainsParameter('?data=');\r\n\t}\r\n\r\n\tdecryptEncodedIdentityAndSetInState(toDecrypt) {\r\n\t\treturn api.post('/decrypt', toDecrypt).then(this.handleDecryptedIds);\r\n\t}\r\n\r\n\thandleDecryptedIds = decryptedStr => {\r\n\t\tconst { customerId, email, orgId } = queryString.parse(decryptedStr);\r\n\t\tthis.setState(state => {\r\n\t\t\tconst { domainSourceOrgId } = state;\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\torgId: domainSourceOrgId ? domainSourceOrgId : orgId,\r\n\t\t\t\tcustomerId: this.getCustomerIdToSet(state, orgId, customerId),\r\n\t\t\t\temailAddress: email ? email : '',\r\n\t\t\t\tisLoading: false,\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\tgetCustomerIdToSet(state, parsedOrgId, parsedCustomerId) {\r\n\t\tconst { domainSourceOrgId } = state;\r\n\t\tif (domainSourceOrgId) {\r\n\t\t\tconst isSameOrg = domainSourceOrgId === parsedOrgId;\r\n\t\t\treturn isSameOrg ? parsedCustomerId : unknownCustomerId;\r\n\t\t}\r\n\t\treturn parsedCustomerId ? parsedCustomerId : unknownCustomerId;\r\n\t}\r\n\r\n\tgetOrgFromUrl() {\r\n\t\treturn api\r\n\t\t\t.post('/store/search', {\r\n\t\t\t\tdomain: window.location.hostname,\r\n\t\t\t})\r\n\t\t\t.then(store => {\r\n\t\t\t\tconst orgId = store.orgId;\r\n\t\t\t\tthis.setState({ orgId, domainSourceOrgId: orgId });\r\n\t\t\t\treturn true;\r\n\t\t\t})\r\n\t\t\t.catch(error => {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t}\r\n\r\n\tparseReferralSourceFromUrl() {\r\n\t\tconst { location } = this.props;\r\n\t\tconst { referralsource } = queryString.parse(location.search);\r\n\t\treturn this.setStateWithReferralSource(referralsource);\r\n\t}\r\n\r\n\thasStoredRefferalSourceToken = () => {\r\n\t\treturn typeof localStorage.getItem('referralsource') === 'string';\r\n\t};\r\n\r\n\tderiveIdentityFromStoredReferralSource() {\r\n\t\tconst refSourceToken = localStorage.getItem('referralsource');\r\n\r\n\t\treturn api.post('/decrypt', refSourceToken).then(decrypted => {\r\n\t\t\tconst { orgId } = queryString.parse(decrypted);\r\n\r\n\t\t\tthis.setState(state => {\r\n\t\t\t\tconst { domainSourceOrgId } = state;\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...state,\r\n\t\t\t\t\torgId: domainSourceOrgId ? domainSourceOrgId : orgId,\r\n\t\t\t\t\tcustomerId: '0',\r\n\t\t\t\t\temailAddress: '',\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tsetStateWithReferralSource(referralSource) {\r\n\t\treturn api\r\n\t\t\t.post('/decrypt', referralSource)\r\n\t\t\t.then(decrypted =>\r\n\t\t\t\tthis.handleParsedReferralSourceToken(decrypted, referralSource),\r\n\t\t\t);\r\n\t}\r\n\r\n\thandleParsedReferralSourceToken = async (decryptedStr, encryptedToken) => {\r\n\t\tconst identityIsStored = this.localStorageHasIdentityToken();\r\n\t\tconst hasIdentityInUrl = this.urlContainsValidIdentityTokenParameter();\r\n\r\n\t\tconst isKnownCustomer = identityIsStored || hasIdentityInUrl;\r\n\t\tconst { customerId, email, orgId } = queryString.parse(decryptedStr);\r\n\r\n\t\tconst getNextState = state => ({\r\n\t\t\torgId: state.domainSourceOrgId ? state.domainSourceOrgId : orgId,\r\n\t\t\tisLoading: false,\r\n\t\t\treferralSourceOrgId: orgId,\r\n\t\t\treferralSourceCustomerId: customerId,\r\n\t\t\treferralSourceEmailAddress: email ? email : '',\r\n\t\t});\r\n\r\n\t\tif (!isKnownCustomer) {\r\n\t\t\tlocalStorage.setItem('referralsource', encryptedToken);\r\n\t\t\treturn this.setState(state => ({\r\n\t\t\t\t...state,\r\n\t\t\t\t...getNextState(state),\r\n\t\t\t\tcustomerId: '0',\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\temailAddress: '',\r\n\t\t\t}));\r\n\t\t}\r\n\r\n\t\tconst identityDataToken = this.getIdentityTokenToDecrypt();\r\n\r\n\t\tconst decrypted = await api.post('/decrypt', identityDataToken);\r\n\t\tconst identity = queryString.parse(decrypted);\r\n\r\n\t\tthis.setState(state => ({\r\n\t\t\t...state,\r\n\t\t\t...getNextState(state),\r\n\t\t\tcustomerId: this.getCustomerIdToSet(\r\n\t\t\t\tstate,\r\n\t\t\t\tidentity.orgId,\r\n\t\t\t\tidentity.customerId,\r\n\t\t\t),\r\n\t\t\tisLoading: false,\r\n\t\t\temailAddress: identity.email ? identity.email : null,\r\n\t\t}));\r\n\t};\r\n\r\n\tgetIdentityTokenToDecrypt() {\r\n\t\tif (this.localStorageHasIdentityToken()) {\r\n\t\t\treturn localStorage.getItem('data');\r\n\t\t}\r\n\t\treturn this.getIdentityTokenToDecryptFromUrl();\r\n\t}\r\n\r\n\turlHasReferralSourceToken() {\r\n\t\treturn this.urlContainsParameter('referralsource');\r\n\t}\r\n\r\n\turlContainsParameter(param) {\r\n\t\tconst { location: loc } = this.props;\r\n\t\treturn loc.search.indexOf(param) > -1;\r\n\t}\r\n}\r\n\r\nexport default withRouter(withLocalize(CustomerIDStore));\r\n","export const LogoShape = {\r\n\tlandscape: 'landscape',\r\n\tportrait: 'portrait',\r\n\tsquare: 'square',\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\nimport makeConnectTo from './makeConnectTo';\r\nimport { LogoShape } from '../UI/BooksellerLogo/LogoShape';\r\n\r\nconst LogoContext = React.createContext();\r\n\r\nexport const connectToLogo = makeConnectTo(LogoContext, 'logoStore');\r\nexport const useBooksellerLogoDataStore = () => useContext(LogoContext);\r\n\r\nexport const ImageType = {\r\n\tlogo: 1,\r\n\tsplash: 2,\r\n};\r\n\r\nclass BooksellerLogoStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tlogoUri: null,\r\n\t\tsplashUri: null,\r\n\t\tisLoading: true,\r\n\t\tisLoadingSplash: true,\r\n\t\tsplashPreviewSource: null,\r\n\t\tlogoShape: null,\r\n\t\tsplashIsVisible: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst store = this.getDataStore(this.state);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchBooksellerLogo();\r\n\t\tthis.fetchBooksellerSplash();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\t[this.logoFetch, this.splashFetch].forEach(r => api.revoke(r));\r\n\t}\r\n\r\n\tgetDataStore = state => ({\r\n\t\tstate,\r\n\t\tgetLogoUri: () => state.logoUri,\r\n\t\tgetSplashImage: () => state.splashUri,\r\n\t\tsetSplashUri: uri => this.setSplashUri(uri),\r\n\t\tgetSplashPreviewSource: () => state.splashPreviewSource,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tisLoadingSplash: () => state.isLoadingSplash,\r\n\t\thasSplashImage: () => !state.isLoadingSplash && state.splashUri,\r\n\t\tsetSplashPreviewSource: base64 => this.setSplashPreviewSource(base64),\r\n\t\tclearSplashPreview: () => this.setSplashPreviewSource(null),\r\n\t\thasSplashPreview: () => state.splashPreviewSource !== null,\r\n\t\tsetLogoShape: dimensions => this.setLogoShape(dimensions),\r\n\t\tgetLogoShape: () => state.logoShape,\r\n\t\tsetSplashVisbility: bool => this.setSplashVisbility(bool),\r\n\t\tgetSplashVisibility: () => state.splashIsVisible,\r\n\t});\r\n\r\n\tfetchBooksellerLogo() {\r\n\t\tthis.logoFetch = this.fetchLogoCancelable(ImageType.logo);\r\n\t\tthis.logoFetch.promise.then(this.cacheLogoUri).catch(err => {\r\n\t\t\tconsole.error(err.message);\r\n\t\t\tthis.setState(() => {\r\n\t\t\t\tthrow new Error('Failed to load logo');\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tcacheLogoUri = logoUri => {\r\n\t\tif (logoUri) {\r\n\t\t\tthis.setState({ logoUri, isLoading: false });\r\n\t\t} else {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t}\r\n\t};\r\n\r\n\tfetchBooksellerSplash() {\r\n\t\tthis.splashFetch = this.fetchLogoCancelable(ImageType.splash);\r\n\t\tthis.splashFetch.promise.then(this.cacheSplashUri).catch(err => {\r\n\t\t\tconsole.error(err.message);\r\n\t\t\tthis.setState(() => {\r\n\t\t\t\tthrow new Error('Failed to load splash');\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tcacheSplashUri = splashUri => {\r\n\t\tif (splashUri) {\r\n\t\t\tthis.setSplashUri(splashUri);\r\n\t\t} else {\r\n\t\t\tthis.setState({ isLoadingSplash: false });\r\n\t\t}\r\n\t};\r\n\r\n\tsetSplashUri = splashUri => {\r\n\t\tthis.setState({ splashUri, isLoadingSplash: false });\r\n\t};\r\n\r\n\tsetSplashPreviewSource = splashPreviewSource => {\r\n\t\tthis.setState({ splashPreviewSource });\r\n\t};\r\n\r\n\tfetchLogoCancelable = imageType => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\treturn api.cancelableGet(`/org/${orgId}/images/${imageType}`);\r\n\t};\r\n\r\n\tsetLogoShape = dimensions => {\r\n\t\tconst { height, width } = dimensions;\r\n\t\tif (height && width) {\r\n\t\t\tthis.setState({\r\n\t\t\t\tlogoShape:\r\n\t\t\t\t\tMath.abs(height - width) <= 20\r\n\t\t\t\t\t\t? LogoShape.square\r\n\t\t\t\t\t\t: height > width\r\n\t\t\t\t\t\t? LogoShape.portrait\r\n\t\t\t\t\t\t: LogoShape.landscape,\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tsetSplashVisbility = bool => {\r\n\t\tthis.setState({ splashIsVisible: bool });\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(BooksellerLogoStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\nimport { set } from 'lodash';\r\n\r\nconst ContentContext = React.createContext();\r\n\r\nexport const useBooksellerContentDataStore = () => {\r\n\treturn React.useContext(ContentContext);\r\n};\r\n\r\nexport const connectToSellerContent = Component => {\r\n\treturn props => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{bcs => }\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n};\r\n\r\nconst contentTypes = {\r\n\tstoreInfo: 'indie360.storeInfo',\r\n\tcustomerApp: 'indie360.customerApp',\r\n};\r\n\r\nclass BooksellerContentDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tstoreInfo: {\r\n\t\t\tlocation1: {\r\n\t\t\t\tlocationName: '',\r\n\t\t\t\taddress: {},\r\n\t\t\t\thours: {},\r\n\t\t\t\tphoneNumber: '',\r\n\t\t\t},\r\n\t\t\tlinks: {},\r\n\t\t},\r\n\t\tcustomerApp: {\r\n\t\t\tretailerMessageBody: '',\r\n\t\t\tretailerMessageTitle: '',\r\n\t\t\tstaffBios: {},\r\n\t\t},\r\n\t\tisLoading: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(this.getDataStore())\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchBooksellerContent();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.contentFetch.cancel && this.contentFetch.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetStoreLocations: () => this.getStoreLocations(),\r\n\t});\r\n\r\n\tgetStoreLocations = () => {\r\n\t\tconst { storeInfo } = this.state;\r\n\t\treturn storeInfo\r\n\t\t\t? Object.keys(storeInfo)\r\n\t\t\t\t\t.filter(key => key.includes('location'))\r\n\t\t\t\t\t.map(key => storeInfo[key])\r\n\t\t\t: [];\r\n\t};\r\n\r\n\tfetchBooksellerContent = () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\r\n\t\tconst booksellerContent = Object.values(contentTypes).map(\r\n\t\t\tcontentType => {\r\n\t\t\t\tconst endpoint = `/org/${orgId}/contents?contentType=${contentType}`;\r\n\t\t\t\tthis.contentFetch = api.get(endpoint);\r\n\t\t\t\treturn this.contentFetch;\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\treturn Promise.all(booksellerContent)\r\n\t\t\t.then(contentPairs =>\r\n\t\t\t\tcontentPairs.map((pairs, i) =>\r\n\t\t\t\t\tthis.parseContentIntoState(pairs, i),\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load Bookseller Content');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tparseContentIntoState = (contentPairs, i) => {\r\n\t\tconst contentType = Object.values(contentTypes)[i];\r\n\t\tconst contentTypeName = contentType.split('.')[1];\r\n\t\tconst content = this.state[contentTypeName];\r\n\t\tconst isLoading = i !== Object.keys(contentTypes).length - 1;\r\n\t\tif (content) {\r\n\t\t\tconst parsedContent =\r\n\t\t\t\tcontentType === contentTypes.storeInfo\r\n\t\t\t\t\t? this.parseStoreLocations(contentPairs)\r\n\t\t\t\t\t: this.parseContentPairs(contentTypeName, contentPairs);\r\n\t\t\treturn this.setState({\r\n\t\t\t\t[contentTypeName]: parsedContent,\r\n\t\t\t\tisLoading,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.setState({ isLoading });\r\n\t\t}\r\n\t};\r\n\r\n\tparseStoreLocations = contentPairs => {\r\n\t\treturn contentPairs\r\n\t\t\t.filter(c => c.value)\r\n\t\t\t.reduce((acc, c) => {\r\n\t\t\t\tconst isFirstLocation =\r\n\t\t\t\t\tc.key === 'locationName' ||\r\n\t\t\t\t\t(!c.key.includes('link') && !c.key.includes('location'));\r\n\t\t\t\tif (isFirstLocation) c.key = 'location1.' + c.key;\r\n\t\t\t\tacc = set(acc, c.key, c.value);\r\n\t\t\t\treturn acc;\r\n\t\t\t}, {});\r\n\t};\r\n\r\n\tparseContentPairs = (contentType, contentPairs) => {\r\n\t\treturn contentPairs.reduce(\r\n\t\t\t(acc, cp) => {\r\n\t\t\t\tif (cp.key.indexOf('.') === -1) {\r\n\t\t\t\t\tconst value =\r\n\t\t\t\t\t\tcp.key === 'staffBios'\r\n\t\t\t\t\t\t\t? JSON.parse(cp.value)\r\n\t\t\t\t\t\t\t: cp.value;\r\n\t\t\t\t\tacc[cp.key] = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst keys = cp.key.split('.');\r\n\t\t\t\t\tacc[keys[0]][keys[1]] = cp.value;\r\n\t\t\t\t}\r\n\t\t\t\treturn acc;\r\n\t\t\t},\r\n\t\t\t{ ...this.state[contentType] },\r\n\t\t);\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(BooksellerContentDataStore);\r\n","export const UnsubscribeScope = {\r\n\tall: 'All',\r\n\trecommendations: 'Recommendations',\r\n};\r\n\r\nexport const UnsubscribeEventType = {\r\n\tsubscribe: 'Subscribe',\r\n\tunsubscribe: 'Unsubscribe',\r\n};\r\n","const combineConnectors = connectors => Component => {\r\n\treturn connectors.reduce((WrappedComponent, connect) => {\r\n\t\treturn connect(WrappedComponent);\r\n\t}, Component);\r\n};\r\n\r\nexport default combineConnectors;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID, connectToPreviewMode } from './CustomerIDStore';\r\nimport { UnsubscribeScope, UnsubscribeEventType } from '../../unsubscribe';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport makeConnectTo from './makeConnectTo';\r\n\r\nconst CustomerSummaryContext = React.createContext();\r\n\r\nexport const connectToCustomer = makeConnectTo(\r\n\tCustomerSummaryContext,\r\n\t'customerDataStore',\r\n);\r\n\r\nexport const useCustomerSummaryDataStore = () => {\r\n\treturn React.useContext(CustomerSummaryContext);\r\n};\r\n\r\nclass CustomerSummaryDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tcustomerSummary: {},\r\n\t\tunsubscribes: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(dataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.setPreviewModeCustomer();\r\n\t\t}\r\n\t\tif (this.props.customerState.isUnknownCustomer) {\r\n\t\t\treturn this.setUnknownCustomer();\r\n\t\t}\r\n\t\tthis.fetchCustomerSummary();\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps) {\r\n\t\tconst prevCustomerId = prevProps.customerState.customerId;\r\n\t\tconst currentCustomerId = this.props.customerState.customerId;\r\n\r\n\t\tif (prevCustomerId !== currentCustomerId) {\r\n\t\t\tthis.fetchCustomerSummary();\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetFullName: () => this.getFullName(state),\r\n\t\tgetFirstName: () => state.customerSummary.firstName,\r\n\t\tgetLastName: () => state.customerSummary.lastName,\r\n\t\tgetEmailAddress: () => this.getEmailAddress(),\r\n\t\tsaveUnsubscribe: reason => this.saveUnsubscribe(reason),\r\n\t\tsaveReSubscribe: () => this.saveReSubscribe(),\r\n\t\tisUnsubscribedFromRecommendationEmails: () => {\r\n\t\t\treturn this.isUnsubscribedFromRecommendationEmails();\r\n\t\t},\r\n\t});\r\n\r\n\tgetEmailAddress = () => {\r\n\t\tconst { customerState } = this.props;\r\n\t\tconst { emailAddress } = customerState;\r\n\t\tconst isStr = typeof emailAddress === 'string';\r\n\r\n\t\tif (emailAddress && isStr && emailAddress.length > 1) {\r\n\t\t\treturn emailAddress;\r\n\t\t}\r\n\t\treturn '';\r\n\t};\r\n\r\n\tfetchCustomerSummary = () => {\r\n\t\tconst { orgId, customerId } = this.props.customerState;\r\n\t\tconst endpoint = `/org/${orgId}/customers/${customerId}/summary`;\r\n\r\n\t\tlet summary;\r\n\t\tthis.request = api.cancelableGet(endpoint);\r\n\r\n\t\treturn this.request.promise\r\n\t\t\t.then(customerSummary => {\r\n\t\t\t\tsummary = customerSummary;\r\n\r\n\t\t\t\tconst nextEndpoint = `/unsubscribeStatus/${customerId}`;\r\n\t\t\t\tthis.request = api.cancelableGet(nextEndpoint);\r\n\r\n\t\t\t\treturn this.request.promise;\r\n\t\t\t})\r\n\t\t\t.then(unsubscribes => {\r\n\t\t\t\treturn this.setState({\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\tcustomerSummary: summary,\r\n\t\t\t\t\tunsubscribes,\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load customer summary');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tsaveUnsubscribe = reason => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tconst dto = this.makeUnsubscribeDTO(reason);\r\n\t\treturn this.updateSubscriptionState(dto);\r\n\t};\r\n\r\n\tsaveReSubscribe = () => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tconst dto = this.makeReSubscribeDTO();\r\n\t\treturn this.updateSubscriptionState(dto);\r\n\t};\r\n\r\n\tupdateSubscriptionState = subscribeDTO => {\r\n\t\treturn api\r\n\t\t\t.post('/unsubscribe', subscribeDTO)\r\n\t\t\t.then(this.fetchCustomerSummary);\r\n\t};\r\n\r\n\tmakeUnsubscribeDTO = reason => ({\r\n\t\tcustomerId: this.props.customerState.customerId,\r\n\t\treason: reason ? reason : null,\r\n\t\tscope: UnsubscribeScope.recommendations,\r\n\t\tmethod: 'App',\r\n\t\teventType: UnsubscribeEventType.unsubscribe,\r\n\t\tmessageId: this.props.customerState.messageId,\r\n\t});\r\n\r\n\tmakeReSubscribeDTO = () => ({\r\n\t\tcustomerId: this.props.customerState.customerId,\r\n\t\tscope: UnsubscribeScope.recommendations,\r\n\t\tmethod: 'App',\r\n\t\teventType: UnsubscribeEventType.subscribe,\r\n\t});\r\n\r\n\tisUnsubscribedFromRecommendationEmails = () => {\r\n\t\tconst { unsubscribes } = this.state;\r\n\r\n\t\tif (!Array.isArray(unsubscribes) || this.props.previewMode.isActive()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < unsubscribes.length; i++) {\r\n\t\t\tconst record = unsubscribes[i];\r\n\r\n\t\t\tif (record.scope === UnsubscribeScope.recommendations) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tgetFullName = ({ customerSummary }) => {\r\n\t\tconst { firstName, lastName } = customerSummary;\r\n\t\treturn `${firstName} ${lastName}`;\r\n\t};\r\n\r\n\tsetPreviewModeCustomer() {\r\n\t\tconst customerSummary = this.getPreviewModeCustomerSummary();\r\n\t\tthis.setState({ isLoading: false, customerSummary });\r\n\t}\r\n\r\n\tgetPreviewModeCustomerSummary = () => ({\r\n\t\tcustomerId: -1,\r\n\t\temailAdd: '360testing@abovethetreeline.com',\r\n\t\tfavorites: [],\r\n\t\tfirstName: 'Tester',\r\n\t\tfirstPurchase: '2019-09-28T10:48:04',\r\n\t\thasEmail: true,\r\n\t\tlastName: 'Testing',\r\n\t\tlastPurchase: null,\r\n\t\tloyaltyExpiration: null,\r\n\t\trecencySegment: 'top',\r\n\t\trecommendationExclusions: [],\r\n\t\ttransactions: 3,\r\n\t\tvolumeSegment: 'low',\r\n\t});\r\n\r\n\tsetUnknownCustomer() {\r\n\t\tconst customerSummary = this.getUnknownCustomerSummary();\r\n\t\tthis.setState({ isLoading: false, customerSummary });\r\n\t}\r\n\r\n\tgetUnknownCustomerSummary = () => ({\r\n\t\tcustomerId: 0,\r\n\t\temailAdd: '',\r\n\t\tfavorites: [],\r\n\t\tfirstName: '',\r\n\t\tfirstPurchase: '2019-09-28T10:48:04',\r\n\t\thasEmail: false,\r\n\t\tlastName: '',\r\n\t\tlastPurchase: null,\r\n\t\tloyaltyExpiration: null,\r\n\t\trecencySegment: 'top',\r\n\t\trecommendationExclusions: [],\r\n\t\ttransactions: 0,\r\n\t\tvolumeSegment: 'low',\r\n\t});\r\n}\r\n\r\nconst connectors = [connectToCustomerID, connectToPreviewMode];\r\n\r\nexport default combineConnectors(connectors)(CustomerSummaryDataStore);\r\n","/**\r\n *\r\n * @param {Number} num\r\n * @param {String} label\r\n * Converts given label into plural if applicable\r\n */\r\nexport const toPlural = (num, label) => {\r\n\tconst n = typeof num === 'number' ? num : Number(num);\r\n\r\n\tconst base = `${n.toLocaleString()} ${label}`;\r\n\r\n\treturn n === 1 ? base : `${base}s`;\r\n};\r\n\r\nexport const formatAsDollarValue = value => {\r\n\tif (!value) return '$ 0';\r\n\tconst val = typeof value === 'number' ? value.toString() : value;\r\n\treturn `$ ${val}`.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\r\n};\r\n\r\n/**\r\n *\r\n * @param {Array} sourceArray\r\n * @param {String} property\r\n * @returns {Object}\r\n * Creates a map of array items by the found values of the given 'property'\r\n */\r\nexport const groupBy = (sourceArray, property) => {\r\n\treturn sourceArray.reduce((accumulator, nextItemInSourceArray) => {\r\n\t\tconst valueAtProperty = nextItemInSourceArray[property];\r\n\r\n\t\tif (!accumulator[valueAtProperty]) {\r\n\t\t\taccumulator[valueAtProperty] = [];\r\n\t\t}\r\n\r\n\t\taccumulator[valueAtProperty].push(nextItemInSourceArray);\r\n\t\treturn accumulator;\r\n\t}, {});\r\n};\r\n\r\n/**\r\n *\r\n * @param {String} src\r\n * @returns {String}\r\n * Capitalize the string. Make the first letter uppercase and return new formatted string.\r\n */\r\nexport const capitalize = src => {\r\n\treturn src.charAt(0).toUpperCase() + src.slice(1);\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport * as Util from '../../util';\r\nimport Convert from '../../util/Convert';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\nimport makeConnectTo from '../data/makeConnectTo';\r\nimport cloneDeep from 'lodash/cloneDeep';\r\n\r\nconst SectionsContext = React.createContext();\r\n\r\nconst name = 'sectionsDataStore';\r\nexport const connectToSections = makeConnectTo(SectionsContext, name);\r\n\r\nexport const useSectionsDataStore = () => {\r\n\treturn React.useContext(SectionsContext);\r\n};\r\n\r\n/**\r\n * Holds all the Sections and Departments for a given Org.\r\n */\r\n\r\nclass SectionsDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tisLoadingRecent: true,\r\n\t\tsections: [],\r\n\t\tdepartments: [],\r\n\t\tsectionsById: {},\r\n\t\tdepartmentsById: {},\r\n\t\trecentSectionIds: [], // Sections 'recently' purchased from by the customer\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst sectionsStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(sectionsStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchSections();\r\n\t\tthis.fetchRecentSectionIds();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetSections: () => state.sections,\r\n\t\tgetDepartments: () => state.departments,\r\n\t\tgetRecentSectionIds: () => {\r\n\t\t\tconst ids = this.getRecentSectionIds(state);\r\n\t\t\treturn ids.map(secId => Convert.toString(secId));\r\n\t\t},\r\n\t\tgetSection: sectionId => {\r\n\t\t\treturn this.getSection(state, sectionId);\r\n\t\t},\r\n\t\tgetSectionFromSectionCode: sectionCode => {\r\n\t\t\tconst { sections } = state;\r\n\t\t\treturn sections.find(s => s.sectionCode === sectionCode);\r\n\t\t},\r\n\t\tgetDepartment: deptId => {\r\n\t\t\treturn this.getDepartment(state, deptId);\r\n\t\t},\r\n\t\tisSection: entityId => {\r\n\t\t\tconst section = this.getSection(state, entityId);\r\n\t\t\treturn typeof section !== 'undefined';\r\n\t\t},\r\n\t\tisDepartment: entityId => {\r\n\t\t\tconst dept = this.getDepartment(state, entityId);\r\n\t\t\treturn typeof dept !== 'undefined';\r\n\t\t},\r\n\t});\r\n\r\n\tgetSection = (state, sectionId) => {\r\n\t\treturn state.sectionsById[Convert.toString(sectionId)];\r\n\t};\r\n\r\n\tgetDepartment = (state, deptId) => {\r\n\t\treturn state.departmentsById[Convert.toString(deptId)];\r\n\t};\r\n\r\n\tfetchRecentSectionIds = () => {\r\n\t\tconst { customerState: c } = this.props;\r\n\t\tconst endpoint = `/org/${c.orgId}/customers/${c.customerId}/sections/highlighted`;\r\n\r\n\t\treturn api\r\n\t\t\t.get(endpoint)\r\n\t\t\t.then(recentSectionIds => {\r\n\t\t\t\tconst rs = Array.isArray(recentSectionIds)\r\n\t\t\t\t\t? recentSectionIds\r\n\t\t\t\t\t: [];\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\trecentSectionIds: rs,\r\n\t\t\t\t\tisLoadingRecent: false,\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tthis.setState({ isLoadingRecent: false });\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t});\r\n\t};\r\n\r\n\tfetchSections = () => {\r\n\t\tconst { customerState: c } = this.props;\r\n\t\tthis.request = api.cancelableGet(`/org/${c.orgId}/sections`);\r\n\r\n\t\tthis.request.promise\r\n\t\t\t.then(response => {\r\n\t\t\t\tconst nextState = this.buildSectionsAndDepartments(response);\r\n\t\t\t\tthis.setState({ isLoading: false, ...nextState });\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load sections');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tgetRecentSectionIds = state => {\r\n\t\tconst topSections = this.getSectionsWithMostTransactions(10);\r\n\t\tconst topSectionIds = topSections.map(section => section.sectionId);\r\n\r\n\t\tif (!state.isLoadingRecent && state.recentSectionIds.length > 0) {\r\n\t\t\treturn [...state.recentSectionIds, ...topSectionIds];\r\n\t\t}\r\n\t\treturn topSectionIds;\r\n\t};\r\n\r\n\tgetSectionsWithMostTransactions = nSectionsRequired => {\r\n\t\tconst bestSellingSections = this.sortSectionsByBestSelling();\r\n\t\treturn bestSellingSections.slice(0, nSectionsRequired);\r\n\t};\r\n\r\n\tbuildSectionsAndDepartments = res => {\r\n\t\tconst sections = this.sortSectionsByName(res);\r\n\t\tconst sectionsById = this.buildSectionsById(res);\r\n\t\tconst { departments, departmentsById } = this.buildDepartments(res);\r\n\r\n\t\treturn {\r\n\t\t\tsections,\r\n\t\t\tdepartments,\r\n\t\t\tsectionsById,\r\n\t\t\tdepartmentsById,\r\n\t\t};\r\n\t};\r\n\r\n\tbuildDepartments(response) {\r\n\t\tconst sections = this.ensureAllSectionsHaveDeptId(response);\r\n\r\n\t\tconst sectionsGroupedByDeptId = Util.groupBy(sections, 'departmentId');\r\n\r\n\t\tconst depts = Object.keys(sectionsGroupedByDeptId).map(\r\n\t\t\tdepartmentId => ({\r\n\t\t\t\tdepartmentId,\r\n\t\t\t\tdepartmentName:\r\n\t\t\t\t\tsectionsGroupedByDeptId[departmentId][0].departmentName,\r\n\t\t\t\tsections: sectionsGroupedByDeptId[departmentId],\r\n\t\t\t\tcountOfSections: sectionsGroupedByDeptId[departmentId].length,\r\n\t\t\t}),\r\n\t\t);\r\n\r\n\t\tdepts.sort((a, b) =>\r\n\t\t\t('' + a.departmentName).localeCompare(b.departmentName),\r\n\t\t);\r\n\r\n\t\tconst departmentsById = {};\r\n\r\n\t\tObject.keys(sectionsGroupedByDeptId).forEach(departmentId => {\r\n\t\t\tdepartmentsById[departmentId] = {\r\n\t\t\t\tdepartmentId,\r\n\t\t\t\tdepartmentName:\r\n\t\t\t\t\tsectionsGroupedByDeptId[departmentId][0].departmentName,\r\n\t\t\t\tsections: sectionsGroupedByDeptId[departmentId],\r\n\t\t\t\tcountOfSections: sectionsGroupedByDeptId[departmentId].length,\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn { departments: depts, departmentsById };\r\n\t}\r\n\r\n\tensureAllSectionsHaveDeptId(response) {\r\n\t\tif (!Array.isArray(response)) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\treturn response.map(section => {\r\n\t\t\tif (section.departmentId && section.departmentId !== '0') {\r\n\t\t\t\treturn section;\r\n\t\t\t}\r\n\t\t\treturn { ...section, ...this.getOtherDepartment() };\r\n\t\t});\r\n\t}\r\n\r\n\tbuildSectionsById(sections) {\r\n\t\tconst sectionsById = {};\r\n\r\n\t\tsections.forEach(sec => {\r\n\t\t\tconst id = Convert.toString(sec.sectionId);\r\n\t\t\tsectionsById[id] = sec;\r\n\t\t});\r\n\r\n\t\treturn sectionsById;\r\n\t}\r\n\r\n\tsortSectionsByName(sections) {\r\n\t\treturn sections.sort((a, b) =>\r\n\t\t\t('' + a.sectionName).localeCompare(b.sectionName),\r\n\t\t);\r\n\t}\r\n\r\n\tsortSectionsByBestSelling() {\r\n\t\tconst sections = cloneDeep(this.state.sections);\r\n\t\treturn sections.sort((a, b) => b.transactions - a.transactions);\r\n\t}\r\n\r\n\tgetOtherDepartment = () => ({\r\n\t\tdepartmentId: '0',\r\n\t\tdepartmentName: 'Other',\r\n\t});\r\n}\r\n\r\nexport default connectToCustomerID(SectionsDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport makeConnectTo from './makeConnectTo';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\n\r\nconst OrgContext = React.createContext();\r\n\r\nexport const connectToOrg = makeConnectTo(OrgContext, 'orgDataStore');\r\n\r\nexport const useOrganizationDataStore = () => {\r\n\treturn React.useContext(OrgContext);\r\n};\r\n\r\nclass OrganizationDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\torganization: {},\r\n\t\tpreferenceData: [],\r\n\t\tordersSettings: {},\r\n\t\tshippingMethods: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tPromise.all([\r\n\t\t\tthis.fetchOrg(),\r\n\t\t\tthis.fetchPreferenceData(),\r\n\t\t\tthis.fetchShippingMethods(),\r\n\t\t]).then(() => {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps, prevState) {\r\n\t\tconst prevHasOrgName = this.hasOrgName(prevState);\r\n\t\tconst thisHasOrgName = this.hasOrgName(this.state);\r\n\r\n\t\tif (!prevHasOrgName && thisHasOrgName) {\r\n\t\t\twindow.document.title = this.getOrgName(this.state);\r\n\t\t}\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetOrgName: () => this.getOrgName(state),\r\n\t\tgetOrgCountry: () => state.organization.country,\r\n\t\tgetOrgShippingMethods: () => state.shippingMethods,\r\n\t});\r\n\r\n\thasOrgName = state => {\r\n\t\tconst { displayName, name, preferredName } = state.organization;\r\n\t\treturn (\r\n\t\t\tthis.isValidOrgName(name) ||\r\n\t\t\tthis.isValidOrgName(displayName) ||\r\n\t\t\tthis.isValidOrgName(preferredName)\r\n\t\t);\r\n\t};\r\n\r\n\tgetOrgName = (state = this.state) => {\r\n\t\tconst { displayName, name, preferredName } = state.organization;\r\n\t\tif (this.isValidOrgName(displayName)) return displayName;\r\n\t\tif (this.isValidOrgName(preferredName)) return preferredName;\r\n\t\treturn this.isValidOrgName(name) ? name : 'Your Bookstore';\r\n\t};\r\n\r\n\tisValidOrgName = name => typeof name === 'string' && name.length > 0;\r\n\r\n\tfetchOrg = () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\treturn api\r\n\t\t\t.get(`/org/${orgId}/organization`)\r\n\t\t\t.then(organization => {\r\n\t\t\t\treturn this.setState({ organization });\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load organization');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tfetchPreferenceData = () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\treturn api\r\n\t\t\t.get(`/org/${orgId}/info`)\r\n\t\t\t.then(preferenceData => {\r\n\t\t\t\treturn this.setState({ preferenceData });\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load organization preferences');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tfetchShippingMethods = () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\treturn api\r\n\t\t\t.get(`/orgs/${orgId}/shipping`)\r\n\t\t\t.then(shippingMethods => {\r\n\t\t\t\treturn this.setState({ shippingMethods });\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load shipping methods');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(OrganizationDataStore);\r\n","export const MMDDYYYYFormat = {\r\n\tyear: 'numeric',\r\n\tmonth: '2-digit',\r\n\tday: '2-digit',\r\n};\r\n\r\nexport const MMDDYYFormat = {\r\n\tyear: '2-digit',\r\n\tmonth: '2-digit',\r\n\tday: '2-digit',\r\n};\r\n\r\nexport const Day = {\r\n\tday: 'numeric',\r\n};\r\n\r\nexport const Month = {\r\n\tmonth: 'long',\r\n};\r\n\r\nexport const FullDateFormatNoDayOfWeek = {\r\n\tyear: 'numeric',\r\n\tmonth: 'long',\r\n\tday: 'numeric',\r\n};\r\n\r\nexport const FullDateFormat = {\r\n\tweekday: 'long',\r\n\tyear: 'numeric',\r\n\tmonth: 'long',\r\n\tday: 'numeric',\r\n};\r\n\r\nexport const FullDateFormatWithTime = {\r\n\tweekday: 'long',\r\n\tyear: 'numeric',\r\n\tmonth: 'long',\r\n\tday: 'numeric',\r\n\thour: 'numeric',\r\n\tminute: '2-digit',\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport makeConnectTo from '../data/makeConnectTo';\r\nimport { FullDateFormatNoDayOfWeek } from '../../dateFormats';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst TransactionsContext = React.createContext();\r\n\r\nexport const connectToTransactions = makeConnectTo(\r\n\tTransactionsContext,\r\n\t'transactionsDataStore',\r\n);\r\n\r\nexport const useTransactionsDataStore = () => {\r\n\treturn React.useContext(TransactionsContext);\r\n};\r\n\r\nexport class TransactionsDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\ttransactionsData: {\r\n\t\t\ttransactions: [],\r\n\t\t\tskus: [],\r\n\t\t\tskuPosData: {},\r\n\t\t\tskuUris: {},\r\n\t\t},\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(this.getDataStore())\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchTransactions();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.transactionsFetch);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tincludes: sku => this.purchasesIncludeSku(sku),\r\n\t\tgetSkuTransactions: sku => this.getSkuTransactions(sku),\r\n\t\tcountTransactions: sku => this.countTransactions(sku),\r\n\t});\r\n\r\n\tpurchasesIncludeSku(sku) {\r\n\t\treturn this.getSkus().includes(sku);\r\n\t}\r\n\r\n\tgetSkus = () => {\r\n\t\treturn this.state.transactionsData.skus;\r\n\t};\r\n\r\n\tgetSkuTransactions(sku) {\r\n\t\treturn this.state.transactionsData.transactions.filter(\r\n\t\t\ttr => tr.sku === sku,\r\n\t\t);\r\n\t}\r\n\r\n\tfetchTransactions = () => {\r\n\t\tconst { orgId, customerId } = this.props.customerState;\r\n\t\tconst endpoint = `/org/${orgId}/customer/${customerId}/transactions/transactions`;\r\n\r\n\t\tthis.transactionsFetch = api.cancelableGet(endpoint);\r\n\t\tthis.transactionsFetch.promise\r\n\t\t\t.then(this.cacheApiResponse)\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load transactions');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tcacheApiResponse = apiResponse => {\r\n\t\tconst transactionsData = this.getTransactionsData(apiResponse);\r\n\t\tthis.setState({ transactionsData, isLoading: false });\r\n\t};\r\n\r\n\tgetTransactionsData = apiResponse => {\r\n\t\tconst r = apiResponse;\r\n\t\treturn {\r\n\t\t\ttransactions: r.transactions,\r\n\t\t\tskus: r.transactions.map(t => t.sku),\r\n\t\t\tskuPosData: r.skuPosData,\r\n\t\t\tskuUris: r.productImageUrisBySku,\r\n\t\t};\r\n\t};\r\n\r\n\tcountTransactions = sku => {\r\n\t\tconst transactions = this.getSkuTransactions(sku);\r\n\r\n\t\tvar copies = 0;\r\n\t\tvar recentPurchase = new Date(\r\n\t\t\ttransactions[0].purchaseDate,\r\n\t\t).toLocaleDateString('en-US', FullDateFormatNoDayOfWeek);\r\n\r\n\t\ttransactions.forEach(transaction => {\r\n\t\t\tcopies += transaction.qty;\r\n\t\t});\r\n\t\tif (copies === 1) {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn (\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 connectToCustomerID(TransactionsDataStore);\r\n","export const HeaderLayout = {\r\n\tclassic: 'Classic',\r\n\toverlap: 'Overlap',\r\n};\r\n","export default __webpack_public_path__ + \"static/media/login_page_image.62b0f422.jpg\";","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\nimport makeConnectTo from './makeConnectTo';\r\nimport api from '../../api';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\nimport loginPageImage from '../../assets/images/login_page_image.jpg';\r\n\r\nconst customerAppPrefType = 'indie360.customerAppSettings';\r\n\r\nconst PreferencesContext = React.createContext();\r\n\r\nexport const connectToSellerPreferences = makeConnectTo(\r\n\tPreferencesContext,\r\n\t'preferencesDataStore',\r\n);\r\n\r\nexport const useBooksellerPreferencesDataStore = () => {\r\n\treturn React.useContext(PreferencesContext);\r\n};\r\n\r\nexport const useBooksellerAppSettings = () => {\r\n\tconst { getAppSettings } = useBooksellerPreferencesDataStore();\r\n\treturn getAppSettings();\r\n};\r\n\r\nconst defaultLoginPageImage = window.location.origin + loginPageImage;\r\n\r\nexport const appSettingsByKey = {\r\n\tappHeaderLogo: 'appHeaderLogo',\r\n\tdoIncludeCommerce: 'doIncludeCommerce',\r\n\tdoShowBookstoreLoyaltyPopup: 'doShowBookstoreLoyaltyPopup',\r\n\tdoShowBrowseShelvesPage: 'doShowBrowseShelvesPage',\r\n\tdoShowMessageOnExplorePageOnly: 'doShowMessageOnExplorePageOnly',\r\n\tdoShowCustomerAppBrandingWhenSharingCampaign:\r\n\t\t'doShowCustomerAppBrandingWhenSharingCampaign',\r\n\tgradientColor: 'gradientColor',\r\n\theaderColor: 'headerColor',\r\n\theaderLayout: 'headerLayout',\r\n\ticonColor: 'iconColor',\r\n\tloginPageImage: 'loginPageImage',\r\n\tpaypalEmailAddress: 'paypalEmailAddress',\r\n\tprimaryFont: 'primaryFont',\r\n\tprimaryColor: 'primaryColor',\r\n\tstaffReviewers: 'staffReviewers',\r\n\ttextColor: 'textColor',\r\n};\r\n\r\nconst initialAppSettings = {\r\n\tappHeaderLogo: null,\r\n\tdoIncludeCommerce: false,\r\n\tdoShowBookstoreLoyaltyPopup: true,\r\n\tdoShowBrowseShelvesPage: true,\r\n\tdoShowMessageOnExplorePageOnly: true,\r\n\tgradientColor: null,\r\n\theaderColor: '#ffffff',\r\n\theaderLayout: HeaderLayout.classic,\r\n\ticonColor: '#525050',\r\n\tloginPageImage: defaultLoginPageImage,\r\n\tpaypalEmailAdddress: null,\r\n\tprimaryFont: null,\r\n\tprimaryColor: '#005373',\r\n\tstaffReviewers: [],\r\n\ttextColor: '#525050',\r\n};\r\n\r\nexport const withSellerAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, store => ({\r\n\t\tappSettings: store.getAppSettings(),\r\n\t}));\r\n};\r\n\r\nclass BooksellerPreferencesDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.func,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tcustomerAppSettings: initialAppSettings,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(dataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchCustomerAppPreferences();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetAppSettings: () => state.customerAppSettings,\r\n\t\tgetAppSettingAtKey: key => state.customerAppSettings[key],\r\n\t\tgetGradient: () => this.getGradient(),\r\n\t\tgetStaffReviewerIds: () => this.getStaffReviewerIds(),\r\n\t});\r\n\r\n\tfetchCustomerAppPreferences = () => {\r\n\t\tthis.request = this.fetchPreferencesOfType(customerAppPrefType);\r\n\r\n\t\tthis.request.promise\r\n\t\t\t.then(preferenceDTOs => {\r\n\t\t\t\treturn this.buildPreferencePairs(preferenceDTOs);\r\n\t\t\t})\r\n\t\t\t.then(preferencesByName => {\r\n\t\t\t\tconst customerAppSettings = {\r\n\t\t\t\t\t...initialAppSettings,\r\n\t\t\t\t\t...preferencesByName,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.addCustomStyling(customerAppSettings);\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\tcustomerAppSettings,\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load store preferences');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tfetchPreferencesOfType = type => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\treturn api.cancelableGet(`/org/${orgId}/preferences?type=${type}`);\r\n\t};\r\n\r\n\tbuildPreferencePairs = preferenceDTOs => {\r\n\t\tlet nextState = {};\r\n\t\tif (!Array.isArray(preferenceDTOs)) return nextState;\r\n\r\n\t\tpreferenceDTOs.forEach(preferenceDTO => {\r\n\t\t\tnextState[preferenceDTO.name] = this.parseOneSettingValue(\r\n\t\t\t\tpreferenceDTO.value,\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn nextState;\r\n\t};\r\n\r\n\tparseOneSettingValue = settingValue => {\r\n\t\tif (settingValue === 'true') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (settingValue === 'false') {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this.isNumeric(settingValue)) {\r\n\t\t\treturn parseInt(settingValue);\r\n\t\t}\r\n\r\n\t\treturn settingValue;\r\n\t};\r\n\r\n\tisNumeric(settingValue) {\r\n\t\tif (typeof settingValue === 'number') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn !isNaN(Number(settingValue));\r\n\t}\r\n\r\n\tgetFontFamily = primaryFont => {\r\n\t\ttry {\r\n\t\t\treturn JSON.parse(primaryFont).fontFamily;\r\n\t\t} catch (e) {\r\n\t\t\treturn primaryFont;\r\n\t\t}\r\n\t};\r\n\r\n\taddCustomStyling = customerAppSettings => {\r\n\t\tconst {\r\n\t\t\tprimaryColor,\r\n\t\t\tprimaryFont,\r\n\t\t\ttextColor,\r\n\t\t\ticonColor,\r\n\t\t} = customerAppSettings;\r\n\r\n\t\tconst fontFamily = primaryFont ? this.getFontFamily(primaryFont) : null;\r\n\r\n\t\tlet varsToModify = {\r\n\t\t\t'@primary-color': primaryColor || '#005373',\r\n\t\t\t'@font-family': fontFamily || 'Open Sans',\r\n\t\t\t'@text-color': textColor || '#525050',\r\n\t\t\t'@icon-color': iconColor || textColor || '#525050',\r\n\t\t};\r\n\r\n\t\tif (fontFamily) {\r\n\t\t\tconst WebFont = require('webfontloader');\r\n\r\n\t\t\tWebFont.load({\r\n\t\t\t\tgoogle: {\r\n\t\t\t\t\tfamilies: ['Open Sans', fontFamily],\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\twindow.less.modifyVars(varsToModify);\r\n\t};\r\n\r\n\tgetGradient = () => {\r\n\t\tconst defaultGradient = '#ffffff, #f1f1f1';\r\n\t\tlet sellerGradient = this.state.customerAppSettings.gradientColor;\r\n\t\treturn `linear-gradient(${\r\n\t\t\tsellerGradient\r\n\t\t\t\t? sellerGradient.split('+').join(',')\r\n\t\t\t\t: defaultGradient\r\n\t\t})`;\r\n\t};\r\n\r\n\tgetStaffReviewerIds = () => {\r\n\t\tconst { staffReviewers } = this.state.customerAppSettings;\r\n\t\tconst reviewerIds = staffReviewers ? staffReviewers.toString() : [];\r\n\t\tif (reviewerIds && reviewerIds.length) {\r\n\t\t\treturn reviewerIds.includes(',')\r\n\t\t\t\t? reviewerIds.split(',')\r\n\t\t\t\t: [reviewerIds];\r\n\t\t}\r\n\t\treturn [];\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(BooksellerPreferencesDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { withSellerAppSettings } from '../../data/BooksellerPreferencesDataStore';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport {\r\n\tconnectToPreviewMode,\r\n\tconnectToCustomerID,\r\n} from '../../data/CustomerIDStore';\r\n\r\nconst BagContext = React.createContext();\r\n\r\nexport const useBagDataStore = () => React.useContext(BagContext);\r\n\r\nexport const connectToBag = makeConnectTo(BagContext, 'bagDataStore');\r\n\r\nconst shoppingCartGuidKey = 'shoppingCartGuid';\r\n\r\nclass BagDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.element,\r\n\t\tappSettings: PropTypes.shape({\r\n\t\t\tdoIncludeCommerce: PropTypes.bool,\r\n\t\t}),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\tbagItems: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst bagDataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { previewMode, appSettings } = this.props;\r\n\r\n\t\tif (previewMode.isActive() || !appSettings.doIncludeCommerce) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\t\tif (this.hasShoppingCart()) {\r\n\t\t\tthis.fetchCustomerCheckoutBag();\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetTitles: () => this.getTitles(state),\r\n\t\thasItems: () => state.bagItems.length > 0,\r\n\t\tsave: recommendableEntity => this.save(recommendableEntity),\r\n\t\tremove: recommendableEntity => this.remove(recommendableEntity),\r\n\t\tincludes: sku => this.includes(state.bagItems, sku),\r\n\t\trefresh: () => this.fetchCustomerCheckoutBag(),\r\n\t\tgetTotalEntitiesCount: () => state.bagItems.length,\r\n\t\tgetQuantitiesBySku: () => this.getQuantitiesBySku(state),\r\n\t\tupdateQuantity: (item, quantity) => {\r\n\t\t\treturn this.updateQuantity(item, quantity);\r\n\t\t},\r\n\t\tgetShoppingCartGuid: () => this.getShoppingCartGuid(),\r\n\t});\r\n\r\n\tfetchCustomerCheckoutBag() {\r\n\t\tconst guid = this.getShoppingCartGuid();\r\n\r\n\t\tif (!guid) {\r\n\t\t\treturn this.setState({\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\tbagItems: [],\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.request = api.cancelableGet(`/shoppingCarts/${guid}`);\r\n\r\n\t\treturn this.request.promise\r\n\t\t\t.then(shoppingCart => {\r\n\t\t\t\tif (shoppingCart.didCompleteOrder) {\r\n\t\t\t\t\tlocalStorage.removeItem(shoppingCartGuidKey);\r\n\t\t\t\t\treturn this.setState({\r\n\t\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\t\tbagItems: [],\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\tbagItems: shoppingCart.items,\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load checkout bag');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t}\r\n\r\n\tgetTitles = state => {\r\n\t\treturn state.bagItems.map(item => ({\r\n\t\t\tsku: item.sku,\r\n\t\t\tname: item.product.name,\r\n\t\t\tauthor: item.product.author,\r\n\t\t\timageUri: item.productImageUri,\r\n\t\t\tquantity: item.quantity,\r\n\t\t\tentity: item.product ? item.product : {},\r\n\t\t}));\r\n\t};\r\n\r\n\tincludes = (bagItems, sku) => {\r\n\t\tfor (let i = 0; i < bagItems.length; i++) {\r\n\t\t\tif (bagItems[i].sku === sku) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tsave = async recommendableEntity => {\r\n\t\tconst guid = this.getShoppingCartGuid();\r\n\t\tconst { orgId, customerId } = this.props.customerState;\r\n\t\tconst sku = recommendableEntity.id;\r\n\r\n\t\tif (guid === null) {\r\n\t\t\tconst shoppingCart = {\r\n\t\t\t\torgId,\r\n\t\t\t\tcustomerId,\r\n\t\t\t\titems: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsku,\r\n\t\t\t\t\t\tquantity: 1,\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t};\r\n\r\n\t\t\tconst endpoint = '/shoppingCarts';\r\n\t\t\tconst newShoppingCart = await api.post(endpoint, shoppingCart);\r\n\r\n\t\t\tif (newShoppingCart) {\r\n\t\t\t\tlocalStorage.setItem(shoppingCartGuidKey, newShoppingCart.id);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst shoppingCartItem = {\r\n\t\t\t\tshoppingCartGuid: guid,\r\n\t\t\t\tsku,\r\n\t\t\t\tquantity: 1,\r\n\t\t\t};\r\n\r\n\t\t\tconst endpoint = `/shoppingCarts/${guid}/items`;\r\n\t\t\tawait api.post(endpoint, shoppingCartItem);\r\n\t\t}\r\n\r\n\t\treturn this.fetchCustomerCheckoutBag();\r\n\t};\r\n\r\n\tremove = async recommendableEntity => {\r\n\t\tconst shoppingCartItem = this.getBagItem(recommendableEntity.id);\r\n\t\tif (!shoppingCartItem) return;\r\n\r\n\t\tconst cartItemToDelete = {\r\n\t\t\tid: shoppingCartItem.id,\r\n\t\t\tsku: shoppingCartItem.sku,\r\n\t\t\tshoppingCartGuid: shoppingCartItem.shoppingCartGuid,\r\n\t\t};\r\n\r\n\t\tconst endpoint = `/shoppingCarts/${shoppingCartItem.shoppingCartGuid}/items`;\r\n\t\tawait api.call('DELETE', endpoint, cartItemToDelete);\r\n\r\n\t\tconst bagItemCount = this.getBagItemCount();\r\n\t\tif (bagItemCount === 1) {\r\n\t\t\tlocalStorage.removeItem(shoppingCartGuidKey);\r\n\t\t}\r\n\r\n\t\treturn this.fetchCustomerCheckoutBag();\r\n\t};\r\n\r\n\tupdateQuantity = async (recommendableEntity, nextQuantity) => {\r\n\t\tconst shoppingCartItem = this.getBagItem(recommendableEntity.id);\r\n\r\n\t\tif (!shoppingCartItem) return;\r\n\r\n\t\tconst itemToUpdate = {\r\n\t\t\tid: shoppingCartItem.id,\r\n\t\t\tsku: shoppingCartItem.sku,\r\n\t\t\tquantity: nextQuantity,\r\n\t\t\tshoppingCartGuid: shoppingCartItem.shoppingCartGuid,\r\n\t\t};\r\n\r\n\t\tconst endpoint = `/shoppingCarts/${shoppingCartItem.shoppingCartGuid}/items`;\r\n\t\tconst updatedItem = await api.put(endpoint, itemToUpdate);\r\n\r\n\t\tconst nextBagItems = this.state.bagItems.map(item => {\r\n\t\t\tif (item.sku === updatedItem.sku) {\r\n\t\t\t\treturn updatedItem;\r\n\t\t\t}\r\n\t\t\treturn item;\r\n\t\t});\r\n\r\n\t\tthis.setState({ bagItems: nextBagItems });\r\n\t};\r\n\r\n\tgetQuantitiesBySku = (state = this.state) => {\r\n\t\treturn state.bagItems.reduce((quantitiesBySku, item) => {\r\n\t\t\tquantitiesBySku[item.sku] = item.quantity;\r\n\t\t\treturn quantitiesBySku;\r\n\t\t}, {});\r\n\t};\r\n\r\n\tgetBagItem = sku => {\r\n\t\treturn this.state.bagItems.find(item => item.sku === sku);\r\n\t};\r\n\r\n\tgetBagItemCount = () => {\r\n\t\treturn this.state.bagItems.length;\r\n\t};\r\n\r\n\thasShoppingCart() {\r\n\t\tconst guid = this.getShoppingCartGuid();\r\n\t\treturn guid !== null;\r\n\t}\r\n\r\n\tgetShoppingCartGuid = () => {\r\n\t\treturn localStorage.getItem(shoppingCartGuidKey);\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([\r\n\tconnectToPreviewMode,\r\n\twithSellerAppSettings,\r\n\tconnectToCustomerID,\r\n]);\r\n\r\nexport default connect(BagDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst ComponentConfig = PropTypes.shape({\r\n\tprops: PropTypes.object,\r\n\tcomponent: PropTypes.element,\r\n});\r\n\r\nconst propTypes = {\r\n\tchildren: PropTypes.element,\r\n\tcomponentConfigs: PropTypes.arrayOf(\r\n\t\tPropTypes.oneOfType([PropTypes.func, ComponentConfig]),\r\n\t),\r\n};\r\n\r\nfunction getComponentAndItsProps(componentConfig) {\r\n\tif (typeof componentConfig === 'object' && componentConfig.component) {\r\n\t\treturn componentConfig;\r\n\t}\r\n\treturn {\r\n\t\tcomponent: componentConfig,\r\n\t};\r\n}\r\n\r\nexport default function ContextAggregator({ componentConfigs, children }) {\r\n\treturn componentConfigs.reduce((WrappedChild, config) => {\r\n\t\tconst { component: C, props } = getComponentAndItsProps(config);\r\n\t\tif (props && typeof props === 'object') {\r\n\t\t\treturn {WrappedChild};\r\n\t\t}\r\n\t\treturn {WrappedChild};\r\n\t}, children);\r\n}\r\n\r\nContextAggregator.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID, connectToPreviewMode } from './CustomerIDStore';\r\nimport combineConnectors from './combineConnectors';\r\nimport makeConnectTo from './makeConnectTo';\r\n\r\nconst RatingsAndReviewsContext = React.createContext();\r\n\r\nexport const connectToRatingsAndReviews = makeConnectTo(\r\n\tRatingsAndReviewsContext,\r\n\t'ratingsAndReviewsDataStore',\r\n);\r\n\r\nexport const useRatingsAndReviewsDataStore = () => {\r\n\treturn React.useContext(RatingsAndReviewsContext);\r\n};\r\n\r\nclass RatingsAndReviewsDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\treviews: {},\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(dataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\t\tthis.fetchAllReviewsByCustomer();\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps) {\r\n\t\tconst prevCustomerId = prevProps.customerState.customerId;\r\n\t\tconst currentCustomerId = this.props.customerState.customerId;\r\n\r\n\t\tif (prevCustomerId !== currentCustomerId) {\r\n\t\t\tthis.fetchAllReviewsByCustomer();\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tfetchAllReviewsByCustomer: () => this.fetchAllReviewsByCustomer(),\r\n\t\tsave: (entity, review, type) =>\r\n\t\t\tthis.saveOneRatingOrReview(entity, review, type),\r\n\t\tupdate: (entity, review, type) =>\r\n\t\t\tthis.updateOneRatingOrReview(entity, review, type),\r\n\t\tremove: (entity, type) => this.deleteOneRatingOrReview(entity, type),\r\n\t\tgetRating: entityId => this.getRating(state, entityId),\r\n\t\tgetReview: entityId => this.getReview(state, entityId),\r\n\t});\r\n\r\n\tfetchAllReviewsByCustomer = () => {\r\n\t\tconst { orgId, customerId } = this.props.customerState;\r\n\t\treturn api\r\n\t\t\t.get(`/org/${orgId}/customer/${customerId}/reviews/title`)\r\n\t\t\t.then(reviews => this.setState({ isLoading: false, reviews }))\r\n\t\t\t.catch(err => {\r\n\t\t\t\tconsole.error(err.message);\r\n\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\tthrow new Error('Failed to load ratings and reviews');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tsaveOneRatingOrReview = (recommendableEntity, review, type) => {\r\n\t\tconst e = recommendableEntity;\r\n\t\tconst customerReviewDTO = this.getRatingOrReviewDTOFromEntity(e);\r\n\t\tcustomerReviewDTO[type] = review;\r\n\t\tconst request = api.post(`/customer/${type}`, customerReviewDTO);\r\n\r\n\t\treturn request.then(() => this.fetchAllReviewsByCustomer());\r\n\t};\r\n\r\n\tupdateOneRatingOrReview = (recommendableEntity, review, type) => {\r\n\t\tconst e = recommendableEntity;\r\n\t\tconst customerReviewDTO = this.getRatingOrReviewDTOFromEntity(e);\r\n\t\tcustomerReviewDTO[type] = review;\r\n\r\n\t\tconst request = api.put(`/customer/${type}`, customerReviewDTO);\r\n\r\n\t\treturn request.then(() => this.fetchAllReviewsByCustomer());\r\n\t};\r\n\r\n\tdeleteOneRatingOrReview = (recommendableEntity, type) => {\r\n\t\tconst e = recommendableEntity;\r\n\t\tconst customerReviewDTO = this.getRatingOrReviewDTOFromEntity(e);\r\n\r\n\t\treturn this.requestDelete(customerReviewDTO, type).then(() => {\r\n\t\t\treturn this.fetchAllReviewsByCustomer();\r\n\t\t});\r\n\t};\r\n\r\n\trequestDelete(customerReviewDTO, type) {\r\n\t\treturn api.call('DELETE', `/customer/${type}`, customerReviewDTO);\r\n\t}\r\n\r\n\tgetRatingOrReviewDTOFromEntity = recommendableEntity => {\r\n\t\tconst { customerId } = this.props.customerState;\r\n\t\treturn {\r\n\t\t\tcustomerId,\r\n\t\t\tentityType: recommendableEntity.type,\r\n\t\t\tentityId: recommendableEntity.id,\r\n\t\t};\r\n\t};\r\n\r\n\tgetRating = (state, entityId) => {\r\n\t\tconst ratings = state.reviews.customerRatings;\r\n\t\tconst entityRating =\r\n\t\t\tArray.isArray(ratings) &&\r\n\t\t\tratings.find(rating => {\r\n\t\t\t\treturn rating.entityId === entityId;\r\n\t\t\t});\r\n\t\treturn entityRating ? entityRating.rating : 0;\r\n\t};\r\n\r\n\tgetReview = (state, entityId) => {\r\n\t\tconst reviews = state.reviews.customerReviews;\r\n\t\tconst entityReview =\r\n\t\t\tArray.isArray(reviews) &&\r\n\t\t\treviews.find(review => {\r\n\t\t\t\treturn review.entityId === entityId;\r\n\t\t\t});\r\n\t\treturn entityReview ? entityReview.review : '';\r\n\t};\r\n}\r\n\r\nconst connectors = [connectToCustomerID, connectToPreviewMode];\r\nexport default combineConnectors(connectors)(RatingsAndReviewsDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport { useBooksellerLogoDataStore } from './BooksellerLogoStore';\r\nimport { useBooksellerContentDataStore } from './BooksellerContentDataStore';\r\nimport { useCustomerSummaryDataStore } from './CustomerSummaryDataStore';\r\nimport { useSectionsDataStore } from './SectionsDataStore';\r\nimport { useBooksellerPreferencesDataStore } from './BooksellerPreferencesDataStore';\r\nimport { useOrganizationDataStore } from './OrganizationDataStore';\r\nimport { useTransactionsDataStore } from './TransactionsDataStore';\r\nimport { useBagDataStore } from '../Bag/data/BagDataStore';\r\nimport { useRatingsAndReviewsDataStore } from './RatingsAndReviewsDataStore';\r\n\r\nGlobalDataStoresLoader.propTypes = {\r\n\tchildren: PropTypes.oneOfType([\r\n\t\tPropTypes.element,\r\n\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t]),\r\n};\r\n\r\nexport default function GlobalDataStoresLoader({ children }) {\r\n\tconst logoDataStore = useBooksellerLogoDataStore();\r\n\tconst contentsDataStore = useBooksellerContentDataStore();\r\n\tconst customerSummaryDataStore = useCustomerSummaryDataStore();\r\n\r\n\tconst sectionsDataStore = useSectionsDataStore();\r\n\tconst organizationDataStore = useOrganizationDataStore();\r\n\tconst preferencesDataStore = useBooksellerPreferencesDataStore();\r\n\r\n\tconst bagDataStore = useBagDataStore();\r\n\tconst transactionsDataStore = useTransactionsDataStore();\r\n\tconst ratingsAndReviewsDataStore = useRatingsAndReviewsDataStore();\r\n\r\n\tconst dataStores = [\r\n\t\tbagDataStore,\r\n\t\tlogoDataStore,\r\n\t\tcontentsDataStore,\r\n\t\tsectionsDataStore,\r\n\t\torganizationDataStore,\r\n\t\tpreferencesDataStore,\r\n\t\ttransactionsDataStore,\r\n\t\tcustomerSummaryDataStore,\r\n\t\tratingsAndReviewsDataStore,\r\n\t];\r\n\r\n\tconst dataStoresDidLoad = () => {\r\n\t\tfor (let i = 0; i < dataStores.length; i++) {\r\n\t\t\tif (dataStores[i].isLoading()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\r\n\tif (dataStoresDidLoad()) {\r\n\t\treturn children;\r\n\t}\r\n\treturn ;\r\n}\r\n","import React, { useState, useEffect, useContext } from 'react';\r\nimport { UserManager, Log } from 'oidc-client';\r\nimport { useCustomerID } from '../data/CustomerIDStore';\r\nimport api from '../../api';\r\n\r\nexport const AuthContext = React.createContext();\r\n\r\nexport const AuthProvider = ({ authOptions, children }) => {\r\n\tconst { oidcClientOptions } = authOptions;\r\n\r\n\tconst [isAuthenticating, setIsAuthenticating] = useState(true);\r\n\tconst [isAuthenticated, setIsAuthenticated] = useState(false);\r\n\r\n\tconst [user, setUser] = useState(null);\r\n\tconst [userManager] = useState(() => new UserManager(oidcClientOptions));\r\n\r\n\tconst { orgId } = useCustomerID();\r\n\tconst { setCustomerId } = useCustomerID();\r\n\r\n\tuseEffect(() => {\r\n\t\tconst initAuth = async () => {\r\n\t\t\tconsole.debug('initialize auth provider - start');\r\n\r\n\t\t\t// occurs when signinSilent and signinSilentCallback are called\r\n\t\t\tuserManager.events.addUserLoaded(user => {\r\n\t\t\t\tconsole.debug('user loaded');\r\n\t\t\t\tsetUser(user);\r\n\t\t\t\tsetIsAuthenticated(true);\r\n\t\t\t});\r\n\r\n\t\t\tconst { oidcClientLoggerOptions } = authOptions;\r\n\r\n\t\t\tif (oidcClientLoggerOptions) {\r\n\t\t\t\tLog.logger = oidcClientLoggerOptions.logger;\r\n\t\t\t\tLog.level = oidcClientLoggerOptions.level;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.debug('attempting to signin');\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst user = await userManager.signinSilent();\r\n\t\t\t\tconsole.debug('signin successful - ' + user.profile.name);\r\n\r\n\t\t\t\tapi.setFetchOptions({\r\n\t\t\t\t\tmode: 'cors',\r\n\t\t\t\t\theaders: new Headers({\r\n\t\t\t\t\t\t'Content-Type': 'application/json',\r\n\t\t\t\t\t\tAuthorization: 'Bearer ' + user.access_token,\r\n\t\t\t\t\t}),\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconst customer = await api.post(`/signin?orgId=${orgId}`);\r\n\t\t\t\tsetCustomerId(customer.customerId);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.debug('signin failed - ' + error.message);\r\n\t\t\t} finally {\r\n\t\t\t\t// Regardless of the signin outcome, the AuthProvider is now initialized\r\n\t\t\t\tsetIsAuthenticating(false);\r\n\t\t\t}\r\n\r\n\t\t\tconsole.debug('initialize auth provider - end');\r\n\t\t};\r\n\r\n\t\tinitAuth();\r\n\t\t// eslint-disable-next-line\r\n\t}, [authOptions, userManager]);\r\n\r\n\tconst loginWithRedirect = signinParams => {\r\n\t\tconsole.debug(\r\n\t\t\t'signing in via redirect - return uri: ' +\r\n\t\t\t\tsigninParams.state.returnUri,\r\n\t\t);\r\n\r\n\t\tuserManager.clearStaleState();\r\n\t\tuserManager.signinRedirect(signinParams);\r\n\t};\r\n\r\n\tconst logoutWithRedirect = () => {\r\n\t\tconst idToken = getIdToken();\r\n\t\tconst signoutParams = idToken ? { logoutId: idToken } : null;\r\n\r\n\t\tconsole.debug('signing out via redirect - logoutId: ' + idToken);\r\n\r\n\t\tuserManager.signoutRedirect(signoutParams);\r\n\t\tuserManager.clearStaleState();\r\n\t};\r\n\r\n\tconst getIdToken = () => user && user.id_token;\r\n\r\n\tconst getAccessToken = () => user && user.access_token;\r\n\r\n\tconst getProfile = () => user && user.profile;\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\r\nexport const AuthConsumer = AuthContext.Consumer;\r\nexport const useAuth = () => useContext(AuthContext);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport BooksellerLogoStore from './BooksellerLogoStore';\r\nimport BooksellerContentDataStore from './BooksellerContentDataStore';\r\nimport CustomerSummaryDataStore from './CustomerSummaryDataStore';\r\nimport SectionsDataStore from './SectionsDataStore';\r\nimport OrganizationDataStore from './OrganizationDataStore';\r\nimport TransactionsDataStore from './TransactionsDataStore';\r\nimport BagDataStore from '../Bag/data/BagDataStore';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport ContextAggregator from '../context/ContextAggregator';\r\nimport GlobalDataStoresLoader from './GlobalDataStoresLoader';\r\nimport BooksellerPreferencesDataStore from './BooksellerPreferencesDataStore';\r\nimport RatingsAndReviewsDataStore from './RatingsAndReviewsDataStore';\r\nimport { useAuth } from '../Auth/AuthProvider';\r\n\r\nconst dataStores = [\r\n\tBagDataStore,\r\n\tSectionsDataStore,\r\n\tBooksellerLogoStore,\r\n\tTransactionsDataStore,\r\n\tOrganizationDataStore,\r\n\tCustomerSummaryDataStore,\r\n\tBooksellerContentDataStore,\r\n\tRatingsAndReviewsDataStore,\r\n];\r\n\r\nGlobalDataStores.propTypes = {\r\n\tchildren: PropTypes.oneOfType([\r\n\t\tPropTypes.element,\r\n\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t]),\r\n};\r\n\r\nexport default function GlobalDataStores({ children }) {\r\n\tconst { isAuthenticating } = useAuth();\r\n\r\n\tif (isAuthenticating) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ isLoading }) => {\r\n\t\t\t\tif (isLoading()) {\r\n\t\t\t\t\treturn ;\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\t{children}\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 PropTypes from 'prop-types';\r\nimport { withWindowSize } from 'react-fns';\r\n\r\nexport const WindowSizeContext = React.createContext();\r\n\r\nexport const useWindowSize = () => React.useContext(WindowSizeContext);\r\n\r\nclass WindowSizeProvider extends React.Component {\r\n\tstatic propTypes = {\r\n\t\twidth: PropTypes.number,\r\n\t\theight: PropTypes.number,\r\n\t\tchildren: PropTypes.element,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { width, height } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default withWindowSize(WindowSizeProvider);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class ErrorBoundary extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]).isRequired,\r\n\t\tFallbackComponent: PropTypes.oneOfType([\r\n\t\t\tPropTypes.func,\r\n\t\t\tPropTypes.element,\r\n\t\t]), // not required\r\n\t};\r\n\r\n\tstate = { hasError: false, error: { message: null, details: null } };\r\n\r\n\trender() {\r\n\t\tconst { FallbackComponent: Fallback } = this.props;\r\n\r\n\t\tif (this.state.hasError) {\r\n\t\t\t// Render any custom fallback UI\r\n\t\t\treturn Fallback ? : this.defaultFallback();\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n\r\n\t// Update state so the next render will show the fallback UI.\r\n\tstatic getDerivedStateFromError() {\r\n\t\treturn { hasError: true };\r\n\t}\r\n\r\n\t// Log the error to an error reporting service\r\n\tcomponentDidCatch(error, info) {\r\n\t\tthis.setState({\r\n\t\t\terror: {\r\n\t\t\t\tmessage: error.message,\r\n\t\t\t\tdetails: info.componentStack,\r\n\t\t\t},\r\n\t\t});\r\n\t\tconsole.error(error, info);\r\n\t}\r\n\r\n\tdefaultFallback() {\r\n\t\tconst rootStyle = {\r\n\t\t\tpadding: '2rem',\r\n\t\t\tpaddingTop: '5rem',\r\n\t\t\theight: '100vh',\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t

\r\n\t\t\t\t\tSorry, something went wrong. Thanks for bearing with us as\r\n\t\t\t\t\twe continue to refine the Edelweiss Indie360 beta.\r\n\t\t\t\t

\r\n\t\t\t\t\r\n\t\t\t\t\tError: {this.state.error.message}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{this.state.error.details}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n","const authOptions = {\r\n\t// https://github.com/IdentityModel/oidc-client-js/wiki\r\n\toidcClientOptions: {\r\n\t\tauthority: process.env.REACT_APP_OIDC_CLIENT_AUTHORITY_URI,\r\n\t\tclient_id: process.env.REACT_APP_OIDC_CLIENT_CLIENT_ID,\r\n\t\tredirect_uri:\r\n\t\t\twindow.location.origin +\r\n\t\t\tprocess.env.REACT_APP_OIDC_CLIENT_AUTH_CALLBACK_PATH,\r\n\t\tpost_logout_redirect_uri: window.location.origin,\r\n\t\tresponse_type: 'code',\r\n\t\tscope: process.env.REACT_APP_OIDC_CLIENT_SCOPE,\r\n\t\tfilterProtocolClaims: true,\r\n\t\tloadUserInfo: true,\r\n\t\tautomaticSilentRenew: true,\r\n\t\tsilent_redirect_uri:\r\n\t\t\twindow.location.origin +\r\n\t\t\tprocess.env.REACT_APP_OIDC_CLIENT_SILENT_REFRESH_CALLBACK_PATH,\r\n\t},\r\n\toidcClientLoggerOptions: {\r\n\t\tlogger: console,\r\n\t\tlevel: process.env.REACT_APP_OIDC_CLIENT_LOGGER_LEVEL,\r\n\t},\r\n};\r\n\r\nexport default authOptions;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LocalizationInit from './Localization/LocalizationInit';\r\nimport GlobalDataStores from './data/GlobalDataStores';\r\nimport WindowSizeProvider from './context/WindowSize';\r\nimport ErrorBoundary from './UI/Error/ErrorBoundary';\r\nimport CustomerIDStore from './data/CustomerIDStore';\r\nimport { AuthProvider } from './Auth/AuthProvider';\r\nimport authOptions from '../auth/authOptions';\r\nimport LoadingPage from './UI/LoadingPage';\r\n\r\nexport default class AppFrame extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]),\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\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{({ isLoading }) => {\r\n\t\t\t\t\t\t\t\t\tif (isLoading) {\r\n\t\t\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\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\r\n\t\t\t\t\t\t\t\t\t\t\t\t{this.props.children}\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 Convert from '../util/Convert';\r\n\r\nexport default class TitleAggregateParser {\r\n\taggregate = {};\r\n\r\n\tconstructor(aggregate) {\r\n\t\tthis.aggregate = aggregate;\r\n\t}\r\n\r\n\tbuildTitles() {\r\n\t\treturn this.getSkuList()\r\n\t\t\t.map(sku => this.buildOneTitle(sku))\r\n\t\t\t.filter(title => this.hasPrice(title));\r\n\t}\r\n\r\n\tgetSkuList = () => {\r\n\t\treturn this.aggregate.skus || Object.keys(this.aggregate.productsBySku);\r\n\t};\r\n\r\n\tbuildOneTitle = sku => ({\r\n\t\t...this.getTitleProductData(sku),\r\n\t\tpos: this.getTitlePOSData(sku),\r\n\t\treviews: this.getTitleReviews(sku),\r\n\t\timageUri: this.getTitleImageUri(sku),\r\n\t\toffers: this.getOffersForOneTitle(sku),\r\n\t\tcurrentRecs: this.getCurrentRecsForSku(sku),\r\n\t\thasImageUri: this.hasImageUri(sku),\r\n\t\teCommerceUri: this.getEcommerceUri(sku),\r\n\t});\r\n\r\n\thasPrice = title =>\r\n\t\t(Array.isArray(title.pos) &&\r\n\t\t\ttitle.pos.length &&\r\n\t\t\ttitle.pos[0].listPrice) ||\r\n\t\ttitle.retailPrice;\r\n\r\n\tgetTitleProductData(sku) {\r\n\t\tconst { productsBySku } = this.aggregate;\r\n\r\n\t\tif (productsBySku && sku in productsBySku) {\r\n\t\t\treturn productsBySku[sku];\r\n\t\t}\r\n\t\treturn { name: 'Title' };\r\n\t}\r\n\r\n\tgetTitlePOSData(sku) {\r\n\t\tconst { skuPosData } = this.aggregate;\r\n\r\n\t\tif (skuPosData && sku in skuPosData) {\r\n\t\t\treturn skuPosData[sku];\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n\r\n\tgetTitleImageUri(sku) {\r\n\t\tconst { productImageUrisBySku } = this.aggregate;\r\n\r\n\t\tif (productImageUrisBySku && sku in productImageUrisBySku) {\r\n\t\t\treturn productImageUrisBySku[sku];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\thasImageUri(sku) {\r\n\t\tconst imageUri = this.getTitleImageUri(sku);\r\n\t\tif (!imageUri || typeof imageUri !== 'string') return false;\r\n\t\treturn !imageUri.includes('/noimage.png');\r\n\t}\r\n\r\n\tgetCurrentRecsForSku(sku) {\r\n\t\tconst { currentRecommendationsBySku: recsBySku } = this.aggregate;\r\n\r\n\t\tif (recsBySku && recsBySku[sku]) {\r\n\t\t\treturn recsBySku[sku];\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n\r\n\tgetTitleReviews(sku) {\r\n\t\tconst { reviews } = this.aggregate;\r\n\r\n\t\tif (Array.isArray(reviews)) {\r\n\t\t\tconst skuReviews = reviews.filter(r => r.sku === sku);\r\n\t\t\treturn skuReviews.map(this.addUserDataToReview);\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n\r\n\taddUserDataToReview = skuReview => {\r\n\t\tconst { userAvatarsByAppUserId, usersById } = this.aggregate;\r\n\t\tconst userId = Convert.toString(skuReview.appUserId);\r\n\r\n\t\tconst user = usersById ? usersById[userId] : {};\r\n\t\tconst av = userAvatarsByAppUserId ? userAvatarsByAppUserId[userId] : {};\r\n\r\n\t\treturn { ...skuReview, avatar: av ? av : {}, user: user ? user : {} };\r\n\t};\r\n\r\n\tgetOffersForOneTitle(sku) {\r\n\t\tconst { offersBySku } = this.aggregate;\r\n\r\n\t\tif (offersBySku && sku in offersBySku) {\r\n\t\t\treturn offersBySku[sku];\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n\r\n\tgetStaffPicksBySku(sku) {\r\n\t\tconst { staffPicksBySku } = this.aggregate;\r\n\r\n\t\tif (staffPicksBySku && sku in staffPicksBySku) {\r\n\t\t\treturn staffPicksBySku[sku];\r\n\t\t}\r\n\t\treturn [];\r\n\t}\r\n\r\n\tgetEcommerceUri(sku) {\r\n\t\tconst { eCommerceUrisBySku } = this.aggregate;\r\n\r\n\t\tif (eCommerceUrisBySku && sku in eCommerceUrisBySku) {\r\n\t\t\treturn eCommerceUrisBySku[sku];\r\n\t\t}\r\n\t\treturn '';\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withRouter } from 'react-router-dom';\r\nimport api from '../../../api';\r\nimport TitleAggregateParser from '../../../title/TitleAggregateParser';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\n\r\nconst CollectionContext = React.createContext();\r\n\r\nexport class CollectionStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// react router props\r\n\t\tmatch: PropTypes.object,\r\n\t\thistory: PropTypes.object,\r\n\t\tlocation: PropTypes.object,\r\n\t\t// customer state props\r\n\t\tcustomerState: PropTypes.object,\r\n\t\t// passed in from parent\r\n\t\tchildren: PropTypes.func,\r\n\t};\r\n\r\n\tstatic connect = (Component, mapToProps) => {\r\n\t\treturn props => {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{collectionStore => {\r\n\t\t\t\t\t\tconst store = collectionStore;\r\n\r\n\t\t\t\t\t\tif (typeof mapToProps === 'function') {\r\n\t\t\t\t\t\t\tconst storeProps = mapToProps(store);\r\n\t\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn ;\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\tstate = {\r\n\t\ttitles: [],\r\n\t\tcatalog: {},\r\n\t\tisLoading: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children(dataStore)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchCollection().then(this.handleResponse);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tgetCatalog: () => state.catalog,\r\n\t});\r\n\r\n\tfetchCollection = () => {\r\n\t\tconst { match, customerState: c } = this.props;\r\n\t\tconst endpoint = `/org/${c.orgId}/catalogs/${match.params.catalogId}/titles`;\r\n\t\treturn api.get(endpoint);\r\n\t};\r\n\r\n\thandleResponse = aggregateResponse => {\r\n\t\tconst parser = new TitleAggregateParser(aggregateResponse);\r\n\t\tconst catalog = this.getCatalogFromAggregate(aggregateResponse);\r\n\r\n\t\tconst titles = parser.buildTitles();\r\n\t\tthis.setState({ titles, catalog, isLoading: false });\r\n\t};\r\n\r\n\tgetCatalogFromAggregate(aggregateResponse) {\r\n\t\tif (aggregateResponse.catalog) {\r\n\t\t\treturn aggregateResponse.catalog;\r\n\t\t}\r\n\t\treturn {};\r\n\t}\r\n}\r\n\r\nexport default connectToCustomerID(withRouter(CollectionStore));\r\n","import React from 'react';\r\nimport { WindowSizeContext } from '../context/WindowSize';\r\n\r\nconst WithIsMobileContext = React.createContext();\r\nexport const useWithIsMobile = () => React.useContext(WithIsMobileContext);\r\n\r\nexport default function withIsMobile(Component, mobileThreshold = 815) {\r\n\treturn class MobileIdentifier extends React.Component {\r\n\t\trender() {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{windowSize => (\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\r\n\t\tinitIsMobile = ({ width }) => (target = mobileThreshold) => {\r\n\t\t\tif (typeof width !== 'number' || width === 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn width <= target;\r\n\t\t};\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\n\r\nfunction PageTitle({ isMobile, content, styleOverrides }) {\r\n\tconst { getGradient } = useBooksellerPreferencesDataStore();\r\n\treturn (\r\n\t\t\r\n\t\t\t
{content}
\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(PageTitle);\r\n\r\nPageTitle.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tstyleOverrides: PropTypes.object,\r\n};\r\n\r\nPageTitle.defaultProps = {\r\n\tstyleOverrides: {},\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport PageTitle from '../../UI/PageTitle';\r\nimport { CollectionStore } from '../data/CollectionStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass CollectionHeader extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisLoading: PropTypes.bool,\r\n\t\tcatalogName: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst content = this.getHeaderContent();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetHeaderContent() {\r\n\t\tif (this.props.isLoading) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\r\n\t\tif (this.props.catalogName) {\r\n\t\t\treturn this.props.catalogName;\r\n\t\t}\r\n\t\treturn this.getDefaultContent();\r\n\t}\r\n\r\n\tgetDefaultContent() {\r\n\t\treturn ;\r\n\t}\r\n}\r\n\r\nexport default CollectionStore.connect(CollectionHeader, s => ({\r\n\tisLoading: s.state.isLoading,\r\n\tcatalogName: s.getCatalog().name,\r\n}));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactHtmlParser from 'react-html-parser';\r\nimport { CollectionStore } from '../data/CollectionStore';\r\nimport { Card } from 'antd';\r\nimport './collectionOverview.css';\r\n\r\nclass CollectionOverview extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisLoading: PropTypes.bool,\r\n\t\toverview: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { overview, isLoading } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t{ReactHtmlParser(overview)}\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 CollectionStore.connect(CollectionOverview, collectionStore => ({\r\n\tisLoading: collectionStore.state.isLoading,\r\n\toverview: collectionStore.getCatalog().overview,\r\n}));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport api from '../../../api';\r\n\r\nconst WishlistSkusContext = React.createContext();\r\n\r\nconst name = 'wishlistSkusDataStore';\r\nexport const connectToWishlistSkus = makeConnectTo(WishlistSkusContext, name);\r\n\r\nconst actions = {\r\n\tADD_SKU: 'ADD_SKU',\r\n\tREMOVE_SKU: 'REMOVE_SKU',\r\n};\r\n\r\nclass WishlistSkusDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tskus: [],\r\n\t\tisLoading: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(this.getDataStore())\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (this.props.customerState.isUnknownCustomer) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\t\tthis.fetchWishlistSkus();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tcount: () => state.skus.length,\r\n\t\tadd: sku => this.addSkuAction(sku),\r\n\t\tremove: sku => this.removeSkuAction(sku),\r\n\t\tincludes: sku => this.wishlistIncludesSku(sku),\r\n\t});\r\n\r\n\tfetchWishlistSkus = () => {\r\n\t\tconst { customerState: c } = this.props;\r\n\t\tconst endpoint = `/org/${c.orgId}/customer/${c.customerId}/titles/wishlist/skus`;\r\n\r\n\t\tthis.request = api.cancelableGet(endpoint);\r\n\r\n\t\tthis.request.promise.then(wishlistData => {\r\n\t\t\tthis.setState({ skus: wishlistData.skus, isLoading: false });\r\n\t\t});\r\n\t};\r\n\r\n\twishlistIncludesSku(sku) {\r\n\t\treturn this.getSkus().includes(sku);\r\n\t}\r\n\r\n\taddSkuAction = sku => {\r\n\t\tthis.update({ type: actions.ADD_SKU, payload: sku });\r\n\t};\r\n\r\n\tremoveSkuAction = sku => {\r\n\t\tthis.update({ type: actions.REMOVE_SKU, payload: sku });\r\n\t};\r\n\r\n\tupdate = action => {\r\n\t\tthis.setState(state => this.resolveNextStateFromAction(state, action));\r\n\t};\r\n\r\n\tresolveNextStateFromAction = (state, action) => {\r\n\t\tswitch (action.type) {\r\n\t\t\tcase actions.ADD_SKU:\r\n\t\t\t\treturn this.addSku(state, action.payload);\r\n\t\t\tcase actions.REMOVE_SKU:\r\n\t\t\t\treturn this.removeSku(state, action.payload);\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t};\r\n\r\n\taddSku = (state, sku) => {\r\n\t\treturn { ...state, skus: [...state.skus, sku] };\r\n\t};\r\n\r\n\tremoveSku = (state, targetSku) => {\r\n\t\treturn { ...state, skus: state.skus.filter(sku => sku !== targetSku) };\r\n\t};\r\n\r\n\tgetSkus = () => {\r\n\t\treturn this.state.skus;\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(WishlistSkusDataStore);\r\n","const CustomerListType = {\r\n\tfavorites: 'favorites',\r\n\trecentlyViewed: 'recentlyViewed',\r\n\twishlist: 'wishlist',\r\n};\r\n\r\nexport default CustomerListType;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport Convert from '../../util/Convert';\r\nimport combineConnectors from './combineConnectors';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\n\r\nclass CustomerEntitiesController extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t\t// Passed in from Parent\r\n\t\tcustomerListType: PropTypes.string,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst customerEntitiesController = this.getController();\r\n\t\treturn this.props.children(customerEntitiesController);\r\n\t}\r\n\r\n\tgetController = () => ({\r\n\t\tget: () => this.fetchCustomerEntities(),\r\n\t\tsave: recommendableEntity => this.save(recommendableEntity),\r\n\t\tremove: entity => this.remove(entity),\r\n\t\tfind: (entities, entityId) => this.findOneEntity(entities, entityId),\r\n\t});\r\n\r\n\tfetchCustomerEntities = () => {\r\n\t\tconst { customerState, customerListType: listType } = this.props;\r\n\t\tconst { orgId, customerId } = customerState;\r\n\t\tconst endpoint = `/org/${orgId}/customer/${customerId}/entities/${listType}`;\r\n\t\treturn api.cancelableGet(endpoint);\r\n\t};\r\n\r\n\tsave = recommendableEntity => {\r\n\t\tconst entity = recommendableEntity;\r\n\t\tconst entityDTO = this.buildCustomerEntityDTO(entity);\r\n\t\treturn api.post('/customer/entity', entityDTO);\r\n\t};\r\n\r\n\tremove = recommendableEntity => {\r\n\t\tconst entity = recommendableEntity;\r\n\t\tconst entityDTO = this.buildCustomerEntityDTO(entity);\r\n\t\treturn this.requestDelete(entityDTO);\r\n\t};\r\n\r\n\trequestDelete(customerEntityDTO) {\r\n\t\treturn api.call('DELETE', '/customer/entity', customerEntityDTO);\r\n\t}\r\n\r\n\tbuildCustomerEntityDTO = recommendableEntity => {\r\n\t\tconst customerId = this.getCustomerId();\r\n\t\tconst listType = this.props.customerListType;\r\n\t\treturn {\r\n\t\t\tcustomerId,\r\n\t\t\tlistType,\r\n\t\t\tentityType: recommendableEntity.type,\r\n\t\t\tentityId: recommendableEntity.id,\r\n\t\t};\r\n\t};\r\n\r\n\tfindOneEntity = (customerEntityDTOs, entityId) => {\r\n\t\tconst entities = customerEntityDTOs;\r\n\t\tfor (let i = 0; i < entities.length; i++) {\r\n\t\t\tif (entities[i].entityId === entityId) {\r\n\t\t\t\treturn { entity: entities[i], result: true };\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { entity: {}, result: false };\r\n\t};\r\n\r\n\tgetCustomerId() {\r\n\t\tconst { customerId } = this.props.customerState;\r\n\t\treturn Convert.toNumber(customerId);\r\n\t}\r\n}\r\n\r\nconst connect = combineConnectors([connectToCustomerID]);\r\n\r\nexport default connect(CustomerEntitiesController);\r\n","import Convert from '../util/Convert';\r\n\r\nexport default class RecommendableEntity {\r\n\tid = '';\r\n\ttype = '';\r\n\tname = '';\r\n\tentity = {};\r\n\r\n\tstatic title = 'title';\r\n\tstatic section = 'section';\r\n\tstatic department = 'department';\r\n\tstatic event = 'event';\r\n\tstatic catalog = 'catalog';\r\n\tstatic author = 'author';\r\n\tstatic series = 'series';\r\n\r\n\tconstructor(id, type, name, entity) {\r\n\t\tif (id) {\r\n\t\t\tthis.id = Convert.toString(id);\r\n\t\t}\r\n\r\n\t\tif (type && typeof type === 'string') {\r\n\t\t\tthis.type = type.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif (name) {\r\n\t\t\tthis.name = name;\r\n\t\t}\r\n\r\n\t\tif (entity) {\r\n\t\t\tthis.entity = entity;\r\n\t\t}\r\n\t}\r\n}\r\n","/**\r\n *\r\n * @param {String} authorName\r\n * @returns {Object} { displayName, initials }\r\n * Parses author.name from {lastName}, {firstName} to {firstName} {lastName}\r\n * and derives initials\r\n */\r\nexport const getAuthorDisplayNameAndInitials = authorName => {\r\n\tif (!authorName || typeof authorName !== 'string') {\r\n\t\treturn { displayName: 'Unknown', initials: null };\r\n\t}\r\n\r\n\tconst nameTokens = authorName.split(',');\r\n\r\n\tif (nameTokens.length !== 2) {\r\n\t\treturn { displayName: authorName, initials: null };\r\n\t}\r\n\r\n\tconst lastName = nameTokens[0].trim();\r\n\tconst firstName = nameTokens[1].trim();\r\n\r\n\tconst initials = `${firstName.charAt(0)}${lastName.charAt(0)}`;\r\n\r\n\treturn { displayName: `${firstName} ${lastName}`, initials };\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n\tconnectToCustomerID,\r\n\tconnectToPreviewMode,\r\n} from '../../data/CustomerIDStore';\r\nimport api from '../../../api';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport * as authorUtils from '../../../author/author.utils';\r\n\r\nexport const FavoritesContext = React.createContext();\r\n\r\nclass CustomerFavoritesDataStoreBase extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t\tcustomerEntitiesController: PropTypes.shape({\r\n\t\t\tget: PropTypes.func,\r\n\t\t\tsave: PropTypes.func,\r\n\t\t\tremove: PropTypes.func,\r\n\t\t\tfind: PropTypes.func, // (entities, entityId) => { entity: object, result: bool },\r\n\t\t}),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\ttitles: [],\r\n\t\tseries: [],\r\n\t\tsections: [],\r\n\t\tauthors: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderChildren(dataStore)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { previewMode, customerState } = this.props;\r\n\r\n\t\tif (previewMode.isActive() || customerState.isUnknownCustomer) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\r\n\t\tthis.fetchCustomerFavorites();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetFavoriteGenres: () => state.sections,\r\n\t\tsave: entity => this.saveOneEntityAsFavorite(entity),\r\n\t\tremove: entity => this.deleteOneEntityAsFavorite(entity),\r\n\t\tgetFavoriteTitles: () => this.getFavoriteTitles(state),\r\n\t\tgetFavoriteSeries: () => this.getFavoriteSeries(state),\r\n\t\tgetFavoriteAuthors: () => this.getFavoriteAuthors(state),\r\n\t\tincludes: (entityId, entityType) => {\r\n\t\t\treturn this.findEntity(entityId, entityType).result;\r\n\t\t},\r\n\t});\r\n\r\n\trenderChildren(dataStore) {\r\n\t\treturn typeof this.props.children === 'function'\r\n\t\t\t? this.props.children(dataStore)\r\n\t\t\t: this.props.children;\r\n\t}\r\n\r\n\tfetchCustomerFavorites = () => {\r\n\t\tthis.request = this.props.customerEntitiesController.get();\r\n\t\treturn this.request.promise.then(this.organizeFavoritesByEntityType);\r\n\t};\r\n\r\n\torganizeFavoritesByEntityType = customerFavorites => {\r\n\t\tconst titles = [];\r\n\t\tconst series = [];\r\n\t\tconst authors = [];\r\n\t\tconst sections = [];\r\n\r\n\t\tfor (let i = 0; i < customerFavorites.length; i++) {\r\n\t\t\tconst current = customerFavorites[i];\r\n\t\t\tconst type = current.entityType.toLowerCase();\r\n\r\n\t\t\tswitch (type) {\r\n\t\t\t\tcase RecommendableEntity.title:\r\n\t\t\t\t\ttitles.push(current);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase RecommendableEntity.section:\r\n\t\t\t\tcase RecommendableEntity.department:\r\n\t\t\t\t\tsections.push(current);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase RecommendableEntity.author:\r\n\t\t\t\t\tauthors.push(current);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase RecommendableEntity.series:\r\n\t\t\t\t\tseries.push(current);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t'Failed to identify Recommendable Entity type',\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: false,\r\n\t\t\ttitles,\r\n\t\t\tseries,\r\n\t\t\tauthors,\r\n\t\t\tsections,\r\n\t\t});\r\n\t};\r\n\r\n\tgetFavoriteTitles = state => {\r\n\t\treturn state.titles.map(titleEntity => ({\r\n\t\t\tsku: titleEntity.entityId,\r\n\t\t\tname: titleEntity.entityName,\r\n\t\t\tauthor: titleEntity.entity.author,\r\n\t\t\timageUri: titleEntity.entityImageUri,\r\n\t\t}));\r\n\t};\r\n\r\n\tgetFavoriteAuthors = state => {\r\n\t\treturn state.authors.map(authorEntity => {\r\n\t\t\tconst name = authorEntity.entityName;\r\n\t\t\tconst {\r\n\t\t\t\tinitials,\r\n\t\t\t\tdisplayName,\r\n\t\t\t} = authorUtils.getAuthorDisplayNameAndInitials(name);\r\n\t\t\treturn {\r\n\t\t\t\tname,\r\n\t\t\t\tinitials,\r\n\t\t\t\tdisplayName,\r\n\t\t\t\tskuCount: authorEntity.entity.skuCount,\r\n\t\t\t\tid: authorEntity.entityId,\r\n\t\t\t\timageUri: authorEntity.entityImageUri,\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\tgetFavoriteSeries = state => {\r\n\t\treturn state.series.map((seriesEntity, idx) => ({\r\n\t\t\tidx,\r\n\t\t\tname: seriesEntity.entityName,\r\n\t\t\tskuCount: seriesEntity.entity && seriesEntity.entity.skuCount,\r\n\t\t}));\r\n\t};\r\n\r\n\tsaveOneEntityAsFavorite = async recommendableEntity => {\r\n\t\tconst { customerEntitiesController } = this.props;\r\n\r\n\t\tawait customerEntitiesController.save(recommendableEntity);\r\n\t\tawait this.fetchCustomerFavorites();\r\n\t};\r\n\r\n\tdeleteOneEntityAsFavorite = async recommendableEntity => {\r\n\t\tconst { customerEntitiesController } = this.props;\r\n\t\tawait customerEntitiesController.remove(recommendableEntity);\r\n\t\treturn this.fetchCustomerFavorites();\r\n\t};\r\n\r\n\t// (entityId: string, entityType: string) => { entity: object, result: bool }\r\n\tfindEntity = (entityId, entityType) => {\r\n\t\tconst entities = this.getFavoriteEntities(entityType);\r\n\t\tconst { customerEntitiesController } = this.props;\r\n\t\treturn customerEntitiesController.find(entities, entityId);\r\n\t};\r\n\r\n\tgetFavoriteEntities(entityType) {\r\n\t\tswitch (entityType) {\r\n\t\t\tcase RecommendableEntity.title:\r\n\t\t\t\treturn this.state.titles;\r\n\t\t\tcase RecommendableEntity.section:\r\n\t\t\t\treturn this.state.sections;\r\n\t\t\tcase RecommendableEntity.author:\r\n\t\t\t\treturn this.state.authors;\r\n\t\t\tcase RecommendableEntity.series:\r\n\t\t\t\treturn this.state.series;\r\n\t\t\tdefault:\r\n\t\t\t\treturn [];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst connect = combineConnectors([connectToPreviewMode, connectToCustomerID]);\r\n\r\nexport default connect(CustomerFavoritesDataStoreBase);\r\n","import React from 'react';\r\nimport CustomerListType from '../../../entity/CustomerListType';\r\nimport CustomerEntitiesController from '../../data/CustomerEntitiesController';\r\nimport CustomerFavoritesDataStoreBase from './CustomerFavoritesDataStoreBase';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport { FavoritesContext } from './CustomerFavoritesDataStoreBase';\r\n\r\nexport const connectToFavorites = makeConnectTo(\r\n\tFavoritesContext,\r\n\t'customerFavoritesDataStore',\r\n);\r\n\r\nexport const useFavoritesDataStore = () => React.useContext(FavoritesContext);\r\n\r\nexport default function CustomerFavoritesDataStore({ children }) {\r\n\tconst listType = CustomerListType.favorites;\r\n\r\n\tconst renderBaseDataStore = customerEntitiesController => {\r\n\t\treturn (\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\treturn (\r\n\t\t\r\n\t\t\t{renderBaseDataStore}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Card } from 'antd';\r\n\r\nexport default function CollectionTitleSkeletons() {\r\n\tconst total = 15;\r\n\tlet skeletons = [];\r\n\r\n\tfor (let i = 0; i < total; i++) {\r\n\t\tskeletons.push();\r\n\t}\r\n\r\n\treturn {skeletons};\r\n}\r\n\r\nfunction CollectionTitleSkeleton() {\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport CollectionTitleSkeletons from './CollectionTitleSkeletons';\r\n\r\nconst propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tisLoading: PropTypes.bool,\r\n};\r\n\r\nfunction CollectionTitlesWrapper(props) {\r\n\tconst isMobile = props.isMobile();\r\n\treturn (\r\n\t\t\r\n\t\t\t{props.isLoading ? : props.children}\r\n\t\t\r\n\t);\r\n}\r\n\r\nCollectionTitlesWrapper.propTypes = propTypes;\r\n\r\nexport default withIsMobile(CollectionTitlesWrapper);\r\n","import PropTypes from 'prop-types';\r\n\r\nconst Review = PropTypes.shape({\r\n\tabstract: PropTypes.string,\r\n\tappUserId: PropTypes.number,\r\n\tuser: PropTypes.object,\r\n\toverallAssessment: PropTypes.number,\r\n\tsku: PropTypes.string,\r\n\tsubmissions: PropTypes.object,\r\n\tupdatedDate: PropTypes.string,\r\n});\r\n\r\nexport default Review;\r\n","import { useState, useEffect } from 'react';\r\nimport { useMounted } from './useMounted';\r\n\r\nexport const useImage = src => {\r\n\tconst [hasLoaded, setHasLoaded] = useState(false);\r\n\tconst [hasError, setHasError] = useState(false);\r\n\tconst [hasStartedInitialFetch, setHasStartedInitialFetch] = useState(false);\r\n\tconst isMounted = useMounted();\r\n\r\n\tuseEffect(() => {\r\n\t\tsetHasStartedInitialFetch(true);\r\n\t\tsetHasLoaded(false);\r\n\t\tsetHasError(false);\r\n\r\n\t\tconst image = new Image();\r\n\t\timage.src = src;\r\n\r\n\t\tconst handleError = () => {\r\n\t\t\tsetHasError(true);\r\n\t\t};\r\n\r\n\t\tconst handleLoad = () => {\r\n\t\t\tif (isMounted.current) {\r\n\t\t\t\tsetHasLoaded(true);\r\n\t\t\t\tsetHasError(false);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\timage.onerror = handleError;\r\n\t\timage.onload = handleLoad;\r\n\r\n\t\treturn () => {\r\n\t\t\timage.removeEventListener('error', handleError);\r\n\t\t\timage.removeEventListener('load', handleLoad);\r\n\t\t};\r\n\t}, [src, isMounted]);\r\n\r\n\treturn { hasLoaded, hasError, hasStartedInitialFetch };\r\n};\r\n","import PropTypes from 'prop-types';\r\nimport Review from './Review';\r\n\r\nconst Title = PropTypes.shape({\r\n\tsku: PropTypes.string,\r\n\tsupplier: PropTypes.string,\r\n\tauthor: PropTypes.string,\r\n\tean: PropTypes.string,\r\n\tfamilyItem: PropTypes.string,\r\n\tformatDescription: PropTypes.string,\r\n\tname: PropTypes.string,\r\n\tpubDate: PropTypes.string,\r\n\timageUri: PropTypes.string,\r\n\tpos: PropTypes.arrayOf(PropTypes.object),\r\n\treviews: PropTypes.arrayOf(Review),\r\n\toffers: PropTypes.arrayOf(PropTypes.object),\r\n});\r\n\r\nexport default Title;\r\n","import PropTypes from 'prop-types';\r\n\r\nconst Series = PropTypes.shape({\r\n\tname: PropTypes.string,\r\n\tskuCount: PropTypes.number,\r\n});\r\n\r\nexport default Series;\r\n","import PropTypes from 'prop-types';\r\n\r\nconst Author = PropTypes.shape({\r\n\tid: PropTypes.string,\r\n\tname: PropTypes.string,\r\n\tdisplayName: PropTypes.string,\r\n\tinitials: PropTypes.string,\r\n\tskuCount: PropTypes.number,\r\n});\r\n\r\nexport default Author;\r\n","import PropTypes from 'prop-types';\r\n\r\nconst TitleAttributes = PropTypes.shape({\r\n\tauthorBio: PropTypes.string,\r\n\tdateAdded: PropTypes.string,\r\n\tisActiveTitle: PropTypes.bool,\r\n\tquotes: PropTypes.string,\r\n\tsummary: PropTypes.string,\r\n});\r\n\r\nexport default TitleAttributes;\r\n","import PropTypes from 'prop-types';\r\n\r\nconst RecommendableEntity = PropTypes.shape({\r\n\tid: PropTypes.string,\r\n\ttype: PropTypes.string,\r\n\tname: PropTypes.string,\r\n\tentity: PropTypes.object,\r\n});\r\n\r\nexport default RecommendableEntity;\r\n","import { useEffect, useRef } from 'react';\r\n\r\nexport const useMounted = () => {\r\n\tconst isMounted = useRef(false);\r\n\r\n\tuseEffect(() => {\r\n\t\tisMounted.current = true;\r\n\t\treturn () => {\r\n\t\t\tisMounted.current = false;\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn isMounted;\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\n\r\nTitleSkeleton.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tisTitleDetail: PropTypes.bool,\r\n};\r\n\r\nfunction TitleSkeleton({ isMobile, isTitleDetail }) {\r\n\tconst skeletonSize = isMobile()\r\n\t\t? `mobile${isTitleDetail ? '-title-detail' : ''}`\r\n\t\t: 'medium';\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\r\n\t\t\t
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(TitleSkeleton);\r\n","export default __webpack_public_path__ + \"static/media/no_image_jacket.44ee3652.png\";","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport noImagePlaceholder from '../../../assets/images/no_image_jacket.png';\r\nimport { useWindowSize } from '../../context/WindowSize';\r\nimport './titleJacketImage.css';\r\n\r\nNoJacketImage.propTypes = {\r\n\ttitleDetails: PropTypes.object,\r\n\tsku: PropTypes.string,\r\n\tsize: PropTypes.string,\r\n};\r\n\r\nexport default function NoJacketImage({ titleDetails, sku, size }) {\r\n\tconst { width } = useWindowSize();\r\n\tconst noJacketRef = React.createRef();\r\n\tconst [dimensions, setDimensions] = React.useState({ height: 0, width: 0 });\r\n\tconst updateDimensions = () =>\r\n\t\tnoJacketRef.current &&\r\n\t\tsetDimensions({\r\n\t\t\theight: noJacketRef.current.offsetHeight,\r\n\t\t\twidth: noJacketRef.current.offsetWidth,\r\n\t\t});\r\n\r\n\tReact.useEffect(updateDimensions, [width]);\r\n\r\n\tconst renderNoJacketCoverText = () => {\r\n\t\treturn titleDetails ? (\r\n\t\t\t<>\r\n\t\t\t\t
\r\n\t\t\t\t\t{titleDetails.title || titleDetails.name}\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{titleDetails.author || ''}\r\n\t\t\t\t
\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t
{sku}
\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t updateDimensions()}\r\n\t\t\t/>\r\n\t\t\t{dimensions.width > 0 && (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{renderNoJacketCoverText()}\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 PropTypes from 'prop-types';\r\nimport { useImage } from '../../hooks/useImage';\r\nimport TitleSkeleton from './TitleSkeleton';\r\nimport NoJacketImage from './NoJacketImage';\r\nimport './titleJacketImage.css';\r\n\r\nconst defaultJacketUris = [\r\n\t'images/common/noimage.png',\r\n\t'https://images.abovethetreeline.com/ea/OO/images/jacket_covers/default_jacket_oo.png',\r\n\t'https://images-azf.edelweiss.plus/ea/OO/images/jacket_covers/default_jacket_oo.png',\r\n];\r\n\r\nconst small = 'small-image';\r\nconst medium = 'medium-image';\r\nconst large = 'large-image';\r\nconst pick = 'pick-image';\r\nconst mobile = 'mobile-image';\r\nconst fillwidth = 'fillwidth-image';\r\nconst fixedwidth = 'fixedwidth-image';\r\n\r\nfunction JacketImage({ size, imageUri, title, isTitleDetail }) {\r\n\tconst { hasLoaded, hasError } = useImage(imageUri);\r\n\r\n\tconst hasValidImageUri = () => {\r\n\t\treturn (\r\n\t\t\timageUri && !defaultJacketUris.some(uri => imageUri.includes(uri))\r\n\t\t);\r\n\t};\r\n\r\n\tif (hasError || !hasValidImageUri()) {\r\n\t\tconst titleDetails =\r\n\t\t\tArray.isArray(title.pos) && title.pos.length\r\n\t\t\t\t? title.pos[0]\r\n\t\t\t\t: title.product\r\n\t\t\t\t? title.product\r\n\t\t\t\t: title;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tif (!hasLoaded) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default class TitleJacketImage extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsize: PropTypes.string,\r\n\t\tonClick: PropTypes.func, // not required\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),\r\n\t\ttitle: PropTypes.shape({\r\n\t\t\tsku: PropTypes.string,\r\n\t\t\timageUri: PropTypes.string,\r\n\t\t\tpos: PropTypes.array,\r\n\t\t}),\r\n\t\tisTitleDetail: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic small = small;\r\n\tstatic medium = medium;\r\n\tstatic mobile = mobile;\r\n\tstatic large = large;\r\n\tstatic pick = pick;\r\n\tstatic fillwidth = fillwidth;\r\n\tstatic fixedwidth = fixedwidth;\r\n\r\n\tstatic defaultProps = {\r\n\t\tsize: mobile,\r\n\t\ttitle: {},\r\n\t\tisTitleDetail: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tlet name = 'title-jacket-image relative';\r\n\t\tlet onClick;\r\n\t\tconst { size, title, isTitleDetail, children } = this.props;\r\n\r\n\t\tif (typeof this.props.onClick === 'function') {\r\n\t\t\tname = `${name} clickable`;\r\n\t\t\tonClick = this.props.onClick;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\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\tgetImageUri() {\r\n\t\tconst { title } = this.props;\r\n\t\treturn title.imageUri\r\n\t\t\t? title.imageUri\r\n\t\t\t: title.product\r\n\t\t\t? title.product.imageUri\r\n\t\t\t: null;\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Tooltip } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default class TextTruncator extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttext: PropTypes.string,\r\n\t\tmaxLength: PropTypes.number,\r\n\t\tending: PropTypes.string,\r\n\t\tfallBackText: PropTypes.object,\r\n\t\tcanUseTooltip: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tmaxLength: 35,\r\n\t\tending: '...',\r\n\t\tfallBackText: ,\r\n\t\tcanUseTooltip: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { text, canUseTooltip } = this.props;\r\n\t\tconst { resultText, isTruncated } = this.handleTruncateText(text);\r\n\r\n\t\tif (isTruncated && canUseTooltip) {\r\n\t\t\treturn {resultText};\r\n\t\t}\r\n\t\treturn {resultText};\r\n\t}\r\n\r\n\thandleTruncateText(text) {\r\n\t\tconst { maxLength, fallBackText } = this.props;\r\n\t\tif (typeof text !== 'string') {\r\n\t\t\treturn { resultText: fallBackText, isTruncated: false };\r\n\t\t}\r\n\t\tif (text.length > maxLength) {\r\n\t\t\tconst resultText = this.truncate(text);\r\n\t\t\treturn { resultText, isTruncated: true };\r\n\t\t}\r\n\t\treturn { resultText: text, isTruncated: false };\r\n\t}\r\n\r\n\ttruncate(text) {\r\n\t\tconst { maxLength, ending } = this.props;\r\n\t\treturn `${text.substring(0, maxLength - ending.length)}${ending}`;\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport Customer360PropTypes from '../../../types';\r\nimport PropTypes from 'prop-types';\r\nimport { Tooltip } from 'antd';\r\nimport { useFavoritesDataStore } from '../data/CustomerFavoritesDataStore';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './favoriteEntityIndicator.css';\r\n\r\nFavoriteEntityIndicator.propTypes = {\r\n\tisTitleDetail: PropTypes.bool,\r\n\tisInTitleLane: PropTypes.bool,\r\n\tentity: Customer360PropTypes.RecommendableEntity,\r\n\ttooltip: PropTypes.object, // optional\r\n\tisActive: PropTypes.bool, // optional\r\n\tstyle: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nFavoriteEntityIndicator.defaultProps = {\r\n\tstyle: {\r\n\t\tbottom: -12,\r\n\t\tright: 58,\r\n\t},\r\n};\r\n\r\nfunction FavoriteEntityIndicator({\r\n\tisTitleDetail,\r\n\tisInTitleLane,\r\n\tentity,\r\n\ttooltip,\r\n\tisActive,\r\n\tstyle,\r\n\tisMobile,\r\n}) {\r\n\tconst { includes } = useFavoritesDataStore();\r\n\r\n\tconst isFavoriteEntity = () => {\r\n\t\treturn typeof isActive === 'boolean'\r\n\t\t\t? isActive\r\n\t\t\t: includes(entity.id, entity.type);\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
\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(FavoriteEntityIndicator);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { Tooltip, Button } from 'antd';\r\nimport './favoriteButton.css';\r\n\r\nFavoriteButton.propTypes = {\r\n\tisLoading: PropTypes.bool,\r\n\tisFavoriteEntity: PropTypes.func,\r\n\thandleToggle: PropTypes.func,\r\n};\r\n\r\nexport default function FavoriteButton({\r\n\tisLoading,\r\n\tisFavoriteEntity,\r\n\thandleToggle,\r\n}) {\r\n\treturn (\r\n\t\t
\r\n\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\tplacement=\"top\">\r\n\t\t\t\t handleToggle()}>\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 Customer360PropTypes from '../../../types';\r\nimport PropTypes from 'prop-types';\r\nimport { Tooltip, notification } from 'antd';\r\nimport FavoriteEntityIndicator from './FavoriteEntityIndicator';\r\nimport { connectToFavorites } from '../data/CustomerFavoritesDataStore';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport FavoriteButton from './FavoriteButton';\r\nimport './favoriteEntityAnchor.css';\r\n\r\nclass FavoriteEntityAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentity: Customer360PropTypes.RecommendableEntity,\r\n\t\t// Mapped to props\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tcustomerFavoritesDataStore: PropTypes.object,\r\n\t\tisTitleDetail: PropTypes.bool,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\tisActive: false,\r\n\t\tdidInitialize: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { isMobile, isTitleDetail } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\r\n\t\t\t\t\treturn !isTitleDetail ? (\r\n\t\t\t\t\t\tthis.renderFavoriteButton(translate)\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{this.state.didInitialize && (\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\tthis.handleToggleAsFavorite(\r\n\t\t\t\t\t\t\t\t\t\t\t\ttranslate,\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{!this.state.isLoading &&\r\n\t\t\t\t\t\t\t\t\t\t\tthis.renderIcon()}\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\tcomponentDidMount() {\r\n\t\tconst isActive = this.isActiveInDataStore();\r\n\t\tthis.setState({ isActive, didInitialize: true });\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tconst { previewMode } = this.props;\r\n\t\tconst isActive = this.isActiveInDataStore();\r\n\r\n\t\tif (!previewMode.isActive() && isActive !== this.state.isActive) {\r\n\t\t\tthis.toggleEntityAsCustomerFavorite();\r\n\t\t}\r\n\t}\r\n\r\n\trenderIcon() {\r\n\t\tconst { entity, isTitleDetail } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetTooltip() {\r\n\t\tif (this.state.isActive) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\treturn ;\r\n\t}\r\n\r\n\tisActiveInDataStore() {\r\n\t\tconst { customerFavoritesDataStore: favorites, entity } = this.props;\r\n\t\treturn favorites.includes(entity.id, entity.type);\r\n\t}\r\n\r\n\thandleToggleAsFavorite = translate => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tconst lastState = this.state.isActive;\r\n\t\tconst nextState = !lastState;\r\n\r\n\t\tthis.setState({ isActive: nextState });\r\n\t\tthis.toggleEntityAsCustomerFavorite();\r\n\r\n\t\tlet message;\r\n\r\n\t\tif (nextState) {\r\n\t\t\tmessage = translate('added_to_favorites');\r\n\t\t} else {\r\n\t\t\tmessage = translate('removed_from_favorites');\r\n\t\t}\r\n\r\n\t\tnotification.success({ message, duration: 1 });\r\n\t};\r\n\r\n\ttoggleEntityAsCustomerFavorite() {\r\n\t\tconst { customerFavoritesDataStore: favorites, entity } = this.props;\r\n\r\n\t\tif (this.isActiveInDataStore()) {\r\n\t\t\treturn favorites.remove(entity);\r\n\t\t}\r\n\t\treturn favorites.save(entity);\r\n\t}\r\n\r\n\trenderFavoriteButton = translate => {\r\n\t\tconst { customerFavoritesDataStore, entity } = this.props;\r\n\t\tconst { isActive, isLoading } = this.state;\r\n\t\tconst isFavoriteEntity = () => {\r\n\t\t\treturn typeof isActive === 'boolean'\r\n\t\t\t\t? isActive\r\n\t\t\t\t: customerFavoritesDataStore.includes(entity.id, entity.type);\r\n\t\t};\r\n\t\treturn (\r\n\t\t\t this.handleToggleAsFavorite(translate)}\r\n\t\t\t/>\r\n\t\t);\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([connectToFavorites, connectToPreviewMode]);\r\n\r\nexport default connect(withIsMobile(FavoriteEntityAnchor));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport TitleJacketImage from './TitleJacketImage';\r\nimport TitleSummary from './TitleSummary';\r\nimport { Card } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { connectToFavorites } from '../../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport FavoriteEntityAnchor from '../../CustomerFavorites/UI/FavoriteEntityAnchor';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport { withIsUnknownCustomer } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { connectToSellerPreferences } from '../../data/BooksellerPreferencesDataStore';\r\n\r\nclass TitleCard extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitle: Customer360PropTypes.Title,\r\n\t\ttitleNameFontSize: PropTypes.number,\r\n\t\tchildren: PropTypes.element,\r\n\t\t// Mapped to props only\r\n\t\tisMobile: PropTypes.func,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\tfavoritesDataStoreIsPresent: PropTypes.bool,\r\n\t\tgradient: PropTypes.string,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\ttitleNameFontSize: 18,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { title, isMobile, gradient } = this.props;\r\n\t\tconst size = isMobile() ? 'fillwidth-image' : 'medium-image';\r\n\t\treturn (\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{this.props.favoritesDataStoreIsPresent &&\r\n\t\t\t\t\t\t\t\t!this.props.isUnknownCustomer &&\r\n\t\t\t\t\t\t\t\tthis.renderFavoriteEntityAnchor()}\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{this.props.children}\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\trenderFavoriteEntityAnchor() {\r\n\t\tconst { title } = this.props;\r\n\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\tconst entity = new RecommendableEntity(title.sku, type, title.name);\r\n\r\n\t\treturn ;\r\n\t}\r\n}\r\n\r\nconst withIsFavoritesDataPresent = Component => {\r\n\treturn connectToFavorites(Component, favoritesDataStore => ({\r\n\t\tfavoritesDataStoreIsPresent: typeof favoritesDataStore !== 'undefined',\r\n\t}));\r\n};\r\n\r\nconst withAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, preferences => ({\r\n\t\tgradient: preferences.getGradient(),\r\n\t}));\r\n};\r\n\r\nconst connect = combineConnectors([\r\n\twithAppSettings,\r\n\twithIsUnknownCustomer,\r\n\twithIsFavoritesDataPresent,\r\n]);\r\n\r\nexport default connect(withIsMobile(TitleCard));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Drawer } from 'antd';\r\n\r\nexport default class DrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.any,\r\n\t\trenderDrawerContent: PropTypes.func,\r\n\t\tonCloseHook: PropTypes.func,\r\n\t\tplacement: PropTypes.string,\r\n\t\twidth: PropTypes.string,\r\n\t\ttitle: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),\r\n\t\theight: PropTypes.string,\r\n\t\tclosable: PropTypes.bool,\r\n\t\tparentStyle: PropTypes.string,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisDrawerVisible: false,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tplacement: 'left',\r\n\t\twidth: '700px',\r\n\t\theight: '100%',\r\n\t\tclosable: false,\r\n\t\tparentStyle: 'clickable',\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tshowDrawer = () => {\r\n\t\tthis.setState({ isDrawerVisible: true });\r\n\t};\r\n\r\n\tcloseDrawer = () => {\r\n\t\tthis.setState({ isDrawerVisible: false });\r\n\r\n\t\tif (typeof this.props.onCloseHook === 'function') {\r\n\t\t\tthis.props.onCloseHook();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport class ControlledDrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.any,\r\n\t\tisDrawerVisible: PropTypes.bool,\r\n\t\tshowDrawer: PropTypes.func,\r\n\t\tcloseDrawer: PropTypes.func,\r\n\t\trenderDrawerContent: PropTypes.func,\r\n\t\tplacement: PropTypes.string,\r\n\t\twidth: PropTypes.string,\r\n\t\theight: PropTypes.string,\r\n\t\tclosable: PropTypes.bool,\r\n\t\tparentStyle: PropTypes.string,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tshowDrawer: () => {},\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children && this.renderAnchorChild()}\r\n\t\t\t\t\r\n\t\t\t\t\t{this.props.renderDrawerContent(this.getInstance())}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderAnchorChild() {\r\n\t\tconst { children, parentStyle } = this.props;\r\n\r\n\t\tif (typeof children === 'function') {\r\n\t\t\treturn children(this.getInstance());\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t
this.showDrawer()}>\r\n\t\t\t\t{children}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tgetInstance = (isDrawerVisible = this.props.isDrawerVisible) => ({\r\n\t\tisVisible: isDrawerVisible,\r\n\t\topen: () => this.showDrawer(),\r\n\t\tclose: () => this.closeDrawer(),\r\n\t\tcloseDrawer: () => this.closeDrawer(),\r\n\t});\r\n\r\n\tshowDrawer = () => {\r\n\t\tthis.props.showDrawer();\r\n\t};\r\n\r\n\tcloseDrawer = () => {\r\n\t\tthis.props.closeDrawer();\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport DrawerAnchor from './DrawerAnchor';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\n\r\nclass DetailDrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\trenderDrawerContent: PropTypes.func,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t\t// Mapped to props\r\n\t\tisMobile: PropTypes.func,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderDrawerContent = drawer => {\r\n\t\treturn drawer.isVisible && this.props.renderDrawerContent();\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(DetailDrawerAnchor);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport DetailDrawerAnchor from './DetailDrawerAnchor';\r\nimport { Button, Icon } from 'antd';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './laneContainer.less';\r\n\r\nSeeAllAnchor.propTypes = {\r\n\trenderAllEntities: PropTypes.func.isRequired,\r\n};\r\n\r\nexport function SeeAllAnchor({ renderAllEntities }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t{drawer => {\r\n\t\t\t\t\treturn (\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\nclass LaneContainer extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// required\r\n\t\tmajorHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.element]),\r\n\t\t// optional\r\n\t\tsubHeader: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\r\n\t\textra: PropTypes.any,\r\n\t\ticon: PropTypes.string,\r\n\t\tshouldRenderIcons: PropTypes.bool,\r\n\t\tstyle: PropTypes.object,\r\n\t\tbackgroundClass: PropTypes.string,\r\n\t\tpreferencesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tstyle: {},\r\n\t\tshouldRenderIcons: false,\r\n\t\tbackgroundClass: 'gradient-background',\r\n\t};\r\n\r\n\tstatic SeeAllAnchor = SeeAllAnchor;\r\n\r\n\trender() {\r\n\t\tconst { backgroundClass, preferencesDataStore } = this.props;\r\n\t\tconst gradient =\r\n\t\t\tbackgroundClass === 'gradient-background'\r\n\t\t\t\t? preferencesDataStore.getGradient()\r\n\t\t\t\t: 'none';\r\n\t\tconst style = {\r\n\t\t\t...this.props.style,\r\n\t\t\tbackgroundImage: gradient,\r\n\t\t};\r\n\r\n\t\treturn (\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{this.renderLaneHeaders()}\r\n\t\t\t\t\t\t{this.props.children}\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\trenderLaneHeaders() {\r\n\t\tconst { majorHeader, subHeader, icon } = this.props;\r\n\t\tif (majorHeader) {\r\n\t\t\treturn (\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{this.getLanePrimaryHeader(majorHeader, icon)}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t{subHeader && (\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{subHeader && subHeader.text\r\n\t\t\t\t\t\t\t\t\t\t? subHeader.text\r\n\t\t\t\t\t\t\t\t\t\t: subHeader}\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{this.props.extra && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{this.props.extra}\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} else {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}\r\n\r\n\tgetLanePrimaryHeader(headerValue, icon) {\r\n\t\tif (!this.props.shouldRenderIcons) {\r\n\t\t\treturn {headerValue};\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{headerValue}\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\r\nexport default connectToSellerPreferences(LaneContainer);\r\n","import React from 'react';\r\nimport Customer360PropTypes from '../../../types';\r\nimport ReactHtmlParser from 'react-html-parser';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './publisherContent.css';\r\n\r\nPublisherContent.propTypes = {\r\n\ttitleAttributes: Customer360PropTypes.TitleAttributes,\r\n};\r\n\r\nexport default function PublisherContent({ titleAttributes: attributes }) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{(attributes.keyNote || attributes.summary) && (\r\n\t\t\t\t}>\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{attributes.keyNote && (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{ReactHtmlParser(attributes.keyNote)}\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{attributes.summary &&\r\n\t\t\t\t\t\t\tReactHtmlParser(attributes.summary)}\r\n\t\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t{attributes.authorBio && (\r\n\t\t\t\t}>\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{ReactHtmlParser(attributes.authorBio)}\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 PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport Convert from '../../../util/Convert';\r\n\r\nconst TitleContext = React.createContext();\r\n\r\nexport const connectToTitle = makeConnectTo(TitleContext, 'titleDataStore');\r\n\r\nclass TitleDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsku: PropTypes.string,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\ttitle: {},\r\n\t\tisLoading: true,\r\n\t\treviewerUsersById: {},\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst titleDataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(titleDataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchTitle();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tgetTitle: () => state.title,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\thasReviews: () => state.title.reviews.length > 0,\r\n\t\tgetReviewer: appUserId => this.getReviewer(state, appUserId),\r\n\t\tgetFormatDescription: () => state.title.formatDescription,\r\n\t});\r\n\r\n\tfetchTitle = () => {\r\n\t\tconst { sku, customerState: c } = this.props;\r\n\t\tconst endpoint = `/org/${c.orgId}/customer/${c.customerId}/titles/${sku}/data`;\r\n\r\n\t\tthis.request = api.cancelableGet(endpoint);\r\n\t\tthis.request.promise\r\n\t\t\t.then(this.buildStateFromTitleAggregate)\r\n\t\t\t.catch(err => !err.isCanceled && console.log(err));\r\n\t};\r\n\r\n\tgetReviewer = (state, appUserId) => {\r\n\t\tconst id = Convert.toString(appUserId);\r\n\t\tconst reviewer = state.reviewerUsersById[id];\r\n\t\treturn reviewer ? reviewer : {};\r\n\t};\r\n\r\n\tbuildStateFromTitleAggregate = titleAggregate => {\r\n\t\tconst title = this.buildTitle(titleAggregate);\r\n\t\tconst reviewerUsersById = this.buildReviewerUsersById(titleAggregate);\r\n\r\n\t\tthis.setState({\r\n\t\t\ttitle,\r\n\t\t\tisLoading: false,\r\n\t\t\treviewerUsersById,\r\n\t\t});\r\n\t};\r\n\r\n\tbuildTitle = titleAggregate => ({\r\n\t\t...titleAggregate.product,\r\n\t\tpos: titleAggregate.skuPosData,\r\n\t\treviews: titleAggregate.reviews,\r\n\t\timageUri: titleAggregate.productImageUri,\r\n\t\tattributes: titleAggregate.attributes,\r\n\t\tisOnWishlist: titleAggregate.isOnWishlist,\r\n\t\teCommerceUri: titleAggregate.eCommerceUri,\r\n\t});\r\n\r\n\tbuildReviewerUsersById = titleAggregate => {\r\n\t\tconst reviewerUsersById = {};\r\n\r\n\t\tconst {\r\n\t\t\tusersById,\r\n\t\t\tuserAvatarsByAppUserId: avatarsById,\r\n\t\t} = titleAggregate;\r\n\r\n\t\tif (!usersById || !avatarsById) return reviewerUsersById;\r\n\r\n\t\tObject.keys(usersById).forEach(appUserId => {\r\n\t\t\treviewerUsersById[appUserId] = usersById[appUserId];\r\n\t\t\treviewerUsersById[appUserId].avatar = avatarsById[appUserId];\r\n\t\t});\r\n\r\n\t\treturn reviewerUsersById;\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(TitleDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport CustomerListType from '../../entity/CustomerListType';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport combineConnectors from '../data/combineConnectors';\r\n\r\nclass WishlistController extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsku: PropTypes.string,\r\n\t\tchildren: PropTypes.func,\r\n\t\t// Mapped to props\r\n\t\tcustomerId: PropTypes.string,\r\n\t};\r\n\r\n\trequest = null;\r\n\r\n\trender() {\r\n\t\treturn this.props.children({\r\n\t\t\tadd: () => this.addToWishlist(),\r\n\t\t\tremove: () => this.removeFromWishlist(),\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\taddToWishlist = () => {\r\n\t\tconst customerEntityDTO = this.makeEntityDTO();\r\n\r\n\t\tthis.request = api.cancelablePost(\r\n\t\t\t'/customer/entity',\r\n\t\t\tcustomerEntityDTO,\r\n\t\t);\r\n\t\treturn this.request.promise;\r\n\t};\r\n\r\n\tremoveFromWishlist = () => {\r\n\t\tconst customerEntityDTO = this.makeEntityDTO();\r\n\r\n\t\tthis.request = api.cancelableCall(\r\n\t\t\t'DELETE',\r\n\t\t\t'/customer/entity',\r\n\t\t\tcustomerEntityDTO,\r\n\t\t);\r\n\t\treturn this.request.promise;\r\n\t};\r\n\r\n\tmakeEntityDTO = () => {\r\n\t\tconst { sku, customerId } = this.props;\r\n\r\n\t\treturn {\r\n\t\t\tcustomerId,\r\n\t\t\tlistType: CustomerListType.wishlist,\r\n\t\t\tentityType: RecommendableEntity.title,\r\n\t\t\tentityId: sku,\r\n\t\t};\r\n\t};\r\n}\r\n\r\nconst mapCustomerToProps = customerState => ({\r\n\tcustomerId: customerState.customerId,\r\n});\r\n\r\nconst connectors = [\r\n\tComponent => connectToCustomerID(Component, mapCustomerToProps),\r\n];\r\n\r\nexport default combineConnectors(connectors)(WishlistController);\r\n","import { makeCancelable } from 'api-fetcher-treeline/dist';\r\n\r\n// Number, Any -> Promise\r\n// Timer function\r\nexport default function delay(t, v) {\r\n\treturn new Promise(function(resolve) {\r\n\t\tsetTimeout(resolve.bind(null, v), t);\r\n\t});\r\n}\r\n\r\nexport const cancelableDelay = (t, v) => makeCancelable(delay(t, v));\r\n","import React from 'react';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport const TitleFormatDescription = {\r\n\tpaperback: 'Paperback',\r\n\thardcover: 'Hardcover',\r\n\taudioCassette: 'Audio Cassette',\r\n\taudioCD: 'Audio CD',\r\n\tunknown: ,\r\n};\r\n","import { sortBy } from 'lodash';\r\nimport { TitleFormatDescription } from '../components/Title/TitleFormatDescription';\r\n\r\nexport function findUniqueFamilyTitles(titles) {\r\n\treturn titles.reduce((acc, title) => {\r\n\t\t!acc.map(t => t.familyItem).includes(title.familyItem) &&\r\n\t\t\tacc.push(title);\r\n\t\treturn acc;\r\n\t}, []);\r\n}\r\n\r\nexport const getFormatDescriptionDisplayName = formatDescription => {\r\n\tconst format = formatDescription || TitleFormatDescription.unknown;\r\n\tswitch (typeof format === 'string' ? format.toLowerCase() : format) {\r\n\t\tcase 'trade paperback':\r\n\t\t\treturn TitleFormatDescription.paperback;\r\n\t\tcase 'mass market':\r\n\t\t\treturn TitleFormatDescription.paperback;\r\n\t\tcase 'b-format paperback':\r\n\t\t\treturn TitleFormatDescription.paperback;\r\n\t\tcase 'hardcover with dust jacket':\r\n\t\t\treturn TitleFormatDescription.hardcover;\r\n\t\tcase 'hardcover paper over boards':\r\n\t\t\treturn TitleFormatDescription.hardcover;\r\n\t\tcase 'book':\r\n\t\t\treturn TitleFormatDescription.unknown;\r\n\t\tdefault:\r\n\t\t\treturn format;\r\n\t}\r\n};\r\n\r\nexport const compareTitlesByFormatAndPrice = titles => {\r\n\tconst getTitlePrice = title => title.listPrice || title.retailPrice || 0;\r\n\tconst formatOrder = [\r\n\t\tTitleFormatDescription.hardcover,\r\n\t\tTitleFormatDescription.paperback,\r\n\t\tTitleFormatDescription.audioCassette,\r\n\t\tTitleFormatDescription.audioCD,\r\n\t\tTitleFormatDescription.unknown,\r\n\t];\r\n\tconst titlesSortedByFormat = sortBy(titles, i => {\r\n\t\tconst matchingFormat = formatOrder.indexOf(i.formatDisplayName);\r\n\t\treturn matchingFormat !== -1 ? matchingFormat : titles.length;\r\n\t});\r\n\treturn titlesSortedByFormat.sort((a, b) => {\r\n\t\treturn a.formatDisplayName === b.formatDisplayName\r\n\t\t\t? getTitlePrice(b) - getTitlePrice(a)\r\n\t\t\t: 0;\r\n\t});\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport TitleAggregateParser from '../../title/TitleAggregateParser';\r\nimport { cancelableDelay } from '../../util/delay';\r\nimport { connectToCustomerID } from './CustomerIDStore';\r\nimport { findUniqueFamilyTitles } from '../../util/titleUtility';\r\n\r\nclass TitleLanesDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tgetEndpoint: PropTypes.func,\r\n\t\tlaneConfigs: PropTypes.arrayOf(PropTypes.object),\r\n\t\tchildren: PropTypes.func,\r\n\t\ttitleName: PropTypes.string,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tgetEndpoint: () => {},\r\n\t\tlaneConfigs: [],\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tlanesByLaneKey: {},\r\n\t};\r\n\r\n\tdelay = null;\r\n\tfetchCalls = [];\r\n\r\n\trender() {\r\n\t\treturn this.props.children(this.getDataStore());\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.delay = cancelableDelay(850);\r\n\t\tthis.delay.promise\r\n\t\t\t.then(() => this.fetchTitleLanes())\r\n\t\t\t.catch(err => !err.isCanceled && console.log(err));\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tconst isArr = Array.isArray(this.fetchCalls);\r\n\t\tisArr && this.fetchCalls.forEach(call => call.cancel && call.cancel());\r\n\r\n\t\tif (this.delay && typeof this.delay.cancel === 'function') {\r\n\t\t\tthis.delay.cancel();\r\n\t\t}\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: state.isLoading,\r\n\t\tgetLaneConfigs: () => this.props.laneConfigs,\r\n\t\tgetLane: laneKey => this.getLane(laneKey),\r\n\t\tgetLaneHeader: laneKey => this.getOneLaneConfig(laneKey).title,\r\n\t\tgetLaneSubtitle: laneKey => this.getOneLaneConfig(laneKey).subtitle,\r\n\t\tgetTitles: laneKey => state.lanesByLaneKey[laneKey].titles,\r\n\t\tupdateLane: laneKey => this.updateLane(laneKey),\r\n\t\tfetchMoreTitles: laneKey => this.fetchMoreTitles(laneKey),\r\n\t\thasTitlesInLane: laneKey => this.hasTitlesInLane(laneKey),\r\n\t\tfetchAllAvailableTitles: laneKey => {\r\n\t\t\treturn this.fetchAllAvailableTitles(laneKey);\r\n\t\t},\r\n\t\thasTitlesInAnyLane: () => this.hasTitlesInAnyLane(),\r\n\t});\r\n\r\n\tgetLane = laneNameKey => {\r\n\t\tconst { lanesByLaneKey } = this.state;\r\n\t\tif (lanesByLaneKey[laneNameKey]) {\r\n\t\t\treturn lanesByLaneKey[laneNameKey];\r\n\t\t}\r\n\t\treturn { titles: [], totalAvailableCount: 0 };\r\n\t};\r\n\r\n\tgetOneLaneConfig = laneKey => {\r\n\t\tconst { laneConfigs } = this.props;\r\n\t\tfor (let i = 0; i < laneConfigs.length; i++) {\r\n\t\t\tif (laneConfigs[i].key === laneKey) {\r\n\t\t\t\treturn laneConfigs[i];\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\thasTitlesInLane = laneKey => {\r\n\t\tconst lane = this.getLane(laneKey);\r\n\t\treturn lane.totalAvailableCount > 0;\r\n\t};\r\n\r\n\tfetchTitleLanes = async () => {\r\n\t\tconst { laneConfigs } = this.props;\r\n\r\n\t\tthis.fetchCalls = laneConfigs.map(laneConfig => {\r\n\t\t\treturn this.fetchOneTitleLane(laneConfig.key);\r\n\t\t});\r\n\r\n\t\tconst lanesByLaneKey = {};\r\n\t\tconst responses = await Promise.all(\r\n\t\t\tthis.fetchCalls.map(c => c.promise),\r\n\t\t);\r\n\r\n\t\tresponses.forEach((res, idx) => {\r\n\t\t\tlanesByLaneKey[laneConfigs[idx].key] = this.buildLaneState(res);\r\n\t\t});\r\n\r\n\t\tthis.setState({ isLoading: false, lanesByLaneKey });\r\n\t\tthis.fetchCalls = [];\r\n\t};\r\n\r\n\t// String -> Promise { Object { titles: Array, totalAvailableCount: number } }\r\n\t// Returns fetch request for all the available titles in given lane identifed by its 'key'\r\n\tfetchAllAvailableTitles = laneNameKey => {\r\n\t\tconst { totalAvailableCount } = this.getLane(laneNameKey);\r\n\t\tconst req = this.fetchOneTitleLane(laneNameKey, totalAvailableCount);\r\n\t\treturn req.promise.then(this.buildLaneState);\r\n\t};\r\n\r\n\tfetchOneTitleLane = (laneNameKey, total = 0) => {\r\n\t\tconst endpoint = this.props.getEndpoint(laneNameKey, total);\r\n\t\treturn api.cancelableGet(endpoint);\r\n\t};\r\n\r\n\tbuildLaneState = response => {\r\n\t\tconst { titleAggregate } = response;\r\n\t\tconst parser = new TitleAggregateParser(titleAggregate);\r\n\t\tconst laneTitles = parser.buildTitles();\r\n\t\treturn this.findTitlesToParse(laneTitles, response);\r\n\t};\r\n\r\n\tfindTitlesToParse = (laneTitles, response) => {\r\n\t\tconst filteredTitles = this.filterTitlesWithTitleName(laneTitles);\r\n\t\tconst uniqueTitles = findUniqueFamilyTitles(filteredTitles);\r\n\t\tconst countOfRemovedTitles = laneTitles.length - uniqueTitles.length;\r\n\t\treturn {\r\n\t\t\ttitles: uniqueTitles,\r\n\t\t\ttotalAvailableCount:\r\n\t\t\t\tresponse.totalAvailableTitles - countOfRemovedTitles,\r\n\t\t};\r\n\t};\r\n\r\n\tfilterTitlesWithTitleName = titles => {\r\n\t\tconst { titleName } = this.props;\r\n\t\treturn titleName ? titles.filter(t => t.name !== titleName) : titles;\r\n\t};\r\n\r\n\tfetchMoreTitles = laneName => {\r\n\t\tconst lane = this.state.lanesByLaneKey[laneName];\r\n\t\tconst availableCt = lane.totalAvailableCount;\r\n\r\n\t\tconst titlesInLane = lane.titles;\r\n\t\tconst total = titlesInLane.length;\r\n\r\n\t\tconst nextTotal = total + 20 > availableCt ? availableCt : total + 20;\r\n\r\n\t\tconst request = this.fetchOneTitleLane(laneName, nextTotal);\r\n\t\tthis.fetchCalls = [request];\r\n\r\n\t\treturn request.promise\r\n\t\t\t.then(this.parseNextStateFromResponse(laneName))\r\n\t\t\t.then(nextLane => {\r\n\t\t\t\tthis.setState(state => ({\r\n\t\t\t\t\t...state,\r\n\t\t\t\t\tlanesByLaneKey: {\r\n\t\t\t\t\t\t...state.lanesByLaneKey,\r\n\t\t\t\t\t\t[nextLane.key]: nextLane.nextState,\r\n\t\t\t\t\t},\r\n\t\t\t\t}));\r\n\t\t\t});\r\n\t};\r\n\r\n\tupdateLane = laneNameKey => {\r\n\t\tconst laneUpdateRequests = [this.requestLaneRefresh(laneNameKey)];\r\n\t\treturn this.setNewStateWithLaneRefreshes(laneUpdateRequests);\r\n\t};\r\n\r\n\trequestLaneRefresh(laneName) {\r\n\t\tconst request = this.fetchOneTitleLane(laneName);\r\n\r\n\t\tif (Array.isArray(this.fetchCalls)) {\r\n\t\t\tthis.fetchCalls.push(request);\r\n\t\t} else {\r\n\t\t\tthis.fetchCalls = [request];\r\n\t\t}\r\n\r\n\t\treturn request.promise.then(this.parseNextStateFromResponse(laneName));\r\n\t}\r\n\r\n\tparseNextStateFromResponse = laneName => response => {\r\n\t\tconst r = response;\r\n\t\treturn {\r\n\t\t\tkey: laneName,\r\n\t\t\tnextState: this.buildLaneState(r),\r\n\t\t};\r\n\t};\r\n\r\n\tsetNewStateWithLaneRefreshes = laneRequests => {\r\n\t\treturn Promise.all(laneRequests).then(lanes => {\r\n\t\t\tif (lanes.length === 0) return;\r\n\r\n\t\t\tconst nextLanesByKey = {};\r\n\t\t\tlanes.forEach(lane => (nextLanesByKey[lane.key] = lane.nextState));\r\n\r\n\t\t\treturn this.setState(state => ({\r\n\t\t\t\t...state,\r\n\t\t\t\tlanesByLaneKey: {\r\n\t\t\t\t\t...state.lanesByLaneKey,\r\n\t\t\t\t\t...nextLanesByKey,\r\n\t\t\t\t},\r\n\t\t\t}));\r\n\t\t});\r\n\t};\r\n\r\n\thasTitlesInAnyLane = () => {\r\n\t\tconst { laneConfigs } = this.props;\r\n\t\treturn laneConfigs.some(lane => this.hasTitlesInLane(lane.key));\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(TitleLanesDataStore);\r\n","const RetailTitleLaneType = {\r\n\tfrontlist: 'frontlist',\r\n\trecentPub: 'recentPub',\r\n\tstaffReviews: 'staffReviews',\r\n\tsectionHighlights: 'sectionHighlights',\r\n\tdeeperBacklist: 'deeperBacklist',\r\n\twishList: 'wishList',\r\n\trelatedComps: 'relatedComps',\r\n\trelatedSection: 'relatedSection',\r\n\trelatedSeries: 'relatedSeries',\r\n};\r\n\r\nexport default RetailTitleLaneType;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nArrowUpIcon.propTypes = {\r\n\tclassName: PropTypes.string,\r\n};\r\n\r\nArrowUpIcon.defaultProps = {\r\n\tclassName: '',\r\n};\r\n\r\nexport default function ArrowUpIcon({ className }) {\r\n\treturn
;\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button, notification, Tooltip } from 'antd';\r\nimport { CopyToClipboard } from 'react-copy-to-clipboard';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport ArrowUpIcon from '../../UI/ArrowUpIcon';\r\nimport './copyLinkToWishlistAnchor.css';\r\n\r\nconst propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\ttext: PropTypes.element,\r\n};\r\n\r\nfunction CopyLinkToWishlistAnchor({ isMobile, text }) {\r\n\tconst buildLinkToWishlist = () => {\r\n\t\tconst host = window.location.host;\r\n\t\tconst protocol = window.location.protocol;\r\n\r\n\t\tconst referralSource = localStorage.getItem('data');\r\n\t\treturn referralSource\r\n\t\t\t? `${protocol}//${host}/wishlist?referralsource=${referralSource}`\r\n\t\t\t: null;\r\n\t};\r\n\r\n\tconst onCopy = translate => {\r\n\t\tnotification.success({\r\n\t\t\tmessage: translate('copied_link_to_your_clipboard'),\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderShareButton = () => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{text}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst wishlistLink = buildLinkToWishlist();\r\n\r\n\treturn wishlistLink ? (\r\n\t\t\r\n\t\t\t{({ translate }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t onCopy(translate)}>\r\n\t\t\t\t\t\t\t{isMobile() ? (\r\n\t\t\t\t\t\t\t\trenderShareButton()\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\tplacement=\"right\">\r\n\t\t\t\t\t\t\t\t\t{renderShareButton()}\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) : null;\r\n}\r\n\r\nexport default withIsMobile(CopyLinkToWishlistAnchor);\r\n\r\nCopyLinkToWishlistAnchor.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleLanesDataStore from '../../data/TitleLanesDataStore';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport RetailTitleLaneType from '../../../entity/RetailTitleLaneType';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport CopyLinkToWishlistAnchor from '../UI/CopyLinkToWishlistAnchor';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst { wishList } = RetailTitleLaneType;\r\n\r\nconst WishlistContext = React.createContext();\r\n\r\nexport const connectToWishlist = makeConnectTo(\r\n\tWishlistContext,\r\n\t'wishlistLaneDataStore',\r\n);\r\n\r\nclass WishlistLaneDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t\tsectionLevel: PropTypes.string,\r\n\t\tsectionId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tsectionId: '0',\r\n\t\tsectionLevel: 'all',\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisUpdating: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderChildren}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderChildren = titleLanesDataStore => {\r\n\t\tconst wishlistLaneDataStore = this.getWishlistLaneDataStore(\r\n\t\t\ttitleLanesDataStore,\r\n\t\t);\r\n\r\n\t\tif (typeof this.props.children === 'function') {\r\n\t\t\treturn this.props.children(wishlistLaneDataStore);\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tgetWishlistLaneDataStore = titleLanesDataStore => ({\r\n\t\t...titleLanesDataStore,\r\n\t\tgetLane: () => {\r\n\t\t\treturn titleLanesDataStore.getLane(wishList);\r\n\t\t},\r\n\t\tgetTitles: () => {\r\n\t\t\treturn titleLanesDataStore.getTitles(wishList);\r\n\t\t},\r\n\t\tfetchMoreTitles: () => {\r\n\t\t\treturn titleLanesDataStore.fetchMoreTitles(wishList);\r\n\t\t},\r\n\t\thasTitlesInLane: () => {\r\n\t\t\treturn titleLanesDataStore.hasTitlesInLane(wishList);\r\n\t\t},\r\n\t\tisUpdating: () => this.state.isUpdating,\r\n\t\tupdateLane: () => this.updateLane(titleLanesDataStore),\r\n\t});\r\n\r\n\tupdateLane = titleLanesDataStore => {\r\n\t\tthis.setState({ isUpdating: true });\r\n\t\treturn titleLanesDataStore.updateLane(wishList).then(() => {\r\n\t\t\tthis.setState({ isUpdating: false });\r\n\t\t});\r\n\t};\r\n\r\n\tgetEndpoint = (laneType, total) => {\r\n\t\tconst { sectionId, sectionLevel: lvl, customerState: c } = this.props;\r\n\t\treturn `/org/${c.orgId}/customer/${c.customerId}/titles/${wishList}/${lvl}/${sectionId}/${total}`;\r\n\t};\r\n\r\n\tgetLaneConfigs() {\r\n\t\tconst wishlistTitlesLaneConfig = {\r\n\t\t\tkey: wishList,\r\n\t\t\ticon: '',\r\n\t\t\ttitle: ,\r\n\t\t\tsubtitle: {\r\n\t\t\t\ttext: ,\r\n\t\t\t\tlink: (\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\treturn [wishlistTitlesLaneConfig];\r\n\t}\r\n}\r\n\r\nexport default connectToCustomerID(WishlistLaneDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button, notification, Tooltip } from 'antd';\r\nimport WishlistController from './WishlistController';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport { connectToWishlist } from './data/WishlistLaneDataStore';\r\nimport { connectToWishlistSkus } from './data/WishlistSkusDataStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './wishlistButton.css';\r\n\r\nclass WishlistButton extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\twishlistSkusDataStore: PropTypes.object,\r\n\t\twishlistLaneDataStore: PropTypes.object,\r\n\t\t// passed in from parent\r\n\t\tsku: PropTypes.string,\r\n\t\ttitleName: PropTypes.string,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\toriginalState: null,\r\n\t\tisOnWishlist: null,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{wishlist => {\r\n\t\t\t\t\t\t\t\tif (this.state.isOnWishlist === null) {\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);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn this.renderButton(wishlist, translate);\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\tcomponentDidMount() {\r\n\t\tconst { previewMode, sku, wishlistSkusDataStore } = this.props;\r\n\r\n\t\tif (previewMode.isActive()) {\r\n\t\t\treturn this.setState({ isOnWishlist: false, originalState: false });\r\n\t\t}\r\n\r\n\t\tconst isAlreadyOnWishlist =\r\n\t\t\twishlistSkusDataStore && wishlistSkusDataStore.includes(sku);\r\n\r\n\t\tthis.setState({\r\n\t\t\tisOnWishlist: isAlreadyOnWishlist,\r\n\t\t\toriginalState: isAlreadyOnWishlist,\r\n\t\t});\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tif (this.wasWishlistUpdated() && this.props.wishlistLaneDataStore) {\r\n\t\t\tthis.props.wishlistLaneDataStore.updateLane();\r\n\t\t}\r\n\t}\r\n\r\n\twasWishlistUpdated = () => {\r\n\t\tconst { isOnWishlist: currentState, originalState } = this.state;\r\n\t\treturn currentState !== originalState;\r\n\t};\r\n\r\n\trenderButton(wishlist, translate) {\r\n\t\tif (this.state.isOnWishlist) {\r\n\t\t\treturn this.renderRemoveButton(wishlist, translate);\r\n\t\t}\r\n\t\treturn this.renderAddButton(wishlist, translate);\r\n\t}\r\n\r\n\trenderAddButton = (wishlist, translate) => {\r\n\t\treturn this.renderWishlistButton({\r\n\t\t\ticon: 'add-circle',\r\n\t\t\tonClick: () => this.add(wishlist, translate),\r\n\t\t});\r\n\t};\r\n\r\n\trenderRemoveButton = (wishlist, translate) => {\r\n\t\treturn this.renderWishlistButton({\r\n\t\t\ticon: 'approved on-wishlist',\r\n\t\t\tonClick: () => this.remove(wishlist, translate),\r\n\t\t});\r\n\t};\r\n\r\n\trenderWishlistButton = ({ onClick, icon }) => {\r\n\t\tconst { isLoading, isOnWishlist } = this.state;\r\n\t\treturn (\r\n\t\t\t
\r\n\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\tplacement=\"top\">\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\tremove = (wishlist, translate) => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\treturn wishlist.remove().then(this.onRemoveSuccess(translate));\r\n\t};\r\n\r\n\tonRemoveSuccess = translate => {\r\n\t\tconst {\r\n\t\t\twishlistSkusDataStore,\r\n\t\t\twishlistLaneDataStore,\r\n\t\t\tsku,\r\n\t\t\ttitleName,\r\n\t\t} = this.props;\r\n\t\twishlistSkusDataStore.remove(sku);\r\n\t\twishlistLaneDataStore && wishlistLaneDataStore.updateLane();\r\n\t\tthis.confirmWishlistWasUpdated();\r\n\t\tthis.notify(\r\n\t\t\ttranslate('removed_from_your_wishlist', {\r\n\t\t\t\tname: titleName,\r\n\t\t\t}),\r\n\t\t);\r\n\t};\r\n\r\n\tadd = (wishlist, translate) => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\treturn wishlist.add().then(this.onAddSuccess(translate));\r\n\t};\r\n\r\n\tonAddSuccess = translate => {\r\n\t\tconst {\r\n\t\t\twishlistSkusDataStore,\r\n\t\t\twishlistLaneDataStore,\r\n\t\t\tsku,\r\n\t\t\ttitleName,\r\n\t\t} = this.props;\r\n\t\twishlistSkusDataStore.add(sku);\r\n\t\twishlistLaneDataStore && wishlistLaneDataStore.updateLane();\r\n\t\tthis.confirmWishlistWasUpdated();\r\n\t\tthis.notify(translate('added_to_your_wishlist', { name: titleName }));\r\n\t};\r\n\r\n\tconfirmWishlistWasUpdated = () => {\r\n\t\tconst isOnList = this.state.isOnWishlist;\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: false,\r\n\t\t\tisOnWishlist: !isOnList,\r\n\t\t});\r\n\t};\r\n\r\n\tnotify = message => {\r\n\t\tnotification.success({ message, duration: 2 });\r\n\t};\r\n}\r\n\r\nconst connectors = [\r\n\tconnectToWishlist,\r\n\tconnectToWishlistSkus,\r\n\tconnectToPreviewMode,\r\n];\r\n\r\nexport default combineConnectors(connectors)(WishlistButton);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nconst DrawerContext = React.createContext();\r\n\r\nexport const useDrawer = () => React.useContext(DrawerContext);\r\n\r\nDrawerContextProvider.propTypes = {\r\n\tchildren: PropTypes.element,\r\n\tdrawer: PropTypes.shape({\r\n\t\topen: PropTypes.func,\r\n\t\tclose: PropTypes.func,\r\n\t}),\r\n};\r\n\r\nexport default function DrawerContextProvider({ drawer, children }) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\r\n\t);\r\n}\r\n","export const paths = {\r\n\taccount: () => '/account',\r\n\tbrowseShelves: () => '/browse-shelves',\r\n\tcampaign: () => '/campaign/:campaignId/email',\r\n\tcollection: () => '/collection/:catalogId',\r\n\tevents: () => '/events',\r\n\texplore: () => '/explore',\r\n\tisAuthPage: pathname => authPages.includes(pathname),\r\n\tlogin: () => '/login',\r\n\tlogout: () => '/logout',\r\n\torder: () => '/order',\r\n\trewards: () => '/rewards',\r\n\tsection: () => '/section/:sectionLevel/:sectionId',\r\n\tsignup: () => '/signup',\r\n\tsubscribe: () => '/subscribe',\r\n\tunsubscribe: () => '/unsubscribe',\r\n\twishlist: () => '/wishlist',\r\n};\r\n\r\nconst authPages = [paths.login(), paths.signup()];\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport delay from '../../../util/delay';\r\nimport { useHistory, useRouteMatch } from 'react-router-dom';\r\nimport { Button, Spin } from 'antd';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport { useDrawer } from '../../context/DrawerContext';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { paths } from '../../../paths';\r\nimport './bagBuyNowButton.css';\r\n\r\nBagBuyNowButton.propTypes = {\r\n\tsku: PropTypes.string,\r\n\ttype: PropTypes.string,\r\n\tlabel: PropTypes.object,\r\n\ttitleName: PropTypes.string,\r\n\tblock: PropTypes.bool,\r\n};\r\n\r\nBagBuyNowButton.defaultProps = {\r\n\tblock: true,\r\n\ttype: 'primary',\r\n\tlabel: ,\r\n};\r\n\r\nexport default function BagBuyNowButton({\r\n\tsku,\r\n\ttitleName,\r\n\tlabel,\r\n\ttype,\r\n\tblock,\r\n}) {\r\n\tconst drawer = useDrawer();\r\n\tconst bagDataStore = useBagDataStore();\r\n\r\n\tconst history = useHistory();\r\n\tconst routeMatch = useRouteMatch();\r\n\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\r\n\tconst getTitleAsEntity = () => {\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\tconst title = { sku, name: titleName };\r\n\t\treturn new RecommendableEntity(sku, type, titleName, title);\r\n\t};\r\n\r\n\tconst handleAddToBag = async () => {\r\n\t\tsetIsLoading(true);\r\n\t\tconst isInBag = bagDataStore.includes(sku);\r\n\r\n\t\tif (isInBag) {\r\n\t\t\tawait delay(1000);\r\n\t\t} else {\r\n\t\t\tawait bagDataStore.save(getTitleAsEntity());\r\n\t\t\tawait delay(300);\r\n\t\t}\r\n\r\n\t\tdrawer && drawer.close && drawer.close();\r\n\t\tawait redirectToOrderPage();\r\n\t};\r\n\r\n\tconst redirectToOrderPage = async () => {\r\n\t\tawait delay(800);\r\n\t\thistory.push('/order');\r\n\t};\r\n\r\n\tconst getButtonType =\r\n\t\tisLoading || routeMatch.path === paths.order() ? 'disabled' : type;\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{label}\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 PropTypes from 'prop-types';\r\nimport { Button, Tooltip } from 'antd';\r\nimport { connectToSellerContent } from '../../data/BooksellerContentDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './buyFromThirdPartyButton.less';\r\n\r\nclass BuyFromThirdPartyButton extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// passed in\r\n\t\ttitle: PropTypes.shape({\r\n\t\t\tsku: PropTypes.string,\r\n\t\t\tpubDate: PropTypes.string,\r\n\t\t\teCommerceUri: PropTypes.string,\r\n\t\t}),\r\n\t\tsize: PropTypes.string,\r\n\t\ttype: PropTypes.string,\r\n\t\tlabel: PropTypes.object,\r\n\t\tblock: PropTypes.bool,\r\n\t\twidth: PropTypes.number,\r\n\t\t// mapped to props\r\n\t\tbooksellerContentStore: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tlabel: ,\r\n\t\ttype: 'default',\r\n\t\tsize: 'default',\r\n\t\tblock: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst href = this.getHref();\r\n\t\tconst { label, type, size, block, width } = this.props;\r\n\r\n\t\treturn (\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\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{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\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tgetHref() {\r\n\t\tconst { title, booksellerContentStore: content } = this.props;\r\n\r\n\t\tif (title.eCommerceUri) {\r\n\t\t\treturn title.eCommerceUri;\r\n\t\t}\r\n\r\n\t\tconst { ean, skuDisplay } = title;\r\n\t\tconst isbn13 = ean ? ean : skuDisplay;\r\n\r\n\t\tif (!content.state.storeInfo.links.titles) return '';\r\n\t\treturn content.state.storeInfo.links.titles\r\n\t\t\t.replace('{sku}', isbn13)\r\n\t\t\t.trim();\r\n\t}\r\n\r\n\tgetBuyButtonLabel() {\r\n\t\tconst { title: t } = this.props;\r\n\t\treturn this.isFrontList(t.pubDate) ? (\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\tthis.props.label\r\n\t\t);\r\n\t}\r\n\r\n\tisFrontList(pubDate) {\r\n\t\tif (!pubDate) return false;\r\n\t\treturn new Date(pubDate) > new Date();\r\n\t}\r\n}\r\n\r\nexport default connectToSellerContent(BuyFromThirdPartyButton);\r\n","import { useBagDataStore } from './BagDataStore';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\n\r\nexport default function useRemoveFromBag(title, setIsLoading) {\r\n\tconst bagDataStore = useBagDataStore();\r\n\r\n\tconst removeFromBag = async () => {\r\n\t\tsetIsLoading(true);\r\n\t\tconst type = RecommendableEntity.title;\r\n\r\n\t\tconst { name, sku } = title;\r\n\t\tconst entity = new RecommendableEntity(sku, type, name, title);\r\n\r\n\t\tawait bagDataStore.remove(entity);\r\n\t};\r\n\r\n\treturn { removeFromBag };\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport delay from '../../../util/delay';\r\nimport { useHistory, useRouteMatch } from 'react-router-dom';\r\nimport { Button, Modal, Result, Spin, notification, Tooltip } from 'antd';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport useRemoveFromBag from '../data/useRemoveFromBag';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport { useDrawer } from '../../context/DrawerContext';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './bagControllerButton.css';\r\n\r\nBagControllerButton.propTypes = {\r\n\tpreviewMode: PropTypes.object,\r\n\tsku: PropTypes.string,\r\n\tisMobile: PropTypes.func,\r\n\ttitleName: PropTypes.string,\r\n\tlabel: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\r\n};\r\n\r\nfunction BagControllerButton({ previewMode, sku, titleName, isMobile, label }) {\r\n\tconst drawer = useDrawer();\r\n\tconst bagDataStore = useBagDataStore();\r\n\r\n\tconst history = useHistory();\r\n\tconst routeMatch = useRouteMatch();\r\n\r\n\tconst [isVisible, setIsVisible] = React.useState(false);\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\tconst [isRedirecting, setIsRedirecting] = React.useState(false);\r\n\r\n\tconst title = { sku, name: titleName };\r\n\tconst { removeFromBag } = useRemoveFromBag(title, setIsLoading);\r\n\r\n\tconst getTitleAsEntity = () => {\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\treturn new RecommendableEntity(sku, type, titleName, title);\r\n\t};\r\n\r\n\tconst addToBag = async () => {\r\n\t\tif (previewMode.isActive()) {\r\n\t\t\treturn previewMode.notify();\r\n\t\t}\r\n\r\n\t\tsetIsLoading(true);\r\n\t\tconst recommendableEntity = getTitleAsEntity();\r\n\r\n\t\tawait bagDataStore.save(recommendableEntity);\r\n\r\n\t\tsetIsLoading(false);\r\n\t\tsetIsVisible(true);\r\n\t};\r\n\r\n\tconst handleRemoveFromBag = translate => async () => {\r\n\t\tif (previewMode.isActive()) {\r\n\t\t\treturn previewMode.notify();\r\n\t\t}\r\n\r\n\t\tawait removeFromBag();\r\n\t\tif (routeMatch.path !== '/order') {\r\n\t\t\tsetIsLoading(false);\r\n\t\t\tnotification.success({ message: translate('removed_from_bag') });\r\n\t\t}\r\n\t};\r\n\r\n\tconst redirectToOrderPage = async () => {\r\n\t\tsetIsRedirecting(true);\r\n\t\tawait delay(900);\r\n\r\n\t\tsetIsVisible(false);\r\n\t\tawait delay(500);\r\n\r\n\t\tdrawer && drawer.close && drawer.close();\r\n\t\tawait delay(500);\r\n\r\n\t\thistory.push('/order');\r\n\t};\r\n\r\n\tconst renderAddedToBagModal = () => {\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tokText={}\r\n\t\t\t\tcancelText={}\r\n\t\t\t\tonOk={redirectToOrderPage}\r\n\t\t\t\tonCancel={() => setIsVisible(false)}>\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\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst isMobileSize = isMobile();\r\n\tconst isInBag = bagDataStore.includes(sku);\r\n\r\n\tconst getButtonLabel = () => {\r\n\t\treturn label && !isInBag ? (\r\n\t\t\tlabel\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\tconst renderButton = translate => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{getButtonLabel()}\r\n\t\t\t\t\r\n\t\t\t\t{renderAddedToBagModal()}\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{({ translate }) => {\r\n\t\t\t\treturn isMobileSize ? (\r\n\t\t\t\t\trenderButton(translate)\r\n\t\t\t\t) : (\r\n\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\t{renderButton(translate)}\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 connectToPreviewMode(withIsMobile(BagControllerButton, 915));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport BagBuyNowButton from '../../Bag/UI/BagBuyNowButton';\r\nimport BuyFromThirdPartyButton from './BuyFromThirdPartyButton';\r\nimport BagControllerButton from '../../Bag/UI/BagControllerButton';\r\nimport { useBooksellerAppSettings } from '../../data/BooksellerPreferencesDataStore';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\n\r\nBuyTitleButton.propTypes = {\r\n\ttitle: Customer360PropTypes.Title,\r\n\tlabel: PropTypes.object,\r\n\tblock: PropTypes.bool,\r\n\tdoRenderBagControllerButton: PropTypes.bool,\r\n\tbuyFromThirdPartyButtonWidth: PropTypes.number,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nBuyTitleButton.defaultProps = {\r\n\tblock: true,\r\n\tdoRenderBagControllerButton: true,\r\n};\r\n\r\nfunction BuyTitleButton({\r\n\ttitle,\r\n\tlabel,\r\n\tblock,\r\n\tdoRenderBagControllerButton,\r\n\tbuyFromThirdPartyButtonWidth,\r\n\tisMobile,\r\n}) {\r\n\tconst { doIncludeCommerce } = useBooksellerAppSettings();\r\n\tconst { name, sku } = title;\r\n\r\n\treturn doIncludeCommerce ? (\r\n\t\t<>\r\n\t\t\t{((isMobile() && !label) || !doRenderBagControllerButton) && (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t{doRenderBagControllerButton && (\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);\r\n}\r\n\r\nexport default withIsMobile(BuyTitleButton);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\nimport TitleDetailDrawer from '../TitleDetailDrawer';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { connectToTransactions } from '../../data/TransactionsDataStore';\r\nimport { connectToRatingsAndReviews } from '../../data/RatingsAndReviewsDataStore';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport BuyTitleButton from '../Buy/BuyTitleButton';\r\nimport { withIsUnknownCustomer } from '../../data/CustomerIDStore';\r\nimport './buyOrReviewButton.css';\r\n\r\nBuyOrReviewButton.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tisTitleDetail: PropTypes.bool,\r\n\tpurchases: PropTypes.array,\r\n\treviews: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n\tisUnknownCustomer: PropTypes.bool,\r\n};\r\n\r\nfunction BuyOrReviewButton({\r\n\ttitle,\r\n\tisTitleDetail,\r\n\tpurchases,\r\n\treviews,\r\n\tisMobile,\r\n\tisUnknownCustomer,\r\n}) {\r\n\tconst didUserPurchaseSku =\r\n\t\ttypeof purchases.find(p => p.sku === title.sku) !== 'undefined';\r\n\tconst didUserReviewSku =\r\n\t\treviews.productsBySku && reviews.productsBySku[title.sku];\r\n\tconst buttonWidth = isMobile() ? 280 : 100;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{!didUserPurchaseSku || isTitleDetail ? (\r\n\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\tundefined\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\t\t\r\n\t\t\t\t\t\t{didUserReviewSku ? (\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\r\nconst withUserPurchases = Component => {\r\n\tconst mapToProps = transactionsDataStore => {\r\n\t\tconst purchases =\r\n\t\t\ttransactionsDataStore.state.transactionsData.transactions;\r\n\t\treturn {\r\n\t\t\tpurchases,\r\n\t\t};\r\n\t};\r\n\treturn connectToTransactions(Component, mapToProps);\r\n};\r\n\r\nconst withUserTitleReviews = Component => {\r\n\tconst mapToProps = ratingsAndReviewsDataStore => {\r\n\t\tconst reviews = ratingsAndReviewsDataStore.state.reviews;\r\n\t\treturn {\r\n\t\t\treviews,\r\n\t\t};\r\n\t};\r\n\treturn connectToRatingsAndReviews(Component, mapToProps);\r\n};\r\n\r\nconst connectors = [\r\n\twithIsMobile,\r\n\twithUserTitleReviews,\r\n\twithUserPurchases,\r\n\twithIsUnknownCustomer,\r\n];\r\n\r\nexport default combineConnectors(connectors)(BuyOrReviewButton);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button, notification, Tooltip } from 'antd';\r\nimport { CopyToClipboard } from 'react-copy-to-clipboard';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport ArrowUpIcon from '../../UI/ArrowUpIcon';\r\nimport './copyLinkToTitleAnchor.css';\r\n\r\nconst propTypes = {\r\n\tsku: PropTypes.string,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction CopyLinkToTitleAnchor({ sku, isMobile }) {\r\n\tconst buildLinkToTitle = () => {\r\n\t\tconst baseUrl = window.location.origin;\r\n\t\tconst data = localStorage.getItem('data');\r\n\t\tlet linkUrl = `${baseUrl}/explore/title/${sku}`;\r\n\t\tif (data) {\r\n\t\t\tlinkUrl = linkUrl.concat(`?referralsource=${data}`);\r\n\t\t}\r\n\t\treturn linkUrl;\r\n\t};\r\n\r\n\tconst onCopy = translate => {\r\n\t\tnotification.success({\r\n\t\t\tmessage: translate('copied_link_to_your_clipboard'),\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderShareButton = () => {\r\n\t\treturn (\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{({ translate }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t onCopy(translate)}>\r\n\t\t\t\t\t\t\t{isMobile() ? (\r\n\t\t\t\t\t\t\t\trenderShareButton()\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\tplacement=\"top\">\r\n\t\t\t\t\t\t\t\t\t{renderShareButton()}\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 withIsMobile(CopyLinkToTitleAnchor);\r\n\r\nCopyLinkToTitleAnchor.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport WishlistButton from '../../Wishlist/WishlistButton';\r\nimport BuyOrReviewButton from './BuyOrReviewButton';\r\nimport { withIsUnknownCustomer } from '../../data/CustomerIDStore';\r\nimport CopyLinkToTitleAnchor from './CopyLinkToTitleAnchor';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport FavoriteEntityAnchor from '../../CustomerFavorites/UI/FavoriteEntityAnchor';\r\nimport './titleActionButton.css';\r\n\r\nTitleActionButtons.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tisUnknownCustomer: PropTypes.bool,\r\n\tisTitleDetail: PropTypes.bool,\r\n};\r\n\r\nTitleActionButtons.defaultProps = {\r\n\tisTitleDetail: false,\r\n};\r\n\r\nfunction TitleActionButtons({ title, isUnknownCustomer, isTitleDetail }) {\r\n\tconst entity = new RecommendableEntity(\r\n\t\ttitle.sku,\r\n\t\tRecommendableEntity.title,\r\n\t\ttitle.name,\r\n\t);\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t{!isUnknownCustomer && (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{!isTitleDetail && (\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\t\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default withIsUnknownCustomer(TitleActionButtons);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { FullDateFormatNoDayOfWeek } from '../../../dateFormats';\r\nimport ShowMoreText from 'react-show-more-text';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport TitleActionButtons from '../../Title/UI/TitleActionButtons';\r\nimport './staffReview.less';\r\n\r\nclass StaffReview extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tdoShowActionButtons: PropTypes.bool,\r\n\t\treviewerFirstName: PropTypes.string,\r\n\t\treviewerFullName: PropTypes.string,\r\n\t\treviewText: PropTypes.string,\r\n\t\tupdatedDate: PropTypes.string,\r\n\t\tchildren: PropTypes.element,\r\n\t\ttitle: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tdoShowActionButtons: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst {\r\n\t\t\tchildren,\r\n\t\t\treviewerFullName,\r\n\t\t\treviewText,\r\n\t\t\tdoShowActionButtons,\r\n\t\t\ttitle,\r\n\t\t\tisMobile,\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{children && (\r\n\t\t\t\t\t\t
{children}
\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{this.renderHeader()}\r\n\t\t\t\t
\r\n\t\t\t\t{reviewText && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{this.renderReviewText()}\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\t{doShowActionButtons && (\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\trenderHeader() {\r\n\t\tconst { reviewerFirstName, title, reviewText } = this.props;\r\n\t\tconst titleName = title.name\r\n\t\t\t? title.name\r\n\t\t\t: title.product\r\n\t\t\t? title.product.name\r\n\t\t\t: null;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{titleName}\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\trenderReviewText() {\r\n\t\tconst { reviewText } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{reviewText}\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 withIsMobile(StaffReview);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport * as Util from '../../../util';\r\nimport Convert from '../../../util/Convert';\r\nimport { connectToSellerPreferences } from '../../data/BooksellerPreferencesDataStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { connectToSections } from '../../data/SectionsDataStore';\r\n\r\nconst StaffPicksContext = React.createContext();\r\n\r\nexport const useStaffPicksDataStore = () => {\r\n\treturn React.useContext(StaffPicksContext);\r\n};\r\n\r\nexport const connectToStaffPicks = makeConnectTo(\r\n\tStaffPicksContext,\r\n\t'staffPicksDataStore',\r\n);\r\n\r\nclass StaffPicksDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsectionsDataStore: PropTypes.object,\r\n\t\tpreferencesDataStore: PropTypes.object,\r\n\t\tentityId: PropTypes.string,\r\n\t\tsectionLevel: PropTypes.string,\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tstaffPicksData: {},\r\n\t\tselectedStaffReviewers: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(dataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (!this.props.entityId && !this.props.sectionLevel) {\r\n\t\t\tthis.fetchStaffPicks();\r\n\t\t} else {\r\n\t\t\tthis.fetchStaffPicksBySection();\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tgetSelectedStaffReviewerIds: () => state.selectedStaffReviewers,\r\n\t\tgetStaffUser: appUserId => {\r\n\t\t\treturn this.getStaffUser(state, appUserId);\r\n\t\t},\r\n\t\tgetTitleReviewsByStaffUser: appUserId => {\r\n\t\t\treturn this.getTitleReviewsByStaffUser(state, appUserId);\r\n\t\t},\r\n\t\tgetCountOfReviewsByStaffUser: appUserId => {\r\n\t\t\treturn this.getCountOfReviewsByStaffUser(state, appUserId);\r\n\t\t},\r\n\t\tgetStaffPickSections: () => this.getStaffPickSections(state),\r\n\t\tgetCountOfTitlesBySection: sectionCode => {\r\n\t\t\treturn this.getCountOfTitlesBySection(state, sectionCode);\r\n\t\t},\r\n\t\tgetTitlesBySection: sectionCode => {\r\n\t\t\treturn this.getTitlesBySection(state, sectionCode);\r\n\t\t},\r\n\t\thasReviews: () => {\r\n\t\t\tif (Object.keys(state.staffPicksData.reviewsById).length) {\r\n\t\t\t\treturn Object.keys(state.staffPicksData.reviewsById).length > 0;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\tgetTitlesWithProductInfoBySection: sectionCode =>\r\n\t\t\tthis.getTitlesWithProductInfoBySection(state, sectionCode),\r\n\t});\r\n\r\n\tfetchStaffPicks = () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\tthis.request = api.cancelableGet(\r\n\t\t\t`/org/${orgId}/titles/staffReviewed/all`,\r\n\t\t);\r\n\t\tthis.request.promise.then(this.cacheApiResponse);\r\n\t};\r\n\r\n\tfetchStaffPicksBySection = async () => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\tconst { sectionLevel, entityId } = this.props;\r\n\t\tthis.request = api.cancelableGet(\r\n\t\t\t`/org/${orgId}/titles/staffReviewed/${sectionLevel}/${entityId}`,\r\n\t\t);\r\n\t\tconst response = await this.request.promise;\r\n\t\tthis.cacheApiResponse(response);\r\n\t};\r\n\r\n\tcacheApiResponse = apiResponse => {\r\n\t\tconst staffPicksData = this.getStaffPicksData(apiResponse);\r\n\t\tthis.setState({ staffPicksData });\r\n\t\tthis.getSelectedStaffReviewers();\r\n\t};\r\n\r\n\tgetStaffPicksData = apiResponse => {\r\n\t\tconst r = apiResponse;\r\n\t\treturn {\r\n\t\t\tusersById: r.usersById,\r\n\t\t\tuserAvatarsByAppUserId: r.userAvatarsByAppUserId,\r\n\t\t\treviewsById: Util.groupBy(r.reviews, 'appUserId'),\r\n\t\t\ttitlesBySectionCode: this.getSkusBySectionCode(\r\n\t\t\t\tr.skuPosData,\r\n\t\t\t\tr.productsBySku,\r\n\t\t\t\tr.productImageUrisBySku,\r\n\t\t\t),\r\n\t\t\tproductImageUrisBySku: r.productImageUrisBySku,\r\n\t\t\tproductsBySku: r.productsBySku,\r\n\t\t};\r\n\t};\r\n\r\n\tgetStaffUser = (state, appUserId) => {\r\n\t\tconst { usersById, userAvatarsByAppUserId } = state.staffPicksData;\r\n\t\tconst id = Convert.toString(appUserId);\r\n\t\treturn {\r\n\t\t\t...usersById[id],\r\n\t\t\tappUserId,\r\n\t\t\tavatarUri: userAvatarsByAppUserId[id],\r\n\t\t};\r\n\t};\r\n\r\n\tgetCountOfReviewsByStaffUser = (state, appUserId) => {\r\n\t\tconst { reviewsById } = state.staffPicksData;\r\n\t\tconst reviewsByUser = reviewsById[Convert.toString(appUserId)];\r\n\t\tconst uniqueReviewsByUser = this.getUniqueReviewsByStaffUser(\r\n\t\t\treviewsByUser,\r\n\t\t).filter(r => r.review);\r\n\t\treturn uniqueReviewsByUser.length;\r\n\t};\r\n\r\n\tgetSelectedStaffReviewers = () => {\r\n\t\tconst { preferencesDataStore } = this.props;\r\n\t\tif (\r\n\t\t\tpreferencesDataStore &&\r\n\t\t\t!preferencesDataStore.isLoading() &&\r\n\t\t\tthis.state.staffPicksData.usersById\r\n\t\t) {\r\n\t\t\tconst staffReviewerIds = preferencesDataStore.getStaffReviewerIds();\r\n\t\t\tconst staffKeys = Object.keys(this.state.staffPicksData.usersById);\r\n\t\t\tconst selectedStaffReviewers =\r\n\t\t\t\tArray.isArray(staffReviewerIds) && staffReviewerIds.length\r\n\t\t\t\t\t? staffKeys.filter(key => staffReviewerIds.includes(key))\r\n\t\t\t\t\t: staffKeys;\r\n\t\t\tthis.setState({ selectedStaffReviewers });\r\n\t\t}\r\n\t\tthis.setState({ isLoading: false });\r\n\t};\r\n\r\n\tgetTitleReviewsByStaffUser = (state, appUserId) => {\r\n\t\tconst {\r\n\t\t\tproductsBySku,\r\n\t\t\tproductImageUrisBySku,\r\n\t\t\treviewsById,\r\n\t\t} = state.staffPicksData;\r\n\r\n\t\tconst reviewsByUser = reviewsById[Convert.toString(appUserId)];\r\n\t\tconst uniqueReviewsByUser = this.getUniqueReviewsByStaffUser(\r\n\t\t\treviewsByUser,\r\n\t\t);\r\n\r\n\t\treturn uniqueReviewsByUser.map(review => ({\r\n\t\t\t...review,\r\n\t\t\tproduct: {\r\n\t\t\t\t...productsBySku[review.sku],\r\n\t\t\t\timageUri: productImageUrisBySku[review.sku],\r\n\t\t\t},\r\n\t\t}));\r\n\t};\r\n\r\n\tgetUniqueReviewsByStaffUser = reviews => {\r\n\t\treturn Array.isArray(reviews)\r\n\t\t\t? reviews.reduce((acc, review) => {\r\n\t\t\t\t\t!acc\r\n\t\t\t\t\t\t.map(r => r.assessmentId)\r\n\t\t\t\t\t\t.includes(review.assessmentId) && acc.push(review);\r\n\t\t\t\t\treturn acc;\r\n\t\t\t }, [])\r\n\t\t\t: [];\r\n\t};\r\n\r\n\tgetSkusBySectionCode(skuPosData, productsBySku, productImageUrisBySku) {\r\n\t\tvar rows = [];\r\n\t\tObject.keys(skuPosData).forEach((sku, index) => {\r\n\t\t\tvar sectionCodes = [];\r\n\t\t\tskuPosData[sku].forEach(posData => {\r\n\t\t\t\tif (sectionCodes.indexOf(posData.sectionCode) === -1) {\r\n\t\t\t\t\trows.push({\r\n\t\t\t\t\t\tsku: sku,\r\n\t\t\t\t\t\tproduct: {\r\n\t\t\t\t\t\t\t...productsBySku[sku],\r\n\t\t\t\t\t\t\timageUri: productImageUrisBySku[sku],\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tsectionCode: posData.sectionCode,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsectionCodes.push(posData.sectionCode);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\treturn Util.groupBy(rows, 'sectionCode');\r\n\t}\r\n\r\n\tgetCountOfTitlesBySection = (state, sectionCode) => {\r\n\t\tconst sectionTitles = this.getTitlesBySection(state, sectionCode);\r\n\t\treturn sectionTitles.length;\r\n\t};\r\n\r\n\tgetTitlesBySection = (state, sectionCode) => {\r\n\t\tconst sectionTitles = this.getStaffPickSections(state).find(\r\n\t\t\tsection => section.sectionCode === sectionCode,\r\n\t\t);\r\n\t\treturn sectionTitles ? sectionTitles.titles : [];\r\n\t};\r\n\r\n\tgetTitlesWithProductInfoBySection = (state, sectionCode) => {\r\n\t\tconst sectionTitles = this.getTitlesBySection(state, sectionCode);\r\n\t\tconst titlesForSelectedReviews = this.getTitlesBySkuForSelectedReviews(\r\n\t\t\tstate,\r\n\t\t);\r\n\t\treturn sectionTitles.map(title => {\r\n\t\t\tconst matchingTitle = titlesForSelectedReviews[title.sku];\r\n\t\t\treturn { ...matchingTitle, product: title.product };\r\n\t\t});\r\n\t};\r\n\r\n\tgetStaffPickSections = state => {\r\n\t\tconst { sectionsDataStore } = this.props;\r\n\t\tconst { titlesBySectionCode } = state.staffPicksData;\r\n\t\tconst sectionCodesForSectionsWithSelectedReviews = this.getSectionCodesForSectionsWithSelectedReviews(\r\n\t\t\tstate,\r\n\t\t);\r\n\t\tconst skusForSelectedReviews = Object.keys(\r\n\t\t\tthis.getTitlesBySkuForSelectedReviews(state),\r\n\t\t);\r\n\r\n\t\treturn sectionCodesForSectionsWithSelectedReviews\r\n\t\t\t.reduce((acc, sectionCode) => {\r\n\t\t\t\tconst section = sectionsDataStore.getSectionFromSectionCode(\r\n\t\t\t\t\tsectionCode,\r\n\t\t\t\t);\r\n\t\t\t\tif (section) {\r\n\t\t\t\t\tconst titles = titlesBySectionCode[sectionCode].filter(\r\n\t\t\t\t\t\ttitle => skusForSelectedReviews.includes(title.sku),\r\n\t\t\t\t\t);\r\n\t\t\t\t\tacc.push({ ...section, titles });\r\n\t\t\t\t}\r\n\t\t\t\treturn acc;\r\n\t\t\t}, [])\r\n\t\t\t.sort((a, b) => b.titles.length - a.titles.length);\r\n\t};\r\n\r\n\tgetSectionCodesForSectionsWithSelectedReviews = state => {\r\n\t\tconst { titlesBySectionCode } = state.staffPicksData;\r\n\t\tconst skusForSelectedReviews = Object.keys(\r\n\t\t\tthis.getTitlesBySkuForSelectedReviews(state),\r\n\t\t);\r\n\t\treturn Object.keys(titlesBySectionCode).filter(key => {\r\n\t\t\tconst sectionTitles = titlesBySectionCode[key].map(\r\n\t\t\t\ttitle => title.sku,\r\n\t\t\t);\r\n\t\t\tconst titlesWithSelectedReviewers = sectionTitles.filter(sku =>\r\n\t\t\t\tskusForSelectedReviews.includes(sku),\r\n\t\t\t);\r\n\t\t\treturn titlesWithSelectedReviewers.length;\r\n\t\t});\r\n\t};\r\n\r\n\tgetTitlesBySkuForSelectedReviews = state => {\r\n\t\tconst { reviewsById } = state.staffPicksData;\r\n\t\tconst { selectedStaffReviewers } = state;\r\n\t\treturn selectedStaffReviewers.reduce((acc, id) => {\r\n\t\t\tconst reviewTitles = Array.isArray(reviewsById[id])\r\n\t\t\t\t? reviewsById[id]\r\n\t\t\t\t: [];\r\n\t\t\treviewTitles.forEach(title => {\r\n\t\t\t\tif (title.review && !acc[title.sku]) {\r\n\t\t\t\t\tacc[title.sku] = title;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([\r\n\tconnectToSellerPreferences,\r\n\tconnectToCustomerID,\r\n\tconnectToSections,\r\n]);\r\n\r\nexport default connect(StaffPicksDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Link } from 'react-router-dom';\r\nimport { useSectionsDataStore } from '../../data/SectionsDataStore';\r\nimport { Button, Collapse, Icon } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './staffProfile.less';\r\n\r\nStaffProfile.propTypes = {\r\n\tstaffUser: PropTypes.object,\r\n\tstaffBio: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction StaffProfile({ staffUser, staffBio, isMobile }) {\r\n\tconst { getDepartment, getSection } = useSectionsDataStore();\r\n\tconst shelfType =\r\n\t\tstaffBio.shelves.length > 0 &&\r\n\t\tstaffBio.shelves[0] &&\r\n\t\t(staffBio.shelves[0].departmentId\r\n\t\t\t? 'department'\r\n\t\t\t: staffBio.shelves[0].sectionId\r\n\t\t\t? 'section'\r\n\t\t\t: null);\r\n\tconst shelfTypeId = `${shelfType}Id`;\r\n\tconst isDepartment = shelfType === 'department';\r\n\tconst nameType = isDepartment ? 'departmentName' : 'displayName';\r\n\tconst favoriteShelves =\r\n\t\tshelfType &&\r\n\t\tstaffBio.shelves.sort((a, b) => (a[nameType] > b[nameType] ? 1 : -1));\r\n\tconst validShelfIds =\r\n\t\tshelfType &&\r\n\t\tstaffBio.shelves.reduce((acc, shelf) => {\r\n\t\t\tconst shelfDetails = isDepartment\r\n\t\t\t\t? getDepartment(shelf.departmentId)\r\n\t\t\t\t: getSection(shelf.sectionId);\r\n\t\t\tshelfDetails && acc.push(shelfDetails[shelfTypeId]);\r\n\t\t\treturn acc;\r\n\t\t}, []);\r\n\tconst { Panel } = Collapse;\r\n\r\n\tconst isValidShelf = shelf =>\r\n\t\tArray.isArray(validShelfIds) &&\r\n\t\tvalidShelfIds.includes(shelf[shelfTypeId]);\r\n\r\n\tconst renderStaffBio = () => (\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

{staffBio.aboutText}

\r\n\t\t
\r\n\t);\r\n\r\n\tconst renderShelfButton = (shelf, idx) => {\r\n\t\tconst isValid = isValidShelf(shelf);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t

\r\n\t\t\t\t\t{isValid ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{shelf[nameType]}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\tshelf[nameType]\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 renderFavoriteShelves = () => (\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{Array.isArray(favoriteShelves) &&\r\n\t\t\t\t\tfavoriteShelves.map((shelf, idx) =>\r\n\t\t\t\t\t\trenderShelfButton(shelf, idx),\r\n\t\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\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\tstyle={{ width: isMobile() ? '100%' : '700px' }}>\r\n\t\t\t\t\t{staffBio.aboutText && renderStaffBio()}\r\n\t\t\t\t\t{shelfType && renderFavoriteShelves()}\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 withIsMobile(StaffProfile);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReactHtmlParser from 'react-html-parser';\r\nimport { Button } from 'antd';\r\nimport TitleActionButtons from './TitleActionButtons';\r\nimport FamilyTitlesDropdown from './FamilyTitlesDropdown/FamilyTitlesDropdown';\r\nimport './titleDescription.css';\r\n\r\nTitleDescription.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tisTitleDetail: PropTypes.bool,\r\n};\r\n\r\nexport default function TitleDescription({ title, isTitleDetail }) {\r\n\tconst [expanded, setExpanded] = React.useState(false);\r\n\tconst publisherDescription = title.attributes.summary;\r\n\r\n\tconst renderPublisherDescription = () => {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t\r\n\t\t\t\t\t{ReactHtmlParser(publisherDescription).filter(\r\n\t\t\t\t\t\tsection => section.type === 'span' || 'p' || 'div',\r\n\t\t\t\t\t)}\r\n\t\t\t\t
\r\n\t\t\t\t{publisherDescription.length > 200 && renderMoreButton()}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderMoreButton = () => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t

{!expanded ? '...' : null}

\r\n\t\t\t\t setExpanded(prev => !prev)}>\r\n\t\t\t\t\t{expanded ? 'less' : 'more'}\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
{title.name}
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t{publisherDescription && renderPublisherDescription()}\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
\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Tooltip } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './wishlistEntityIndicator.css';\r\n\r\nWishlistEntityIndicator.propTypes = {\r\n\tstyle: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nWishlistEntityIndicator.defaultProps = {\r\n\tstyle: {\r\n\t\tright: 30,\r\n\t\tbottom: -16,\r\n\t},\r\n};\r\n\r\nfunction WishlistEntityIndicator({ style, isMobile }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t\t) : null\r\n\t\t\t\t}\r\n\t\t\t\tplacement=\"rightTop\">\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 withIsMobile(WishlistEntityIndicator);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Tooltip } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './purchasedEntityIndicator.css';\r\n\r\nPurchasedEntityIndicator.propTypes = {\r\n\tright: PropTypes.number,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nPurchasedEntityIndicator.defaultProps = {\r\n\tright: 30,\r\n};\r\n\r\nfunction PurchasedEntityIndicator({ right, isMobile }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t : null}\r\n\t\t\t\tplacement=\"rightTop\">\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\r\nexport default withIsMobile(PurchasedEntityIndicator);\r\n","import React from 'react';\r\nimport { Tooltip } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport PropTypes from 'prop-types';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './bagEntityIndicator.css';\r\n\r\nBagEntityIndicator.propTypes = {\r\n\tright: PropTypes.number,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nBagEntityIndicator.defaultProps = {\r\n\tright: 33,\r\n};\r\n\r\nfunction BagEntityIndicator({ right, isMobile }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t : null\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\r\nexport default withIsMobile(BagEntityIndicator);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport TitleJacketImage from '../Title/UI/TitleJacketImage';\r\nimport { connectToBag } from '../Bag/data/BagDataStore';\r\nimport { connectToFavorites } from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport { connectToWishlistSkus } from '../Wishlist/data/WishlistSkusDataStore';\r\nimport { connectToTransactions } from '../data/TransactionsDataStore';\r\nimport WishlistEntityIndicator from '../Wishlist/UI/WishlistEntityIndicator';\r\nimport PurchasedEntityIndicator from '../Rewards/UI/PurchasedEntityIndicator';\r\nimport FavoriteEntityIndicator from '../CustomerFavorites/UI/FavoriteEntityIndicator';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport BagEntityIndicator from '../Bag/UI/BagEntityIndicator';\r\nimport TitleDetailDrawer from '../Title/TitleDetailDrawer';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nTitleJacketImageWithIconBadges.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tsize: PropTypes.string,\r\n\tisInTitleLane: PropTypes.bool,\r\n\tisMobile: PropTypes.func,\r\n\ttitleIsInBag: PropTypes.bool,\r\n\ttitleIsInWishlist: PropTypes.bool,\r\n\ttitleIsFavorite: PropTypes.bool,\r\n\ttitleWasPurchased: PropTypes.bool,\r\n};\r\n\r\nTitleJacketImageWithIconBadges.defaultProps = {\r\n\tisInTitleLane: false,\r\n};\r\n\r\nfunction TitleJacketImageWithIconBadges({\r\n\ttitle,\r\n\tsize,\r\n\tisInTitleLane,\r\n\tisMobile,\r\n\ttitleIsInBag,\r\n\ttitleIsFavorite,\r\n\ttitleIsInWishlist,\r\n\ttitleWasPurchased,\r\n}) {\r\n\tconst renderTitleJacketImage = () => {\r\n\t\tif (isInTitleLane) {\r\n\t\t\tconst jacketSize = isMobile() ? 'mobile' : 'medium';\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{renderIconBadges()}\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\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{renderIconBadges()}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderIconBadges = () => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{titleIsInBag && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{titleIsFavorite && renderFavoritesBadge()}\r\n\t\t\t\t{titleIsInWishlist && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{titleWasPurchased && (\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 renderFavoritesBadge = () => {\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\tconst entity = new RecommendableEntity(title.sku, type, title.name);\r\n\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tbottom: isInTitleLane ? -12 : -6,\r\n\t\t\t\t\tright: titleIsInWishlist\r\n\t\t\t\t\t\t? isInTitleLane\r\n\t\t\t\t\t\t\t? 58\r\n\t\t\t\t\t\t\t: 23\r\n\t\t\t\t\t\t: isInTitleLane\r\n\t\t\t\t\t\t? 33\r\n\t\t\t\t\t\t: -8,\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{renderTitleJacketImage()}\r\n\t\t\r\n\t);\r\n}\r\n\r\nconst mapWishlistToProps = (wishlistSkusDataStore, { title }) => {\r\n\tconst hasDataStore = typeof wishlistSkusDataStore !== 'undefined';\r\n\treturn {\r\n\t\ttitleIsInWishlist:\r\n\t\t\thasDataStore && wishlistSkusDataStore.includes(title.sku),\r\n\t};\r\n};\r\n\r\nconst mapFavoritesToProps = (customerFavoritesDataStore, { title }) => {\r\n\tconst hasFavoritesDataStore =\r\n\t\ttypeof customerFavoritesDataStore !== 'undefined';\r\n\treturn {\r\n\t\ttitleIsFavorite:\r\n\t\t\thasFavoritesDataStore &&\r\n\t\t\tcustomerFavoritesDataStore.includes(\r\n\t\t\t\ttitle.sku,\r\n\t\t\t\tRecommendableEntity.title,\r\n\t\t\t),\r\n\t};\r\n};\r\n\r\nconst mapTransactionsToProps = (transactionsDataStore, { title }) => ({\r\n\ttitleWasPurchased: transactionsDataStore.includes(title.sku),\r\n});\r\n\r\nconst withIsInBag = Component => {\r\n\treturn connectToBag(Component, (bagDataStore, { title }) => ({\r\n\t\ttitleIsInBag: bagDataStore.includes(title.sku),\r\n\t}));\r\n};\r\n\r\nconst connectors = [\r\n\twithIsInBag,\r\n\tComponent => connectToFavorites(Component, mapFavoritesToProps),\r\n\tComponent => connectToWishlistSkus(Component, mapWishlistToProps),\r\n\tComponent => connectToTransactions(Component, mapTransactionsToProps),\r\n];\r\n\r\nexport default combineConnectors(connectors)(\r\n\twithIsMobile(TitleJacketImageWithIconBadges),\r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin, Card, Button } from 'antd';\r\nimport { makeCancelable } from 'api-fetcher-treeline';\r\nimport api from '../../api';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport StaffReview from '../StaffPicks/UI/StaffReview';\r\nimport TitleJacketImage from '../Title/UI/TitleJacketImage';\r\nimport TitleDataStore from '../Title/data/TitleDataStore';\r\nimport TitleDescription from '../Title/UI/TitleDescription';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport { StaffUserAvatar } from '../StaffPicks/UI/StaffUserAvatar';\r\nimport { connectToStaffPicks } from '../StaffPicks/data/StaffPicksDataStore';\r\nimport TitleJacketImageWithIconBadges from '../UI/TitleJacketImageWithIconBadges';\r\nimport FavoriteEntityAnchor from '../CustomerFavorites/UI/FavoriteEntityAnchor';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport { connectToFavorites } from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport { withIsUnknownCustomer } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport TitleDetailDrawer from '../Title/TitleDetailDrawer';\r\nimport { connectToOrg } from '../data/OrganizationDataStore';\r\nimport './allAvailableTitles.less';\r\n\r\nclass AllAvailableTitles extends React.Component {\r\n\tstatic propTypes = {\r\n\t\trenderOneTitle: PropTypes.func, // (title) => Jsx\r\n\t\tfetchAllAvailableTitles: PropTypes.func, // () => Promise\r\n\t\theader: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),\r\n\t\tsubtitle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\r\n\t\tisMobile: PropTypes.func,\r\n\t\ttitles: PropTypes.array,\r\n\t\tstaffPicksDataStore: PropTypes.object,\r\n\t\torgDataStore: PropTypes.object,\r\n\t\tdoShowStaffAvatar: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\theader: ,\r\n\t\tdoShowStaffAvatar: true,\r\n\t};\r\n\r\n\trequest = null;\r\n\tloadMoreTitlesAmount = 10;\r\n\tscrollRefToLastViewedTitle = React.createRef();\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tallTitles: [],\r\n\t\tcanLoadMoreTitles: false,\r\n\t\thasLoadedMoreTitles: false,\r\n\t\tcurrentMaxTitles: this.loadMoreTitlesAmount,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderHeader()}\r\n\t\t\t\t{this.props.subtitle && this.renderSubtitle()}\r\n\t\t\t\t
\r\n\t\t\t\t\t{this.state.isLoading\r\n\t\t\t\t\t\t? this.renderLoading()\r\n\t\t\t\t\t\t: this.renderTitles()}\r\n\t\t\t\t\t{this.state.canLoadMoreTitles && (\r\n\t\t\t\t\t\t this.handleLoadMoreTitles()}>\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\thandleLoadMoreTitles = () => {\r\n\t\tconst { allTitles, currentMaxTitles } = this.state;\r\n\t\tconst newMaxTitles = currentMaxTitles + this.loadMoreTitlesAmount;\r\n\t\tconst canLoadMoreTitles = allTitles.length > newMaxTitles;\r\n\t\tthis.setState({\r\n\t\t\tcurrentMaxTitles: newMaxTitles,\r\n\t\t\tcanLoadMoreTitles,\r\n\t\t\thasLoadedMoreTitles: true,\r\n\t\t});\r\n\t};\r\n\r\n\trenderTitles = () => {\r\n\t\tconst { currentMaxTitles, allTitles } = this.state;\r\n\t\tconst titlesToRender = allTitles.slice(0, currentMaxTitles);\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{this.renderTitleCount()}\r\n\t\t\t\t{titlesToRender.map((title, idx) =>\r\n\t\t\t\t\tthis.renderOneTitle(title, idx),\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tgetNewState = allTitles => {\r\n\t\tconst { currentMaxTitles } = this.state;\r\n\t\treturn {\r\n\t\t\tisLoading: false,\r\n\t\t\tallTitles,\r\n\t\t\tcanLoadMoreTitles: allTitles.length > currentMaxTitles,\r\n\t\t};\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { titles } = this.props;\r\n\t\tif (!titles) {\r\n\t\t\tthis.request = makeCancelable(this.props.fetchAllAvailableTitles());\r\n\t\t\tthis.request.promise\r\n\t\t\t\t.then(({ titles }) => {\r\n\t\t\t\t\tconst allTitles = Array.isArray(titles) ? titles : [];\r\n\t\t\t\t\treturn this.getNewState(allTitles);\r\n\t\t\t\t})\r\n\t\t\t\t.then(newState => this.setState(newState))\r\n\t\t\t\t.catch(err => !err.isCanceled && console.log(err));\r\n\t\t} else {\r\n\t\t\tconst newState = this.getNewState(titles);\r\n\t\t\tthis.setState(newState);\r\n\t\t}\r\n\t}\r\n\r\n\thandleScrollToLastViewedTitle = () => {\r\n\t\tthis.scrollRefToLastViewedTitle.current &&\r\n\t\t\tthis.scrollRefToLastViewedTitle.current.scrollIntoView({\r\n\t\t\t\tbehavior: 'smooth',\r\n\t\t\t});\r\n\t\tthis.setState({ hasLoadedMoreTitles: false });\r\n\t};\r\n\r\n\tcomponentDidUpdate() {\r\n\t\tthis.state.hasLoadedMoreTitles && this.handleScrollToLastViewedTitle();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\trenderLoading() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderHeader() {\r\n\t\tconst { header, subtitle } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{header}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderSubtitle() {\r\n\t\tconst { subtitle } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{subtitle && subtitle.text && subtitle.link\r\n\t\t\t\t\t? [subtitle.text, subtitle.link]\r\n\t\t\t\t\t: subtitle}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderTitleCount = () => {\r\n\t\tconst { allTitles } = this.state;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{allTitles.length === 1 ? (\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)}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tgetTitleWrapperStyle = () => {\r\n\t\tconst { isLoading } = this.state;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn {\r\n\t\t\tdisplay: 'flex',\r\n\t\t\tflexDirection: 'column',\r\n\t\t\tmargin: '0 auto',\r\n\t\t\tjustifyContent: isLoading\r\n\t\t\t\t? 'center'\r\n\t\t\t\t: isMobile\r\n\t\t\t\t? 'space-around'\r\n\t\t\t\t: 'space-between',\r\n\t\t};\r\n\t};\r\n\r\n\trenderReviewOrDescription = (titleDataStore, title) => {\r\n\t\tif (titleDataStore.isLoading()) {\r\n\t\t\treturn this.renderLoading();\r\n\t\t}\r\n\t\tconst { isMobile } = this.props;\r\n\t\tconst titleData = titleDataStore.getTitle();\r\n\t\tconst firstVisibleReview = this.findFirstVisibleReview(titleData);\r\n\t\treturn firstVisibleReview ? (\r\n\t\t\tthis.findStaffReviewer(titleDataStore, title, firstVisibleReview)\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tfindFirstVisibleReview = titleData => {\r\n\t\tconst { staffPicksDataStore } = this.props;\r\n\t\tconst staffReviewerIds = staffPicksDataStore.getSelectedStaffReviewerIds();\r\n\t\treturn (\r\n\t\t\ttitleData.reviews &&\r\n\t\t\ttitleData.reviews.find(\r\n\t\t\t\tr =>\r\n\t\t\t\t\tr.text && staffReviewerIds.includes(r.appUserId.toString()),\r\n\t\t\t)\r\n\t\t);\r\n\t};\r\n\r\n\tfindStaffReviewer = (titleDataStore, title, firstVisibleReview) => {\r\n\t\tif (titleDataStore.isLoading()) {\r\n\t\t\treturn this.renderLoading();\r\n\t\t}\r\n\t\tconst staffReviewer = titleDataStore.getReviewer(\r\n\t\t\tfirstVisibleReview ? firstVisibleReview.appUserId : title.appUserId,\r\n\t\t);\r\n\t\treturn this.renderStaffReview(title, staffReviewer, firstVisibleReview);\r\n\t};\r\n\r\n\trenderStaffReview = (title, staffReviewer, firstVisibleReview) => {\r\n\t\tconst { doShowStaffAvatar } = this.props;\r\n\t\tconst review = firstVisibleReview || title;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{doShowStaffAvatar ? (\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);\r\n\t};\r\n\r\n\trenderFavoriteEntityAnchor(title) {\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\tconst entity = new RecommendableEntity(title.sku, type, title.name);\r\n\t\treturn (\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\tisLastViewedTitle = idx => {\r\n\t\tconst { currentMaxTitles } = this.state;\r\n\t\tconst lastViewedTitleIndex = this.loadMoreTitlesAmount + 1;\r\n\t\treturn idx === currentMaxTitles - lastViewedTitleIndex;\r\n\t};\r\n\r\n\trenderOneTitle = (title, idx) => {\r\n\t\tconst { isMobile, isUnknownCustomer } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t{isMobile() ? (\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{!isUnknownCustomer &&\r\n\t\t\t\t\t\t\t\tthis.renderFavoriteEntityAnchor(title)}\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{titleDataStore =>\r\n\t\t\t\t\t\t\ttitle.review\r\n\t\t\t\t\t\t\t\t? this.findStaffReviewer(titleDataStore, title)\r\n\t\t\t\t\t\t\t\t: this.renderReviewOrDescription(\r\n\t\t\t\t\t\t\t\t\t\ttitleDataStore,\r\n\t\t\t\t\t\t\t\t\t\ttitle,\r\n\t\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\nconst connectors = [\r\n\tconnectToOrg,\r\n\tconnectToFavorites,\r\n\tconnectToStaffPicks,\r\n\twithIsUnknownCustomer,\r\n\twithIsMobile,\r\n];\r\n\r\nexport default combineConnectors(connectors)(AllAvailableTitles);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport StaffUserAvatar from '../UI/StaffUserAvatar';\r\nimport StaffProfile from '../UI/StaffProfile';\r\nimport { connectToStaffPicks } from '../data/StaffPicksDataStore';\r\nimport combineConnectors from '../../data/combineConnectors.js';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { connectToSellerContent } from '../../data/BooksellerContentDataStore';\r\nimport { connectToSections } from '../../data/SectionsDataStore';\r\nimport { Link } from 'react-router-dom';\r\nimport AllAvailableTitles from '../../TitleLanes/AllAvailableTitles';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './staffPicksDetail.less';\r\n\r\nclass StaffPicksDetail extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tappUserId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\r\n\t\tsectionCode: PropTypes.string,\r\n\t\tshelfName: PropTypes.string,\r\n\t\t// Mapped to Props\r\n\t\tsectionsDataStore: PropTypes.object,\r\n\t\tbooksellerContentStore: PropTypes.object,\r\n\t\tstaffPicksDataStore: PropTypes.object,\r\n\t\ttitleReviews: PropTypes.arrayOf(PropTypes.object),\r\n\t\tisMobile: PropTypes.func,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { staffPicksDataStore } = this.props;\r\n\t\tif (staffPicksDataStore && !staffPicksDataStore.isLoading()) {\r\n\t\t\treturn this.renderReviewedTitles();\r\n\t\t}\r\n\t\treturn this.renderLoading();\r\n\t}\r\n\r\n\trenderLoading() {\r\n\t\treturn (\r\n\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...\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderDrawerHeader(staffUser) {\r\n\t\tconst { appUserId, sectionCode, isMobile } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{!sectionCode && (\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{this.getHeaderTitle(staffUser)}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tgetHeaderTitle(staffUser) {\r\n\t\tconst { sectionCode, shelfName } = this.props;\r\n\t\treturn sectionCode ? (\r\n\t\t\t\r\n\t\t) : shelfName ? (\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetSectionLink(sectionCode) {\r\n\t\tconst { sectionsDataStore } = this.props;\r\n\t\tconst section = sectionsDataStore.getSectionFromSectionCode(\r\n\t\t\tsectionCode,\r\n\t\t);\r\n\t\treturn section ? (\r\n\t\t\t\r\n\t\t\t\t{section.displayName || section.sectionName}\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tfindStaffBioStatus(staffUser) {\r\n\t\tconst { booksellerContentStore } = this.props;\r\n\t\tconst { staffBios } = booksellerContentStore.state.customerApp;\r\n\t\tconst staffUserBio = staffBios[staffUser.id];\r\n\t\tconst hasStaffBio =\r\n\t\t\tstaffUserBio &&\r\n\t\t\t(staffUserBio.aboutText || staffUserBio.shelves.length > 0);\r\n\t\treturn { hasStaffBio, staffUserBio };\r\n\t}\r\n\r\n\trenderStaffBio(staffUser) {\r\n\t\tconst { hasStaffBio, staffUserBio } = this.findStaffBioStatus(\r\n\t\t\tstaffUser,\r\n\t\t);\r\n\t\treturn (\r\n\t\t\thasStaffBio && (\r\n\t\t\t\t\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\trenderReviewedTitles() {\r\n\t\tconst {\r\n\t\t\tappUserId,\r\n\t\t\tstaffPicksDataStore,\r\n\t\t\tsectionCode,\r\n\t\t\ttitleReviews,\r\n\t\t} = this.props;\r\n\t\tconst staffUser = !sectionCode\r\n\t\t\t? staffPicksDataStore.getStaffUser(appUserId)\r\n\t\t\t: null;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t{staffUser && this.renderStaffBio(staffUser)}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst withStaffUserTitleReviews = Component => {\r\n\tconst mapToProps = (staffPicksDataStore, { sectionCode, appUserId }) => {\r\n\t\tconst titlesWithReviews = sectionCode\r\n\t\t\t? staffPicksDataStore.getTitlesWithProductInfoBySection(sectionCode)\r\n\t\t\t: appUserId\r\n\t\t\t? staffPicksDataStore.getTitleReviewsByStaffUser(appUserId)\r\n\t\t\t: [];\r\n\t\tconst sortedTitlesWithReviewText = titlesWithReviews\r\n\t\t\t.filter(title => title.review)\r\n\t\t\t.sort((a, b) => new Date(b.updatedDate) - new Date(a.updatedDate));\r\n\t\treturn { titleReviews: sortedTitlesWithReviewText };\r\n\t};\r\n\treturn connectToStaffPicks(Component, mapToProps);\r\n};\r\n\r\nconst connectors = [\r\n\twithIsMobile,\r\n\twithStaffUserTitleReviews,\r\n\tconnectToSellerContent,\r\n\tconnectToSections,\r\n\tconnectToStaffPicks,\r\n];\r\n\r\nexport default combineConnectors(connectors)(StaffPicksDetail);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport { connectToStaffPicks } from '../data/StaffPicksDataStore';\r\nimport StaffPicksDetail from '../Drawers/StaffPicksDetail';\r\nimport DetailDrawerAnchor from '../../UI/DetailDrawerAnchor';\r\nimport { Tooltip } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport class StaffUserAvatar extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tappUserId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\r\n\t\t\t.isRequired,\r\n\t\tfirstName: PropTypes.string.isRequired,\r\n\t\tlastName: PropTypes.string.isRequired,\r\n\t\tavatarUri: PropTypes.string, // can be undefined\r\n\t\tdisplayName: PropTypes.string.isRequired,\r\n\t\tsize: PropTypes.string,\r\n\t\tshouldRenderStaffDetails: PropTypes.bool,\r\n\t\tshelfName: PropTypes.string,\r\n\t\tisInLane: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tsize: UserAvatar.large,\r\n\t\tshouldRenderStaffDetails: true,\r\n\t\tisInLane: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst {\r\n\t\t\tappUserId,\r\n\t\t\tshouldRenderStaffDetails,\r\n\t\t\tavatarUri,\r\n\t\t\tdisplayName,\r\n\t\t\tsize,\r\n\t\t\tfirstName,\r\n\t\t\tshelfName,\r\n\t\t\tisInLane,\r\n\t\t} = this.props;\r\n\t\treturn shouldRenderStaffDetails ? (\r\n\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\t) : null\r\n\t\t\t\t\t}>\r\n\t\t\t\t\t{this.renderUserAvatar(avatarUri, displayName, size)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\tthis.renderUserAvatar(avatarUri, displayName, size)\r\n\t\t);\r\n\t}\r\n\r\n\trenderUserAvatar = (avatarUri, displayName, size) => {\r\n\t\treturn (\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\tgetInitials = () => {\r\n\t\tconst { firstName, lastName } = this.props;\r\n\t\tif (!firstName || !lastName) return 'CU';\r\n\r\n\t\tconst first = firstName.charAt(0).toUpperCase();\r\n\t\tconst last = lastName.charAt(0).toUpperCase();\r\n\r\n\t\treturn `${first}${last}`;\r\n\t};\r\n}\r\n\r\nconst mapStaffPicksToProps = (staffPicksDataStore, { appUserId }) => {\r\n\tconst staffUser = staffPicksDataStore.getStaffUser(appUserId);\r\n\treturn {\r\n\t\tfirstName: staffUser.firstName,\r\n\t\tlastName: staffUser.lastName,\r\n\t\tdisplayName: staffUser.fullName,\r\n\t\tavatarUri: staffUser.avatarUri.uri ? staffUser.avatarUri.uri : '',\r\n\t};\r\n};\r\n\r\nexport default connectToStaffPicks(StaffUserAvatar, mapStaffPicksToProps);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport Convert from '../../../util/Convert';\r\n\r\nconst TitleIndiePicksContext = React.createContext();\r\n\r\nexport const connectToTitleIndiePicks = makeConnectTo(\r\n\tTitleIndiePicksContext,\r\n\t'titleIndiePicksDataStore',\r\n);\r\n\r\nclass TitleIndiePicksDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsku: PropTypes.string,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\ttitle: {},\r\n\t\tisLoading: true,\r\n\t\treviewerUsersById: {},\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst titleIndiePicksDataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(titleIndiePicksDataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchTitleIndiePicks();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tgetTitleIndiePicks: () => state.title,\r\n\t\tgetReviewers: () => state.reviewerUsersById,\r\n\t\tisLoading: () => state.isLoading,\r\n\t\thasReviews: () => state.title.reviews.length > 0,\r\n\t\tgetReviewer: appUserId => this.getReviewer(state, appUserId),\r\n\t});\r\n\r\n\tfetchTitleIndiePicks = () => {\r\n\t\tconst { sku, customerState: c } = this.props;\r\n\t\tconst endpoint = `/org/${c.orgId}/titles/${sku}/indiePicks`;\r\n\r\n\t\tthis.request = api.cancelableGet(endpoint);\r\n\t\tthis.request.promise.then(this.buildStateFromTitleAggregate);\r\n\t};\r\n\r\n\tgetReviewer = (state, appUserId) => {\r\n\t\tconst id = Convert.toString(appUserId);\r\n\t\tconst reviewer = state.reviewerUsersById[id];\r\n\t\treturn reviewer ? reviewer : {};\r\n\t};\r\n\r\n\tbuildStateFromTitleAggregate = titleAggregate => {\r\n\t\tconst title = this.buildTitle(titleAggregate);\r\n\t\tconst reviewerUsersById = this.buildReviewerUsersById(titleAggregate);\r\n\r\n\t\tthis.setState({\r\n\t\t\ttitle,\r\n\t\t\tisLoading: false,\r\n\t\t\treviewerUsersById,\r\n\t\t});\r\n\t};\r\n\r\n\tbuildTitle = titleAggregate => ({\r\n\t\treviews: titleAggregate.reviews,\r\n\t});\r\n\r\n\tbuildReviewerUsersById = titleAggregate => {\r\n\t\tconst reviewerUsersById = {};\r\n\r\n\t\tconst {\r\n\t\t\tusersById,\r\n\t\t\tuserAvatarsByAppUserId: avatarsById,\r\n\t\t} = titleAggregate;\r\n\r\n\t\tif (!usersById || !avatarsById) return reviewerUsersById;\r\n\r\n\t\tObject.keys(usersById).forEach(appUserId => {\r\n\t\t\treviewerUsersById[appUserId] = usersById[appUserId];\r\n\t\t\treviewerUsersById[appUserId].avatar = avatarsById[appUserId];\r\n\t\t});\r\n\r\n\t\treturn reviewerUsersById;\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(TitleIndiePicksDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { FullDateFormatNoDayOfWeek } from '../../../dateFormats';\r\nimport ShowMoreText from 'react-show-more-text';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './indieReview.less';\r\n\r\nexport default class IndieReview extends React.Component {\r\n\tstatic propTypes = {\r\n\t\treviewer: PropTypes.object,\r\n\t\treviewText: PropTypes.string,\r\n\t\tupdatedDate: PropTypes.string,\r\n\t\ttitleName: PropTypes.string,\r\n\t\tchildren: PropTypes.element,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { reviewText } = this.props;\r\n\r\n\t\treturn (\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{this.props.children}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t{this.renderHeader()}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{reviewText && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{this.renderReviewText()}\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\trenderHeader() {\r\n\t\tconst { reviewer } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\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
\r\n\t\t);\r\n\t}\r\n\r\n\trenderReviewText() {\r\n\t\tconst { reviewText } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{reviewText}\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 PropTypes from 'prop-types';\r\nimport TitleIndiePicksDataStore from '../data/TitleIndiePicksDataStore';\r\nimport DrawerAnchor from '../../UI/DrawerAnchor';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport IndieReview from '../../StaffPicks/UI/IndieReview';\r\nimport { StaffUserAvatar } from '../../StaffPicks/UI/StaffUserAvatar';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport { useBooksellerPreferencesDataStore } from '../../data/BooksellerPreferencesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './titleIndiePicks.less';\r\n\r\nTitleIndiePicks.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction TitleIndiePicks({ title, isMobile }) {\r\n\tconst isMobileSize = isMobile();\r\n\tconst { getGradient } = useBooksellerPreferencesDataStore();\r\n\r\n\tconst renderIndiePicks = titleIndiePicksDataStore => {\r\n\t\tconst { reviews } = titleIndiePicksDataStore.getTitleIndiePicks();\r\n\t\tconst reviewers = titleIndiePicksDataStore.getReviewers();\r\n\r\n\t\tif (reviews && reviews.length > 0) {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\trenderDrawerContent(reviews, reviewers)\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
\r\n\t\t\t\t\t\t\t\t{reviews.length === 1 ? (\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\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} else {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t};\r\n\r\n\tconst renderDrawerContent = (reviews, reviewers) => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{isMobileSize &&
}\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
\r\n\t\t\t\t{renderReviews(reviews, reviewers)}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderReviews = (reviews, reviewers) => {\r\n\t\treturn reviews.map((review, index) => (\r\n\t\t\t\r\n\t\t\t\t{review.appUserId in reviewers &&\r\n\t\t\t\t\trenderReview(review, reviewers[review.appUserId])}\r\n\t\t\t\r\n\t\t));\r\n\t};\r\n\r\n\tconst renderReview = (review, reviewer) => {\r\n\t\tconst { assessmentId, appUserId, updatedDate } = review;\r\n\r\n\t\tconst key = `${assessmentId}-${appUserId}`;\r\n\r\n\t\treturn (\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);\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{renderIndiePicks}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(TitleIndiePicks);\r\n","const ScrollerType = {\r\n\tsimpleBar: 'simpleBar',\r\n\tcarousel: 'carousel',\r\n};\r\n\r\nexport default ScrollerType;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ScrollerType from './ScrollerType.js';\r\n\r\nexport const ScrollerConfigContext = React.createContext();\r\n\r\nconst ScrollerConfigurationModel = PropTypes.shape({\r\n\tscrollerType: PropTypes.string,\r\n});\r\n\r\nScrollerConfigProvider.propTypes = {\r\n\tchildren: PropTypes.element,\r\n\tscrollerConfig: PropTypes.shape({\r\n\t\tmobile: ScrollerConfigurationModel,\r\n\t\tdesktop: ScrollerConfigurationModel,\r\n\t}),\r\n};\r\n\r\nScrollerConfigProvider.defaultProps = {\r\n\tscrollerConfig: {\r\n\t\tmobile: { scrollerType: ScrollerType.simpleBar },\r\n\t\tdesktop: { scrollerType: ScrollerType.simpleBar },\r\n\t},\r\n};\r\n\r\nexport function ScrollerConfigProvider({ scrollerConfig, children }) {\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 PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport SimpleBar from 'simplebar-react';\r\nimport 'simplebar/dist/simplebar.min.css';\r\nimport Carousel from 'react-multi-carousel';\r\nimport './scroller.css';\r\nimport 'react-multi-carousel/lib/styles.css';\r\nimport { ScrollerConfigContext } from './ScrollerConfigContext';\r\nimport ScrollerType from '../../UI/Scroller/ScrollerType.js';\r\n\r\nconst ScrollerConfigConsumer = ScrollerConfigContext.Consumer;\r\n\r\nconst CustomButtonGroup = ({ mobile, next, previous, ...rest }) => {\r\n\tconst {\r\n\t\tcarouselState: { totalItems, currentSlide },\r\n\t} = rest;\r\n\trest.carouselState.itemWidth = 150;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t previous()}\r\n\t\t\t/>\r\n\t\t\t next()}\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tvisibility: currentSlide === totalItems - 2.5 && 'hidden',\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t
\r\n\t);\r\n};\r\n\r\nclass Scroller extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t]).isRequired,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{scrollerConfig => {\r\n\t\t\t\t\tconst scrollerType = this.getScrollerType(scrollerConfig);\r\n\t\t\t\t\tif (scrollerType === ScrollerType.carousel) {\r\n\t\t\t\t\t\treturn this.renderCarouselScroller();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn this.renderSimplebarScroller();\r\n\t\t\t\t}}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetScrollerType = scrollerConfig => {\r\n\t\tif (this.props.isMobile()) {\r\n\t\t\treturn scrollerConfig.mobile.scrollerType;\r\n\t\t}\r\n\t\treturn scrollerConfig.desktop.scrollerType;\r\n\t};\r\n\r\n\trenderSimplebarScroller = () => {\r\n\t\treturn (\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{this.props.children}\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\tgetSimplebarProps = () => {\r\n\t\tif (this.props.isMobile()) {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t\treturn { forceVisible: 'x', autoHide: false };\r\n\t};\r\n\r\n\trenderCarouselScroller = () => {\r\n\t\tconst responsive = {\r\n\t\t\ttablet: {\r\n\t\t\t\tbreakpoint: { max: 1024, min: 464 },\r\n\t\t\t\titems: 4,\r\n\t\t\t\tslidesToSlide: 3,\r\n\t\t\t},\r\n\t\t\tmobile: {\r\n\t\t\t\tbreakpoint: { max: 464, min: 0 },\r\n\t\t\t\titems: 2.5,\r\n\t\t\t\tslidesToSlide: 1,\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tconst mobile = this.props.isMobile();\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tswipeable\r\n\t\t\t\t\tpartialVisible>\r\n\t\t\t\t\t{this.getChildren()}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tgetChildren = () => {\r\n\t\tconst { children } = this.props;\r\n\t\tif (children.props && children.props.children) {\r\n\t\t\treturn React.Children.toArray(this.props.children.props.children);\r\n\t\t}\r\n\t\treturn [];\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(Scroller);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleSkeleton from '../Title/UI/TitleSkeleton';\r\n\r\nexport class TitleSkeletons extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisRenderedInDrawer: PropTypes.bool,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { isRenderedInDrawer } = this.props;\r\n\t\treturn [...Array(isRenderedInDrawer ? 5 : 10).keys()].map(titleIdx => {\r\n\t\t\treturn (\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\r\nexport default TitleSkeletons;\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport Scroller from '../UI/Scroller/Scroller';\r\nimport TitleSkeletons from './TitleSkeletons';\r\nimport { Button } from 'antd';\r\nimport { makeCancelable } from 'api-fetcher-treeline/dist';\r\nimport TitleJacketImageWithIconBadges from '../UI/TitleJacketImageWithIconBadges';\r\n\r\nclass ViewMore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tfetchMoreTitles: PropTypes.func,\r\n\t};\r\n\r\n\tstate = { isLoading: false };\r\n\r\n\trender() {\r\n\t\treturn (\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\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tonClick = () => {\r\n\t\tthis.setState({ isLoading: true });\r\n\r\n\t\tthis.request = makeCancelable(this.props.fetchMoreTitles());\r\n\r\n\t\tthis.request.promise.then(() => {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t});\r\n\t};\r\n}\r\n\r\nexport default class TitleScroller extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisLoading: PropTypes.bool,\r\n\t\ttitles: PropTypes.arrayOf(PropTypes.object),\r\n\t\tcanFetchMoreTitles: PropTypes.bool,\r\n\t\tfetchMoreTitles: PropTypes.func,\r\n\t\trenderOneTitle: PropTypes.func,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\ttitles: [],\r\n\t\tisLoading: false,\r\n\t\tcanFetchMoreTitles: false,\r\n\t\trenderOneTitle: title => (\r\n\t\t\t\r\n\t\t),\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.renderTitles()}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderTitles() {\r\n\t\tconst {\r\n\t\t\tisLoading,\r\n\t\t\tcanFetchMoreTitles,\r\n\t\t\tfetchMoreTitles,\r\n\t\t\ttitles,\r\n\t\t} = this.props;\r\n\t\tif (isLoading) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{titles.map(this.renderOneTitle)}\r\n\t\t\t\t{canFetchMoreTitles && fetchMoreTitles && (\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\trenderOneTitle = (title, idx) => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.props.renderOneTitle(title, idx)}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nShowingTitlesCount.propTypes = {\r\n\tnumberOfTitles: PropTypes.number,\r\n};\r\n\r\nexport default function ShowingTitlesCount({ numberOfTitles }) {\r\n\tconst getCountLabel = () => {\r\n\t\treturn numberOfTitles === 1 ? (\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\treturn {getCountLabel()};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleScroller from './TitleScroller';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport LaneContainer from '../UI/LaneContainer';\r\nimport AllAvailableTitles from './AllAvailableTitles';\r\nimport { SeeAllAnchor } from '../UI/LaneContainer';\r\nimport TitleSkeletons from './TitleSkeletons';\r\nimport StaffPicksDataStore from '../StaffPicks/data/StaffPicksDataStore';\r\nimport ShowingTitlesCount from './ShowingTitlesCount';\r\nimport TitleJacketImageWithIconBadges from '../UI/TitleJacketImageWithIconBadges';\r\n\r\nclass TitleLanes extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitleLanesDataStore: PropTypes.object.isRequired,\r\n\t\trenderOneTitle: PropTypes.func, // optional\r\n\t\tshouldRenderLaneTitlesWithIcons: PropTypes.bool, // optional\r\n\t\tlaneConfigs: PropTypes.arrayOf(\r\n\t\t\tPropTypes.shape({\r\n\t\t\t\tkey: PropTypes.string,\r\n\t\t\t\ticon: PropTypes.string,\r\n\t\t\t\tsubtitle: PropTypes.oneOfType([\r\n\t\t\t\t\tPropTypes.object,\r\n\t\t\t\t\tPropTypes.string,\r\n\t\t\t\t]),\r\n\t\t\t\t// 'header'\r\n\t\t\t\ttitle: PropTypes.oneOfType([\r\n\t\t\t\t\tPropTypes.element,\r\n\t\t\t\t\tPropTypes.string,\r\n\t\t\t\t]),\r\n\t\t\t}),\r\n\t\t),\r\n\t\trenderIcon: PropTypes.func,\r\n\t\t// show all controls\r\n\t\tdoRenderSeeAllAnchor: PropTypes.bool,\r\n\t\t// Render something in the bottom right corner of the lane\r\n\t\textraBottom: PropTypes.element,\r\n\t\t// mapped to props\r\n\t\tisMobile: PropTypes.func,\r\n\t\tisRenderedInDrawer: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tlaneConfigs: [],\r\n\t\tdoRenderSeeAllAnchor: true,\r\n\t\tshouldRenderLaneTitlesWithIcons: false,\r\n\t\textraBottom: null,\r\n\t\tisRenderedInDrawer: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.getLaneConfigsToRender().map(laneConfig => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{this.renderOneLane(laneConfig)}\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\tgetLaneConfigsToRender() {\r\n\t\tconst { titleLanesDataStore } = this.props;\r\n\t\tif (titleLanesDataStore.state.isLoading) {\r\n\t\t\treturn titleLanesDataStore.getLaneConfigs();\r\n\t\t}\r\n\t\treturn titleLanesDataStore.getLaneConfigs().filter(laneConfig => {\r\n\t\t\treturn titleLanesDataStore.hasTitlesInLane(laneConfig.key);\r\n\t\t});\r\n\t}\r\n\r\n\trenderOneLane = laneConfig => {\r\n\t\tconst { key, title, subtitle } = laneConfig;\r\n\t\tconst { renderIcon } = this.props;\r\n\t\tconst header =\r\n\t\t\ttypeof renderIcon === 'function' ? this.renderHeader(title) : title;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderLaneTitleScroller(key)}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\trenderHeader = title => {\r\n\t\tconst { renderIcon } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
{title}
\r\n\t\t\t\t{renderIcon()}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\trenderExtra = laneKey => {\r\n\t\tconst key = laneKey;\r\n\t\tconst { isMobile } = this.props;\r\n\t\treturn !isMobile() && this.getShowingTitlesTotal(key);\r\n\t};\r\n\r\n\tgetShowingTitlesTotal(laneKey) {\r\n\t\tconst { titleLanesDataStore } = this.props;\r\n\t\tif (!titleLanesDataStore.state.isLoading) {\r\n\t\t\tconst titles = titleLanesDataStore.getTitles(laneKey);\r\n\t\t\tconst numberOfTitles = titles.length;\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}\r\n\r\n\trenderLaneTitleScroller(laneKey) {\r\n\t\tconst { titleLanesDataStore, isRenderedInDrawer } = this.props;\r\n\t\tif (titleLanesDataStore.state.isLoading) {\r\n\t\t\treturn (\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\r\n\t\tconst lane = titleLanesDataStore.getLane(laneKey);\r\n\t\tconst laneTitles = titleLanesDataStore.getTitles(laneKey);\r\n\t\tconst total = laneTitles.length;\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t total}\r\n\t\t\t\t\tfetchMoreTitles={() => {\r\n\t\t\t\t\t\treturn titleLanesDataStore.fetchMoreTitles(laneKey);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\trenderOneTitle={(title, idx) => {\r\n\t\t\t\t\t\treturn this.renderOneTitle(title, laneKey, idx);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t\t{this.canRenderSeeAllAnchor(laneKey) && (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\treturn this.renderAllAvailableTitlesInLane(\r\n\t\t\t\t\t\t\t\t\tlaneKey,\r\n\t\t\t\t\t\t\t\t\tfalse,\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{this.props.extraBottom}\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\tgetBottomContainerClassNames = () => {\r\n\t\tconst base = 'lane-container-bottom';\r\n\t\tconst { extraBottom } = this.props;\r\n\t\tif (extraBottom) return `${base} flex-default`;\r\n\t\treturn base;\r\n\t};\r\n\r\n\tcanRenderSeeAllAnchor(laneKey) {\r\n\t\tconst { titleLanesDataStore, doRenderSeeAllAnchor } = this.props;\r\n\r\n\t\tconst {\r\n\t\t\tgetLaneHeader,\r\n\t\t\tgetLaneSubtitle,\r\n\t\t\tfetchAllAvailableTitles,\r\n\t\t} = titleLanesDataStore;\r\n\r\n\t\tconst isFunc = x => typeof x === 'function';\r\n\r\n\t\tconst hasRequiredFuncs =\r\n\t\t\tisFunc(getLaneHeader) &&\r\n\t\t\tisFunc(getLaneSubtitle) &&\r\n\t\t\tisFunc(fetchAllAvailableTitles);\r\n\r\n\t\tconst titles = titleLanesDataStore.getTitles(laneKey);\r\n\t\tconst hasRequiredTitleCt = titles.length > 2;\r\n\r\n\t\treturn doRenderSeeAllAnchor && hasRequiredFuncs && hasRequiredTitleCt;\r\n\t}\r\n\r\n\trenderAllAvailableTitlesInLane = (laneKey, isInTitleLane) => {\r\n\t\tconst { titleLanesDataStore } = this.props;\r\n\t\tconst header = titleLanesDataStore.getLaneHeader(laneKey);\r\n\t\tconst subtitle = titleLanesDataStore.getLaneSubtitle(laneKey);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t {\r\n\t\t\t\t\t\treturn titleLanesDataStore.fetchAllAvailableTitles(\r\n\t\t\t\t\t\t\tlaneKey,\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\trenderOneTitle = (title, laneKeyName, idx) => {\r\n\t\tif (typeof this.props.renderOneTitle === 'function') {\r\n\t\t\tconst { renderOneTitle, titleLanesDataStore } = this.props;\r\n\t\t\treturn renderOneTitle(title, laneKeyName, titleLanesDataStore, idx);\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\trenderOneTitleInDrawer = (title, laneKeyName, idx) => {\r\n\t\treturn ;\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(TitleLanes);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleLanesDataStore from '../../../data/TitleLanesDataStore';\r\nimport { connectToCustomerID } from '../../../data/CustomerIDStore';\r\nimport RetailTitleLaneType from '../../../../entity/RetailTitleLaneType';\r\nimport makeConnectTo from '../../../data/makeConnectTo';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst RelatedContext = React.createContext();\r\n\r\nexport const connectToRelated = makeConnectTo(\r\n\tRelatedContext,\r\n\t'relatedLaneDataStore',\r\n);\r\n\r\nclass RelatedDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t\tsku: PropTypes.string,\r\n\t\ttitleName: PropTypes.string,\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisUpdating: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderChildren}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderChildren = titleLanesDataStore => {\r\n\t\tconst relatedDataStore = this.getRelatedDataStore(titleLanesDataStore);\r\n\r\n\t\tif (typeof this.props.children === 'function') {\r\n\t\t\treturn this.props.children(relatedDataStore);\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tgetRelatedDataStore = titleLanesDataStore => ({\r\n\t\t...titleLanesDataStore,\r\n\t\tgetLane: () => {\r\n\t\t\treturn titleLanesDataStore.getLane(this.props.retailTitleLaneType);\r\n\t\t},\r\n\t\tgetTitles: () => {\r\n\t\t\treturn titleLanesDataStore.getTitles(\r\n\t\t\t\tthis.props.retailTitleLaneType,\r\n\t\t\t);\r\n\t\t},\r\n\t\tfetchMoreTitles: () => {\r\n\t\t\treturn titleLanesDataStore.fetchMoreTitles(\r\n\t\t\t\tthis.props.retailTitleLaneType,\r\n\t\t\t);\r\n\t\t},\r\n\t\thasTitlesInLane: () => {\r\n\t\t\treturn titleLanesDataStore.hasTitlesInLane(\r\n\t\t\t\tthis.props.retailTitleLaneType,\r\n\t\t\t);\r\n\t\t},\r\n\t\tisUpdating: () => this.state.isUpdating,\r\n\t\tupdateLane: () => this.updateLane(titleLanesDataStore),\r\n\t\tfetchAllAvailableTitles: () => {\r\n\t\t\tconst type = this.props.retailTitleLaneType;\r\n\t\t\treturn titleLanesDataStore.fetchAllAvailableTitles(type);\r\n\t\t},\r\n\t});\r\n\r\n\tupdateLane = titleLanesDataStore => {\r\n\t\tthis.setState({ isUpdating: true });\r\n\t\treturn titleLanesDataStore\r\n\t\t\t.updateLane(this.props.retailTitleLaneType)\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.setState({ isUpdating: false });\r\n\t\t\t});\r\n\t};\r\n\r\n\tgetEndpoint = (laneNameKey, total) => {\r\n\t\tconst { retailTitleLaneType, sku, customerState: c } = this.props;\r\n\t\treturn `/org/${c.orgId}/title/${sku}/${retailTitleLaneType}/${total}`;\r\n\t};\r\n\r\n\tgetLaneConfigs() {\r\n\t\tconst relatedTitlesLaneConfig = {\r\n\t\t\tkey: this.props.retailTitleLaneType,\r\n\t\t\ticon: '',\r\n\t\t\ttitle: this.getTitle(this.props.retailTitleLaneType),\r\n\t\t};\r\n\t\treturn [relatedTitlesLaneConfig];\r\n\t}\r\n\r\n\tgetTitle = retailTitleLaneType => {\r\n\t\tif (retailTitleLaneType === RetailTitleLaneType.relatedComps) {\r\n\t\t\treturn ;\r\n\t\t} else if (retailTitleLaneType === RetailTitleLaneType.relatedSection) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(RelatedDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleLanes from '../../TitleLanes';\r\nimport { Spin } from 'antd';\r\nimport RelatedDataStore from './data/RelatedDataStore';\r\nimport { ScrollerConfigProvider } from '../../UI/Scroller/ScrollerConfigContext';\r\nimport ScrollerType from '../../UI/Scroller/ScrollerType.js';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './relatedTitlesLane.css';\r\n\r\nclass RelatedTitlesLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tsku: PropTypes.string,\r\n\t\ttitleName: PropTypes.string,\r\n\t\tretailTitleLaneType: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { sku, titleName, retailTitleLaneType } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderRelatedTitleLane}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderRelatedTitleLane = relatedDataStore => {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\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
\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(RelatedTitlesLane);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport ShowMoreText from 'react-show-more-text';\r\nimport './rateAndReview.less';\r\nimport { connectToRatingsAndReviews } from '../data/RatingsAndReviewsDataStore';\r\n\r\nexport class ReviewDisplay extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentityId: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { entityId, ratingsAndReviewsDataStore } = this.props;\r\n\t\tconst reviewText = ratingsAndReviewsDataStore.getReview(entityId);\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{reviewText ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{reviewText}\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)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst connect = combineConnectors([\r\n\tconnectToRatingsAndReviews,\r\n\tconnectToPreviewMode,\r\n]);\r\n\r\nexport default connect(ReviewDisplay);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Modal, Input, Button, notification } from 'antd';\r\nimport { connectToRatingsAndReviews } from '../data/RatingsAndReviewsDataStore';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport './rateAndReview.less';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst { TextArea } = Input;\r\nconst confirm = Modal.confirm;\r\n\r\nexport class ReviewInput extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentityType: PropTypes.string,\r\n\t\tentityId: PropTypes.string,\r\n\t\treview: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\treview: '',\r\n\t\tinitialReview: '',\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.setInitialReview();\r\n\t}\r\n\r\n\tonChange = ({ target: { value } }) => {\r\n\t\tthis.setState({ review: value });\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { review } = this.state;\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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
\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t this.cancelEdits()}>\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\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tthis.deleteReview(translate)\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\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tthis.saveReview(translate)\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\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\tsetInitialReview() {\r\n\t\tconst { entityId, ratingsAndReviewsDataStore } = this.props;\r\n\t\tconst reviewText = ratingsAndReviewsDataStore.getReview(entityId);\r\n\t\tif (reviewText) {\r\n\t\t\tthis.setState({\r\n\t\t\t\treview: reviewText,\r\n\t\t\t\tinitialReview: reviewText,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tcancelEdits = () => {\r\n\t\tthis.props.leaveEditMode();\r\n\t};\r\n\r\n\tsaveReview = translate => {\r\n\t\tconst initialReview = this.state.initialReview;\r\n\t\tconst currentReview = this.state.review;\r\n\t\tconst { ratingsAndReviewsDataStore, entityId, entityType } = this.props;\r\n\t\tconst entity = new RecommendableEntity(entityId, entityType);\r\n\t\tconst type = 'review';\r\n\r\n\t\tif (initialReview) {\r\n\t\t\tthis.setState({ initialReview: currentReview });\r\n\t\t\treturn ratingsAndReviewsDataStore\r\n\t\t\t\t.update(entity, currentReview, type)\r\n\t\t\t\t.then(() => {\r\n\t\t\t\t\tthis.props.leaveEditMode();\r\n\t\t\t\t})\r\n\t\t\t\t.then(() =>\r\n\t\t\t\t\tnotification.success({\r\n\t\t\t\t\t\tmessage: translate('your_x_has_been_updated', {\r\n\t\t\t\t\t\t\ttype: type,\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} else {\r\n\t\t\tthis.setState({ initialReview: currentReview });\r\n\t\t\treturn ratingsAndReviewsDataStore\r\n\t\t\t\t.save(entity, currentReview, type)\r\n\t\t\t\t.then(() => {\r\n\t\t\t\t\tthis.props.leaveEditMode();\r\n\t\t\t\t})\r\n\t\t\t\t.then(() =>\r\n\t\t\t\t\tnotification.success({\r\n\t\t\t\t\t\tmessage: translate('your_x_has_been_saved', {\r\n\t\t\t\t\t\t\ttype: type,\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\tdeleteReview = translate => {\r\n\t\tconst initialReview = this.state.initialReview;\r\n\t\tconst type = 'review';\r\n\r\n\t\tif (initialReview) {\r\n\t\t\tconfirm({\r\n\t\t\t\ttitle: this.getTitle(translate),\r\n\t\t\t\tonOk: () => {\r\n\t\t\t\t\tconst {\r\n\t\t\t\t\t\tratingsAndReviewsDataStore,\r\n\t\t\t\t\t\tentityId,\r\n\t\t\t\t\t\tentityType,\r\n\t\t\t\t\t} = this.props;\r\n\t\t\t\t\tconst entity = new RecommendableEntity(\r\n\t\t\t\t\t\tentityId,\r\n\t\t\t\t\t\tentityType,\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn ratingsAndReviewsDataStore\r\n\t\t\t\t\t\t.remove(entity, 'review')\r\n\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\tthis.props.leaveEditMode();\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.then(() =>\r\n\t\t\t\t\t\t\tnotification.success({\r\n\t\t\t\t\t\t\t\tmessage: translate('your_x_has_been_removed', {\r\n\t\t\t\t\t\t\t\t\ttype: type,\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},\r\n\t\t\t\tonCancel() {\r\n\t\t\t\t\tconsole.log('Cancel');\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tgetTitle = translate => {\r\n\t\treturn translate('are_you_sure_you_want_to_delete_review');\r\n\t};\r\n\r\n\tgetPlaceholder = translate => {\r\n\t\treturn translate('what_did_you_think_review');\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([\r\n\tconnectToRatingsAndReviews,\r\n\tconnectToPreviewMode,\r\n]);\r\n\r\nexport default connect(ReviewInput);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Rate, notification } from 'antd';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport ReviewDisplay from './ReviewDisplay';\r\nimport ReviewInput from './ReviewInput';\r\nimport { connectToRatingsAndReviews } from '../data/RatingsAndReviewsDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './rateAndReview.less';\r\n\r\nexport class RateAndReview extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentityId: PropTypes.string,\r\n\t\ttransactions: PropTypes.object,\r\n\t\tisEditingReview: PropTypes.bool,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tvalue: 0,\r\n\t\tisEditingReview: false,\r\n\t};\r\n\r\n\thandleChange = (value, translate) => {\r\n\t\tconst previousValue = this.state.value;\r\n\t\tconst type = 'rating';\r\n\t\tthis.setState({ value });\r\n\r\n\t\tconst { ratingsAndReviewsDataStore, entityType, entityId } = this.props;\r\n\t\tconst entity = new RecommendableEntity(entityId, entityType);\r\n\r\n\t\tif (value === 0) {\r\n\t\t\treturn ratingsAndReviewsDataStore.remove(entity, type).then(() =>\r\n\t\t\t\tnotification.success({\r\n\t\t\t\t\tmessage: translate('your_x_has_been_removed', {\r\n\t\t\t\t\t\ttype: type,\r\n\t\t\t\t\t}),\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\t\t} else if (previousValue > 0) {\r\n\t\t\treturn ratingsAndReviewsDataStore\r\n\t\t\t\t.update(entity, value, type)\r\n\t\t\t\t.then(() =>\r\n\t\t\t\t\tnotification.success({\r\n\t\t\t\t\t\tmessage: translate('your_x_has_been_updated', {\r\n\t\t\t\t\t\t\ttype: type,\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} else {\r\n\t\t\treturn ratingsAndReviewsDataStore\r\n\t\t\t\t.save(entity, value, type)\r\n\t\t\t\t.then(() =>\r\n\t\t\t\t\tnotification.success({\r\n\t\t\t\t\t\tmessage: translate('your_x_has_been_saved', {\r\n\t\t\t\t\t\t\ttype: type,\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\trender() {\r\n\t\tconst { value, isEditingReview } = this.state;\r\n\t\tconst { entityType, entityId } = this.props;\r\n\r\n\t\treturn (\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\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{({ translate }) => {\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\tthis.handleChange(value, translate)\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\t
\r\n\t\t\t\t\t\t&{' '}\r\n\t\t\t\t\t\t this.editReview()}>\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{isEditingReview ? (\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)}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.setInitialValue();\r\n\t}\r\n\r\n\tsetInitialValue() {\r\n\t\tconst { entityId, ratingsAndReviewsDataStore } = this.props;\r\n\t\tconst rating = ratingsAndReviewsDataStore.getRating(entityId);\r\n\t\tif (rating) {\r\n\t\t\tthis.setState({ value: rating });\r\n\t\t}\r\n\t}\r\n\r\n\teditReview = () => {\r\n\t\tthis.setState({ isEditingReview: true });\r\n\t};\r\n\r\n\tleaveEditMode = () => {\r\n\t\tthis.setState({ isEditingReview: false });\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([\r\n\tconnectToRatingsAndReviews,\r\n\tconnectToPreviewMode,\r\n]);\r\n\r\nexport default connect(RateAndReview);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport RateAndReview from '../../RateAndReview/RateAndReview';\r\nimport { useTransactionsDataStore } from '../../data/TransactionsDataStore';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\n\r\nTitleInset.propTypes = {\r\n\tsku: PropTypes.string,\r\n\tisMobile: PropTypes.func,\r\n\tuserHasPurchased: PropTypes.bool,\r\n};\r\n\r\nfunction TitleInset({ sku, userHasPurchased, isMobile }) {\r\n\tconst { countTransactions } = useTransactionsDataStore();\r\n\treturn (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t{userHasPurchased && (\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
{countTransactions(sku)}
\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
\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(TitleInset);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {\r\n\tconnectToCustomerID,\r\n\tconnectToPreviewMode,\r\n} from '../../data/CustomerIDStore';\r\nimport api from '../../../api';\r\nimport combineConnectors from '../../data/combineConnectors';\r\n\r\nexport const RecentlyViewedContext = React.createContext();\r\n\r\nclass RecentlyViewedDataStoreBase extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\r\n\t\tcustomerEntitiesController: PropTypes.shape({\r\n\t\t\tget: PropTypes.func,\r\n\t\t\tsave: PropTypes.func,\r\n\t\t\tremove: PropTypes.func,\r\n\t\t\tfind: PropTypes.func, // (entities, entityId) => { entity: object, result: bool },\r\n\t\t}),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tentities: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderChildren(dataStore)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tconst { previewMode, customerState } = this.props;\r\n\r\n\t\tif (previewMode.isActive() || customerState.isUnknownCustomer) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\r\n\t\tthis.fetchRecentlyViewedEntities();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tany: () => this.hasAnyEntities(state),\r\n\t\tisLoading: () => state.isLoading,\r\n\t\tsave: entity => this.saveEntityAsRecentlyViewed(entity),\r\n\t\tgetTitles: () => this.getTitles(state),\r\n\t});\r\n\r\n\trenderChildren(dataStore) {\r\n\t\treturn typeof this.props.children === 'function'\r\n\t\t\t? this.props.children(dataStore)\r\n\t\t\t: this.props.children;\r\n\t}\r\n\r\n\tfetchRecentlyViewedEntities = async () => {\r\n\t\tconst { customerEntitiesController } = this.props;\r\n\t\tthis.request = customerEntitiesController.get();\r\n\t\tconst entities = await this.request.promise;\r\n\t\tthis.setState({ entities, isLoading: false });\r\n\t};\r\n\r\n\thasAnyEntities = state => {\r\n\t\tif (state.isLoading) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn state.entities.length > 0;\r\n\t};\r\n\r\n\tsaveEntityAsRecentlyViewed = async entity => {\r\n\t\tconst { customerEntitiesController } = this.props;\r\n\t\tconst didSave = await customerEntitiesController.save(entity);\r\n\t\tif (didSave) {\r\n\t\t\tthis.fetchRecentlyViewedEntities();\r\n\t\t}\r\n\t};\r\n\r\n\tgetTitles = state => {\r\n\t\treturn state.entities.map(titleEntity => ({\r\n\t\t\tsku: titleEntity.entityId,\r\n\t\t\tname: titleEntity.entityName,\r\n\t\t\tauthor: titleEntity.entity.author,\r\n\t\t\timageUri: titleEntity.entityImageUri,\r\n\t\t}));\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([connectToPreviewMode, connectToCustomerID]);\r\n\r\nexport default connect(RecentlyViewedDataStoreBase);\r\n","import React from 'react';\r\nimport CustomerListType from '../../../entity/CustomerListType';\r\nimport CustomerEntitiesController from '../../data/CustomerEntitiesController';\r\nimport RecentlyViewedDataStoreBase from './RecentlyViewedDataStoreBase';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\nimport { RecentlyViewedContext } from './RecentlyViewedDataStoreBase';\r\n\r\nexport const connectToRecentlyViewed = makeConnectTo(\r\n\tRecentlyViewedContext,\r\n\t'recentlyViewedDataStore',\r\n);\r\n\r\nexport const useRecentlyViewedDataStore = () =>\r\n\tReact.useContext(RecentlyViewedContext);\r\n\r\nexport default function RecentlyViewedDataStore({ children }) {\r\n\tconst listType = CustomerListType.recentlyViewed;\r\n\r\n\tconst renderBaseDataStore = customerEntitiesController => {\r\n\t\treturn (\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\treturn (\r\n\t\t\r\n\t\t\t{renderBaseDataStore}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../api';\r\nimport CustomerListType from '../../entity/CustomerListType';\r\nimport RecommendableEntityType from '../../types/RecommendableEntity';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport { connectToRecentlyViewed } from './data/RecentlyViewedDataStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\n\r\nclass RecentlyViewedEntity extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.element,\r\n\t\trecommendableEntity: RecommendableEntityType,\r\n\t\t// mapped to props\r\n\t\tcustomerId: PropTypes.string,\r\n\t\tisPreviewMode: PropTypes.bool,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\trecentlyViewedDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn this.props.children;\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (this.doSaveEntityToRecentlyViewedForCustomer()) {\r\n\t\t\tthis.saveEntityToRecentlyViewed();\r\n\t\t}\r\n\t}\r\n\r\n\tdoSaveEntityToRecentlyViewedForCustomer = () => {\r\n\t\treturn !this.props.isPreviewMode && !this.props.isUnknownCustomer;\r\n\t};\r\n\r\n\tsaveEntityToRecentlyViewed = () => {\r\n\t\tconst { recentlyViewedDataStore, recommendableEntity } = this.props;\r\n\r\n\t\tif (typeof recentlyViewedDataStore !== 'undefined') {\r\n\t\t\trecentlyViewedDataStore.save(recommendableEntity);\r\n\t\t} else {\r\n\t\t\tthis.postRecentlyViewedEntity();\r\n\t\t}\r\n\t};\r\n\r\n\tpostRecentlyViewedEntity = () => {\r\n\t\tconst { customerId, recommendableEntity } = this.props;\r\n\r\n\t\tconst entityDTO = {\r\n\t\t\tcustomerId,\r\n\t\t\tentityId: recommendableEntity.id,\r\n\t\t\tentityType: recommendableEntity.type,\r\n\t\t\tlistType: CustomerListType.recentlyViewed,\r\n\t\t};\r\n\r\n\t\tapi.post('/customer/entity', entityDTO);\r\n\t};\r\n}\r\n\r\nconst withCustomerState = Component => {\r\n\treturn connectToCustomerID(Component, customerState => ({\r\n\t\tcustomerId: customerState.customerId,\r\n\t\tisPreviewMode: customerState.isPreviewMode,\r\n\t\tisUnknownCustomer: customerState.isUnknownCustomer,\r\n\t}));\r\n};\r\n\r\nconst connectors = [withCustomerState, connectToRecentlyViewed];\r\n\r\nexport default combineConnectors(connectors)(RecentlyViewedEntity);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleCard from './UI/TitleCard';\r\nimport PublisherContent from './UI/PublisherContent';\r\nimport { connectToTitle } from './data/TitleDataStore';\r\nimport { Spin } from 'antd';\r\nimport StaffReview from '../StaffPicks/UI/StaffReview';\r\nimport { StaffUserAvatar } from '../StaffPicks/UI/StaffUserAvatar';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport { connectToTransactions } from '../data/TransactionsDataStore';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport TitleIndiePicks from './UI/TitleIndiePicks';\r\nimport RelatedTitlesLane from './Related/RelatedTitlesLane';\r\nimport RetailTitleLaneType from '../../entity/RetailTitleLaneType';\r\nimport TitleInset from '../Rewards/UI/TitleInset';\r\nimport { withIsUnknownCustomer } from '../data/CustomerIDStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport RecentlyViewedEntity from '../RecentlyViewed/RecentlyViewedEntity';\r\nimport { connectToStaffPicks } from '../StaffPicks/data/StaffPicksDataStore';\r\nimport TitleActionButtons from './UI/TitleActionButtons';\r\nimport './titleDetail.less';\r\n\r\nclass TitleDetail extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Mapped to props\r\n\t\tstaffPicksDataStore: PropTypes.object,\r\n\t\ttitleDataStore: PropTypes.object,\r\n\t\ttransactionsDataStore: PropTypes.object,\r\n\t\tisMobile: PropTypes.func,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\tappSettings: PropTypes.shape({\r\n\t\t\tdoIncludeCommerce: PropTypes.bool,\r\n\t\t}),\r\n\t\tgradient: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\tif (this.isLoading()) {\r\n\t\t\treturn this.renderLoading();\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderTitleUI()}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tisLoading() {\r\n\t\tconst dataStores = [\r\n\t\t\tthis.props.titleDataStore,\r\n\t\t\tthis.props.transactionsDataStore,\r\n\t\t].filter(ds => typeof ds !== 'undefined');\r\n\r\n\t\tfor (let i = 0; i < dataStores.length; i++) {\r\n\t\t\tconst ds = dataStores[i];\r\n\t\t\tif (typeof ds.isLoading === 'function' && ds.isLoading()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetTitleAsEntity = () => {\r\n\t\tconst { titleDataStore } = this.props;\r\n\t\tconst title = titleDataStore.getTitle();\r\n\t\tconst entityType = RecommendableEntity.title;\r\n\t\treturn new RecommendableEntity(title.sku, entityType, title.name);\r\n\t};\r\n\r\n\trenderTitleUI = () => {\r\n\t\tconst { titleDataStore, transactionsDataStore } = this.props;\r\n\t\tconst title = titleDataStore.getTitle();\r\n\t\tconst userHasPurchased = transactionsDataStore.includes(title.sku);\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.props.isMobile() && (\r\n\t\t\t\t\t
\r\n\t\t\t\t)}\r\n\t\t\t\t{!this.props.isUnknownCustomer && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{this.renderTitleCard(title)}\r\n\t\t\t\t{titleDataStore.hasReviews() && this.renderReviews(title)}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{title.attributes && (\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\trenderTitleCard = title => {\r\n\t\treturn (\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);\r\n\t};\r\n\r\n\trenderReviews(title) {\r\n\t\tconst { titleDataStore, gradient, staffPicksDataStore } = this.props;\r\n\t\tconst staffReviewerIds = staffPicksDataStore.getSelectedStaffReviewerIds();\r\n\t\tconst visibleReviews = title.reviews.filter(r =>\r\n\t\t\tstaffReviewerIds.includes(r.appUserId.toString()),\r\n\t\t);\r\n\r\n\t\treturn visibleReviews.map(review => {\r\n\t\t\tconst { assessmentId, appUserId, updatedDate } = review;\r\n\t\t\tconst key = `${assessmentId}-${appUserId}`;\r\n\t\t\tconst userReviewer = titleDataStore.getReviewer(appUserId);\r\n\r\n\t\t\treturn (\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
\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n\r\n\trenderLoading() {\r\n\t\treturn (\r\n\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...\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst mapSettingsToProps = store => ({\r\n\tappSettings: store.getAppSettings(),\r\n\tgradient: store.getGradient(),\r\n});\r\n\r\nconst connectors = [\r\n\tconnectToTitle,\r\n\tconnectToTransactions,\r\n\tconnectToStaffPicks,\r\n\twithIsUnknownCustomer,\r\n\tC => connectToSellerPreferences(C, mapSettingsToProps),\r\n];\r\n\r\nexport default combineConnectors(connectors)(withIsMobile(TitleDetail));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleDetail from './TitleDetail';\r\nimport TitleDataStore from './data/TitleDataStore';\r\nimport DrawerAnchor from '../UI/DrawerAnchor';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport DrawerContextProvider from '../context/DrawerContext';\r\nimport StaffPicksDataStore from '../StaffPicks/data/StaffPicksDataStore';\r\n\r\nclass TitleDetailDrawer extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsku: PropTypes.string,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t\tparentStyle: PropTypes.string,\r\n\t\t// Mapped to props\r\n\t\tisMobile: PropTypes.func,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tparentStyle: 'clickable dotDot',\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\tconst { parentStyle } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderDrawerContent = drawer => {\r\n\t\treturn drawer.isVisible && this.renderTitleDetail(drawer);\r\n\t};\r\n\r\n\trenderTitleDetail = drawer => {\r\n\t\tconst { sku } = this.props;\r\n\t\treturn (\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\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(TitleDetailDrawer);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nTitleListPrice.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\torgCountry: PropTypes.string,\r\n};\r\n\r\nexport default function TitleListPrice({ title, orgCountry }) {\r\n\tlet price = ;\r\n\r\n\tconst hasTitlePosData = () => {\r\n\t\tconst { pos } = title;\r\n\t\treturn Array.isArray(pos) && pos.length && typeof pos[0] === 'object';\r\n\t};\r\n\r\n\tconst getCultureIndicator = () => {\r\n\t\treturn orgCountry && orgCountry === 'UK' ? 'en-GB' : 'en-US';\r\n\t};\r\n\r\n\tconst getCurrencyIndicator = () => {\r\n\t\treturn orgCountry && orgCountry === 'UK' ? 'GBP' : 'USD';\r\n\t};\r\n\r\n\tif (hasTitlePosData() && title.pos[0].listPrice) {\r\n\t\tprice = title.pos[0].listPrice;\r\n\t} else if (title.listPrice) {\r\n\t\tprice = title.listPrice;\r\n\t} else if (title.retailPrice) {\r\n\t\tprice = title.retailPrice;\r\n\t}\r\n\r\n\tif (typeof price === 'number') {\r\n\t\tprice = `${price.toLocaleString(getCultureIndicator(), {\r\n\t\t\tstyle: 'currency',\r\n\t\t\tcurrency: getCurrencyIndicator(),\r\n\t\t})}`;\r\n\t}\r\n\r\n\treturn {price};\r\n}\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Dropdown, Icon, Menu } from 'antd';\r\nimport TitleDetailDrawer from '../../TitleDetailDrawer';\r\nimport { useCustomerID } from '../../../data/CustomerIDStore';\r\nimport TitleListPrice from '../TitleListPrice';\r\nimport { useOrganizationDataStore } from '../../../data/OrganizationDataStore';\r\nimport api from '../../../../api';\r\nimport {\r\n\tcompareTitlesByFormatAndPrice,\r\n\tgetFormatDescriptionDisplayName,\r\n} from '../../../../util/titleUtility';\r\nimport './familyTitlesDropdown.less';\r\n\r\nFamilyTitlesDropdown.propTypes = {\r\n\ttitle: PropTypes.object,\r\n};\r\n\r\nexport default function FamilyTitlesDropdown({ title }) {\r\n\tconst [isVisible, setIsVisible] = useState(false);\r\n\tconst [familyTitles, setFamilyTitles] = useState([]);\r\n\tconst { getOrgCountry } = useOrganizationDataStore();\r\n\tconst { orgId } = useCustomerID();\r\n\r\n\tconst getTitleWithDisplayFormat = useCallback(\r\n\t\ttitle => ({\r\n\t\t\t...title,\r\n\t\t\tformatDisplayName: getFormatDescriptionDisplayName(\r\n\t\t\t\ttitle.formatDescription,\r\n\t\t\t),\r\n\t\t}),\r\n\t\t[],\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst endpoint = `/org/${orgId}/search/familyTitles?familyKey=${title.familyItem}`;\r\n\t\tconst request = api.cancelableGet(endpoint);\r\n\r\n\t\tconst sortFamilyByFormatAndPrice = titles => {\r\n\t\t\tconst titlesWithDisplayFormat = titles.map(\r\n\t\t\t\tgetTitleWithDisplayFormat,\r\n\t\t\t);\r\n\t\t\treturn compareTitlesByFormatAndPrice(titlesWithDisplayFormat);\r\n\t\t};\r\n\r\n\t\trequest.promise\r\n\t\t\t.then(familyTitles =>\r\n\t\t\t\tsortFamilyByFormatAndPrice(familyTitles.familyDropdownItems),\r\n\t\t\t)\r\n\t\t\t.then(sortedFamily => setFamilyTitles(sortedFamily))\r\n\t\t\t.catch(err => !err.isCanceled && console.log(err));\r\n\r\n\t\treturn () => {\r\n\t\t\tapi.revoke(request);\r\n\t\t};\r\n\t}, [orgId, title, getTitleWithDisplayFormat]);\r\n\r\n\tconst renderOneDropdownItem = item => {\r\n\t\treturn item ? (\r\n\t\t\t
\r\n\t\t\t\t{item.sku !== title.sku ? (\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.name}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t, {item.formatDisplayName}\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\titem.formatDisplayName\r\n\t\t\t\t)}\r\n\t\t\t\t, \r\n\t\t\t\t\r\n\t\t\t\r\n\t\t) : null;\r\n\t};\r\n\r\n\tconst getFamilyTitlesMenu = () => {\r\n\t\tconst alternativeTitleFormats = familyTitles.filter(\r\n\t\t\tt => t.sku !== title.sku,\r\n\t\t);\r\n\t\treturn (\r\n\t\t\t setIsVisible(prev => !prev)}>\r\n\t\t\t\t{alternativeTitleFormats.map((title, idx) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderOneDropdownItem(title)}\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 renderCurrentTitle = () => {\r\n\t\tconst currentTitle = familyTitles.find(t => t.sku === title.sku);\r\n\t\treturn renderOneDropdownItem(currentTitle);\r\n\t};\r\n\r\n\tconst renderDescriptionWithoutDropdown = () => {\r\n\t\tconst formattedTitle = getTitleWithDisplayFormat(title);\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{formattedTitle.formatDisplayName},{' '}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\treturn Array.isArray(familyTitles) &&\r\n\t\tfamilyTitles.length > 1 &&\r\n\t\tfamilyTitles.map(t => t.sku).includes(title.sku) ? (\r\n\t\t trigger.parentNode}\r\n\t\t\toverlayClassName={'family-titles-dropdown-overlay'}\r\n\t\t\tonVisibleChange={val => setIsVisible(val)}\r\n\t\t\ttrigger={['click']}\r\n\t\t\tdefaultValue={familyTitles[0].sku}\r\n\t\t\tstyle={{ paddingTop: 10 }}>\r\n\t\t\t
\r\n\t\t\t\t{renderCurrentTitle()}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t) : (\r\n\t\trenderDescriptionWithoutDropdown()\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport TextTruncator from '../../UI/TextTruncator';\r\nimport { connectToSections } from '../../data/SectionsDataStore';\r\nimport { Link } from 'react-router-dom';\r\nimport { Translate } from 'react-localize-redux';\r\nimport FamilyTitlesDropdown from './FamilyTitlesDropdown/FamilyTitlesDropdown';\r\nimport './titleSummary.css';\r\n\r\nexport class TitleSummary extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitle: Customer360PropTypes.Title,\r\n\t\tshouldTruncateName: PropTypes.bool,\r\n\t\ttitleNameFontSize: PropTypes.number,\r\n\t\tchildren: PropTypes.element,\r\n\t\tsections: PropTypes.arrayOf(PropTypes.object),\r\n\t\tdoShowSection: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\ttitle: {},\r\n\t\tshouldTruncateName: true,\r\n\t\ttitleNameFontSize: 16,\r\n\t\tdoShowSection: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.renderTitleSummary()}\r\n\t\t\t\t{this.props.children}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderTitleSummary() {\r\n\t\tconst {\r\n\t\t\ttitle,\r\n\t\t\ttitleNameFontSize: sz,\r\n\t\t\tshouldTruncateName,\r\n\t\t\tdoShowSection,\r\n\t\t} = this.props;\r\n\r\n\t\tlet secDisplayName = '';\r\n\r\n\t\tif (doShowSection && Array.isArray(title.pos) && title.pos[0]) {\r\n\t\t\tsecDisplayName = this.getSectionDisplayName(\r\n\t\t\t\ttitle.pos[0].sectionCode,\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (\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{shouldTruncateName ? (\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\ttitle.name\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
{title.author}
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t{new Date(title.pubDate).toLocaleDateString('en-US', {\r\n\t\t\t\t\t\t\tmonth: 'short',\r\n\t\t\t\t\t\t\tday: 'numeric',\r\n\t\t\t\t\t\t\tyear: 'numeric',\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{secDisplayName && (\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\tgetSectionDisplayName(sectionCode) {\r\n\t\tconst { sections } = this.props;\r\n\t\tif (!sections) return '';\r\n\r\n\t\tconst section = sections.find(s => s && s.sectionCode === sectionCode);\r\n\r\n\t\treturn section ? (\r\n\t\t\t\r\n\t\t\t\t{section.displayName || section.sectionName}\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t''\r\n\t\t);\r\n\t}\r\n}\r\n\r\nconst withSections = Component => {\r\n\treturn connectToSections(Component, sectionsDataStore => ({\r\n\t\tsections: sectionsDataStore.getSections(),\r\n\t}));\r\n};\r\n\r\nexport default withSections(TitleSummary);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport TitleJacketImage from '../../Title/UI/TitleJacketImage';\r\nimport TitleSummary from '../../Title/UI/TitleSummary';\r\nimport { Card } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport TitleJacketImageWithIconBadges from '../../UI/TitleJacketImageWithIconBadges';\r\n\r\nclass CollectionTitleCard extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitle: Customer360PropTypes.Title,\r\n\t\tchildren: PropTypes.element,\r\n\t\tonTitleJacketClick: PropTypes.func, // Not required\r\n\t\t// Mapped to props\r\n\t\tisMobile: PropTypes.func,\r\n\t\ttitleIsInWishlist: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\ttitleIsInWishlist: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { title } = this.props;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\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\t\t{this.props.children}\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 withIsMobile(CollectionTitleCard);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport CollectionTitleCard from './CollectionTitleCard';\r\nimport TitleDetailDrawer from '../../Title/TitleDetailDrawer';\r\nimport { Button } from 'antd';\r\nimport BuyTitleButton from '../../Title/Buy/BuyTitleButton';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './collectionTitle.css';\r\n\r\nconst propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\ttitle: Customer360PropTypes.Title,\r\n};\r\n\r\nfunction CollectionTitle({ title, isMobile }) {\r\n\tconst renderViewTitleButton = drawer => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderTitleActionButtons = () => {\r\n\t\treturn (\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{renderViewTitleButton}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tblock={false}\r\n\t\t\t\t\t\tdoRenderBagControllerButton={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\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{drawer => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{renderTitleActionButtons()}\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 withIsMobile(CollectionTitle);\r\n\r\nCollectionTitle.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport CollectionStore from './data/CollectionStore';\r\nimport CollectionHeader from './UI/CollectionHeader';\r\nimport CollectionOverview from './UI/CollectionOverview';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport CollectionTitlesWrapper from './UI/CollectionTitlesWrapper';\r\nimport CollectionTitle from './UI/CollectionTitle';\r\nimport './collection.css';\r\n\r\nexport default class CollectionLanding extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// from withIsMobile\r\n\t\tisMobile: PropTypes.func,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\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{this.renderCollectionLandingUI}\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\trenderCollectionLandingUI = collectionStore => {\r\n\t\tconst { state } = collectionStore;\r\n\t\tconst { overview } = state.catalog;\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t{overview && }\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{state.titles.map(title => {\r\n\t\t\t\t\t\t\tconst key = title.sku;\r\n\t\t\t\t\t\t\treturn ;\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 { Icon } from 'antd';\r\nimport Fade from 'treeline-react-core-components/Fade';\r\n\r\nexport default class UpdateConfirmation extends React.Component {\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tUpdated\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 PropTypes from 'prop-types';\r\nimport { Button, Modal, Input, Spin, notification } from 'antd';\r\nimport UpdateConfirmation from '../UI/UpdateConfirmation';\r\nimport { connectToOrg } from '../../data/OrganizationDataStore';\r\nimport { connectToCustomer } from '../../data/CustomerSummaryDataStore';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass UnsubscribeService extends React.Component {\r\n\tstatic propTypes = {\r\n\t\torgName: PropTypes.string,\r\n\t\tcustomerDataStore: PropTypes.object,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\tdidUpdate: false,\r\n\t\tisUnsubscribeModalOpen: false,\r\n\t\tunsubscribeReason: '',\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t

{this.getMessagePrompt()}

\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{this.getButtonLabel()}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{this.state.didUpdate && }\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}\r\n\t\t\t\t\t\t\t\tvisible={this.state.isUnsubscribeModalOpen}\r\n\t\t\t\t\t\t\t\tonCancel={this.closeModal}\r\n\t\t\t\t\t\t\t\tonOk={this.saveUnsubscribe(translate)}\r\n\t\t\t\t\t\t\t\tokText={}>\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\t\t);\r\n\t}\r\n\r\n\tgetMessagePrompt() {\r\n\t\tif (this.isUnsubscribed()) {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tupdateReason = evt => {\r\n\t\tthis.setState({\r\n\t\t\tunsubscribeReason: evt.currentTarget.value,\r\n\t\t});\r\n\t};\r\n\r\n\tgetOnClick = translate => {\r\n\t\tif (this.isUnsubscribed()) {\r\n\t\t\treturn this.saveReSubscribe(translate);\r\n\t\t}\r\n\t\treturn this.showUnsubscribeModal;\r\n\t};\r\n\r\n\tsaveReSubscribe = translate => async () => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\r\n\t\tawait this.props.customerDataStore.saveReSubscribe().then(() => {\r\n\t\t\tnotification.success({\r\n\t\t\t\tmessage: translate('hallelujah_welcome_back'),\r\n\t\t\t});\r\n\t\t});\r\n\t\tthis.resetUIState();\r\n\t};\r\n\r\n\tcloseModal = () => {\r\n\t\tthis.setState({ isUnsubscribeModalOpen: false });\r\n\t};\r\n\r\n\tshowUnsubscribeModal = () => {\r\n\t\tthis.setState({ isUnsubscribeModalOpen: true });\r\n\t};\r\n\r\n\tsaveUnsubscribe = translate => async () => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tconst { unsubscribeReason: reason } = this.state;\r\n\t\tthis.setState({ isLoading: true });\r\n\r\n\t\tawait this.props.customerDataStore.saveUnsubscribe(reason).then(() => {\r\n\t\t\tnotification.success({\r\n\t\t\t\tmessage: translate('preference_saved_thank_you'),\r\n\t\t\t});\r\n\t\t});\r\n\t\tthis.resetUIState();\r\n\t};\r\n\r\n\tresetUIState = () => {\r\n\t\tthis.setState({\r\n\t\t\tisLoading: false,\r\n\t\t\tdidUpdate: true,\r\n\t\t\tisUnsubscribeModalOpen: false,\r\n\t\t});\r\n\t};\r\n\r\n\tgetButtonLabel() {\r\n\t\tif (this.isUnsubscribed()) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\treturn ;\r\n\t}\r\n\r\n\tisUnsubscribed() {\r\n\t\tconst { customerDataStore } = this.props;\r\n\t\treturn customerDataStore.isUnsubscribedFromRecommendationEmails();\r\n\t}\r\n\r\n\tgetPlaceholder = translate => {\r\n\t\treturn translate('could_you_let_us_know_why');\r\n\t};\r\n}\r\n\r\nconst mapOrgToProps = orgStore => ({\r\n\torgName: orgStore.getOrgName(),\r\n});\r\n\r\nconst connectors = [\r\n\tconnectToCustomer,\r\n\tconnectToPreviewMode,\r\n\tComponent => connectToOrg(Component, mapOrgToProps),\r\n];\r\n\r\nexport default combineConnectors(connectors)(UnsubscribeService);\r\n","export const MessageFrequencyType = {\r\n\tXMessagesEveryYWeeks: 'XMessagesEveryYWeeks',\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport { UnsubscribeScope } from '../../../unsubscribe';\r\nimport { MessageFrequencyType } from '../../../messageFrequency';\r\n\r\nconst FrequencyContext = React.createContext();\r\n\r\nexport const connectToMessageFrequencyPreferences = Component => {\r\n\treturn props => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{messageFrequencyDataStore => {\r\n\t\t\t\t\tconst mfds = messageFrequencyDataStore;\r\n\t\t\t\t\treturn (\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\nclass MessageFrequencyDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\tmessageFrequencyPreferences: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(this.state)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tif (this.props.customerState.isPreviewMode) {\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t}\r\n\t\tthis.fetchFrequencyPreferences();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tthis.request && this.request.cancel && this.request.cancel();\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tsavePreference: value => this.saveFrequencyPreference(value),\r\n\t\tgetPreference: () => this.getEmailFrequencyPreferenceValue(),\r\n\t});\r\n\r\n\tfetchFrequencyPreferences = () => {\r\n\t\tconst { customerId } = this.props.customerState;\r\n\t\tconst endpoint = `/preferences/messages/frequency/${customerId}`;\r\n\r\n\t\tthis.request = api.cancelableGet(endpoint);\r\n\r\n\t\treturn this.request.promise.then(messageFrequencyPreferences => {\r\n\t\t\tconst isArr = Array.isArray(messageFrequencyPreferences);\r\n\r\n\t\t\tif (isArr && messageFrequencyPreferences.length > 0) {\r\n\t\t\t\treturn this.setState({\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\tmessageFrequencyPreferences,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\treturn this.setState({ isLoading: false });\r\n\t\t});\r\n\t};\r\n\r\n\t// I.E every two months\r\n\tgetEmailFrequencyPreferenceValue = () => {\r\n\t\tconst result = this.getRecommendationEmailFrequencyPreference();\r\n\t\tif (result.hasPreference) {\r\n\t\t\tconst value = this.parseValue(result.frequencyPreference.value);\r\n\t\t\treturn value ? value : null;\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tgetRecommendationEmailFrequencyPreference() {\r\n\t\tconst { messageFrequencyPreferences: prefs } = this.state;\r\n\r\n\t\tfor (let i = 0; i < prefs.length; i++) {\r\n\t\t\tconst current = prefs[i];\r\n\t\t\tif (current.scope === UnsubscribeScope.recommendations) {\r\n\t\t\t\treturn { hasPreference: true, frequencyPreference: current };\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { hasPreference: false };\r\n\t}\r\n\r\n\tparseValue(value) {\r\n\t\tif (typeof value !== 'string') return 0;\r\n\t\tconst tokens = value.split(',');\r\n\t\treturn parseInt(tokens[1]);\r\n\t}\r\n\r\n\t// Number -> setState with new state of the customerSummary\r\n\tsaveFrequencyPreference = frequencyValue => {\r\n\t\tconst endpoint = '/preferences/messages/frequency';\r\n\t\tconst body = this.makeMessageFrequencyPreferenceDTO(frequencyValue);\r\n\r\n\t\tconst result = this.getRecommendationEmailFrequencyPreference();\r\n\t\tconst httpMethod = result.hasPreference ? 'PUT' : 'POST';\r\n\r\n\t\treturn api\r\n\t\t\t.call(httpMethod, endpoint, body)\r\n\t\t\t.then(() => this.fetchFrequencyPreferences());\r\n\t};\r\n\r\n\tmakeMessageFrequencyPreferenceDTO = preferenceValue => ({\r\n\t\tcustomerId: this.props.customerState.customerId,\r\n\t\tscope: UnsubscribeScope.recommendations,\r\n\t\ttype: MessageFrequencyType.XMessagesEveryYWeeks,\r\n\t\tvalue: `${this.getNumberOfEmails()},${preferenceValue}`,\r\n\t});\r\n\r\n\tgetNumberOfEmails = () => 1;\r\n}\r\n\r\nexport default connectToCustomerID(MessageFrequencyDataStore);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button, InputNumber } from 'antd';\r\nimport UpdateConfirmation from '../UI/UpdateConfirmation';\r\nimport { connectToMessageFrequencyPreferences } from '../data/MessageFrequencyDataStore';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { notification } from 'antd';\r\n\r\nclass EmailFrequencyService extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tmessageFrequencyDataStore: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\tdidSaveNewFrequency: false,\r\n\t\tnumberOfEmailsPrefence: 0,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{this.renderNumberInput()}\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\tthis.saveNewPreference(translate)\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\t\r\n\t\t\t\t\t\t\t\t\t{this.state.didSaveNewFrequency && (\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\tcomponentDidMount() {\r\n\t\tthis.setInitialNumberOfEmailsFrequencyPreference();\r\n\t}\r\n\r\n\tgetRootClassNames() {\r\n\t\tconst baseName = 'reduce-frequency';\r\n\t\tif (this.props.isMobile()) {\r\n\t\t\treturn baseName;\r\n\t\t}\r\n\t\treturn `flex-align-center ${baseName}`;\r\n\t}\r\n\r\n\tgetButtonStyle() {\r\n\t\tif (this.props.isMobile()) {\r\n\t\t\treturn { marginTop: '0.5rem' };\r\n\t\t}\r\n\t\treturn { marginLeft: '1rem' };\r\n\t}\r\n\r\n\tsetInitialNumberOfEmailsFrequencyPreference() {\r\n\t\tconst { messageFrequencyDataStore } = this.props;\r\n\t\tconst preference = messageFrequencyDataStore.getPreference();\r\n\t\tthis.setState({ numberOfEmailsPrefence: preference });\r\n\t}\r\n\r\n\tsaveNewPreference = translate => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.props.previewMode.notify();\r\n\t\t}\r\n\r\n\t\tconst { numberOfEmailsPrefence: pref } = this.state;\r\n\t\tconst { messageFrequencyDataStore } = this.props;\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\r\n\t\tmessageFrequencyDataStore\r\n\t\t\t.savePreference(pref)\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.setState({ isLoading: false, didSaveNewFrequency: true });\r\n\t\t\t})\r\n\t\t\t.then(() => this.getNotification(translate));\r\n\t};\r\n\r\n\tgetNotification = translate => {\r\n\t\tnotification.success({\r\n\t\t\tmessage: translate('preference_saved_thank_you'),\r\n\t\t});\r\n\t};\r\n\r\n\trenderNumberInput() {\r\n\t\tconst { numberOfEmailsPrefence: count } = this.state;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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{count === 1 ? (\r\n\t\t\t\t\t\t\t\t\tthis.getSingularLabel(\r\n\t\t\t\t\t\t\t\t\t\ttranslate,\r\n\t\t\t\t\t\t\t\t\t).toLowerCase()\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\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\tgetSingularLabel = translate => {\r\n\t\treturn translate('week');\r\n\t};\r\n\r\n\tupdatePreferenceNumber = numberOfEmailsPrefence => {\r\n\t\tif (numberOfEmailsPrefence > 0) {\r\n\t\t\tthis.setState({ numberOfEmailsPrefence });\r\n\t\t}\r\n\t};\r\n}\r\n\r\nconst connectors = [connectToMessageFrequencyPreferences, connectToPreviewMode];\r\n\r\nexport default combineConnectors(connectors)(\r\n\twithIsMobile(EmailFrequencyService),\r\n);\r\n","import React from 'react';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function SeriesAutocompleteRow({ series }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
{series.name}
\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 PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport { urlPrefix } from '../../../api';\r\nimport SeriesAutocompleteRow from './SeriesAutocompleteRow';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport LoadableAutocomplete from 'treeline-react-core-components/LoadableAutocomplete';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass SeriesAutocomplete extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tplaceholder: PropTypes.string,\r\n\t\tonSelectOption: PropTypes.func,\r\n\t\trenderOption: PropTypes.func,\r\n\t\t// Mapped to props\r\n\t\torgId: PropTypes.string,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tonSelectOption: () => {},\r\n\t\tplaceholder: ,\r\n\t\trenderOption: s => ,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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\thandleOptionsResponse = series => {\r\n\t\treturn series.map((s, i) => ({\r\n\t\t\tid: i.toString(),\r\n\t\t\tname: s.series,\r\n\t\t\tskuCount: s.skuCount,\r\n\t\t}));\r\n\t};\r\n\r\n\tgetURLForOptions = userInput => {\r\n\t\tconst { orgId } = this.props;\r\n\t\tconst endpoint = `/org/${orgId}/search/series?q=${userInput}`;\r\n\t\treturn `${urlPrefix}${endpoint}`;\r\n\t};\r\n\r\n\tonSelectHook = autocompleteState => {\r\n\t\tconst { selectedId: id } = autocompleteState;\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\tconst selected = autocompleteState.selectedOption;\r\n\r\n\t\tthis.props.onSelectOption(id, selected).then(() => {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t});\r\n\t};\r\n\r\n\tgetFeedback = translate => {\r\n\t\treturn translate('too_short');\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(SeriesAutocomplete, customerState => ({\r\n\torgId: customerState.orgId,\r\n}));\r\n","export const FavoriteType = {\r\n\tauthor: 'author',\r\n\tseries: 'series',\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport DetailDrawerAnchor from '../../UI/DetailDrawerAnchor';\r\nimport api from '../../../api';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\nimport TitleAggregateParser from '../../../title/TitleAggregateParser';\r\nimport AllAvailableTitles from '../../TitleLanes/AllAvailableTitles';\r\nimport { Translate } from 'react-localize-redux';\r\nimport StaffPicksDataStore from '../../StaffPicks/data/StaffPicksDataStore';\r\nimport { FavoriteType } from '../FavoriteType';\r\n\r\nFavoriteTitles.propTypes = {\r\n\tentity: PropTypes.object,\r\n};\r\n\r\nFavoriteTitlesDrawer.propTypes = {\r\n\tchildren: PropTypes.func,\r\n\tentity: PropTypes.object,\r\n\ttypeOfFavorite: PropTypes.string,\r\n};\r\n\r\nexport default function FavoriteTitlesDrawer({\r\n\tchildren,\r\n\tentity,\r\n\ttypeOfFavorite,\r\n}) {\r\n\treturn (\r\n\t\t (\r\n\t\t\t\t\r\n\t\t\t)}>\r\n\t\t\t{children}\r\n\t\t\r\n\t);\r\n}\r\n\r\nfunction FavoriteTitles({ entity, typeOfFavorite }) {\r\n\tconst isFavoriteAuthor = typeOfFavorite === FavoriteType.author;\r\n\tconst { orgId } = useCustomerID();\r\n\tconst endpoint = isFavoriteAuthor\r\n\t\t? `/org/${orgId}/contributor/${entity.id}/titles`\r\n\t\t: `/org/${orgId}/search/series/titles?seriesName=${entity.name}`;\r\n\r\n\tconst fetchFavoriteTitles = () => {\r\n\t\treturn api.get(endpoint).then(titleAggregate => {\r\n\t\t\tconst parser = new TitleAggregateParser(titleAggregate);\r\n\t\t\treturn { titles: parser.buildTitles() };\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\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\tfetchAllAvailableTitles={fetchFavoriteTitles}\r\n\t\t\t/>\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Card } from 'antd';\r\nimport Customer360PropTypes from '../../../types';\r\nimport Scroller from '../../UI/Scroller/Scroller';\r\nimport FavoriteTitlesDrawer from '../../CustomerFavorites/UI/FavoriteTitlesDrawer';\r\nimport { FavoriteType } from '../../CustomerFavorites/FavoriteType';\r\nimport './seriesScroller.css';\r\n\r\nSeriesScrollerItem.propTypes = {\r\n\tchildren: PropTypes.element,\r\n\tseries: Customer360PropTypes.Series,\r\n};\r\n\r\nfunction SeriesScrollerItem({ series, children }) {\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{drawer => (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{series.name}\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{children}\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 class SeriesScroller extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.element]),\r\n\t};\r\n\r\n\tstatic SeriesItem = SeriesScrollerItem;\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{this.props.children}\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 PropTypes from 'prop-types';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport { connectToFavorites } from './data/CustomerFavoritesDataStore';\r\nimport Customer360PropTypes from '../../types';\r\n\r\nclass RemoveFavoriteController extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.func.isRequired,\r\n\t\tentity: Customer360PropTypes.RecommendableEntity.isRequired,\r\n\t\t// Mapped to props\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tcustomerFavoritesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst s = this.state;\r\n\t\treturn this.props.children({\r\n\t\t\tisLoading: s.isLoading,\r\n\t\t\thandleRemove: () => this.handleRemove(),\r\n\t\t});\r\n\t}\r\n\r\n\thandleRemove = () => {\r\n\t\tconst { previewMode, customerFavoritesDataStore, entity } = this.props;\r\n\r\n\t\tif (previewMode.isActive()) {\r\n\t\t\treturn previewMode.notify();\r\n\t\t}\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\tcustomerFavoritesDataStore.remove(entity);\r\n\t};\r\n}\r\n\r\nconst connect = combineConnectors([connectToFavorites, connectToPreviewMode]);\r\n\r\nexport default connect(RemoveFavoriteController);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport SeriesAutocomplete from '../../Series/UI/SeriesAutocomplete';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport SeriesScroller from '../../Series/UI/SeriesScroller';\r\nimport RemoveFavoriteController from '../RemoveFavoriteController';\r\nimport { Button, Spin, notification } from 'antd';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport delay from '../../../util/delay';\r\nimport { connectToFavorites } from '../data/CustomerFavoritesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass SeriesFavoritesLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tcustomerFavoritesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst mobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tsubHeader={\r\n\t\t\t\t\t!mobile ? (\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\textra={\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{({ translate }) => {\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\r\n\t\t\t\t\t\t\t\t\t\t\tthis.onSelectSeries(\r\n\t\t\t\t\t\t\t\t\t\t\t\tidx,\r\n\t\t\t\t\t\t\t\t\t\t\t\tseries,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\tplaceholder={this.getPlaceholder(\r\n\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\t{this.handleRenderFavorites()}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\thandleRenderFavorites = () => {\r\n\t\tconst isLoading = this.props.customerFavoritesDataStore.isLoading();\r\n\t\treturn isLoading\r\n\t\t\t? this.renderLoadingFavorites()\r\n\t\t\t: this.renderSeriesFavorites();\r\n\t};\r\n\r\n\trenderLoadingFavorites() {\r\n\t\treturn (\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\tonSelectSeries = (idx, series, translate) => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.makeEmptyPromise();\r\n\t\t}\r\n\t\tconst entity = this.getSeriesAsEntity(series);\r\n\t\tconst name = entity.name;\r\n\r\n\t\treturn this.props.customerFavoritesDataStore.save(entity).then(() =>\r\n\t\t\tnotification.success({\r\n\t\t\t\tmessage: translate('saved_x_to_your_favorites', {\r\n\t\t\t\t\tname: name,\r\n\t\t\t\t}),\r\n\t\t\t}),\r\n\t\t);\r\n\t};\r\n\r\n\tgetSeriesAsEntity = series => {\r\n\t\tconst entityType = RecommendableEntity.series;\r\n\t\treturn new RecommendableEntity(series.name, entityType, series.name);\r\n\t};\r\n\r\n\trenderSeriesFavorites = () => {\r\n\t\tconst { customerFavoritesDataStore } = this.props;\r\n\t\tconst series = customerFavoritesDataStore.getFavoriteSeries();\r\n\t\treturn series.length ? (\r\n\t\t\t\r\n\t\t\t\t{series.map(this.renderOneSeries)}\r\n\t\t\t\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);\r\n\t};\r\n\r\n\trenderOneSeries = series => {\r\n\t\tconst entity = this.getSeriesAsEntity(series);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ isLoading, handleRemove }) => {\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\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\tmakeEmptyPromise = () => {\r\n\t\treturn delay(300).then(() => this.props.previewMode.notify());\r\n\t};\r\n\r\n\tgetPlaceholder = translate => {\r\n\t\treturn translate('search_for_series');\r\n\t};\r\n}\r\n\r\nconst connectors = [connectToFavorites, connectToPreviewMode, withIsMobile];\r\n\r\nexport default combineConnectors(connectors)(SeriesFavoritesLane);\r\n","const SectionLevel = {\r\n\tsection: 'section',\r\n\tdepartment: 'department',\r\n};\r\n\r\nexport default SectionLevel;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport LoadableAutocomplete from 'treeline-react-core-components/LoadableAutocomplete';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport { urlPrefix } from '../../../api';\r\nimport SectionLevel from '../../../entity/SectionLevel';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass SectionAutocompleteRow extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tsection: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { section } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{this.getSectionLevel(section.key)}\r\n\t\t\t\t
\r\n\t\t\t\t
{section.name}
\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tgetSectionLevel(key) {\r\n\t\tconst sectionLevel = key.split('.')[0];\r\n\t\tif (sectionLevel === 'section') {\r\n\t\t\treturn 'Section';\r\n\t\t} else {\r\n\t\t\treturn 'Department';\r\n\t\t}\r\n\t}\r\n}\r\n\r\nclass SectionAutocomplete extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tplaceholder: PropTypes.string,\r\n\t\tonSelectOption: PropTypes.func,\r\n\t\trenderOption: PropTypes.func,\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tplaceholder: ,\r\n\t\tonSelectOption: () => {},\r\n\t\trenderOption: section => ,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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\tgetURLForOptions = userInput => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\tconst endpoint = `/org/${orgId}/search/sections?q=${userInput}`;\r\n\t\treturn `${urlPrefix}${endpoint}`;\r\n\t};\r\n\r\n\tonSelectHook = autocompleteState => {\r\n\t\tconst { selectedId: sectionKey } = autocompleteState;\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\tconst section = this.buildSection(autocompleteState.selectedOption);\r\n\r\n\t\tthis.props.onSelectOption(section, sectionKey).then(() => {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t});\r\n\t};\r\n\r\n\tbuildSection(selectedSection = {}) {\r\n\t\tconst { key, name } = selectedSection;\r\n\r\n\t\tconst sectionId = this.getEntityIdFromSectionKey(key);\r\n\t\tconst sectionLevel = this.getSectionLevelFromSectionKey(key);\r\n\r\n\t\treturn { sectionId, sectionLevel, name };\r\n\t}\r\n\r\n\tgetEntityIdFromSectionKey(sectionKey) {\r\n\t\tif (typeof sectionKey === 'number' || !sectionKey) {\r\n\t\t\treturn sectionKey;\r\n\t\t}\r\n\t\tif (sectionKey.indexOf('section.') > -1) {\r\n\t\t\treturn parseInt(sectionKey.replace('section.', '').trim());\r\n\t\t}\r\n\t\tif (sectionKey.indexOf('department.') > -1) {\r\n\t\t\treturn parseInt(sectionKey.replace('department.', '').trim());\r\n\t\t}\r\n\t\treturn parseInt(sectionKey);\r\n\t}\r\n\r\n\tgetSectionLevelFromSectionKey(sectionKey) {\r\n\t\tif (typeof sectionKey === 'number' || !sectionKey) {\r\n\t\t\treturn SectionLevel.section;\r\n\t\t}\r\n\t\tif (sectionKey.indexOf('section.') > -1) {\r\n\t\t\treturn SectionLevel.section;\r\n\t\t}\r\n\t\tif (sectionKey.indexOf('department.') > -1) {\r\n\t\t\treturn SectionLevel.department;\r\n\t\t}\r\n\t\treturn SectionLevel.section;\r\n\t}\r\n\r\n\tgetFeedback = translate => {\r\n\t\treturn translate('too_short');\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(SectionAutocomplete);\r\n","import React from 'react';\r\nimport Customer360PropTypes from '../../../types';\r\nimport { Button, Tooltip } from 'antd';\r\nimport RemoveFavoriteController from '../RemoveFavoriteController';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default class RemoveGenreFavoriteButton extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentity: Customer360PropTypes.RecommendableEntity,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ isLoading, handleRemove }) => {\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\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 from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport Scroller from '../../UI/Scroller/Scroller';\r\nimport { Link } from 'react-router-dom';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport SectionLevel from '../../../entity/SectionLevel';\r\nimport './sectionsScroller.css';\r\n\r\nclass SectionsScrollerItem extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tdoLinkToSectionRoute: PropTypes.bool,\r\n\t\tentity: Customer360PropTypes.RecommendableEntity,\r\n\t\tgenreCount: PropTypes.number,\r\n\t\tonClickOnName: PropTypes.func, // optional\r\n\t\tcount: PropTypes.number, // optional\r\n\t\tchildren: PropTypes.element, // optional\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tdoLinkToSectionRoute: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t 1 ? 'over-one-genre' : ''\r\n\t\t\t\t}`}>\r\n\t\t\t\t
\r\n\t\t\t\t\t{typeof this.props.count === 'number' && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{this.props.count}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{this.props.doLinkToSectionRoute\r\n\t\t\t\t\t\t? this.renderNameWithLinkToSectionOrDepartment()\r\n\t\t\t\t\t\t: this.renderNameWithOnClick()}\r\n\r\n\t\t\t\t\t{this.props.children}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderNameWithLinkToSectionOrDepartment() {\r\n\t\tconst { entity } = this.props;\r\n\t\tconst isSection = entity.type === RecommendableEntity.section;\r\n\r\n\t\tconst sectionLvl = isSection\r\n\t\t\t? SectionLevel.section\r\n\t\t\t: SectionLevel.department;\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.entity.name}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderNameWithOnClick() {\r\n\t\tconst hasOnClick = typeof this.props.onClickOnName === 'function';\r\n\t\tconst baseClassNames = 'dotDot section-item-name bold';\r\n\t\treturn (\r\n\t\t\t {}}\r\n\t\t\t\tclassName={\r\n\t\t\t\t\thasOnClick ? `${baseClassNames} clickable` : baseClassNames\r\n\t\t\t\t}>\r\n\t\t\t\t{this.props.entity.name}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default class SectionsScroller extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.element]),\r\n\t};\r\n\r\n\tstatic SectionAnchor = SectionsScrollerItem;\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t 4\r\n\t\t\t\t\t\t\t? 'columns-over-four'\r\n\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t}`}\r\n\t\t\t\t\tstyle={{ marginBottom: '1rem' }}>\r\n\t\t\t\t\t{this.props.children}\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 PropTypes from 'prop-types';\r\nimport SectionAutocomplete from '../../Section/UI/SectionAutocomplete';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport RemoveGenreFavoriteButton from '../UI/RemoveGenreFavoriteButton';\r\nimport SectionsScroller from '../../Section/UI/SectionsScroller';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\nimport { useSectionsDataStore } from '../../data/SectionsDataStore';\r\nimport { Spin, notification } from 'antd';\r\nimport delay from '../../../util/delay';\r\nimport { useFavoritesDataStore } from '../data/CustomerFavoritesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport SectionLevel from '../../../entity/SectionLevel';\r\n\r\nShelfFavoritesLane.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction ShelfFavoritesLane({ isMobile }) {\r\n\tconst { isLoading, save, getFavoriteGenres } = useFavoritesDataStore();\r\n\tconst { isPreviewMode, notifyUserOfPreviewMode } = useCustomerID();\r\n\tconst { getSection, getDepartment } = useSectionsDataStore();\r\n\r\n\tconst handleRenderFavorites = () => {\r\n\t\treturn isLoading() ? renderLoadingFavorites() : renderGenreFavorites();\r\n\t};\r\n\r\n\tconst renderLoadingFavorites = () => {\r\n\t\treturn (\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\tconst notifyUserOfPreviewModeAfterDelay = () => {\r\n\t\treturn delay(300).then(() => notifyUserOfPreviewMode());\r\n\t};\r\n\r\n\tconst getSearchBoxPlaceholder = translate => {\r\n\t\treturn translate('search_for_shelves');\r\n\t};\r\n\r\n\tconst onSelectSection = (section, translate) => {\r\n\t\tif (isPreviewMode) {\r\n\t\t\treturn notifyUserOfPreviewModeAfterDelay();\r\n\t\t}\r\n\r\n\t\tconst { sectionId: id, sectionLevel: entityType } = section;\r\n\t\tconst entity = new RecommendableEntity(id, entityType, section.name);\r\n\t\tconst name = entity.name;\r\n\t\treturn save(entity).then(() =>\r\n\t\t\tnotification.success({\r\n\t\t\t\tmessage: translate('saved_x_to_your_favorites', {\r\n\t\t\t\t\tname: name,\r\n\t\t\t\t}),\r\n\t\t\t}),\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderGenreFavorites = () => {\r\n\t\tconst genres = getFavoriteGenres();\r\n\t\treturn genres.length ? (\r\n\t\t\t\r\n\t\t\t\t{genres.map(renderOneFavoriteGenre)}\r\n\t\t\t\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);\r\n\t};\r\n\r\n\tconst renderOneFavoriteGenre = genreEntity => {\r\n\t\tconst { entityId: id, entityType, entityName } = genreEntity;\r\n\t\tconst entity = new RecommendableEntity(id, entityType, entityName);\r\n\t\tconst isValidSectionOrDepartment =\r\n\t\t\t(entityType.toLowerCase() === SectionLevel.section\r\n\t\t\t\t? getSection(id)\r\n\t\t\t\t: getDepartment(id)) !== undefined;\r\n\r\n\t\treturn (\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\tsubHeader={\r\n\t\t\t\t!isMobile() ? (\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)\r\n\t\t\t}\r\n\t\t\textra={\r\n\t\t\t\t\r\n\t\t\t\t\t{({ translate }) => {\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\tonSelectSection(section, translate)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tplaceholder={getSearchBoxPlaceholder(\r\n\t\t\t\t\t\t\t\t\t\ttranslate,\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{handleRenderFavorites()}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(ShelfFavoritesLane);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport LoadableAutocomplete from 'treeline-react-core-components/LoadableAutocomplete';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport { urlPrefix } from '../../../api';\r\nimport { FullDateFormatNoDayOfWeek } from '../../../dateFormats';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass TitleAutocompleteRow extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitle: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { title } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{title.title}\r\n\t\t\t\t
\r\n\t\t\t\t
{title.author}
\r\n\t\t\t\t
\r\n\t\t\t\t\t:{' '}\r\n\t\t\t\t\t{new Date(title.pubDate).toLocaleDateString(\r\n\t\t\t\t\t\tFullDateFormatNoDayOfWeek,\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\nclass TitleAutocomplete extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tplaceholder: PropTypes.string,\r\n\t\tonSelectOption: PropTypes.func,\r\n\t\trenderOption: PropTypes.func,\r\n\t\tisClearable: PropTypes.bool,\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tonSelectOption: () => {},\r\n\t\tplaceholder: ,\r\n\t\tisClearable: true,\r\n\t\trenderTitleOption: title => {\r\n\t\t\treturn ;\r\n\t\t},\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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\thandleOptionsResponse = aggregateDTO => {\r\n\t\tif (aggregateDTO && aggregateDTO.retailTitles) {\r\n\t\t\treturn aggregateDTO.retailTitles;\r\n\t\t}\r\n\t\treturn [];\r\n\t};\r\n\r\n\tgetURLForOptions = userInput => {\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\tconst endpoint = `/org/${orgId}/search/titles?q=${userInput}`;\r\n\t\treturn `${urlPrefix}${endpoint}`;\r\n\t};\r\n\r\n\tonSelectHook = autocompleteState => {\r\n\t\tconst { selectedId: sku } = autocompleteState;\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\t\tconst selected = autocompleteState.selectedOption;\r\n\r\n\t\tthis.props.onSelectOption(sku, this.buildTitle(selected)).then(() => {\r\n\t\t\tthis.setState({ isLoading: false });\r\n\t\t});\r\n\t};\r\n\r\n\tbuildTitle(selectedTitleOption) {\r\n\t\tif (!selectedTitleOption) return {};\r\n\t\tconst { sku, title, author } = selectedTitleOption;\r\n\t\treturn { sku, author, name: title };\r\n\t}\r\n\r\n\tgetFeedback = translate => {\r\n\t\treturn translate('too_short');\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(TitleAutocomplete);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleAutocomplete from '../../Title/UI/TitleAutocomplete';\r\nimport LaneContainer, { SeeAllAnchor } from '../../UI/LaneContainer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport TitleScroller from '../../TitleLanes/TitleScroller';\r\nimport { Spin, notification } from 'antd';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport delay from '../../../util/delay';\r\nimport { connectToFavorites } from '../data/CustomerFavoritesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport AllAvailableTitles from '../../TitleLanes/AllAvailableTitles';\r\nimport StaffPicksDataStore from '../../StaffPicks/data/StaffPicksDataStore';\r\nimport TitleJacketImageWithIconBadges from '../../UI/TitleJacketImageWithIconBadges';\r\n\r\nclass TitleFavoritesLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tcustomerFavoritesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisRefreshingTitles: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst mobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tsubHeader={\r\n\t\t\t\t\t!mobile ? (\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\textra={\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{({ translate }) => {\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\r\n\t\t\t\t\t\t\t\t\t\t\tthis.onSelectTitle(\r\n\t\t\t\t\t\t\t\t\t\t\t\tsku,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttitle,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\tplaceholder={this.getPlaceholder(\r\n\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\t{this.handleRenderFavorites()}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\thandleRenderFavorites = () => {\r\n\t\tconst isLoading = this.props.customerFavoritesDataStore.isLoading();\r\n\t\treturn isLoading\r\n\t\t\t? this.renderLoadingFavorites()\r\n\t\t\t: this.renderTitleFavorites();\r\n\t};\r\n\r\n\trenderLoadingFavorites() {\r\n\t\treturn (\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\tonSelectTitle = (sku, title, translate) => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.makeEmptyPromise();\r\n\t\t}\r\n\r\n\t\tconst entityType = RecommendableEntity.title;\r\n\t\tconst entity = new RecommendableEntity(sku, entityType, title.name);\r\n\t\tconst name = entity.name;\r\n\r\n\t\tthis.setState({ isRefreshingTitles: true });\r\n\r\n\t\treturn this.props.customerFavoritesDataStore\r\n\t\t\t.save(entity)\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.setState({ isRefreshingTitles: false });\r\n\t\t\t})\r\n\t\t\t.then(() =>\r\n\t\t\t\tnotification.success({\r\n\t\t\t\t\tmessage: translate('saved_x_to_your_favorites', {\r\n\t\t\t\t\t\tname: name,\r\n\t\t\t\t\t}),\r\n\t\t\t\t}),\r\n\t\t\t);\r\n\t};\r\n\r\n\trenderTitleFavorites = () => {\r\n\t\tconst titles = this.props.customerFavoritesDataStore.getFavoriteTitles();\r\n\t\treturn titles.length ? (\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\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{this.renderSeeAllTitles(titles)}\r\n\t\t\t\t
\r\n\t\t\t
\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);\r\n\t};\r\n\r\n\tmakeEmptyPromise = () => {\r\n\t\treturn delay(300).then(() => this.props.previewMode.notify());\r\n\t};\r\n\r\n\tgetPlaceholder = translate => {\r\n\t\treturn translate('search_for_books');\r\n\t};\r\n\r\n\trenderSeeAllTitles = titles => {\r\n\t\treturn (\r\n\t\t\t
\r\n\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\ttitles={titles}\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\nconst connectors = [connectToFavorites, connectToPreviewMode, withIsMobile];\r\n\r\nexport default combineConnectors(connectors)(TitleFavoritesLane);\r\n","import React from 'react';\r\nimport Customer360PropTypes from '../../../types';\r\n\r\nconst propTypes = {\r\n\tauthor: Customer360PropTypes.Author,\r\n};\r\n\r\nexport default function AuthorAutocompleteRow({ author }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t{author.name}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nAuthorAutocompleteRow.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport AuthorAutocompleteRow from './AuthorAutocompleteRow';\r\nimport { Spin } from 'antd';\r\nimport LoadableAutocomplete from 'treeline-react-core-components/LoadableAutocomplete';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\nimport { urlPrefix } from '../../../api';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst propTypes = {\r\n\tonSelectOption: PropTypes.func,\r\n\tplaceholder: PropTypes.string,\r\n\trenderAuthorOption: PropTypes.func,\r\n};\r\n\r\nconst defaultProps = {\r\n\tonSelectOption: () => {},\r\n\tplaceholder: ,\r\n\trenderAuthorOption: author => {\r\n\t\treturn ;\r\n\t},\r\n};\r\n\r\nexport default function AuthorsAutocomplete(props) {\r\n\tconst { placeholder, onSelectOption, renderAuthorOption } = props;\r\n\r\n\tconst { orgId } = useCustomerID();\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\r\n\tconst getURLForOptions = userInput => {\r\n\t\tconst endpoint = `/org/${orgId}/search/authors?q=${userInput}`;\r\n\t\treturn `${urlPrefix}${endpoint}`;\r\n\t};\r\n\r\n\tconst onSelectHook = async autocompleteState => {\r\n\t\tconst { selectedId: id, selectedOption } = autocompleteState;\r\n\t\tsetIsLoading(true);\r\n\t\tawait onSelectOption(id, selectedOption);\r\n\t\tsetIsLoading(false);\r\n\t};\r\n\r\n\tconst getFeedback = translate => {\r\n\t\treturn translate('too_short');\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ translate }) => {\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\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\nAuthorsAutocomplete.propTypes = propTypes;\r\nAuthorsAutocomplete.defaultProps = defaultProps;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport { Card, Button } from 'antd';\r\nimport UserAvatar from 'treeline-react-core-components/UserAvatar';\r\nimport { Translate } from 'react-localize-redux';\r\nimport FavoriteTitlesDrawer from '../../CustomerFavorites/UI/FavoriteTitlesDrawer';\r\nimport { FavoriteType } from '../../CustomerFavorites/FavoriteType';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport TitleAggregateParser from '../../../title/TitleAggregateParser';\r\nimport api from '../../../api';\r\n\r\nclass AuthorCard extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.element,\r\n\t\tauthor: Customer360PropTypes.Author,\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tauthorTitles: [],\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchAuthorTitles().then(authorTitles =>\r\n\t\t\tthis.setState({\r\n\t\t\t\tauthorTitles,\r\n\t\t\t}),\r\n\t\t);\r\n\t}\r\n\r\n\tfetchAuthorTitles = () => {\r\n\t\tconst { author, customerState: orgId } = this.props;\r\n\t\tthis.request = api.cancelableGet(\r\n\t\t\t`/org/${orgId}/contributor/${author.id}/titles`,\r\n\t\t);\r\n\t\treturn this.request.promise.then(titleAggregate =>\r\n\t\t\tthis.parseTitlesByAuthor(titleAggregate),\r\n\t\t);\r\n\t};\r\n\r\n\tparseTitlesByAuthor = titleAggregate => {\r\n\t\tconst parser = new TitleAggregateParser(titleAggregate);\r\n\t\treturn parser.buildTitles();\r\n\t};\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.request);\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { author, children } = this.props;\r\n\t\tconst { authorTitles } = this.state;\r\n\t\tauthor.titles = authorTitles;\r\n\t\treturn (\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{Array.isArray(authorTitles) && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{children}\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 connectToCustomerID(AuthorCard);\r\n\r\nfunction AuthorContent({ author, children }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t{drawer => (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{author.displayName}\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
\r\n\t\t\t\t{children && (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{children}\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\nfunction ViewAuthorTitlesButton({ author }) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{drawer => (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n\r\nfunction WorksCount({ authorTitles }) {\r\n\tconst titleCount = authorTitles.length;\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t{titleCount.length === 1 ? (\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)}\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport Scroller from '../../UI/Scroller/Scroller';\r\nimport AuthorCard from './AuthorCard';\r\nimport './authorsScroller.css';\r\n\r\nAuthorScrollerItem.propTypes = {\r\n\tchildren: PropTypes.element,\r\n\tauthor: Customer360PropTypes.Author,\r\n};\r\n\r\nfunction AuthorScrollerItem({ author, children }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t{children}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default class AuthorsScroller extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.element]),\r\n\t};\r\n\r\n\tstatic AuthorItem = AuthorScrollerItem;\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{this.props.children}\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 PropTypes from 'prop-types';\r\nimport AuthorsAutocomplete from '../../Authors/UI/AuthorsAutocomplete';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport AuthorsScroller from '../../Authors/UI/AuthorsScroller';\r\nimport { Spin, Button, notification } from 'antd';\r\nimport delay from '../../../util/delay';\r\nimport RemoveFavoriteController from '../RemoveFavoriteController';\r\nimport { connectToPreviewMode } from '../../data/CustomerIDStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { connectToFavorites } from '../data/CustomerFavoritesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass AuthorFavoritesLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tcustomerFavoritesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst mobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tsubHeader={\r\n\t\t\t\t\t!mobile ? (\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\textra={\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{({ translate }) => {\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\r\n\t\t\t\t\t\t\t\t\t\t\tthis.onSelectAuthor(\r\n\t\t\t\t\t\t\t\t\t\t\t\tid,\r\n\t\t\t\t\t\t\t\t\t\t\t\tauthor,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\tplaceholder={this.getPlaceholder(\r\n\t\t\t\t\t\t\t\t\t\t\ttranslate,\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\t{this.handleRenderFavorites()}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\thandleRenderFavorites = () => {\r\n\t\tconst isLoading = this.props.customerFavoritesDataStore.isLoading();\r\n\t\treturn isLoading\r\n\t\t\t? this.renderLoadingFavorites()\r\n\t\t\t: this.renderAuthorFavorites();\r\n\t};\r\n\r\n\trenderLoadingFavorites() {\r\n\t\treturn (\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\tgetPlaceholder = translate => {\r\n\t\treturn translate('search_for_authors');\r\n\t};\r\n\r\n\tonSelectAuthor = (id, author, translate) => {\r\n\t\tif (this.props.previewMode.isActive()) {\r\n\t\t\treturn this.makeEmptyPromise();\r\n\t\t}\r\n\t\tconst entity = this.getAuthorAsEntity(id, author);\r\n\t\tconst name = entity.name;\r\n\t\treturn this.props.customerFavoritesDataStore.save(entity).then(() =>\r\n\t\t\tnotification.success({\r\n\t\t\t\tmessage: translate('saved_x_to_your_favorites', {\r\n\t\t\t\t\tname: name,\r\n\t\t\t\t}),\r\n\t\t\t}),\r\n\t\t);\r\n\t};\r\n\r\n\tgetAuthorAsEntity = (id, author) => {\r\n\t\tconst entityType = RecommendableEntity.author;\r\n\t\treturn new RecommendableEntity(id, entityType, author.name);\r\n\t};\r\n\r\n\trenderAuthorFavorites = () => {\r\n\t\tconst { customerFavoritesDataStore } = this.props;\r\n\t\tconst authors = customerFavoritesDataStore.getFavoriteAuthors();\r\n\t\treturn authors.length ? (\r\n\t\t\t\r\n\t\t\t\t{authors.map(this.renderOneAuthorInScroller)}\r\n\t\t\t\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);\r\n\t};\r\n\r\n\trenderOneAuthorInScroller = author => {\r\n\t\tconst entity = this.getAuthorAsEntity(author.id, author);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ isLoading, handleRemove }) => {\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\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\tmakeEmptyPromise = () => {\r\n\t\treturn delay(300).then(() => this.props.previewMode.notify());\r\n\t};\r\n}\r\n\r\nconst connectors = [connectToFavorites, connectToPreviewMode, withIsMobile];\r\nexport default combineConnectors(connectors)(AuthorFavoritesLane);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport CustomerFavoritesDataStore from './data/CustomerFavoritesDataStore';\r\nimport SeriesFavoritesLane from './SeriesFavorites/SeriesFavoritesLane';\r\nimport ShelfFavoritesLane from './ShelfFavorites/ShelfFavoritesLane';\r\nimport TitleFavoritesLane from './TitleFavorites/TitleFavoritesLane';\r\nimport AuthorFavoritesLane from './AuthorFavorites/AuthorFavoritesLane';\r\nimport { ScrollerConfigProvider } from '../UI/Scroller/ScrollerConfigContext';\r\nimport ScrollerType from '../UI/Scroller/ScrollerType.js';\r\nimport './customerFavorites.less';\r\n\r\nclass CustomerFavoritesService extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tdoShowSeriesLane: PropTypes.bool,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tdoShowSeriesLane: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst scrollerConfig = {\r\n\t\t\tmobile: { scrollerType: ScrollerType.carousel },\r\n\t\t\tdesktop: { scrollerType: ScrollerType.simpleBar },\r\n\t\t};\r\n\r\n\t\treturn (\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\r\n\t\t\t\t\t{this.props.doShowSeriesLane && }\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 CustomerFavoritesService;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport UnsubscribeService from './Services/UnsubscribeService';\r\nimport LaneContainer from '../UI/LaneContainer';\r\nimport EmailFrequencyService from './Services/EmailFrequencyService';\r\nimport CustomerFavoritesService from '../CustomerFavorites/CustomerFavoritesService';\r\nimport { connectToCustomer } from '../data/CustomerSummaryDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass UnsubscribePage extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isUnsubscribed = this.props.customerDataStore.isUnsubscribedFromRecommendationEmails();\r\n\r\n\t\treturn (\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
\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{!isUnsubscribed && this.renderSubscriptionModifiers()}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderSubscriptionModifiers() {\r\n\t\treturn (\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\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\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n}\r\n\r\nfunction PageDivider({ children }) {\r\n\treturn
{children}
;\r\n}\r\n\r\nexport default connectToCustomer(UnsubscribePage);\r\n","import React from 'react';\r\nimport UnsubscribePage from './UnsubscribePage';\r\nimport MessageFrequencyDataStore from './data/MessageFrequencyDataStore';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport './unsubscribe.css';\r\n\r\nexport default class UnsubscribePageRoot extends React.Component {\r\n\trender() {\r\n\t\treturn (\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{this.renderPageContent}\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\trenderPageContent = ({ isLoading }) => {\r\n\t\tif (isLoading) {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn ;\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport { connectToSections } from '../data/SectionsDataStore';\r\nimport TitleLanesDataStore from '../data/TitleLanesDataStore';\r\nimport TitleLanes from '../TitleLanes';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport RetailTitleLaneType from '../../entity/RetailTitleLaneType';\r\nimport { connectToFavorites } from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport SectionLevel from '../../entity/SectionLevel';\r\nimport { Link } from 'react-router-dom';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\n/**\r\n * Title lanes 'highlighting' the Sections in which the customer\r\n * has 'recently' purchased titles.\r\n */\r\n\r\nclass RecentShelvesTitleLanes extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tmaxLanes: PropTypes.number,\r\n\t\t// Mapped to props\r\n\t\t// From SectionsDataStore\r\n\t\tisLoading: PropTypes.bool,\r\n\t\tsections: PropTypes.arrayOf(PropTypes.object),\r\n\t\tdepartments: PropTypes.arrayOf(PropTypes.object),\r\n\t\trecentSectionIds: PropTypes.arrayOf(PropTypes.string),\r\n\t\tgetOneSection: PropTypes.func,\r\n\t\t// From CustomerFavoritesDataStore\r\n\t\tisLoadingFavorites: PropTypes.bool,\r\n\t\tidsOfFavoriteSections: PropTypes.arrayOf(PropTypes.string),\r\n\t\t// From CustomerIDDataStore\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tmaxLanes: 5,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { isLoading, isLoadingFavorites } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{isLoading || isLoadingFavorites\r\n\t\t\t\t\t? this.renderLoading()\r\n\t\t\t\t\t: this.renderRecentSectionHighlightLanes()}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderLoading() {\r\n\t\treturn (\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\trenderRecentSectionHighlightLanes() {\r\n\t\tconst sectionIds = this.getRecentSectionIdsToDisplay();\r\n\t\tconst laneConfigs = this.getRecentSectionLaneConfigs(sectionIds);\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{sectionIds[0] && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{titleLanesDataStore => {\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\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\tgetRecentSectionIdsToDisplay() {\r\n\t\tconst { recentSectionIds, maxLanes } = this.props;\r\n\t\tconst topFavSectionIds = this.getTopFavoriteSectionIds();\r\n\r\n\t\tconst sectionIdsToShow = [...topFavSectionIds, ...recentSectionIds];\r\n\r\n\t\tif (typeof maxLanes !== 'number') {\r\n\t\t\treturn sectionIdsToShow;\r\n\t\t}\r\n\r\n\t\t// Else trim off the array up to and not including the idx identified by `this.props.maxLanes`\r\n\t\treturn sectionIdsToShow.slice(0, maxLanes);\r\n\t}\r\n\r\n\tgetTopFavoriteSectionIds() {\r\n\t\tconst { recentSectionIds } = this.props;\r\n\t\tconst { idsOfFavoriteSections, getOneSection } = this.props;\r\n\r\n\t\tconst validSectionIds = idsOfFavoriteSections.filter(sectionId => {\r\n\t\t\tconst isInRecentIds = recentSectionIds.includes(sectionId);\r\n\t\t\tconst hasSection = typeof getOneSection(sectionId) !== 'undefined';\r\n\t\t\treturn !isInRecentIds && hasSection;\r\n\t\t});\r\n\r\n\t\treturn validSectionIds.sort((a, b) => {\r\n\t\t\treturn (\r\n\t\t\t\tgetOneSection(b).transactions - getOneSection(a).transactions\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n\r\n\tgetRecentSectionLaneConfigs = (recentSectionIds = []) => {\r\n\t\treturn recentSectionIds.map(sectionId => {\r\n\t\t\tconst section = this.props.getOneSection(sectionId);\r\n\t\t\tconst laneKey = this.getLaneNameKeyFromSectionId(sectionId);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tkey: laneKey,\r\n\t\t\t\ticon: '',\r\n\t\t\t\tsubtitle: ,\r\n\t\t\t\ttitle: (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{section ? (\r\n\t\t\t\t\t\t\t\tsection.displayName\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\tgetRecentSectionTitlesEndpoint = (titleLaneKey, total) => {\r\n\t\tconst { sectionHighlights } = RetailTitleLaneType;\r\n\r\n\t\tconst sectionId = this.getSectionIdFromLaneKey(titleLaneKey);\r\n\t\tconst sectionLvl = SectionLevel.section;\r\n\r\n\t\tconst { customerState: c } = this.props;\r\n\r\n\t\treturn `/org/${c.orgId}/titles/${sectionHighlights}/${sectionLvl}/${sectionId}/${total}`;\r\n\t};\r\n\r\n\tgetSectionIdFromLaneKey = laneKey => {\r\n\t\treturn laneKey.replace(/sectionHighlights_/g, '').trim();\r\n\t};\r\n\r\n\tgetLaneNameKeyFromSectionId = sectionId => {\r\n\t\tconst { sectionHighlights } = RetailTitleLaneType;\r\n\t\treturn `${sectionHighlights}_${sectionId}`;\r\n\t};\r\n}\r\n\r\nconst mapSectionsDataStore = sectionsDataStore => ({\r\n\tisLoading: sectionsDataStore.isLoading(),\r\n\tsections: sectionsDataStore.getSections(),\r\n\tdepartments: sectionsDataStore.getDepartments(),\r\n\trecentSectionIds: sectionsDataStore.getRecentSectionIds(),\r\n\tgetOneSection: sectionId => sectionsDataStore.getSection(sectionId),\r\n});\r\n\r\nconst mapFavoritesDataStore = customerFavoritesDataStore => {\r\n\tconst isLoading = customerFavoritesDataStore.isLoading();\r\n\tconst favSections = customerFavoritesDataStore.getFavoriteGenres();\r\n\treturn {\r\n\t\tisLoadingFavorites: isLoading,\r\n\t\tidsOfFavoriteSections: favSections.map(entity => entity.entityId),\r\n\t};\r\n};\r\n\r\nconst connectors = [\r\n\tconnectToCustomerID,\r\n\tComponent => connectToSections(Component, mapSectionsDataStore),\r\n\tComponent => connectToFavorites(Component, mapFavoritesDataStore),\r\n];\r\n\r\nexport default combineConnectors(connectors)(RecentShelvesTitleLanes);\r\n","const StaffPickLaneType = {\r\n\tbyStaffMember: 'byStaffMember',\r\n\tbySection: 'bySection',\r\n};\r\n\r\nexport default StaffPickLaneType;\r\n","import React from 'react';\r\nimport LaneContainer from '../UI/LaneContainer';\r\nimport SectionsScroller from '../Section/UI/SectionsScroller';\r\nimport RecommendableEntity from '../../entity/RecommendableEntity';\r\nimport DetailDrawerAnchor from '../UI/DetailDrawerAnchor';\r\nimport { Translate } from 'react-localize-redux';\r\nimport StaffPicksDetail from './Drawers/StaffPicksDetail';\r\nimport { useStaffPicksDataStore } from './data/StaffPicksDataStore';\r\n\r\nexport default function StaffPicksBySectionLane() {\r\n\tconst { getStaffPickSections } = useStaffPicksDataStore();\r\n\tconst staffPickSections = getStaffPickSections();\r\n\r\n\tconst renderSections = () => {\r\n\t\treturn staffPickSections.map(section => {\r\n\t\t\treturn (\r\n\t\t\t\t
\r\n\t\t\t\t\t{renderOneStaffPickSectionAnchor(section)}\r\n\t\t\t\t
\r\n\t\t\t);\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderOneStaffPickSectionAnchor = section => {\r\n\t\tconst {\r\n\t\t\ttitles,\r\n\t\t\tsectionCode,\r\n\t\t\tdisplayName,\r\n\t\t\tsectionName,\r\n\t\t\tsectionId,\r\n\t\t} = section;\r\n\t\tconst name = displayName ? displayName : sectionName;\r\n\r\n\t\tconst sectionType = RecommendableEntity.section;\r\n\t\tconst entity = new RecommendableEntity(sectionId, sectionType, name);\r\n\r\n\t\treturn (\r\n\t\t\t renderDrawerContent(sectionCode)}>\r\n\t\t\t\t{drawer => {\r\n\t\t\t\t\treturn (\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 renderDrawerContent = sectionCode => (\r\n\t\t\r\n\t);\r\n\r\n\treturn (\r\n\t\t}\r\n\t\t\tsubHeader={}>\r\n\t\t\t{renderSections()}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Scroller from '../UI/Scroller/Scroller';\r\nimport StaffUserAvatar from './UI/StaffUserAvatar';\r\nimport LaneContainer from '../UI/LaneContainer';\r\nimport { connectToStaffPicks } from './data/StaffPicksDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass StaffPicksByMemberLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tshelfName: PropTypes.string,\r\n\t\tstaffPicksDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { staffPicksDataStore, shelfName } = this.props;\r\n\t\tconst staffUserIds = staffPicksDataStore.getSelectedStaffReviewerIds();\r\n\t\treturn staffUserIds.length ? (\r\n\t\t\t}\r\n\t\t\t\tsubHeader={\r\n\t\t\t\t\tshelfName ? (\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{this.renderStaffAvatars(staffUserIds)}\r\n\t\t\t\r\n\t\t) : null;\r\n\t}\r\n\r\n\trenderStaffAvatars = staffUserIds => {\r\n\t\tconst { staffPicksDataStore } = this.props;\r\n\t\tconst staffUsersWithReviews = staffUserIds.filter(staffUserId =>\r\n\t\t\tstaffPicksDataStore.getCountOfReviewsByStaffUser(staffUserId),\r\n\t\t);\r\n\t\treturn staffUsersWithReviews.map(staffUserId => {\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{this.renderOneStaffAvatarAnchor(staffUserId)}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t});\r\n\t};\r\n\r\n\trenderOneStaffAvatarAnchor = staffUserId => {\r\n\t\tconst { staffPicksDataStore, shelfName } = this.props;\r\n\t\tconst reviewsCt = staffPicksDataStore.getCountOfReviewsByStaffUser(\r\n\t\t\tstaffUserId,\r\n\t\t);\r\n\t\treturn (\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
{reviewsCt}
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{staffPicksDataStore.getStaffUser(staffUserId).firstName}\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 connectToStaffPicks(StaffPicksByMemberLane);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport StaffPicksDataStore from './data/StaffPicksDataStore';\r\nimport StaffPickLaneType from '../../entity/StaffPickLaneType';\r\nimport StaffPicksBySectionLane from './StaffPicksBySectionLane';\r\nimport StaffPicksByMemberLane from './StaffPicksByMemberLane';\r\nimport './staffPicks.css';\r\n\r\nexport default class StaffPicksSummary extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tstaffPickLaneType: PropTypes.string, // By Staff Member or By Section\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderStaffPicksLane}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderStaffPicksLane = staffPicksDataStore => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{!staffPicksDataStore.isLoading() &&\r\n\t\t\t\t\tthis.renderLane(staffPicksDataStore)}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\trenderLane = staffPicksDataStore => {\r\n\t\tswitch (this.props.staffPickLaneType) {\r\n\t\t\tcase StaffPickLaneType.bySection:\r\n\t\t\t\tconst staffPickSections = staffPicksDataStore.getStaffPickSections();\r\n\t\t\t\treturn Array.isArray(staffPickSections) &&\r\n\t\t\t\t\tstaffPickSections.length ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : null;\r\n\t\t\tcase StaffPickLaneType.byStaffMember:\r\n\t\t\tdefault:\r\n\t\t\t\treturn ;\r\n\t\t}\r\n\t};\r\n}\r\n","/**\r\n *\r\n * @param {String} pubDate\r\n * @returns {Boolean}\r\n */\r\nexport const isNotYetPublished = pubDate => {\r\n\treturn new Date(pubDate) > new Date();\r\n};\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { FullDateFormatNoDayOfWeek } from '../../../dateFormats';\r\nimport * as TitleStatus from '../../../title/TitleStatus';\r\n\r\nexport default class BrowseTitleAutocompleteRow extends React.Component {\r\n\tstatic propTypes = {\r\n\t\ttitle: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { title } = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t{title.title}\r\n\t\t\t\t
\r\n\t\t\t\t
{title.author}
\r\n\t\t\t\t
\r\n\t\t\t\t\t{title.pubDate !== '0001-01-01T00:00:00' && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{new Date(title.pubDate).toLocaleDateString(\r\n\t\t\t\t\t\t\t\t'en-US',\r\n\t\t\t\t\t\t\t\tFullDateFormatNoDayOfWeek,\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\t{title.formatDescription}\r\n\t\t\t\t
\r\n\t\t\t\t{this.isFrontList(title.pubDate) ? (\r\n\t\t\t\t\t
Coming Soon!
\r\n\t\t\t\t) : title.onHand ? (\r\n\t\t\t\t\t
On the Shelf
\r\n\t\t\t\t) : (\r\n\t\t\t\t\t
Available
\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tisFrontList(pubDate) {\r\n\t\treturn TitleStatus.isNotYetPublished(pubDate);\r\n\t}\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport LoadableAutocomplete from 'treeline-react-core-components/LoadableAutocomplete';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport { urlPrefix } from '../../../api';\r\nimport { cancelableDelay } from 'treeline-react-core-components/util';\r\nimport BrowseTitleAutocompleteRow from './BrowseTitleAutocompleteRow';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './browseTitleAutocomplete.css';\r\n\r\nclass BrowseTitleAutocomplete extends React.Component {\r\n\tstatic propTypes = {\r\n\t\t// Passed in from parent\r\n\t\tplaceholder: PropTypes.string,\r\n\t\tonSelectOption: PropTypes.func,\r\n\t\trenderOption: PropTypes.func,\r\n\t\tisClearable: PropTypes.bool,\r\n\t\tincludeProductImagesInResults: PropTypes.bool,\r\n\t\thandleOptionsResponse: PropTypes.func,\r\n\t\tshouldResetInternalState: PropTypes.bool,\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tonSelectOption: () => {},\r\n\t\tisClearable: true,\r\n\t\tincludeProductImagesInResults: false,\r\n\t\trenderTitleOption: title => {\r\n\t\t\treturn ;\r\n\t\t},\r\n\t\tshouldResetInternalState: false,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: false,\r\n\t\tuserInput: '',\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { isClearable, shouldResetInternalState } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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\thandleOptionsResponse = options => {\r\n\t\tconst { userInput } = this.state;\r\n\t\tconst { handleOptionsResponse } = this.props;\r\n\t\tif (typeof handleOptionsResponse === 'function') {\r\n\t\t\treturn handleOptionsResponse(userInput, options);\r\n\t\t}\r\n\t\tif (Array.isArray(options)) {\r\n\t\t\treturn options;\r\n\t\t}\r\n\t\tif (options && typeof options === 'object' && options.retailTitles) {\r\n\t\t\treturn options.retailTitles;\r\n\t\t}\r\n\t\treturn [];\r\n\t};\r\n\r\n\tgetURLForOptions = userInput => {\r\n\t\tthis.setState({ userInput });\r\n\t\tconst { orgId } = this.props.customerState;\r\n\t\tconst base = this.getEndpointBase();\r\n\t\tconst endpoint = `/org/${orgId}${base}?q=${userInput}`;\r\n\t\treturn `${urlPrefix}${endpoint}`;\r\n\t};\r\n\r\n\tgetEndpointBase() {\r\n\t\tconst { includeProductImagesInResults } = this.props;\r\n\t\tconst searchTitles = '/search/titles';\r\n\r\n\t\tif (!includeProductImagesInResults) {\r\n\t\t\treturn searchTitles;\r\n\t\t}\r\n\t\treturn `${searchTitles}/retailTitleSearchResults,productImages,productInfo`;\r\n\t}\r\n\r\n\tonSelectHook = autocompleteState => {\r\n\t\tconst { selectedId: sku } = autocompleteState;\r\n\r\n\t\tthis.setState({ isLoading: true });\r\n\r\n\t\tthis.delay = cancelableDelay(500);\r\n\r\n\t\tthis.delay.promise.then(() => {\r\n\t\t\tconst instance = this.getTitleAutocompleteInstance();\r\n\t\t\tthis.props.onSelectOption(sku, instance);\r\n\t\t});\r\n\t};\r\n\r\n\tgetTitleAutocompleteInstance = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tupdate: nextState => this.setState(nextState),\r\n\t});\r\n\r\n\tgetFeedback = translate => {\r\n\t\treturn translate('too_short');\r\n\t};\r\n\r\n\tgetPlaceholder = translate => {\r\n\t\treturn this.props.placeholder\r\n\t\t\t? this.props.placeholder\r\n\t\t\t: translate('find_a_title');\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(BrowseTitleAutocomplete);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleScroller from '../../TitleLanes/TitleScroller';\r\n\r\nSearchResultsTitleScroller.propTypes = {\r\n\ttitles: PropTypes.arrayOf(PropTypes.object),\r\n};\r\n\r\nexport default function SearchResultsTitleScroller({ titles }) {\r\n\tconst [maxVisibleTitles, setMaxVisible] = React.useState(10);\r\n\r\n\tconst totalTitlesCount = titles.length;\r\n\tconst titlesToRender = titles.slice(0, maxVisibleTitles);\r\n\r\n\tconst showMoreTitles = () => {\r\n\t\treturn new Promise(resolve =>\r\n\t\t\tresolve(setMaxVisible(currentMax => currentMax + 10)),\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t maxVisibleTitles}\r\n\t\t/>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LaneContainer, { SeeAllAnchor } from '../../UI/LaneContainer';\r\nimport SearchResultsTitleScroller from './SearchResultsTitleScroller';\r\nimport { Translate } from 'react-localize-redux';\r\nimport AllAvailableTitles from '../../TitleLanes/AllAvailableTitles';\r\nimport StaffPicksDataStore from '../../StaffPicks/data/StaffPicksDataStore';\r\n\r\nTitleLanesByStatus.propTypes = {\r\n\tchildren: PropTypes.element,\r\n\ttitlesByStatus: PropTypes.shape({\r\n\t\tonShelf: PropTypes.arrayOf(PropTypes.object),\r\n\t\tcomingSoon: PropTypes.arrayOf(PropTypes.object),\r\n\t\tavailableForOrder: PropTypes.arrayOf(PropTypes.object),\r\n\t}),\r\n};\r\n\r\nexport default function TitleLanesByStatus({ titlesByStatus, children }) {\r\n\tconst titleStatusHeaders = {\r\n\t\tonShelf: {\r\n\t\t\tmajorHeader: ,\r\n\t\t\tsubHeader: (\r\n\t\t\t\t\r\n\t\t\t),\r\n\t\t},\r\n\t\tcomingSoon: {\r\n\t\t\tmajorHeader: ,\r\n\t\t\tsubHeader: ,\r\n\t\t},\r\n\t\tavailableForOrder: {\r\n\t\t\tmajorHeader: ,\r\n\t\t\tsubHeader: ,\r\n\t\t},\r\n\t};\r\n\r\n\tconst renderAllTitles = (titles, headers) => {\r\n\t\treturn (\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{titlesByStatus &&\r\n\t\t\t\tObject.keys(titlesByStatus).map((status, idx) => {\r\n\t\t\t\t\tconst headers = titleStatusHeaders[status];\r\n\t\t\t\t\tconst titles = titlesByStatus[status];\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\ttitles.length > 0 && (\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{titles.length > 3 && (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\trenderAllTitles(titles, headers)\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{children}\r\n\t\t
\r\n\t);\r\n}\r\n","import React, { useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport { Drawer } from 'antd';\r\nimport { Empty, Card } from 'antd';\r\nimport BrowseTitleAutocomplete from './BrowseTitleAutocomplete';\r\nimport * as TitleStatus from '../../../title/TitleStatus';\r\nimport TitleLanesByStatus from './TitleLanesByStatus';\r\nimport { withLocalize } from 'react-localize-redux';\r\nimport delay from '../../../util/delay';\r\nimport { findUniqueFamilyTitles } from '../../../util/titleUtility';\r\nimport './detailedTitleSearch.less';\r\n\r\nDetailedTitleSearch.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tonCancel: PropTypes.func,\r\n\tdoShowResults: PropTypes.bool,\r\n\tonSearchResultsReceived: PropTypes.func,\r\n\theader: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\r\n\ttranslate: PropTypes.func,\r\n};\r\n\r\nfunction DetailedTitleSearch({\r\n\tisMobile,\r\n\tonCancel,\r\n\tdoShowResults,\r\n\tonSearchResultsReceived,\r\n\theader,\r\n\ttranslate,\r\n}) {\r\n\tconst [titles, setTitles] = useState([]);\r\n\tconst [userInput, setUserInput] = useState('');\r\n\tconst [didExecuteSearch, setDidExecute] = useState(false);\r\n\tconst [doResetInternalState, setDoResetInternalState] = useState(false);\r\n\r\n\tconst onTitleOptions = (\r\n\t\tuserInput,\r\n\t\t{ retailTitles, productImageUrisBySku, productsBySku },\r\n\t) => {\r\n\t\tconst productInfo = Object.values(productsBySku);\r\n\t\tconst titles = retailTitles.map(t => {\r\n\t\t\tconst imageKey = Object.keys(productImageUrisBySku).find(\r\n\t\t\t\tkey => key.toLowerCase() === t.sku.toLowerCase(),\r\n\t\t\t);\r\n\t\t\tconst titleInfo = productInfo.find(p => p.sku === t.sku);\r\n\t\t\treturn {\r\n\t\t\t\t...t,\r\n\t\t\t\timageUri: productImageUrisBySku[imageKey],\r\n\t\t\t\tfamilyItem: titleInfo.familyItem,\r\n\t\t\t\tretailPrice: titleInfo.retailPrice,\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tconst titlesWithPrices = titles.filter(\r\n\t\t\tt => t.listPrice || t.retailPrice,\r\n\t\t);\r\n\t\tconst uniqueTitles = findUniqueFamilyTitles(titlesWithPrices);\r\n\r\n\t\tsetTitles(uniqueTitles);\r\n\t\tsetUserInput(userInput);\r\n\r\n\t\tif (!didExecuteSearch) {\r\n\t\t\tsetDidExecute(true);\r\n\t\t}\r\n\r\n\t\tonSearchResultsReceived(uniqueTitles);\r\n\t\treturn [];\r\n\t};\r\n\r\n\tconst getTitlesByStatus = () => {\r\n\t\tconst titlesByStatus = {\r\n\t\t\tonShelf: [],\r\n\t\t\tcomingSoon: [],\r\n\t\t\tavailableForOrder: [],\r\n\t\t};\r\n\t\tfor (let i = 0; i < titles.length; i++) {\r\n\t\t\tconst title = titles[i];\r\n\t\t\tif (TitleStatus.isNotYetPublished(title.pubDate)) {\r\n\t\t\t\ttitlesByStatus.comingSoon.push(title);\r\n\t\t\t} else if (typeof title.onHand === 'number' && title.onHand > 0) {\r\n\t\t\t\ttitlesByStatus.onShelf.push(title);\r\n\t\t\t} else {\r\n\t\t\t\ttitlesByStatus.availableForOrder.push(title);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn titlesByStatus;\r\n\t};\r\n\r\n\tconst hasNoResults = titlesByStatus => {\r\n\t\treturn (\r\n\t\t\ttitlesByStatus.onShelf.length === 0 &&\r\n\t\t\ttitlesByStatus.comingSoon.length === 0 &&\r\n\t\t\ttitlesByStatus.availableForOrder.length === 0\r\n\t\t);\r\n\t};\r\n\r\n\tconst getNoResultsPrompt = () => {\r\n\t\treturn didExecuteSearch\r\n\t\t\t? translate('no_results_found')\r\n\t\t\t: translate('search_results_will_appear_here');\r\n\t};\r\n\r\n\tconst clearSearch = () => {\r\n\t\tresetSearch();\r\n\t\tonCancel();\r\n\t\tsetDidExecute(false);\r\n\t};\r\n\r\n\tconst resetSearch = async () => {\r\n\t\tsetDoResetInternalState(true);\r\n\t\tawait delay(850);\r\n\t\tsetDoResetInternalState(false);\r\n\t};\r\n\r\n\tconst renderResults = titlesByStatus => {\r\n\t\treturn hasNoResults(titlesByStatus) ? (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst titlesByStatus = getTitlesByStatus(titles);\r\n\tconst drawerHeader = (\r\n\t\t<>\r\n\t\t\t{translate('results_for')} {userInput}\r\n\t\t\r\n\t);\r\n\tconst pagePlaceholder = translate('search_for_books_by_title_or_author');\r\n\tconst drawerPlaceholder = translate('try_another_search');\r\n\r\n\tconst renderSearchLane = (header, placeholder) => {\r\n\t\treturn (\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
\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{renderSearchLane(header, pagePlaceholder)}\r\n\t\t\t{doShowResults && (\r\n\t\t\t\t\r\n\t\t\t\t\t{renderSearchLane(drawerHeader, drawerPlaceholder)}\r\n\t\t\t\t\t{renderResults(titlesByStatus)}\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 withLocalize(DetailedTitleSearch);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport DetailedTitleSearch from './DetailedTitleSearch';\r\nimport { Spin } from 'antd';\r\nimport delay from '../../../util/delay';\r\n\r\nTitleSearchService.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tchildren: PropTypes.func,\r\n};\r\n\r\nexport function useTitleSearchService(isMobile) {\r\n\tconst [isCancelingSearch, setIsCancelingSearch] = React.useState(false);\r\n\tconst [isTitleSearchActive, setIsTitleSearchActive] = React.useState(false);\r\n\r\n\tconst cancelSearch = async () => {\r\n\t\tsetIsCancelingSearch(true);\r\n\t\tawait delay(200);\r\n\t\tsetIsCancelingSearch(false);\r\n\t\tsetIsTitleSearchActive(false);\r\n\t};\r\n\r\n\tconst onSearchResultsReceived = () => {\r\n\t\tsetIsTitleSearchActive(true);\r\n\t};\r\n\r\n\tconst renderTitleSearch = header => {\r\n\t\treturn (\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 { isTitleSearchActive, renderTitleSearch };\r\n}\r\n\r\nfunction TitleSearchService({ isMobile, children }) {\r\n\tconst titleSearchService = useTitleSearchService(isMobile);\r\n\treturn children(titleSearchService);\r\n}\r\n\r\nexport default withIsMobile(TitleSearchService);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleLanesDataStore from '../../data/TitleLanesDataStore';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport RetailTitleLaneType from '../../../entity/RetailTitleLaneType';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst {\r\n\tfrontlist,\r\n\trecentPub,\r\n\tstaffReviews,\r\n\tdeeperBacklist,\r\n} = RetailTitleLaneType;\r\n\r\nclass SectionTitleLanesDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tentityId: PropTypes.string,\r\n\t\tsectionLevel: PropTypes.string,\r\n\t\tchildren: PropTypes.func,\r\n\t\t// Mapped to props\r\n\t\tcustomerState: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{titleLanesDataStore => {\r\n\t\t\t\t\treturn this.props.children(titleLanesDataStore);\r\n\t\t\t\t}}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetEndpointForTitleLanes = (retailTitleLaneType, total) => {\r\n\t\tconst {\r\n\t\t\tentityId: id,\r\n\t\t\tsectionLevel: lvl,\r\n\t\t\tcustomerState: c,\r\n\t\t} = this.props;\r\n\r\n\t\treturn `/org/${c.orgId}/titles/${retailTitleLaneType}/${lvl}/${id}/${total}`;\r\n\t};\r\n\r\n\tgetLaneConfigs = () => {\r\n\t\tconst frontlistConfig = {\r\n\t\t\tkey: frontlist,\r\n\t\t\ticon: 'lightbulb',\r\n\t\t\ttitle: ,\r\n\t\t\tsubtitle: (\r\n\t\t\t\t\r\n\t\t\t),\r\n\t\t};\r\n\r\n\t\tconst recentPubConfig = {\r\n\t\t\tkey: recentPub,\r\n\t\t\ticon: 'lightbulb',\r\n\t\t\ttitle: ,\r\n\t\t\tsubtitle: (\r\n\t\t\t\t\r\n\t\t\t),\r\n\t\t};\r\n\r\n\t\tconst staffReviewsConfig = {\r\n\t\t\tkey: staffReviews,\r\n\t\t\ticon: 'review-icon',\r\n\t\t\ttitle: ,\r\n\t\t\tsubtitle: ,\r\n\t\t};\r\n\r\n\t\tconst deeperBacklistConfig = {\r\n\t\t\tkey: deeperBacklist,\r\n\t\t\ticon: 'review-icon',\r\n\t\t\ttitle: ,\r\n\t\t\tsubtitle: ,\r\n\t\t};\r\n\r\n\t\treturn [\r\n\t\t\tfrontlistConfig,\r\n\t\t\trecentPubConfig,\r\n\t\t\tstaffReviewsConfig,\r\n\t\t\tdeeperBacklistConfig,\r\n\t\t];\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(SectionTitleLanesDataStore);\r\n","import React from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { Collapse, Spin } from 'antd';\r\nimport Convert from '../../util/Convert';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { useSectionsDataStore } from '../data/SectionsDataStore';\r\nimport SectionLevel from '../../entity/SectionLevel';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport SectionTitleLanesDataStore from '../Section/data/SectionTitleLanesDataStore';\r\nimport './shelves.less';\r\n\r\nconst { Panel } = Collapse;\r\n\r\nexport default function Shelves() {\r\n\tconst { getSections, getDepartments, isLoading } = useSectionsDataStore();\r\n\tconst sections = getSections();\r\n\tconst departments = getDepartments();\r\n\r\n\tconst renderLoading = () => {\r\n\t\treturn ;\r\n\t};\r\n\r\n\tconst renderShelvesBySectionsOrDepartments = () => {\r\n\t\treturn booksellerHasDefinedEnoughDepartments()\r\n\t\t\t? renderAllDepartments()\r\n\t\t\t: renderAllSections();\r\n\t};\r\n\r\n\tconst booksellerHasDefinedEnoughDepartments = () => {\r\n\t\treturn departments && departments.length > 5;\r\n\t};\r\n\r\n\tconst renderAllDepartments = () => {\r\n\t\treturn departments.map(department =>\r\n\t\t\trenderDepartmentOrSectionWithDataStore(\r\n\t\t\t\tdepartment,\r\n\t\t\t\tSectionLevel.department,\r\n\t\t\t),\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderAllSections = () => {\r\n\t\treturn sections.map(section =>\r\n\t\t\trenderDepartmentOrSectionWithDataStore(\r\n\t\t\t\tsection,\r\n\t\t\t\tSectionLevel.section,\r\n\t\t\t),\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderDepartmentOrSectionWithDataStore = (shelf, level) => {\r\n\t\tconst isDepartment = level === SectionLevel.department;\r\n\t\tconst entityId = Convert.toString(\r\n\t\t\tisDepartment ? shelf.departmentId : shelf.sectionId,\r\n\t\t);\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{titleLanesDataStore =>\r\n\t\t\t\t\ttitleLanesDataStore.isLoading\r\n\t\t\t\t\t\t? renderLoading()\r\n\t\t\t\t\t\t: isDepartment\r\n\t\t\t\t\t\t? renderOneDepartment(titleLanesDataStore, shelf)\r\n\t\t\t\t\t\t: renderOneSection(titleLanesDataStore, shelf)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderOneDepartment = (titleLanesDataStore, department) => {\r\n\t\tconst { departmentId, departmentName, sections } = department;\r\n\t\tconst key = Convert.toString(departmentId);\r\n\t\tconst hasTitles = titleLanesDataStore.hasTitlesInAnyLane();\r\n\r\n\t\treturn (\r\n\t\t\thasTitles && (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{sections.map(section =>\r\n\t\t\t\t\t\t\trenderDepartmentOrSectionWithDataStore(\r\n\t\t\t\t\t\t\t\tsection,\r\n\t\t\t\t\t\t\t\tSectionLevel.section,\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\tconst linkToDepartment = departmentId => {\r\n\t\treturn (\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\tconst renderOneSection = (titleLanesDataStore, section) => {\r\n\t\tconst { sectionId, displayName } = section;\r\n\t\tconst hasEnoughDepartments = booksellerHasDefinedEnoughDepartments();\r\n\t\tconst hasTitles = titleLanesDataStore.hasTitlesInAnyLane();\r\n\r\n\t\treturn (\r\n\t\t\thasTitles && (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{displayName}\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\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{isLoading()\r\n\t\t\t\t\t\t? renderLoading()\r\n\t\t\t\t\t\t: renderShelvesBySectionsOrDepartments()}\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 RecentShelvesTitleLanes from '../RecentShelves/RecentShelvesTitleLanes';\r\nimport StaffPicksSummary from '../StaffPicks/StaffPicksSummary';\r\nimport StaffPickLaneType from '../../entity/StaffPickLaneType';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport TitleSearchService from '../Title/Search/TitleSearchService';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport Shelves from './Shelves';\r\nimport './browseShelvesPage.css';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default class BrowseShelvesPage extends React.Component {\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{wishlistSkus => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{favorites =>\r\n\t\t\t\t\t\t\t\tthis.renderContent(wishlistSkus, favorites)\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\trenderContent = (wishlistSkus, favorites) => {\r\n\t\tif (wishlistSkus.isLoading() || favorites.isLoading()) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderWithTitleSearchService}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\trenderWithTitleSearchService = titleSearchService => {\r\n\t\treturn (\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{({ translate }) => {\r\n\t\t\t\t\t\t\treturn titleSearchService.renderTitleSearch(\r\n\t\t\t\t\t\t\t\tthis.getHeader(translate),\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\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\tgetHeader = translate => {\r\n\t\treturn translate('browse_our_shelves');\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport './overlay.css';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\n\r\nconst propTypes = {\r\n\tstyle: PropTypes.object,\r\n\theader: PropTypes.object,\r\n\tchildren: PropTypes.element,\r\n};\r\n\r\nconst defaultProps = {\r\n\tstyle: {},\r\n};\r\n\r\nexport function OverlayItem({ className, children }) {\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default function Overlay({ style, header, children }) {\r\n\tconst { getAppSettingAtKey } = useBooksellerPreferencesDataStore();\r\n\tconst headerLayout = getAppSettingAtKey('headerLayout');\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t{header && (\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
{header}
\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{children && (\r\n\t\t\t\t\r\n\t\t\t\t\t{children}\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nOverlay.propTypes = propTypes;\r\nOverlay.defaultProps = defaultProps;\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\n\r\nconst ImageUploadContext = React.createContext();\r\n\r\nconst name = 'imageUploadDataStore';\r\nexport const connectToImageUpload = makeConnectTo(ImageUploadContext, name);\r\n\r\nexport const useImageUpload = () => useContext(ImageUploadContext);\r\n\r\nexport default class ImageUploadDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\r\n\t};\r\n\r\n\tinitialState = {\r\n\t\tfileType: null,\r\n\t\tfileName: null,\r\n\t\tbase64Image: null,\r\n\t\tcroppedImageBase64Source: null,\r\n\t\tdidChooseImage: false,\r\n\t\tisLoading: false,\r\n\t\tisCropActive: false,\r\n\t};\r\n\r\n\tstate = this.initialState;\r\n\r\n\trender() {\r\n\t\tconst dataStore = this.getDataStore();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(dataStore)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t\tset: nextState => this.setState(s => ({ ...s, ...nextState })),\r\n\t\treset: () => this.reset(),\r\n\t\tisCropActive: () => state.isCropActive,\r\n\t\tgetUploadedImageAsBase64: () => {\r\n\t\t\treturn this.getUploadedImageAsBase64();\r\n\t\t},\r\n\t\tsetBase64ImageResult: uploadResult => {\r\n\t\t\treturn this.setBase64ImageResult(uploadResult);\r\n\t\t},\r\n\t\tsetCroppedImageBase64: croppedImageBase64Source => {\r\n\t\t\tthis.setState({ croppedImageBase64Source });\r\n\t\t},\r\n\t\tgetUploadedFileType: () => state.fileType,\r\n\t\tgetOriginalBase64: () => state.base64Image,\r\n\t\tgetImageSourceForPreview: () => this.getImageSourceForPreview(state),\r\n\t});\r\n\r\n\tsetBase64ImageResult = uploadResult => {\r\n\t\tconst { base64, fileType, fileName } = uploadResult;\r\n\r\n\t\tthis.setState({\r\n\t\t\tfileType,\r\n\t\t\tfileName,\r\n\t\t\tbase64Image: base64,\r\n\t\t\tdidChooseImage: true,\r\n\t\t\tisLoading: false,\r\n\t\t});\r\n\t};\r\n\r\n\treset = () => {\r\n\t\tthis.setState(this.initialState);\r\n\t};\r\n\r\n\tsetCroppedImageBase64 = croppedImageBase64Source => {\r\n\t\tthis.setState({ croppedImageBase64Source });\r\n\t};\r\n\r\n\tgetImageSourceForPreview = state => {\r\n\t\tconst { base64Image, croppedImageBase64Source: cropped } = state;\r\n\t\treturn cropped ? cropped : base64Image;\r\n\t};\r\n\r\n\tgetUploadedImageAsBase64() {\r\n\t\tconst { croppedImageBase64Source, base64Image } = this.state;\r\n\r\n\t\tif (croppedImageBase64Source) {\r\n\t\t\treturn this.normalizeBase64(croppedImageBase64Source);\r\n\t\t}\r\n\t\treturn this.normalizeBase64(base64Image);\r\n\t}\r\n\r\n\tnormalizeBase64 = base64 => {\r\n\t\tconst match = /data:image\\/.+;base64,/g;\r\n\t\treturn base64.replace(match, '').trim();\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Upload } from 'antd';\r\nimport { connectToImageUpload } from './ImageUploadDataStore';\r\n\r\nclass ImageUploadAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tchildren: PropTypes.element,\r\n\t\tonUpload: PropTypes.func,\r\n\t\timageUploadDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\ttransformFileOnDrop = uploadInstance => {\r\n\t\treturn this.readImageFileOnDrop(uploadInstance)\r\n\t\t\t.then(this.handleTransformedImage)\r\n\t\t\t.catch(err => console.error(err));\r\n\t};\r\n\r\n\treadImageFileOnDrop = uploadInstance => {\r\n\t\tconst { file } = uploadInstance;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tconst reader = new FileReader();\r\n\t\t\treader.readAsDataURL(file);\r\n\r\n\t\t\tconst fileType = file.type;\r\n\t\t\tconst fileName = file.name;\r\n\r\n\t\t\treader.onload = () => {\r\n\t\t\t\tif (reader.result) {\r\n\t\t\t\t\tresolve({ fileType, fileName, base64: reader.result });\r\n\t\t\t\t} else {\r\n\t\t\t\t\treject(Error('Failed conversion to base64'));\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\thandleTransformedImage = uploadResult => {\r\n\t\tif (uploadResult) {\r\n\t\t\tconst { imageUploadDataStore } = this.props;\r\n\t\t\timageUploadDataStore.setBase64ImageResult(uploadResult);\r\n\t\t\tthis.onUpload(uploadResult.base64);\r\n\t\t}\r\n\t};\r\n\r\n\tonUpload = uploadResult => {\r\n\t\tif (typeof this.props.onUpload === 'function') {\r\n\t\t\treturn this.props.onUpload(uploadResult);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default connectToImageUpload(ImageUploadAnchor);\r\n","import React from 'react';\r\nimport { connectToLogo } from '../../data/BooksellerLogoStore';\r\nimport { Button, Icon, notification } from 'antd';\r\nimport ImageUploadAnchor from '../Image/ImageUploadAnchor';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nfunction UploadButton({ label, ...rest }) {\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nfunction SplashUploadAnchor({ logoStore }) {\r\n\tconst onUpload = (base64, translate) => {\r\n\t\tnotification.info({\r\n\t\t\tmessage: translate('this_is_a_preview'),\r\n\t\t});\r\n\t\treturn logoStore.setSplashPreviewSource(base64);\r\n\t};\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ translate }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t onUpload(base64, translate)}>\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 connectToLogo(SplashUploadAnchor);\r\n","import { useState } from 'react';\r\nimport api from '../../../../api';\r\nimport delay from '../../../../util/delay';\r\nimport { notification } from 'antd';\r\nimport { useCustomerID } from '../../../data/CustomerIDStore';\r\nimport { useImageUpload } from '../../Image/ImageUploadDataStore';\r\nimport { useBooksellerLogoDataStore } from '../../../data/BooksellerLogoStore';\r\nimport { ImageType } from '../../../data/BooksellerLogoStore';\r\n\r\nexport default function useSplashImageController() {\r\n\tconst { orgId } = useCustomerID();\r\n\tconst imageUploadDataStore = useImageUpload();\r\n\tconst logoDataStore = useBooksellerLogoDataStore();\r\n\r\n\tconst endpoint = `/org/${orgId}/images/splash`;\r\n\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\tconst [isDeleting, setIsDeleting] = useState(false);\r\n\r\n\tconst makeRetailImageDTO = () => ({\r\n\t\tbase64: imageUploadDataStore.getUploadedImageAsBase64(),\r\n\t\timageType: ImageType.splash,\r\n\t\tfileName: imageUploadDataStore.state.fileName,\r\n\t\tfileType: imageUploadDataStore.state.fileType,\r\n\t});\r\n\r\n\tconst clearPreviewAndReset = () => {\r\n\t\timageUploadDataStore.reset();\r\n\t\tlogoDataStore.clearSplashPreview();\r\n\t};\r\n\r\n\tconst saveUploadedSplash = async translate => {\r\n\t\tsetIsLoading(true);\r\n\r\n\t\tconst imgDTO = makeRetailImageDTO();\r\n\t\tconst { didUpdateSucceed, imageUri } = await api.put(endpoint, imgDTO);\r\n\r\n\t\tif (didUpdateSucceed && imageUri) {\r\n\t\t\tlogoDataStore.setSplashUri(imageUri);\r\n\t\t}\r\n\t\tawait delay(750);\r\n\t\tnotification.success({ message: translate('splash_image_uploaded') });\r\n\r\n\t\tawait delay(500);\r\n\t\tclearPreviewAndReset();\r\n\t};\r\n\r\n\tconst deleteCurrentSplashImage = async translate => {\r\n\t\tsetIsDeleting(true);\r\n\t\tawait api.del(endpoint);\r\n\r\n\t\tnotification.info({ message: translate('splash_image_deleted') });\r\n\t\tlogoDataStore.setSplashUri(null);\r\n\t};\r\n\r\n\treturn {\r\n\t\tisLoading,\r\n\t\tisDeleting,\r\n\t\tsaveUploadedSplash,\r\n\t\tclearPreviewAndReset,\r\n\t\tdeleteCurrentSplashImage,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport useSplashImageController from './hooks/useSplashImageController';\r\nimport { Button, Icon } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function SaveUploadedSplashButton() {\r\n\tconst { isLoading, saveUploadedSplash } = useSplashImageController();\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ translate }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t saveUploadedSplash(translate)}\r\n\t\t\t\t\t\tloading={isLoading}>\r\n\t\t\t\t\t\t{isLoading ? (\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\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 React from 'react';\r\nimport { Popconfirm, Button } from 'antd';\r\nimport useSplashImageController from './hooks/useSplashImageController';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function DeleteSplashButton() {\r\n\tconst splashController = useSplashImageController();\r\n\tconst { deleteCurrentSplashImage, isDeleting } = splashController;\r\n\r\n\tconst title = (\r\n\t\t\r\n\t);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ translate }) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t deleteCurrentSplashImage(translate)}\r\n\t\t\t\t\t\tokText={}>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{isDeleting ? (\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 React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button } from 'antd';\r\nimport { connectToLogo } from '../../data/BooksellerLogoStore';\r\nimport SplashUploadAnchor from './SplashUploadAnchor';\r\nimport SaveUploadedSplashButton from './SaveUploadedSplashButton';\r\nimport DeleteSplashButton from './DeleteSplashButton';\r\nimport useSplashImageController from './hooks/useSplashImageController';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './splashImageUpload.css';\r\n\r\nconst propTypes = {\r\n\tonIgnore: PropTypes.func,\r\n\tlogoStore: PropTypes.object,\r\n};\r\n\r\nfunction SplashImageUpload({ onIgnore, logoStore }) {\r\n\tconst { clearPreviewAndReset } = useSplashImageController();\r\n\tconst hasUploadedPreview = logoStore.hasSplashPreview();\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
\r\n\t\t\t\t{hasUploadedPreview ? (\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)}\r\n\t\t\t\t{!hasUploadedPreview && logoStore.hasSplashImage() && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{hasUploadedPreview ? (\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)}\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\r\nSplashImageUpload.propTypes = propTypes;\r\n\r\nexport default connectToLogo(SplashImageUpload);\r\n","import React from 'react';\r\nimport ImageUploadDataStore from '../Image/ImageUploadDataStore';\r\nimport SplashImageUpload from './SplashImageUpload';\r\n\r\nexport default 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 PropTypes from 'prop-types';\r\nimport Overlay from './Overlay';\r\nimport { connectToLogo } from '../data/BooksellerLogoStore';\r\nimport { connectToPreviewMode } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport SplashImageUpload from '../FileUpload/SplashImage';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport Fade from 'treeline-react-core-components/Fade';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\nimport classNames from 'classnames';\r\nimport './booksellerSplashImage.less';\r\n\r\nclass BooksellerSplashImage extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tlogoStore: PropTypes.object,\r\n\t\theader: PropTypes.object,\r\n\t\tgradient: PropTypes.string,\r\n\t\theaderLayout: PropTypes.string,\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisUploadVisible: true,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { gradient, header } = this.props;\r\n\t\tconst imageUri = this.getImageUri();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{imageUri ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\"bookseller\r\n\t\t\t\t\t
\r\n\t\t\t\t) : (\r\n\t\t\t\t\tthis.state.isUploadVisible &&\r\n\t\t\t\t\tthis.renderPreviewModeEmptySplash()\r\n\t\t\t\t)}\r\n\t\t\t\t{header && }\r\n\t\t\t\t{this.doAllowSplashUpload() && this.renderUploadService()}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.props.logoStore.setSplashVisbility(true);\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tif (this.props.logoStore.hasSplashPreview()) {\r\n\t\t\tthis.props.logoStore.clearSplashPreview();\r\n\t\t}\r\n\t\tthis.props.logoStore.setSplashVisbility(false);\r\n\t}\r\n\r\n\tgetImageUri() {\r\n\t\tconst { logoStore, previewMode } = this.props;\r\n\t\tconst splashUri = logoStore.getSplashImage();\r\n\r\n\t\tconst splashPreviewSrc = logoStore.getSplashPreviewSource();\r\n\t\tconst showUploadPreview = splashPreviewSrc && previewMode.isActive();\r\n\r\n\t\treturn showUploadPreview ? splashPreviewSrc : splashUri;\r\n\t}\r\n\r\n\tdoAllowSplashUpload() {\r\n\t\tconst { isUploadVisible: isVisible } = this.state;\r\n\t\tconst { previewMode, isMobile, header } = this.props;\r\n\t\treturn !header && previewMode.isActive() && !isMobile() && isVisible;\r\n\t}\r\n\r\n\trenderUploadService() {\r\n\t\tconst { headerLayout } = this.props;\r\n\t\tconst isOverlapLayout = headerLayout === HeaderLayout.overlap;\r\n\t\tconst splashImageUploadContainerClasses = classNames(\r\n\t\t\t'flex-align-center',\r\n\t\t\t{\r\n\t\t\t\t'splash-image-upload-service-container': !isOverlapLayout,\r\n\t\t\t\t'splash-image-upload-service-container-overlap': isOverlapLayout,\r\n\t\t\t},\r\n\t\t);\r\n\t\treturn (\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\tthis.setState({\r\n\t\t\t\t\t\t\t\t\t\tisUploadVisible: false,\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\trenderPreviewModeEmptySplash() {\r\n\t\treturn
;\r\n\t}\r\n}\r\n\r\nconst withSellerPreferences = Component => {\r\n\treturn connectToSellerPreferences(Component, preferences => ({\r\n\t\tgradient: preferences.getGradient(),\r\n\t\theaderLayout: preferences.getAppSettingAtKey('headerLayout'),\r\n\t}));\r\n};\r\n\r\nconst connectors = [connectToLogo, withSellerPreferences, connectToPreviewMode];\r\n\r\nexport default combineConnectors(connectors)(\r\n\twithIsMobile(BooksellerSplashImage, 825),\r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleLanes from '../TitleLanes';\r\nimport { Spin } from 'antd';\r\nimport { connectToWishlist } from './data/WishlistLaneDataStore';\r\nimport CopyLinkToWishlistAnchor from './UI/CopyLinkToWishlistAnchor';\r\n\r\nclass WishlistTitlesLane extends React.Component {\r\n\tstatic propTypes = {\r\n\t\twishlistLaneDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { wishlistLaneDataStore } = this.props;\r\n\t\treturn (\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);\r\n\t}\r\n\r\n\trenderCopyLinkToWishlistAnchor = () => {\r\n\t\treturn ;\r\n\t};\r\n}\r\n\r\nexport default connectToWishlist(WishlistTitlesLane);\r\n","export const StoreLocationInfoEnum = {\r\n\tlocationName: ['locationName'],\r\n\tphoneNumber: ['phoneNumber'],\r\n\taddress: ['address.line1', 'address.line2'],\r\n\thours: ['hours.line1', 'hours.line2', 'hours.line3'],\r\n};\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { StoreLocationInfoEnum } from './StoreLocationInfoEnum';\r\nimport './storeLocationInfo.less';\r\n\r\nStoreLocationInfo.propTypes = {\r\n\tlocation: PropTypes.object,\r\n};\r\n\r\nexport default function StoreLocationInfo({ location }) {\r\n\tconst { locationName, phoneNumber, address, hours } = location;\r\n\r\n\tconst getStoreInfoProperties = properties => {\r\n\t\treturn properties.map((p, i) => {\r\n\t\t\tconst property = p.includes('.') ? p.split('.') : p;\r\n\t\t\tconst value = Array.isArray(property)\r\n\t\t\t\t? location[property[0]][property[1]]\r\n\t\t\t\t: location[property];\r\n\t\t\treturn (\r\n\t\t\t\tvalue && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{value}\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
\r\n\t\t\t\t{locationName &&\r\n\t\t\t\t\tgetStoreInfoProperties(StoreLocationInfoEnum.locationName)}\r\n\t\t\t\t{address &&\r\n\t\t\t\t\tObject.values(address).some(value => value) &&\r\n\t\t\t\t\tgetStoreInfoProperties(StoreLocationInfoEnum.address)}\r\n\t\t\t\t{phoneNumber &&\r\n\t\t\t\t\tgetStoreInfoProperties(StoreLocationInfoEnum.phoneNumber)}\r\n\t\t\t
\r\n\t\t\t{hours && Object.values(hours).some(value => value) && (\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{getStoreInfoProperties(StoreLocationInfoEnum.hours)}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n","import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport StoreLocationInfo from './StoreLocationInfo';\r\nimport './organizationInfo.less';\r\n\r\nOrganizationInfo.propTypes = {\r\n\tstoreLocations: PropTypes.array,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction OrganizationInfo({ storeLocations, isMobile }) {\r\n\tconst appSettings = useBooksellerPreferencesDataStore();\r\n\tconst { textColor, iconColor } = appSettings;\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 1 ? 's' : ''\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{storeLocations.map((location, i) => (\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 withIsMobile(OrganizationInfo);\r\n","import React from 'react';\r\nimport LaneContainer from '../UI/LaneContainer';\r\nimport { Progress } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default class RewardsProgress extends React.Component {\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t}\r\n\t\t\t\t\tsubHeader=\"...towards your next $20 off!\">\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
\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 PropTypes from 'prop-types';\r\nimport TitleScroller from '../TitleLanes/TitleScroller';\r\nimport LaneContainer, { SeeAllAnchor } from '../UI/LaneContainer';\r\nimport { useRecentlyViewedDataStore } from './data/RecentlyViewedDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport ShowingTitlesCount from '../TitleLanes/ShowingTitlesCount';\r\nimport AllAvailableTitles from '../TitleLanes/AllAvailableTitles';\r\nimport StaffPicksDataStore from '../StaffPicks/data/StaffPicksDataStore';\r\n\r\nRecentlyViewedLane.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction RecentlyViewedLane({ isMobile }) {\r\n\tconst recentlyViewed = useRecentlyViewedDataStore();\r\n\tconst titles = recentlyViewed ? recentlyViewed.getTitles() : [];\r\n\r\n\tconst getHeader = () => ;\r\n\r\n\tconst renderExtra = () => {\r\n\t\tif (isMobile()) return null;\r\n\t\treturn ;\r\n\t};\r\n\r\n\tconst renderAllTitles = () => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\tnew Promise(resolve => resolve({ titles }))\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{recentlyViewed && (\r\n\t\t\t\t<>\r\n\t\t\t\t\t\r\n\t\t\t\t\t{titles.length > 3 ? (\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)}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(RecentlyViewedLane);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport BooksellerSplashImage from '../UI/BooksellerSplashImage';\r\nimport RecentShelvesTitleLanes from '../RecentShelves/RecentShelvesTitleLanes';\r\nimport WishListTitlesLane from '../Wishlist/WishlistTitlesLane';\r\nimport StaffPicksSummary from '../StaffPicks/StaffPicksSummary';\r\nimport OrganizationInfo from '../Organization/OrganizationInfo';\r\nimport StaffPickLaneType from '../../entity/StaffPickLaneType';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport RewardsProgress from '../Rewards/RewardsProgress';\r\nimport { connectToLogo } from '../data/BooksellerLogoStore';\r\nimport {\r\n\twithIsUnknownCustomer,\r\n\tconnectToPreviewMode,\r\n\twithIsDemoBookstore,\r\n} from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport TitleSearchService from '../Title/Search/TitleSearchService';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport RecentlyViewedLane from '../RecentlyViewed/RecentlyViewedLane';\r\nimport { connectToRecentlyViewed } from '../RecentlyViewed/data/RecentlyViewedDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { connectToSellerContent } from '../data/BooksellerContentDataStore';\r\nimport './homePage.css';\r\n\r\nclass HomePage extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tonDidMount: PropTypes.func,\r\n\t\tlogoStore: PropTypes.object,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\tpreviewMode: PropTypes.object,\r\n\t\tisDemoBookstore: PropTypes.bool,\r\n\t\trecentlyViewedDataStore: PropTypes.object,\r\n\t\tappSettings: PropTypes.shape({\r\n\t\t\tdoIncludeCommerce: PropTypes.bool,\r\n\t\t\theaderColor: PropTypes.string,\r\n\t\t}),\r\n\t\tgradient: PropTypes.string,\r\n\t\tbooksellerContentStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{titleSearchService => {\r\n\t\t\t\t\treturn this.renderHomePageContent(titleSearchService);\r\n\t\t\t\t}}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderHomePageContent(titleSearchService) {\r\n\t\tconst { headerColor, gradient } = this.props.appSettings;\r\n\t\tconst { getStoreLocations } = this.props.booksellerContentStore;\r\n\t\tconst { isMobile } = this.props;\r\n\t\tconst style = isMobile()\r\n\t\t\t? { backgroundImage: gradient }\r\n\t\t\t: { background: headerColor };\r\n\t\tconst storeLocations = getStoreLocations();\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{this.doRenderSplash() && }\r\n\t\t\t\t{titleSearchService.renderTitleSearch(\r\n\t\t\t\t\t!isMobile() ? : '',\r\n\t\t\t\t)}\r\n\t\t\t\t{this.doRenderRecentlyViewedLane() && }\r\n\t\t\t\t{this.hasValidCustomer() && }\r\n\t\t\t\t{this.doRenderRewardsProgressLane() && }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{storeLocations.length > 0 && (\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\tcomponentDidMount() {\r\n\t\tif (typeof this.props.onDidMount === 'function') {\r\n\t\t\tthis.props.onDidMount();\r\n\t\t}\r\n\t}\r\n\r\n\tdoRenderRewardsProgressLane() {\r\n\t\tconst { appSettings, isDemoBookstore } = this.props;\r\n\t\treturn (\r\n\t\t\tappSettings.doIncludeCommerce &&\r\n\t\t\tthis.hasValidCustomer() &&\r\n\t\t\tisDemoBookstore\r\n\t\t);\r\n\t}\r\n\r\n\tdoRenderRecentlyViewedLane() {\r\n\t\tconst { recentlyViewedDataStore: recentlyViewed } = this.props;\r\n\t\treturn recentlyViewed.any() && this.hasValidCustomer();\r\n\t}\r\n\r\n\tdoRenderSplash() {\r\n\t\tconst { logoStore, previewMode } = this.props;\r\n\t\treturn previewMode.isActive() ? true : logoStore.hasSplashImage();\r\n\t}\r\n\r\n\thasValidCustomer() {\r\n\t\tconst { previewMode, isUnknownCustomer } = this.props;\r\n\t\treturn !isUnknownCustomer && !previewMode.isActive();\r\n\t}\r\n}\r\n\r\nconst withAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, preferences => ({\r\n\t\tappSettings: preferences.getAppSettings(),\r\n\t\tgradient: preferences.getGradient(),\r\n\t}));\r\n};\r\n\r\nconst connectors = [\r\n\tconnectToLogo,\r\n\twithIsDemoBookstore,\r\n\tconnectToPreviewMode,\r\n\twithIsUnknownCustomer,\r\n\twithAppSettings,\r\n\twithIsMobile,\r\n\tconnectToRecentlyViewed,\r\n\tconnectToSellerContent,\r\n];\r\n\r\nexport default combineConnectors(connectors)(HomePage);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport HomePage from './HomePage';\r\nimport { Route, Switch, Redirect } from 'react-router-dom';\r\nimport TitleDetailDrawer from '../Title/TitleDetailDrawer';\r\nimport { connectToOrg } from '../data/OrganizationDataStore';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport WishlistLaneDataStore from '../Wishlist/data/WishlistLaneDataStore';\r\nimport { connectToLogo } from '../data/BooksellerLogoStore';\r\nimport RecentlyViewedDataStore from '../RecentlyViewed/data/RecentlyViewedDataStore';\r\n\r\nclass HomePageRoot extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tmatch: PropTypes.object,\r\n\t\thistory: PropTypes.object,\r\n\t\tlocation: PropTypes.object,\r\n\t\t// Mapped to Props\r\n\t\torgName: PropTypes.string,\r\n\t\tisLoadingLogos: PropTypes.bool,\r\n\t\tisLoadingOrgData: PropTypes.bool,\r\n\t\tcustomerState: PropTypes.shape({\r\n\t\t\tisPreviewMode: PropTypes.bool,\r\n\t\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\t}),\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { isPreviewMode, isUnknownCustomer } = this.props.customerState;\r\n\r\n\t\tif (isPreviewMode || isUnknownCustomer) {\r\n\t\t\treturn this.renderPage();\r\n\t\t}\r\n\t\treturn (\r\n\t\t\t{this.renderPage()}\r\n\t\t);\r\n\t}\r\n\r\n\trenderPage() {\r\n\t\tif (this.props.isLoadingLogos) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\r\n\t\treturn (\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/>\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\r\n\t\t);\r\n\t}\r\n\r\n\trenderHomeWithTitleDetail = ({ match }) => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{drawer => {\r\n\t\t\t\t\tif (this.props.isLoadingOrgData) {\r\n\t\t\t\t\t\treturn ;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn drawer.open()} />;\r\n\t\t\t\t}}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n}\r\n\r\nconst withOrg = Component => {\r\n\treturn connectToOrg(Component, orgDataStore => ({\r\n\t\torgName: orgDataStore.getOrgName(),\r\n\t\tisLoadingOrgData: orgDataStore.isLoading(),\r\n\t}));\r\n};\r\n\r\nconst withIsLoadingLogos = Component => {\r\n\treturn connectToLogo(Component, ({ isLoadingSplash, isLoading }) => ({\r\n\t\tisLoadingLogos: isLoadingSplash() || isLoading(),\r\n\t}));\r\n};\r\n\r\nconst connectors = [withOrg, connectToCustomerID, withIsLoadingLogos];\r\n\r\nexport default combineConnectors(connectors)(HomePageRoot);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport './sectionHeader.css';\r\n\r\nSectionHeader.propTypes = {\r\n\tdisplayName: PropTypes.object,\r\n};\r\n\r\nexport default function SectionHeader({ displayName }) {\r\n\tconst { getGradient } = useBooksellerPreferencesDataStore();\r\n\treturn (\r\n\t\t\r\n\t\t\t
{displayName}
\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Popover } from 'antd';\r\nimport { Link } from 'react-router-dom';\r\nimport './sectionPopover.css';\r\n\r\nSectionPopover.propTypes = {\r\n\tdepartment: PropTypes.object,\r\n\tsection: PropTypes.object,\r\n};\r\n\r\nexport default function SectionPopover({ department, section }) {\r\n\tconst getSectionName = section =>\r\n\t\tsection.displayName ? section.displayName : section.sectionName;\r\n\r\n\tconst renderLinksToDepartmentAndSections = () => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{section ? (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{department.departmentName}\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\tShelves:\r\n\t\t\t\t\t
\r\n\t\t\t\t) : (\r\n\t\t\t\t\t`${department.departmentName} Shelves:`\r\n\t\t\t\t)}\r\n\t\t\t\t{getSectionList()}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst getSectionList = () => {\r\n\t\treturn (\r\n\t\t\t
    \r\n\t\t\t\t{department.sections.map((s, idx) => {\r\n\t\t\t\t\tconst sectionName = getSectionName(s);\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t{!section || s.sectionId !== section.sectionId ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{sectionName}\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\tsectionName\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
\r\n\t\t\t\t{section\r\n\t\t\t\t\t? getSectionName(section)\r\n\t\t\t\t\t: `${department.departmentName} Department`}\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport SectionTitleLanesDataStore from './data/SectionTitleLanesDataStore';\r\nimport TitleLanes from '../TitleLanes';\r\nimport SectionHeader from './SectionHeader';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport StaffPicksDataStore from '../StaffPicks/data/StaffPicksDataStore';\r\nimport StaffPicksByMemberLane from '../StaffPicks/StaffPicksByMemberLane';\r\nimport { Spin } from 'antd';\r\nimport SectionLevel from '../../entity/SectionLevel';\r\nimport { useSectionsDataStore } from '../data/SectionsDataStore';\r\nimport { useTitleSearchService } from '../Title/Search/TitleSearchService';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport SectionPopover from './SectionPopover';\r\nimport './sectionHome.css';\r\n\r\nSectionHome.propTypes = {\r\n\tentityId: PropTypes.string,\r\n\tsectionLevel: PropTypes.string,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction SectionHome({ entityId, sectionLevel, isMobile }) {\r\n\tconst { renderTitleSearch } = useTitleSearchService(isMobile);\r\n\tconst { getDepartment, getSection } = useSectionsDataStore();\r\n\tconst [shelfName, setShelfName] = React.useState('');\r\n\r\n\tconst getDisplayName = () => {\r\n\t\tif (sectionLevel === SectionLevel.section) {\r\n\t\t\treturn getHeaderForSection();\r\n\t\t}\r\n\t\tif (sectionLevel === SectionLevel.department) {\r\n\t\t\treturn getHeaderForDepartment();\r\n\t\t}\r\n\t\tthrow new Error('Invalid Path!');\r\n\t};\r\n\r\n\tconst getHeaderForDepartment = () => {\r\n\t\tconst department = getDepartment(entityId);\r\n\t\tsetShelfName(department.departmentName);\r\n\t\treturn department.sections.length ? (\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\tdepartment.departmentName\r\n\t\t);\r\n\t};\r\n\r\n\tconst findDepartment = section => {\r\n\t\tconst { departmentId } = section;\r\n\t\treturn getDepartment(departmentId);\r\n\t};\r\n\r\n\tconst getHeaderForSection = () => {\r\n\t\tconst section = getSection(entityId);\r\n\t\tconst sectionName = section.displayName\r\n\t\t\t? section.displayName\r\n\t\t\t: section.sectionName;\r\n\t\tconst department =\r\n\t\t\tsection.departmentId && section.departmentId !== '0'\r\n\t\t\t\t? findDepartment(section)\r\n\t\t\t\t: null;\r\n\t\tsetShelfName(sectionName);\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{department && department.sections.length ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\tsectionName\r\n\t\t\t\t)}\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderLoading = () => {\r\n\t\treturn (\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\tconst renderStaffPicks = () => {\r\n\t\treturn (\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\tconst renderPageWithDataStore = titleLanesDataStore => {\r\n\t\tconst displayName = getDisplayName();\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t{renderTitleSearch()}\r\n\t\t\t\t\r\n\t\t\t\t\t{staffPicksDataStore => {\r\n\t\t\t\t\t\treturn staffPicksDataStore.isLoading()\r\n\t\t\t\t\t\t\t? renderLoading()\r\n\t\t\t\t\t\t\t: !staffPicksDataStore.isLoading() &&\r\n\t\t\t\t\t\t\t staffPicksDataStore.hasReviews()\r\n\t\t\t\t\t\t\t? renderStaffPicks()\r\n\t\t\t\t\t\t\t: null;\r\n\t\t\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\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{titleLanesDataStore => {\r\n\t\t\t\t\t\treturn renderPageWithDataStore(titleLanesDataStore);\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 withIsMobile(SectionHome);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport api from '../../../api';\r\nimport { connectToCustomerID } from '../../data/CustomerIDStore';\r\nimport makeConnectTo from '../../data/makeConnectTo';\r\n\r\nconst TransactionDetailsContext = React.createContext();\r\n\r\nexport const connectToTransactionDetails = makeConnectTo(\r\n\tTransactionDetailsContext,\r\n\t'transactionDetailsDataStore',\r\n);\r\n\r\nclass TransactionDetailsDataStore extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcustomerState: PropTypes.object,\r\n\t\tchildren: PropTypes.oneOfType([\r\n\t\t\tPropTypes.element,\r\n\t\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t\t\tPropTypes.func,\r\n\t\t]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisLoading: true,\r\n\t\ttransactionsData: [],\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{typeof this.props.children === 'function'\r\n\t\t\t\t\t? this.props.children(this.state)\r\n\t\t\t\t\t: this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchTransactionDetails();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tapi.revoke(this.transactionDetailsFetch);\r\n\t}\r\n\r\n\tgetDataStore = (state = this.state) => ({\r\n\t\tstate,\r\n\t});\r\n\r\n\tfetchTransactionDetails = () => {\r\n\t\tconst { orgId, customerId } = this.props.customerState;\r\n\t\tconst request = api.cancelableGet(\r\n\t\t\t`/org/${orgId}/customer/${customerId}/transactions`,\r\n\t\t);\r\n\t\trequest.promise.then(this.cacheApiResponse);\r\n\t\tthis.transactionDetailsFetch = request;\r\n\t};\r\n\r\n\tcacheApiResponse = apiResponse => {\r\n\t\tconst transactionsData = this.getTransactionDetailsData(apiResponse);\r\n\t\tthis.setState({ transactionsData });\r\n\t};\r\n\r\n\tgetTransactionDetailsData = apiResponse => {\r\n\t\tconst r = apiResponse;\r\n\t\treturn {\r\n\t\t\ttransactions: this.buildBrowseableTransactions(r),\r\n\t\t};\r\n\t};\r\n\r\n\tbuildBrowseableTransactions(transactionsAggregate) {\r\n\t\tconst { skuPosData, productsBySku } = transactionsAggregate;\r\n\t\treturn transactionsAggregate.transactions.map(t => {\r\n\t\t\tconst sku = t.sku;\r\n\t\t\tconst title = this.getTitleForTransaction(\r\n\t\t\t\tsku,\r\n\t\t\t\tproductsBySku[sku] && productsBySku[sku],\r\n\t\t\t\tskuPosData[sku] && skuPosData[sku],\r\n\t\t\t);\r\n\t\t\tconst author = this.getAuthorForTransaction(\r\n\t\t\t\tsku,\r\n\t\t\t\tproductsBySku[sku] && productsBySku[sku],\r\n\t\t\t\tskuPosData[sku] && skuPosData[sku],\r\n\t\t\t);\r\n\t\t\treturn { ...t, title, author };\r\n\t\t});\r\n\t}\r\n\r\n\tgetTitleForTransaction = (sku, product, pos) => {\r\n\t\tif (product && product.name) {\r\n\t\t\treturn product.name;\r\n\t\t} else if (pos && pos[0] != null) {\r\n\t\t\treturn pos[0].title;\r\n\t\t} else {\r\n\t\t\treturn sku || '';\r\n\t\t}\r\n\t};\r\n\r\n\tgetAuthorForTransaction = (sku, product, pos) => {\r\n\t\tif (product && product.name) {\r\n\t\t\treturn product.author;\r\n\t\t} else if (pos && pos[0] != null) {\r\n\t\t\treturn pos[0].author;\r\n\t\t} else {\r\n\t\t\treturn sku || '';\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default connectToCustomerID(TransactionDetailsDataStore);\r\n","import React from 'react';\r\nimport TransactionDetailsDataStore from './data/TransactionDetailsDataStore';\r\nimport TitleDetailDrawer from '../Title/TitleDetailDrawer';\r\nimport { Table } from 'antd';\r\n\r\nexport default class TransactionsList extends React.Component {\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.renderTransactions}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderTransactions = transactionDetailsDataStore => {\r\n\t\tif (transactionDetailsDataStore.transactionsData) {\r\n\t\t\tconst {\r\n\t\t\t\ttransactions,\r\n\t\t\t} = transactionDetailsDataStore.transactionsData;\r\n\r\n\t\t\treturn (\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} else {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t};\r\n\r\n\tbuildColumns() {\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\ttitle: 'Date',\r\n\t\t\t\tsorter: (a, b) =>\r\n\t\t\t\t\tnew Date(b.purchaseDate) - new Date(a.purchaseDate),\r\n\t\t\t\trender: transaction => (\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{new Date(transaction.purchaseDate).toLocaleDateString(\r\n\t\t\t\t\t\t\t'en-US',\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tyear: '2-digit',\r\n\t\t\t\t\t\t\t\tmonth: '2-digit',\r\n\t\t\t\t\t\t\t\tday: '2-digit',\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{\r\n\t\t\t\ttitle: 'Title',\r\n\t\t\t\trender: transaction => (\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{transaction.title}\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
{transaction.author}
\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 PageTitle from '../UI/PageTitle';\r\nimport TransactionsList from './TransactionsList';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\n\r\nexport default class RewardsPage extends React.Component {\r\n\trender() {\r\n\t\treturn (\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\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 PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { connectToLogo } from '../../data/BooksellerLogoStore';\r\nimport { connectToCustomer } from '../../data/CustomerSummaryDataStore';\r\nimport PageTitle from '../../UI/PageTitle';\r\nimport BooksellerSplashImage from '../../UI/BooksellerSplashImage';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tlogoStore: PropTypes.object,\r\n\tcustomerDataStore: PropTypes.object,\r\n};\r\n\r\nfunction WishlistCollectionPageHeader(props) {\r\n\tconst getPageTitle = () => {\r\n\t\tconst loading = props.customerDataStore.isLoading();\r\n\t\tconst refFullName = props.customerDataStore.getFullName();\r\n\r\n\t\tconst refLastName = props.customerDataStore.getLastName();\r\n\t\tconst refFirstName = props.customerDataStore.getFirstName();\r\n\r\n\t\tconst referralName = refLastName ? refFullName : refFirstName;\r\n\t\treturn loading || !referralName ? (\r\n\t\t\t\r\n\t\t) : (\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst isMobile = props.isMobile();\r\n\tconst hasSplash = props.logoStore.hasSplashImage();\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{hasSplash && (\r\n\t\t\t\t
\r\n\t\t\t\t\t{isMobile && (\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\t{!hasSplash && (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nconst connectors = [connectToLogo, connectToCustomer];\r\n\r\nexport default combineConnectors(connectors)(\r\n\twithIsMobile(WishlistCollectionPageHeader, 550),\r\n);\r\n\r\nWishlistCollectionPageHeader.propTypes = propTypes;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useReferralSource } from '../../data/CustomerIDStore';\r\nimport CustomerSummaryDataStore from '../../data/CustomerSummaryDataStore';\r\nimport TransactionsDataStore from '../../data/TransactionsDataStore';\r\n\r\nconst propTypes = {\r\n\tchildren: PropTypes.func,\r\n};\r\n\r\nexport default function WishlistCollectionPageDataStores({ children }) {\r\n\tconst referralSource = useReferralSource();\r\n\treturn (\r\n\t\t\r\n\t\t\t{customerSummaryDataStore => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{transactionsDataStore => {\r\n\t\t\t\t\t\t\treturn children({\r\n\t\t\t\t\t\t\t\ttransactionsDataStore,\r\n\t\t\t\t\t\t\t\tcustomerSummaryDataStore,\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\nWishlistCollectionPageDataStores.propTypes = propTypes;\r\n","import React, { useEffect } from 'react';\r\nimport { cancelableDelay } from '../../../util/delay';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function WishlistPageError() {\r\n\tconst history = useHistory();\r\n\r\n\tuseEffect(() => {\r\n\t\tconst delay = cancelableDelay(3500);\r\n\t\tdelay.promise.then(() => history.push('/explore'));\r\n\r\n\t\treturn () => {\r\n\t\t\tdelay.cancel();\r\n\t\t};\r\n\t}, [history]);\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\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\nimport useReferralWishlistTitles from './data/useReferralWishlistTitles';\r\nimport CollectionTitle from '../Collection/UI/CollectionTitle';\r\nimport CollectionTitlesWrapper from '../Collection/UI/CollectionTitlesWrapper';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport WishlistCollectionPageHeader from './UI/WishlistCollectionPageHeader';\r\nimport WishlistCollectionPageDataStores from './data/WishlistCollectionPageDataStores';\r\nimport ErrorBoundary from '../UI/Error/ErrorBoundary';\r\nimport WishlistPageError from './UI/WishlistPageError';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport WishlistSkusDataStore from './data/WishlistSkusDataStore';\r\nimport './wishlistCollectionPage.css';\r\n\r\nexport default function WishlistCollectionPage() {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nfunction WishlistCollectionPageContent() {\r\n\tconst {\r\n\t\twishlistTitles,\r\n\t\tisLoading,\r\n\t\tisInvalidReferral,\r\n\t} = useReferralWishlistTitles();\r\n\r\n\tconst {\r\n\t\tgetGradient,\r\n\t\tgetAppSettingAtKey,\r\n\t} = useBooksellerPreferencesDataStore();\r\n\r\n\tif (isInvalidReferral) {\r\n\t\tthrow new Error('Invalid Referral!');\r\n\t}\r\n\r\n\tconst renderWishlistTitles = transactionsDataStore => {\r\n\t\tconst titles = wishlistTitles.filter(\r\n\t\t\tt => !transactionsDataStore.includes(t.sku),\r\n\t\t);\r\n\t\treturn titles.map(title => {\r\n\t\t\tconst key = title.sku;\r\n\t\t\treturn ;\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderPageContent = transactionsDataStore => {\r\n\t\tconst headerLayout = getAppSettingAtKey('headerLayout');\r\n\t\treturn (\r\n\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{renderWishlistTitles(transactionsDataStore)}\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\r\n\t\t\t\t\r\n\t\t\t\t\t{({ customerSummaryDataStore, transactionsDataStore }) => {\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{customerSummaryDataStore.isLoading() ? (\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\t\trenderPageContent(transactionsDataStore)\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 { useState, useEffect } from 'react';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\nimport TitleAggregateParser from '../../../title/TitleAggregateParser';\r\nimport api, { isBadRequest } from '../../../api';\r\n\r\nexport default function useReferralWishlistTitles() {\r\n\tconst c = useCustomerID();\r\n\r\n\tconst [isLoading, setIsLoading] = useState(true);\r\n\tconst [wishlistTitles, setWishlistTitles] = useState([]);\r\n\tconst [isInvalidReferral, setIsInvalidReferral] = useState(false);\r\n\r\n\tconst buildWishlistTitles = ({ titleAggregate }) => {\r\n\t\tconst parser = new TitleAggregateParser(titleAggregate);\r\n\t\tsetWishlistTitles(parser.buildTitles());\r\n\t\tsetIsLoading(false);\r\n\t};\r\n\r\n\tconst fetchWishlistTitlesEffect = () => {\r\n\t\tconst referral = c.referralSource;\r\n\t\tconst skusEndpoint = `/org/${referral.orgId}/customer/${referral.customerId}/titles/wishlist/skus`;\r\n\r\n\t\tlet request = api.cancelableGet(skusEndpoint);\r\n\r\n\t\trequest.promise\r\n\t\t\t.then(wishlistData => {\r\n\t\t\t\tconst ct = wishlistData.skus.length;\r\n\t\t\t\tconst endpoint = `/org/${referral.orgId}/customer/${referral.customerId}/titles/wishList/all/0/${ct}`;\r\n\r\n\t\t\t\trequest = api.cancelableGet(endpoint);\r\n\t\t\t\treturn request.promise;\r\n\t\t\t})\r\n\t\t\t.then(buildWishlistTitles)\r\n\t\t\t.catch(err => {\r\n\t\t\t\tif (isBadRequest(err) && !referral.orgId) {\r\n\t\t\t\t\tsetIsInvalidReferral(true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\treturn () => {\r\n\t\t\tapi.revoke(request);\r\n\t\t};\r\n\t};\r\n\r\n\tuseEffect(fetchWishlistTitlesEffect, [wishlistTitles.length]);\r\n\r\n\treturn {\r\n\t\tisLoading,\r\n\t\twishlistTitles,\r\n\t\tisInvalidReferral,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport api from '../../../api';\r\nimport { useBagDataStore } from './BagDataStore';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\n\r\nexport default function useBagDataTotalAmount() {\r\n\tconst bag = useBagDataStore();\r\n\tconst [isLoading, setIsLoading] = React.useState(true);\r\n\r\n\tconst [amountsBySku, setAmountsForSkus] = React.useState({});\r\n\tconst { orgId } = useCustomerID();\r\n\r\n\tconst skus = bag.getTitles().map(t => t.sku);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst endpoint = `/orgs/${orgId}/orders/skus/pos`;\r\n\t\tconst request = api.cancelablePost(endpoint, skus);\r\n\r\n\t\trequest.promise.then(res => {\r\n\t\t\tsetAmountsForSkus(res);\r\n\t\t\tsetIsLoading(false);\r\n\t\t});\r\n\r\n\t\treturn () => {\r\n\t\t\tapi.revoke(request);\r\n\t\t};\r\n\t\t// eslint-disable-next-line\r\n\t}, [orgId, skus.length]);\r\n\r\n\tconst getTotal = () => {\r\n\t\tconst quantitesBySku = bag.getQuantitiesBySku();\r\n\t\treturn Object.keys(amountsBySku).reduce((totalPrice, sku) => {\r\n\t\t\tlet quantity = 0;\r\n\t\t\tif (typeof quantitesBySku[sku] === 'number') {\r\n\t\t\t\tquantity = quantitesBySku[sku];\r\n\t\t\t}\r\n\t\t\treturn totalPrice + amountsBySku[sku][0] * quantity;\r\n\t\t}, 0);\r\n\t};\r\n\r\n\tconst getPrice = sku => {\r\n\t\tconst hasPrice = amountsBySku && amountsBySku[sku];\r\n\t\tif (hasPrice && amountsBySku[sku][0]) {\r\n\t\t\treturn amountsBySku[sku][0];\r\n\t\t}\r\n\t\treturn 'Unavailable';\r\n\t};\r\n\r\n\treturn {\r\n\t\tisLoading,\r\n\t\tamountsBySku,\r\n\t\tgetTotal,\r\n\t\tgetPrice,\r\n\t\tgetFixedTotal: () => getTotal().toFixed(2),\r\n\t};\r\n}\r\n","import { useOrganizationDataStore } from '../data/OrganizationDataStore';\r\n\r\nexport default function LocalizedPrice() {\r\n\tconst { getOrgCountry } = useOrganizationDataStore();\r\n\r\n\tconst getCultureAndCurrencyCodes = () => {\r\n\t\tswitch (getOrgCountry()) {\r\n\t\t\tcase 'UK':\r\n\t\t\t\treturn {\r\n\t\t\t\t\tculture: 'en-GB',\r\n\t\t\t\t\tcurrency: 'GBP',\r\n\t\t\t\t};\r\n\t\t\tcase 'CA':\r\n\t\t\t\treturn {\r\n\t\t\t\t\tculture: 'en-CA',\r\n\t\t\t\t\tcurrency: 'CAD',\r\n\t\t\t\t};\r\n\t\t\tdefault:\r\n\t\t\tcase 'US':\r\n\t\t\t\treturn {\r\n\t\t\t\t\tculture: 'en-US',\r\n\t\t\t\t\tcurrency: 'USD',\r\n\t\t\t\t};\r\n\t\t}\r\n\t};\r\n\r\n\treturn {\r\n\t\tgetCultureAndCurrencyCodes,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport useLocalizedCurrencyCode from './useLocalizedCurrencyCode';\r\n\r\nLocalizedPrice.propTypes = {\r\n\tprice: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n};\r\n\r\nexport default function LocalizedPrice({ price }) {\r\n\tconst { getCultureAndCurrencyCodes } = useLocalizedCurrencyCode();\r\n\tconst { culture, currency } = getCultureAndCurrencyCodes();\r\n\r\n\tconst displayPrice = price.toLocaleString(culture, {\r\n\t\tstyle: 'currency',\r\n\t\tcurrency,\r\n\t});\r\n\r\n\treturn {displayPrice};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport useRemoveFromBag from '../data/useRemoveFromBag';\r\nimport { Button, Popconfirm, Modal } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nRemoveFromBagAnchor.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\ttitle: Customer360PropTypes.Title,\r\n};\r\n\r\nfunction RemoveFromBagAnchor({ title, isMobile }) {\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\tconst { removeFromBag } = useRemoveFromBag(title, setIsLoading);\r\n\r\n\tconst [isVisible, setIsVisible] = React.useState(false);\r\n\r\n\tconst renderAsPopConfirm = () => {\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tcancelText={}\r\n\t\t\t\ttitle={}\r\n\t\t\t\tonConfirm={removeFromBag}>\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\tconst onModalOk = async () => {\r\n\t\tsetIsVisible(false);\r\n\t\tawait removeFromBag();\r\n\t};\r\n\r\n\tconst renderWithConfirmModal = () => {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t setIsVisible(true)}\r\n\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\t\tokText={}\r\n\t\t\t\t\tcancelText={}\r\n\t\t\t\t\tonCancel={() => setIsVisible(false)}\r\n\t\t\t\t\tonOk={onModalOk}>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t{title.name}\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{isMobile() ? renderWithConfirmModal() : renderAsPopConfirm()}\r\n\t\t
\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(RemoveFromBagAnchor);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport TitleDataStore from '../../Title/data/TitleDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nBagTitleFormat.propTypes = {\r\n\tsku: PropTypes.string,\r\n};\r\n\r\nexport default function BagTitleFormat({ sku }) {\r\n\tconst getFormatDisplay = format => {\r\n\t\tswitch (format) {\r\n\t\t\tcase 'Trade Paperback':\r\n\t\t\t\treturn 'Paperback';\r\n\t\t\tdefault:\r\n\t\t\t\treturn format;\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{titleDataStore => {\r\n\t\t\t\tif (titleDataStore.isLoading()) {\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...\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\tconst format = titleDataStore.getFormatDescription();\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{format ? (\r\n\t\t\t\t\t\t\tgetFormatDisplay(format)\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","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Customer360PropTypes from '../../../types';\r\nimport { Select, Form } from 'antd';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst { Option } = Select;\r\n\r\nBagItemQuantitySelect.propTypes = {\r\n\tquantity: PropTypes.number,\r\n\tentity: Customer360PropTypes.RecommendableEntity,\r\n};\r\n\r\nconst maxCopies = 7;\r\n\r\nexport default function BagItemQuantitySelect({ entity, quantity }) {\r\n\tconst bag = useBagDataStore();\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\r\n\tconst renderOptions = () => {\r\n\t\tconst options = [];\r\n\t\tfor (let i = 1; i < maxCopies; i++) {\r\n\t\t\toptions.push(\r\n\t\t\t\t,\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\r\n\tconst onSelect = async nextQuantity => {\r\n\t\tsetIsLoading(true);\r\n\t\tawait bag.updateQuantity(entity, nextQuantity);\r\n\t\tsetIsLoading(false);\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{renderOptions()}\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 { PropTypes } from 'prop-types';\r\nimport TitleJacketImage from '../../Title/UI/TitleJacketImage';\r\nimport useBagDataTotalAmount from '../data/useBagDataTotalAmount';\r\nimport LocalizedPrice from '../../Localization/LocalizedPrice';\r\nimport { Row, Col, Descriptions } from 'antd';\r\nimport TitleDetailDrawer from '../../Title/TitleDetailDrawer';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport RemoveFromBagAnchor from './RemoveFromBagAnchor';\r\nimport { getAuthorDisplayNameAndInitials } from '../../../author/author.utils';\r\nimport BagTitleFormat from './BagTitleFormat';\r\nimport BagItemQuantitySelect from './BagItemQuantitySelect';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './bagOrderTitleSummary.less';\r\n\r\nBagOrderTitleSummary.propTypes = {\r\n\ttitle: PropTypes.object,\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction BagOrderTitleSummary({ title, isMobile }) {\r\n\tconst { getPrice } = useBagDataTotalAmount();\r\n\tconst price = getPrice(title.sku);\r\n\r\n\tconst renderPrice = () => {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{isNaN(price) ? (\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)}\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tconst getTitleAsEntity = () => {\r\n\t\tconst type = RecommendableEntity.title;\r\n\t\treturn new RecommendableEntity(title.sku, type, title.name, title);\r\n\t};\r\n\r\n\tconst isMobileSize = isMobile();\r\n\r\n\tconst entity = getTitleAsEntity();\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{isMobileSize && (\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\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\r\n\t\t\t\t{!isMobileSize && (\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\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\tgetAuthorDisplayNameAndInitials(\r\n\t\t\t\t\t\t\t\t\t\ttitle.author,\r\n\t\t\t\t\t\t\t\t\t).displayName\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\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{isMobileSize && (\r\n\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t\t{renderPrice()}\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\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{!isMobileSize && (\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
\r\n\t\t\t\t\t\t\t\t\t\t:{' '}\r\n\t\t\t\t\t\t\t\t\t\t{renderPrice()}\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
\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 withIsMobile(BagOrderTitleSummary);\r\n","import React from 'react';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport BagOrderTitleSummary from './BagOrderTitleSummary';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './bagOrderTitleSummary.less';\r\n\r\nexport default function BagOrderTitleSummaries() {\r\n\tconst { getTitles } = useBagDataStore();\r\n\tconst titles = getTitles();\r\n\r\n\tconst renderNoTitlesInBag = () => {\r\n\t\treturn (\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);\r\n\t};\r\n\r\n\tconst renderBagTitles = () => {\r\n\t\treturn titles.map(t => );\r\n\t};\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t{titles.length > 0 ? renderBagTitles() : renderNoTitlesInBag()}\r\n\t\t
\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport useBagDataTotalAmount from '../data/useBagDataTotalAmount';\r\nimport LocalizedPrice from '../../Localization/LocalizedPrice';\r\n\r\nexport default function BagTotal() {\r\n\tconst { getTotal } = useBagDataTotalAmount();\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 React from 'react';\r\nimport TitleAutocomplete from '../../Title/UI/TitleAutocomplete';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport RecommendableEntity from '../../../entity/RecommendableEntity';\r\nimport { notification, Spin } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function AddTitlesAutocomplete() {\r\n\tconst bagDataStore = useBagDataStore();\r\n\tconst [isLoading, setIsLoading] = React.useState(false);\r\n\r\n\tconst addTitleToBag = translate => async (sku, chosenOption) => {\r\n\t\tconst name = chosenOption.name;\r\n\t\tconst type = RecommendableEntity.title;\r\n\r\n\t\tsetIsLoading(true);\r\n\t\tconst entity = new RecommendableEntity(sku, type, name);\r\n\r\n\t\tawait bagDataStore.save(entity);\r\n\t\tnotification.success({\r\n\t\t\tmessage: translate('added_x_to_your_bag', { name: name }),\r\n\t\t});\r\n\t\tsetIsLoading(false);\r\n\t};\r\n\r\n\tconst getPlaceholder = translate => {\r\n\t\treturn translate('search_for_more_titles');\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{({ translate }) => {\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\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 from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LaneContainer from '../../UI/LaneContainer';\r\nimport BagTotal from '../../Bag/UI/BagTotal';\r\nimport { useBagDataStore } from '../../Bag/data/BagDataStore';\r\nimport AddTitlesAutocomplete from '../../Bag/UI/AddTitlesAutocomplete';\r\nimport './orderLaneContainer.css';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nOrderLaneContainer.propTypes = {\r\n\tchildren: PropTypes.element,\r\n};\r\n\r\nexport default function OrderLaneContainer({ children }) {\r\n\tconst { getTotalEntitiesCount } = useBagDataStore();\r\n\tconst totalEntitiesCount = getTotalEntitiesCount();\r\n\r\n\tconst renderSubHeader = () => {\r\n\t\tconst itemCountDisplay =\r\n\t\t\ttotalEntitiesCount === 1 ? (\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\treturn (\r\n\t\t\t\r\n\t\t\t\t ({itemCountDisplay}): \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\tsubHeader={renderSubHeader()}\r\n\t\t\textra={}>\r\n\t\t\t{children}\r\n\t\t
\r\n\t);\r\n}\r\n","export const DeliveryMode = {\r\n\tPickup: 0,\r\n\tHomeDelivery: 1,\r\n};\r\n","import React from 'react';\r\nimport useBagDataTotalAmount from '../Bag/data/useBagDataTotalAmount';\r\nimport { Row, Col } from 'antd';\r\nimport LocalizedPrice from '../Localization/LocalizedPrice';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default function OrderTotalBreakdown(props) {\r\n\tconst bagDataTotalAmount = useBagDataTotalAmount();\r\n\tconst { getTotal } = bagDataTotalAmount;\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:\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\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{props.isShipping() && (\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\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\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\t\t\t{props.doShowTax && (\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\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\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\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\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","import api from '../../api';\r\nimport { useCustomerID } from '../data/CustomerIDStore';\r\n\r\nexport default function useTaxes() {\r\n\tconst { orgId } = useCustomerID();\r\n\r\n\tconst getLocationTaxRate = async address => {\r\n\t\tconst addressQueryParams = new URLSearchParams(address).toString();\r\n\t\treturn api.get(`/orgs/${orgId}/taxes?${addressQueryParams}`);\r\n\t};\r\n\r\n\treturn {\r\n\t\tgetLocationTaxRate,\r\n\t};\r\n}\r\n","export const OrderProvider = {\r\n\tPayPal: 'PayPal',\r\n};\r\n","export const AddressType = {\r\n\tBilling: 'Billing',\r\n\tShipping: 'Shipping',\r\n};\r\n","export const PreferredContactMethod = {\r\n\tText: 'Text',\r\n\tEmail: 'Email',\r\n\tPhoneCall: 'PhoneCall',\r\n};\r\n","import api from '../../../api';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\nimport { OrderProvider } from '../../../orders/OrderProvider';\r\nimport { AddressType } from '../../../orders/AddressType';\r\nimport { PreferredContactMethod } from '../../../orders/PreferredContactMethod';\r\nimport { DeliveryMode } from '../../../orders/DeliveryMode';\r\nimport { useBagDataStore } from '../../Bag/data/BagDataStore';\r\n\r\nexport default function usePayPalOrders(deliveryMode) {\r\n\tconst { customerId, orgId } = useCustomerID();\r\n\tconst bagDataStore = useBagDataStore();\r\n\r\n\tconst hasValidLineItems = paypalOrderDetails => {\r\n\t\tconst { purchase_units } = paypalOrderDetails;\r\n\t\treturn (\r\n\t\t\tArray.isArray(purchase_units) &&\r\n\t\t\tArray.isArray(purchase_units[0].items)\r\n\t\t);\r\n\t};\r\n\r\n\tconst buildLineItems = paypalOrderDetails => {\r\n\t\tconst { purchase_units } = paypalOrderDetails;\r\n\r\n\t\tif (!hasValidLineItems(paypalOrderDetails)) {\r\n\t\t\tthrow new Error('Invalid order details');\r\n\t\t}\r\n\t\treturn purchase_units[0].items.map(item => ({\r\n\t\t\tsku: item.sku,\r\n\t\t\tamount: item.unit_amount.value,\r\n\t\t\tquantity: item.quantity,\r\n\t\t\tcurrencyCode: item.unit_amount.currency_code,\r\n\t\t}));\r\n\t};\r\n\r\n\tconst buildShippingAddress = paypalOrderDetails => {\r\n\t\tconst { purchase_units } = paypalOrderDetails;\r\n\t\tconst { shipping } = purchase_units[0];\r\n\t\treturn {\r\n\t\t\tfullName: shipping.name.full_name,\r\n\t\t\taddressType: AddressType.Shipping,\r\n\t\t\tstreetAddress1: shipping.address.address_line_1,\r\n\t\t\tstreetAddress2: shipping.address.address_line_2,\r\n\t\t\tregion: shipping.address.admin_area_1,\r\n\t\t\tlocality: shipping.address.admin_area_2,\r\n\t\t\tpostalCode: shipping.address.postal_code,\r\n\t\t\tcountryCode: shipping.address.country_code,\r\n\t\t\thomePhone: null,\r\n\t\t\tmobilePhone: null,\r\n\t\t};\r\n\t};\r\n\r\n\tconst buildAddresses = paypalOrderDetails => {\r\n\t\tif (deliveryMode !== DeliveryMode.HomeDelivery) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn [buildShippingAddress(paypalOrderDetails)];\r\n\t};\r\n\r\n\tconst buildOrderDTO = paypalOrderDetails => ({\r\n\t\torgId,\r\n\t\tcustomerId,\r\n\t\tdeliveryMode,\r\n\t\tisGift: false,\r\n\t\tdoWrap: false,\r\n\t\treferenceId: paypalOrderDetails.id,\r\n\t\temail: paypalOrderDetails.payer.email_address,\r\n\t\tlastName: paypalOrderDetails.payer.name.surname,\r\n\t\tfirstName: paypalOrderDetails.payer.name.given_name,\r\n\t\torderProvider: OrderProvider.PayPal,\r\n\t\tpreferredContactMethod: PreferredContactMethod.Email,\r\n\t\tstatus: paypalOrderDetails.status,\r\n\t\tshoppingCartGuid: bagDataStore.getShoppingCartGuid(),\r\n\t\taddresses: buildAddresses(paypalOrderDetails),\r\n\t\tlineItems: buildLineItems(paypalOrderDetails),\r\n\t});\r\n\r\n\tconst createOrders = async paypalOrderDetails => {\r\n\t\tif (!paypalOrderDetails) return;\r\n\r\n\t\tconst endpoint = `/org/${orgId}/orders`;\r\n\t\tconst orderDTO = buildOrderDTO(paypalOrderDetails);\r\n\r\n\t\tconst didSucceed = await api.post(endpoint, [orderDTO]);\r\n\t\treturn didSucceed;\r\n\t};\r\n\r\n\treturn {\r\n\t\tcreatePayPalOrders: createOrders,\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport {\r\n\tuseBooksellerAppSettings,\r\n\tappSettingsByKey,\r\n} from '../data/BooksellerPreferencesDataStore';\r\nimport { useCustomerID } from '../data/CustomerIDStore';\r\nimport { useCustomerSummaryDataStore } from '../data/CustomerSummaryDataStore';\r\nimport { useBagDataStore } from '../Bag/data/BagDataStore';\r\nimport useBagDataTotalAmount from '../Bag/data/useBagDataTotalAmount';\r\nimport useLocalizedCurrencyCode from '../Localization/useLocalizedCurrencyCode';\r\nimport { useOrganizationDataStore } from '../data/OrganizationDataStore';\r\nimport useTaxes from '../hooks/useTaxes';\r\nimport usePayPalOrders from './data/usePayPalOrders';\r\nimport useScript from 'react-script-hook';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport { Alert } from 'antd';\r\n\r\nexport default function PayPalOrderButton({\r\n\tisShipping,\r\n\tdeliveryChoice,\r\n\torgSalesTax,\r\n\torgUseTax,\r\n\tgetOrderTotal,\r\n\tgetShippingPrice,\r\n\tgetTax,\r\n\tsetError,\r\n\tsetIsVisible,\r\n}) {\r\n\tconst bagDataStore = useBagDataStore();\r\n\tconst bagDataTotalAmount = useBagDataTotalAmount();\r\n\r\n\tconst titles = bagDataStore.getTitles();\r\n\tconst { amountsBySku, getFixedTotal } = bagDataTotalAmount;\r\n\r\n\tconst booksellerAppSettings = useBooksellerAppSettings();\r\n\tconst { emailAddress } = useCustomerID();\r\n\tconst { getFirstName, getLastName } = useCustomerSummaryDataStore();\r\n\r\n\tconst { getCultureAndCurrencyCodes } = useLocalizedCurrencyCode();\r\n\tconst { currency } = getCultureAndCurrencyCodes();\r\n\r\n\tconst {\r\n\t\tstate: orgDataStoreState,\r\n\t\tgetOrgName,\r\n\t\tgetOrgCountry,\r\n\t} = useOrganizationDataStore();\r\n\tconst { state: stateAbbreviation } = orgDataStoreState.organization;\r\n\r\n\tconst { getLocationTaxRate } = useTaxes();\r\n\tconst { createPayPalOrders } = usePayPalOrders(deliveryChoice);\r\n\r\n\tconst paypalApiKey = process.env.REACT_APP_PAYPAL_API_KEY;\r\n\tconst [isLoading, isError] = useScript({\r\n\t\tsrc: `https://www.paypal.com/sdk/js?client-id=${paypalApiKey}¤cy=${currency}`,\r\n\t});\r\n\tif (isLoading) return ;\r\n\tif (isError)\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\r\n\tlet PayPalButton = window.paypal.Buttons.driver('react', {\r\n\t\tReact,\r\n\t\tReactDOM,\r\n\t\tcurrency_code: currency,\r\n\t});\r\n\r\n\tconst onApprove = (data, actions) => {\r\n\t\treturn actions.order.capture().then(async details => {\r\n\t\t\tconst { status } = details;\r\n\t\t\tif (status !== 'COMPLETED' && status !== 'APPROVED') {\r\n\t\t\t\tsetError({ exists: true, details });\r\n\t\t\t} else {\r\n\t\t\t\tawait createPayPalOrders(details);\r\n\t\t\t\tawait bagDataStore.refresh();\r\n\t\t\t}\r\n\t\t\tsetIsVisible(true);\r\n\t\t});\r\n\t};\r\n\r\n\tconst getPaypalOrder = function() {\r\n\t\treturn {\r\n\t\t\tpurchase_units: getPurchaseUnits(),\r\n\t\t\tapplication_context: {\r\n\t\t\t\tbrand_name: getOrgName(),\r\n\t\t\t\tshipping_preference: isShipping()\r\n\t\t\t\t\t? 'GET_FROM_FILE'\r\n\t\t\t\t\t: 'NO_SHIPPING',\r\n\t\t\t},\r\n\t\t};\r\n\t};\r\n\r\n\tconst getPurchaseUnits = function() {\r\n\t\tconst items = getPurchaseUnitsItems(orgSalesTax);\r\n\r\n\t\tconst breakdown = {\r\n\t\t\titem_total: {\r\n\t\t\t\tcurrency_code: currency,\r\n\t\t\t\tvalue: getFixedTotal(),\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tconst shippingPrice = getShippingPrice();\r\n\r\n\t\tif (isShipping()) {\r\n\t\t\tbreakdown.shipping = {\r\n\t\t\t\tcurrency_code: currency,\r\n\t\t\t\tvalue: shippingPrice,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\tamount: getAmount(orgSalesTax),\r\n\t\t\t\titems,\r\n\t\t\t\tpayee: getPayee(),\r\n\t\t\t\tpayer: getPayer(),\r\n\t\t\t},\r\n\t\t];\r\n\t};\r\n\r\n\tconst getAmount = taxRate => {\r\n\t\tconst itemTotal = getFixedTotal();\r\n\r\n\t\tconst breakdown = {\r\n\t\t\titem_total: {\r\n\t\t\t\tcurrency_code: currency,\r\n\t\t\t\tvalue: itemTotal,\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tconst shippingPrice = getShippingPrice();\r\n\t\tif (isShipping()) {\r\n\t\t\tbreakdown.shipping = {\r\n\t\t\t\tcurrency_code: currency,\r\n\t\t\t\tvalue: shippingPrice,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (taxRate && taxRate.totalRate) {\r\n\t\t\tbreakdown.tax_total = {\r\n\t\t\t\tcurrency_code: currency,\r\n\t\t\t\tvalue: getTax(),\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tvalue: getOrderTotal(taxRate),\r\n\t\t\tbreakdown,\r\n\t\t\tcurrency_code: currency,\r\n\t\t};\r\n\t};\r\n\r\n\tconst getPayee = function() {\r\n\t\t// If we can't find an email address an empty string prevent paypal from loading\r\n\t\t// and sending money to us\r\n\t\tconst paypalEmailAddress =\r\n\t\t\tbooksellerAppSettings[appSettingsByKey.paypalEmailAddress] || '';\r\n\t\treturn {\r\n\t\t\temail_address: paypalEmailAddress,\r\n\t\t};\r\n\t};\r\n\r\n\tconst getPayer = function() {\r\n\t\treturn {\r\n\t\t\tname: {\r\n\t\t\t\tgiven_name: getFirstName(),\r\n\t\t\t\tsurname: getLastName(),\r\n\t\t\t},\r\n\t\t\temail_address: emailAddress,\r\n\t\t};\r\n\t};\r\n\r\n\tconst getPurchaseUnitsItems = () => {\r\n\t\treturn titles.map(t => {\r\n\t\t\tconst titleAmount = amountsBySku[t.sku][0];\r\n\t\t\tconst item = {\r\n\t\t\t\tunit_amount: {\r\n\t\t\t\t\tcurrency_code: currency,\r\n\t\t\t\t\tvalue: titleAmount,\r\n\t\t\t\t},\r\n\t\t\t\tsku: t.sku,\r\n\t\t\t\tname: t.name,\r\n\t\t\t\tquantity: t.quantity,\r\n\t\t\t\tcategory: 'PHYSICAL_GOODS',\r\n\t\t\t};\r\n\r\n\t\t\treturn item;\r\n\t\t});\r\n\t};\r\n\r\n\tconst doUseStoreSalesTaxRates = shippingAddress =>\r\n\t\torgSalesTax.originDestination === 'O' &&\r\n\t\tshippingAddress.state === stateAbbreviation;\r\n\r\n\tconst getNewTaxRate = (shippingAddress, destinationTaxRates) => {\r\n\t\tconst { salesTax, useTax } = destinationTaxRates;\r\n\t\tif (shippingAddress.state === stateAbbreviation) {\r\n\t\t\treturn salesTax;\r\n\t\t} else {\r\n\t\t\treturn useTax.originDestination === 'O' ? orgUseTax : useTax;\r\n\t\t}\r\n\t};\r\n\r\n\tconst getShippingAddressCountryCode = ({ country_code }) => {\r\n\t\tif (country_code === 'GB') {\r\n\t\t\treturn 'UK';\r\n\t\t}\r\n\r\n\t\treturn country_code;\r\n\t};\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t 0) {\r\n\t\t\t\t\t\t\treturn actions.order.patch([\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\top: 'replace',\r\n\t\t\t\t\t\t\t\t\tpath:\r\n\t\t\t\t\t\t\t\t\t\t\"/purchase_units/@reference_id=='default'/amount\",\r\n\t\t\t\t\t\t\t\t\tvalue: getAmount(taxRate),\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} else {\r\n\t\t\t\t\t\t\treturn actions.resolve();\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 { useHistory } from 'react-router-dom';\r\nimport BagOrderTitleSummaries from '../Bag/UI/BagOrderTitleSummaries';\r\nimport { useBagDataStore } from '../Bag/data/BagDataStore';\r\nimport useBagDataTotalAmount from '../Bag/data/useBagDataTotalAmount';\r\nimport { useOrganizationDataStore } from '../data/OrganizationDataStore';\r\nimport { Modal, Result, Form, Radio } from 'antd';\r\nimport OrderLaneContainer from './UI/OrderLaneContainer';\r\nimport './orderPage.css';\r\nimport LocalizedPrice from '../Localization/LocalizedPrice';\r\nimport { DeliveryMode } from '../../orders/DeliveryMode';\r\nimport OrderTotalBreakdown from './OrderTotalBreakdown';\r\nimport PayPalOrderButton from './PayPalOrderButton';\r\nimport useTaxes from '../hooks/useTaxes';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { PropTypes } from 'prop-types';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nOrderPage.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction OrderPage({ isMobile }) {\r\n\tconst bagDataStore = useBagDataStore();\r\n\tconst bagDataTotalAmount = useBagDataTotalAmount();\r\n\tconst { getFixedTotal } = bagDataTotalAmount;\r\n\r\n\tconst {\r\n\t\tstate: orgDataStoreState,\r\n\t\tgetOrgCountry,\r\n\t\tgetOrgShippingMethods,\r\n\t} = useOrganizationDataStore();\r\n\tconst { zip, city, state: stateProvince } = orgDataStoreState.organization;\r\n\r\n\tconst { getLocationTaxRate } = useTaxes();\r\n\tconst [orgTaxRate, setOrgTaxRate] = React.useState(null);\r\n\tconst { salesTax: orgSalesTax, useTax: orgUseTax } = orgTaxRate || {\r\n\t\tsalesTax: null,\r\n\t\tuseTax: null,\r\n\t};\r\n\r\n\tconst shippingMethods = getOrgShippingMethods();\r\n\tconst hasShippingMethods = shippingMethods && shippingMethods.length > 0;\r\n\r\n\tconst history = useHistory();\r\n\r\n\tconst [isVisible, setIsVisible] = React.useState(false);\r\n\tconst [error, setError] = React.useState({});\r\n\r\n\tconst firstShippingMethod = hasShippingMethods ? shippingMethods[0].id : -1;\r\n\tconst [shippingMethod, setShippingMethod] = React.useState(\r\n\t\tfirstShippingMethod,\r\n\t);\r\n\r\n\tconst defaultDeliveryChoice = hasShippingMethods\r\n\t\t? DeliveryMode.HomeDelivery\r\n\t\t: DeliveryMode.Pickup;\r\n\r\n\tconst [deliveryChoice, setDeliveryChoice] = React.useState(\r\n\t\tdefaultDeliveryChoice,\r\n\t);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tgetLocationTaxRate({ postalCode: zip, city, stateProvince }).then(\r\n\t\t\tres => {\r\n\t\t\t\tsetOrgTaxRate(\r\n\t\t\t\t\tres || {\r\n\t\t\t\t\t\tsalesTax: null,\r\n\t\t\t\t\t\tuseTax: null,\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\t// eslint-disable-next-line\r\n\t}, []);\r\n\r\n\tconst getShippingPrice = shipping => {\r\n\t\tlet price = 0;\r\n\t\tconst anyItemType = 0;\r\n\t\tif (isShipping()) {\r\n\t\t\tconst shippingItemFee =\r\n\t\t\t\tshipping.shippingItemFees &&\r\n\t\t\t\tshipping.shippingItemFees.find(\r\n\t\t\t\t\tfee => fee.itemType === anyItemType,\r\n\t\t\t\t);\r\n\r\n\t\t\tif (typeof shippingItemFee === 'undefined') {\r\n\t\t\t\tprice = shipping.price;\r\n\t\t\t} else {\r\n\t\t\t\tvar items = bagDataStore.getTitles();\r\n\t\t\t\tvar itemCount = items.reduce(function(total, item) {\r\n\t\t\t\t\treturn total + item.quantity;\r\n\t\t\t\t}, 0);\r\n\t\t\t\tprice =\r\n\t\t\t\t\tshipping.price + itemCount * shippingItemFee.shippingFee;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Number(price.toFixed(2));\r\n\t};\r\n\r\n\tconst getSelectedShippingPrice = () => {\r\n\t\tconst shipping = shippingMethods.find(sm => sm.id === shippingMethod);\r\n\r\n\t\treturn getShippingPrice(shipping);\r\n\t};\r\n\r\n\tconst isShipping = () => {\r\n\t\treturn deliveryChoice === DeliveryMode.HomeDelivery;\r\n\t};\r\n\r\n\tconst onChangeDelivery = e => {\r\n\t\tsetDeliveryChoice(e.target.value);\r\n\t};\r\n\r\n\tconst renderDeliveryOrPickupRadios = () => {\r\n\t\tconst radioStyle = {\r\n\t\t\tdisplay: 'block',\r\n\t\t\theight: '30px',\r\n\t\t\tlineHeight: '30px',\r\n\t\t};\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstyle={{ marginBottom: -3 }}\r\n\t\t\t\t\trequired\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{hasShippingMethods && (\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\tconst onChangeShipping = e => {\r\n\t\tsetShippingMethod(e.target.value);\r\n\t};\r\n\r\n\tconst renderShippingMethodRadio = () => {\r\n\t\tif (!isShipping()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst radioStyle = {\r\n\t\t\tdisplay: 'block',\r\n\t\t\theight: '30px',\r\n\t\t\tlineHeight: '30px',\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t}\r\n\t\t\t\t\tstyle={{ marginBottom: -3 }}\r\n\t\t\t\t\trequired\r\n\t\t\t\t/>\r\n\t\t\t\t\r\n\t\t\t\t\t{shippingMethods.map(so => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{so.name} -{' '}\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\tconst onModalOk = () => {\r\n\t\tsetIsVisible(false);\r\n\t\thistory.push('/explore');\r\n\t};\r\n\r\n\tconst getTax = taxRate => {\r\n\t\tif (!taxRate) {\r\n\t\t\ttaxRate = orgSalesTax;\r\n\t\t}\r\n\t\tif (!taxRate || !taxRate.totalRate) {\r\n\t\t\treturn 0.0;\r\n\t\t}\r\n\t\tconst orderTotal = Number(getFixedTotal());\r\n\t\tlet taxCost = orderTotal * taxRate.totalRate;\r\n\r\n\t\tif (taxRate.isFreightTaxable) {\r\n\t\t\tconst shippingPrice = getSelectedShippingPrice();\r\n\t\t\ttaxCost += shippingPrice * taxRate.totalRate;\r\n\t\t}\r\n\r\n\t\treturn Number(taxCost.toFixed(2));\r\n\t};\r\n\r\n\tconst getOrderTotal = taxRate => {\r\n\t\tlet orderTotal = Number(getFixedTotal());\r\n\r\n\t\tconst shippingPrice = getSelectedShippingPrice();\r\n\t\torderTotal += shippingPrice;\r\n\r\n\t\tconst tax = getTax(taxRate);\r\n\t\torderTotal += tax;\r\n\r\n\t\treturn orderTotal.toFixed(2);\r\n\t};\r\n\r\n\tconst renderCompletePaypalOrder = () => {\r\n\t\treturn (\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\r\n\t\t);\r\n\t};\r\n\r\n\tconst bagHasItems = bagDataStore.hasItems();\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{bagHasItems && renderDeliveryOrPickupRadios()}\r\n\t\t\t\t\t{bagHasItems && renderShippingMethodRadio()}\r\n\t\t\t\t\t{bagHasItems && renderCompletePaypalOrder()}\r\n\t\t\t\t
\r\n\t\t\t
\r\n\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\tonOk={onModalOk}>\r\n\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\tsubTitle={\r\n\t\t\t\t\t\terror.exists ? 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\nexport default withIsMobile(OrderPage);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport { useAuth } from './AuthProvider';\r\nimport { useCustomerID } from '../data/CustomerIDStore';\r\nimport { useBooksellerLogoDataStore } from '../data/BooksellerLogoStore';\r\nimport { useOrganizationDataStore } from '../data/OrganizationDataStore';\r\nimport { useCustomerSummaryDataStore } from '../data/CustomerSummaryDataStore';\r\nimport {\r\n\tuseBooksellerPreferencesDataStore,\r\n\tappSettingsByKey,\r\n} from '../data/BooksellerPreferencesDataStore';\r\n\r\nLogin.propTypes = {\r\n\tgoToSignUp: PropTypes.bool,\r\n};\r\n\r\nLogin.defaultProps = {\r\n\tgoToSignUp: false,\r\n};\r\n\r\nfunction Login({ returnUri, goToSignUp }) {\r\n\tconst { orgId } = useCustomerID();\r\n\tconst { loginWithRedirect } = useAuth();\r\n\r\n\tconst { getOrgName } = useOrganizationDataStore();\r\n\tconst { getEmailAddress } = useCustomerSummaryDataStore();\r\n\r\n\tconst { getLogoUri } = useBooksellerLogoDataStore();\r\n\tconst { getAppSettingAtKey } = useBooksellerPreferencesDataStore();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst customer = {\r\n\t\t\temail: getEmailAddress(),\r\n\t\t};\r\n\r\n\t\tconst tenant = {\r\n\t\t\torgId,\r\n\t\t\tname: getOrgName(),\r\n\t\t\tlogoImage: getLogoUri(),\r\n\t\t\tbackgroundImage: getAppSettingAtKey(\r\n\t\t\t\tappSettingsByKey.loginPageImage,\r\n\t\t\t),\r\n\t\t};\r\n\r\n\t\tloginWithRedirect({\r\n\t\t\tacr_values: 'tenant:' + tenant.orgId,\r\n\t\t\tlogin_hint: customer.email,\r\n\t\t\tstate: {\r\n\t\t\t\torgId: tenant.orgId,\r\n\t\t\t\treturnUri: returnUri || '/',\r\n\t\t\t},\r\n\t\t\textraQueryParams: {\r\n\t\t\t\ttenant: btoa(JSON.stringify(tenant)),\r\n\t\t\t\tsignup: goToSignUp,\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\r\n\treturn ;\r\n}\r\n\r\nexport default Login;\r\n","import { useEffect } from 'react';\r\nimport { useAuth } from './AuthProvider';\r\n\r\nexport default function Logout() {\r\n\tconst { isAuthenticated, logoutWithRedirect } = useAuth();\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isAuthenticated) return;\r\n\r\n\t\tlogoutWithRedirect();\r\n\t});\r\n\r\n\treturn null;\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { connectToTransactions } from '../../data/TransactionsDataStore';\r\nimport TitleJacketImage from '../../Title/UI/TitleJacketImage';\r\nimport { Spin, Rate, Button } from 'antd';\r\nimport TitleDetailDrawer from '../../Title/TitleDetailDrawer';\r\nimport './purchaseDetail.css';\r\nimport { getAuthorDisplayNameAndInitials } from '../../../author/author.utils';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass PurchaseDetail extends React.Component {\r\n\tstatic propTypes = {\r\n\t\turi: PropTypes.string,\r\n\t\tposData: PropTypes.object,\r\n\t\trating: PropTypes.object,\r\n\t\tisMobile: PropTypes.func,\r\n\t\ttransactionsDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tif (\r\n\t\t\t!this.props.transactionsDataStore ||\r\n\t\t\tthis.props.transactionsDataStore.isLoading()\r\n\t\t) {\r\n\t\t\treturn this.renderLoading();\r\n\t\t}\r\n\t\treturn this.renderPurchaseDetailUI();\r\n\t}\r\n\r\n\trenderLoading() {\r\n\t\treturn (\r\n\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...\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\trenderPurchaseDetailUI() {\r\n\t\tconst { transactionsDataStore, rating, posData, uri } = this.props;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\tconst author =\r\n\t\t\tposData.author &&\r\n\t\t\tgetAuthorDisplayNameAndInitials(posData.author).displayName;\r\n\r\n\t\treturn (\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\r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
{posData.title}
\r\n\t\t\t\t\t\t{author && (\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{transactionsDataStore &&\r\n\t\t\t\t\t\ttransactionsDataStore.includes(posData.sku) && (\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{transactionsDataStore.countTransactions(\r\n\t\t\t\t\t\t\t\t\tposData.sku,\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{rating ? (\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\t\t\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\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 connectToTransactions(withIsMobile(PurchaseDetail));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { connectToTransactions } from '../../data/TransactionsDataStore';\r\nimport PurchaseDetail from './PurchaseDetail';\r\nimport { connectToRatingsAndReviews } from '../../data/RatingsAndReviewsDataStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass MyPurchases extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tpurchases: PropTypes.array,\r\n\t\tpurchasePosData: PropTypes.object,\r\n\t\tpurchaseUris: PropTypes.object,\r\n\t\treviews: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst {\r\n\t\t\tpurchases,\r\n\t\t\tpurchasePosData,\r\n\t\t\tpurchaseUris,\r\n\t\t\treviews,\r\n\t\t} = this.props;\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t ({purchases.length || 0})\r\n\t\t\t\t
\r\n\t\t\t\t{purchases.length &&\r\n\t\t\t\t\tpurchases.map((purchase, index) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\tpurchasePosData[purchase.sku] && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\trating.entityId === purchase.sku,\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\tposData={purchasePosData[purchase.sku][0]}\r\n\t\t\t\t\t\t\t\t\turi={purchaseUris[purchase.sku]}\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\r\nconst withUserPurchases = Component => {\r\n\tconst mapToProps = transactionsDataStore => {\r\n\t\tconst purchases =\r\n\t\t\ttransactionsDataStore.state.transactionsData.transactions;\r\n\t\tconst purchasePosData =\r\n\t\t\ttransactionsDataStore.state.transactionsData.skuPosData;\r\n\t\tconst purchaseUris =\r\n\t\t\ttransactionsDataStore.state.transactionsData.skuUris;\r\n\t\treturn {\r\n\t\t\tpurchases,\r\n\t\t\tpurchasePosData,\r\n\t\t\tpurchaseUris,\r\n\t\t};\r\n\t};\r\n\treturn connectToTransactions(Component, mapToProps);\r\n};\r\n\r\nconst withUserReviews = Component => {\r\n\tconst mapToProps = ratingsAndReviewsDataStore => {\r\n\t\tconst reviews = ratingsAndReviewsDataStore.state.reviews;\r\n\t\treturn {\r\n\t\t\treviews,\r\n\t\t};\r\n\t};\r\n\treturn connectToRatingsAndReviews(Component, mapToProps);\r\n};\r\n\r\nconst connectors = [withUserReviews, withUserPurchases];\r\n\r\nexport default combineConnectors(connectors)(MyPurchases);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport DrawerAnchor from '../../UI/DrawerAnchor';\r\nimport MyPurchases from './MyPurchases';\r\nimport { AuthContext } from '../../Auth/AuthProvider';\r\nimport { Modal, Spin, Result } from 'antd';\r\nimport delay from '../../../util/delay';\r\nimport { withRouter } from 'react-router-dom';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst AuthConsumer = AuthContext.Consumer;\r\n\r\nclass MyPurchasesDrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\r\n\t};\r\n\r\n\tstate = {\r\n\t\tisRedirecting: false,\r\n\t\tisVisible: false,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{auth => {\r\n\t\t\t\t\tif (auth && auth.isAuthenticated) {\r\n\t\t\t\t\t\treturn this.renderDrawerAnchor();\r\n\t\t\t\t\t}\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\tthis.setState({ isVisible: true })\r\n\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t{this.props.children}\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{this.renderRegistrationModal()}\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\trenderDrawerAnchor() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderRegistrationModal = () => {\r\n\t\tconst { isRedirecting, isVisible } = this.state;\r\n\t\treturn (\r\n\t\t\t}\r\n\t\t\t\tokText={}\r\n\t\t\t\tcancelText={}\r\n\t\t\t\tonOk={this.redirectToLoginPage}\r\n\t\t\t\tonCancel={() => this.setState({ isVisible: false })}>\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\r\n\t\t\t\r\n\t\t);\r\n\t};\r\n\r\n\tredirectToLoginPage = async () => {\r\n\t\tconst { history } = this.props;\r\n\r\n\t\tthis.setState({ isRedirecting: true });\r\n\t\tawait delay(900);\r\n\r\n\t\tthis.setState({ isVisible: false });\r\n\t\tawait delay(500);\r\n\r\n\t\thistory.push('/login');\r\n\t};\r\n\r\n\trenderDrawerContent = drawer => {\r\n\t\treturn drawer.isVisible && ;\r\n\t};\r\n}\r\n\r\nexport default withRouter(withIsMobile(MyPurchasesDrawerAnchor));\r\n","import React from 'react';\r\nimport { useAuth } from '../../Auth/AuthProvider';\r\nimport { Link } from 'react-router-dom';\r\nimport { Icon } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { Translate } from 'react-localize-redux';\r\nimport './authAnchor.css';\r\n\r\nfunction AuthAnchor({ isMobile }) {\r\n\tconst { isAuthenticated } = useAuth();\r\n\r\n\treturn isAuthenticated ? (\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\t\t
\r\n\t\t\t\r\n\t\t\t\t{' '}\r\n\t\t\t\t
\r\n\t\t\t\t\t{!isMobile() && }\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 withIsMobile(AuthAnchor);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Avatar } from 'antd';\r\n\r\nCustomerAvatar.propTypes = {\r\n\tsize: PropTypes.number,\r\n};\r\n\r\nexport default function CustomerAvatar({ size }) {\r\n\treturn ;\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { useCustomerSummaryDataStore } from '../../data/CustomerSummaryDataStore';\r\nimport AuthAnchor from '../Auth/AuthAnchor';\r\nimport CustomerAvatar from './CustomerAvatar';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { useBooksellerPreferencesDataStore } from '../../data/BooksellerPreferencesDataStore';\r\n\r\nCustomerHeader.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction CustomerHeader({ isMobile }) {\r\n\tconst { getFullName, getEmailAddress } = useCustomerSummaryDataStore();\r\n\tconst { getGradient } = useBooksellerPreferencesDataStore();\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
{getFullName()}
\r\n\t\t\t\t
{getEmailAddress()}
\r\n\t\t\t\t{isMobile() && }\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(CustomerHeader);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport TitleJacketImage from '../../Title/UI/TitleJacketImage';\r\nimport { Button, Rate } from 'antd';\r\nimport CustomerAvater from '../UI/CustomerAvatar';\r\nimport TitleDetailDrawer from '../../Title/TitleDetailDrawer';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass ReviewDetail extends React.Component {\r\n\tstatic propTypes = {\r\n\t\treview: PropTypes.object,\r\n\t\trating: PropTypes.object,\r\n\t\tposData: PropTypes.array,\r\n\t\turi: PropTypes.string,\r\n\t\tisMobile: PropTypes.func,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { posData, uri, review, rating } = this.props;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\r\n\t\treturn Array.isArray(posData) && posData.length ? (\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\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
\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{rating && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{review ? (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{review.review}\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\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) : null;\r\n\t}\r\n}\r\n\r\nexport default withIsMobile(ReviewDetail);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReviewDetail from './ReviewDetail';\r\nimport { connectToRatingsAndReviews } from '../../data/RatingsAndReviewsDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass MyReviews extends React.Component {\r\n\tstatic propTypes = {\r\n\t\treviews: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { reviews } = this.props;\r\n\t\tconst reviewSkus = reviews.productsBySku\r\n\t\t\t? Object.keys(reviews.productsBySku)\r\n\t\t\t: [];\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t ({reviewSkus.length || 0})\r\n\t\t\t\t
\r\n\t\t\t\t{reviewSkus.map((sku, index) => (\r\n\t\t\t\t\t rating.entityId === sku,\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\treview={reviews.customerReviews.find(\r\n\t\t\t\t\t\t\treview => review.entityId === sku,\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\tposData={reviews.skuPosData[sku]}\r\n\t\t\t\t\t\turi={reviews.productImageUrisBySku[sku]}\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\nconst withUserReviews = Component => {\r\n\tconst mapToProps = ratingsAndReviewsDataStore => {\r\n\t\tconst reviews = ratingsAndReviewsDataStore.state.reviews;\r\n\t\treturn {\r\n\t\t\treviews,\r\n\t\t};\r\n\t};\r\n\treturn connectToRatingsAndReviews(Component, mapToProps);\r\n};\r\n\r\nexport default withUserReviews(MyReviews);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport DrawerAnchor from '../../UI/DrawerAnchor';\r\nimport MyReviews from './MyReviews';\r\n\r\nclass MyReviewsDrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderDrawerContent = drawer => {\r\n\t\treturn drawer.isVisible && ;\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(MyReviewsDrawerAnchor);\r\n","import React from 'react';\r\nimport { Form, Radio, Input, Button } from 'antd';\r\nimport { DeliveryMode } from '../../../orders/DeliveryMode';\r\nimport PropTypes from 'prop-types';\r\nimport { connectToOrg } from '../../data/OrganizationDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nclass MyOrderPreferences extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tform: PropTypes.object,\r\n\t\torgDataStore: PropTypes.object,\r\n\t};\r\n\r\n\tstate = { shippingMethod: {}, deliveryChoice: {} };\r\n\r\n\tonChange = e => {\r\n\t\tthis.setState({\r\n\t\t\t[e.target.name]: e.target.value,\r\n\t\t});\r\n\t};\r\n\r\n\thandleSubmit = e => {\r\n\t\te.preventDefault();\r\n\t\tthis.props.form.validateFieldsAndScroll();\r\n\t};\r\n\r\n\tgetPlaceholder = (translate, id) => {\r\n\t\treturn translate(id);\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { getFieldDecorator } = this.props.form;\r\n\t\tconst { orgDataStore } = this.props;\r\n\t\tconst shippingMethods = orgDataStore.getOrgShippingMethods();\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{({ translate }) => {\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\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{this.renderDeliveryOrPickupRadios()}\r\n\t\t\t\t\t\t\t\t{shippingMethods.length\r\n\t\t\t\t\t\t\t\t\t? this.renderShippingMethodRadio(\r\n\t\t\t\t\t\t\t\t\t\t\tshippingMethods,\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\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{getFieldDecorator('firstName', {\r\n\t\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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{getFieldDecorator('lastName', {\r\n\t\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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\t\r\n\t\t\t\t\t\t\t\t\t{getFieldDecorator('address1', {\r\n\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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\t\r\n\t\t\t\t\t\t\t\t\t{getFieldDecorator('address2')(\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\t\r\n\t\t\t\t\t\t\t\t\t{getFieldDecorator('city', {\r\n\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{getFieldDecorator('state', {\r\n\t\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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{getFieldDecorator('zipCode', {\r\n\t\t\t\t\t\t\t\t\t\t\trules: [\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\trequired: true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmessage: (\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\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\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\trenderDeliveryOrPickupRadios = () => {\r\n\t\tconst radioStyle = {\r\n\t\t\tdisplay: 'block',\r\n\t\t\theight: '30px',\r\n\t\t\tlineHeight: '30px',\r\n\t\t};\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstyle={{ marginBottom: -3 }}\r\n\t\t\t\t\trequired\r\n\t\t\t\t/>\r\n\t\t\t\t this.onChange(e)}>\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\trenderShippingMethodRadio = shippingMethods => {\r\n\t\tconst radioStyle = {\r\n\t\t\tdisplay: 'block',\r\n\t\t\theight: '30px',\r\n\t\t\tlineHeight: '30px',\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tstyle={{ marginBottom: -3 }}\r\n\t\t\t\t\trequired\r\n\t\t\t\t/>\r\n\t\t\t\t this.onChange(e)}>\r\n\t\t\t\t\t{shippingMethods.map((method, i) => {\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{method.name} \r\n\t\t\t\t\t\t\t\t-${method.price}\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 MyOrderPreferences = Form.create({})(\r\n\tconnectToOrg(MyOrderPreferences),\r\n);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport DrawerAnchor from '../../UI/DrawerAnchor';\r\nimport MyOrderPreferences from './MyOrderPreferences';\r\n\r\nclass MyOrderPreferencesDrawerAnchor extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tchildren: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{this.props.children}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\trenderDrawerContent = drawer => {\r\n\t\treturn drawer.isVisible && ;\r\n\t};\r\n}\r\n\r\nexport default withIsMobile(MyOrderPreferencesDrawerAnchor);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Icon } from 'antd';\r\nimport './accountAnchor.less';\r\n\r\nAccountAnchor.propTypes = {\r\n\tlabel: PropTypes.object,\r\n\tcount: PropTypes.number,\r\n};\r\n\r\nAccountAnchor.defaultProps = {\r\n\tcount: 0,\r\n};\r\n\r\nexport default function AccountAnchor({ label, count }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t{label}\r\n\t\t\t
\r\n\t\t\t\t{count}\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 PropTypes from 'prop-types';\r\nimport MyPurchasesDrawerAnchor from './Purchases/MyPurchasesDrawerAnchor';\r\nimport { connectToTransactions } from '../data/TransactionsDataStore';\r\nimport CustomerHeader from './UI/CustomerHeader';\r\nimport RewardsProgress from '../Rewards/RewardsProgress';\r\nimport { withIsDemoBookstore } from '../data/CustomerIDStore.js';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport MyReviewsDrawerAnchor from './Reviews/MyReviewsDrawerAnchor';\r\nimport MyOrderPerferencesDrawerAnchor from './OrderPerferences/MyOrderPerferencesDrawerAnchor';\r\nimport { Collapse, Icon, Tooltip } from 'antd';\r\nimport AuthorFavoritesLane from '../CustomerFavorites/AuthorFavorites/AuthorFavoritesLane';\r\nimport TitleFavoritesLane from '../CustomerFavorites/TitleFavorites/TitleFavoritesLane';\r\nimport SeriesFavoritesLane from '../CustomerFavorites/SeriesFavorites/SeriesFavoritesLane';\r\nimport ShelfFavoritesLane from '../CustomerFavorites/ShelfFavorites/ShelfFavoritesLane';\r\nimport CustomerFavoritesDataStore from '../CustomerFavorites/data/CustomerFavoritesDataStore';\r\nimport CustomerFavoritesService from '../CustomerFavorites/CustomerFavoritesService';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport AuthAnchor from './Auth/AuthAnchor';\r\nimport AccountAnchor from './UI/AccountAnchor';\r\nimport { connectToRatingsAndReviews } from '../data/RatingsAndReviewsDataStore';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport WishlistSkusDataStore from '../Wishlist/data/WishlistSkusDataStore';\r\nimport './accountPage.less';\r\n\r\nconst { Panel } = Collapse;\r\n\r\nclass AccountPage extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tpurchases: PropTypes.arrayOf(PropTypes.object),\r\n\t\treviews: PropTypes.object,\r\n\t\tisDemoBookstore: PropTypes.bool,\r\n\t\tpreferencesDataStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst {\r\n\t\t\tpurchases,\r\n\t\t\tisDemoBookstore,\r\n\t\t\treviews,\r\n\t\t\tpreferencesDataStore,\r\n\t\t} = this.props;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\tconst gradient = preferencesDataStore.getGradient();\r\n\r\n\t\treturn (\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\t{isDemoBookstore ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : !isMobile ? (\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\t\tcount={0}\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}\r\n\t\t\t\t\t\t\t\t\t\t\tcount={0}\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
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{!isMobile && }\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\tcount={\r\n\t\t\t\t\t\t\t\t\t\treviews.productsBySku &&\r\n\t\t\t\t\t\t\t\t\t\tObject.keys(reviews.productsBySku)\r\n\t\t\t\t\t\t\t\t\t\t\t.length\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\t}\r\n\t\t\t\t\t\t\t\t\tcount={purchases.length}\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{isDemoBookstore && (\r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\n\t\t);\r\n\t}\r\n}\r\n\r\nconst withUserTransactions = Component => {\r\n\tconst mapToProps = transactionsDataStore => {\r\n\t\tconst purchases =\r\n\t\t\ttransactionsDataStore.state.transactionsData.transactions;\r\n\t\treturn {\r\n\t\t\tpurchases,\r\n\t\t};\r\n\t};\r\n\treturn connectToTransactions(Component, mapToProps);\r\n};\r\n\r\nconst withUserReviews = Component => {\r\n\tconst mapToProps = ratingsAndReviewsDataStore => {\r\n\t\tconst reviews = ratingsAndReviewsDataStore.state.reviews;\r\n\t\treturn {\r\n\t\t\treviews,\r\n\t\t};\r\n\t};\r\n\treturn connectToRatingsAndReviews(Component, mapToProps);\r\n};\r\n\r\nconst connectors = [\r\n\twithIsDemoBookstore,\r\n\twithUserTransactions,\r\n\twithUserReviews,\r\n\tconnectToSellerPreferences,\r\n];\r\n\r\nexport default combineConnectors(connectors)(withIsMobile(AccountPage));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class IframeRenderer extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tcontent: PropTypes.string.isRequired,\r\n\t\twidth: PropTypes.number,\r\n\t\theight: PropTypes.number,\r\n\t\tstyle: PropTypes.object,\r\n\t\ttitle: PropTypes.string.isRequired,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tstyle: {},\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis._updateIframe();\r\n\t\tthis.refs.iframe.addEventListener('load', this._updateIframe);\r\n\t}\r\n\r\n\t_updateIframe = () => {\r\n\t\tconst iframe = this.refs.iframe;\r\n\t\tconst document = iframe.contentDocument;\r\n\t\tdocument.body.innerHTML = this.props.content;\r\n\t};\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Alert } from 'antd';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nexport default class PreviewModeAlert extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tstyle: PropTypes.object,\r\n\t\tonClose: PropTypes.func,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tstyle: {},\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t}\r\n\t\t\t\t\tdescription={}\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 PropTypes from 'prop-types';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { useBagDataStore } from '../data/BagDataStore';\r\nimport { Button } from 'antd';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport './bagAnchor.css';\r\nimport { useBooksellerPreferencesDataStore } from '../../data/BooksellerPreferencesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nBagAnchor.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction BagAnchor({ isMobile }) {\r\n\tconst history = useHistory();\r\n\tconst bagDataStore = useBagDataStore();\r\n\tconst isLoading = bagDataStore.isLoading();\r\n\tconst totalCount = bagDataStore.getTitles().length;\r\n\tconst { getAppSettings } = useBooksellerPreferencesDataStore();\r\n\tconst { headerColor } = getAppSettings();\r\n\r\n\tconst getCountDisplay = () => {\r\n\t\tif (isLoading) return '-';\r\n\t\treturn totalCount;\r\n\t};\r\n\r\n\tconst goToCheckout = () => {\r\n\t\thistory.push('/order');\r\n\t};\r\n\r\n\tconst renderForMobile = () => {\r\n\t\treturn (\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\tconst renderForDesktop = () => {\r\n\t\tconst bagLabel = ;\r\n\t\tconst labelWithCount = (\r\n\t\t\t<>\r\n\t\t\t\t{bagLabel} ({getCountDisplay()})\r\n\t\t\t\r\n\t\t);\r\n\t\treturn (\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\tif (isMobile()) {\r\n\t\treturn renderForMobile();\r\n\t}\r\n\treturn renderForDesktop();\r\n}\r\n\r\nexport default withIsMobile(BagAnchor, 915);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport useActiveRoute from '../hooks/useActiveRoute';\r\n\r\nNavigationAnchorRoot.propTypes = {\r\n\tonClick: PropTypes.func,\r\n\troutes: PropTypes.arrayOf(PropTypes.string),\r\n\talsoMatches: PropTypes.arrayOf(PropTypes.object), // array of RegExp\r\n\tchildren: PropTypes.oneOfType([\r\n\t\tPropTypes.element,\r\n\t\tPropTypes.arrayOf(PropTypes.element),\r\n\t]),\r\n};\r\n\r\nNavigationAnchorRoot.defaultProps = {\r\n\talsoMatches: [],\r\n};\r\n\r\nexport default function NavigationAnchorRoot({\r\n\troutes,\r\n\tchildren,\r\n\tonClick,\r\n\talsoMatches,\r\n}) {\r\n\tconst { isAnyRouteActive, isAnyMatchActive } = useActiveRoute(\r\n\t\troutes,\r\n\t\talsoMatches,\r\n\t);\r\n\r\n\tconst activeName = 'nav-anchor-active';\r\n\r\n\tconst isNavAnchorActive = () => {\r\n\t\treturn isAnyRouteActive() || isAnyMatchActive();\r\n\t};\r\n\r\n\tconst baseName = 'footer-navigation-anchor column';\r\n\tconst isActive = isNavAnchorActive();\r\n\r\n\tconst className = isActive ? `${baseName} ${activeName}` : baseName;\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 { useLocation } from 'react-router-dom';\r\n\r\nexport default function useActiveRoute(routesToCheck = [], alsoMatches = []) {\r\n\tconst { pathname } = useLocation();\r\n\r\n\tconst isAnyMatchActive = () => {\r\n\t\tfor (let i = 0; i < alsoMatches.length; i++) {\r\n\t\t\tif (alsoMatches[i].test(pathname)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tconst isAnyRouteActive = () => {\r\n\t\tconst predicate = r => pathname.indexOf(r) > -1;\r\n\t\tconst activeRoutes = routesToCheck.filter(predicate);\r\n\t\treturn activeRoutes.length > 0;\r\n\t};\r\n\r\n\treturn {\r\n\t\tisAnyRouteActive,\r\n\t\tisAnyMatchActive,\r\n\t\tisActive: route => pathname === route,\r\n\t};\r\n}\r\n","export default __webpack_public_path__ + \"static/media/stacked_books.be78b2ab.png\";","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Modal, Button } from 'antd';\r\nimport { useBooksellerContentDataStore } from '../data/BooksellerContentDataStore';\r\nimport { Translate, withLocalize } from 'react-localize-redux';\r\nimport { Link, useLocation } from 'react-router-dom';\r\nimport { paths } from '../../paths';\r\nimport stackedBooksImage from '../../assets/images/stacked_books.png';\r\nimport './signUpModal.less';\r\n\r\nSignUpModal.propTypes = {\r\n\tdoRenderLearnMoreButton: PropTypes.bool,\r\n\tisVisibleAtRender: PropTypes.bool,\r\n\ttranslate: PropTypes.func,\r\n};\r\n\r\nSignUpModal.defaultProps = {\r\n\tdoRenderLearnMoreButton: true,\r\n\tisVisibleAtRender: true,\r\n};\r\n\r\nfunction SignUpModal({\r\n\tdoRenderLearnMoreButton,\r\n\tisVisibleAtRender,\r\n\ttranslate,\r\n}) {\r\n\tconst { state } = useBooksellerContentDataStore();\r\n\tconst { retailerMessageBody } = state.customerApp;\r\n\tconst location = useLocation();\r\n\tconst isAuthPage = paths.isAuthPage(location.pathname);\r\n\tconst [isVisible, setIsVisible] = React.useState(\r\n\t\tisVisibleAtRender && !isAuthPage && !retailerMessageBody.length > 0,\r\n\t);\r\n\tconst benefitsListItems = [\r\n\t\t{ translationId: 'create_a_wishlist' },\r\n\t\t{ translationId: 'add_to_your_favorites_collection' },\r\n\t\t{ translationId: 'get_better_title_recommendations' },\r\n\t\t{ translationId: 'view_your_reviews_and_past_purchases' },\r\n\t\t{ translationId: 'save_your_order_preferences_for_next_time' },\r\n\t];\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{doRenderLearnMoreButton && (\r\n\t\t\t\t setIsVisible(true)}\r\n\t\t\t\t\tclassName=\"learn-more-button\">\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t setIsVisible(false)}\r\n\t\t\t\ttitle={}\r\n\t\t\t\tvisible={isVisible}\r\n\t\t\t\tfooter={null}>\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
\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t{benefitsListItems.map((item, idx) => (\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\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\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 withLocalize(SignUpModal);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button, Popover } from 'antd';\r\nimport { Link, useLocation } from 'react-router-dom';\r\nimport { paths } from '../../paths';\r\nimport { Translate } from 'react-localize-redux';\r\nimport SignUpModal from '../UI/SignUpModal';\r\nimport { useBooksellerContentDataStore } from '../data/BooksellerContentDataStore';\r\nimport { useWithIsMobile } from '../hoc/withIsMobile';\r\nimport './signUpPopover.less';\r\n\r\nSignUpPopover.propTypes = {\r\n\tchildren: PropTypes.object,\r\n};\r\n\r\nfunction SignUpPopover({ children }) {\r\n\tconst { isMobile } = useWithIsMobile();\r\n\tconst { state } = useBooksellerContentDataStore();\r\n\tconst { retailerMessageBody } = state.customerApp;\r\n\tconst location = useLocation();\r\n\tconst isAuthPage = paths.isAuthPage(location.pathname);\r\n\tconst [isVisible, setIsVisible] = React.useState(\r\n\t\t!isAuthPage && retailerMessageBody.length > 0,\r\n\t);\r\n\r\n\tconst content = (\r\n\t\t
\r\n\t\t\t setIsVisible(false)}\r\n\t\t\t\tclassName=\"close-button\"\r\n\t\t\t\tshape=\"circle\">\r\n\t\t\t\tX\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
setIsVisible(false)}>\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\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
setIsVisible(true)}>{children}
\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default SignUpPopover;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Link } from 'react-router-dom';\r\nimport NavigationAnchorRoot from './NavigationAnchorRoot';\r\nimport { paths } from '../../paths';\r\nimport SignUpPopover from './SignUpPopover';\r\nimport SignUpModal from '../UI/SignUpModal';\r\nimport {\r\n\tappSettingsByKey,\r\n\tuseBooksellerPreferencesDataStore,\r\n} from '../data/BooksellerPreferencesDataStore';\r\n\r\nNavigationAnchor.propTypes = {\r\n\ticon: PropTypes.string,\r\n\tlabel: PropTypes.object,\r\n\tlinkTo: PropTypes.string,\r\n\talsoMatches: PropTypes.arrayOf(PropTypes.object), // array of RegExp\r\n};\r\n\r\nNavigationAnchor.defaultProps = {\r\n\talsoMatches: [],\r\n};\r\n\r\nexport default function NavigationAnchor({ icon, label, linkTo, alsoMatches }) {\r\n\tconst { getAppSettingAtKey } = useBooksellerPreferencesDataStore();\r\n\tconst doShowBookstoreLoyaltyPopup = getAppSettingAtKey(\r\n\t\tappSettingsByKey.doShowBookstoreLoyaltyPopup,\r\n\t);\r\n\r\n\tconst renderNavigationLink = () => (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t
{label}
\r\n\t\t\r\n\t);\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{linkTo === paths.signup() && doShowBookstoreLoyaltyPopup ? (\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\r\n\t\t\t) : (\r\n\t\t\t\trenderNavigationLink()\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { paths } from '../../paths';\r\n\r\nexport const LinkName = {\r\n\tShelves: paths.browseShelves(),\r\n\tHome: paths.explore(),\r\n\tEvents: paths.events(),\r\n\tAccount: paths.account(),\r\n\tSignUp: paths.signup(),\r\n};\r\n\r\nconst NavigationItems = {\r\n\tHomeNav: {\r\n\t\ticon: 'compass',\r\n\t\tlabel: ,\r\n\t\tlinkTo: LinkName.Home,\r\n\t},\r\n\tShelvesNav: {\r\n\t\ticon: 'books',\r\n\t\tlabel: ,\r\n\t\tlinkTo: LinkName.Shelves,\r\n\t\talsoMatches: [new RegExp(/\\/section\\/(section|department)\\/\\d+/g)],\r\n\t},\r\n\tEventsNav: {\r\n\t\ticon: 'calendar-num',\r\n\t\tlabel: ,\r\n\t\tlinkTo: LinkName.Events,\r\n\t},\r\n\tAccountNav: {\r\n\t\ticon: 'person',\r\n\t\tlabel: ,\r\n\t\tlinkTo: LinkName.Account,\r\n\t},\r\n\tSignUpNav: {\r\n\t\ticon: 'person',\r\n\t\tlabel: ,\r\n\t\tlinkTo: LinkName.SignUp,\r\n\t},\r\n};\r\n\r\nexport default NavigationItems;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Spin } from 'antd';\r\nimport {\r\n\tconnectToLogo,\r\n\tuseBooksellerLogoDataStore,\r\n} from '../../data/BooksellerLogoStore';\r\nimport {\r\n\tconnectToSellerPreferences,\r\n\tappSettingsByKey,\r\n} from '../../data/BooksellerPreferencesDataStore';\r\nimport combineConnectors from '../../data/combineConnectors';\r\nimport './booksellerLogo.css';\r\nimport { LogoShape } from './LogoShape';\r\nimport withIsMobile from '../../hoc/withIsMobile';\r\nimport { HeaderLayout } from '../../Navigation/HeaderLayout';\r\nimport { useImage } from '../../hooks/useImage';\r\n\r\nfunction LogoImage({ logoUri, height, isMobile, headerLayout }) {\r\n\tconst { hasLoaded, hasError } = useImage(logoUri);\r\n\tconst { setLogoShape } = useBooksellerLogoDataStore();\r\n\tconst logoRef = React.createRef();\r\n\tconst isMobileClassicLayout =\r\n\t\tisMobile && headerLayout === HeaderLayout.classic;\r\n\r\n\tif (hasError) {\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\tsetLogoShape({\r\n\t\t\t\t\t\t\theight: logoRef.current.naturalHeight,\r\n\t\t\t\t\t\t\twidth: logoRef.current.naturalWidth,\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\nclass BooksellerLogo extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tlogoStore: PropTypes.object,\r\n\t\tisLoadingPreferences: PropTypes.bool,\r\n\t\tappHeaderLogoPreferenceUri: PropTypes.string,\r\n\t\tisMobile: PropTypes.func,\r\n\t\theaderLayout: PropTypes.string,\r\n\t};\r\n\r\n\trender() {\r\n\t\treturn (\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\tgetLogoHeight() {\r\n\t\tconst { isMobile, headerLayout } = this.props;\r\n\t\tconst { logoShape } = this.props.logoStore.state;\r\n\t\tif (headerLayout === HeaderLayout.classic) {\r\n\t\t\tif (!isMobile()) {\r\n\t\t\t\tswitch (logoShape) {\r\n\t\t\t\t\tcase LogoShape.square:\r\n\t\t\t\t\t\treturn '110px';\r\n\t\t\t\t\tcase LogoShape.portrait:\r\n\t\t\t\t\t\treturn '130px';\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn '55px';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn '100%';\r\n\t\t}\r\n\r\n\t\tswitch (logoShape) {\r\n\t\t\tcase LogoShape.square:\r\n\t\t\t\treturn isMobile() ? '110px' : '250px';\r\n\t\t\tcase LogoShape.portrait:\r\n\t\t\t\treturn isMobile() ? '110px' : '280px';\r\n\t\t\tdefault:\r\n\t\t\t\treturn isMobile() ? '70px' : '170px';\r\n\t\t}\r\n\t}\r\n\r\n\tgetLogoUri() {\r\n\t\tconst { logoUri } = this.props.logoStore.state;\r\n\t\tconst { appHeaderLogoPreferenceUri } = this.props;\r\n\t\tif (this.isLoading()) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\tif (appHeaderLogoPreferenceUri) {\r\n\t\t\treturn appHeaderLogoPreferenceUri;\r\n\t\t}\r\n\t\treturn logoUri;\r\n\t}\r\n\r\n\tisLoading() {\r\n\t\tconst { isLoadingPreferences, logoStore } = this.props;\r\n\t\treturn isLoadingPreferences || logoStore.state.isLoading;\r\n\t}\r\n}\r\n\r\nconst mapToProps = preferencesDataStore => {\r\n\tconst uriKey = appSettingsByKey.appHeaderLogo;\r\n\tconst uri = preferencesDataStore.getAppSettingAtKey(uriKey);\r\n\tconst layoutKey = appSettingsByKey.headerLayout;\r\n\tconst headerLayout = preferencesDataStore.getAppSettingAtKey(layoutKey);\r\n\treturn {\r\n\t\tisLoadingPreferences: preferencesDataStore.isLoading(),\r\n\t\tappHeaderLogoPreferenceUri: uri && typeof uri === 'string' ? uri : null,\r\n\t\theaderLayout,\r\n\t};\r\n};\r\n\r\nconst connectors = [\r\n\twithIsMobile,\r\n\tconnectToLogo,\r\n\tC => connectToSellerPreferences(C, mapToProps),\r\n];\r\n\r\nexport default combineConnectors(connectors)(BooksellerLogo);\r\n","import React from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport BooksellerLogo from '../UI/BooksellerLogo/BooksellerLogo';\r\nimport { LinkName } from './NavigationItems';\r\nimport './classicHeaderLayout.less';\r\n\r\nexport default function ClassicHeaderLayout() {\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, { useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Link } from 'react-router-dom';\r\nimport BooksellerLogo from '../UI/BooksellerLogo/BooksellerLogo';\r\nimport { LinkName } from './NavigationItems';\r\nimport { useOrganizationDataStore } from '../data/OrganizationDataStore';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport { LogoShape } from '../UI/BooksellerLogo/LogoShape';\r\nimport { useBooksellerLogoDataStore } from '../data/BooksellerLogoStore';\r\nimport classNames from 'classnames';\r\nimport './overlapHeaderLayout.less';\r\n\r\nOverlapHeaderLayout.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n};\r\n\r\nfunction OverlapHeaderLayout({ isMobile }) {\r\n\tconst { getOrgName } = useOrganizationDataStore();\r\n\tconst { getAppSettings } = useBooksellerPreferencesDataStore();\r\n\tconst { headerColor, iconColor } = getAppSettings();\r\n\tconst { getLogoShape, getSplashVisibility } = useBooksellerLogoDataStore();\r\n\r\n\tconst [scrollPosition, setScrollPosition] = useState(0);\r\n\tconst handleScroll = () => {\r\n\t\tconst position = window.pageYOffset;\r\n\t\tsetScrollPosition(position);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\twindow.addEventListener('scroll', handleScroll, { passive: true });\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('scroll', handleScroll);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tconst findMaxScrollPosition = () => {\r\n\t\tswitch (getLogoShape()) {\r\n\t\t\tcase LogoShape.square:\r\n\t\t\t\treturn isMobile() ? 140 : 275;\r\n\t\t\tcase LogoShape.portrait:\r\n\t\t\t\treturn isMobile() ? 140 : 300;\r\n\t\t\tdefault:\r\n\t\t\t\treturn isMobile() ? 100 : 200;\r\n\t\t}\r\n\t};\r\n\r\n\tconst doUseExplorePageDisplay =\r\n\t\tgetSplashVisibility() && scrollPosition < findMaxScrollPosition();\r\n\r\n\tconst headerLogoClass = classNames({\r\n\t\t'header-logo-explore-overlap': doUseExplorePageDisplay,\r\n\t\t'header-logo-overlap': !doUseExplorePageDisplay,\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\r\n\t\t\t\t{!doUseExplorePageDisplay && !isMobile() && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{getOrgName()}\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 withIsMobile(OverlapHeaderLayout);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\nimport { LogoShape } from '../UI/BooksellerLogo/LogoShape';\r\nimport { useBooksellerLogoDataStore } from '../data/BooksellerLogoStore';\r\nimport { useBooksellerAppSettings } from '../data/BooksellerPreferencesDataStore';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\n\r\nHeaderMargin.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tisPreviewModeBannerVisible: PropTypes.bool,\r\n};\r\n\r\nfunction HeaderMargin({ isMobile, isPreviewModeBannerVisible }) {\r\n\tconst { getLogoShape } = useBooksellerLogoDataStore();\r\n\tconst { headerLayout } = useBooksellerAppSettings();\r\n\r\n\tconst findMarginTop = () => {\r\n\t\tif (headerLayout === HeaderLayout.classic && !isMobile()) {\r\n\t\t\tswitch (getLogoShape()) {\r\n\t\t\t\tcase LogoShape.square:\r\n\t\t\t\t\treturn isPreviewModeBannerVisible ? 205 : 125;\r\n\t\t\t\tcase LogoShape.portrait:\r\n\t\t\t\t\treturn isPreviewModeBannerVisible ? 230 : 150;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn isPreviewModeBannerVisible ? 154 : 75;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn isPreviewModeBannerVisible ? 154 : 75;\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(HeaderMargin);\r\n","import React from 'react';\r\nimport { Modal, Button } from 'antd';\r\nimport ReactHtmlParser from 'react-html-parser';\r\nimport { useBooksellerContentDataStore } from '../data/BooksellerContentDataStore';\r\nimport { useBooksellerPreferencesDataStore } from '../data/BooksellerPreferencesDataStore';\r\nimport { Translate } from 'react-localize-redux';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { paths } from '../../paths';\r\nimport './retailerMessage.css';\r\n\r\nexport default function RetailerMessage() {\r\n\tconst { state } = useBooksellerContentDataStore();\r\n\tconst { getAppSettingAtKey } = useBooksellerPreferencesDataStore();\r\n\tconst doShowMessageOnExplorePageOnly = getAppSettingAtKey(\r\n\t\t'doShowMessageOnExplorePageOnly',\r\n\t);\r\n\tconst { retailerMessageTitle, retailerMessageBody } = state.customerApp;\r\n\tconst location = useLocation();\r\n\tconst isAuthPage = paths.isAuthPage(location.pathname);\r\n\tconst isExplorePage = location.pathname === paths.explore();\r\n\r\n\tconst [isVisible, setIsVisible] = React.useState(\r\n\t\t!isAuthPage &&\r\n\t\t\t!sessionStorage.hasViewedRetailerMessage &&\r\n\t\t\t(!doShowMessageOnExplorePageOnly ||\r\n\t\t\t\t(doShowMessageOnExplorePageOnly && isExplorePage)),\r\n\t);\r\n\r\n\tconst onCancel = () => {\r\n\t\tsessionStorage.setItem('hasViewedRetailerMessage', true);\r\n\t\tsetIsVisible(false);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t setIsVisible(true)}\r\n\t\t\t\tclassName=\"column retailer-message-navigation-anchor\">\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\t)\r\n\t\t\t\t}\r\n\t\t\t\tvisible={isVisible}\r\n\t\t\t\tfooter={[\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{ReactHtmlParser(retailerMessageBody)}\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 PropTypes from 'prop-types';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { connectToCustomerID } from '../data/CustomerIDStore';\r\nimport PreviewModeAlert from '../UI/PreviewModeAlert';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport BagAnchor from '../Bag/UI/BagAnchor';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport { withIsUnknownCustomer } from '../data/CustomerIDStore';\r\nimport NavigationAnchor from './NavigationAnchor';\r\nimport NavigationItems from './NavigationItems';\r\nimport { HeaderLayout } from './HeaderLayout';\r\nimport { LogoShape } from '../UI/BooksellerLogo/LogoShape';\r\nimport { connectToLogo } from '../data/BooksellerLogoStore';\r\nimport ClassicHeaderLayout from './ClassicHeaderLayout';\r\nimport OverlapHeaderLayout from './OverlapHeaderLayout';\r\nimport HeaderMargin from './HeaderMargin';\r\nimport RetailerMessage from '../UI/RetailerMessage';\r\nimport { connectToSellerContent } from '../data/BooksellerContentDataStore';\r\nimport classNames from 'classnames';\r\nimport './landingHeader.less';\r\n\r\nclass LandingHeader extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\tisPreviewMode: PropTypes.bool,\r\n\t\tchildren: PropTypes.object,\r\n\t\tappSettings: PropTypes.shape({\r\n\t\t\tdoIncludeCommerce: PropTypes.bool,\r\n\t\t\theaderLayout: PropTypes.string,\r\n\t\t\theaderColor: PropTypes.string,\r\n\t\t}),\r\n\t\tlogoShape: PropTypes.string,\r\n\t\tdoShowRetailerBrandLogo: PropTypes.bool,\r\n\t\tbooksellerContentStore: PropTypes.object,\r\n\t};\r\n\r\n\tstatic defaultProps = {\r\n\t\tdoShowRetailerBrandLogo: true,\r\n\t};\r\n\r\n\tstate = { didClosePreviewModeAlert: false };\r\n\r\n\trender() {\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\tconst { HomeNav, ShelvesNav } = NavigationItems;\r\n\t\tconst {\r\n\t\t\tappSettings,\r\n\t\t\tdoShowRetailerBrandLogo,\r\n\t\t\tchildren,\r\n\t\t\tbooksellerContentStore: content,\r\n\t\t} = this.props;\r\n\t\tconst { headerLayout } = appSettings;\r\n\t\tconst isClassicHeader = headerLayout === HeaderLayout.classic;\r\n\t\tconst { retailerMessageBody } = content.state.customerApp;\r\n\t\tconst hasMessageBody = retailerMessageBody.length > 0;\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{this.shouldShowAlert() && this.renderPreviewModeAlert()}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{!isClassicHeader && doShowRetailerBrandLogo && (\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{!isMobile && (\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t{!isClassicHeader && hasMessageBody && (\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{this.renderNavItem(HomeNav)}\r\n\t\t\t\t\t\t\t\t\t\t{appSettings.doShowBrowseShelvesPage &&\r\n\t\t\t\t\t\t\t\t\t\t\tthis.renderNavItem(ShelvesNav)}\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\t{isClassicHeader && doShowRetailerBrandLogo && (\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\t{!isMobile && this.renderDesktopHeaderItems()}\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{appSettings.doIncludeCommerce &&\r\n\t\t\t\t\t\tisMobile &&\r\n\t\t\t\t\t\tthis.renderBagAnchor()}\r\n\t\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\trenderNavItem(navItem) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\trenderBagAnchor() {\r\n\t\tconst bagAnchorWrapperClasses = classNames('bag-anchor-wrapper', {\r\n\t\t\t'bag-anchor-wrapper-alert-shown': this.shouldShowAlert(),\r\n\t\t});\r\n\t\treturn (\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\tshouldShowAlert() {\r\n\t\treturn this.props.isPreviewMode && !this.state.didClosePreviewModeAlert;\r\n\t}\r\n\r\n\tonCloseAlert = () => {\r\n\t\tthis.setState({ didClosePreviewModeAlert: true });\r\n\t};\r\n\r\n\trenderPreviewModeAlert = () => {\r\n\t\treturn ;\r\n\t};\r\n\r\n\trenderDesktopHeaderItems() {\r\n\t\tconst {\r\n\t\t\tisUnknownCustomer,\r\n\t\t\tappSettings,\r\n\t\t\tbooksellerContentStore: content,\r\n\t\t} = this.props;\r\n\t\tconst { SignUpNav, AccountNav } = NavigationItems;\r\n\t\tconst { headerLayout } = appSettings;\r\n\t\tconst isClassicHeader = headerLayout === HeaderLayout.classic;\r\n\t\tconst { retailerMessageBody } = content.state.customerApp;\r\n\t\tconst hasMessageBody = retailerMessageBody.length > 0;\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{isClassicHeader && hasMessageBody && }\r\n\t\t\t\t{appSettings.doIncludeCommerce && (\r\n\t\t\t\t\t
{this.renderBagAnchor()}
\r\n\t\t\t\t)}\r\n\t\t\t\t{this.renderNavItem(isUnknownCustomer ? SignUpNav : AccountNav)}\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tgetHeaderHeight() {\r\n\t\tconst { headerLayout } = this.props.appSettings;\r\n\t\tconst { logoShape, isMobile } = this.props;\r\n\t\tif (headerLayout === HeaderLayout.classic && !isMobile()) {\r\n\t\t\tswitch (logoShape) {\r\n\t\t\t\tcase LogoShape.square:\r\n\t\t\t\t\treturn '125px';\r\n\t\t\t\tcase LogoShape.portrait:\r\n\t\t\t\t\treturn '150px';\r\n\t\t\t\tdefault:\r\n\t\t\t\t\treturn 'auto';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 'auto';\r\n\t}\r\n\r\n\tgetJustifyContentValue() {\r\n\t\tconst { headerLayout } = this.props.appSettings;\r\n\t\tconst isMobile = this.props.isMobile();\r\n\t\treturn isMobile\r\n\t\t\t? 'center'\r\n\t\t\t: headerLayout === HeaderLayout.classic\r\n\t\t\t? 'space-between'\r\n\t\t\t: 'flex-end';\r\n\t}\r\n}\r\n\r\nfunction HeaderContainer({ children }) {\r\n\treturn (\r\n\t\t
\r\n\t\t\t
{children}
\r\n\t\t
\r\n\t);\r\n}\r\n\r\nconst withIsPreviewMode = Component => {\r\n\treturn connectToCustomerID(Component, customerState => ({\r\n\t\tisPreviewMode: customerState.isPreviewMode,\r\n\t}));\r\n};\r\n\r\nconst withAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, preferences => ({\r\n\t\tappSettings: preferences.getAppSettings(),\r\n\t}));\r\n};\r\n\r\nconst withLogoShape = Component => {\r\n\treturn connectToLogo(Component, logoStore => ({\r\n\t\tlogoShape: logoStore.state.logoShape,\r\n\t}));\r\n};\r\n\r\nconst connect = combineConnectors([\r\n\twithLogoShape,\r\n\twithAppSettings,\r\n\twithIsPreviewMode,\r\n\twithIsUnknownCustomer,\r\n\tconnectToSellerContent,\r\n]);\r\n\r\nexport default connect(withIsMobile(LandingHeader, 915));\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { withIsUnknownCustomer } from '../data/CustomerIDStore';\r\nimport { connectToSellerPreferences } from '../data/BooksellerPreferencesDataStore';\r\nimport combineConnectors from '../data/combineConnectors';\r\nimport NavigationAnchor from './NavigationAnchor';\r\nimport NavigationItems from './NavigationItems';\r\nimport RetailerMessage from '../UI/RetailerMessage';\r\nimport { connectToSellerContent } from '../data/BooksellerContentDataStore';\r\nimport './landingFooter.css';\r\n\r\nclass LandingFooter extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tisMobile: PropTypes.func,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\theaderColor: PropTypes.string,\r\n\t\tdoShowBrowseShelvesPage: PropTypes.bool,\r\n\t\tbooksellerContentStore: PropTypes.object,\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst {\r\n\t\t\theaderColor,\r\n\t\t\tisUnknownCustomer,\r\n\t\t\tdoShowBrowseShelvesPage,\r\n\t\t\tbooksellerContentStore: content,\r\n\t\t} = this.props;\r\n\r\n\t\tconst { HomeNav, ShelvesNav, SignUpNav, AccountNav } = NavigationItems;\r\n\r\n\t\tconst { retailerMessageBody } = content.state.customerApp;\r\n\t\tconst hasMessageBody = retailerMessageBody.length > 0;\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{hasMessageBody && }\r\n\t\t\t\t\t{this.renderNavItem(HomeNav)}\r\n\t\t\t\t\t{doShowBrowseShelvesPage && this.renderNavItem(ShelvesNav)}\r\n\t\t\t\t\t{this.renderNavItem(\r\n\t\t\t\t\t\tisUnknownCustomer ? SignUpNav : AccountNav,\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\trenderNavItem(navItem) {\r\n\t\treturn ;\r\n\t}\r\n}\r\n\r\nconst withFooterAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, store => {\r\n\t\tconst appSettings = store.getAppSettings();\r\n\t\treturn {\r\n\t\t\theaderColor: appSettings.headerColor,\r\n\t\t\tdoShowBrowseShelvesPage: appSettings.doShowBrowseShelvesPage,\r\n\t\t};\r\n\t});\r\n};\r\n\r\nconst connectors = [\r\n\twithIsUnknownCustomer,\r\n\twithFooterAppSettings,\r\n\tconnectToSellerContent,\r\n];\r\n\r\nexport default combineConnectors(connectors)(LandingFooter);\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport LandingHeader from './LandingHeader';\r\nimport LandingFooter from './LandingFooter';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport { useLocation } from 'react-router-dom';\r\n\r\nPage.propTypes = {\r\n\tisMobile: PropTypes.func,\r\n\tchildren: PropTypes.element.isRequired,\r\n\tdoShowAppHeader: PropTypes.bool,\r\n\tdoShowRetailerBrandLogo: PropTypes.bool,\r\n};\r\n\r\nPage.defaultProps = {\r\n\tdoShowAppHeader: true,\r\n\tdoShowRetailerBrandLogo: true,\r\n};\r\n\r\nfunction Page({\r\n\tchildren,\r\n\tisMobile,\r\n\tdoShowAppHeader,\r\n\tdoShowRetailerBrandLogo,\r\n}) {\r\n\tconst { pathname } = useLocation();\r\n\r\n\tReact.useEffect(() => {\r\n\t\twindow.scrollTo && window.scrollTo(0, 0);\r\n\t}, [pathname]);\r\n\r\n\tconst renderChildrenWithHeader = () => {\r\n\t\treturn (\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\treturn (\r\n\t\t<>\r\n\t\t\t{doShowAppHeader ? renderChildrenWithHeader() : children}\r\n\t\t\t{isMobile() && }\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default withIsMobile(Page, 915);\r\n","import React from 'react';\r\nimport api from '../../api';\r\nimport { useParams } from 'react-router-dom';\r\nimport { useCustomerID } from '../data/CustomerIDStore';\r\nimport useCampaign from './data/useCampaign';\r\nimport LoadingPage from '../UI/LoadingPage';\r\nimport IFrameRenderer from './UI/IFrameRenderer';\r\nimport withIsMobile from '../hoc/withIsMobile';\r\nimport Page from '../Navigation/Page';\r\nimport { capitalize } from '../../util';\r\nimport { HeaderLayout } from '../Navigation/HeaderLayout';\r\nimport { useBooksellerAppSettings } from '../data/BooksellerPreferencesDataStore';\r\nimport './campaignEmailPreviewPage.css';\r\n\r\nfunction CampaignEmailPreviewPage({ isMobile }) {\r\n\tconst { campaignId } = useParams();\r\n\tconst { customerId, orgId } = useCustomerID();\r\n\tconst {\r\n\t\theaderLayout,\r\n\t\tdoShowCustomerAppBrandingWhenSharingCampaign,\r\n\t} = useBooksellerAppSettings();\r\n\tconst { isLoadingCampaign, hasError, campaign } = useCampaign(campaignId);\r\n\r\n\tconst [isLoading, setIsLoading] = React.useState(true);\r\n\tconst [campaignHtml, setCampaignHtml] = React.useState('');\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet request;\r\n\t\tconst endpoint = `/orgs/${orgId}/customer/${customerId}/campaign/${campaignId}/email/content`;\r\n\r\n\t\tconst fetchCampaignPreview = async () => {\r\n\t\t\trequest = api.cancelableGet(endpoint);\r\n\t\t\tconst html = await request.promise;\r\n\r\n\t\t\tif (html) {\r\n\t\t\t\tsetCampaignHtml(html);\r\n\t\t\t}\r\n\t\t\tsetIsLoading(false);\r\n\t\t};\r\n\r\n\t\tfetchCampaignPreview();\r\n\r\n\t\treturn () => {\r\n\t\t\tapi.revoke(request);\r\n\t\t};\r\n\t}, [campaignId, customerId, orgId]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (hasError) {\r\n\t\t\tthrow new Error(`Failed to load campaign for ${campaignId}`);\r\n\t\t}\r\n\t}, [hasError, campaignId]);\r\n\r\n\tconst doShowCampaignHeader = () => {\r\n\t\treturn (\r\n\t\t\ttypeof campaign.subject === 'string' && campaign.subject.length > 0\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderCampaignHeader = () => {\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t

\r\n\t\t\t\t\t{capitalize(campaign.subject)}\r\n\t\t\t\t

\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\tconst renderCampaignEmailPreview = () => {\r\n\t\tif (!campaignHtml) {\r\n\t\t\treturn No Preview Available;\r\n\t\t}\r\n\r\n\t\treturn (\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);\r\n\t};\r\n\r\n\tconst doShowRetailerLogo = () => {\r\n\t\treturn headerLayout === HeaderLayout.overlap;\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t{isLoading || isLoadingCampaign ? (\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{doShowCampaignHeader() && renderCampaignHeader()}\r\n\t\t\t\t\t\t{renderCampaignEmailPreview()}\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 withIsMobile(CampaignEmailPreviewPage);\r\n","import React from 'react';\r\nimport api from '../../../api';\r\nimport { useCustomerID } from '../../data/CustomerIDStore';\r\n\r\nexport default function useCampaign(campaignId) {\r\n\tconst { orgId } = useCustomerID();\r\n\r\n\tconst [campaign, setCampaign] = React.useState({});\r\n\tconst [isLoading, setIsLoading] = React.useState(true);\r\n\tconst [error, setError] = React.useState({ exists: false, body: null });\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet request;\r\n\t\tconst endpoint = `/orgs/${orgId}/campaign/${campaignId}`;\r\n\r\n\t\tconst fetchCampaign = async () => {\r\n\t\t\ttry {\r\n\t\t\t\trequest = api.cancelableGet(endpoint);\r\n\t\t\t\tconst c = await request.promise;\r\n\r\n\t\t\t\tif (c) {\r\n\t\t\t\t\tsetCampaign(c);\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Error(\r\n\t\t\t\t\t\t`Failed to match CampaignId ${campaignId} to a campaign`,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t} catch (err) {\r\n\t\t\t\tsetError({ exists: true, body: err });\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfetchCampaign();\r\n\r\n\t\treturn () => {\r\n\t\t\tapi.revoke(request);\r\n\t\t};\r\n\t}, [orgId, campaignId]);\r\n\r\n\treturn {\r\n\t\tcampaign,\r\n\t\thasError: error.exists,\r\n\t\tisLoadingCampaign: isLoading,\r\n\t};\r\n}\r\n","import { Button, Form, Input, Alert } from 'antd';\r\nimport React from 'react';\r\nimport { e360Api } from '../../../api';\r\nimport './subscribeForm.less';\r\nimport { FormComponentProps } from 'antd/es/form';\r\nimport { useOrganizationDataStore } from '../../data/OrganizationDataStore';\r\nimport { withLocalize, LocalizeContextProps } from 'react-localize-redux';\r\n\r\ntype CustomerType = {\r\n\t[key: string]: string;\r\n};\r\n\r\ntype AlertType = {\r\n\tisSuccessful: boolean;\r\n\tmessage?: string;\r\n};\r\n\r\ninterface ISubscribeFormProps\r\n\textends FormComponentProps,\r\n\t\tLocalizeContextProps {}\r\n\r\nconst SubscribeForm = ({ form, translate }: ISubscribeFormProps) => {\r\n\tconst isFormTouched = form.isFieldsTouched();\r\n\tconst { getFieldDecorator } = form;\r\n\tconst [alert, setAlert] = React.useState(null);\r\n\tconst {\r\n\t\tstate: { organization },\r\n\t} = useOrganizationDataStore();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (isFormTouched) {\r\n\t\t\tsetAlert(null);\r\n\t\t}\r\n\t}, [isFormTouched]);\r\n\r\n\tconst config = {\r\n\t\tonResponse: (response: any) => response,\r\n\t};\r\n\r\n\tconst postCustomer = async (customer: CustomerType) => {\r\n\t\ttry {\r\n\t\t\tconst response = await e360Api(config).post(\r\n\t\t\t\t`/organizations/${organization.orgID}/customers/directUpload`,\r\n\t\t\t\tcustomer,\r\n\t\t\t);\r\n\t\t\tconst isSuccessful = response.ok;\r\n\t\t\tconst data = await response.json();\r\n\r\n\t\t\tisSuccessful && form.resetFields();\r\n\t\t\tsetAlert({ isSuccessful, message: data?.message });\r\n\t\t} catch (_e) {\r\n\t\t\tsetAlert({ isSuccessful: false });\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleSubmit = (): void => {\r\n\t\tform.validateFields((err, values) => {\r\n\t\t\tif (!err) {\r\n\t\t\t\tvalues.tags = [translate('newsletter_subscribe')];\r\n\t\t\t\tpostCustomer(values);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tconst getAlertMessage = () => {\r\n\t\tif (alert?.isSuccessful) return 'upload_successful';\r\n\r\n\t\tif (alert?.message === 'Email is invalid.') {\r\n\t\t\treturn 'email_is_invalid';\r\n\t\t} else {\r\n\t\t\treturn 'there_was_an_error_with_your_request';\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{getFieldDecorator('firstName')()}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t{getFieldDecorator('lastName')()}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t{getFieldDecorator('email', {\r\n\t\t\t\t\trules: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trequired: true,\r\n\t\t\t\t\t\t\tmessage: translate('email_is_required'),\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\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{alert && (\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\r\n\t);\r\n};\r\n\r\nconst WrappedSubscribeForm = Form.create({})(\r\n\tSubscribeForm,\r\n);\r\n\r\nexport default withLocalize(WrappedSubscribeForm);\r\n","import { Card } from 'antd';\r\nimport React from 'react';\r\nimport { useBooksellerLogoDataStore } from '../../data/BooksellerLogoStore';\r\nimport './subscribePage.less';\r\nimport { useOrganizationDataStore } from '../../data/OrganizationDataStore';\r\nimport SubscribeForm from '../SubscribeForm';\r\nimport { Translate } from 'react-localize-redux';\r\n\r\nconst SubscribePage = (): JSX.Element => {\r\n\tconst {\r\n\t\tgetLogoUri,\r\n\t\tisLoading: isLogoLoading,\r\n\t} = useBooksellerLogoDataStore();\r\n\tconst { getOrgName, isLoading: isOrgLoading } = useOrganizationDataStore();\r\n\tconst orgName = getOrgName() ?? '';\r\n\tconst isLoading = isLogoLoading() || isOrgLoading();\r\n\tconst logoUri = getLogoUri();\r\n\r\n\treturn (\r\n\t\t
\r\n\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\t\r\n\t\t\t\r\n\t\t
\r\n\t);\r\n};\r\n\r\nexport default SubscribePage;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Route, Switch, Redirect, withRouter } from 'react-router-dom';\r\nimport CollectionLanding from './Collection/CollectionLanding';\r\nimport UnsubscribePageRoot from './Unsubscribe/UnsubscribePageRoot';\r\nimport BrowseShelvesPage from './BrowseShelves/BrowseShelvesPage';\r\nimport HomePageRoot from './Home/HomePageRoot';\r\nimport SectionHome from './Section/SectionHome';\r\nimport RewardsPage from './Rewards/RewardsPage';\r\nimport WishlistCollectionPage from './Wishlist/WishlistCollectionPage';\r\nimport { connectToSellerPreferences } from './data/BooksellerPreferencesDataStore';\r\nimport { withIsUnknownCustomer } from './data/CustomerIDStore';\r\nimport combineConnectors from './data/combineConnectors';\r\nimport OrderPage from './Order/OrderPage';\r\nimport Login from './Auth/Login';\r\nimport Logout from './Auth/Logout';\r\nimport AccountPage from './CustomerAccount/AccountPage';\r\nimport CampaignEmailPreviewPage from './Campaign/CampaignEmailPreviewPage';\r\nimport Page from './Navigation/Page';\r\nimport { paths } from '../paths';\r\nimport SubscribePage from './Subscribe/SubscribePage';\r\n\r\nclass AppSwitch extends React.Component {\r\n\tstatic propTypes = {\r\n\t\tmatch: PropTypes.object,\r\n\t\thistory: PropTypes.object,\r\n\t\tlocation: PropTypes.object,\r\n\t\tisUnknownCustomer: PropTypes.bool,\r\n\t\tappSettings: PropTypes.shape({\r\n\t\t\tdoShowBrowseShelvesPage: PropTypes.bool,\r\n\t\t}),\r\n\t};\r\n\r\n\trender() {\r\n\t\tconst { appSettings, isUnknownCustomer } = this.props;\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t {\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\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\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\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{appSettings.doShowBrowseShelvesPage && (\r\n\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\t{!isUnknownCustomer && (\r\n\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\t{!isUnknownCustomer && (\r\n\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\t }\r\n\t\t\t\t/>\r\n\t\t\t\t{!isUnknownCustomer && (\r\n\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\t }\r\n\t\t\t\t/>\r\n\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\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\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\t{appSettings.doIncludeCommerce && (\r\n\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\t\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\tcomponentDidUpdate(prevProps) {\r\n\t\tif (!window.Appcues) return;\r\n\r\n\t\tconst thisLocation = this.props.location.pathname;\r\n\t\tconst previousLocation = prevProps.location.pathname;\r\n\r\n\t\tif (thisLocation !== previousLocation) {\r\n\t\t\twindow.Appcues.page();\r\n\t\t}\r\n\t}\r\n\r\n\trenderSectionPage = router => {\r\n\t\tconst { sectionId, sectionLevel } = router.match.params;\r\n\t\treturn (\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\nconst withSellerAppSettings = Component => {\r\n\treturn connectToSellerPreferences(Component, sellerPreferencesStore => ({\r\n\t\tappSettings: sellerPreferencesStore.getAppSettings(),\r\n\t}));\r\n};\r\n\r\nconst connectors = [withIsUnknownCustomer, withSellerAppSettings];\r\n\r\nexport default combineConnectors(connectors)(withRouter(AppSwitch));\r\n","import React from 'react';\r\nimport AppFrame from './components/AppFrame';\r\nimport AppSwitchWithRouter from './components/AppSwitch';\r\nimport { ScrollerConfigProvider } from './components/UI/Scroller/ScrollerConfigContext';\r\n\r\nexport default function App() {\r\n\tif (window.Appcues) {\r\n\t\twindow.Appcues.anonymous();\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\r\n\t);\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport App from './App';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport * as serviceWorker from './serviceWorker';\r\nimport 'antd/dist/antd.css';\r\nimport './styles/index.less';\r\nimport 'treeline-react-core-components/index.css';\r\nimport './assets/fontastic.css';\r\nimport './index.css';\r\n\r\nReactDOM.render(\r\n\t\r\n\t\t\r\n\t,\r\n\tdocument.getElementById('root'),\r\n);\r\n\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}