@roomstay/frontend 2.6.100 → 2.6.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/177.bundle.js +1 -1
  2. package/dist/288.bundle.js +1 -1
  3. package/dist/570.bundle.js +1 -0
  4. package/dist/main.bundle.js +1 -1
  5. package/dist/src/components/generic/PromotionalCodeInput.d.ts +2 -0
  6. package/dist/src/components/generic/PromotionalCodeInput.js +142 -0
  7. package/dist/src/components/generic/PromotionalCodeInput.js.map +1 -0
  8. package/dist/src/components/steps/confirmation/StepConfirmationForm.js +3 -0
  9. package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
  10. package/dist/src/components/steps/room/RoomList.js +1 -1
  11. package/dist/src/components/steps/room/RoomList.js.map +1 -1
  12. package/dist/src/components/steps/room/RoomModal.js.map +1 -1
  13. package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRooms.js +1 -1
  14. package/dist/src/components/steps/room/TabGroupedRooms/TabGroupedRooms.js.map +1 -1
  15. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.js +1 -1
  16. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateDescriptionTab.js.map +1 -1
  17. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js +1 -1
  18. package/dist/src/components/steps/room/roomDetails/roomRates/RoomRateRow.js.map +1 -1
  19. package/dist/src/contexts/BookingEngineContext/BookingEngineContextType.types.d.ts +6 -0
  20. package/dist/src/contexts/BookingEngineContext/BookingEngineContextType.types.js.map +1 -1
  21. package/dist/src/contexts/BookingEngineContext/BookingEngineContextWrapper.js +4 -0
  22. package/dist/src/contexts/BookingEngineContext/BookingEngineContextWrapper.js.map +1 -1
  23. package/dist/src/contexts/ErrorContext.js +15 -13
  24. package/dist/src/contexts/ErrorContext.js.map +1 -1
  25. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.d.ts +0 -8
  26. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.js.map +1 -1
  27. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +1 -3
  28. package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
  29. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +17 -8
  30. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
  31. package/dist/src/models/Client/Hotel/Hotel.d.ts +1 -1
  32. package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
  33. package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.js +2 -1
  34. package/dist/src/pages/steps/StepGroupedRoom/StepGroupedRoomComponent.js.map +1 -1
  35. package/dist/src/pages/steps/StepRoom/StepRoomComponent.js +2 -2
  36. package/dist/src/pages/steps/StepRoom/StepRoomComponent.js.map +1 -1
  37. package/dist/src/translations/Translation.d.ts +7 -0
  38. package/dist/src/translations/Translation.js +7 -0
  39. package/dist/src/translations/Translation.js.map +1 -1
  40. package/dist/src/translations/languages/en-gb.js +7 -0
  41. package/dist/src/translations/languages/en-gb.js.map +1 -1
  42. package/dist/test.bundle.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/434.bundle.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RoomRateRow.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/RoomRateRow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,8BAoRC;AA7TD,iDAA0F;AAC1F,2CAAkD;AAClD,4DAAoC;AACpC,+CAAuE;AACvE,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,uEAAgE;AAChE,kEAA2D;AAC3D,iFAA8E;AAC9E,mGAAgG;AAChG,kEAA2D;AAC3D,sHAA8F;AAC9F,gHAAwF;AACxF,6JAE6F;AAC7F,gHAAwF;AAExF,gEAA2C;AAC3C,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C,8BAA8B,CAAC,CAAC,EAAE,YAAY;qBACzD,CAAC,IAED,QAAQ,CAAC,CAAC,CAAC,CACR,8BAAC,kBAAQ,IAAC,MAAM,QAAC,OAAO,QAAC,IAAI,QAAC,OAAO,EAAE,4BAA4B,IAC9D,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CACvC,CACd,CAAC,CAAC,CAAC,CACA,8BAAC,uBAAa,IACV,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,YAAY,EACzB,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,QAAQ,EAAE,CAAC,iBAAiB,EAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,GAC/C,CACL,CACC,CACJ,CACJ;QACN,8BAAC,+CAAqC,IAClC,MAAM,EAAE,YAAY,CAAC,IAAI,EACzB,UAAU,EAAE,YAAY,CAAC,UAAU,EACnC,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,OAAO,EAAE,kBAAkB,GAC7B,CACA,CACT,CAAC;AACN,CAAC","sourcesContent":["import { BasketContext, CompanyContext, FullPageEngineContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport Pill, { PillType } from '@/components/generic/Pill';\nimport { PlanpayPrice } from '@/components/generic/PlanpayPrice/PlanpayPrice';\nimport { TaxInclusionNotice } from '@/components/generic/TaxInclusionNotice/TaxInclusionNotice';\nimport Text, { TextType } from '@/components/generic/Text';\nimport RoomDetailsPriceBlock from '@/components/steps/room/roomDetails/RoomDetailsPriceBlock';\nimport BookNowButton from '@/components/steps/room/roomDetails/roomRates/BookNowButton';\nimport RoomRateDetailsAndPriceBreakdownModal, {\n RoomRateDetailsAndPriceBreakdownModalTabs,\n} from '@/components/steps/room/roomDetails/roomRates/RoomRateDetailsAndPriceBreakdownModal';\nimport RoomRatePills from '@/components/steps/room/roomDetails/roomRates/RoomRatePills';\nimport { InlineRoomMiniEngineConfig } from '@/engines/InlineRoomMiniEngine/InlineRoomMiniEngine';\nimport useCurrency from '@/hooks/Currency';\nimport usePlanpay from '@/hooks/Planpay';\nimport { useRateDetails } from '@/hooks/useRateDetails';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport { TextAlign } from '@/util/TextAlignment';\n\nimport styles from './RoomRateRow.module.scss';\nexport interface RoomRateRowProps extends Pick<InlineRoomMiniEngineConfig, 'policy' | 'priceDescription'> {\n rate: RoomRate;\n\n getButtonLabel?: (isRoomSelectedAndEditing: boolean, isThisSelectedRow: boolean) => string;\n onAddToBasketOverride?: (rate: RoomRate) => void;\n\n isPromoRate?: boolean;\n isCardLayout?: boolean;\n bookNowButtonDisabledReason?: string;\n}\n\nexport default function RoomRateRow(props: RoomRateRowProps) {\n const { roomRateCalendarInteractivity, setRoomRateCalendarInteractivity } = useContext(FullPageEngineContext);\n const ccx = useContext(CompanyContext);\n const basketContext = useContext(BasketContext);\n\n const [viewingModal, setViewingModal] = useState({\n open: false,\n currentTab: RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails,\n });\n\n const { t } = useTranslation();\n const { isAccent2ColorDark } = useCurrentHotel();\n const { isMobile } = useWindowSize();\n const { rate, isCardLayout } = props;\n const selectedRow = basketContext.selectedBasketRow;\n const isRoomSelectedAndEditing = selectedRow?.isValid();\n\n const isThisSelectedRow = selectedRow && rate.name === selectedRow.getRate()?.name && rate.getRoom()?.name === selectedRow.getRoom()?.name;\n\n const currentRow = useRef<HTMLDivElement | null>(null);\n\n const classes = classNames('room-info', {\n '--default': !rate.isMemberOnly,\n '--locked': rate.isMemberOnly,\n '--current': isThisSelectedRow && isRoomSelectedAndEditing,\n '--is-promo': props.isPromoRate,\n });\n\n let isLocked = false;\n\n if (rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n useEffect(() => {\n if (!isLocked) {\n const basketRow = basketContext.selectedBasketRow;\n if (!basketRow) {\n return;\n }\n\n DataLayer.instance.addRoomRateImpression(rate.getRoom(), rate, { to: basketRow.getStartDate(), from: basketRow.getEndDate() }, basketRow.getPromoCode());\n }\n }, [isThisSelectedRow]);\n\n const { rateName, shortDescription } = useRateDetails(rate, isLocked);\n\n const openTab = (tab: RoomRateDetailsAndPriceBreakdownModalTabs) => {\n setViewingModal({ open: true, currentTab: tab });\n };\n\n let bookNowLabel = '';\n if (props.getButtonLabel) {\n bookNowLabel = props.getButtonLabel(isRoomSelectedAndEditing, isThisSelectedRow);\n } else {\n if (isRoomSelectedAndEditing) {\n bookNowLabel = isThisSelectedRow ? t(Translation.Step.Room.RoomInfo.Selected) : (bookNowLabel = t(Translation.Step.Room.RoomInfo.Update));\n } else if (props.bookNowButtonDisabledReason) {\n bookNowLabel = props.bookNowButtonDisabledReason;\n } else {\n bookNowLabel = t(Translation.Misc.BookNow);\n }\n }\n\n const openMemberSignupModalOnClick = () => {\n DataLayer.instance.sendInteraction('Member Signup Modal', InteractionType.LINK, InteractionStep.ROOMS);\n ccx.openMemberSignupModal();\n };\n\n const rateDetailsOnClick = () => {\n DataLayer.instance.sendInteraction('More Rate Details', InteractionType.LINK, InteractionStep.ROOMS);\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails);\n };\n\n useEffect(() => {\n const roomCode = props.rate.getRoom().code;\n if (roomRateCalendarInteractivity?.roomCode === roomCode && props.rate.code === roomRateCalendarInteractivity?.rateCode) {\n //Provided the API response still includes that rate => still open the modal\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails);\n }\n }, [props.rate, roomRateCalendarInteractivity]);\n\n const updateModalOnClose = () => {\n // Clear the modal state\n setRoomRateCalendarInteractivity(null);\n setViewingModal((old) => {\n old.open = false;\n return { ...old };\n });\n };\n\n const openTabOnClick = () => {\n DataLayer.instance.sendInteraction('Rate Breakdown', InteractionType.LINK, InteractionStep.ROOMS);\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.PriceBreakdown);\n };\n\n const shouldTextBeWhite = isAccent2ColorDark && ((isThisSelectedRow && isRoomSelectedAndEditing) || props.isPromoRate);\n const textWhiteOr = (color = Color.Graphite) => {\n return shouldTextBeWhite ? Color.White : color;\n };\n\n const { value: price, isLoading } = useCurrency({\n disableLoading: true,\n hideDecimals: true,\n children: rate.getAveragePrice(true),\n });\n\n const { hasPricePreview } = usePlanpay();\n\n const RoomDetailsPriceBlockSection = () => (\n <div className=\"u-flex flex-column align-items-start align-items-lg-end\">\n <RoomDetailsPriceBlock\n isLocked={isLocked}\n averagePreDiscount={rate.getAveragePriceBeforeDiscount(true)}\n averagePrice={rate.getAveragePrice(true)}\n isMemberOnly={props.rate.isMemberOnly}\n useLightText={shouldTextBeWhite}\n />\n <Text type={TextType.Label} color={textWhiteOr(Color.DarkGrey)} align={isMobile ? TextAlign.Left : TextAlign.Right}>\n <TaxInclusionNotice rate={rate} />\n </Text>\n </div>\n );\n\n const RateTitle = () => {\n if (isLocked) {\n return (\n <Text type={TextType.Body} color={Color.Success}>\n <strong>{t(Translation.Step.Room.RoomInfo.MemberOnlyDeal)}</strong>\n </Text>\n );\n }\n return (\n <div className={classNames(styles['card-layout-rate-title'])}>\n {props.isPromoRate && isCardLayout ? <Icon icon={IconType.Star} /> : null}\n <Text type={TextType.Body} color={textWhiteOr()} bold>\n {rateName}\n </Text>\n </div>\n );\n };\n\n return (\n <div className={classes} ref={currentRow}>\n <div className=\"row\">\n <div\n className={classNames({\n 'col-lg-6': hasPricePreview && !isCardLayout,\n 'col-lg-8': !hasPricePreview && !isCardLayout,\n 'col-lg-12': isCardLayout,\n })}\n >\n <div className=\"u-flex flex-column h-100\">\n <div>\n <div className=\"u-marg-bottom-half\">\n <RateTitle />\n </div>\n <div className=\"u-marg-bottom u-h-ml-5 text-small u-clear-font-weight rdcaf\" style={{ color: textWhiteOr() }}>\n <div dangerouslySetInnerHTML={{ __html: shortDescription ?? '' }} />\n </div>\n {isLocked && (\n <div className=\"u-marg\">\n <span onClick={openMemberSignupModalOnClick}>\n <Pill icon={IconType.Money} type={PillType.Success}>\n {t(Translation.Step.Room.RoomInfo.SignUpToSee)}\n </Pill>\n </span>\n </div>\n )}\n {!isCardLayout ? <RoomRatePills rate={props.rate} rateDescription /> : null}\n </div>\n\n {isCardLayout ? (\n <div className={classNames(styles['card-layout-price-wrapper'])}>\n {props.policy ? (\n <div className={classNames(styles['card-layout-price-policy'])}>\n <Icon icon={IconType.Info} />\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {props.policy}\n </Text>\n </div>\n ) : null}\n <div className={classNames(styles['card-layout-price-row'])}>\n {props.priceDescription ? (\n <div className={classNames(styles['card-layout-price-notes'])}>\n <Text type={TextType.Small} color={Color.Accent}>\n {props.priceDescription}\n </Text>\n </div>\n ) : null}\n <div className={classNames(styles['card-layout-price-info'])}>\n <RoomDetailsPriceBlockSection />\n </div>\n </div>\n </div>\n ) : null}\n\n <div\n className={classNames('u-flex justify-content-start u-marg-top-bottom@l- room-rate-row-navigation-button', {\n [styles['room-rate-row-navigation-button']]: isCardLayout,\n })}\n >\n <div className=\"u-marg-right u-inline-flex\">\n <BEButton\n icon={isCardLayout ? undefined : IconType.ArrowRight2}\n isText\n primary\n size=\"small\"\n iconPosition=\"right\"\n onClick={rateDetailsOnClick}\n textColor={isCardLayout ? Color.Accent : textWhiteOr(Color.Accent)}\n >\n {t(Translation.Step.Room.ReadMore)}\n </BEButton>\n </div>\n <BEButton\n icon={isCardLayout ? undefined : IconType.ArrowRight2}\n isText\n textColor={isCardLayout ? Color.Accent : textWhiteOr(Color.Navy)}\n size=\"small\"\n iconPosition=\"right\"\n onClick={openTabOnClick}\n disabled={isLocked}\n >\n {t(Translation.Step.Room.RoomInfo.ViewPriceBreakdown)}\n </BEButton>\n </div>\n </div>\n </div>\n <div\n className={classNames(\n {\n 'col-lg-6': hasPricePreview && !isCardLayout,\n 'col-lg-4': !hasPricePreview && !isCardLayout,\n 'col-lg-12': isCardLayout,\n },\n 'u-flex flex-column align-items-start align-items-md-start align-items-lg-end justify-content-start'\n )}\n >\n {!isCardLayout ? <RoomDetailsPriceBlockSection /> : null}\n {!isLoading && hasPricePreview ? (\n <div className=\"u-marg-top--light\">\n <PlanpayPrice price={price} checkin={(selectedRow?.getStartDate() || basketContext.endDate).format('YYYY-MM-DD')} currency={ccx.currentCurrency} />\n </div>\n ) : null}\n <div\n className={classNames('u-marg-top--light', {\n [styles['room-rate-row-booknow-button']]: isCardLayout,\n })}\n >\n {isLocked ? (\n <BEButton filled success wide onClick={openMemberSignupModalOnClick}>\n {t(Translation.Step.Room.RoomInfo.RevealPrice)}\n </BEButton>\n ) : (\n <BookNowButton\n rate={rate}\n buttonLabel={bookNowLabel}\n onAddToBasketOverride={props.onAddToBasketOverride}\n isFilled={!isThisSelectedRow}\n disabled={!!props.bookNowButtonDisabledReason}\n />\n )}\n </div>\n </div>\n </div>\n <RoomRateDetailsAndPriceBreakdownModal\n isOpen={viewingModal.open}\n currentTab={viewingModal.currentTab}\n rate={props.rate}\n getButtonLabel={props.getButtonLabel}\n onAddToBasketOverride={props.onAddToBasketOverride}\n onClose={updateModalOnClose}\n />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"RoomRateRow.js","sourceRoot":"/","sources":["src/components/steps/room/roomDetails/roomRates/RoomRateRow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,8BAoRC;AA7TD,iDAAyF;AACzF,2CAAkD;AAClD,4DAAoC;AACpC,+CAAuE;AACvE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CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,eAAe,GAAI,CACjJ,CACT,CAAC,CAAC,CAAC,IAAI;gBACR,uCACI,SAAS,EAAE,IAAA,oBAAU,EAAC,mBAAmB,EAAE;wBACvC,CAAC,iCAAM,CAAC,8BAA8B,CAAC,CAAC,EAAE,YAAY;qBACzD,CAAC,IAED,QAAQ,CAAC,CAAC,CAAC,CACR,8BAAC,kBAAQ,IAAC,MAAM,QAAC,OAAO,QAAC,IAAI,QAAC,OAAO,EAAE,4BAA4B,IAC9D,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CACvC,CACd,CAAC,CAAC,CAAC,CACA,8BAAC,uBAAa,IACV,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,YAAY,EACzB,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,QAAQ,EAAE,CAAC,iBAAiB,EAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,GAC/C,CACL,CACC,CACJ,CACJ;QACN,8BAAC,+CAAqC,IAClC,MAAM,EAAE,YAAY,CAAC,IAAI,EACzB,UAAU,EAAE,YAAY,CAAC,UAAU,EACnC,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,OAAO,EAAE,kBAAkB,GAC7B,CACA,CACT,CAAC;AACN,CAAC","sourcesContent":["import { BasketContext, BookingEngineContext, CompanyContext } from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport Pill, { PillType } from '@/components/generic/Pill';\nimport { PlanpayPrice } from '@/components/generic/PlanpayPrice/PlanpayPrice';\nimport { TaxInclusionNotice } from '@/components/generic/TaxInclusionNotice/TaxInclusionNotice';\nimport Text, { TextType } from '@/components/generic/Text';\nimport RoomDetailsPriceBlock from '@/components/steps/room/roomDetails/RoomDetailsPriceBlock';\nimport BookNowButton from '@/components/steps/room/roomDetails/roomRates/BookNowButton';\nimport RoomRateDetailsAndPriceBreakdownModal, {\n RoomRateDetailsAndPriceBreakdownModalTabs,\n} from '@/components/steps/room/roomDetails/roomRates/RoomRateDetailsAndPriceBreakdownModal';\nimport RoomRatePills from '@/components/steps/room/roomDetails/roomRates/RoomRatePills';\nimport { InlineRoomMiniEngineConfig } from '@/engines/InlineRoomMiniEngine/InlineRoomMiniEngine';\nimport useCurrency from '@/hooks/Currency';\nimport usePlanpay from '@/hooks/Planpay';\nimport { useRateDetails } from '@/hooks/useRateDetails';\nimport { useWindowSize } from '@/hooks/WindowSize';\nimport { RoomRate } from '@/models/Room/RoomRate';\nimport { Color } from '@/util/Color';\nimport DataLayer, { InteractionStep, InteractionType } from '@/util/DataLayer';\nimport { TextAlign } from '@/util/TextAlignment';\n\nimport styles from './RoomRateRow.module.scss';\nexport interface RoomRateRowProps extends Pick<InlineRoomMiniEngineConfig, 'policy' | 'priceDescription'> {\n rate: RoomRate;\n\n getButtonLabel?: (isRoomSelectedAndEditing: boolean, isThisSelectedRow: boolean) => string;\n onAddToBasketOverride?: (rate: RoomRate) => void;\n\n isPromoRate?: boolean;\n isCardLayout?: boolean;\n bookNowButtonDisabledReason?: string;\n}\n\nexport default function RoomRateRow(props: RoomRateRowProps) {\n const ccx = useContext(CompanyContext);\n const basketContext = useContext(BasketContext);\n const { roomRateCalendarInteractivity, setRoomRateCalendarInteractivity } = useContext(BookingEngineContext);\n\n const [viewingModal, setViewingModal] = useState({\n open: false,\n currentTab: RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails,\n });\n\n const { t } = useTranslation();\n const { isAccent2ColorDark } = useCurrentHotel();\n const { isMobile } = useWindowSize();\n const { rate, isCardLayout } = props;\n const selectedRow = basketContext.selectedBasketRow;\n const isRoomSelectedAndEditing = selectedRow?.isValid();\n\n const isThisSelectedRow = selectedRow && rate.name === selectedRow.getRate()?.name && rate.getRoom()?.name === selectedRow.getRoom()?.name;\n\n const currentRow = useRef<HTMLDivElement | null>(null);\n\n const classes = classNames('room-info', {\n '--default': !rate.isMemberOnly,\n '--locked': rate.isMemberOnly,\n '--current': isThisSelectedRow && isRoomSelectedAndEditing,\n '--is-promo': props.isPromoRate,\n });\n\n let isLocked = false;\n\n if (rate.isMemberOnly && !ccx.signedInUser) {\n isLocked = true;\n }\n\n useEffect(() => {\n if (!isLocked) {\n const basketRow = basketContext.selectedBasketRow;\n if (!basketRow) {\n return;\n }\n\n DataLayer.instance.addRoomRateImpression(rate.getRoom(), rate, { to: basketRow.getStartDate(), from: basketRow.getEndDate() }, basketRow.getPromoCode());\n }\n }, [isThisSelectedRow]);\n\n const { rateName, shortDescription } = useRateDetails(rate, isLocked);\n\n const openTab = (tab: RoomRateDetailsAndPriceBreakdownModalTabs) => {\n setViewingModal({ open: true, currentTab: tab });\n };\n\n let bookNowLabel = '';\n if (props.getButtonLabel) {\n bookNowLabel = props.getButtonLabel(isRoomSelectedAndEditing, isThisSelectedRow);\n } else {\n if (isRoomSelectedAndEditing) {\n bookNowLabel = isThisSelectedRow ? t(Translation.Step.Room.RoomInfo.Selected) : (bookNowLabel = t(Translation.Step.Room.RoomInfo.Update));\n } else if (props.bookNowButtonDisabledReason) {\n bookNowLabel = props.bookNowButtonDisabledReason;\n } else {\n bookNowLabel = t(Translation.Misc.BookNow);\n }\n }\n\n const openMemberSignupModalOnClick = () => {\n DataLayer.instance.sendInteraction('Member Signup Modal', InteractionType.LINK, InteractionStep.ROOMS);\n ccx.openMemberSignupModal();\n };\n\n const rateDetailsOnClick = () => {\n DataLayer.instance.sendInteraction('More Rate Details', InteractionType.LINK, InteractionStep.ROOMS);\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails);\n };\n\n useEffect(() => {\n const roomCode = props.rate.getRoom().code;\n if (roomRateCalendarInteractivity?.roomCode === roomCode && props.rate.code === roomRateCalendarInteractivity?.rateCode) {\n //Provided the API response still includes that rate => still open the modal\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.RoomDetails);\n }\n }, [props.rate, roomRateCalendarInteractivity]);\n\n const updateModalOnClose = () => {\n // Clear the modal state\n setRoomRateCalendarInteractivity(null);\n setViewingModal((old) => {\n old.open = false;\n return { ...old };\n });\n };\n\n const openTabOnClick = () => {\n DataLayer.instance.sendInteraction('Rate Breakdown', InteractionType.LINK, InteractionStep.ROOMS);\n openTab(RoomRateDetailsAndPriceBreakdownModalTabs.PriceBreakdown);\n };\n\n const shouldTextBeWhite = isAccent2ColorDark && ((isThisSelectedRow && isRoomSelectedAndEditing) || props.isPromoRate);\n const textWhiteOr = (color = Color.Graphite) => {\n return shouldTextBeWhite ? Color.White : color;\n };\n\n const { value: price, isLoading } = useCurrency({\n disableLoading: true,\n hideDecimals: true,\n children: rate.getAveragePrice(true),\n });\n\n const { hasPricePreview } = usePlanpay();\n\n const RoomDetailsPriceBlockSection = () => (\n <div className=\"u-flex flex-column align-items-start align-items-lg-end\">\n <RoomDetailsPriceBlock\n isLocked={isLocked}\n averagePreDiscount={rate.getAveragePriceBeforeDiscount(true)}\n averagePrice={rate.getAveragePrice(true)}\n isMemberOnly={props.rate.isMemberOnly}\n useLightText={shouldTextBeWhite}\n />\n <Text type={TextType.Label} color={textWhiteOr(Color.DarkGrey)} align={isMobile ? TextAlign.Left : TextAlign.Right}>\n <TaxInclusionNotice rate={rate} />\n </Text>\n </div>\n );\n\n const RateTitle = () => {\n if (isLocked) {\n return (\n <Text type={TextType.Body} color={Color.Success}>\n <strong>{t(Translation.Step.Room.RoomInfo.MemberOnlyDeal)}</strong>\n </Text>\n );\n }\n return (\n <div className={classNames(styles['card-layout-rate-title'])}>\n {props.isPromoRate && isCardLayout ? <Icon icon={IconType.Star} /> : null}\n <Text type={TextType.Body} color={textWhiteOr()} bold>\n {rateName}\n </Text>\n </div>\n );\n };\n\n return (\n <div className={classes} ref={currentRow}>\n <div className=\"row\">\n <div\n className={classNames({\n 'col-lg-6': hasPricePreview && !isCardLayout,\n 'col-lg-8': !hasPricePreview && !isCardLayout,\n 'col-lg-12': isCardLayout,\n })}\n >\n <div className=\"u-flex flex-column h-100\">\n <div>\n <div className=\"u-marg-bottom-half\">\n <RateTitle />\n </div>\n <div className=\"u-marg-bottom u-h-ml-5 text-small u-clear-font-weight rdcaf\" style={{ color: textWhiteOr() }}>\n <div dangerouslySetInnerHTML={{ __html: shortDescription ?? '' }} />\n </div>\n {isLocked && (\n <div className=\"u-marg\">\n <span onClick={openMemberSignupModalOnClick}>\n <Pill icon={IconType.Money} type={PillType.Success}>\n {t(Translation.Step.Room.RoomInfo.SignUpToSee)}\n </Pill>\n </span>\n </div>\n )}\n {!isCardLayout ? <RoomRatePills rate={props.rate} rateDescription /> : null}\n </div>\n\n {isCardLayout ? (\n <div className={classNames(styles['card-layout-price-wrapper'])}>\n {props.policy ? (\n <div className={classNames(styles['card-layout-price-policy'])}>\n <Icon icon={IconType.Info} />\n <Text type={TextType.Small} color={Color.DarkGrey}>\n {props.policy}\n </Text>\n </div>\n ) : null}\n <div className={classNames(styles['card-layout-price-row'])}>\n {props.priceDescription ? (\n <div className={classNames(styles['card-layout-price-notes'])}>\n <Text type={TextType.Small} color={Color.Accent}>\n {props.priceDescription}\n </Text>\n </div>\n ) : null}\n <div className={classNames(styles['card-layout-price-info'])}>\n <RoomDetailsPriceBlockSection />\n </div>\n </div>\n </div>\n ) : null}\n\n <div\n className={classNames('u-flex justify-content-start u-marg-top-bottom@l- room-rate-row-navigation-button', {\n [styles['room-rate-row-navigation-button']]: isCardLayout,\n })}\n >\n <div className=\"u-marg-right u-inline-flex\">\n <BEButton\n icon={isCardLayout ? undefined : IconType.ArrowRight2}\n isText\n primary\n size=\"small\"\n iconPosition=\"right\"\n onClick={rateDetailsOnClick}\n textColor={isCardLayout ? Color.Accent : textWhiteOr(Color.Accent)}\n >\n {t(Translation.Step.Room.ReadMore)}\n </BEButton>\n </div>\n <BEButton\n icon={isCardLayout ? undefined : IconType.ArrowRight2}\n isText\n textColor={isCardLayout ? Color.Accent : textWhiteOr(Color.Navy)}\n size=\"small\"\n iconPosition=\"right\"\n onClick={openTabOnClick}\n disabled={isLocked}\n >\n {t(Translation.Step.Room.RoomInfo.ViewPriceBreakdown)}\n </BEButton>\n </div>\n </div>\n </div>\n <div\n className={classNames(\n {\n 'col-lg-6': hasPricePreview && !isCardLayout,\n 'col-lg-4': !hasPricePreview && !isCardLayout,\n 'col-lg-12': isCardLayout,\n },\n 'u-flex flex-column align-items-start align-items-md-start align-items-lg-end justify-content-start'\n )}\n >\n {!isCardLayout ? <RoomDetailsPriceBlockSection /> : null}\n {!isLoading && hasPricePreview ? (\n <div className=\"u-marg-top--light\">\n <PlanpayPrice price={price} checkin={(selectedRow?.getStartDate() || basketContext.endDate).format('YYYY-MM-DD')} currency={ccx.currentCurrency} />\n </div>\n ) : null}\n <div\n className={classNames('u-marg-top--light', {\n [styles['room-rate-row-booknow-button']]: isCardLayout,\n })}\n >\n {isLocked ? (\n <BEButton filled success wide onClick={openMemberSignupModalOnClick}>\n {t(Translation.Step.Room.RoomInfo.RevealPrice)}\n </BEButton>\n ) : (\n <BookNowButton\n rate={rate}\n buttonLabel={bookNowLabel}\n onAddToBasketOverride={props.onAddToBasketOverride}\n isFilled={!isThisSelectedRow}\n disabled={!!props.bookNowButtonDisabledReason}\n />\n )}\n </div>\n </div>\n </div>\n <RoomRateDetailsAndPriceBreakdownModal\n isOpen={viewingModal.open}\n currentTab={viewingModal.currentTab}\n rate={props.rate}\n getButtonLabel={props.getButtonLabel}\n onAddToBasketOverride={props.onAddToBasketOverride}\n onClose={updateModalOnClose}\n />\n </div>\n );\n}\n"]}
@@ -4,6 +4,10 @@ import type { RoomSort } from '../../providers/RoomSortProvider';
4
4
  import type LocalStorageProvider from '../../providers/storage/LocalStorageProvider';
5
5
  import type SessionProvider from '../../providers/storage/SessionProvider';
6
6
  import type ScreenSize from '../../util/ScreenSize';
7
+ export interface RoomRateCalendarInteractivity {
8
+ roomCode: string;
9
+ rateCode: string;
10
+ }
7
11
  export type BookingEngineContextType = {
8
12
  currentRoomSort: RoomSort;
9
13
  currentRoomRateSort?: RoomSort | undefined;
@@ -17,6 +21,8 @@ export type BookingEngineContextType = {
17
21
  setCurrentRoomRateSort: (sort: RoomSort | undefined) => void;
18
22
  setCurrentFilters: (filters: EngineFilterType) => void;
19
23
  setCurrentGroupedRoomFilters: (filters: GroupedRoomFilters) => void;
24
+ roomRateCalendarInteractivity: RoomRateCalendarInteractivity | null;
25
+ setRoomRateCalendarInteractivity: React.Dispatch<React.SetStateAction<RoomRateCalendarInteractivity | null>>;
20
26
  };
21
27
  export type EngineFilterType = {
22
28
  [code: string]: Filter | null;
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEngineContextType.types.js","sourceRoot":"/","sources":["src/contexts/BookingEngineContext/BookingEngineContextType.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseEngine, BaseEngineConfig } from '@/engines/BaseEngine';\nimport type Filter from '@/models/Room/Filters/Filter';\nimport type { RoomSort } from '@/providers/RoomSortProvider';\nimport type LocalStorageProvider from '@/providers/storage/LocalStorageProvider';\nimport type SessionProvider from '@/providers/storage/SessionProvider';\nimport type ScreenSize from '@/util/ScreenSize';\n\n// TODO: Re-factor to a general Engine / UI Context, to leave the FullPageBookingEngine Logic separate i.e the filters & room sort values\nexport type BookingEngineContextType = {\n currentRoomSort: RoomSort;\n currentRoomRateSort?: RoomSort | undefined;\n currentFilters: EngineFilterType;\n currentGroupedRoomFilters: EngineFilterType;\n\n screenSize: ScreenSize;\n\n engine: BaseEngine<BaseEngineConfig>;\n sessionProvider: SessionProvider;\n storageProvider: LocalStorageProvider;\n\n setCurrentRoomSort: (sort: RoomSort) => void;\n setCurrentRoomRateSort: (sort: RoomSort | undefined) => void;\n setCurrentFilters: (filters: EngineFilterType) => void;\n setCurrentGroupedRoomFilters: (filters: GroupedRoomFilters) => void;\n};\n\nexport type EngineFilterType = { [code: string]: Filter | null };\nexport type GroupedRoomFilters = { [id: string]: any };\n"]}
1
+ {"version":3,"file":"BookingEngineContextType.types.js","sourceRoot":"/","sources":["src/contexts/BookingEngineContext/BookingEngineContextType.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseEngine, BaseEngineConfig } from '@/engines/BaseEngine';\nimport type Filter from '@/models/Room/Filters/Filter';\nimport type { RoomSort } from '@/providers/RoomSortProvider';\nimport type LocalStorageProvider from '@/providers/storage/LocalStorageProvider';\nimport type SessionProvider from '@/providers/storage/SessionProvider';\nimport type ScreenSize from '@/util/ScreenSize';\n\nexport interface RoomRateCalendarInteractivity {\n roomCode: string;\n rateCode: string;\n}\n\n// TODO: Re-factor to a general Engine / UI Context, to leave the FullPageBookingEngine Logic separate i.e the filters & room sort values\nexport type BookingEngineContextType = {\n currentRoomSort: RoomSort;\n currentRoomRateSort?: RoomSort | undefined;\n currentFilters: EngineFilterType;\n currentGroupedRoomFilters: EngineFilterType;\n\n screenSize: ScreenSize;\n\n engine: BaseEngine<BaseEngineConfig>;\n sessionProvider: SessionProvider;\n storageProvider: LocalStorageProvider;\n\n setCurrentRoomSort: (sort: RoomSort) => void;\n setCurrentRoomRateSort: (sort: RoomSort | undefined) => void;\n setCurrentFilters: (filters: EngineFilterType) => void;\n setCurrentGroupedRoomFilters: (filters: GroupedRoomFilters) => void;\n\n // Persists state for RoomRateDetailsAndPriceBreakdownModal\n roomRateCalendarInteractivity: RoomRateCalendarInteractivity | null;\n setRoomRateCalendarInteractivity: React.Dispatch<React.SetStateAction<RoomRateCalendarInteractivity | null>>;\n};\n\nexport type EngineFilterType = { [code: string]: Filter | null };\nexport type GroupedRoomFilters = { [id: string]: any };\n"]}
@@ -49,6 +49,8 @@ function BookingEngineContextWrapper({ engine, children }) {
49
49
  const [currentRoomRateSort, setCurrentRoomRateSort] = (0, react_1.useState)(undefined);
50
50
  const [currentFilters, setCurrentFilters] = (0, react_1.useState)({});
51
51
  const [currentGroupedRoomFilters, setCurrentGroupedRoomFilters] = (0, react_1.useState)({});
52
+ // Persists state for RoomRateDetailsAndPriceBreakdownModal
53
+ const [roomRateCalendarInteractivity, setRoomRateCalendarInteractivity] = (0, react_1.useState)(null);
52
54
  (0, react_1.useEffect)(() => {
53
55
  let isCancelled = false;
54
56
  const onResize = () => {
@@ -82,6 +84,8 @@ function BookingEngineContextWrapper({ engine, children }) {
82
84
  engine,
83
85
  sessionProvider,
84
86
  storageProvider,
87
+ roomRateCalendarInteractivity,
88
+ setRoomRateCalendarInteractivity,
85
89
  };
86
90
  return react_1.default.createElement(contexts_1.BookingEngineContext.Provider, { value: bookingEngineContext }, children);
87
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEngineContextWrapper.js","sourceRoot":"/","sources":["src/contexts/BookingEngineContext/BookingEngineContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,kEAwDC;AApED,iDAA0H;AAC1H,+CAAmD;AAGnD,mEAAwD;AACxD,mEAA2C;AAO3C,SAAgB,2BAA2B,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAoC;IAC9F,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IACpD,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAEpD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAoB,IAAI,CAAC,CAAC;IAEtE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAW,2BAAQ,CAAC,QAAQ,CAAC,CAAC;IACpF,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,E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terType, GroupedRoomFilters } from '@frontend/contexts';\nimport React, { useEffect, useState } from 'react';\n\nimport type { BaseEngine, BaseEngineConfig } from '@/engines/BaseEngine';\nimport { RoomSort } from '@/providers/RoomSortProvider';\nimport ScreenSize from '@/util/ScreenSize';\n\nexport interface BookingEngineContextWrapperProps {\n children: React.ReactNode;\n engine: BaseEngine<BaseEngineConfig>;\n}\n\nexport function BookingEngineContextWrapper({ engine, children }: BookingEngineContextWrapperProps) {\n const sessionProvider = engine.getSessionProvider();\n const storageProvider = engine.getStorageProvider();\n\n const [screenSize, setScreenSize] = useState<ScreenSize | null>(null);\n\n const [currentRoomSort, setCurrentRoomSort] = useState<RoomSort>(RoomSort.PriceLow);\n const [currentRoomRateSort, setCurrentRoomRateSort] = useState<RoomSort | undefined>(undefined);\n const [currentFilters, setCurrentFilters] = useState<EngineFilterType>({});\n const [currentGroupedRoomFilters, setCurrentGroupedRoomFilters] = useState<GroupedRoomFilters>({});\n\n useEffect(() => {\n let isCancelled = false;\n\n const onResize = () => {\n if (!isCancelled) {\n for (const size in ScreenSize) {\n if (window.innerWidth <= Number(size)) {\n setScreenSize(Number(size));\n break;\n }\n }\n }\n };\n\n onResize();\n\n window.addEventListener('resize', onResize);\n\n return () => {\n isCancelled = true;\n\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n const bookingEngineContext: BookingEngineContextType = {\n currentRoomSort,\n currentRoomRateSort,\n currentFilters,\n currentGroupedRoomFilters,\n\n screenSize: screenSize as ScreenSize,\n\n // Setters\n setCurrentRoomSort,\n setCurrentRoomRateSort,\n setCurrentFilters,\n setCurrentGroupedRoomFilters,\n\n engine,\n sessionProvider,\n storageProvider,\n };\n\n return <BookingEngineContext.Provider value={bookingEngineContext}>{children}</BookingEngineContext.Provider>;\n}\n"]}
1
+ {"version":3,"file":"BookingEngineContextWrapper.js","sourceRoot":"/","sources":["src/contexts/BookingEngineContext/BookingEngineContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;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,CAAC,CAAC;QAEF,QAAQ,EAAE,CAAC;QAEX,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAE5C,OAAO,GAAG,EAAE;YACR,WAAW,GAAG,IAAI,CAAC;YAEnB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,oBAAoB,GAA6B;QACnD,eAAe;QACf,mBAAmB;QACnB,cAAc;QACd,yBAAyB;QAEzB,UAAU,EAAE,UAAwB;QAEpC,UAAU;QACV,kBAAkB;QAClB,sBAAsB;QACtB,iBAAiB;QACjB,4BAA4B;QAE5B,MAAM;QACN,eAAe;QACf,eAAe;QAEf,6BAA6B;QAC7B,gCAAgC;KACnC,CAAC;IAEF,OAAO,8BAAC,+BAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,oBAAoB,IAAG,QAAQ,CAAiC,CAAC;AAClH,CAAC","sourcesContent":["import { BookingEngineContext, BookingEngineContextType, EngineFilterType, GroupedRoomFilters, RoomRateCalendarInteractivity } from '@frontend/contexts';\nimport React, { useEffect, useState } from 'react';\n\nimport type { BaseEngine, BaseEngineConfig } from '@/engines/BaseEngine';\nimport { RoomSort } from '@/providers/RoomSortProvider';\nimport ScreenSize from '@/util/ScreenSize';\n\nexport interface BookingEngineContextWrapperProps {\n children: React.ReactNode;\n engine: BaseEngine<BaseEngineConfig>;\n}\n\nexport function BookingEngineContextWrapper({ engine, children }: BookingEngineContextWrapperProps) {\n const sessionProvider = engine.getSessionProvider();\n const storageProvider = engine.getStorageProvider();\n\n const [screenSize, setScreenSize] = useState<ScreenSize | null>(null);\n\n const [currentRoomSort, setCurrentRoomSort] = useState<RoomSort>(RoomSort.PriceLow);\n const [currentRoomRateSort, setCurrentRoomRateSort] = useState<RoomSort | undefined>(undefined);\n const [currentFilters, setCurrentFilters] = useState<EngineFilterType>({});\n const [currentGroupedRoomFilters, setCurrentGroupedRoomFilters] = useState<GroupedRoomFilters>({});\n\n // Persists state for RoomRateDetailsAndPriceBreakdownModal\n const [roomRateCalendarInteractivity, setRoomRateCalendarInteractivity] = useState<RoomRateCalendarInteractivity | null>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n const onResize = () => {\n if (!isCancelled) {\n for (const size in ScreenSize) {\n if (window.innerWidth <= Number(size)) {\n setScreenSize(Number(size));\n break;\n }\n }\n }\n };\n\n onResize();\n\n window.addEventListener('resize', onResize);\n\n return () => {\n isCancelled = true;\n\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n const bookingEngineContext: BookingEngineContextType = {\n currentRoomSort,\n currentRoomRateSort,\n currentFilters,\n currentGroupedRoomFilters,\n\n screenSize: screenSize as ScreenSize,\n\n // Setters\n setCurrentRoomSort,\n setCurrentRoomRateSort,\n setCurrentFilters,\n setCurrentGroupedRoomFilters,\n\n engine,\n sessionProvider,\n storageProvider,\n\n roomRateCalendarInteractivity,\n setRoomRateCalendarInteractivity,\n };\n\n return <BookingEngineContext.Provider value={bookingEngineContext}>{children}</BookingEngineContext.Provider>;\n}\n"]}
@@ -47,21 +47,23 @@ exports.ErrorHandler = {};
47
47
  function ErrorContextWrapper(props) {
48
48
  var _a, _b, _c;
49
49
  const [errors, setErrors] = (0, react_1.useState)([]);
50
- const context = {
51
- addError: (error) => {
52
- error.id = Math.random();
53
- setErrors((oldErrors) => [...oldErrors, error]);
54
- },
50
+ // Improve ErrorHandler
51
+ const pushError = (error) => {
52
+ if (!!(error === null || error === void 0 ? void 0 : error.message)) {
53
+ setErrors((currentErrors) => {
54
+ const exists = currentErrors.some((it) => it.title === error.title && it.message === error.message);
55
+ if (!exists) {
56
+ error.id = Math.random();
57
+ return [...currentErrors, error];
58
+ }
59
+ return currentErrors;
60
+ });
61
+ }
55
62
  };
56
- exports.ErrorHandler.add = (error) => {
57
- setErrors((currentErrors) => {
58
- if (!currentErrors.some((it) => it.title === error.title && it.message === error.message)) {
59
- error.id = Math.random();
60
- return [...currentErrors, error];
61
- }
62
- return currentErrors;
63
- });
63
+ const context = {
64
+ addError: pushError,
64
65
  };
66
+ exports.ErrorHandler.add = pushError;
65
67
  const onCloseModalHandler = () => {
66
68
  if (errors[0].retry) {
67
69
  errors[0].retry();
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorContext.js","sourceRoot":"/","sources":["src/contexts/ErrorContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,kDA4CC;AAzED,+CAAwD;AAExD,qEAA6C;AAE7C,MAAM,UAAU,GAAG,IAAA,YAAI,EAAC,GAAG,EAAE,mDAAQ,uCAAuC,GAAC,CAAC,CAAC;AAgB/E,MAAM,YAAY,GAAG,eAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC;AACxE,kBAAe,YAAY,CAAC;AAMf,QAAA,YAAY,GAA8C,EAAE,CAAC;AAE1E,SAAgB,mBAAmB,CAAC,KAA+B;;IAC/D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAc,EAAE,CAAC,CAAC;IAEtD,MAAM,OAAO,GAAqB;QAC9B,QAAQ,EAAE,CAAC,KAAgB,EAAE,EAAE;YAC3B,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;QACpD,CAAC;KACJ,CAAC;IAEF,oBAAY,CAAC,GAAG,GAAG,CAAC,KAAgB,EAAE,EAAE;QACpC,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE;YACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,CA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ent":["import { IconType } from '@roomstay/ui';\nimport React, { lazy, Suspense, useState } from 'react';\n\nimport Text from '@/components/generic/Text';\n\nconst ErrorModal = lazy(() => import('@/components/generic/modal/ErrorModal'));\n\ninterface ErrorContextType {\n addError: (error: ErrorType) => void;\n}\n\ninterface ErrorType {\n id?: number;\n retry?: () => void;\n message: string;\n title?: string;\n icon?: IconType;\n\n buttonText?: string;\n}\n\nconst ErrorContext = React.createContext<ErrorContextType | null>(null);\nexport default ErrorContext;\n\ninterface ErrorContextWrapperProps {\n children: React.ReactNode;\n}\n\nexport const ErrorHandler: { add: (error: ErrorType) => void } | any = {};\n\nexport function ErrorContextWrapper(props: ErrorContextWrapperProps) {\n const [errors, setErrors] = useState<ErrorType[]>([]);\n\n const context: ErrorContextType = {\n addError: (error: ErrorType) => {\n error.id = Math.random();\n setErrors((oldErrors) => [...oldErrors, error]);\n },\n };\n\n ErrorHandler.add = (error: ErrorType) => {\n setErrors((currentErrors) => {\n if (!currentErrors.some((it) => it.title === error.title && it.message === error.message)) {\n error.id = Math.random();\n return [...currentErrors, error];\n }\n\n return currentErrors;\n });\n };\n const onCloseModalHandler = () => {\n if (errors[0].retry) {\n errors[0].retry();\n }\n errors.shift();\n setErrors(() => [...errors]);\n };\n\n const buttonText = errors?.[0]?.buttonText ?? errors?.[0]?.retry ? 'Retry' : 'Close';\n\n return (\n <>\n <ErrorContext.Provider value={context}>\n {!!errors.length && (\n <Suspense fallback=\"\">\n <ErrorModal title={errors[0].title} closeButtonText={buttonText} open onClose={onCloseModalHandler} icon={errors[0].icon}>\n <Text>{errors[0].message}</Text>\n </ErrorModal>\n </Suspense>\n )}\n {props.children}\n </ErrorContext.Provider>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"ErrorContext.js","sourceRoot":"/","sources":["src/contexts/ErrorContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,kDAiDC;AA9ED,+CAAwD;AAExD,qEAA6C;AA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ACtB,CAAC;QACD,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,0CAAE,UAAU,mCAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,0CAAE,KAAK,EAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAErF,OAAO,CACH;QACI,8BAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO;YAChC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAChB,8BAAC,gBAAQ,IAAC,QAAQ,EAAC,EAAE;gBACjB,8BAAC,UAAU,IAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,QAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;oBACpH,8BAAC,cAAI,QAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAQ,CACvB,CACN,CACd;YACA,KAAK,CAAC,QAAQ,CACK,CACzB,CACN,CAAC;AACN,CAAC","sourcesContent":["import { IconType } from '@roomstay/ui';\nimport React, { lazy, Suspense, useState } from 'react';\n\nimport Text from '@/components/generic/Text';\n\nconst ErrorModal = lazy(() => import('@/components/generic/modal/ErrorModal'));\n\ninterface ErrorContextType {\n addError: (error: ErrorType) => void;\n}\n\ninterface ErrorType {\n id?: number;\n retry?: () => void;\n message: string;\n title?: string;\n icon?: IconType;\n\n buttonText?: string;\n}\n\nconst ErrorContext = React.createContext<ErrorContextType | null>(null);\nexport default ErrorContext;\n\ninterface ErrorContextWrapperProps {\n children: React.ReactNode;\n}\n\nexport const ErrorHandler: { add: (error: ErrorType) => void } | any = {};\n\nexport function ErrorContextWrapper(props: ErrorContextWrapperProps) {\n const [errors, setErrors] = useState<ErrorType[]>([]);\n\n // Improve ErrorHandler\n const pushError = (error: ErrorType) => {\n if (!!error?.message) {\n setErrors((currentErrors) => {\n const exists = currentErrors.some((it) => it.title === error.title && it.message === error.message);\n\n if (!exists) {\n error.id = Math.random();\n return [...currentErrors, error];\n }\n\n return currentErrors;\n });\n }\n };\n\n const context: ErrorContextType = {\n addError: pushError,\n };\n\n ErrorHandler.add = pushError;\n\n const onCloseModalHandler = () => {\n if (errors[0].retry) {\n errors[0].retry();\n }\n errors.shift();\n setErrors(() => [...errors]);\n };\n\n const buttonText = errors?.[0]?.buttonText ?? errors?.[0]?.retry ? 'Retry' : 'Close';\n\n return (\n <>\n <ErrorContext.Provider value={context}>\n {!!errors.length && (\n <Suspense fallback=\"\">\n <ErrorModal title={errors[0].title} closeButtonText={buttonText} open onClose={onCloseModalHandler} icon={errors[0].icon}>\n <Text>{errors[0].message}</Text>\n </ErrorModal>\n </Suspense>\n )}\n {props.children}\n </ErrorContext.Provider>\n </>\n );\n}\n"]}
@@ -18,12 +18,4 @@ export interface FullPageEngineContextType {
18
18
  urlParameters: FullPageBookingEngineUrlParameters;
19
19
  currentStep: Step;
20
20
  setCurrentStep: (step: Step) => void;
21
- roomRateCalendarInteractivity: {
22
- roomCode: string;
23
- rateCode: string;
24
- } | null;
25
- setRoomRateCalendarInteractivity: React.Dispatch<React.SetStateAction<{
26
- roomCode: string;
27
- rateCode: string;
28
- } | null>>;
29
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FullPageEngineContextTypes.js","sourceRoot":"/","sources":["src/contexts/FullPageEngineContext/FullPageEngineContextTypes.ts"],"names":[],"mappings":"","sourcesContent":["import dayjs from 'dayjs';\n\nimport type Step from '@/pages/steps/Step';\n\nexport interface FullPageBookingEngineUrlParameters {\n startDate?: dayjs.Dayjs;\n endDate?: dayjs.Dayjs;\n\n hotelId?: string;\n\n defaultCity?: string;\n\n promoCode?: string;\n promoOnly?: boolean;\n\n promoFeatured?: boolean;\n\n rooms?: {\n adults?: number;\n children?: number;\n infants?: number;\n }[];\n}\n\nexport interface FullPageEngineContextType {\n urlParameters: FullPageBookingEngineUrlParameters;\n\n currentStep: Step;\n setCurrentStep: (step: Step) => void;\n\n // Persists state for RoomRateDetailsAndPriceBreakdownModal\n roomRateCalendarInteractivity: {\n roomCode: string;\n rateCode: string;\n } | null;\n setRoomRateCalendarInteractivity: React.Dispatch<\n React.SetStateAction<{\n roomCode: string;\n rateCode: string;\n } | null>\n >;\n}\n"]}
1
+ {"version":3,"file":"FullPageEngineContextTypes.js","sourceRoot":"/","sources":["src/contexts/FullPageEngineContext/FullPageEngineContextTypes.ts"],"names":[],"mappings":"","sourcesContent":["import dayjs from 'dayjs';\n\nimport type Step from '@/pages/steps/Step';\n\nexport interface FullPageBookingEngineUrlParameters {\n startDate?: dayjs.Dayjs;\n endDate?: dayjs.Dayjs;\n\n hotelId?: string;\n\n defaultCity?: string;\n\n promoCode?: string;\n promoOnly?: boolean;\n\n promoFeatured?: boolean;\n\n rooms?: {\n adults?: number;\n children?: number;\n infants?: number;\n }[];\n}\n\nexport interface FullPageEngineContextType {\n urlParameters: FullPageBookingEngineUrlParameters;\n\n currentStep: Step;\n setCurrentStep: (step: Step) => void;\n}\n"]}
@@ -83,8 +83,6 @@ function FullPageEngineContextWrapper() {
83
83
  const [urlParameters, setUrlParameters] = (0, react_1.useState)({});
84
84
  const [currentStep, setCurrentStep] = (0, react_1.useState)((_b = StepManager_1.default.getStepFromName((_a = beContext.engine.getInitialSession()) === null || _a === void 0 ? void 0 : _a.step)) !== null && _b !== void 0 ? _b : StepManager_1.default.getFirstStep());
85
85
  const [initialStep, setInitialStep] = (0, react_1.useState)(StepManager_1.default.getFirstStep());
86
- // Persists state for RoomRateDetailsAndPriceBreakdownModal
87
- const [roomRateCalendarInteractivity, setRoomRateCalendarInteractivity] = (0, react_1.useState)(null);
88
86
  const { hotel } = (0, hooks_1.useCurrentHotel)();
89
87
  const location = (0, react_router_dom_1.useLocation)();
90
88
  const historyConsistentPush = (0, HistoryConsistentPush_1.useHistoryConsistentPush)();
@@ -292,7 +290,7 @@ function FullPageEngineContextWrapper() {
292
290
  }
293
291
  }
294
292
  }, [hotel === null || hotel === void 0 ? void 0 : hotel.currentRoomSort, hotel === null || hotel === void 0 ? void 0 : hotel.currentRoomRateSort]);
295
- const workingContext = { urlParameters, currentStep, setCurrentStep, roomRateCalendarInteractivity, setRoomRateCalendarInteractivity };
293
+ const workingContext = { urlParameters, currentStep, setCurrentStep };
296
294
  return (react_1.default.createElement(contexts_1.FullPageEngineContext.Provider, { value: workingContext },
297
295
  react_1.default.createElement(contexts_1.ModalContextWrapper, null,
298
296
  react_1.default.createElement(ScrollToTop_1.default, null),
@@ -1 +1 @@
1
- {"version":3,"file":"FullPageEngineContextWrapper.js","sourceRoot":"/","sources":["src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,oEA2XC;AAjbD,iDAQ4B;AAC5B,2CAAkD;AAClD,uDAA+D;AAC/D,kDAA0B;AAC1B,+CAA+D;AAC/D,uDAA+F;AAC/F,uGAA4D;AAE5D,2CAAgD;AAChD,0FAAkE;AAClE,oEAAiE;AACjE,mFAA2D;AAC3D,4EAAoD;AACpD,4DAAyD;AACzD,yEAAyE;AACzE,oEAAkE;AAClE,mEAA2C;AAC3C,0FAAkE;AAClE,0FAAkE;AAClE,2FAAgG;AAChG,4GAAoF;AACpF,wEAAgD;AAChD,8FAAsE;AAEtE,kFAA0D;AAC1D,sHAA8F;AAC9F,oGAA4E;AAC5E,0FAAkE;AAClE,kGAA0E;AAC1E,kFAA0D;AAC1D,qEAA6C;AAC7C,sDAA6C;AAC7C,qEAA6C;AAE7C,yDAAsD;AACtD,yDAAsD;AAEtD,MAAM,aAAa,GAAG,eAAK,CAA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OAAO,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,QAAQ,EAAE,mCAAI,EAAE,EACvE,OAAO,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,EAAE,EAC9B,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,mBAAmB,GAC/B,CACW,GAEvB,CACL;oBAGD,8BAAC,wBAAK,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,8BAAC,2BAAQ,IAAC,EAAE,EAAE,qBAAW,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,EAAE,OAAO,SAAG,GAAI,CAC1F,CACH,CACZ;YAED,8BAAC,2BAAY,OAAG,CACE,CACO,CACpC,CAAC;AACN,CAAC","sourcesContent":["import {\n BasketContext,\n BookingEngineContext,\n CompanyContext,\n FullPageBookingEngineUrlParameters,\n FullPageEngineContext,\n FullPageEngineContextType,\n ModalContextWrapper,\n} from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { PurchaseGiftCardEngine } from '@roomstay/gc-frontend';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { Navigate, Route, Routes, useLocation, useMatch, useNavigate } from 'react-router-dom';\nimport StepRoute from 'routes/NaturallyProgressedStepRoute';\n\nimport { API_DATE_FORMAT } from '@/api/BaseAPI';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport { RoomstayMark } from '@/components/generic/RoomstayMark';\nimport ScrollToTop from '@/components/generic/ScrollToTop';\nimport Header from '@/components/navigation/Header';\nimport { PrivateRoute } from '@/containers/PrivateRoute';\nimport { useHistoryConsistentPush } from '@/hooks/HistoryConsistentPush';\nimport { EAppQueryParameters } from '@/models/AppQueryParameters';\nimport BasketRow from '@/models/BasketRow';\nimport RateTypeFilter from '@/models/Room/Filters/RateTypeFilter';\nimport RoomTypeFilter from '@/models/Room/Filters/RoomTypeFilter';\nimport FindReservation, { EFindReservationPath } from '@/pages/findReservation/FindReservation';\nimport FindReservationResults from '@/pages/findReservation/FindReservationResults';\nimport HotelInfo from '@/pages/hotel/HotelInfo';\nimport HotelInfoPlaceholder from '@/pages/hotel/HotelInfoPlaceholder';\nimport Step from '@/pages/steps/Step';\nimport StepHotel from '@/pages/steps/StepHotel/StepHotel';\nimport DerbysoftClickTrackingFeature from '@/providers/feature/DerbysoftClickTrackingFeature';\nimport FeaturedPromoFeature from '@/providers/feature/FeaturedPromoFeature';\nimport GiftCardFeature from '@/providers/feature/GiftCardFeature';\nimport MemberPortalFeature from '@/providers/feature/MemberPortalFeature';\nimport FeatureProvider from '@/providers/FeatureProvider';\nimport getStepRoom from '@/util/GetStepRoom';\nimport { ROUTES } from '@/util/RouteManager';\nimport StepManager from '@/util/StepManager';\n\nimport { EngineBodyLayout } from './EngineBodyLayout';\nimport { EnginePageLayout } from './EnginePageLayout';\n\nconst AccountRouter = React.lazy(() =>\n import('@/pages/account/AccountRouter').then(({ AccountRouter }) => ({\n default: AccountRouter,\n }))\n);\n\ndeclare const GIFT_CARD_API_URL: string;\ndeclare const GIFT_CARD_ASSET_URL: string;\n\nexport function FullPageEngineContextWrapper() {\n const basketContext = useContext(BasketContext);\n const ccx = useContext(CompanyContext);\n const beContext = useContext(BookingEngineContext);\n\n const [engineReady, setEngineReady] = useState(false);\n const [urlFlagsParsed, setUrlFlagsParsed] = useState(false);\n const [urlParameters, setUrlParameters] = useState<FullPageBookingEngineUrlParameters>({});\n\n const [currentStep, setCurrentStep] = useState<Step>(StepManager.getStepFromName(beContext.engine.getInitialSession()?.step as string) ?? StepManager.getFirstStep());\n const [initialStep, setInitialStep] = useState<Step>(StepManager.getFirstStep());\n // Persists state for RoomRateDetailsAndPriceBreakdownModal\n const [roomRateCalendarInteractivity, setRoomRateCalendarInteractivity] = useState<{ roomCode: string; rateCode: string } | null>(null);\n\n const { hotel } = useCurrentHotel();\n\n const location = useLocation();\n const historyConsistentPush = useHistoryConsistentPush();\n const navigate = useNavigate();\n\n const isInStepRoot = useMatch(StepManager.STEP_BASE);\n\n useEffect(() => {\n beContext.sessionProvider?.updateSession({ step: currentStep.getName() });\n\n if (currentStep === StepHotel) {\n ccx.changeHotel(null);\n }\n }, [currentStep]);\n\n useEffect(() => {\n if (hotel?.company?.enableDerbysoftFeed) {\n FeatureProvider.load(DerbysoftClickTrackingFeature);\n }\n }, [hotel?.company?.enableDerbysoftFeed]);\n\n useEffect(() => {\n const currentBasketRows = basketContext.currentBasketRows;\n\n let addXRooms = 1;\n\n // TODO: this probably needs to be the only place this is set, and listen for URL changes\n if (currentBasketRows.length === 0) {\n const urlParameterBuilder: FullPageBookingEngineUrlParameters = {};\n // The Choose Hotel step should not apply the room filter\n const shouldEnableRoomCodeFilter = currentStep.getName() !== StepHotel.getName();\n\n if (location.search) {\n const query = new URLSearchParams(location.search);\n\n const format = API_DATE_FORMAT;\n\n let start = dayjs(query.get(EAppQueryParameters.Arrive), format);\n let end = dayjs(query.get(EAppQueryParameters.Depart), format);\n\n const promoCode = query.get(EAppQueryParameters.PromoCode);\n const promoOnly = query.get(EAppQueryParameters.PromoOnly);\n\n const promoFeatured = query.get(EAppQueryParameters.PromoFeatured);\n\n if (promoCode) {\n urlParameterBuilder.promoCode = promoCode;\n }\n\n if (promoOnly && promoOnly.toLowerCase() !== 'false') {\n urlParameterBuilder.promoOnly = Boolean(promoOnly);\n }\n\n if (promoFeatured && promoFeatured.toLowerCase() !== 'false') {\n FeatureProvider.load(FeaturedPromoFeature);\n urlParameterBuilder.promoFeatured = true;\n }\n\n const updatedCurrentFilters = { ...beContext.currentFilters };\n const roomCode = query.get(EAppQueryParameters.Room);\n\n if (roomCode && shouldEnableRoomCodeFilter) {\n // TODO: Refactor this to come from this context instead.\n updatedCurrentFilters['RoomType'] = new RoomTypeFilter([roomCode]);\n }\n\n const rateCode = query.get(EAppQueryParameters.Rate);\n if (rateCode) {\n // TODO: Refactor this to come from this context instead.\n updatedCurrentFilters['RateType'] = new RateTypeFilter([rateCode]);\n }\n beContext.setCurrentFilters(updatedCurrentFilters);\n\n const hotelId = query.get(EAppQueryParameters.Hotel);\n\n if (hotelId) {\n if (ccx.changeHotel(hotelId)) {\n if (!start.isValid()) {\n start = dayjs().add(1, 'day');\n }\n\n if (!end.isValid()) {\n end = start.add(1, 'day');\n }\n\n setInitialStep(getStepRoom());\n }\n\n urlParameterBuilder.hotelId = hotelId;\n }\n\n const defaultCity = query.get(EAppQueryParameters.DefaultCity);\n if (defaultCity) {\n urlParameterBuilder.defaultCity = defaultCity;\n }\n\n // We're doing dates last, as other properties, like hotelID might change them if they're not already set\n if (start.isValid() && end.isValid()) {\n const today = dayjs().startOf('day');\n\n if (start.isBefore(today)) {\n start = today;\n }\n\n if (end.isBefore(start) || end.isSame(start)) {\n end = start.add(1, 'day');\n } else if (end.isBefore(today.add(1, 'day')) || end.isSame(today)) {\n end = today.add(1, 'day');\n }\n\n urlParameterBuilder.startDate = start;\n urlParameterBuilder.endDate = end;\n }\n\n const parseQueryInt = (key: string, min = 0): number | undefined => {\n const value = Number.parseInt(query.get(key) ?? '', 10);\n return Number.isNaN(value) || value < min ? undefined : value;\n };\n\n addXRooms = parseQueryInt(EAppQueryParameters.Rooms, 1) ?? 1;\n const globalAdults = parseQueryInt(EAppQueryParameters.Adults, 1);\n const globalChildren = parseQueryInt(EAppQueryParameters.Children);\n const globalInfants = parseQueryInt(EAppQueryParameters.Infants);\n\n urlParameterBuilder.rooms = [];\n\n for (let i = 0; i < addXRooms; i++) {\n let roomOccupancy = 1;\n\n let adults = parseQueryInt(`adults-${i + 1}`, 1) ?? globalAdults;\n query.delete(`adults-${i + 1}`);\n\n if (adults && hotel?.maxOccupancy && (roomOccupancy = adults) > hotel.maxOccupancy) {\n adults = undefined;\n }\n\n let children = parseQueryInt(`children-${i + 1}`) ?? globalChildren;\n query.delete(`children-${i + 1}`);\n\n if (children && hotel?.maxOccupancy && (roomOccupancy += children) > hotel.maxOccupancy) {\n children = undefined;\n }\n\n let infants = parseQueryInt(`infants-${i + 1}`) ?? globalInfants;\n query.delete(`infants-${i + 1}`);\n\n if (infants && hotel?.maxOccupancy && hotel.countInfantsInOccupancy && (roomOccupancy += infants) > hotel.maxOccupancy) {\n infants = undefined;\n }\n\n urlParameterBuilder.rooms[i] = { adults, children, infants };\n }\n\n navigate({ search: query.toString() }, { replace: true });\n setUrlParameters(urlParameterBuilder);\n }\n\n let firstBasketRow: BasketRow | undefined = undefined;\n const { startDate, endDate, promoCode, promoOnly, rooms } = urlParameterBuilder;\n for (let i = 0; i < addXRooms; i++) {\n const { adults, children, infants } = rooms?.[i] ?? {};\n const basketRow = new BasketRow(undefined, undefined, shouldEnableRoomCodeFilter);\n\n if (startDate) {\n basketRow.setStartDate(startDate);\n }\n\n if (endDate) {\n basketRow.setEndDate(endDate);\n }\n\n if (promoCode) {\n basketRow.setPromoCode(promoCode);\n }\n\n if (promoOnly) {\n basketRow.setPromoOnly(promoOnly);\n }\n\n if (adults) {\n basketRow.setAdults(adults);\n }\n\n if (children) {\n basketRow.setChildren(children);\n }\n\n if (infants) {\n basketRow.setInfants(infants);\n }\n\n basketContext.addBasketRow(basketRow);\n\n if (i === 0) {\n firstBasketRow = basketRow;\n }\n }\n\n if (firstBasketRow?.getStartDate() && firstBasketRow.getEndDate() && StepManager.getFirstStep() !== StepHotel) {\n basketContext.selectBasketRow(firstBasketRow);\n setInitialStep(getStepRoom());\n }\n } else {\n const initialSession = beContext.engine.getInitialSession();\n if (initialSession) {\n setInitialStep(StepManager.getStepFromName(initialSession.step) as Step);\n }\n }\n\n setUrlFlagsParsed(true);\n }, []);\n\n /**\n * Engine Ready useEffect, used to deffer loading the UI until everything engine wise is set up properly\n */\n useEffect(() => {\n if (!engineReady) {\n if (ccx.hotels.length > 0 && urlFlagsParsed) {\n setEngineReady(true);\n }\n }\n }, [ccx.hotels, urlFlagsParsed]);\n\n useEffect(() => {\n if (engineReady) {\n if (isInStepRoot && initialStep) {\n // We want to respect the browsers pathname, and only redirect to a defined step if\n // the pathname isn't set, or matches an unknown page.\n\n // Is the current location in the path? i.e does the user want to be somewhere specific\n let pathInLoadedSteps = false;\n for (const step of StepManager.getSteps()) {\n // Using match instead of equals as some clients have skipped the trailing slash\n // We also want to make sure to only match the start of the path, in case step contains nested paths.\n if (location.pathname.match(new RegExp(`${step.getStepUrl()}.+`, 'ig'))) {\n pathInLoadedSteps = true;\n break;\n }\n }\n\n // We're in /step/ but on a not recognized one.\n if (!pathInLoadedSteps) {\n historyConsistentPush(initialStep.getStepUrl());\n }\n }\n }\n }, [engineReady]);\n\n useEffect(() => {\n if (hotel) {\n if (hotel.currentRoomSort) {\n beContext.setCurrentRoomSort(hotel.currentRoomSort);\n }\n if (hotel.currentRoomRateSort) {\n beContext.setCurrentRoomRateSort(hotel.currentRoomRateSort);\n }\n }\n }, [hotel?.currentRoomSort, hotel?.currentRoomRateSort]);\n\n const workingContext: FullPageEngineContextType = { urlParameters, currentStep, setCurrentStep, roomRateCalendarInteractivity, setRoomRateCalendarInteractivity };\n\n return (\n <FullPageEngineContext.Provider value={workingContext}>\n <ModalContextWrapper>\n <ScrollToTop />\n <header className=\"engine-header\">\n <Header />\n </header>\n\n {engineReady && (\n <Routes>\n <Route path=\"/\" element={<Navigate to={StepManager.getFirstStep().getStepUrl()} replace />} />\n\n <Route path=\"/step\" element={<EngineBodyLayout />}>\n {StepManager.getSteps().map((step: Step) => (\n <Route key={step.getName()} path={`${step.getStepUrl()}*`} element={<StepRoute step={step} />} />\n ))}\n </Route>\n\n {/**\n * We aren't on a /step/ path, or the root path, so it's probably one of the engine-page paths.\n * If no matching path is found, we'll redirect back to the first step.\n */}\n <Route path=\"/*\" element={<EnginePageLayout />}>\n {/* TODO: This startsWith('/') check should be temporary. We should update the Route in client config after this is merged. */}\n <Route\n path={ROUTES.HOTEL_INFO.startsWith('/') ? ROUTES.HOTEL_INFO.substring(1) : ROUTES.HOTEL_INFO}\n element={\n <React.Suspense fallback={<HotelInfoPlaceholder />}>\n <HotelInfo />\n </React.Suspense>\n }\n />\n\n {Object.values(EFindReservationPath)\n .filter((path) => MemberPortalFeature.isActive() || path === EFindReservationPath.FindReservation)\n .map((path) => (\n <Route\n key={path}\n path={path}\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <FindReservation />\n </React.Suspense>\n }\n />\n ))}\n\n <Route\n path=\"find-reservation/:ref/:email\"\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <FindReservationResults />\n </React.Suspense>\n }\n />\n\n <Route\n path=\"account/*\"\n element={\n <PrivateRoute>\n {MemberPortalFeature.isActive() && (\n <React.Suspense\n fallback={\n <div>\n <LargeLoader />\n </div>\n }\n >\n <AccountRouter />\n </React.Suspense>\n )}\n </PrivateRoute>\n }\n />\n\n {GiftCardFeature.isActive() && GiftCardFeature.config && (\n <Route\n path=\"gift-cards/purchase\"\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <PurchaseGiftCardEngine\n companyId={GiftCardFeature.config.companyId}\n companyName={hotel?.name ?? ''}\n logoUrl={GiftCardFeature.config.logoUrl ?? hotel?.logo.toString() ?? ''}\n homeUrl={hotel?.hotelUrl ?? ''}\n apiUrl={GIFT_CARD_API_URL}\n assetUrl={GIFT_CARD_ASSET_URL}\n />\n </React.Suspense>\n }\n />\n )}\n\n {/* We haven't found a matching path, so just redirect to the first step. */}\n <Route path=\"*\" element={<Navigate to={StepManager.getFirstStep().getStepUrl()} replace />} />\n </Route>\n </Routes>\n )}\n\n <RoomstayMark />\n </ModalContextWrapper>\n </FullPageEngineContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"FullPageEngineContextWrapper.js","sourceRoot":"/","sources":["src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,oEAyXC;AA/aD,iDAQ4B;AAC5B,2CAAkD;AAClD,uDAA+D;AAC/D,kDAA0B;AAC1B,+CAA+D;AAC/D,uDAA+F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F,IAAI,EAAC,qBAAqB,EAC1B,OAAO,EACH,8BAAC,eAAK,CAAC,QAAQ,IAAC,QAAQ,EAAE,wDAAqB;4BAC3C,8BAAC,oCAAsB,IACnB,SAAS,EAAE,yBAAe,CAAC,MAAM,CAAC,SAAS,EAC3C,WAAW,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,mCAAI,EAAE,EAC9B,OAAO,EAAE,MAAA,MAAA,yBAAe,CAAC,MAAM,CAAC,OAAO,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,QAAQ,EAAE,mCAAI,EAAE,EACvE,OAAO,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,EAAE,EAC9B,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,mBAAmB,GAC/B,CACW,GAEvB,CACL;oBAGD,8BAAC,wBAAK,IAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,8BAAC,2BAAQ,IAAC,EAAE,EAAE,qBAAW,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,EAAE,OAAO,SAAG,GAAI,CAC1F,CACH,CACZ;YAED,8BAAC,2BAAY,OAAG,CACE,CACO,CACpC,CAAC;AACN,CAAC","sourcesContent":["import {\n BasketContext,\n BookingEngineContext,\n CompanyContext,\n FullPageBookingEngineUrlParameters,\n FullPageEngineContext,\n FullPageEngineContextType,\n ModalContextWrapper,\n} from '@frontend/contexts';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport { PurchaseGiftCardEngine } from '@roomstay/gc-frontend';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { Navigate, Route, Routes, useLocation, useMatch, useNavigate } from 'react-router-dom';\nimport StepRoute from 'routes/NaturallyProgressedStepRoute';\n\nimport { API_DATE_FORMAT } from '@/api/BaseAPI';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport { RoomstayMark } from '@/components/generic/RoomstayMark';\nimport ScrollToTop from '@/components/generic/ScrollToTop';\nimport Header from '@/components/navigation/Header';\nimport { PrivateRoute } from '@/containers/PrivateRoute';\nimport { useHistoryConsistentPush } from '@/hooks/HistoryConsistentPush';\nimport { EAppQueryParameters } from '@/models/AppQueryParameters';\nimport BasketRow from '@/models/BasketRow';\nimport RateTypeFilter from '@/models/Room/Filters/RateTypeFilter';\nimport RoomTypeFilter from '@/models/Room/Filters/RoomTypeFilter';\nimport FindReservation, { EFindReservationPath } from '@/pages/findReservation/FindReservation';\nimport FindReservationResults from '@/pages/findReservation/FindReservationResults';\nimport HotelInfo from '@/pages/hotel/HotelInfo';\nimport HotelInfoPlaceholder from '@/pages/hotel/HotelInfoPlaceholder';\nimport Step from '@/pages/steps/Step';\nimport StepHotel from '@/pages/steps/StepHotel/StepHotel';\nimport DerbysoftClickTrackingFeature from '@/providers/feature/DerbysoftClickTrackingFeature';\nimport FeaturedPromoFeature from '@/providers/feature/FeaturedPromoFeature';\nimport GiftCardFeature from '@/providers/feature/GiftCardFeature';\nimport MemberPortalFeature from '@/providers/feature/MemberPortalFeature';\nimport FeatureProvider from '@/providers/FeatureProvider';\nimport getStepRoom from '@/util/GetStepRoom';\nimport { ROUTES } from '@/util/RouteManager';\nimport StepManager from '@/util/StepManager';\n\nimport { EngineBodyLayout } from './EngineBodyLayout';\nimport { EnginePageLayout } from './EnginePageLayout';\n\nconst AccountRouter = React.lazy(() =>\n import('@/pages/account/AccountRouter').then(({ AccountRouter }) => ({\n default: AccountRouter,\n }))\n);\n\ndeclare const GIFT_CARD_API_URL: string;\ndeclare const GIFT_CARD_ASSET_URL: string;\n\nexport function FullPageEngineContextWrapper() {\n const basketContext = useContext(BasketContext);\n const ccx = useContext(CompanyContext);\n const beContext = useContext(BookingEngineContext);\n\n const [engineReady, setEngineReady] = useState(false);\n const [urlFlagsParsed, setUrlFlagsParsed] = useState(false);\n const [urlParameters, setUrlParameters] = useState<FullPageBookingEngineUrlParameters>({});\n\n const [currentStep, setCurrentStep] = useState<Step>(StepManager.getStepFromName(beContext.engine.getInitialSession()?.step as string) ?? StepManager.getFirstStep());\n const [initialStep, setInitialStep] = useState<Step>(StepManager.getFirstStep());\n\n const { hotel } = useCurrentHotel();\n\n const location = useLocation();\n const historyConsistentPush = useHistoryConsistentPush();\n const navigate = useNavigate();\n\n const isInStepRoot = useMatch(StepManager.STEP_BASE);\n\n useEffect(() => {\n beContext.sessionProvider?.updateSession({ step: currentStep.getName() });\n\n if (currentStep === StepHotel) {\n ccx.changeHotel(null);\n }\n }, [currentStep]);\n\n useEffect(() => {\n if (hotel?.company?.enableDerbysoftFeed) {\n FeatureProvider.load(DerbysoftClickTrackingFeature);\n }\n }, [hotel?.company?.enableDerbysoftFeed]);\n\n useEffect(() => {\n const currentBasketRows = basketContext.currentBasketRows;\n\n let addXRooms = 1;\n\n // TODO: this probably needs to be the only place this is set, and listen for URL changes\n if (currentBasketRows.length === 0) {\n const urlParameterBuilder: FullPageBookingEngineUrlParameters = {};\n // The Choose Hotel step should not apply the room filter\n const shouldEnableRoomCodeFilter = currentStep.getName() !== StepHotel.getName();\n\n if (location.search) {\n const query = new URLSearchParams(location.search);\n\n const format = API_DATE_FORMAT;\n\n let start = dayjs(query.get(EAppQueryParameters.Arrive), format);\n let end = dayjs(query.get(EAppQueryParameters.Depart), format);\n\n const promoCode = query.get(EAppQueryParameters.PromoCode);\n const promoOnly = query.get(EAppQueryParameters.PromoOnly);\n\n const promoFeatured = query.get(EAppQueryParameters.PromoFeatured);\n\n if (promoCode) {\n urlParameterBuilder.promoCode = promoCode;\n }\n\n if (promoOnly && promoOnly.toLowerCase() !== 'false') {\n urlParameterBuilder.promoOnly = Boolean(promoOnly);\n }\n\n if (promoFeatured && promoFeatured.toLowerCase() !== 'false') {\n FeatureProvider.load(FeaturedPromoFeature);\n urlParameterBuilder.promoFeatured = true;\n }\n\n const updatedCurrentFilters = { ...beContext.currentFilters };\n const roomCode = query.get(EAppQueryParameters.Room);\n\n if (roomCode && shouldEnableRoomCodeFilter) {\n // TODO: Refactor this to come from this context instead.\n updatedCurrentFilters['RoomType'] = new RoomTypeFilter([roomCode]);\n }\n\n const rateCode = query.get(EAppQueryParameters.Rate);\n if (rateCode) {\n // TODO: Refactor this to come from this context instead.\n updatedCurrentFilters['RateType'] = new RateTypeFilter([rateCode]);\n }\n beContext.setCurrentFilters(updatedCurrentFilters);\n\n const hotelId = query.get(EAppQueryParameters.Hotel);\n\n if (hotelId) {\n if (ccx.changeHotel(hotelId)) {\n if (!start.isValid()) {\n start = dayjs().add(1, 'day');\n }\n\n if (!end.isValid()) {\n end = start.add(1, 'day');\n }\n\n setInitialStep(getStepRoom());\n }\n\n urlParameterBuilder.hotelId = hotelId;\n }\n\n const defaultCity = query.get(EAppQueryParameters.DefaultCity);\n if (defaultCity) {\n urlParameterBuilder.defaultCity = defaultCity;\n }\n\n // We're doing dates last, as other properties, like hotelID might change them if they're not already set\n if (start.isValid() && end.isValid()) {\n const today = dayjs().startOf('day');\n\n if (start.isBefore(today)) {\n start = today;\n }\n\n if (end.isBefore(start) || end.isSame(start)) {\n end = start.add(1, 'day');\n } else if (end.isBefore(today.add(1, 'day')) || end.isSame(today)) {\n end = today.add(1, 'day');\n }\n\n urlParameterBuilder.startDate = start;\n urlParameterBuilder.endDate = end;\n }\n\n const parseQueryInt = (key: string, min = 0): number | undefined => {\n const value = Number.parseInt(query.get(key) ?? '', 10);\n return Number.isNaN(value) || value < min ? undefined : value;\n };\n\n addXRooms = parseQueryInt(EAppQueryParameters.Rooms, 1) ?? 1;\n const globalAdults = parseQueryInt(EAppQueryParameters.Adults, 1);\n const globalChildren = parseQueryInt(EAppQueryParameters.Children);\n const globalInfants = parseQueryInt(EAppQueryParameters.Infants);\n\n urlParameterBuilder.rooms = [];\n\n for (let i = 0; i < addXRooms; i++) {\n let roomOccupancy = 1;\n\n let adults = parseQueryInt(`adults-${i + 1}`, 1) ?? globalAdults;\n query.delete(`adults-${i + 1}`);\n\n if (adults && hotel?.maxOccupancy && (roomOccupancy = adults) > hotel.maxOccupancy) {\n adults = undefined;\n }\n\n let children = parseQueryInt(`children-${i + 1}`) ?? globalChildren;\n query.delete(`children-${i + 1}`);\n\n if (children && hotel?.maxOccupancy && (roomOccupancy += children) > hotel.maxOccupancy) {\n children = undefined;\n }\n\n let infants = parseQueryInt(`infants-${i + 1}`) ?? globalInfants;\n query.delete(`infants-${i + 1}`);\n\n if (infants && hotel?.maxOccupancy && hotel.countInfantsInOccupancy && (roomOccupancy += infants) > hotel.maxOccupancy) {\n infants = undefined;\n }\n\n urlParameterBuilder.rooms[i] = { adults, children, infants };\n }\n\n navigate({ search: query.toString() }, { replace: true });\n setUrlParameters(urlParameterBuilder);\n }\n\n let firstBasketRow: BasketRow | undefined = undefined;\n const { startDate, endDate, promoCode, promoOnly, rooms } = urlParameterBuilder;\n for (let i = 0; i < addXRooms; i++) {\n const { adults, children, infants } = rooms?.[i] ?? {};\n const basketRow = new BasketRow(undefined, undefined, shouldEnableRoomCodeFilter);\n\n if (startDate) {\n basketRow.setStartDate(startDate);\n }\n\n if (endDate) {\n basketRow.setEndDate(endDate);\n }\n\n if (promoCode) {\n basketRow.setPromoCode(promoCode);\n }\n\n if (promoOnly) {\n basketRow.setPromoOnly(promoOnly);\n }\n\n if (adults) {\n basketRow.setAdults(adults);\n }\n\n if (children) {\n basketRow.setChildren(children);\n }\n\n if (infants) {\n basketRow.setInfants(infants);\n }\n\n basketContext.addBasketRow(basketRow);\n\n if (i === 0) {\n firstBasketRow = basketRow;\n }\n }\n\n if (firstBasketRow?.getStartDate() && firstBasketRow.getEndDate() && StepManager.getFirstStep() !== StepHotel) {\n basketContext.selectBasketRow(firstBasketRow);\n setInitialStep(getStepRoom());\n }\n } else {\n const initialSession = beContext.engine.getInitialSession();\n if (initialSession) {\n setInitialStep(StepManager.getStepFromName(initialSession.step) as Step);\n }\n }\n\n setUrlFlagsParsed(true);\n }, []);\n\n /**\n * Engine Ready useEffect, used to deffer loading the UI until everything engine wise is set up properly\n */\n useEffect(() => {\n if (!engineReady) {\n if (ccx.hotels.length > 0 && urlFlagsParsed) {\n setEngineReady(true);\n }\n }\n }, [ccx.hotels, urlFlagsParsed]);\n\n useEffect(() => {\n if (engineReady) {\n if (isInStepRoot && initialStep) {\n // We want to respect the browsers pathname, and only redirect to a defined step if\n // the pathname isn't set, or matches an unknown page.\n\n // Is the current location in the path? i.e does the user want to be somewhere specific\n let pathInLoadedSteps = false;\n for (const step of StepManager.getSteps()) {\n // Using match instead of equals as some clients have skipped the trailing slash\n // We also want to make sure to only match the start of the path, in case step contains nested paths.\n if (location.pathname.match(new RegExp(`${step.getStepUrl()}.+`, 'ig'))) {\n pathInLoadedSteps = true;\n break;\n }\n }\n\n // We're in /step/ but on a not recognized one.\n if (!pathInLoadedSteps) {\n historyConsistentPush(initialStep.getStepUrl());\n }\n }\n }\n }, [engineReady]);\n\n useEffect(() => {\n if (hotel) {\n if (hotel.currentRoomSort) {\n beContext.setCurrentRoomSort(hotel.currentRoomSort);\n }\n if (hotel.currentRoomRateSort) {\n beContext.setCurrentRoomRateSort(hotel.currentRoomRateSort);\n }\n }\n }, [hotel?.currentRoomSort, hotel?.currentRoomRateSort]);\n\n const workingContext: FullPageEngineContextType = { urlParameters, currentStep, setCurrentStep };\n\n return (\n <FullPageEngineContext.Provider value={workingContext}>\n <ModalContextWrapper>\n <ScrollToTop />\n <header className=\"engine-header\">\n <Header />\n </header>\n\n {engineReady && (\n <Routes>\n <Route path=\"/\" element={<Navigate to={StepManager.getFirstStep().getStepUrl()} replace />} />\n\n <Route path=\"/step\" element={<EngineBodyLayout />}>\n {StepManager.getSteps().map((step: Step) => (\n <Route key={step.getName()} path={`${step.getStepUrl()}*`} element={<StepRoute step={step} />} />\n ))}\n </Route>\n\n {/**\n * We aren't on a /step/ path, or the root path, so it's probably one of the engine-page paths.\n * If no matching path is found, we'll redirect back to the first step.\n */}\n <Route path=\"/*\" element={<EnginePageLayout />}>\n {/* TODO: This startsWith('/') check should be temporary. We should update the Route in client config after this is merged. */}\n <Route\n path={ROUTES.HOTEL_INFO.startsWith('/') ? ROUTES.HOTEL_INFO.substring(1) : ROUTES.HOTEL_INFO}\n element={\n <React.Suspense fallback={<HotelInfoPlaceholder />}>\n <HotelInfo />\n </React.Suspense>\n }\n />\n\n {Object.values(EFindReservationPath)\n .filter((path) => MemberPortalFeature.isActive() || path === EFindReservationPath.FindReservation)\n .map((path) => (\n <Route\n key={path}\n path={path}\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <FindReservation />\n </React.Suspense>\n }\n />\n ))}\n\n <Route\n path=\"find-reservation/:ref/:email\"\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <FindReservationResults />\n </React.Suspense>\n }\n />\n\n <Route\n path=\"account/*\"\n element={\n <PrivateRoute>\n {MemberPortalFeature.isActive() && (\n <React.Suspense\n fallback={\n <div>\n <LargeLoader />\n </div>\n }\n >\n <AccountRouter />\n </React.Suspense>\n )}\n </PrivateRoute>\n }\n />\n\n {GiftCardFeature.isActive() && GiftCardFeature.config && (\n <Route\n path=\"gift-cards/purchase\"\n element={\n <React.Suspense fallback={<div>Loading...</div>}>\n <PurchaseGiftCardEngine\n companyId={GiftCardFeature.config.companyId}\n companyName={hotel?.name ?? ''}\n logoUrl={GiftCardFeature.config.logoUrl ?? hotel?.logo.toString() ?? ''}\n homeUrl={hotel?.hotelUrl ?? ''}\n apiUrl={GIFT_CARD_API_URL}\n assetUrl={GIFT_CARD_ASSET_URL}\n />\n </React.Suspense>\n }\n />\n )}\n\n {/* We haven't found a matching path, so just redirect to the first step. */}\n <Route path=\"*\" element={<Navigate to={StepManager.getFirstStep().getStepUrl()} replace />} />\n </Route>\n </Routes>\n )}\n\n <RoomstayMark />\n </ModalContextWrapper>\n </FullPageEngineContext.Provider>\n );\n}\n"]}
@@ -85,12 +85,13 @@ const DataLayer_1 = __importStar(require("../../util/DataLayer"));
85
85
  const StringHelper_1 = __importDefault(require("../../util/StringHelper"));
86
86
  const InlineRoomMiniEngine_module_scss_1 = __importDefault(require("./InlineRoomMiniEngine.module.scss"));
87
87
  function InlineRoomMiniEngineElement(props) {
88
- var _a, _b, _c;
88
+ var _a, _b, _c, _d, _e;
89
89
  const { layout = 'default', policy, priceDescription } = props.engine.getConfig();
90
90
  const isCardLayout = layout === 'card';
91
91
  const { hotel } = (0, hooks_1.useCurrentHotel)();
92
92
  const { memberNumber } = (0, useSignedInMember_1.useSignedInMember)();
93
93
  const basketContext = (0, react_1.useContext)(contexts_1.BasketContext);
94
+ const { roomRateCalendarInteractivity } = (0, react_1.useContext)(contexts_1.BookingEngineContext);
94
95
  const ccx = (0, react_1.useContext)(contexts_1.CompanyContext);
95
96
  const row = basketContext.currentBasketRows[0];
96
97
  const [isLoading, setLoading] = (0, react_1.useState)(true);
@@ -129,9 +130,15 @@ function InlineRoomMiniEngineElement(props) {
129
130
  }, [row, memberNumber]);
130
131
  (0, react_1.useEffect)(() => {
131
132
  if (row) {
132
- findRoomsOnClick();
133
+ fetchAvailability();
133
134
  }
134
135
  }, [row === null || row === void 0 ? void 0 : row.getPromoCode()]);
136
+ // Re-fetch availability when dates change from the calendar in the Room Rate Details modal
137
+ (0, react_1.useEffect)(() => {
138
+ if (row && ranFirstLoad && roomRateCalendarInteractivity) {
139
+ fetchAvailability(false);
140
+ }
141
+ }, [(_a = row === null || row === void 0 ? void 0 : row.getStartDate()) === null || _a === void 0 ? void 0 : _a.format('YYYY-MM-DD'), (_b = row === null || row === void 0 ? void 0 : row.getEndDate()) === null || _b === void 0 ? void 0 : _b.format('YYYY-MM-DD')]);
135
142
  (0, react_1.useEffect)(() => {
136
143
  var _a, _b, _c, _d, _e, _f;
137
144
  if (!(rooms && rooms.length > 0))
@@ -228,12 +235,14 @@ function InlineRoomMiniEngineElement(props) {
228
235
  row === null || row === void 0 ? void 0 : row.setEndDate((0, dayjs_1.default)().add(8, 'day'));
229
236
  }
230
237
  const isCompact = bounds.width < 1000 ? '--compact' : '';
231
- const findRoomsOnClick = () => __awaiter(this, void 0, void 0, function* () {
238
+ const fetchAvailability = (...args_1) => __awaiter(this, [...args_1], void 0, function* (showLoading = true) {
232
239
  var _a;
233
240
  if (isCardLayout) {
234
241
  basketContext.updateBasketRow(row);
235
242
  }
236
- setLoading(true);
243
+ if (showLoading) {
244
+ setLoading(true);
245
+ }
237
246
  setRooms((_a = (yield BookingAPI_1.default.Availability.fetchAvailabilityData(row, hotel === null || hotel === void 0 ? void 0 : hotel.hotelID, memberNumber, false))) === null || _a === void 0 ? void 0 : _a.filter((room) => room.code === props.engine.getRoomCode()));
238
247
  setLoading(false);
239
248
  });
@@ -247,8 +256,8 @@ function InlineRoomMiniEngineElement(props) {
247
256
  updatePeopleValues({ children: +value });
248
257
  };
249
258
  const defaultGuestValue = {
250
- adults: (_a = row === null || row === void 0 ? void 0 : row.getAdults()) !== null && _a !== void 0 ? _a : 1,
251
- children: (_b = row === null || row === void 0 ? void 0 : row.getChildren()) !== null && _b !== void 0 ? _b : 0,
259
+ adults: (_c = row === null || row === void 0 ? void 0 : row.getAdults()) !== null && _c !== void 0 ? _c : 1,
260
+ children: (_d = row === null || row === void 0 ? void 0 : row.getChildren()) !== null && _d !== void 0 ? _d : 0,
252
261
  infants: 0,
253
262
  room: 1,
254
263
  };
@@ -293,7 +302,7 @@ function InlineRoomMiniEngineElement(props) {
293
302
  const changePromoCode = (val) => {
294
303
  updatePromoCode(val);
295
304
  };
296
- const maxOccupancy = (_c = hotel === null || hotel === void 0 ? void 0 : hotel.maxOccupancy) !== null && _c !== void 0 ? _c : 1;
305
+ const maxOccupancy = (_e = hotel === null || hotel === void 0 ? void 0 : hotel.maxOccupancy) !== null && _e !== void 0 ? _e : 1;
297
306
  const DatePickerSelector = () => {
298
307
  const inner = () => {
299
308
  if (isCardLayout) {
@@ -401,7 +410,7 @@ function InlineRoomMiniEngineElement(props) {
401
410
  'w-100': isCompact,
402
411
  [InlineRoomMiniEngine_module_scss_1.default['rs-inline-filter-button']]: isCardLayout,
403
412
  }) },
404
- react_1.default.createElement(BEButton_1.default, { filled: true, primary: true, isLoading: isLoading, wide: isCompact !== '', onClick: findRoomsOnClick }, t(Translation_1.Translation.Misc.CheckRates)))),
413
+ react_1.default.createElement(BEButton_1.default, { filled: true, primary: true, isLoading: isLoading, wide: isCompact !== '', onClick: () => fetchAvailability() }, t(Translation_1.Translation.Misc.CheckRates)))),
405
414
  react_1.default.createElement("div", { className: (0, classnames_1.default)('u-border-rounded rs-inline-content', {
406
415
  [InlineRoomMiniEngine_module_scss_1.default['rs-inline-content']]: isCardLayout,
407
416
  }) }, !isLoading ? (react_1.default.createElement(AutoAutoHeight_1.default, { open: !isLoading },