@ubnt/store.core 9.19.0 → 9.20.0-alpha.0
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.
- package/CHANGELOG.md +201 -1
- package/lib/_virtual/_virtual_multi-entry.js +27 -12
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +14 -10
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/efg.png +0 -0
- package/lib/assets/icon-location-pin.svg +5 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.js +27 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.js.map +1 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs +3 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs.map +1 -0
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/ucg-max.png +0 -0
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +2 -3
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +2 -3
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/Compare/Compare.styles.d.ts +5 -5
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/Container/Container.js +4 -3
- package/lib/components/Container/Container.js.map +1 -1
- package/lib/components/Container/Container.mjs +5 -4
- package/lib/components/Container/Container.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.js +11 -1
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +13 -3
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/Header.js +6 -6
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +6 -6
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.styles.d.ts +2 -2
- package/lib/components/Header/Header.types.d.ts +12 -4
- package/lib/components/Header/Header.types.js +2 -1
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs +2 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +1 -0
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +2 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js +103 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +81 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +23 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +121 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +106 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +12 -0
- package/lib/components/Header/Navigation/ProMenu/index.d.ts +1 -0
- package/lib/components/Header/Navigation/ProMenu/index.js +6 -0
- package/lib/components/{ResourceCalculatorV1/components → Header/Navigation/ProMenu}/index.js.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/index.mjs +3 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +92 -95
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +92 -95
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +9 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +15 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +13 -2
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +10 -4
- package/lib/components/Header/ProHeader/ProHeader.d.ts +3 -4
- package/lib/components/Header/ProHeader/ProHeader.js +247 -120
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +249 -124
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +4 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.js +23 -17
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +21 -18
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Header/translations/ar.json.js +4 -1
- package/lib/components/Header/translations/ar.json.js.map +1 -1
- package/lib/components/Header/translations/ar.json.mjs +4 -2
- package/lib/components/Header/translations/ar.json.mjs.map +1 -1
- package/lib/components/Header/translations/de.json.js +4 -1
- package/lib/components/Header/translations/de.json.js.map +1 -1
- package/lib/components/Header/translations/de.json.mjs +4 -2
- package/lib/components/Header/translations/de.json.mjs.map +1 -1
- package/lib/components/Header/translations/el.json.js +4 -1
- package/lib/components/Header/translations/el.json.js.map +1 -1
- package/lib/components/Header/translations/el.json.mjs +4 -2
- package/lib/components/Header/translations/el.json.mjs.map +1 -1
- package/lib/components/Header/translations/en.json.js +4 -1
- package/lib/components/Header/translations/en.json.js.map +1 -1
- package/lib/components/Header/translations/en.json.mjs +4 -2
- package/lib/components/Header/translations/en.json.mjs.map +1 -1
- package/lib/components/Header/translations/es.json.js +4 -1
- package/lib/components/Header/translations/es.json.js.map +1 -1
- package/lib/components/Header/translations/es.json.mjs +4 -2
- package/lib/components/Header/translations/es.json.mjs.map +1 -1
- package/lib/components/Header/translations/fr.json.js +4 -1
- package/lib/components/Header/translations/fr.json.js.map +1 -1
- package/lib/components/Header/translations/fr.json.mjs +4 -2
- package/lib/components/Header/translations/fr.json.mjs.map +1 -1
- package/lib/components/Header/translations/it.json.js +4 -1
- package/lib/components/Header/translations/it.json.js.map +1 -1
- package/lib/components/Header/translations/it.json.mjs +4 -2
- package/lib/components/Header/translations/it.json.mjs.map +1 -1
- package/lib/components/Header/translations/ja.json.js +4 -1
- package/lib/components/Header/translations/ja.json.js.map +1 -1
- package/lib/components/Header/translations/ja.json.mjs +4 -2
- package/lib/components/Header/translations/ja.json.mjs.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.js +4 -1
- package/lib/components/Header/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.mjs +4 -2
- package/lib/components/Header/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.js +4 -1
- package/lib/components/Header/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js +4 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/Hero/Hero.styles.d.ts +2 -2
- package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +1 -1
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.d.ts +1 -1
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.js +3 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.mjs +3 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.d.ts +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.js +10 -7
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.mjs +10 -7
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.types.d.ts +1 -0
- package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.d.ts +3 -0
- package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +1 -1
- package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +1 -1
- package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/ModelCompareV3.js +2 -0
- package/lib/components/ModelCompareV3/ModelCompareV3.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.mjs +3 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.d.ts +1 -0
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js +8 -0
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs +8 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +1 -0
- package/lib/components/ModelCompareV3/data/products/envr.js +1 -1
- package/lib/components/ModelCompareV3/data/products/envr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/envr.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/envr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/ar.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/de.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/de.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/el.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/el.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/en.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/en.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/es.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/es.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/fr.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/fr.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/it.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/it.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/ja.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/ja.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +3 -3
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +3 -3
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +3 -3
- package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +313 -17
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +311 -17
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +3 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +120 -34
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs +120 -34
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.d.ts +16 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js +54 -12
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs +50 -11
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowLeftPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowRightPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +1 -2
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs +1 -2
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs.map +1 -1
- package/lib/{assets/icons/menu/icon-globe.svg.js → components/ResourceCalculatorV1/assets/consoles/efg.png.js} +6 -6
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +3 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +27 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +3 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +1 -0
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +6 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +6 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/index.mjs +2 -0
- package/lib/components/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +1 -0
- package/lib/constants/proStoreCategories/mapping/index.js +15 -10
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +15 -10
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +2 -1
- package/lib/constants/proStoreCategories/mapping/unifi.js +1 -0
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -0
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +3 -0
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +3 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +1 -1
- package/lib/constants/theme.js +4 -0
- package/lib/constants/theme.js.map +1 -1
- package/lib/constants/theme.mjs +4 -0
- package/lib/constants/theme.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +1 -1
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +1 -1
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/helpers/index.d.ts +1 -0
- package/lib/helpers/index.js +11 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +1 -0
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/helpers/product.d.ts +87 -0
- package/lib/helpers/product.js +346 -0
- package/lib/helpers/product.js.map +1 -0
- package/lib/helpers/product.mjs +335 -0
- package/lib/helpers/product.mjs.map +1 -0
- package/lib/helpers/ux.d.ts +9 -1
- package/lib/helpers/ux.js +15 -0
- package/lib/helpers/ux.js.map +1 -1
- package/lib/helpers/ux.mjs +15 -1
- package/lib/helpers/ux.mjs.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +1 -0
- package/lib/types/index.mjs.map +1 -1
- package/lib/types/product.d.ts +87 -0
- package/lib/types/product.js +14 -0
- package/lib/types/product.js.map +1 -0
- package/lib/types/product.mjs +13 -0
- package/lib/types/product.mjs.map +1 -0
- package/lib/utils/array.d.ts +4 -0
- package/lib/utils/array.js +10 -0
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +10 -1
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.d.ts +26 -0
- package/lib/utils/money/allocators/fixedAmount.js +52 -0
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -0
- package/lib/utils/money/allocators/fixedAmount.mjs +50 -0
- package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -0
- package/lib/utils/money/allocators/index.d.ts +2 -0
- package/lib/utils/money/allocators/index.js +8 -0
- package/lib/utils/money/allocators/index.js.map +1 -0
- package/lib/utils/money/allocators/index.mjs +4 -0
- package/lib/utils/money/allocators/index.mjs.map +1 -0
- package/lib/utils/money/allocators/productAmount.d.ts +13 -0
- package/lib/utils/money/allocators/productAmount.js +98 -0
- package/lib/utils/money/allocators/productAmount.js.map +1 -0
- package/lib/utils/money/allocators/productAmount.mjs +96 -0
- package/lib/utils/money/allocators/productAmount.mjs.map +1 -0
- package/lib/utils/money/constants.d.ts +56 -25
- package/lib/utils/money/constants.js +72 -7
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +70 -7
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/exchangeRate.d.ts +31 -0
- package/lib/utils/money/exchangeRate.js +27 -0
- package/lib/utils/money/exchangeRate.js.map +1 -0
- package/lib/utils/money/exchangeRate.mjs +23 -0
- package/lib/utils/money/exchangeRate.mjs.map +1 -0
- package/lib/utils/money/format.d.ts +10 -5
- package/lib/utils/money/format.js +22 -14
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +23 -16
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +4 -1
- package/lib/utils/money/index.js +26 -8
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +8 -4
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/misc.d.ts +68 -28
- package/lib/utils/money/misc.js +35 -64
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs +32 -43
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/money/misc.private.d.ts +23 -0
- package/lib/utils/money/misc.private.js +46 -0
- package/lib/utils/money/misc.private.js.map +1 -0
- package/lib/utils/money/misc.private.mjs +21 -0
- package/lib/utils/money/misc.private.mjs.map +1 -0
- package/lib/utils/money/shipping.d.ts +5 -0
- package/lib/utils/money/shipping.js +8 -0
- package/lib/utils/money/shipping.js.map +1 -0
- package/lib/utils/money/shipping.mjs +6 -0
- package/lib/utils/money/shipping.mjs.map +1 -0
- package/lib/utils/money/tax.d.ts +38 -2
- package/lib/utils/money/tax.js +46 -10
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +42 -11
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/tax.private.d.ts +17 -0
- package/lib/utils/money/tax.private.js +65 -0
- package/lib/utils/money/tax.private.js.map +1 -0
- package/lib/utils/money/tax.private.mjs +60 -0
- package/lib/utils/money/tax.private.mjs.map +1 -0
- package/lib/utils/money/types.d.ts +78 -3
- package/lib/utils/number.d.ts +1 -1
- package/lib/utils/number.js +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/productSort.d.ts +41 -0
- package/lib/utils/productSort.js +67 -0
- package/lib/utils/productSort.js.map +1 -0
- package/lib/utils/productSort.mjs +60 -0
- package/lib/utils/productSort.mjs.map +1 -0
- package/package.json +1 -1
- package/lib/assets/icons/menu/icon-globe.svg.js.map +0 -1
- package/lib/assets/icons/menu/icon-globe.svg.mjs +0 -3
- package/lib/assets/icons/menu/icon-globe.svg.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/index.d.ts +0 -1
- package/lib/components/ResourceCalculatorV1/components/index.js +0 -5
- package/lib/components/ResourceCalculatorV1/components/index.mjs +0 -3
- package/lib/utils/validations.d.ts +0 -15
- package/lib/utils/validations.js +0 -23
- package/lib/utils/validations.js.map +0 -1
- package/lib/utils/validations.mjs +0 -21
- package/lib/utils/validations.mjs.map +0 -1
- /package/lib/components/{ResourceCalculatorV1/components → Header/Navigation/ProMenu}/index.mjs.map +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.d.ts +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.js +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.js.map +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.mjs +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.mjs.map +0 -0
|
@@ -9,10 +9,10 @@ function _interopDefault(e) {
|
|
|
9
9
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
10
10
|
"use strict";
|
|
11
11
|
const HorizontalOptionSelectWrap = styled__default["default"].div`
|
|
12
|
-
border-radius:
|
|
13
|
-
background-color: #
|
|
12
|
+
border-radius: 100px;
|
|
13
|
+
background-color: #f4f5f6;
|
|
14
14
|
display: flex;
|
|
15
|
-
padding:
|
|
15
|
+
padding: 2px;
|
|
16
16
|
overflow-x: auto;
|
|
17
17
|
|
|
18
18
|
&::-webkit-slider-thumb,
|
|
@@ -21,23 +21,26 @@ const HorizontalOptionSelectWrap = styled__default["default"].div`
|
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
23
|
const Button = styled__default["default"].button`
|
|
24
|
+
flex: ${({
|
|
25
|
+
$symetricButtons
|
|
26
|
+
}) => $symetricButtons ? "1" : "0 1 auto"};
|
|
24
27
|
font-size: 14px;
|
|
25
|
-
line-height:
|
|
28
|
+
line-height: 24px;
|
|
26
29
|
font-weight: 400;
|
|
27
30
|
|
|
28
31
|
border: none;
|
|
29
32
|
outline: none;
|
|
30
33
|
box-shadow: none;
|
|
31
34
|
|
|
32
|
-
padding:
|
|
33
|
-
border-radius:
|
|
35
|
+
padding: 2px;
|
|
36
|
+
border-radius: 100px;
|
|
34
37
|
|
|
35
38
|
background-color: ${({
|
|
36
39
|
$active
|
|
37
40
|
}) => $active ? "#FFFFFF" : "transparent"};
|
|
38
41
|
color: ${({
|
|
39
42
|
$active
|
|
40
|
-
}) => $active ? "#
|
|
43
|
+
}) => $active ? "#006FFF" : "#808893"};
|
|
41
44
|
|
|
42
45
|
flex-grow: 1;
|
|
43
46
|
white-space: nowrap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalOptionSelect.styles.js","sources":["../../../src/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const HorizontalOptionSelectWrap = styled.div`\n border-radius: 100px;\n background-color: #f4f5f6;\n display: flex;\n padding: 2px;\n overflow-x: auto;\n\n &::-webkit-slider-thumb,\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const Button = styled.button<{\n $active: boolean;\n $symetricButtons?: boolean;\n}>`\n flex: ${({ $symetricButtons }) => ($symetricButtons ? \"1\" : \"0 1 auto\")};\n font-size: 14px;\n line-height: 24px;\n font-weight: 400;\n\n border: none;\n outline: none;\n box-shadow: none;\n\n padding: 2px;\n border-radius: 100px;\n\n background-color: ${({ $active }) => ($active ? \"#FFFFFF\" : \"transparent\")};\n color: ${({ $active }) => ($active ? \"#006FFF\" : \"#808893\")};\n\n flex-grow: 1;\n white-space: nowrap;\n cursor: pointer;\n`;\n"],"names":["HorizontalOptionSelectWrap","styled","div","Button","button","$symetricButtons","$active"],"mappings":";;;;;;;;;;AAEO,MAAMA,6BAA6BC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAa1C,MAAMC,SAASF,eAAO,CAAA,SAAA,CAAA,CAAAG,MAAA;AAAA,UAInB,CAAC;EAAEC;AAAA,CAAwB,KAAAA,gBAAA,GAAmB,MAAM,UAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAYnD,CAAC;EAAEC;AAAA,CAAe,KAAAA,OAAA,GAAU,YAAY,aAAc;AAAA,WACjE,CAAC;EAAEA;AAAA,CAAe,KAAAA,OAAA,GAAU,YAAY,SAAU;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
"use strict";
|
|
3
3
|
const HorizontalOptionSelectWrap = styled.div`
|
|
4
|
-
border-radius:
|
|
5
|
-
background-color: #
|
|
4
|
+
border-radius: 100px;
|
|
5
|
+
background-color: #f4f5f6;
|
|
6
6
|
display: flex;
|
|
7
|
-
padding:
|
|
7
|
+
padding: 2px;
|
|
8
8
|
overflow-x: auto;
|
|
9
9
|
|
|
10
10
|
&::-webkit-slider-thumb,
|
|
@@ -13,23 +13,26 @@ const HorizontalOptionSelectWrap = styled.div`
|
|
|
13
13
|
}
|
|
14
14
|
`;
|
|
15
15
|
const Button = styled.button`
|
|
16
|
+
flex: ${({
|
|
17
|
+
$symetricButtons
|
|
18
|
+
}) => $symetricButtons ? "1" : "0 1 auto"};
|
|
16
19
|
font-size: 14px;
|
|
17
|
-
line-height:
|
|
20
|
+
line-height: 24px;
|
|
18
21
|
font-weight: 400;
|
|
19
22
|
|
|
20
23
|
border: none;
|
|
21
24
|
outline: none;
|
|
22
25
|
box-shadow: none;
|
|
23
26
|
|
|
24
|
-
padding:
|
|
25
|
-
border-radius:
|
|
27
|
+
padding: 2px;
|
|
28
|
+
border-radius: 100px;
|
|
26
29
|
|
|
27
30
|
background-color: ${({
|
|
28
31
|
$active
|
|
29
32
|
}) => $active ? "#FFFFFF" : "transparent"};
|
|
30
33
|
color: ${({
|
|
31
34
|
$active
|
|
32
|
-
}) => $active ? "#
|
|
35
|
+
}) => $active ? "#006FFF" : "#808893"};
|
|
33
36
|
|
|
34
37
|
flex-grow: 1;
|
|
35
38
|
white-space: nowrap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalOptionSelect.styles.mjs","sources":["../../../src/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const HorizontalOptionSelectWrap = styled.div`\n border-radius: 100px;\n background-color: #f4f5f6;\n display: flex;\n padding: 2px;\n overflow-x: auto;\n\n &::-webkit-slider-thumb,\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nexport const Button = styled.button<{\n $active: boolean;\n $symetricButtons?: boolean;\n}>`\n flex: ${({ $symetricButtons }) => ($symetricButtons ? \"1\" : \"0 1 auto\")};\n font-size: 14px;\n line-height: 24px;\n font-weight: 400;\n\n border: none;\n outline: none;\n box-shadow: none;\n\n padding: 2px;\n border-radius: 100px;\n\n background-color: ${({ $active }) => ($active ? \"#FFFFFF\" : \"transparent\")};\n color: ${({ $active }) => ($active ? \"#006FFF\" : \"#808893\")};\n\n flex-grow: 1;\n white-space: nowrap;\n cursor: pointer;\n`;\n"],"names":["HorizontalOptionSelectWrap","styled","div","Button","button","$symetricButtons","$active"],"mappings":";;AAEO,MAAMA,6BAA6BC,MAAO,CAAAC,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAa1C,MAAMC,SAASF,MAAO,CAAAG,MAAA;AAAA,UAInB,CAAC;EAAEC;AAAA,CAAwB,KAAAA,gBAAA,GAAmB,MAAM,UAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAYnD,CAAC;EAAEC;AAAA,CAAe,KAAAA,OAAA,GAAU,YAAY,aAAc;AAAA,WACjE,CAAC;EAAEA;AAAA,CAAe,KAAAA,OAAA,GAAU,YAAY,SAAU;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const Container: import("styled-components").StyledComponent<import("react").
|
|
2
|
-
export declare const TopologyContainer: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const TopologyContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const SectionTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {
|
|
4
4
|
extraMargin?: boolean;
|
|
5
5
|
}, never>;
|
|
@@ -17,5 +17,8 @@ export interface LandingPageProProps {
|
|
|
17
17
|
renderImage: RenderImageFn;
|
|
18
18
|
isCartSummaryOpen?: boolean;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated This component is deprecated and will be removed in the future.
|
|
22
|
+
*/
|
|
20
23
|
export declare const LandingPagePro: ({ sidebarProps, productGridProps, searchProps, renderImage, isCartSummaryOpen, }: LandingPageProProps) => JSX.Element;
|
|
21
24
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var currencies = require('@dinero.js/currencies');
|
|
4
5
|
var react = require('react');
|
|
5
6
|
require('../../contexts/MenuContext/index.js');
|
|
6
7
|
var mapping = require('../../contexts/MenuContext/mapping.js');
|
|
7
8
|
require('../../types/index.js');
|
|
8
|
-
require('../../utils/money/index.js');
|
|
9
9
|
var url = require('../../utils/url.js');
|
|
10
10
|
require('../LandingPageSearch/index.js');
|
|
11
11
|
require('../LandingPageSidebar/index.js');
|
|
@@ -14,12 +14,12 @@ var ProductGrid_types = require('../ProductGrid/ProductGrid.types.js');
|
|
|
14
14
|
var LandingPagePro_styles = require('./LandingPagePro.styles.js');
|
|
15
15
|
var utils = require('./utils.js');
|
|
16
16
|
var context = require('../../contexts/MenuContext/context.js');
|
|
17
|
-
var constants = require('../../utils/money/constants.js');
|
|
18
17
|
var generated = require('../../types/generated.js');
|
|
19
18
|
var LandingPageSidebar = require('../LandingPageSidebar/LandingPageSidebar.js');
|
|
20
19
|
var LandingPageSearch = require('../LandingPageSearch/LandingPageSearch.js');
|
|
21
20
|
var ProductGrid = require('../ProductGrid/ProductGrid.js');
|
|
22
21
|
"use strict";
|
|
22
|
+
const maximumPriceFilterLookup = /* @__PURE__ */new Map([[currencies.CAD.code, 7e4], [currencies.EUR.code, 7e4], [currencies.AED.code, 7e4]]);
|
|
23
23
|
const LandingPagePro = ({
|
|
24
24
|
// storeId = StoreId.Us,
|
|
25
25
|
sidebarProps,
|
|
@@ -119,7 +119,7 @@ const LandingPagePro = ({
|
|
|
119
119
|
}, [navigation.primary.items, navigation.secondary.items, productGridProps?.products, sidebarProps.productTypeBlock.activeType, sidebarProps.translations.all]);
|
|
120
120
|
const maxPriceFilterAmount = react.useMemo(() => {
|
|
121
121
|
return {
|
|
122
|
-
amount:
|
|
122
|
+
amount: maximumPriceFilterLookup.get(sidebarProps.filtersBlock?.currency || generated.Currency.Cad) || 7e4,
|
|
123
123
|
currency: sidebarProps.filtersBlock?.currency || generated.Currency.Cad
|
|
124
124
|
};
|
|
125
125
|
}, [sidebarProps.filtersBlock?.currency]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LandingPagePro.js","sources":["../../../src/components/LandingPagePro/LandingPagePro.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\n// import { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { maximumPriceFilterLookup } from \"../../utils/money\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\nexport const LandingPagePro = ({\n // storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware,\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n // !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n // getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) => innerItem?.items,\n // &&\n // innerItem.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n // ||\n // item.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["LandingPagePro","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","maximumPriceFilterLookup","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,iBAAiBA,CAAC;EAAA;EAE7BC,YAAA;EACAC,gBAAA;EACAC,WAAA;EACAC,WAAA;EACAC;AACF,CAA2B,KAAA;EACnB,MAAA;IAAEC;GAAW,GAAIC,OAAAA,CAAAA,OAAQ,EAAA;EAE/B,MAAMC,YAAe,GAAAC,KAAA,CAAAA,OAAA,CACnB,MAAM,CAAC,CAACN,WAAY,CAAAO,WAAA,EACpB,CAACP,YAAYO,WAAW,CAAA,CAC1B;EAEM,MAAAC,UAAA,GAAoDF,KAAAA,CAAAA,QAAQ,MAAM;IAChE,MAAAG,QAAA,GACJX,aAAaY,gBAAiB,CAAAC,UAAA,KAAe,UACzCR,UAAW,CAAAS,OAAA,CAAQC,KACnB,GAAAV,UAAA,CAAWW,SAAU,CAAAD,KAAA;IAC3B,MAAMA,QAAQJ,QACX,CAAAM,MAAA,CACEC,QACCA,IAAK,CAAAC,EAAA,KAAOC,OAAAA,CAAAA,iBAAiBC,aAC7B,IAAAH,IAAA,CAAKC,OAAOC,OAAAA,CAAAA,gBAAiB,CAAAE;IAAA;AAAA;AAAA;AAAA;IAAA;IAAA,CAMjC,C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A,CAAE,CAAA;QAC3B,CAAA;QACAV,SAAW,EAAAX,oBAAA;QACXG;MAAA,CACF,CAAA;KACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"LandingPagePro.js","sources":["../../../src/components/LandingPagePro/LandingPagePro.tsx"],"sourcesContent":["import { AED, CAD, EUR } from \"@dinero.js/currencies\";\nimport { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\n// import { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\n/**\n * Mapping of maximum price filter\n */\nconst maximumPriceFilterLookup = new Map([\n [CAD.code, 70000],\n [EUR.code, 70000],\n [AED.code, 70000],\n]);\n\n/**\n * @deprecated This component is deprecated and will be removed in the future.\n */\nexport const LandingPagePro = ({\n // storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware,\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n // !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n // getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) => innerItem?.items,\n // &&\n // innerItem.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n // ||\n // item.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["maximumPriceFilterLookup","Map","CAD","code","EUR","AED","LandingPagePro","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwDA,MAAMA,wBAAA,GAAA,mBAA+BC,GAAI,CAAA,CACvC,CAACC,UAAI,CAAAA,GAAA,CAAAC,IAAA,EAAM,GAAK,CAAA,EAChB,CAACC,UAAI,CAAAA,GAAA,CAAAD,IAAA,EAAM,GAAK,CAAA,EAChB,CAACE,UAAI,CAAAA,GAAA,CAAAF,IAAA,EAAM,GAAK,CAAA,CACjB,CAAA;AAKM,MAAMG,iBAAiBA,CAAC;EAAA;EAE7BC,YAAA;EACAC,gBAAA;EACAC,WAAA;EACAC,WAAA;EACAC;AACF,CAA2B,KAAA;EACnB,MAAA;IAAEC;GAAW,GAAIC,OAAAA,CAAAA,OAAQ,EAAA;EAE/B,MAAMC,YAAe,GAAAC,KAAA,CAAAA,OAAA,CACnB,MAAM,CAAC,CAACN,WAAY,CAAAO,WAAA,EACpB,CAACP,YAAYO,WAAW,CAAA,CAC1B;EAEM,MAAAC,UAAA,GAAoDF,KAAAA,CAAAA,QAAQ,MAAM;IAChE,MAAAG,QAAA,GACJX,aAAaY,gBAAiB,CAAAC,UAAA,KAAe,UACzCR,UAAW,CAAAS,OAAA,CAAQC,KACnB,GAAAV,UAAA,CAAWW,SAAU,CAAAD,KAAA;IAC3B,MAAMA,QAAQJ,QACX,CAAAM,MAAA,CACEC,QACCA,IAAK,CAAAC,EAAA,KAAOC,OAAAA,CAAAA,iBAAiBC,aAC7B,IAAAH,IAAA,CAAKC,OAAOC,OAAAA,CAAAA,gBAAiB,CAAAE;IAAA;AAAA;AAAA;AAAA;IAAA;IAAA,CAMjC,CAECC,GAAI,CAACL,IAAS,IAAA;MACb,QAAQA,KAAKC,EAAI;QACf,KAAKC,OAAiB,CAAAA,gBAAA,CAAAI,WAAA;UACb,OAAA;YACL,GAAGN,IAAA;YACHO,KAAO,EAAA;UAAA,CACT;QACF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sx-runtime';
|
|
2
|
+
import { CAD, EUR, AED } from '@dinero.js/currencies';
|
|
2
3
|
import { useMemo, useCallback } from 'react';
|
|
3
4
|
import '../../contexts/MenuContext/index.mjs';
|
|
4
5
|
import { NavigationItemId } from '../../contexts/MenuContext/mapping.mjs';
|
|
5
6
|
import '../../types/index.mjs';
|
|
6
|
-
import '../../utils/money/index.mjs';
|
|
7
7
|
import { slugify } from '../../utils/url.mjs';
|
|
8
8
|
import '../LandingPageSearch/index.mjs';
|
|
9
9
|
import '../LandingPageSidebar/index.mjs';
|
|
@@ -12,12 +12,12 @@ import { ProductGridSortOption } from '../ProductGrid/ProductGrid.types.mjs';
|
|
|
12
12
|
import { Container, ProductsContainer, SearchLoader } from './LandingPagePro.styles.mjs';
|
|
13
13
|
import { productHasSomeInStock, compareSortWeights } from './utils.mjs';
|
|
14
14
|
import { useMenu } from '../../contexts/MenuContext/context.mjs';
|
|
15
|
-
import { maximumPriceFilterLookup } from '../../utils/money/constants.mjs';
|
|
16
15
|
import { Currency } from '../../types/generated.mjs';
|
|
17
16
|
import { LandingPageSidebar } from '../LandingPageSidebar/LandingPageSidebar.mjs';
|
|
18
17
|
import { LandingPageSearch } from '../LandingPageSearch/LandingPageSearch.mjs';
|
|
19
18
|
import { ProductGrid } from '../ProductGrid/ProductGrid.mjs';
|
|
20
19
|
"use strict";
|
|
20
|
+
const maximumPriceFilterLookup = /* @__PURE__ */new Map([[CAD.code, 7e4], [EUR.code, 7e4], [AED.code, 7e4]]);
|
|
21
21
|
const LandingPagePro = ({
|
|
22
22
|
// storeId = StoreId.Us,
|
|
23
23
|
sidebarProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LandingPagePro.mjs","sources":["../../../src/components/LandingPagePro/LandingPagePro.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\n// import { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { maximumPriceFilterLookup } from \"../../utils/money\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\nexport const LandingPagePro = ({\n // storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware,\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n // !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n // getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) => innerItem?.items,\n // &&\n // innerItem.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n // ||\n // item.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["LandingPagePro","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","maximumPriceFilterLookup","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,iBAAiBA,CAAC;EAAA;EAE7BC,YAAA;EACAC,gBAAA;EACAC,WAAA;EACAC,WAAA;EACAC;AACF,CAA2B,KAAA;EACnB,MAAA;IAAEC;GAAW,GAAIC,OAAQ,EAAA;EAE/B,MAAMC,YAAe,GAAAC,OAAA,CACnB,MAAM,CAAC,CAACN,WAAY,CAAAO,WAAA,EACpB,CAACP,YAAYO,WAAW,CAAA,CAC1B;EAEM,MAAAC,UAAA,GAAoDF,QAAQ,MAAM;IAChE,MAAAG,QAAA,GACJX,aAAaY,gBAAiB,CAAAC,UAAA,KAAe,UACzCR,UAAW,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agePro/LandingPagePro.tsx"],"sourcesContent":["import { AED, CAD, EUR } from \"@dinero.js/currencies\";\nimport { useCallback, useMemo } from \"react\";\n\nimport { useMenu } from \"../../contexts/MenuContext\";\nimport { NavigationItemId } from \"../../contexts/MenuContext/mapping\";\nimport type { ParsedNavigationSubSubItem } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { Currency } from \"../../types\";\n// import { getCollectionSlugFromPath } from \"../../utils/collectionSlug\";\nimport { slugify } from \"../../utils/url\";\nimport type { RenderImageFn } from \"../CustomImage/CustomImage.types\";\nimport { LandingPageSearch } from \"../LandingPageSearch\";\nimport type { LandingPageSearchProps } from \"../LandingPageSearch/LandingPageSearch.types\";\nimport { LandingPageSidebar } from \"../LandingPageSidebar\";\nimport type {\n CategoriesProps,\n FiltersProps,\n LandingPageSidebarProps,\n ProductTypeProps,\n SidebarTranslations,\n} from \"../LandingPageSidebar/LandingPageSidebar.types\";\nimport { ProductGrid } from \"../ProductGrid\";\nimport { ProductGridSortOption } from \"../ProductGrid/ProductGrid.types\";\nimport type {\n GridProduct,\n ProductGridProps,\n} from \"../ProductGrid/ProductGrid.types\";\nimport * as S from \"./LandingPagePro.styles\";\nimport { compareSortWeights, productHasSomeInStock } from \"./utils\";\n\ninterface SidebarProps {\n translations: SidebarTranslations;\n categoriesBlock?: CategoriesProps;\n filtersBlock?: Omit<FiltersProps, \"minValue\" | \"maxValue\">;\n productTypeBlock: ProductTypeProps;\n}\n\nexport interface LandingPageProProps {\n storeId?: StoreId;\n sidebarProps: SidebarProps;\n productGridProps: Omit<\n ProductGridProps,\n | \"renderImage\"\n | \"clearFilters\"\n | \"hasFilters\"\n | \"isLoading\"\n | \"isDefaultCategory\"\n >;\n searchProps: Omit<LandingPageSearchProps, \"renderImage\">;\n renderImage: RenderImageFn;\n isCartSummaryOpen?: boolean;\n}\n\n/**\n * Mapping of maximum price filter\n */\nconst maximumPriceFilterLookup = new Map([\n [CAD.code, 70000],\n [EUR.code, 70000],\n [AED.code, 70000],\n]);\n\n/**\n * @deprecated This component is deprecated and will be removed in the future.\n */\nexport const LandingPagePro = ({\n // storeId = StoreId.Us,\n sidebarProps,\n productGridProps,\n searchProps,\n renderImage,\n isCartSummaryOpen,\n}: LandingPageProProps) => {\n const { navigation } = useMenu();\n\n const isSearchUsed = useMemo(\n () => !!searchProps.searchValue,\n [searchProps.searchValue],\n );\n\n const categories: LandingPageSidebarProps[\"categories\"] = useMemo(() => {\n const navItems =\n sidebarProps.productTypeBlock.activeType === \"unifi\"\n ? navigation.primary.items\n : navigation.secondary.items;\n const items = navItems\n .filter(\n (item) =>\n item.id !== NavigationItemId.UnifiIdentity &&\n item.id !== NavigationItemId.UispSoftware,\n /**\n * TODO: Hacky way to hide Amplifi from sidebar on US store\n * since we don't pass storePath in `navigation` variable from useMenu()\n */\n // !(item.id === NavigationItemId.Amplifi && storeId === StoreId.Us),\n )\n // HACK: Change the category titles\n .map((item) => {\n switch (item.id) {\n case NavigationItemId.Accessories:\n return {\n ...item,\n label: \"Accessories\",\n };\n case NavigationItemId.CameraSecurity:\n return {\n ...item,\n label: \"Camera Security\",\n };\n default:\n return item;\n }\n })\n .map((category) => {\n const innerItems: {\n label: string;\n slug: string;\n products: ProductGridProps[\"products\"];\n items: ParsedNavigationSubSubItem[];\n }[] = category.items\n // HACK: We are filtering out \"door-access\" from the 2nd level so that products are collected in 1st level \"Door Access\"\n .filter((item) => item.id !== \"door-access\")\n .map((innerItem) => {\n return {\n label: innerItem.label,\n items: innerItem.items,\n slug:\n // getCollectionSlugFromPath(innerItem.path) ||\n slugify(innerItem.id),\n products: [],\n };\n });\n\n innerItems.unshift({\n label: `${sidebarProps.translations.all} ${category.label}`,\n slug: category.id,\n products: [],\n items: [],\n });\n\n return {\n label: category.label,\n id: category.id,\n items: innerItems,\n };\n });\n\n productGridProps?.products?.forEach((product) => {\n const activeCategoryIndex = items.findIndex((category) => {\n const isIncluded = category.items.some(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n );\n\n if (isIncluded) {\n return true;\n }\n\n return category.items.some(\n (innerItem) => innerItem?.items,\n // &&\n // innerItem.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n });\n\n // Add product to \"All ...\" category\n if (items[activeCategoryIndex]) {\n items[activeCategoryIndex]?.items[0]?.products?.push(product);\n\n const activeCategoryInnerIndex = items[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) =>\n item.slug === product.defaultCollectionSlug ||\n item.slug === product.organizationalCollectionSlug,\n // ||\n // item.items.some(\n // (subItem) =>\n // getCollectionSlugFromPath(subItem.path) ===\n // product.defaultCollectionSlug ||\n // getCollectionSlugFromPath(subItem.path) ===\n // product.organizationalCollectionSlug,\n // ),\n );\n\n // Add product to the category where it belongs, except the \"All ...\" category\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n items[activeCategoryIndex]?.items[activeCategoryInnerIndex] &&\n activeCategoryInnerIndex !== 0\n ) {\n items[activeCategoryIndex]?.items[\n activeCategoryInnerIndex\n ]?.products?.push(product);\n }\n }\n });\n\n return items.map((category) => ({\n ...category,\n items: category.items.filter((item) => item?.products?.length),\n }));\n }, [\n navigation.primary.items,\n navigation.secondary.items,\n productGridProps?.products,\n sidebarProps.productTypeBlock.activeType,\n sidebarProps.translations.all,\n ]);\n\n const maxPriceFilterAmount = useMemo(() => {\n return {\n amount:\n maximumPriceFilterLookup.get(\n sidebarProps.filtersBlock?.currency || Currency.Cad,\n ) || 70000,\n currency: sidebarProps.filtersBlock?.currency || Currency.Cad,\n };\n }, [sidebarProps.filtersBlock?.currency]);\n\n const categoryProducts = useMemo(() => {\n // If category is set to \"all\" -> return all products\n if (!sidebarProps?.categoriesBlock?.activeCategory) {\n return productGridProps.products;\n }\n\n const activeCategoryIndex = categories.findIndex((category) =>\n category.items.some(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n ),\n );\n const activeCategoryInnerIndex = categories[\n activeCategoryIndex\n ]?.items.findIndex(\n (item) => item.slug === sidebarProps.categoriesBlock?.activeCategory,\n );\n\n if (\n typeof activeCategoryInnerIndex === \"number\" &&\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ) {\n return (\n categories[activeCategoryIndex]?.items[activeCategoryInnerIndex]\n ?.products || []\n );\n }\n return [];\n }, [\n categories,\n productGridProps.products,\n sidebarProps.categoriesBlock?.activeCategory,\n ]);\n\n // #############################################################################\n // Products\n // #############################################################################\n const productsFilter = useCallback(\n (product: GridProduct): boolean => {\n // TODO: Make enum for filter values\n // Filter out non is in stock\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"inStock\",\n ) &&\n !product.variants.find((variant) => variant.isInStock)\n ) {\n return false;\n }\n // Filter out non coming soon\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"comingSoon\",\n ) &&\n // TODO: Might need to add check if one of the variants is in stock\n !product.variants.find((variant) => variant.isComingSoon)\n ) {\n return false;\n }\n // Filter out non previously purchased\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"previouslyPurchased\",\n ) &&\n !product.isPreviouslyPurchased\n ) {\n return false;\n }\n // Filter out non newest products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\"newest\") &&\n !product.isNew\n ) {\n return false;\n }\n // Filter out non \"early access\" products\n if (\n sidebarProps.filtersBlock?.activeFilters?.filters?.includes(\n \"earlyAccess\",\n ) &&\n !product.variants.find((variant) => variant.isEarlyAccess)\n ) {\n return false;\n }\n // Filter out non \"price from\" products\n if (\n sidebarProps.filtersBlock?.activeFilters.priceFrom?.displayPrice &&\n product.displayPrice.amount <\n sidebarProps.filtersBlock.activeFilters.priceFrom.displayPrice.amount\n ) {\n return false;\n }\n // Filter out non \"price to\" products\n // eslint-disable-next-line sonarjs/prefer-single-boolean-return\n if (sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice) {\n // First check if range \"to\" value has max value, then we need to show products that has bigger price too\n if (\n sidebarProps.filtersBlock?.activeFilters.priceTo?.displayPrice\n ?.amount >= maxPriceFilterAmount.amount\n ) {\n return true;\n } else if (\n product.displayPrice.amount >\n sidebarProps.filtersBlock.activeFilters.priceTo.displayPrice.amount\n ) {\n return false;\n }\n }\n\n return true;\n },\n [\n maxPriceFilterAmount.amount,\n sidebarProps.filtersBlock?.activeFilters?.filters,\n sidebarProps.filtersBlock?.activeFilters?.priceFrom?.displayPrice,\n sidebarProps.filtersBlock?.activeFilters?.priceTo?.displayPrice,\n ],\n );\n\n const productsSort = useCallback(\n (currentProduct: GridProduct, nextProduct: GridProduct): number => {\n // Stock\n const currentInStock = productHasSomeInStock(currentProduct);\n const nextInStock = productHasSomeInStock(nextProduct);\n\n // Resolve custom sort weighting\n // If search is used, we set to 0\n const sortWeight = !isSearchUsed\n ? compareSortWeights({\n current: currentProduct.sortWeight,\n next: nextProduct.sortWeight,\n })\n : 0;\n\n // Resolve sort value\n // If search is used, we set to 0\n let sortValue = !isSearchUsed\n ? (Number(!!nextInStock) - Number(!!currentInStock)) * 2\n : 0;\n\n switch (productGridProps.sortValue) {\n case ProductGridSortOption.lowestPrice:\n sortValue +=\n currentProduct.displayPrice.amount -\n nextProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.highestPrice:\n sortValue +=\n nextProduct.displayPrice.amount -\n currentProduct.displayPrice.amount;\n break;\n case ProductGridSortOption.newestProducts:\n sortValue +=\n Number(!!nextProduct.isNew) - Number(!!currentProduct.isNew);\n break;\n case ProductGridSortOption.oldestProducts:\n sortValue +=\n Number(!!currentProduct.isNew) - Number(!!nextProduct.isNew);\n break;\n default:\n // Sort by featured\n if (\n // Not searching\n !isSearchUsed &&\n // Has no sort weight\n !sortWeight\n ) {\n sortValue +=\n Number(!!nextProduct.isFeatured) -\n Number(!!currentProduct.isFeatured);\n }\n break;\n }\n\n // Combine resolved values\n return sortValue + sortWeight;\n },\n [isSearchUsed, productGridProps.sortValue],\n );\n\n const products = useMemo(() => {\n if (categoryProducts === null) {\n return null;\n }\n\n return categoryProducts?.filter(productsFilter).sort(productsSort);\n }, [categoryProducts, productsFilter, productsSort]);\n\n const filtersBlock = useMemo(() => {\n if (!sidebarProps.filtersBlock) {\n return undefined;\n }\n\n const minValDisplayPrice = productGridProps?.products?.length\n ? productGridProps.products.reduce((prev, curr) =>\n prev.displayPrice.amount < curr.displayPrice.amount ? prev : curr,\n ).displayPrice\n : undefined;\n\n return {\n ...sidebarProps.filtersBlock,\n minValue: {\n displayPrice: minValDisplayPrice,\n },\n maxValue: {\n displayPrice: maxPriceFilterAmount,\n },\n };\n }, [\n maxPriceFilterAmount,\n productGridProps.products,\n sidebarProps.filtersBlock,\n ]);\n\n const hasFilters = useMemo(() => {\n return (\n !!filtersBlock?.activeFilters.filters?.length ||\n filtersBlock?.activeFilters.priceFrom !== undefined ||\n filtersBlock?.activeFilters.priceTo !== undefined\n );\n }, [\n filtersBlock?.activeFilters.filters?.length,\n filtersBlock?.activeFilters.priceFrom,\n filtersBlock?.activeFilters.priceTo,\n ]);\n\n const areCategoriesLoading = useMemo(\n () =>\n !!(\n sidebarProps.categoriesBlock &&\n sidebarProps.categoriesBlock.activeCategory === undefined\n ),\n [sidebarProps.categoriesBlock],\n );\n\n const isSidebarLoading = useMemo(\n () => areCategoriesLoading || !productGridProps.isFullyLoaded,\n [areCategoriesLoading, productGridProps.isFullyLoaded],\n );\n\n const isDefaultCategory = useMemo(\n () => !sidebarProps.categoriesBlock?.activeCategory,\n [sidebarProps.categoriesBlock?.activeCategory],\n );\n\n return (\n <S.Container size=\"desktop\">\n <LandingPageSidebar\n {...sidebarProps}\n isLoading={isSidebarLoading}\n categories={categories}\n filtersBlock={filtersBlock}\n isSearchUsed={isSearchUsed}\n productCount={productGridProps?.products?.length}\n productTypeProps={sidebarProps.productTypeBlock}\n isCartSummaryOpen={isCartSummaryOpen}\n />\n <S.ProductsContainer>\n {!sidebarProps.categoriesBlock ? (\n <S.SearchLoader height={40} />\n ) : (\n <LandingPageSearch {...searchProps} renderImage={renderImage} />\n )}\n <ProductGrid\n {...productGridProps}\n products={products}\n hasFilters={hasFilters}\n renderImage={renderImage}\n clearFilters={() => {\n filtersBlock?.onChange({});\n }}\n isLoading={areCategoriesLoading}\n isDefaultCategory={isDefaultCategory}\n />\n </S.ProductsContainer>\n </S.Container>\n );\n};\n"],"names":["maximumPriceFilterLookup","Map","CAD","code","EUR","AED","LandingPagePro","sidebarProps","productGridProps","searchProps","renderImage","isCartSummaryOpen","navigation","useMenu","isSearchUsed","useMemo","searchValue","categories","navItems","productTypeBlock","activeType","primary","items","secondary","filter","item","id","NavigationItemId","UnifiIdentity","UispSoftware","map","Accessories","label","CameraSecurity","category","innerItems","innerItem","slug","slugify","products","unshift","translations","all","forEach","product","activeCategoryIndex","findIndex","isIncluded","some","defaultCollectionSlug","organizationalCollectionSlug","push","activeCategoryInnerIndex","length","maxPriceFilterAmount","amount","get","filtersBlock","currency","Currency","Cad","categoryProducts","categoriesBlock","activeCategory","productsFilter","useCallback","activeFilters","filters","includes","variants","find","variant","isInStock","isComingSoon","isPreviouslyPurchased","isNew","isEarlyAccess","priceFrom","displayPrice","priceTo","productsSort","currentProduct","nextProduct","currentInStock","productHasSomeInStock","nextInStock","sortWeight","compareSortWeights","current","next","sortValue","Number","ProductGridSortOption","lowestPrice","highestPrice","newestProducts","oldestProducts","isFeatured","sort","minValDisplayPrice","reduce","prev","curr","minValue","maxValue","hasFilters","areCategoriesLoading","isSidebarLoading","isFullyLoaded","isDefaultCategory","jsxs","S.Container","size","children","jsx","LandingPageSidebar","isLoading","productCount","productTypeProps","S.ProductsContainer","S.SearchLoader","height","LandingPageSearch","ProductGrid","clearFilters","onChange"],"mappings":";;;;;;;;;;;;;;;;;;;AAwDA,MAAMA,wBAAA,GAAA,mBAA+BC,GAAI,CAAA,CACvC,CAACC,GAAI,CAAAC,IA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a,CAAAuD,eAAA,GAAA,eACZoD,GAAA,CAAAM,YAAA,EAAA;QAAeC,MAAQ,EAAA;OAAI,CAE5B,GAAA,eAAAP,GAAA,CAACQ,iBAAmB,EAAA;QAAA,GAAGjH;QAAaC;MAA0B,CAAA,CAAA,EAAA,eAEhEwG,GAAA,CAACS,WAAA,EAAA;QACE,GAAGnH,gBAAA;QACJ+B,QAAA;QACAkE,UAAA;QACA/F,WAAA;QACAkH,cAAcA,CAAA,KAAM;UACJnE,YAAA,EAAAoE,QAAA,CAAS,CAAA,CAAE,CAAA;QAC3B,CAAA;QACAT,SAAW,EAAAV,oBAAA;QACXG;MAAA,CACF,CAAA;KACF,CAAA;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Container: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
2
|
export declare const ProductsContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const SearchLoader: import("styled-components").StyledComponent<({ height, maxWidth, className, }: import("../SkeletonLoader/SkeletonLinearLoader/SkeletonLinearLoader").SkeletonLinearLoaderProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
2
|
export declare const ProductLayoutProductSectionWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const ProductLayoutLeftSide: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const ProductLayoutRightSide: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const Container: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {
|
|
2
2
|
imageCarouselFullScreen?: boolean;
|
|
3
3
|
}, never>;
|
|
4
|
-
export declare const UpsellContainer: import("styled-components").StyledComponent<import("react").
|
|
4
|
+
export declare const UpsellContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {
|
|
5
5
|
imageCarouselFullScreen?: boolean;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const ProductSection: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -44,7 +44,7 @@ export declare const DescriptionIconWrap: import("styled-components").StyledComp
|
|
|
44
44
|
export declare const BREADCRUMBS_HEIGHT: number;
|
|
45
45
|
export declare const LAYOUT_DIVIDER_HEIGHT = 1;
|
|
46
46
|
export declare const ProductLayoutDivider: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
47
|
-
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").
|
|
47
|
+
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
48
48
|
export declare const ProductLayoutBreadcrumbs: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Breadcrumbs/Breadcrumbs.types").BreadcrumbsProps & import("react").RefAttributes<HTMLDivElement | null>>, import("styled-components").DefaultTheme, {
|
|
49
49
|
showDivider?: boolean;
|
|
50
50
|
}, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const Container: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {
|
|
2
2
|
imageCarouselFullScreen?: boolean;
|
|
3
3
|
}, never>;
|
|
4
|
-
export declare const UpsellContainer: import("styled-components").StyledComponent<import("react").
|
|
4
|
+
export declare const UpsellContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {
|
|
5
5
|
imageCarouselFullScreen?: boolean;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const ProductSection: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -41,7 +41,7 @@ export declare const TopologyScheme: import("styled-components").StyledComponent
|
|
|
41
41
|
export declare const DescriptionItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
42
|
export declare const DescriptionIconCircle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
43
43
|
export declare const DescriptionIconWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
-
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").
|
|
44
|
+
export declare const ProductLayoutContainer: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
45
45
|
export declare const ProductLayoutHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
46
46
|
export declare const ProductLayoutTitle: import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, {}, never>;
|
|
47
47
|
export declare const ProductLayoutDescription: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Wrap: import("styled-components").StyledComponent<import("react").
|
|
1
|
+
export declare const Wrap: import("styled-components").StyledComponent<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
2
|
export declare const HeadingWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const Heading: import("styled-components").StyledComponent<"h2", import("styled-components").DefaultTheme, {}, never>;
|
|
4
4
|
export declare const SubHeading: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -11,7 +11,7 @@ require('./assets/play.svg.js');
|
|
|
11
11
|
var MicrositeVideoSlideshow_styles = require('./MicrositeVideoSlideshow.styles.js');
|
|
12
12
|
var MicrositeSectionWrap = require('../MicrositeSectionWrap/MicrositeSectionWrap.js');
|
|
13
13
|
var PlayIcon = require("../../assets/play.svg");
|
|
14
|
-
var PauseIcon = require("../../assets/
|
|
14
|
+
var PauseIcon = require("../../assets/pause.svg");
|
|
15
15
|
var ActiveIconBox = require("../../assets/active-icon-box.svg");
|
|
16
16
|
function _interopDefault(e) {
|
|
17
17
|
return e && e.__esModule ? e : {
|
|
@@ -9,7 +9,7 @@ import './assets/play.svg.mjs';
|
|
|
9
9
|
import { VideoBlock, Video, VideoControls, VideoInnerWrap, ProgressCircle, PlayIcon, PauseIcon, SlideRow, Slide, FeatureIconWrap, FeatureIconActiveBackground, FeatureIcon, FeatureTitle, MicrositeBuyButton } from './MicrositeVideoSlideshow.styles.mjs';
|
|
10
10
|
import { MicrositeSectionWrap } from '../MicrositeSectionWrap/MicrositeSectionWrap.mjs';
|
|
11
11
|
import PlayIcon__default from "../../assets/play.svg";
|
|
12
|
-
import PauseIcon__default from "../../assets/
|
|
12
|
+
import PauseIcon__default from "../../assets/pause.svg";
|
|
13
13
|
import ActiveIconBox__default from "../../assets/active-icon-box.svg";
|
|
14
14
|
"use strict";
|
|
15
15
|
const MicrositeVideoSlideshow = ({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/pause.svg";
|
|
2
|
+
export { default } from "../../../assets/pause.svg";
|
|
3
3
|
//# sourceMappingURL=pause.svg.mjs.map
|
|
@@ -246,6 +246,8 @@ const ModelCompare = ({
|
|
|
246
246
|
children: formatMessage(product.title)
|
|
247
247
|
}) : /* @__PURE__ */jsxRuntime.jsx(ModelCompareV3_styles.ProductTitle, {
|
|
248
248
|
children: formatMessage(product.title)
|
|
249
|
+
}), !!product?.productNote && /* @__PURE__ */jsxRuntime.jsx(ModelCompareV3_styles.ProductNote, {
|
|
250
|
+
children: formatMessage(product.productNote)
|
|
249
251
|
}), product.description ? /* @__PURE__ */jsxRuntime.jsx(ModelCompareV3_styles.ProductDescription, {
|
|
250
252
|
$maxWidth: product.descriptionMaxWidth,
|
|
251
253
|
$direction: languageDirection,
|