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QACsB,CAAC,GAACA,CAAA,QAAAM,EAAAA,GAAAA,GAAAR,EAAAC,IAAAQ,EAAAA,GAAAA,GAAAT,EAAA,EAAAzU,IAAA,SAAAC,MAMhD,WACE,IAAQiI,EAA8BiN,KAAKC,MAAnClN,MAER,OAAIA,GACFzE,GAASyE,GAEF,MAGgCiN,KAAKE,MAAtC1B,QAGV,IAAC,EAAA3T,IAAA,2BAAAC,MAhBD,SAAgCiI,GAC9B,MAAO,CAAEA,MAAAA,EACX,IAAC,CALuB,CAASoN,EAAAA,W,ykBCHnC,IAAM3I,IAAWmC,EAAAA,EAAAA,IAAepM,EAAAA,IAKnB6S,GAAS3T,eAAO4T,EAA4BC,GACvD,IAAAC,EAAmCF,EAA3BG,UAAWC,OAAM,IAAAF,EAAG,GAAEA,EACxBG,GAAkBC,EAAAA,EAAAA,GAAsCF,EAAQ,CACpE,kBACA,aACA,eACA,cACA,WAEFjJ,GAAS,uBAAwBkJ,GACjC,IAAQrM,EAAoCqM,EAApCrM,WAAY6K,EAAwBwB,EAAxBxB,YAAwBwB,EAAXtS,OAEjC,IAAK8Q,EACH,MAAM,IAAI0B,MAAM,0BAclBC,EAAAA,EAAAA,GAAWP,GAAaF,QACtBxB,EAAAA,GAAAA,KAACU,GAAa,CAAAd,UACZI,EAAAA,GAAAA,KAACkC,EAAAA,EAAsB,CACrBzM,WAAYA,EACZ0M,aAAa,GAAEvC,UAEfI,EAAAA,GAAAA,KAACI,GAAG1S,GAAA,GAAKoU,QAIjB,C","sources":["webpack://oribasketprovider/../../src/index.ts","webpack://oribasketprovider/../../../src/types/RequestUrl.ts","webpack://oribasketprovider/../../../src/utils/convertToCamelCase.ts","webpack://oribasketprovider/../../../src/types/HttpHeader.ts","webpack://oribasketprovider/../../../src/types/ContentType.ts","webpack://oribasketprovider/../../../src/utils/getHttpRequestSettings.ts","webpack://oribasketprovider/../../../src/utils/addBasketOffer.ts","webpack://oribasketprovider/../../../src/utils/addToBasket.ts","webpack://oribasketprovider/../../../src/api/deleteOfferItem.ts","webpack://oribasketprovider/../../../src/handlers/deleteOfferItemHandler.ts","webpack://oribasketprovider/../../../src/handlers/replaceSubscriptionHandler.ts","webpack://oribasketprovider/../../../src/constants/requestOptions.ts","webpack://oribasketprovider/../../../src/handlers/updateOfferItemHandler.ts","webpack://oribasketprovider/../../../src/constants/shoppingContextActions.ts","webpack://oribasketprovider/../../../src/handlers/acceptNotificationHandler.ts","webpack://oribasketprovider/../../../src/handlers/addBackorderDemandHandler.ts","webpack://oribasketprovider/../../../src/handlers/addBasketOfferHandler.ts","webpack://oribasketprovider/../../../src/handlers/addCatalogueOfferHandler.ts","webpack://oribasketprovider/../../../src/handlers/addCustomerOrderHandler.ts","webpack://oribasketprovider/../../../src/handlers/addFreeShippingOfferHandler.ts","webpack://oribasketprovider/../../../src/handlers/addToBasketHandler.ts","webpack://oribasketprovider/../../../src/utils/getBuyingUrlAndMethod.ts","webpack://oribasketprovider/../../../src/handlers/addVoucherHandler.ts","webpack://oribasketprovider/../../../src/handlers/cancelBackorderDemandHandler.ts","webpack://oribasketprovider/../../../src/handlers/cancelSubscriptionHandler.ts","webpack://oribasketprovider/../../../src/handlers/clearBasketHandler.ts","webpack://oribasketprovider/../../../src/handlers/delaySubscriptionHandler.ts","webpack://oribasketprovider/../../../src/handlers/checkLoyaltyDialogResultAndAddToBasketHandler.ts","webpack://oribasketprovider/../../../src/handlers/removeBasketItemHandler.ts","webpack://oribasketprovider/../../../src/handlers/removeCustomerOrderHandler.ts","webpack://oribasketprovider/../../../src/handlers/removeVoucherHandler.ts","webpack://oribasketprovider/../../../src/handlers/replaceShoppingBagItemHandler.ts","webpack://oribasketprovider/../../../src/api/replaceSubscription.ts","webpack://oribasketprovider/../../../src/handlers/requestShoppingContextHandler.ts","webpack://oribasketprovider/../../../src/handlers/resetShippingSelectionHandler.ts","webpack://oribasketprovider/../../../src/handlers/updateBasketItemHandler.ts","webpack://oribasketprovider/../../../src/handlers/updateCustomerOrderItemHandler.ts","webpack://oribasketprovider/../../../src/handlers/updateDeliveryHandler.ts","webpack://oribasketprovider/../../../src/handlers/updateDeliveryChannelHandler.ts","webpack://oribasketprovider/../../../src/handlers/updateDonationHandler.ts","webpack://oribasketprovider/../../../src/api/updateOfferItem.ts","webpack://oribasketprovider/../../../src/handlers/updateOfferItemsHandler.ts","webpack://oribasketprovider/../../../src/handlers/updatePaymentProviderHandler.ts","webpack://oribasketprovider/../../../src/utils/storage.ts","webpack://oribasketprovider/../../../src/utils/cookies.ts","webpack://oribasketprovider/../../../src/utils/hashes.ts","webpack://oribasketprovider/../../../src/utils/dispatchBasketUpdatedEvent.ts","webpack://oribasketprovider/../../../src/utils/logReceivedEvent.ts","webpack://oribasketprovider/../../../src/utils/clearCachePages.ts","webpack://oribasketprovider/../../../src/hooks/useBasketProviderData.ts","webpack://oribasketprovider/../../../src/components/BasketProvider.ts","webpack://oribasketprovider/../../../src/containers/ApiProvider.tsx","webpack://oribasketprovider/../../../src/containers/BasketProviderController.tsx","webpack://oribasketprovider/./src/App.tsx","webpack://oribasketprovider/./src/containers/ErrorBoundary.ts","webpack://oribasketprovider/./src/appRender.tsx"],"sourcesContent":["import type { Data } from './Data';\n\nexport { Results as LastAddedItemMethod } from '@ori-events/loyalty-dialog-result';\n\nexport type {\n BasketOffer,\n BasketOfferBenefit,\n BasketOfferConcept,\n BasketOfferConceptBenefit,\n BasketOfferItem,\n BasketOfferProduct,\n BasketOfferPurchase,\n} from './BasketOffer';\nexport { BasketOfferTypes } from './BasketOffer';\n\nexport type { GodModeOutput, GodModeOutputItem } from './GodModeOutput';\n\nexport type { LastAddedItem } from './LastAddedItem';\n\nexport type { Referral } from './Referral';\n\nexport type {\n ShoppingBag,\n ShoppingBagBalance,\n ShoppingBagDiscount,\n ShoppingBagSubscriptions,\n ShoppingBagSubscriptionsPackages,\n ShoppingBagVipLoyalty,\n} from './ShoppingBag';\n\nexport type {\n DiscountMessage,\n OriginalProduct,\n Replacement,\n ReplacementItem,\n ShoppingBagItem,\n ShoppingBagItemProductFlag,\n} from './ShoppingBagItem';\n\nexport type { ShoppingBagOffer } from './ShoppingBagOffer';\n\nexport type { ShoppingMessage, ProgressBarItems } from './ShoppingMessage';\n\nexport type { ShoppingNotification } from './ShoppingNotification';\nexport { ShoppingNotificationType } from './ShoppingNotification';\n\nexport type {\n EndConsumerOrderItem,\n PendingEndConsumerOrder,\n ShippingOffer,\n SliderModel,\n UnitDataCollection,\n UnitDataCollectionBeautyConsultant,\n UnitDataCollectionCommon,\n UnitDataCollectionDelivery,\n UnitDataCollectionDonationUnit,\n UnitDataCollectionEndConsumerPendingOrder,\n UnitDataCollectionOffer,\n UnitDataCollectionPreOrderTargetUnit,\n UnitDataCollectionSectionUnit,\n UnitDataCollectionSpecialOffer,\n UnitDataCollectionVouchers,\n UnitDataCollectionWellnessSelling,\n UnitDataOffer,\n UnitDataOfferItem,\n} from './UnitDataCollection';\n\nexport const Test = 'TEST';\nexport const Name = 'basket-updated';\ntype EventName = typeof Name;\n\nexport const BasketUpdatedEvent: EventName = Name;\nexport type { Data };\n\nexport interface Event extends CustomEvent {\n type: EventName;\n}\n\nexport default Event;\n\ndeclare global {\n interface WindowEventMap {\n [Name]: Event;\n }\n}\n","export enum RequestUrl {\n AcceptNotification = '/system/ajax/Message/AcceptFailMessage',\n AddBackorderDemand = '/system/ajax/ShoppingBag/AddBackorderDemand',\n AddBasketOffer = '/system/ajax/Offer/ApplyBasketOffer',\n AddCatalogueOffer = '/system/ajax/Offer/ApplyCatalogueOffer',\n AddCustomerOrder = '/system/ajax/EndConsumerOrder/ApproveOrders',\n AddFreeShippingOffer = '/system/ajax/Delivery/AddFreeShippingItem',\n AddToBasketCheckLoyalty = '/system/ajax/ShoppingBag/AddToShoppingBagItemAndCheckLoyalty',\n AddToBasketForMoney = '/system/ajax/ShoppingBag/AddOrUpdateShoppingBagItem',\n AddToBasketForPoints = '/system/ajax/Offer/AddOfferItem',\n AddToBasketForPointsRewardShop = '/system/ajax/Offer/RedeemLoyaltyPoints',\n AddVoucher = '/system/ajax/ShoppingBag/AddVoucher',\n CancelBackorderDemand = '/system/ajax/ShoppingBag/CancelBackorderDemand',\n CancelSubscription = '/system/ajax/ShoppingBag/CancelSubscription',\n ClearBasket = '/system/ajax/ShoppingBag/RemoveAllShoppingBagItems',\n DelaySubscription = '/system/ajax/ShoppingBag/DelaySubscription',\n GetShoppingContext = '/system/ajax/ShoppingBag/GetShoppingContext',\n PurchaseBasketOffer = '/system/ajax/Offer/PurchaseBasketOffer',\n RemoveBasketItem = '/system/ajax/ShoppingBag/RemoveShoppingBagItem',\n RemoveCustomerOrder = '/system/ajax/EndConsumerOrder/UnapproveOrder',\n RemoveVoucher = '/system/ajax/ShoppingBag/RemoveVoucher',\n ReplaceShoppingBagItem = '/system/ajax/ShoppingBag/ReplaceShoppingBagItem',\n ResetFreeShippingSelection = '/system/ajax/Delivery/ResetFreeShippingSelection',\n UpdateBasketItem = '/system/ajax/ShoppingBag/UpdateShoppingBagItem',\n UpdateCustomerOrderItem = '/system/ajax/EndConsumerOrder/UpdateEndConsumerOrderItem',\n UpdateDeliveryAddress = '/system/ajax/DeliverySelection/UpdateDeliveryAddress',\n UpdateDeliveryChannel = '/system/ajax/DeliverySelection/UpdateDeliveryChannel',\n UpdateDonation = '/system/ajax/Donation/UpdateDonation',\n UpdateOfferItem = '/system/ajax/Offer/UpdateOfferItem',\n UpdateOfferItems = '/system/ajax/Offer/UpdateOfferItems',\n UpdatePaymentProvider = '/system/ajax/Payment/UpdatePaymentProvider',\n}\n","import camelCase from 'lodash.camelcase';\n\ntype CamelCaseObjectDeepType = (object?: unknown) => T;\n\nexport const convertToCamelCase: CamelCaseObjectDeepType = (object?: unknown) => {\n if (Array.isArray(object)) {\n return object.map(convertToCamelCase) as unknown as T;\n }\n\n if (typeof object === 'object' && object !== null && object.constructor === Object) {\n return Object.fromEntries(\n Object.entries(object).map(([key, value]) => [camelCase(key), convertToCamelCase(value)]),\n ) as unknown as T;\n }\n\n return object as T;\n};\n","// TODO: Move to checkout-utils\nexport enum HttpHeader {\n ContentType = 'Content-Type',\n Placement = 'x-placement',\n}\n","// TODO: Move to checkout-utils\nexport enum ContentType {\n Json = 'application/json',\n}\n","import type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { ContentType, HttpHeader } from '../types';\n\nexport const getHttpRequestSettings: (data?: T, method?: HttpMethod) => RequestInit = (\n data,\n method = HttpMethod.Get,\n) => {\n const headers: HeadersInit = {\n [HttpHeader.ContentType]: ContentType.Json,\n };\n let body: BodyInit | undefined;\n if (data) {\n const { placement, ...finalData } = data;\n if (placement) {\n headers[HttpHeader.Placement] = placement;\n }\n const bodyValue = JSON.stringify(finalData);\n body = bodyValue === '{}' ? undefined : bodyValue;\n }\n\n return {\n credentials: 'same-origin',\n headers,\n method,\n ...(method === HttpMethod.Post && Boolean(body) && { body }),\n };\n};\n","import type { BasketOfferItem } from '@ori-events/add-basket-offer';\nimport * as AddBasketOfferFailed from '@ori-events/add-basket-offer-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport type { RequestUrl } from '../types';\nimport { convertToCamelCase } from './convertToCamelCase';\nimport { getHttpRequestSettings } from './getHttpRequestSettings';\n\ntype AddBasketOfferApplyParams = PositionData & {\n offerId: number;\n};\n\ntype AddBasketOfferPurchaseParams = PositionData & {\n choiceId: number;\n items: BasketOfferItem[];\n};\n\nexport async function addBasketOffer(\n url: RequestUrl.AddBasketOffer | RequestUrl.PurchaseBasketOffer,\n params: AddBasketOfferApplyParams | AddBasketOfferPurchaseParams,\n) {\n const response = await fetch(url, getHttpRequestSettings(params, HttpMethod.Post));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (AddBasketOfferFailed.isAddBasketOfferErrorResponse(data)) {\n const event = new CustomEvent(AddBasketOfferFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(event);\n\n return false;\n }\n\n return data;\n}\n","import type * as AddToBasket from '@ori-events/add-to-basket';\nimport * as AddToBasketFailed from '@ori-events/add-to-basket-failed';\nimport * as ShowLoyaltyDialog from '@ori-events/show-loyalty-dialog';\nimport type { PositionData } from '@ori/analytics-data';\nimport { getWarningLogger, HttpMethod } from '@ori/checkout-utils';\n\nimport { APP_NAME } from '../constants';\nimport { convertToCamelCase } from './convertToCamelCase';\nimport { getHttpRequestSettings } from './getHttpRequestSettings';\n\nexport type AddToBasketParams = AddToBasket.Data &\n PositionData & {\n choiceId?: number | null;\n catalogueItemId?: string;\n };\n\nconst logWarning = getWarningLogger(APP_NAME);\nexport const MISSING_PLACEMENT_MESSAGE = `Missing 'placement' property in add-to-basket action data will impact reporting, please contact your SE.`;\n\nexport async function addToBasket(url: string, params: AddToBasketParams, buyingMethod: AddToBasket.Method) {\n const { itemCode, placement, quantity } = params;\n if (!placement) {\n logWarning(MISSING_PLACEMENT_MESSAGE);\n }\n const response = await fetch(url, getHttpRequestSettings(params, HttpMethod.Post));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (AddToBasketFailed.isAddToBasketErrorResponse(data)) {\n const event = new CustomEvent(AddToBasketFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(event);\n\n return false;\n }\n\n if (AddToBasketFailed.isAddToBasketLoyaltyResponse(data)) {\n const event = new CustomEvent(ShowLoyaltyDialog.Name, {\n detail: {\n ...data,\n itemCode,\n placement,\n quantity,\n },\n });\n window.dispatchEvent(event);\n\n return false;\n }\n\n return {\n ...data,\n lastAddedItem: {\n itemCode,\n method: buyingMethod,\n quantity,\n },\n };\n}\n","import {\n deleteShoppingSessionOfferChoice,\n type DeleteShoppingSessionOfferChoiceHeaders,\n} from '@ori/global-api-client-react';\n\nimport type { HandlerSettings } from '../types';\n\ntype DeleteOfferItemHandlerSettings = Pick;\n\nexport type DeleteOfferItemParams = DeleteOfferItemHandlerSettings & {\n itemCode: string;\n offerId: number;\n tenant: string;\n};\n\nexport async function deleteOfferItem({ client, itemCode, offerId, sessionId, tenant }: DeleteOfferItemParams) {\n // TODO: Is this needed when there is the tenant prop of ApiProvider applied on some upper level?\n const headers: DeleteShoppingSessionOfferChoiceHeaders = {\n 'x-tenant-context': tenant,\n };\n\n return deleteShoppingSessionOfferChoice(client, sessionId, offerId, itemCode, headers);\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport type * as DeleteOfferItem from '@ori-events/delete-offer-item';\nimport { isDeleteOfferItemErrorResponse, Name as ErrorEventName } from '@ori-events/delete-offer-item-failed';\nimport type { Data as ErrorData } from '@ori-events/delete-offer-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod, getErrorLogger } from '@ori/checkout-utils';\n\nimport { deleteOfferItem } from '../api';\nimport { APP_NAME } from '../constants';\nimport { RequestUrl, type HandlerSettings } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & DeleteOfferItem.Data;\n\nconst logError = getErrorLogger(APP_NAME);\n\nconst dispatchErrorEvent = (detail: ErrorData) => {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail,\n });\n window.dispatchEvent(errorEvent);\n};\n\nexport async function deleteOfferItemHandler(\n { detail: { choiceId, itemCode } }: CustomEvent,\n { client, sessionId, tenant }: HandlerSettings,\n) {\n // STEP 1 - Update through API\n try {\n await deleteOfferItem({\n client,\n itemCode,\n offerId: choiceId,\n sessionId,\n tenant,\n });\n } catch (error: unknown) {\n const message = String(error);\n logError(`Error while deleting offer item in delete-offer-item event: ${message}`);\n dispatchErrorEvent({\n isSuccess: false,\n localizedMessage: '',\n message: 'Deletion of offer item failed via API call',\n });\n\n return false;\n }\n\n // STEP 2 - Update shopping context via Online endpoint\n const response = await fetch(RequestUrl.GetShoppingContext, getHttpRequestSettings(undefined, HttpMethod.Post));\n\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isDeleteOfferItemErrorResponse(data)) {\n dispatchErrorEvent(data);\n\n return false;\n }\n\n return data;\n}\n","import type * as ReplaceSubscription from '@ori-events/replace-subscription';\nimport * as ReplaceSubscriptionFailed from '@ori-events/replace-subscription-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { getErrorLogger, HttpMethod } from '@ori/checkout-utils';\nimport { type GlobalCustomersSubscriptionItemDto } from '@ori/global-api-client-react';\n\nimport { replaceSubscription } from '../api';\nimport { APP_NAME } from '../constants';\nimport { RequestUrl } from '../types';\nimport type { HandlerSettings } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & ReplaceSubscription.Data;\ntype Response = ReplaceSubscriptionFailed.ReplaceSubscriptionResponse;\n\nconst logError = getErrorLogger(APP_NAME);\n\nexport async function replaceSubscriptionHandler(\n { detail: { droppingId, itemCode, subscriptionId } }: CustomEvent,\n { client, customerId, tenant }: HandlerSettings,\n) {\n // STEP 1 - Update through API\n const subscriptionItemId = 0;\n const item = {\n droppingId,\n isReplacementAllowed: true,\n itemCode,\n quantity: 1,\n subscriptionItemId,\n // TODO: This was optional / not used before, that's why the cast for now.\n // The ReplaceSubscription event data contains currently only the props destructured above.\n // To change it (if requested), we need cross-team collaboration with Presentation.\n // discountedPrice: 0,\n // discountPercent: 0,\n // totalBp: 0,\n // price: 0,\n // isDropped: false,\n };\n const globalCustomersSubscriptionItemDto = item as GlobalCustomersSubscriptionItemDto;\n\n try {\n await replaceSubscription({\n client,\n customerId,\n globalCustomersSubscriptionItemDto,\n subscriptionId,\n subscriptionItemId,\n tenant,\n });\n } catch (error: unknown) {\n const message = String(error);\n logError(`Error while replacing subscription in replaceSubscription event: ${message}`);\n\n return false;\n }\n\n // STEP 2 - Update shopping context via Online endpoint\n const response = await fetch(RequestUrl.GetShoppingContext, getHttpRequestSettings(undefined, HttpMethod.Post));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (ReplaceSubscriptionFailed.isReplaceSubscriptionErrorResponse(data)) {\n const errorEvent = new CustomEvent(ReplaceSubscriptionFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","// TODO: common header names & values to checkout-utils\nexport const putRequestOptions = {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- predefined HTTP header name\n headers: { 'Content-Type': 'application/json' },\n method: 'PUT',\n};\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport type * as UpdateOfferItem from '@ori-events/update-offer-item';\nimport { isUpdateOfferItemFailedResponse, Name as ErrorEventName } from '@ori-events/update-offer-item-failed';\nimport type { Data as ErrorData } from '@ori-events/update-offer-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod, getErrorLogger } from '@ori/checkout-utils';\n\nimport { updateOfferItem } from '../api';\nimport { APP_NAME } from '../constants';\nimport { RequestUrl, type HandlerSettings } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdateOfferItem.Data;\n\nconst logError = getErrorLogger(APP_NAME);\n\nconst dispatchErrorEvent = (detail: ErrorData) => {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail,\n });\n window.dispatchEvent(errorEvent);\n};\n\nexport async function updateOfferItemHandler(\n { detail: { choiceId, itemCode, quantity } }: CustomEvent,\n { client, sessionId, tenant }: HandlerSettings,\n) {\n // STEP 1 - Update through API\n try {\n await updateOfferItem({\n client,\n itemCode,\n offerId: choiceId,\n quantity,\n sessionId,\n tenant,\n });\n } catch (error: unknown) {\n const message = String(error);\n logError(`Error while updating offer item in update-offer-item event: ${message}`);\n dispatchErrorEvent({\n isSuccess: false,\n localizedMessage: '',\n message: 'Updating of offer item failed via API call',\n });\n\n return false;\n }\n\n // STEP 2 - Update shopping context via Online endpoint\n const response = await fetch(RequestUrl.GetShoppingContext, getHttpRequestSettings(undefined, HttpMethod.Post));\n\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isUpdateOfferItemFailedResponse(data)) {\n dispatchErrorEvent(data);\n\n return false;\n }\n\n return data;\n}\n","import * as AcceptNotification from '@ori-events/accept-notification';\nimport * as AcceptNotificationFailed from '@ori-events/accept-notification-failed';\nimport * as AddBackorderDemand from '@ori-events/add-backorder-demand';\nimport * as AddBackorderDemandFailed from '@ori-events/add-backorder-demand-failed';\nimport * as AddBasketOffer from '@ori-events/add-basket-offer';\nimport * as AddBasketOfferFailed from '@ori-events/add-basket-offer-failed';\nimport * as AddCatalogueOffer from '@ori-events/add-catalogue-offer';\nimport * as AddCatalogueOfferFailed from '@ori-events/add-catalogue-offer-failed';\nimport * as AddCustomerOrder from '@ori-events/add-customer-order';\nimport * as AddCustomerOrderFailed from '@ori-events/add-customer-order-failed';\nimport * as AddFreeShippingOffer from '@ori-events/add-free-shipping-offer';\nimport * as AddFreeShippingOfferFailed from '@ori-events/add-free-shipping-offer-failed';\nimport * as AddToBasket from '@ori-events/add-to-basket';\nimport * as AddToBasketFailed from '@ori-events/add-to-basket-failed';\nimport * as AddVoucher from '@ori-events/add-voucher';\nimport * as AddVoucherFailed from '@ori-events/add-voucher-failed';\nimport * as CancelBackorderDemand from '@ori-events/cancel-backorder-demand';\nimport * as CancelSubscription from '@ori-events/cancel-subscription';\nimport * as CancelSubscriptionFailed from '@ori-events/cancel-subscription-failed';\nimport * as ClearBasket from '@ori-events/clear-basket';\nimport * as DelaySubscription from '@ori-events/delay-subscription';\nimport * as DelaySubscriptionFailed from '@ori-events/delay-subscription-failed';\nimport * as DeleteOfferItem from '@ori-events/delete-offer-item';\nimport * as DeleteOfferItemFailed from '@ori-events/delete-offer-item-failed';\nimport * as LoyaltyDialogResult from '@ori-events/loyalty-dialog-result';\nimport * as RemoveBasketItem from '@ori-events/remove-basket-item';\nimport * as RemoveBasketItemFailed from '@ori-events/remove-basket-item-failed';\nimport * as RemoveCustomerOrder from '@ori-events/remove-customer-order';\nimport * as RemoveCustomerOrderFailed from '@ori-events/remove-customer-order-failed';\nimport * as RemoveVoucher from '@ori-events/remove-voucher';\nimport * as RemoveVoucherFailed from '@ori-events/remove-voucher-failed';\nimport * as ReplaceShoppingBagItem from '@ori-events/replace-shopping-bag-item';\nimport * as ReplaceShoppingBagItemFailed from '@ori-events/replace-shopping-bag-item-failed';\nimport * as ReplaceSubscription from '@ori-events/replace-subscription';\nimport * as ReplaceSubscriptionFailed from '@ori-events/replace-subscription-failed';\nimport * as RequestShoppingContext from '@ori-events/request-shopping-context';\nimport * as ResetShippingSelection from '@ori-events/reset-shipping-selection';\nimport * as ShoppingContextLoaded from '@ori-events/shopping-context-loaded';\nimport * as UpdateBasketItem from '@ori-events/update-basket-item';\nimport * as UpdateBasketItemFailed from '@ori-events/update-basket-item-failed';\nimport * as UpdateCustomerOrderItem from '@ori-events/update-customer-order-item';\nimport * as UpdateCustomerOrderItemFailed from '@ori-events/update-customer-order-item-failed';\nimport * as UpdateDelivery from '@ori-events/update-delivery';\nimport * as UpdateDeliveryChannel from '@ori-events/update-delivery-channel';\nimport * as UpdateDeliveryChannelFailed from '@ori-events/update-delivery-channel-failed';\nimport * as UpdateDeliveryFailed from '@ori-events/update-delivery-failed';\nimport * as UpdateDonation from '@ori-events/update-donation';\nimport * as UpdateDonationFailed from '@ori-events/update-donation-failed';\nimport * as UpdateOfferItem from '@ori-events/update-offer-item';\nimport * as UpdateOfferItemFailed from '@ori-events/update-offer-item-failed';\nimport * as UpdateOfferItems from '@ori-events/update-offer-items';\nimport * as UpdatePaymentProvider from '@ori-events/update-payment-provider';\nimport * as UpdatePaymentProviderFailed from '@ori-events/update-payment-provider-failed';\n\nimport {\n acceptNotificationHandler,\n addBackorderDemandHandler,\n addBasketOfferHandler,\n addCatalogueOfferHandler,\n addCustomerOrderHandler,\n addFreeShippingOfferHandler,\n addToBasketHandler,\n addVoucherHandler,\n cancelBackorderDemandHandler,\n cancelSubscriptionHandler,\n checkLoyaltyDialogResultAndAddToBasketHandler,\n clearBasketHandler,\n delaySubscriptionHandler,\n deleteOfferItemHandler,\n removeBasketItemHandler,\n removeCustomerOrderHandler,\n removeVoucherHandler,\n replaceShoppingBagItemHandler,\n replaceSubscriptionHandler,\n requestShoppingContextHandler,\n resetShippingSelectionHandler,\n updateBasketItemHandler,\n updateCustomerOrderItemHandler,\n updateDeliveryHandler,\n updateDeliveryChannelHandler,\n updateDonationHandler,\n updateOfferItemHandler,\n updateOfferItemsHandler,\n updatePaymentProviderHandler,\n} from '../handlers';\nimport type { ShoppingContextActionInfo, TriggerActionEventName } from '../types';\n\n/**\n * Configuration of shopping context actions. Mapping of triggering events to response\n * success & failed events and event handlers for the responses.\n */\nexport const shoppingContextActions = new Map([\n [AcceptNotification.Name, { failedEvent: AcceptNotificationFailed.Name, handler: acceptNotificationHandler }],\n [AddBackorderDemand.Name, { failedEvent: AddBackorderDemandFailed.Name, handler: addBackorderDemandHandler }],\n [AddBasketOffer.Name, { failedEvent: AddBasketOfferFailed.Name, handler: addBasketOfferHandler }],\n [AddCatalogueOffer.Name, { failedEvent: AddCatalogueOfferFailed.Name, handler: addCatalogueOfferHandler }],\n [AddCustomerOrder.Name, { failedEvent: AddCustomerOrderFailed.Name, handler: addCustomerOrderHandler }],\n [AddFreeShippingOffer.Name, { failedEvent: AddFreeShippingOfferFailed.Name, handler: addFreeShippingOfferHandler }],\n [AddToBasket.Name, { failedEvent: AddToBasketFailed.Name, handler: addToBasketHandler }],\n [AddVoucher.Name, { failedEvent: AddVoucherFailed.Name, handler: addVoucherHandler }],\n // TODO: no failed event available so far for CancelBackorderDemand\n [CancelBackorderDemand.Name, { handler: cancelBackorderDemandHandler }],\n [CancelSubscription.Name, { failedEvent: CancelSubscriptionFailed.Name, handler: cancelSubscriptionHandler }],\n // TODO: no failed event available so far for ClearBasket\n [ClearBasket.Name, { handler: clearBasketHandler }],\n [DelaySubscription.Name, { failedEvent: DelaySubscriptionFailed.Name, handler: delaySubscriptionHandler }],\n [DeleteOfferItem.Name, { failedEvent: DeleteOfferItemFailed.Name, handler: deleteOfferItemHandler }],\n // TODO: solve better the possible cases for LoyaltyDialogResult - maybe add-to-basket-failed,\n // and don't set up the loading state when just closed dialog (so exception to check for this case)\n [LoyaltyDialogResult.Name, { handler: checkLoyaltyDialogResultAndAddToBasketHandler }],\n [RemoveBasketItem.Name, { failedEvent: RemoveBasketItemFailed.Name, handler: removeBasketItemHandler }],\n [RemoveCustomerOrder.Name, { failedEvent: RemoveCustomerOrderFailed.Name, handler: removeCustomerOrderHandler }],\n [RemoveVoucher.Name, { failedEvent: RemoveVoucherFailed.Name, handler: removeVoucherHandler }],\n [\n ReplaceShoppingBagItem.Name,\n { failedEvent: ReplaceShoppingBagItemFailed.Name, handler: replaceShoppingBagItemHandler },\n ],\n [ReplaceSubscription.Name, { failedEvent: ReplaceSubscriptionFailed.Name, handler: replaceSubscriptionHandler }],\n [RequestShoppingContext.Name, { successEvent: ShoppingContextLoaded.Name, handler: requestShoppingContextHandler }],\n // TODO: no failed event available so far for ResetShippingSelection\n [ResetShippingSelection.Name, { handler: resetShippingSelectionHandler }],\n [UpdateBasketItem.Name, { failedEvent: UpdateBasketItemFailed.Name, handler: updateBasketItemHandler }],\n [\n UpdateCustomerOrderItem.Name,\n { failedEvent: UpdateCustomerOrderItemFailed.Name, handler: updateCustomerOrderItemHandler },\n ],\n [UpdateDelivery.Name, { failedEvent: UpdateDeliveryFailed.Name, handler: updateDeliveryHandler }],\n [\n UpdateDeliveryChannel.Name,\n { failedEvent: UpdateDeliveryChannelFailed.Name, handler: updateDeliveryChannelHandler },\n ],\n [UpdateDonation.Name, { failedEvent: UpdateDonationFailed.Name, handler: updateDonationHandler }],\n [UpdateOfferItem.Name, { failedEvent: UpdateOfferItemFailed.Name, handler: updateOfferItemHandler }],\n // TODO: no failed event available so far for UpdateOfferItems\n [UpdateOfferItems.Name, { handler: updateOfferItemsHandler }],\n [\n UpdatePaymentProvider.Name,\n { failedEvent: UpdatePaymentProviderFailed.Name, handler: updatePaymentProviderHandler },\n ],\n]);\n","import type * as AcceptNotification from '@ori-events/accept-notification';\nimport type { Data as ErrorData, AcceptNotificationResponse } from '@ori-events/accept-notification-failed';\nimport { isAcceptNotificationErrorResponse, Name as ErrorEventName } from '@ori-events/accept-notification-failed';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase } from '../utils';\n\nexport async function acceptNotificationHandler({ detail: { reasonId } }: CustomEvent) {\n const response = await fetch(`${RequestUrl.AcceptNotification}?reasonId=${reasonId}`);\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isAcceptNotificationErrorResponse(data)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as AddBackorderDemand from '@ori-events/add-backorder-demand';\nimport type { AddBackorderDemandResponse, Data as ErrorData } from '@ori-events/add-backorder-demand-failed';\nimport { isAddBackorderDemandErrorResponse, Name as ErrorEventName } from '@ori-events/add-backorder-demand-failed';\nimport type * as BasketUpdated from '@ori-events/basket-updated';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = AddBackorderDemand.Data & PositionData;\n\nexport async function addBackorderDemandHandler({ detail: { lineNumber, placement, quantity } }: CustomEvent) {\n if (typeof quantity === 'number' && quantity > 0) {\n const responseWithQuantity = await fetch(\n `${RequestUrl.UpdateBasketItem}?lineNumber=${lineNumber}&quantity=${quantity}`,\n getHttpRequestSettings({ placement }),\n );\n const dataWithQuantity = convertToCamelCase(\n (await responseWithQuantity.json()) as object,\n );\n\n if (isAddBackorderDemandErrorResponse(dataWithQuantity)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: dataWithQuantity,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n }\n\n const response = await fetch(`${RequestUrl.AddBackorderDemand}?lineNumber=${lineNumber}`, getHttpRequestSettings());\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isAddBackorderDemandErrorResponse(data)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as AddBasketOffer from '@ori-events/add-basket-offer';\nimport { isAddBasketOfferPurchaseEvent } from '@ori-events/add-basket-offer';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { addBasketOffer } from '../utils';\n\ntype Data = AddBasketOffer.Data & PositionData;\ntype PurchaseData = AddBasketOffer.AddBasketOfferPurchaseData & PositionData;\n\nexport async function addBasketOfferHandler(event: CustomEvent) {\n if (isAddBasketOfferPurchaseEvent(event)) {\n const {\n detail: { items, offerId: choiceId, placement },\n } = event as CustomEvent;\n\n return addBasketOffer(RequestUrl.PurchaseBasketOffer, {\n choiceId,\n items,\n placement,\n });\n }\n\n const {\n detail: { offerId, placement },\n } = event as CustomEvent;\n\n return addBasketOffer(RequestUrl.AddBasketOffer, {\n offerId,\n placement,\n });\n}\n","import type * as AddCatalogueOffer from '@ori-events/add-catalogue-offer';\nimport * as AddCatalogueOfferFailed from '@ori-events/add-catalogue-offer-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = AddCatalogueOffer.Data & PositionData;\n\nexport const dispatchAddCatalogueOfferFailedEvent = (detail: AddCatalogueOfferFailed.Data) => {\n const event = new CustomEvent(AddCatalogueOfferFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function addCatalogueOfferHandler({ detail: { offerId, placement } }: CustomEvent) {\n const request = await fetch(\n RequestUrl.AddCatalogueOffer,\n getHttpRequestSettings({ offerId, placement }, HttpMethod.Post),\n );\n\n const response = convertToCamelCase(\n (await request.json()) as object,\n );\n if (AddCatalogueOfferFailed.isAddCatalogueOfferErrorResponse(response)) {\n dispatchAddCatalogueOfferFailedEvent(response);\n\n return false;\n }\n\n return response;\n}\n","import type * as AddCustomerOrder from '@ori-events/add-customer-order';\nimport * as AddCustomerOrderFailed from '@ori-events/add-customer-order-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = AddCustomerOrder.Data & PositionData;\n\nexport async function addCustomerOrderHandler({ detail: { orderIds, placement } }: CustomEvent) {\n const url = new URL(RequestUrl.AddCustomerOrder, window.location.href);\n orderIds.forEach((id) => url.searchParams.append('orderIds', String(id)));\n\n const response = await fetch(url.toString(), getHttpRequestSettings({ placement }));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (AddCustomerOrderFailed.isAddCustomerOrderErrorResponse(data)) {\n const errorEvent = new CustomEvent(AddCustomerOrderFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return {\n ...data,\n lastAddedCustomerOrderIds: orderIds,\n };\n}\n","import type * as AddFreeShippingOffer from '@ori-events/add-free-shipping-offer';\nimport * as AddFreeShippingOfferFailed from '@ori-events/add-free-shipping-offer-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = AddFreeShippingOffer.Data & PositionData;\n\nexport const dispatchAddFreeShippingOfferFailedEvent = (detail: AddFreeShippingOfferFailed.Data) => {\n const event = new CustomEvent(AddFreeShippingOfferFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function addFreeShippingOfferHandler({ detail: { itemCode, placement } }: CustomEvent) {\n const request = await fetch(\n RequestUrl.AddFreeShippingOffer,\n getHttpRequestSettings({ itemCode, placement }, HttpMethod.Post),\n );\n\n const response = convertToCamelCase(\n (await request.json()) as object,\n );\n if (AddFreeShippingOfferFailed.isAddFreeShippingOfferErrorResponse(response)) {\n dispatchAddFreeShippingOfferFailedEvent(response);\n\n return false;\n }\n\n return response;\n}\n","import type * as AddToBasket from '@ori-events/add-to-basket';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { addToBasket, getBuyingUrlAndMethod } from '../utils';\n\ntype Data = AddToBasket.Data & PositionData;\n\nexport async function addToBasketHandler({\n detail: { itemCode, quantity, originalItemCode, replacementType, method: addToBasketMethod, placement },\n}: CustomEvent) {\n const { url, method } = getBuyingUrlAndMethod(addToBasketMethod);\n\n return addToBasket(\n url,\n {\n itemCode,\n quantity,\n originalItemCode,\n replacementType,\n placement,\n },\n method,\n );\n}\n","import * as AddToBasket from '@ori-events/add-to-basket';\n\nimport { RequestUrl } from '../types';\n\ninterface BuyingUrlAndMethod {\n url: string;\n method: AddToBasket.Method;\n}\n\nexport function getBuyingUrlAndMethod(method?: AddToBasket.Method): BuyingUrlAndMethod {\n switch (method) {\n case AddToBasket.Method.BUY_FOR_MONEY:\n return {\n url: RequestUrl.AddToBasketForMoney,\n method: AddToBasket.Method.BUY_FOR_MONEY,\n };\n case AddToBasket.Method.BUY_FOR_POINTS:\n return {\n url: RequestUrl.AddToBasketForPointsRewardShop,\n method: AddToBasket.Method.BUY_FOR_POINTS,\n };\n default:\n return {\n url: RequestUrl.AddToBasketCheckLoyalty,\n method: AddToBasket.Method.BUY_FOR_MONEY,\n };\n }\n}\n","import type * as AddVoucher from '@ori-events/add-voucher';\nimport * as AddVoucherFailed from '@ori-events/add-voucher-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = AddVoucher.Data & PositionData;\n\nconst dispatchAddVoucherFailed = (detail: AddVoucherFailed.Data) => {\n const event = new CustomEvent(AddVoucherFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function addVoucherHandler({ detail: { placement, voucherCode } }: CustomEvent) {\n const fetchUrl = `${RequestUrl.AddVoucher}?voucherCode=${voucherCode}`;\n const response = await fetch(fetchUrl, getHttpRequestSettings({ placement }));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (AddVoucherFailed.isAddVoucherErrorResponse(data)) {\n dispatchAddVoucherFailed(data);\n\n return false;\n }\n\n return data;\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport type * as CancelBackorderDemand from '@ori-events/cancel-backorder-demand';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = CancelBackorderDemand.Data & PositionData;\n\nexport async function cancelBackorderDemandHandler({ detail: { lineNumber, placement } }: CustomEvent) {\n const response = await fetch(\n `${RequestUrl.CancelBackorderDemand}?lineNumber=${lineNumber}`,\n getHttpRequestSettings({ placement }),\n );\n\n return convertToCamelCase((await response.json()) as object);\n}\n","import type * as CancelSubscription from '@ori-events/cancel-subscription';\nimport * as CancelSubscriptionFailed from '@ori-events/cancel-subscription-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = CancelSubscription.Data & PositionData;\n\nexport const dispatchCancelSubscriptionFailedEvent = (detail: CancelSubscriptionFailed.Data) => {\n const event = new CustomEvent(CancelSubscriptionFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function cancelSubscriptionHandler({\n detail: { consumerId, packageId, placement, subscriptionId },\n}: CustomEvent) {\n const response = await fetch(\n `${RequestUrl.CancelSubscription}?consumerId=${consumerId}&subscriptionId=${subscriptionId}&packageId=${packageId}`,\n getHttpRequestSettings({ placement }),\n );\n\n const data = convertToCamelCase(\n (await response.json()) as object,\n );\n\n if (CancelSubscriptionFailed.isCancelSubscriptionErrorResponse(data)) {\n dispatchCancelSubscriptionFailedEvent(data);\n\n return false;\n }\n\n return data;\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\nexport async function clearBasketHandler() {\n const response = await fetch(RequestUrl.ClearBasket, getHttpRequestSettings());\n\n return convertToCamelCase((await response.json()) as object);\n}\n","import type * as DelaySubscription from '@ori-events/delay-subscription';\nimport * as DelaySubscriptionFailed from '@ori-events/delay-subscription-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = DelaySubscription.Data & PositionData;\n\nexport const dispatchDelaySubscriptionFailedEvent = (detail: DelaySubscriptionFailed.Data) => {\n const event = new CustomEvent(DelaySubscriptionFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function delaySubscriptionHandler({\n detail: { cycle, placement, step, subscriptionId },\n}: CustomEvent) {\n const response = await fetch(\n RequestUrl.DelaySubscription,\n getHttpRequestSettings({ cycle, placement, step, subscriptionId }, HttpMethod.Post),\n );\n const data = convertToCamelCase((await response.json()) as object);\n\n if (DelaySubscriptionFailed.isDelaySubscriptionErrorResponse(data)) {\n dispatchDelaySubscriptionFailedEvent(data);\n\n return false;\n }\n\n return data;\n}\n","import * as AddToBasket from '@ori-events/add-to-basket';\nimport * as LoyaltyDialogResult from '@ori-events/loyalty-dialog-result';\n\nimport { RequestUrl } from '../types';\nimport { addToBasket } from '../utils';\n\nexport async function checkLoyaltyDialogResultAndAddToBasketHandler({ detail }: CustomEvent) {\n const { result } = detail;\n\n if (LoyaltyDialogResult.isLoyaltyCloseResult(result)) {\n return false;\n }\n\n if (LoyaltyDialogResult.isLoyaltyBuyForPointsResult(result)) {\n const { catalogueItemId, choiceId, itemCode, quantity, placement } = detail;\n\n return addToBasket(\n RequestUrl.AddToBasketForPoints,\n {\n itemCode,\n quantity,\n choiceId,\n catalogueItemId,\n placement,\n },\n AddToBasket.Method.BUY_FOR_POINTS,\n );\n }\n\n if (LoyaltyDialogResult.isLoyaltyBuyForMoneyResult(result)) {\n const { itemCode, quantity, originalItemCode, replacementType, placement } = detail;\n\n return addToBasket(\n RequestUrl.AddToBasketForMoney,\n {\n itemCode,\n quantity,\n originalItemCode,\n replacementType,\n placement,\n },\n AddToBasket.Method.BUY_FOR_MONEY,\n );\n }\n\n return false;\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport type * as RemoveBasketItem from '@ori-events/remove-basket-item';\nimport * as RemoveBasketItemFailed from '@ori-events/remove-basket-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & RemoveBasketItem.Data;\n\nexport async function removeBasketItemHandler({ detail: { lineNumber, placement } }: CustomEvent) {\n const response = await fetch(\n RequestUrl.RemoveBasketItem,\n getHttpRequestSettings({ lineNumber, placement }, HttpMethod.Post),\n );\n\n const data = convertToCamelCase((await response.json()) as object);\n\n if (RemoveBasketItemFailed.isRemoveBasketItemErrorResponse(data)) {\n const errorEvent = new CustomEvent(RemoveBasketItemFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as RemoveCustomerOrder from '@ori-events/remove-customer-order';\nimport * as RemoveCustomerOrderFailed from '@ori-events/remove-customer-order-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & RemoveCustomerOrder.Data;\n\nexport async function removeCustomerOrderHandler({ detail: { endConsumerOrderId, placement } }: CustomEvent) {\n const fetchUrl = `${RequestUrl.RemoveCustomerOrder}?endConsumerOrderId=${endConsumerOrderId}`;\n\n const response = await fetch(fetchUrl, getHttpRequestSettings({ placement }));\n const data = convertToCamelCase(\n (await response.json()) as object,\n );\n\n if (RemoveCustomerOrderFailed.isRemoveCustomerOrderErrorResponse(data)) {\n const errorEvent = new CustomEvent(RemoveCustomerOrderFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as RemoveVoucher from '@ori-events/remove-voucher';\nimport * as RemoveVoucherFailed from '@ori-events/remove-voucher-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & RemoveVoucher.Data;\n\nconst dispatchRemoveVoucherFailed = (detail: RemoveVoucherFailed.Data) => {\n const event = new CustomEvent(RemoveVoucherFailed.Name, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport async function removeVoucherHandler({ detail: { placement, voucherCode } }: CustomEvent) {\n const fetchUrl = `${RequestUrl.RemoveVoucher}?voucherCode=${voucherCode}`;\n const response = await fetch(fetchUrl, getHttpRequestSettings({ placement }));\n const data = convertToCamelCase((await response.json()) as object);\n\n if (RemoveVoucherFailed.isRemoveVoucherErrorResponse(data)) {\n dispatchRemoveVoucherFailed(data);\n\n return false;\n }\n\n return data;\n}\n","import type * as ReplaceShoppingBagItem from '@ori-events/replace-shopping-bag-item';\nimport * as ReplaceShoppingBagItemFailed from '@ori-events/replace-shopping-bag-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & ReplaceShoppingBagItem.Data;\n\nexport async function replaceShoppingBagItemHandler({\n detail: { itemCode, lineNumber, placement },\n}: CustomEvent) {\n const response = await fetch(\n `${RequestUrl.ReplaceShoppingBagItem}?lineNumber=${lineNumber}&itemCode=${itemCode}`,\n getHttpRequestSettings({ placement }),\n );\n const data = convertToCamelCase(\n (await response.json()) as object,\n );\n\n if (ReplaceShoppingBagItemFailed.isReplaceShoppingBagItemErrorResponse(data)) {\n const errorEvent = new CustomEvent(ReplaceShoppingBagItemFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import {\n type GlobalCustomersSubscriptionItemDto,\n updateCustomerSubscriptionSubscriptionItem,\n type UpdateCustomerSubscriptionSubscriptionItemHeaders,\n} from '@ori/global-api-client-react';\n\nimport type { HandlerSettings } from '../types';\n\ntype ReplaceSubscriptionHandlerSettings = Pick;\n\nexport type ReplaceSubscriptionParams = ReplaceSubscriptionHandlerSettings & {\n globalCustomersSubscriptionItemDto: GlobalCustomersSubscriptionItemDto;\n subscriptionId: number;\n subscriptionItemId: number;\n tenant: string;\n};\n\nexport async function replaceSubscription({\n client,\n customerId,\n globalCustomersSubscriptionItemDto,\n subscriptionId,\n subscriptionItemId,\n tenant,\n}: ReplaceSubscriptionParams) {\n // TODO: Is this needed when there is the tenant prop of ApiProvider applied on some upper level?\n const headers: UpdateCustomerSubscriptionSubscriptionItemHeaders = {\n 'x-tenant-context': tenant,\n };\n\n return updateCustomerSubscriptionSubscriptionItem(\n client,\n customerId,\n subscriptionId,\n subscriptionItemId,\n globalCustomersSubscriptionItemDto,\n headers,\n );\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport * as ShoppingContextLoaded from '@ori-events/shopping-context-loaded';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\nexport async function requestShoppingContextHandler() {\n const response = await fetch(RequestUrl.GetShoppingContext, getHttpRequestSettings(undefined, HttpMethod.Post));\n const data = convertToCamelCase((await response.json()) as object);\n const event = new CustomEvent(ShoppingContextLoaded.Name, {\n detail: data,\n });\n window.dispatchEvent(event);\n\n return data;\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\nexport async function resetShippingSelectionHandler() {\n const response = await fetch(RequestUrl.ResetFreeShippingSelection, getHttpRequestSettings());\n\n return convertToCamelCase((await response.json()) as object);\n}\n","import type * as UpdateBasketItem from '@ori-events/update-basket-item';\nimport type { Data as ErrorData, UpdateBasketItemResponse } from '@ori-events/update-basket-item-failed';\nimport { isUpdateBasketItemErrorResponse, Name as ErrorEventName } from '@ori-events/update-basket-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdateBasketItem.Data;\n\nexport async function updateBasketItemHandler({ detail: { lineNumber, placement, quantity } }: CustomEvent) {\n const response = await fetch(\n `${RequestUrl.UpdateBasketItem}?lineNumber=${lineNumber}&quantity=${quantity}`,\n getHttpRequestSettings({ placement }),\n );\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isUpdateBasketItemErrorResponse(data)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as UpdateCustomerOrderItem from '@ori-events/update-customer-order-item';\nimport * as UpdateCustomerOrderItemFailed from '@ori-events/update-customer-order-item-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdateCustomerOrderItem.Data;\n\nexport async function updateCustomerOrderItemHandler({\n detail: { endConsumerOrderId, itemCode, placement, requestedQuantity },\n}: CustomEvent) {\n const fetchUrl =\n `${RequestUrl.UpdateCustomerOrderItem}` +\n `?endConsumerOrderId=${endConsumerOrderId}` +\n `&itemCode=${itemCode}` +\n `&requestedQuantity=${requestedQuantity}`;\n\n const response = await fetch(fetchUrl, getHttpRequestSettings({ placement }));\n const data = convertToCamelCase(\n (await response.json()) as object,\n );\n\n if (UpdateCustomerOrderItemFailed.isUpdateCustomerOrderItemErrorResponse(data)) {\n const errorEvent = new CustomEvent(UpdateCustomerOrderItemFailed.Name, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as UpdateDelivery from '@ori-events/update-delivery';\nimport type { Data as ErrorData, UpdateDeliveryResponse } from '@ori-events/update-delivery-failed';\nimport { isUpdateDeliveryErrorResponse, Name as ErrorEventName } from '@ori-events/update-delivery-failed';\n\nimport { putRequestOptions } from '../constants/requestOptions';\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase } from '../utils';\n\ntype Data = UpdateDelivery.Data;\n\nexport async function updateDeliveryHandler({\n detail: { deliveryAddressId, deliveryChannelId, registrationId },\n}: CustomEvent) {\n // if needed, start with delivery channel ID update\n if (typeof deliveryChannelId !== 'undefined') {\n const channelRequestOptions = {\n ...putRequestOptions,\n body: JSON.stringify({ deliveryChannelId }),\n };\n const channelResponse = await fetch(RequestUrl.UpdateDeliveryChannel, channelRequestOptions);\n const channelResponseData = convertToCamelCase((await channelResponse.json()) as object);\n\n if (isUpdateDeliveryErrorResponse(channelResponseData)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: channelResponseData,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n }\n\n // delivery address ID update\n const addressParams: {\n addressId: number;\n registrationId?: string;\n } = {\n addressId: deliveryAddressId,\n };\n if (registrationId) {\n addressParams.registrationId = registrationId;\n }\n const addressRequestOptions = {\n ...putRequestOptions,\n body: JSON.stringify(addressParams),\n };\n const addressResponse = await fetch(RequestUrl.UpdateDeliveryAddress, addressRequestOptions);\n const addressResponseData = convertToCamelCase((await addressResponse.json()) as object);\n\n if (isUpdateDeliveryErrorResponse(addressResponseData)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: addressResponseData,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return addressResponseData;\n}\n","import type * as UpdateDeliveryChannel from '@ori-events/update-delivery-channel';\nimport type { Data as ErrorData, UpdateDeliveryChannelResponse } from '@ori-events/update-delivery-channel-failed';\nimport {\n isUpdateDeliveryChannelErrorResponse,\n Name as ErrorEventName,\n} from '@ori-events/update-delivery-channel-failed';\n\nimport { putRequestOptions } from '../constants/requestOptions';\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase } from '../utils';\n\ntype Data = UpdateDeliveryChannel.Data;\n\nexport async function updateDeliveryChannelHandler({ detail: { deliveryChannelId } }: CustomEvent) {\n const requestOptions = {\n ...putRequestOptions,\n body: JSON.stringify({ deliveryChannelId }),\n };\n const response = await fetch(RequestUrl.UpdateDeliveryChannel, requestOptions);\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isUpdateDeliveryChannelErrorResponse(data)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import type * as UpdateDonation from '@ori-events/update-donation';\nimport type { Data as ErrorData, UpdateDonationResponse } from '@ori-events/update-donation-failed';\nimport { isUpdateDonationFailedResponse, Name as ErrorEventName } from '@ori-events/update-donation-failed';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdateDonation.Data;\n\nexport async function updateDonationHandler({ detail: { choiceId, checked } }: CustomEvent) {\n const response = await fetch(\n RequestUrl.UpdateDonation,\n getHttpRequestSettings({ choiceId, checked }, HttpMethod.Post),\n );\n\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isUpdateDonationFailedResponse(data)) {\n const event = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(event);\n\n return false;\n }\n\n return data;\n}\n","import {\n type GlobalShoppingOfferChoiceDtoBody,\n updateShoppingSessionOfferChoice,\n type UpdateShoppingSessionOfferChoiceHeaders,\n} from '@ori/global-api-client-react';\n\nimport type { HandlerSettings } from '../types';\nimport { deleteOfferItem } from './deleteOfferItem';\n\ntype UpdateOfferItemHandlerSettings = Pick;\n\nexport type UpdateOfferItemParams = UpdateOfferItemHandlerSettings & {\n itemCode: string;\n offerId: number;\n quantity: number;\n tenant: string;\n};\n\nexport async function updateOfferItem(params: UpdateOfferItemParams) {\n const { client, itemCode, offerId, quantity, sessionId, tenant } = params;\n\n if (quantity === 0) {\n return deleteOfferItem(params);\n }\n\n const globalShoppingOfferChoiceDtoBody = {\n itemCode,\n quantity,\n } as GlobalShoppingOfferChoiceDtoBody;\n\n // TODO: Is this needed when there is the tenant prop of ApiProvider applied on some upper level?\n const headers: UpdateShoppingSessionOfferChoiceHeaders = {\n 'x-tenant-context': tenant,\n };\n\n return updateShoppingSessionOfferChoice(\n client,\n sessionId,\n offerId,\n itemCode,\n globalShoppingOfferChoiceDtoBody,\n headers,\n );\n}\n","import type * as BasketUpdated from '@ori-events/basket-updated';\nimport type * as UpdateOfferItems from '@ori-events/update-offer-items';\nimport type { PositionData } from '@ori/analytics-data';\nimport { HttpMethod } from '@ori/checkout-utils';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdateOfferItems.Data;\n\nexport async function updateOfferItemsHandler({ detail: { choiceId, items, placement } }: CustomEvent) {\n const response = await fetch(\n RequestUrl.UpdateOfferItems,\n getHttpRequestSettings({ choiceId, items, placement }, HttpMethod.Post),\n );\n\n return convertToCamelCase((await response.json()) as object);\n}\n","import type * as UpdatePaymentProvider from '@ori-events/update-payment-provider';\nimport type { Data as ErrorData, UpdatePaymentProviderResponse } from '@ori-events/update-payment-provider-failed';\nimport {\n isUpdatePaymentProviderFailedResponse,\n Name as ErrorEventName,\n} from '@ori-events/update-payment-provider-failed';\nimport type { PositionData } from '@ori/analytics-data';\n\nimport { RequestUrl } from '../types';\nimport { convertToCamelCase, getHttpRequestSettings } from '../utils';\n\ntype Data = PositionData & UpdatePaymentProvider.Data;\n\nexport async function updatePaymentProviderHandler({ detail: { paymentProviderId, placement } }: CustomEvent) {\n const response = await fetch(\n `${RequestUrl.UpdatePaymentProvider}?paymentProviderId=${paymentProviderId}`,\n getHttpRequestSettings({ placement }),\n );\n const data = convertToCamelCase((await response.json()) as object);\n\n if (isUpdatePaymentProviderFailedResponse(data)) {\n const errorEvent = new CustomEvent(ErrorEventName, {\n detail: data,\n });\n window.dispatchEvent(errorEvent);\n\n return false;\n }\n\n return data;\n}\n","import { getLoggers } from '@ori/checkout-utils';\n\nimport { APP_NAME, DATA_CACHE_TIMEOUT, SCHEDULED_CLEANUP_KEY, USER_COOKIE_NAME } from '../constants';\nimport type { StoredValue } from '../types';\nimport { getCookie } from './cookies';\nimport { adler32 } from './hashes';\n\nconst { logDebug, logWarning, logError } = getLoggers(APP_NAME);\n\nexport const isValidTimestamp = (timestamp: number) => Date.now() - timestamp <= DATA_CACHE_TIMEOUT;\n\n// Both sessionStorage or localStorage could be used here.\n// The sessionStorage doesn't support triggering syncing events on other browser tabs.\n// The sessionStorage should clean up stored data after the browser tab gets closed.\n// But the browser's restore-session-on-reopen functionality may clash with this.\n// Both storage types have no connection with server-side session,\n// so, if working with server session data, manual cleanups / refreshing\n// has to be solved anyway.\nexport const getStorage = () => typeof window === 'object' && window.localStorage;\nexport const isStorageAvailable = () => Boolean(getStorage());\nif (!isStorageAvailable()) {\n logWarning('Storage is not available.');\n}\n\n// In Online session, there should always be some value set.\n// The 'unknown' value is just a fallback for testing.\nexport const getUserCheck = () => adler32((getCookie(USER_COOKIE_NAME) ?? '').trim() || 'unknown');\n\n// TODO: don't we have some util for this already in some NPM?\nconst parseValue = (serializedData: string) => {\n let parsedValue: StoredValue | undefined;\n try {\n parsedValue = JSON.parse(serializedData) as StoredValue;\n } catch (error) {\n logError(`Error parsing serialized data:`, error);\n }\n\n return parsedValue;\n};\n\nexport const getStorageItem = (key: string): T | undefined => {\n const storage = getStorage();\n if (typeof storage !== 'object') {\n return undefined;\n }\n\n const data = storage.getItem(key);\n if (!data) {\n logDebug(`Item with key '${key}' wasn't found in storage.`);\n\n return undefined;\n }\n\n const parsedValue = parseValue(data);\n if (!parsedValue) {\n logError(`Error getting stored item with key '${key}'.`);\n\n return undefined;\n }\n\n const { savedTimestamp, value, userCheck } = parsedValue;\n if (!isValidTimestamp(savedTimestamp)) {\n storage.removeItem(key);\n logDebug(`Stored item with key '${key}' has expired and was deleted.`);\n\n return undefined;\n }\n\n if (userCheck !== getUserCheck()) {\n storage.removeItem(key);\n logDebug(`Item with key '${key}' was stored for different user and was deleted.`);\n\n return undefined;\n }\n\n logDebug(`Item with key ${key} was found in storage.\\n\\t`, parsedValue);\n\n return value;\n};\n\nexport const setStorageItem = (key: string, value: T) => {\n const storage = getStorage();\n if (typeof storage !== 'object') {\n return false;\n }\n\n const data: StoredValue = {\n savedTimestamp: Date.now(),\n value,\n userCheck: getUserCheck(),\n };\n\n try {\n storage.setItem(key, JSON.stringify(data));\n logDebug(`Stored item with key '${key}', value:\\n\\t`, data);\n } catch (error) {\n logError(`Error storing item with ${key}:`, error);\n\n return false;\n }\n\n return true;\n};\n\nexport const removeStorageItem = (key: string) => {\n const storage = getStorage();\n if (typeof storage !== 'object') {\n return false;\n }\n\n try {\n storage.removeItem(key);\n logDebug(`Stored item with key '${key}' was removed.`);\n } catch (error) {\n logError(`Error removing item with key '${key}':`, error);\n\n return false;\n }\n\n return true;\n};\n\nexport const isScheduledCacheCleanup = (): boolean => {\n const storage = getStorage();\n if (typeof storage !== 'object') {\n return false;\n }\n\n const isScheduled = Boolean(storage.getItem(SCHEDULED_CLEANUP_KEY));\n if (isScheduled) {\n logDebug('Cache cleanup was scheduled with last page reload.');\n }\n\n return isScheduled;\n};\n\nexport const removeScheduledCacheCleanup = () => removeStorageItem(SCHEDULED_CLEANUP_KEY);\n\nexport const listenToStoredItemChanges = (key: string, callback?: (value: T | undefined) => unknown) => {\n const storage = getStorage();\n if (typeof storage !== 'object') {\n return undefined;\n }\n\n const eventName = 'storage';\n const eventListener = ((event: StorageEvent) => {\n if (event.storageArea !== storage || event.key !== key) {\n return undefined;\n }\n\n logDebug(`Storage change event from another browser tab was received for item with key '${key}'.`);\n if (event.newValue === null) {\n logDebug(`Stored item with '${key}' was removed in another browser window.`);\n removeStorageItem(key);\n\n return callback?.(undefined);\n }\n\n const parsedValue = parseValue(event.newValue);\n if (!parsedValue) {\n return undefined;\n }\n\n try {\n storage.setItem(key, event.newValue);\n logDebug(`Stored item with key '${key}', value:\\n\\t`, parsedValue);\n } catch (error) {\n logError(`Error storing item with key '${key}':`, error);\n }\n\n return callback?.(parsedValue.value);\n }) as EventListener;\n\n return { eventName, eventListener };\n};\n","export const getCookie = (cookieName: string) => {\n const match = document.cookie.match(new RegExp(`${cookieName}=([^;]+)`));\n\n return match ? match[1] : undefined;\n};\n","export const adler32 = (data: string) => {\n const MOD_ADLER = 65521;\n const BITS_MOVED = 16;\n const { length } = data;\n\n let a = 1;\n let b = 0;\n\n for (let i = 0; i < length; i++) {\n // eslint-disable-next-line unicorn/prefer-code-point -- x\n a += data.charCodeAt(i);\n b += a;\n }\n\n a %= MOD_ADLER;\n b %= MOD_ADLER;\n\n // eslint-disable-next-line no-bitwise -- x\n return (b << BITS_MOVED) | a;\n};\n","import * as BasketUpdated from '@ori-events/basket-updated';\n\nimport type { UpdateEventType } from '../types';\n\nexport const dispatchBasketUpdatedEvent = (\n detail: BasketUpdated.Data,\n eventType: UpdateEventType = BasketUpdated.Name,\n) => {\n const event = new CustomEvent(eventType, {\n detail,\n });\n window.dispatchEvent(event);\n};\n\nexport default dispatchBasketUpdatedEvent;\n","import { getDebugLogger } from '@ori/checkout-utils';\n\nimport { APP_NAME } from '../constants';\n\nconst logDebug = getDebugLogger(APP_NAME);\n\nexport const logReceivedEvent = (event: T) => logDebug(`Received ${event.type} event:\\n\\t`, event);\n","import { getDebugLogger } from '@ori/checkout-utils';\n\nimport { APP_NAME } from '../constants';\n\nconst logDebug = getDebugLogger(APP_NAME);\n\nconst pagePathPatterns = ['/shopping/basket'];\n\nexport const isPageMarkedForCacheCleanup = () => {\n const isCleanupPage = pagePathPatterns.some((item) => window.location.pathname.includes(item));\n if (isCleanupPage) {\n logDebug('Cache cleanup is always requested for current page.');\n }\n\n return isCleanupPage;\n};\n","import { useSpaConfig } from '@ori-appshell/config';\nimport * as BasketUpdated from '@ori-events/basket-updated';\nimport * as PlaceOrderRequested from '@ori-events/place-order-requested';\nimport * as RequestClearShoppingCache from '@ori-events/request-clear-shopping-cache';\nimport * as RequestShoppingContext from '@ori-events/request-shopping-context';\nimport * as ShoppingContextLoaded from '@ori-events/shopping-context-loaded';\nimport { useToken } from '@ori/auth';\nimport { getDebugLogger } from '@ori/checkout-utils';\nimport { useApiClient } from '@ori/global-api-client-react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { APP_NAME, CONTEXT_KEY } from '../constants';\nimport { shoppingContextActions } from '../constants/shoppingContextActions';\nimport type { HandlerSettings, ContextUpdateEventHandler, SuccessEventName } from '../types';\nimport {\n dispatchBasketUpdatedEvent,\n getStorageItem,\n isPageMarkedForCacheCleanup,\n isScheduledCacheCleanup,\n isStorageAvailable,\n listenToStoredItemChanges,\n logReceivedEvent,\n removeStorageItem,\n removeScheduledCacheCleanup,\n setStorageItem,\n} from '../utils';\n\nconst logDebug = getDebugLogger(APP_NAME);\n\nlet isReadyPromiseResolve: (value: PromiseLike | boolean) => void;\n\n/**\n * Promise indicating that shopping bag provider handlers are connected\n * and other components can start communicating with the provider via events.\n */\nexport const isReady = new Promise((resolve) => {\n isReadyPromiseResolve = resolve;\n});\n\ntype EventListenerInfo = {\n eventName: string;\n eventListener: EventListener;\n};\n\nconst getCachedContext = () => getStorageItem(CONTEXT_KEY);\nconst setCachedContext = (value: BasketUpdated.Data) => setStorageItem(CONTEXT_KEY, value);\nconst clearCachedContext = () => removeStorageItem(CONTEXT_KEY);\n\nexport const useBasketProviderData = () => {\n const client = useApiClient();\n const { tenant } = useSpaConfig();\n const { customerId } = useToken();\n\n // Indication that startup shopping context data initialization was done.\n const isInitialShoppingContextApplied = useRef(false);\n\n // Requesting shopping context data usually on application startup has now\n // specific logic involving also this state flag. When true, subsequent coming\n // request-shopping-context events will not trigger additional server requests\n // & it waits for the 1st request to return.\n const isRequestingShoppingContext = useRef(false);\n\n // Current shopping context / shopping session data. This is also being synchronized\n // with the cache on startup & after each update action.\n const [shoppingContext, setShoppingContext] = useState();\n\n const shoppingSessionId = useRef('');\n\n /**\n * Sets current shopping context data state while optionally setting also the cache\n * and/or triggering a requested success response event.\n */\n const updateContext = useCallback(\n (data: BasketUpdated.Data, eventTypeToBeTriggered?: SuccessEventName, shouldStoreData = true) => {\n shoppingSessionId.current = data.sessionId ?? '';\n setShoppingContext(data);\n if (shouldStoreData && isStorageAvailable()) {\n setCachedContext(data);\n logDebug('Stored context was updated with new data:\\n\\t', data);\n } else {\n logDebug('Context was updated with new data:\\n\\t', data);\n }\n if (eventTypeToBeTriggered) {\n logDebug(`Triggering ${eventTypeToBeTriggered} event ...`);\n dispatchBasketUpdatedEvent(data, eventTypeToBeTriggered);\n }\n },\n [],\n );\n\n /** Tries to read last cache and, if found, sets it back into current shopping context state. */\n const getStoredContext = useCallback(() => {\n const data = getCachedContext();\n if (!data) {\n return;\n }\n updateContext(data, undefined, false);\n logDebug('Restored context data from storage.');\n }, [updateContext]);\n\n /** Clears current shopping context data and stored cache. */\n const clearContext = useCallback(() => {\n logDebug('Clearing stored shopping context data ...');\n clearCachedContext();\n setShoppingContext(undefined);\n }, []);\n\n /** Clears shopping context data based on received event. */\n const clearContextOnEvent = useCallback(\n (event: Event) => {\n logReceivedEvent(event);\n clearContext();\n },\n [clearContext],\n );\n\n /** Generic event listener for most update actions. */\n const createEventListener = useCallback(\n (handler: ContextUpdateEventHandler, currentSettings: HandlerSettings) => {\n const result = (async (event: T) => {\n logReceivedEvent(event);\n const data = await handler(event, currentSettings);\n if (data === false) {\n logDebug('Shopping context update failed.');\n } else {\n updateContext(data, BasketUpdated.Name);\n }\n }) as EventListener;\n\n return result;\n },\n [updateContext],\n );\n\n /**\n * Specific event listener for request-shopping-context action.\n * Getting the shopping context data from storage and/or the isRequestingShoppingContext\n * state is involved in this case. If in cache, the data is returned w/o creating\n * another request to server. If the loading already started before, it waits for\n * the original request to return the data.\n */\n const createRequestShoppingContextEventListener = useCallback(\n (handler: ContextUpdateEventHandler, currentSettings: HandlerSettings) => {\n const result = (async (event: T) => {\n logReceivedEvent(event);\n\n if (shoppingContext) {\n const triggerResponse = () => {\n logDebug(`Context data was loaded before. Triggering ${ShoppingContextLoaded.Name} event ...`);\n dispatchBasketUpdatedEvent(shoppingContext, ShoppingContextLoaded.Name);\n };\n\n // postpone a bit to have same events order as when really fetching the data\n setTimeout(() => triggerResponse());\n\n return;\n }\n\n if (isRequestingShoppingContext.current) {\n logDebug('Shopping context was already requested. Waiting for response ...');\n\n return;\n }\n\n logDebug('Loading shopping context ...');\n isRequestingShoppingContext.current = true;\n const data = await handler(event, currentSettings);\n isRequestingShoppingContext.current = false;\n if (data === false) {\n logDebug('Shopping context load failed.');\n } else {\n logDebug('Shopping context was loaded.');\n updateContext(data, ShoppingContextLoaded.Name);\n }\n }) as EventListener;\n\n return result;\n },\n [isRequestingShoppingContext, shoppingContext, updateContext],\n );\n\n /** Creates event listeners for the actions defined in shoppingContextActions list. */\n const getEventListeners = useCallback(\n (currentSettings: HandlerSettings) => {\n const result: EventListenerInfo[] = [];\n for (const [triggerActionEventName, { handler }] of shoppingContextActions.entries()) {\n const eventListenerFactory =\n triggerActionEventName === RequestShoppingContext.Name\n ? createRequestShoppingContextEventListener\n : createEventListener;\n result.push({\n eventName: triggerActionEventName,\n eventListener: eventListenerFactory(handler, currentSettings),\n });\n }\n\n return result;\n },\n [createEventListener, createRequestShoppingContextEventListener],\n );\n\n // setup initial state of shopping context data\n useEffect(() => {\n if (isStorageAvailable() && !isInitialShoppingContextApplied.current) {\n isInitialShoppingContextApplied.current = true;\n if (isPageMarkedForCacheCleanup() || isScheduledCacheCleanup()) {\n removeScheduledCacheCleanup();\n clearContext();\n } else {\n getStoredContext();\n }\n }\n }, [clearContext, getStoredContext]);\n\n // init event listeners\n useEffect(() => {\n const eventListeners = getEventListeners({ client, customerId, sessionId: shoppingSessionId.current, tenant });\n eventListeners.push(\n // This is now called when the user requests creating a new order.\n // That means that the cache should be cleared. But we don't know yet\n // if the create order action succeeds. Getting exact order creation\n // result / success might be problematic, as there are page redirects\n // involved, and after page reload, it is too late for clearing caches.\n // So current solution calls the PlaceOrderRequested event before\n // calling the request on server, so that there is enough time to\n // do this cache cleanup here before the redirects happen.\n // ATM, the redirect is being done in legacy module & this logic might\n // change after rewriting to React.\n {\n eventName: PlaceOrderRequested.Name,\n eventListener: clearContextOnEvent,\n },\n\n // This is now called for other cases when clearing context data is needed.\n {\n eventName: RequestClearShoppingCache.Name,\n eventListener: clearContextOnEvent,\n },\n );\n\n // If there was a change in stored data from another browser tab,\n // if the context value was set, update the context with triggering\n // basket-updated event. Other components need to be informed about\n // the new state & this will not happen on page load, but later.\n // So the basket-updated event should be fine for this.\n if (isStorageAvailable()) {\n const monitoredStorageChanges = listenToStoredItemChanges(CONTEXT_KEY, (value) => {\n if (value) {\n updateContext(value, BasketUpdated.Name, false);\n }\n });\n if (monitoredStorageChanges) {\n const { eventName, eventListener } = monitoredStorageChanges;\n eventListeners.push({ eventName, eventListener });\n }\n }\n\n eventListeners.forEach(({ eventName, eventListener }) => {\n window.addEventListener(eventName, eventListener);\n });\n logDebug('Event listeners are connected.');\n\n // TODO: We publish the promise to window scope & resolve it immediately.\n // Is it worth using promise at all when polling is still needed in consuming components?\n // Maybe the exported isReady promise on module level is still worth it?\n window.isBasketProviderReady = isReady;\n isReadyPromiseResolve(true);\n\n return () => {\n eventListeners.forEach(({ eventName, eventListener }) => {\n window.removeEventListener(eventName, eventListener);\n });\n eventListeners.length = 0;\n logDebug('Old event listeners were disconnected.');\n };\n }, [clearContextOnEvent, client, customerId, getEventListeners, tenant, updateContext]);\n\n const contextValue = useMemo(\n () => ({\n isRequestingShoppingContext,\n isReady,\n shoppingContext,\n }),\n [isRequestingShoppingContext, shoppingContext],\n );\n\n return contextValue;\n};\n","import type { FC } from 'react';\n\nimport { useBasketProviderData } from '../hooks';\n\nexport const BasketProvider: FC = () => {\n useBasketProviderData();\n\n return null;\n};\n","import { useSpaConfig } from '@ori-appshell/config';\nimport { useToken } from '@ori/auth';\nimport { useServiceUrls } from '@ori/configuration-manager';\nimport { ApiClientProvider } from '@ori/global-api-client-react';\nimport type { ReactElement } from 'react';\n\ninterface ApiProviderProps {\n children: ReactElement;\n}\n\nexport const ApiProvider = ({ children }: ApiProviderProps) => {\n const { globalApiUrl } = useServiceUrls(['globalApi']);\n const { tenant } = useSpaConfig();\n const { token } = useToken();\n\n return (\n \n {children}\n \n );\n};\n","import type { FC } from 'react';\n\nimport { BasketProvider } from '../components';\nimport { ApiProvider } from './ApiProvider';\n\nexport const BasketProviderController: FC = () => (\n \n \n \n);\n","import { SpaConfigProvider } from '@ori-appshell/config';\nimport { BasketProviderController } from '@ori/basket-provider-lib';\nimport { ServiceUrlsProvider } from '@ori/configuration-manager';\n\nimport type { ClientAppConfig } from './types';\n\nexport const App = ({ currentLanguage, globalApiUrl, identityUrl, tenant }: ClientAppConfig) => (\n \n \n \n \n \n);\n","import { APP_NAME } from '@ori/basket-provider-lib';\nimport { getErrorLogger } from '@ori/checkout-utils';\nimport { type ReactNode, Component } from 'react';\n\ninterface ErrorBoundaryProps {\n children: JSX.Element;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nconst logError = getErrorLogger(APP_NAME);\n\nexport class ErrorBoundary extends Component {\n override readonly state: ErrorBoundaryState = {};\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { error };\n }\n\n override render(): ReactNode {\n const { error }: ErrorBoundaryState = this.state;\n\n if (error) {\n logError(error);\n\n return null;\n }\n\n const { children }: ErrorBoundaryProps = this.props;\n\n return children;\n }\n}\n","/* istanbul ignore file */\nimport { UniversalTokenProvider, doDevelopmentLogin } from '@ori/auth';\nimport { APP_NAME } from '@ori/basket-provider-lib';\nimport { getDebugLogger } from '@ori/checkout-utils';\nimport { parseClientAppConfig } from '@ori/client-app-config';\nimport { createRoot } from 'react-dom/client';\n\nimport { App } from './App';\nimport { ErrorBoundary } from './containers';\nimport type { ClientAppConfig } from './types';\n\nconst logDebug = getDebugLogger(APP_NAME);\n\n/**\n * React app renderer that is used when app is used as a standalone app\n */\nexport const render = async (configElement: HTMLElement, rootElement: HTMLElement) => {\n const { innerText: config = '' } = configElement;\n const clientAppConfig = parseClientAppConfig(config, [\n 'currentLanguage',\n 'customerId',\n 'globalApiUrl',\n 'identityUrl',\n 'tenant',\n ]);\n logDebug('parsed configuration', clientAppConfig);\n const { customerId, identityUrl, tenant } = clientAppConfig;\n\n if (!identityUrl) {\n throw new Error('Missing Identity URL!');\n }\n\n // Get token for local development\n if (process.env.NODE_ENV !== 'production') {\n // when using Requestly we do not want to load token\n if (process.env.REACT_APP_USE_REQUESTLY === '1') {\n // eslint-disable-next-line no-console -- wanted behavior\n console.log('USING REQUESTLY');\n } else {\n await doDevelopmentLogin({ identityUrl, tenant });\n }\n }\n\n createRoot(rootElement).render(\n \n \n \n \n ,\n );\n};\n"],"names":["Name","isErrorResponse","response","_typeof","isSuccess","isAddBackorderDemandErrorResponse","isAddBasketOfferErrorResponse","Method","isAddToBasketErrorResponse","isAddToBasketLoyaltyResponse","Boolean","loyaltyPoints","LoyaltyDialogResults","Results","BUY_FOR_MONEY","BUY_FOR_POINTS","isUpdateDeliveryErrorResponse","RequestUrl","convertToCamelCase","object","Array","isArray","map","constructor","Object","fromEntries","entries","_ref","_ref2","_slicedToArray","key","value","camelCase","HttpHeader","ContentType","getHttpRequestSettings","data","body","method","arguments","length","undefined","HttpMethod","Get","headers","_defineProperty","Json","placement","finalData","_objectWithoutProperties","_excluded","Placement","bodyValue","JSON","stringify","_objectSpread","credentials","Post","async","addBasketOffer","url","params","fetch","json","AddBasketOfferFailed","event","CustomEvent","detail","window","dispatchEvent","logWarning","getWarningLogger","APP_NAME","MISSING_PLACEMENT_MESSAGE","addToBasket","buyingMethod","itemCode","quantity","AddToBasketFailed","ShowLoyaltyDialog","lastAddedItem","deleteOfferItem","client","offerId","sessionId","tenant","deleteShoppingSessionOfferChoice","logError","getErrorLogger","dispatchErrorEvent","errorEvent","ErrorEventName","putRequestOptions","shoppingContextActions","Map","AcceptNotification","failedEvent","AcceptNotificationFailed","handler","reasonId","concat","isAcceptNotificationErrorResponse","AddBackorderDemand","AddBackorderDemandFailed","_ref$detail","lineNumber","responseWithQuantity","UpdateBasketItem","dataWithQuantity","AddBasketOffer","items","isAddBasketOfferPurchaseEvent","_event$detail","choiceId","PurchaseBasketOffer","_event$detail2","AddCatalogueOffer","AddCatalogueOfferFailed","request","AddCustomerOrder","AddCustomerOrderFailed","orderIds","URL","location","href","forEach","id","searchParams","append","String","toString","lastAddedCustomerOrderIds","AddFreeShippingOffer","AddFreeShippingOfferFailed","AddToBasket","originalItemCode","replacementType","addToBasketMethod","_getBuyingUrlAndMetho","AddToBasketForMoney","AddToBasketForPointsRewardShop","AddToBasketCheckLoyalty","getBuyingUrlAndMethod","AddVoucher","AddVoucherFailed","voucherCode","fetchUrl","CancelBackorderDemand","CancelSubscription","CancelSubscriptionFailed","consumerId","packageId","subscriptionId","ClearBasket","DelaySubscription","DelaySubscriptionFailed","cycle","step","DeleteOfferItem","DeleteOfferItemFailed","error","message","localizedMessage","GetShoppingContext","isDeleteOfferItemErrorResponse","LoyaltyDialogResult","result","CLOSE","catalogueItemId","AddToBasketForPoints","RemoveBasketItem","RemoveBasketItemFailed","RemoveCustomerOrder","RemoveCustomerOrderFailed","endConsumerOrderId","RemoveVoucher","RemoveVoucherFailed","ReplaceShoppingBagItem","ReplaceShoppingBagItemFailed","ReplaceSubscription","ReplaceSubscriptionFailed","droppingId","customerId","globalCustomersSubscriptionItemDto","isReplacementAllowed","subscriptionItemId","updateCustomerSubscriptionSubscriptionItem","replaceSubscription","RequestShoppingContext","successEvent","ShoppingContextLoaded","ResetShippingSelection","ResetFreeShippingSelection","UpdateBasketItemFailed","isUpdateBasketItemErrorResponse","UpdateCustomerOrderItem","UpdateCustomerOrderItemFailed","requestedQuantity","UpdateDelivery","UpdateDeliveryFailed","deliveryAddressId","deliveryChannelId","registrationId","channelRequestOptions","channelResponse","UpdateDeliveryChannel","channelResponseData","addressParams","addressId","addressRequestOptions","addressResponse","UpdateDeliveryAddress","addressResponseData","UpdateDeliveryChannelFailed","requestOptions","isUpdateDeliveryChannelErrorResponse","UpdateDonation","UpdateDonationFailed","checked","isUpdateDonationFailedResponse","UpdateOfferItem","UpdateOfferItemFailed","globalShoppingOfferChoiceDtoBody","updateShoppingSessionOfferChoice","updateOfferItem","isUpdateOfferItemFailedResponse","UpdateOfferItems","UpdatePaymentProvider","UpdatePaymentProviderFailed","paymentProviderId","isUpdatePaymentProviderFailedResponse","_getLoggers","getLoggers","logDebug","getStorage","localStorage","isStorageAvailable","getUserCheck","_getCookie","cookieName","match","a","b","i","charCodeAt","adler32","USER_COOKIE_NAME","document","cookie","RegExp","trim","parseValue","serializedData","parsedValue","parse","getStorageItem","storage","getItem","timestamp","savedTimestamp","userCheck","Date","now","DATA_CACHE_TIMEOUT","removeItem","removeStorageItem","dispatchBasketUpdatedEvent","BasketUpdated","getDebugLogger","logReceivedEvent","type","pagePathPatterns","isReadyPromiseResolve","isReady","Promise","resolve","setCachedContext","setItem","setStorageItem","CONTEXT_KEY","useBasketProviderData","useApiClient","useSpaConfig","useToken","isInitialShoppingContextApplied","useRef","isRequestingShoppingContext","_useState","useState","_useState2","shoppingContext","setShoppingContext","shoppingSessionId","updateContext","useCallback","eventTypeToBeTriggered","_data$sessionId","shouldStoreData","current","getStoredContext","clearContext","clearContextOnEvent","createEventListener","currentSettings","createRequestShoppingContextEventListener","setTimeout","getEventListeners","_step","_iterator","_createForOfIteratorHelper","s","n","done","_step$value","triggerActionEventName","eventListenerFactory","push","eventName","eventListener","err","e","f","useEffect","isCleanupPage","some","item","pathname","includes","isScheduled","SCHEDULED_CLEANUP_KEY","isScheduledCacheCleanup","eventListeners","PlaceOrderRequested","RequestClearShoppingCache","monitoredStorageChanges","callback","storageArea","newValue","listenToStoredItemChanges","addEventListener","isBasketProviderReady","removeEventListener","useMemo","BasketProvider","ApiProvider","children","globalApiUrl","useServiceUrls","token","_jsx","ApiClientProvider","baseUrl","BasketProviderController","App","currentLanguage","identityUrl","ServiceUrlsProvider","serviceUrls","SpaConfigProvider","ErrorBoundary","_Component","_this","_classCallCheck","_len","args","_key","_callSuper","_inherits","_createClass","this","state","props","Component","render","configElement","rootElement","_configElement$innerT","innerText","config","clientAppConfig","parseClientAppConfig","Error","createRoot","UniversalTokenProvider","initialToken"],"sourceRoot":""}