@ubnt/store.core 9.45.0-beta.2 → 9.45.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/_virtual/_virtual_multi-entry.js +2 -0
  3. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  4. package/lib/_virtual/_virtual_multi-entry.mjs +2 -0
  5. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  6. package/lib/apis/smartcat.d.ts +4 -4
  7. package/lib/apis/smartcat.js +1 -1
  8. package/lib/apis/smartcat.js.map +1 -1
  9. package/lib/apis/smartcat.mjs +1 -1
  10. package/lib/apis/smartcat.mjs.map +1 -1
  11. package/lib/assets/close2.svg +2 -3
  12. package/lib/assets/close3.svg +3 -2
  13. package/lib/assets/pause.svg +3 -3
  14. package/lib/assets/pause2.svg +3 -3
  15. package/lib/assets/ux.png +0 -0
  16. package/lib/components/Accordion/Accordion.js +2 -2
  17. package/lib/components/Accordion/Accordion.js.map +1 -1
  18. package/lib/components/Accordion/Accordion.mjs +2 -2
  19. package/lib/components/Accordion/Accordion.mjs.map +1 -1
  20. package/lib/components/CustomImage/CustomImage.js +4 -4
  21. package/lib/components/CustomImage/CustomImage.js.map +1 -1
  22. package/lib/components/CustomImage/CustomImage.mjs +4 -4
  23. package/lib/components/CustomImage/CustomImage.mjs.map +1 -1
  24. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +2 -2
  25. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js.map +1 -1
  26. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +2 -2
  27. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs.map +1 -1
  28. package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
  29. package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
  30. package/lib/components/Gallery/Gallery.context.js.map +1 -1
  31. package/lib/components/Gallery/Gallery.context.mjs.map +1 -1
  32. package/lib/components/Gallery/GalleryItem/GalleryItem.js +3 -1
  33. package/lib/components/Gallery/GalleryItem/GalleryItem.js.map +1 -1
  34. package/lib/components/Gallery/GalleryItem/GalleryItem.mjs +3 -1
  35. package/lib/components/Gallery/GalleryItem/GalleryItem.mjs.map +1 -1
  36. package/lib/components/Header/AccountFrame/AccountFrame.js +3 -3
  37. package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
  38. package/lib/components/Header/AccountFrame/AccountFrame.mjs +3 -3
  39. package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
  40. package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
  41. package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
  42. package/lib/components/Header/Header.js +3 -3
  43. package/lib/components/Header/Header.js.map +1 -1
  44. package/lib/components/Header/Header.mjs +3 -3
  45. package/lib/components/Header/Header.mjs.map +1 -1
  46. package/lib/components/Header/Header.types.d.ts +1 -1
  47. package/lib/components/Header/Header.types.js.map +1 -1
  48. package/lib/components/Header/Header.types.mjs.map +1 -1
  49. package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
  50. package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
  51. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js +2 -2
  52. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js.map +1 -1
  53. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs +2 -2
  54. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs.map +1 -1
  55. package/lib/components/Header/ProHeader/ProHeader.js +11 -7
  56. package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
  57. package/lib/components/Header/ProHeader/ProHeader.mjs +11 -7
  58. package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
  59. package/lib/components/Hero/Hero.js +1 -1
  60. package/lib/components/Hero/Hero.js.map +1 -1
  61. package/lib/components/Hero/Hero.mjs +1 -1
  62. package/lib/components/Hero/Hero.mjs.map +1 -1
  63. package/lib/components/HeroVideo/HeroVideo.js +5 -5
  64. package/lib/components/HeroVideo/HeroVideo.js.map +1 -1
  65. package/lib/components/HeroVideo/HeroVideo.mjs +5 -5
  66. package/lib/components/HeroVideo/HeroVideo.mjs.map +1 -1
  67. package/lib/components/ImageCarousel/ImageCarousel.js.map +1 -1
  68. package/lib/components/ImageCarousel/ImageCarousel.mjs.map +1 -1
  69. package/lib/components/LandingPagePro/LandingPagePro.js +4 -1
  70. package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
  71. package/lib/components/LandingPagePro/LandingPagePro.mjs +4 -1
  72. package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
  73. package/lib/components/LandingPageSidebar/LandingPageSidebar.js +8 -8
  74. package/lib/components/LandingPageSidebar/LandingPageSidebar.js.map +1 -1
  75. package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs +8 -8
  76. package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs.map +1 -1
  77. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.js +4 -4
  78. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.js.map +1 -1
  79. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.mjs +4 -4
  80. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.mjs.map +1 -1
  81. package/lib/components/MicrositeHero/MicrositeHero.js +2 -2
  82. package/lib/components/MicrositeHero/MicrositeHero.js.map +1 -1
  83. package/lib/components/MicrositeHero/MicrositeHero.mjs +2 -2
  84. package/lib/components/MicrositeHero/MicrositeHero.mjs.map +1 -1
  85. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
  86. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
  87. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
  88. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
  89. package/lib/components/Microsites/Microsites.types.js.map +1 -1
  90. package/lib/components/Microsites/Microsites.types.mjs.map +1 -1
  91. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js +37 -26
  92. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js.map +1 -1
  93. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs +37 -26
  94. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs.map +1 -1
  95. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +1 -1
  96. package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.js +16 -8
  97. package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.js.map +1 -1
  98. package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.mjs +16 -8
  99. package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.mjs.map +1 -1
  100. package/lib/components/ModelCompareV3/StickyGrid/context.d.ts +3 -3
  101. package/lib/components/ModelCompareV3/StickyGrid/context.js.map +1 -1
  102. package/lib/components/ModelCompareV3/StickyGrid/context.mjs.map +1 -1
  103. package/lib/components/PriceRangeSlider/PriceRangeSlider.types.d.ts +2 -2
  104. package/lib/components/PriceRangeSlider/PriceRangeSlider.types.js.map +1 -1
  105. package/lib/components/PriceRangeSlider/PriceRangeSlider.types.mjs.map +1 -1
  106. package/lib/components/ProductCard/ProductCard.js +1 -1
  107. package/lib/components/ProductCard/ProductCard.js.map +1 -1
  108. package/lib/components/ProductCard/ProductCard.mjs +2 -2
  109. package/lib/components/ProductCard/ProductCard.mjs.map +1 -1
  110. package/lib/components/ProductCardPopup/ProductCardPopup.js +2 -2
  111. package/lib/components/ProductCardPopup/ProductCardPopup.js.map +1 -1
  112. package/lib/components/ProductCardPopup/ProductCardPopup.mjs +2 -2
  113. package/lib/components/ProductCardPopup/ProductCardPopup.mjs.map +1 -1
  114. package/lib/components/ProductSectionTabs/ProductSectionTabs.js +6 -1
  115. package/lib/components/ProductSectionTabs/ProductSectionTabs.js.map +1 -1
  116. package/lib/components/ProductSectionTabs/ProductSectionTabs.mjs +6 -1
  117. package/lib/components/ProductSectionTabs/ProductSectionTabs.mjs.map +1 -1
  118. package/lib/components/ProductWizard/ProductWizard.js +3 -3
  119. package/lib/components/ProductWizard/ProductWizard.js.map +1 -1
  120. package/lib/components/ProductWizard/ProductWizard.mjs +3 -3
  121. package/lib/components/ProductWizard/ProductWizard.mjs.map +1 -1
  122. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js +17 -4
  123. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js.map +1 -1
  124. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.mjs +17 -4
  125. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.mjs.map +1 -1
  126. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +673 -589
  127. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
  128. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +672 -589
  129. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
  130. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +4 -4
  131. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
  132. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs +4 -4
  133. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
  134. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -1
  135. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +1 -0
  136. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
  137. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +1 -0
  138. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
  139. package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js +27 -0
  140. package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js.map +1 -0
  141. package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs +3 -0
  142. package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs.map +1 -0
  143. package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -0
  144. package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
  145. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -0
  146. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
  147. package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
  148. package/lib/components/ScrollWrapper/ScrollWrapper.styles.js +87 -64
  149. package/lib/components/ScrollWrapper/ScrollWrapper.styles.js.map +1 -1
  150. package/lib/components/ScrollWrapper/ScrollWrapper.styles.mjs +87 -64
  151. package/lib/components/ScrollWrapper/ScrollWrapper.styles.mjs.map +1 -1
  152. package/lib/components/StorageSliders/StorageSliders.context.js +17 -14
  153. package/lib/components/StorageSliders/StorageSliders.context.js.map +1 -1
  154. package/lib/components/StorageSliders/StorageSliders.context.mjs +17 -14
  155. package/lib/components/StorageSliders/StorageSliders.context.mjs.map +1 -1
  156. package/lib/components/StorybookUtils/StoryFaker.js.map +1 -1
  157. package/lib/components/StorybookUtils/StoryFaker.mjs.map +1 -1
  158. package/lib/components/VariantSelector/VariantSelector.js +4 -4
  159. package/lib/components/VariantSelector/VariantSelector.js.map +1 -1
  160. package/lib/components/VariantSelector/VariantSelector.mjs +4 -4
  161. package/lib/components/VariantSelector/VariantSelector.mjs.map +1 -1
  162. package/lib/components/VideoPlayerNew/VideoPlayer.js +14 -16
  163. package/lib/components/VideoPlayerNew/VideoPlayer.js.map +1 -1
  164. package/lib/components/VideoPlayerNew/VideoPlayer.mjs +14 -16
  165. package/lib/components/VideoPlayerNew/VideoPlayer.mjs.map +1 -1
  166. package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
  167. package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
  168. package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
  169. package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
  170. package/lib/constants/address.d.ts +1 -1
  171. package/lib/constants/address.js +34 -34
  172. package/lib/constants/address.js.map +1 -1
  173. package/lib/constants/address.mjs +34 -34
  174. package/lib/constants/address.mjs.map +1 -1
  175. package/lib/constants/icons/options/colors/black.svg.js +5 -5
  176. package/lib/constants/icons/options/colors/index.js +3 -3
  177. package/lib/constants/icons/options/styles/black.svg.js +5 -5
  178. package/lib/constants/icons/options/styles/index.js +3 -3
  179. package/lib/constants/optionIcons.js +6 -6
  180. package/lib/constants/optionIcons.mjs +4 -4
  181. package/lib/constants/postalCode.js +10 -10
  182. package/lib/constants/postalCode.js.map +1 -1
  183. package/lib/constants/postalCode.mjs +10 -10
  184. package/lib/constants/postalCode.mjs.map +1 -1
  185. package/lib/contexts/MenuContext/context.js +27 -26
  186. package/lib/contexts/MenuContext/context.js.map +1 -1
  187. package/lib/contexts/MenuContext/context.mjs +27 -26
  188. package/lib/contexts/MenuContext/context.mjs.map +1 -1
  189. package/lib/helpers/ux.d.ts +0 -11
  190. package/lib/hooks/useScrollToY.js.map +1 -1
  191. package/lib/hooks/useScrollToY.mjs.map +1 -1
  192. package/lib/utils/blackFriday.d.ts +1 -20
  193. package/lib/utils/blackFriday.js +3 -84
  194. package/lib/utils/blackFriday.js.map +1 -1
  195. package/lib/utils/blackFriday.mjs +1 -74
  196. package/lib/utils/blackFriday.mjs.map +1 -1
  197. package/lib/utils/collectionSlug.js +2 -2
  198. package/lib/utils/collectionSlug.js.map +1 -1
  199. package/lib/utils/collectionSlug.mjs +2 -2
  200. package/lib/utils/collectionSlug.mjs.map +1 -1
  201. package/lib/utils/errors.js.map +1 -1
  202. package/lib/utils/errors.mjs.map +1 -1
  203. package/lib/utils/index.d.ts +1 -0
  204. package/lib/utils/index.js +2 -0
  205. package/lib/utils/index.js.map +1 -1
  206. package/lib/utils/index.mjs +2 -0
  207. package/lib/utils/index.mjs.map +1 -1
  208. package/lib/utils/measures.js +1 -0
  209. package/lib/utils/measures.js.map +1 -1
  210. package/lib/utils/measures.mjs +1 -0
  211. package/lib/utils/measures.mjs.map +1 -1
  212. package/lib/utils/money/format.js.map +1 -1
  213. package/lib/utils/money/format.mjs.map +1 -1
  214. package/lib/utils/money/misc.js +1 -1
  215. package/lib/utils/money/misc.js.map +1 -1
  216. package/lib/utils/money/misc.mjs +1 -1
  217. package/lib/utils/money/misc.mjs.map +1 -1
  218. package/lib/utils/nextjs/ssr/transform-css-module.js.map +1 -1
  219. package/lib/utils/nextjs/ssr/transform-css-module.mjs.map +1 -1
  220. package/lib/utils/number.js.map +1 -1
  221. package/lib/utils/number.mjs.map +1 -1
  222. package/lib/utils/product.js +4 -4
  223. package/lib/utils/product.js.map +1 -1
  224. package/lib/utils/product.mjs +4 -4
  225. package/lib/utils/product.mjs.map +1 -1
  226. package/lib/utils/sales.d.ts +34 -0
  227. package/lib/utils/sales.js +113 -0
  228. package/lib/utils/sales.js.map +1 -0
  229. package/lib/utils/sales.mjs +99 -0
  230. package/lib/utils/sales.mjs.map +1 -0
  231. package/lib/utils/sales.test.d.ts +1 -0
  232. package/lib/utils/tags.js +2 -2
  233. package/lib/utils/tags.js.map +1 -1
  234. package/lib/utils/tags.mjs +2 -2
  235. package/lib/utils/tags.mjs.map +1 -1
  236. package/package.json +1 -1
  237. package/lib/helpers/ux.js +0 -53
  238. package/lib/helpers/ux.js.map +0 -1
  239. package/lib/helpers/ux.mjs +0 -49
  240. package/lib/helpers/ux.mjs.map +0 -1
@@ -48,6 +48,22 @@ const PaymentGooglePaySrc = {
48
48
  width: 30,
49
49
  height: 19
50
50
  };
51
+ const getPaymentIcon = type => {
52
+ switch (type) {
53
+ case "applePay":
54
+ {
55
+ return PaymentApplePaySrc;
56
+ }
57
+ case "googlePay":
58
+ {
59
+ return PaymentGooglePaySrc;
60
+ }
61
+ case "card":
62
+ {
63
+ return PaymentCardSrc;
64
+ }
65
+ }
66
+ };
51
67
  const ProductWizardFootnotes = ({
52
68
  maxRelevantLimitAddToCartQuantity,
53
69
  // relevantLimitQuantity,
@@ -94,10 +110,7 @@ const ProductWizardFootnotes = ({
94
110
  }
95
111
  return /* @__PURE__ */jsxRuntime.jsx(ProductWizardFootnotes_styles.ImageWrap, {
96
112
  children: Object.keys(availablePaymentMethods).map(key => {
97
- if (availablePaymentMethods[key] === false) {
98
- return null;
99
- }
100
- const src = key === "applePay" ? PaymentApplePaySrc : key === "googlePay" ? PaymentGooglePaySrc : PaymentCardSrc;
113
+ const src = getPaymentIcon(key);
101
114
  return /* @__PURE__ */jsxRuntime.jsx(ProductWizardFootnotes_styles.PaymentImage, {
102
115
  renderImage,
103
116
  asset: src,
@@ -1 +1 @@
1
- {"version":3,"file":"ProductWizardFootnotes.js","sources":["../../../src/components/ProductWizardFootnotes/ProductWizardFootnotes.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport PaymentApplePay from \"../../assets/icons/payment-apple-pay.svg\";\nimport PaymentCard from \"../../assets/icons/payment-card.svg\";\nimport PaymentGooglePay from \"../../assets/icons/payment-google-pay.svg\";\nimport {\n box,\n // hand,\n warranty,\n} from \"../../assets/icons/wizard\";\nimport { BackInStock } from \"../BackInStock\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./ProductWizardFootnotes.styles\";\nimport type { ProductWizardFootnotesProps } from \"./ProductWizardFootnotes.types\";\n\nconst PaymentCardSrcLink =\n typeof PaymentCard === \"string\" ? PaymentCard : PaymentCard.src;\nconst PaymentApplePaySrcLink =\n typeof PaymentApplePay === \"string\" ? PaymentApplePay : PaymentApplePay.src;\nconst PaymentGooglePaySrcLink =\n typeof PaymentGooglePay === \"string\"\n ? PaymentGooglePay\n : PaymentGooglePay.src;\n\nconst PaymentCardSrc = {\n src: PaymentCardSrcLink,\n alt: \"Card\",\n width: 24,\n height: 25,\n};\n\nconst PaymentApplePaySrc = {\n src: PaymentApplePaySrcLink,\n alt: \"Apple Pay\",\n width: 26,\n height: 19,\n};\n\nconst PaymentGooglePaySrc = {\n src: PaymentGooglePaySrcLink,\n alt: \"Google Pay\",\n width: 30,\n height: 19,\n};\n\nexport const ProductWizardFootnotes = ({\n maxRelevantLimitAddToCartQuantity,\n // relevantLimitQuantity,\n limitsDisabled,\n requiresLogin,\n showLimitError,\n translations,\n enableLimitAndBackInStock,\n backInStockProps,\n className,\n availablePaymentMethods,\n renderImage,\n}: ProductWizardFootnotesProps) => {\n // #############################################################################\n // Limitations\n // #############################################################################\n const limitErrorNode = useMemo(() => {\n if (limitsDisabled) {\n return;\n }\n\n if (requiresLogin) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitedToBuy}\n </S.ErrorText>\n );\n }\n\n if (maxRelevantLimitAddToCartQuantity === 0) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitReached}\n </S.ErrorText>\n );\n }\n\n if (\n maxRelevantLimitAddToCartQuantity != null &&\n maxRelevantLimitAddToCartQuantity > 0 &&\n showLimitError\n ) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitErrorPer}\n </S.ErrorText>\n );\n }\n\n return undefined;\n }, [\n limitsDisabled,\n requiresLogin,\n maxRelevantLimitAddToCartQuantity,\n showLimitError,\n translations.errors.limitedToBuy,\n translations.errors.limitReached,\n translations.errors.limitErrorPer,\n ]);\n\n const getCardIcons = useCallback(() => {\n const hasPaymentMethods =\n availablePaymentMethods &&\n Object.keys(availablePaymentMethods).filter((item) => {\n return !!availablePaymentMethods[\n item as keyof typeof availablePaymentMethods\n ];\n }).length > 0;\n\n if (!availablePaymentMethods || !hasPaymentMethods) {\n return;\n }\n\n return (\n <S.ImageWrap>\n {Object.keys(availablePaymentMethods).map((key) => {\n if (\n availablePaymentMethods[\n key as keyof typeof availablePaymentMethods\n ] === false\n ) {\n return null;\n }\n const src =\n key === \"applePay\"\n ? PaymentApplePaySrc\n : key === \"googlePay\"\n ? PaymentGooglePaySrc\n : PaymentCardSrc;\n return (\n <S.PaymentImage\n key={key}\n renderImage={renderImage}\n asset={src}\n sizes={`${src.width}px`}\n />\n );\n })}\n </S.ImageWrap>\n );\n }, [availablePaymentMethods, renderImage]);\n\n const footnotes = useMemo(\n () => (\n <>\n {getCardIcons()}\n {translations?.footnotes?.shipping?.loading ? (\n <S.SkeletonFootnote maxWidth={120} />\n ) : (\n translations?.footnotes?.shipping?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={box} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.shipping.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )}\n {translations?.footnotes?.warranty && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={warranty} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>{translations.footnotes.warranty}</S.FootnoteText>\n </S.IconTextWrap>\n )}\n {/* Hide limits */}\n {/* {translations?.footnotes?.limit?.loading ? (\n <S.SkeletonFootnote maxWidth={200} />\n ) : (\n !!relevantLimitQuantity &&\n translations?.footnotes?.limit?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={hand} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.limit.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )} */}\n </>\n ),\n [\n getCardIcons,\n translations.footnotes.shipping?.loading,\n translations.footnotes.shipping.value,\n translations.footnotes.warranty,\n ],\n );\n\n /**\n * Does the footnotes have any content\n */\n const hasFootnotes = useMemo(\n () => !!footnotes.props.children.filter((child: unknown) => !!child).length,\n [footnotes.props.children],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n if (!hasFootnotes && !enableLimitAndBackInStock && !limitErrorNode) {\n return null;\n }\n\n return (\n <S.Wrap className={className}>\n {enableLimitAndBackInStock && (\n <>\n {backInStockProps && <BackInStock {...backInStockProps} />}\n {limitErrorNode}\n </>\n )}\n <S.FootnoteWrap>{footnotes}</S.FootnoteWrap>\n </S.Wrap>\n );\n};\n"],"names":["PaymentCardSrcLink","PaymentCard","src","PaymentApplePaySrcLink","PaymentApplePay","PaymentGooglePaySrcLink","PaymentGooglePay","PaymentCardSrc","alt","width","height","PaymentApplePaySrc","PaymentGooglePaySrc","ProductWizardFootnotes","maxRelevantLimitAddToCartQuantity","limitsDisabled","requiresLogin","showLimitError","translations","enableLimitAndBackInStock","backInStockProps","className","availablePaymentMethods","renderImage","limitErrorNode","useMemo","jsx","S.ErrorText","children","errors","limitedToBuy","limitReached","limitErrorPer","getCardIcons","useCallback","hasPaymentMethods","Object","keys","filter","item","length","S.ImageWrap","map","key","S.PaymentImage","PaymentImage","asset","sizes","footnotes","jsxs","Fragment","shipping","loading","S.SkeletonFootnote","maxWidth","value","S.IconTextWrap","S.IconWrap","StyleableSvgImage","box","S.FootnoteText","FootnoteText","warranty","hasFootnotes","props","child","S.Wrap","BackInStock","S.FootnoteWrap","FootnoteWrap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,kBACJ,GAAA,OAAOC,oBAAAA,CAAAA,SAAAA,CAAgB,KAAA,QAAA,GAAWA,oBAAAA,CAAAA,SAAAA,IAAcA,oBAAAA,CAAAA,SAAAA,CAAY,CAAAC,GAAA;AAC9D,MAAMC,sBACJ,GAAA,OAAOC,wBAAAA,CAAAA,SAAAA,CAAoB,KAAA,QAAA,GAAWA,wBAAAA,CAAAA,SAAAA,IAA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AAA;QAAA,CAAI;MAC3D,CAAA,CAAA,EAAA,8BAECkD,6BAAE,CAAAC,YAAA,EAAF;QAAgBjC,QAAA,EAAAV,YAAA,CAAa8B,UAAUc;OAAS,CAAA;KACnD,CAAA;GAmBJ,CAAA,EAEF,CACE7B,YAAA,EACAf,YAAA,CAAa8B,UAAUG,QAAU,EAAAC,OAAA,EACjClC,YAAA,CAAa8B,UAAUG,QAAS,CAAAI,KAAA,EAChCrC,aAAa8B,SAAU,CAAAc,QAAA,CACzB,CACF;EAKA,MAAMC,YAAe,GAAAtC,KAAA,CAAAA,OAAA,CACnB,MAAM,CAAC,CAACuB,SAAA,CAAUgB,KAAM,CAAApC,QAAA,CAASU,MAAO,CAAC2B,KAAmB,IAAA,CAAC,CAACA,KAAK,CAAE,CAAAzB,MAAA,EACrE,CAACQ,SAAU,CAAAgB,KAAA,CAAMpC,QAAQ,CAAA,CAC3B;EAKA,IAAI,CAACmC,YAAA,IAAgB,CAAC5C,yBAAA,IAA6B,CAACK,cAAgB,EAAA;IAC3D,OAAA,IAAA;EACT;EAEA,OAAA,eACGyB,eAAA,CAAAiB,6BAAAA,CAAAA,IAAA,EAAA;IAAO7C,SACL;IAAAO,QAAA,EAAA,CAAAT,yBAAA,mBAEI8B,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;MAAAtB,QAAA,EAAA,CAAoBR,gBAAA,IAAAM,eAAAA,UAAAA,CAAAA,GAAA,CAACyC,WAAAA,CAAAA,WAAa,EAAA;QAAA,GAAG/C;MAAkB,CAAA,CAAA,EACvDI,cAAA;KACH,CAAA,EAEDE,eAAAA,UAAAA,CAAAA,GAAA,CAAA0C,6BAAA,CAAAC,YAAA,EAAA;MAAgBzC,QAAU,EAAAoB;IAAA,CAAA,CAAA;EAC7B,CAAA,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"ProductWizardFootnotes.js","sources":["../../../src/components/ProductWizardFootnotes/ProductWizardFootnotes.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport PaymentApplePay from \"../../assets/icons/payment-apple-pay.svg\";\nimport PaymentCard from \"../../assets/icons/payment-card.svg\";\nimport PaymentGooglePay from \"../../assets/icons/payment-google-pay.svg\";\nimport {\n box,\n // hand,\n warranty,\n} from \"../../assets/icons/wizard\";\nimport { BackInStock } from \"../BackInStock\";\nimport type { PaymentTypes } from \"../ProductWizard/ProductWizard.types\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./ProductWizardFootnotes.styles\";\nimport type { ProductWizardFootnotesProps } from \"./ProductWizardFootnotes.types\";\n\nconst PaymentCardSrcLink =\n typeof PaymentCard === \"string\" ? PaymentCard : PaymentCard.src;\nconst PaymentApplePaySrcLink =\n typeof PaymentApplePay === \"string\" ? PaymentApplePay : PaymentApplePay.src;\nconst PaymentGooglePaySrcLink =\n typeof PaymentGooglePay === \"string\"\n ? PaymentGooglePay\n : PaymentGooglePay.src;\n\nconst PaymentCardSrc = {\n src: PaymentCardSrcLink,\n alt: \"Card\",\n width: 24,\n height: 25,\n};\n\nconst PaymentApplePaySrc = {\n src: PaymentApplePaySrcLink,\n alt: \"Apple Pay\",\n width: 26,\n height: 19,\n};\n\nconst PaymentGooglePaySrc = {\n src: PaymentGooglePaySrcLink,\n alt: \"Google Pay\",\n width: 30,\n height: 19,\n};\n\nconst getPaymentIcon = (type: keyof PaymentTypes) => {\n switch (type) {\n case \"applePay\": {\n return PaymentApplePaySrc;\n }\n case \"googlePay\": {\n return PaymentGooglePaySrc;\n }\n case \"card\": {\n return PaymentCardSrc;\n }\n }\n};\n\nexport const ProductWizardFootnotes = ({\n maxRelevantLimitAddToCartQuantity,\n // relevantLimitQuantity,\n limitsDisabled,\n requiresLogin,\n showLimitError,\n translations,\n enableLimitAndBackInStock,\n backInStockProps,\n className,\n availablePaymentMethods,\n renderImage,\n}: ProductWizardFootnotesProps) => {\n // #############################################################################\n // Limitations\n // #############################################################################\n const limitErrorNode = useMemo(() => {\n if (limitsDisabled) {\n return;\n }\n\n if (requiresLogin) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitedToBuy}\n </S.ErrorText>\n );\n }\n\n if (maxRelevantLimitAddToCartQuantity === 0) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitReached}\n </S.ErrorText>\n );\n }\n\n if (\n maxRelevantLimitAddToCartQuantity != null &&\n maxRelevantLimitAddToCartQuantity > 0 &&\n showLimitError\n ) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitErrorPer}\n </S.ErrorText>\n );\n }\n\n return undefined;\n }, [\n limitsDisabled,\n requiresLogin,\n maxRelevantLimitAddToCartQuantity,\n showLimitError,\n translations.errors.limitedToBuy,\n translations.errors.limitReached,\n translations.errors.limitErrorPer,\n ]);\n\n const getCardIcons = useCallback(() => {\n const hasPaymentMethods =\n availablePaymentMethods &&\n Object.keys(availablePaymentMethods).filter((item) => {\n return !!availablePaymentMethods[\n item as keyof typeof availablePaymentMethods\n ];\n }).length > 0;\n\n if (!availablePaymentMethods || !hasPaymentMethods) {\n return;\n }\n\n return (\n <S.ImageWrap>\n {Object.keys(availablePaymentMethods).map((key) => {\n const src = getPaymentIcon(key);\n\n return (\n <S.PaymentImage\n key={key}\n renderImage={renderImage}\n asset={src}\n sizes={`${src.width}px`}\n />\n );\n })}\n </S.ImageWrap>\n );\n }, [availablePaymentMethods, renderImage]);\n\n const footnotes = useMemo(\n () => (\n <>\n {getCardIcons()}\n {translations?.footnotes?.shipping?.loading ? (\n <S.SkeletonFootnote maxWidth={120} />\n ) : (\n translations?.footnotes?.shipping?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={box} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.shipping.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )}\n {translations?.footnotes?.warranty && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={warranty} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>{translations.footnotes.warranty}</S.FootnoteText>\n </S.IconTextWrap>\n )}\n {/* Hide limits */}\n {/* {translations?.footnotes?.limit?.loading ? (\n <S.SkeletonFootnote maxWidth={200} />\n ) : (\n !!relevantLimitQuantity &&\n translations?.footnotes?.limit?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={hand} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.limit.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )} */}\n </>\n ),\n [\n getCardIcons,\n translations.footnotes.shipping?.loading,\n translations.footnotes.shipping.value,\n translations.footnotes.warranty,\n ],\n );\n\n /**\n * Does the footnotes have any content\n */\n const hasFootnotes = useMemo(\n () => !!footnotes.props.children.filter((child: unknown) => !!child).length,\n [footnotes.props.children],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n if (!hasFootnotes && !enableLimitAndBackInStock && !limitErrorNode) {\n return null;\n }\n\n return (\n <S.Wrap className={className}>\n {enableLimitAndBackInStock && (\n <>\n {backInStockProps && <BackInStock {...backInStockProps} />}\n {limitErrorNode}\n </>\n )}\n <S.FootnoteWrap>{footnotes}</S.FootnoteWrap>\n </S.Wrap>\n );\n};\n"],"names":["PaymentCardSrcLink","PaymentCard","src","PaymentApplePaySrcLink","PaymentApplePay","PaymentGooglePaySrcLink","PaymentGooglePay","PaymentCardSrc","alt","width","height","PaymentApplePaySrc","PaymentGooglePaySrc","getPaymentIcon","type","ProductWizardFootnotes","maxRelevantLimitAddToCartQuantity","limitsDisabled","requiresLogin","showLimitError","translations","enableLimitAndBackInStock","backInStockProps","className","availablePaymentMethods","renderImage","limitErrorNode","useMemo","jsx","S.ErrorText","children","errors","limitedToBuy","limitReached","limitErrorPer","getCardIcons","useCallback","hasPaymentMethods","Object","keys","filter","item","length","S.ImageWrap","map","key","S.PaymentImage","PaymentImage","asset","sizes","footnotes","jsxs","Fragment","shipping","loading","S.SkeletonFootnote","maxWidth","value","S.IconTextWrap","S.IconWrap","StyleableSvgImage","box","S.FootnoteText","FootnoteText","warranty","hasFootnotes","props","child","S.Wrap","BackInStock","S.FootnoteWrap","FootnoteWrap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,kBACJ,GAAA,OAAOC,oBAAAA,CAAAA,SAAAA,CAAgB,KAAA,QAAA,GAAWA,oBAAAA,CAAAA,SAAAA,IAAcA,oBAAAA,CAAAA,SAAAA,CAAY,CAAAC,GAAA;AAC9D,MAAMC,sBACJ,GAAA,OAAOC,wBAAAA,CAAAA,SAAAA,CAAoB,KAAA,QAAA,GAAWA,wBAAAA,CAAAA,SAAAA,IAAkBA,wBAAAA,CAAAA,SAAAA,CAAgB,CAAAF,GAAA;AAC1E,MAAMG,uBACJ,GAAA,OAAOC,yBAAAA,CAAAA,SAAAA,CAAqB,KAAA,QAAA,GACxBA,yBAAAA,CAAAA,SAAAA,IACAA,yBAAAA,CAAAA,SAAAA,CAAiB,CAAAJ,GAAA;AAEvB,MAAMK,cAAiB,GAAA;EACrBL,GAAK,EAAAF,kBAAA;EACLQ,GAAK,EAAA,MAAA;EACLC,KAAO,EAAA,EAAA;EACPC,MAAQ,EAAA;AACV,CAAA;AAEA,MAAMC,kBAAqB,GAAA;EACzBT,GAAK,EAAAC,sBAAA;EACLK,GAAK,EAAA,WAAA;EACLC,KAAO,EAAA,EAAA;EACPC,MAAQ,EAAA;AACV,CAAA;AAEA,MAAME,mBAAsB,GAAA;EAC1BV,GAAK,EAAAG,uBAAA;EACLG,GAAK,EAAA,YAAA;EACLC,KAAO,EAAA,EAAA;EACPC,MAAQ,EAAA;AACV,CAAA;AAEA,MAAMG,cAAA,GAAkBC,IAA6B,IAAA;EACnD,QAAQA,IAAM;IACZ,KAAK,UAAY;MAAA;QACR,OAAAH,kBAAA;MACT;IACA,KAAK,WAAa;MAAA;QACT,OAAAC,mBAAA;MACT;IACA,KAAK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AA,CAAAiB,6BAAAA,CAAAA,IAAA,EAAA;IAAO7C,SACL;IAAAO,QAAA,EAAA,CAAAT,yBAAA,mBAEI8B,UAAA,CAAAA,IAAA,CAAAC,mBAAA,EAAA;MAAAtB,QAAA,EAAA,CAAoBR,gBAAA,IAAAM,eAAAA,UAAAA,CAAAA,GAAA,CAACyC,WAAAA,CAAAA,WAAa,EAAA;QAAA,GAAG/C;MAAkB,CAAA,CAAA,EACvDI,cAAA;KACH,CAAA,EAEDE,eAAAA,UAAAA,CAAAA,GAAA,CAAA0C,6BAAA,CAAAC,YAAA,EAAA;MAAgBzC,QAAU,EAAAoB;IAAA,CAAA,CAAA;EAC7B,CAAA,CAAA;AAEJ,CAAA;"}
@@ -36,6 +36,22 @@ const PaymentGooglePaySrc = {
36
36
  width: 30,
37
37
  height: 19
38
38
  };
39
+ const getPaymentIcon = type => {
40
+ switch (type) {
41
+ case "applePay":
42
+ {
43
+ return PaymentApplePaySrc;
44
+ }
45
+ case "googlePay":
46
+ {
47
+ return PaymentGooglePaySrc;
48
+ }
49
+ case "card":
50
+ {
51
+ return PaymentCardSrc;
52
+ }
53
+ }
54
+ };
39
55
  const ProductWizardFootnotes = ({
40
56
  maxRelevantLimitAddToCartQuantity,
41
57
  // relevantLimitQuantity,
@@ -82,10 +98,7 @@ const ProductWizardFootnotes = ({
82
98
  }
83
99
  return /* @__PURE__ */jsx(ImageWrap, {
84
100
  children: Object.keys(availablePaymentMethods).map(key => {
85
- if (availablePaymentMethods[key] === false) {
86
- return null;
87
- }
88
- const src = key === "applePay" ? PaymentApplePaySrc : key === "googlePay" ? PaymentGooglePaySrc : PaymentCardSrc;
101
+ const src = getPaymentIcon(key);
89
102
  return /* @__PURE__ */jsx(PaymentImage, {
90
103
  renderImage,
91
104
  asset: src,
@@ -1 +1 @@
1
- {"version":3,"file":"ProductWizardFootnotes.mjs","sources":["../../../src/components/ProductWizardFootnotes/ProductWizardFootnotes.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport PaymentApplePay from \"../../assets/icons/payment-apple-pay.svg\";\nimport PaymentCard from \"../../assets/icons/payment-card.svg\";\nimport PaymentGooglePay from \"../../assets/icons/payment-google-pay.svg\";\nimport {\n box,\n // hand,\n warranty,\n} from \"../../assets/icons/wizard\";\nimport { BackInStock } from \"../BackInStock\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./ProductWizardFootnotes.styles\";\nimport type { ProductWizardFootnotesProps } from \"./ProductWizardFootnotes.types\";\n\nconst PaymentCardSrcLink =\n typeof PaymentCard === \"string\" ? PaymentCard : PaymentCard.src;\nconst PaymentApplePaySrcLink =\n typeof PaymentApplePay === \"string\" ? PaymentApplePay : PaymentApplePay.src;\nconst PaymentGooglePaySrcLink =\n typeof PaymentGooglePay === \"string\"\n ? PaymentGooglePay\n : PaymentGooglePay.src;\n\nconst PaymentCardSrc = {\n src: PaymentCardSrcLink,\n alt: \"Card\",\n width: 24,\n height: 25,\n};\n\nconst PaymentApplePaySrc = {\n src: PaymentApplePaySrcLink,\n alt: \"Apple Pay\",\n width: 26,\n height: 19,\n};\n\nconst PaymentGooglePaySrc = {\n src: PaymentGooglePaySrcLink,\n alt: \"Google Pay\",\n width: 30,\n height: 19,\n};\n\nexport const ProductWizardFootnotes = ({\n maxRelevantLimitAddToCartQuantity,\n // relevantLimitQuantity,\n limitsDisabled,\n requiresLogin,\n showLimitError,\n translations,\n enableLimitAndBackInStock,\n backInStockProps,\n className,\n availablePaymentMethods,\n renderImage,\n}: ProductWizardFootnotesProps) => {\n // #############################################################################\n // Limitations\n // #############################################################################\n const limitErrorNode = useMemo(() => {\n if (limitsDisabled) {\n return;\n }\n\n if (requiresLogin) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitedToBuy}\n </S.ErrorText>\n );\n }\n\n if (maxRelevantLimitAddToCartQuantity === 0) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitReached}\n </S.ErrorText>\n );\n }\n\n if (\n maxRelevantLimitAddToCartQuantity != null &&\n maxRelevantLimitAddToCartQuantity > 0 &&\n showLimitError\n ) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitErrorPer}\n </S.ErrorText>\n );\n }\n\n return undefined;\n }, [\n limitsDisabled,\n requiresLogin,\n maxRelevantLimitAddToCartQuantity,\n showLimitError,\n translations.errors.limitedToBuy,\n translations.errors.limitReached,\n translations.errors.limitErrorPer,\n ]);\n\n const getCardIcons = useCallback(() => {\n const hasPaymentMethods =\n availablePaymentMethods &&\n Object.keys(availablePaymentMethods).filter((item) => {\n return !!availablePaymentMethods[\n item as keyof typeof availablePaymentMethods\n ];\n }).length > 0;\n\n if (!availablePaymentMethods || !hasPaymentMethods) {\n return;\n }\n\n return (\n <S.ImageWrap>\n {Object.keys(availablePaymentMethods).map((key) => {\n if (\n availablePaymentMethods[\n key as keyof typeof availablePaymentMethods\n ] === false\n ) {\n return null;\n }\n const src =\n key === \"applePay\"\n ? PaymentApplePaySrc\n : key === \"googlePay\"\n ? PaymentGooglePaySrc\n : PaymentCardSrc;\n return (\n <S.PaymentImage\n key={key}\n renderImage={renderImage}\n asset={src}\n sizes={`${src.width}px`}\n />\n );\n })}\n </S.ImageWrap>\n );\n }, [availablePaymentMethods, renderImage]);\n\n const footnotes = useMemo(\n () => (\n <>\n {getCardIcons()}\n {translations?.footnotes?.shipping?.loading ? (\n <S.SkeletonFootnote maxWidth={120} />\n ) : (\n translations?.footnotes?.shipping?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={box} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.shipping.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )}\n {translations?.footnotes?.warranty && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={warranty} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>{translations.footnotes.warranty}</S.FootnoteText>\n </S.IconTextWrap>\n )}\n {/* Hide limits */}\n {/* {translations?.footnotes?.limit?.loading ? (\n <S.SkeletonFootnote maxWidth={200} />\n ) : (\n !!relevantLimitQuantity &&\n translations?.footnotes?.limit?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={hand} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.limit.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )} */}\n </>\n ),\n [\n getCardIcons,\n translations.footnotes.shipping?.loading,\n translations.footnotes.shipping.value,\n translations.footnotes.warranty,\n ],\n );\n\n /**\n * Does the footnotes have any content\n */\n const hasFootnotes = useMemo(\n () => !!footnotes.props.children.filter((child: unknown) => !!child).length,\n [footnotes.props.children],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n if (!hasFootnotes && !enableLimitAndBackInStock && !limitErrorNode) {\n return null;\n }\n\n return (\n <S.Wrap className={className}>\n {enableLimitAndBackInStock && (\n <>\n {backInStockProps && <BackInStock {...backInStockProps} />}\n {limitErrorNode}\n </>\n )}\n <S.FootnoteWrap>{footnotes}</S.FootnoteWrap>\n </S.Wrap>\n );\n};\n"],"names":["PaymentCardSrcLink","PaymentCard","src","PaymentApplePaySrcLink","PaymentApplePay","PaymentGooglePaySrcLink","PaymentGooglePay","PaymentCardSrc","alt","width","height","PaymentApplePaySrc","PaymentGooglePaySrc","ProductWizardFootnotes","maxRelevantLimitAddToCartQuantity","limitsDisabled","requiresLogin","showLimitError","translations","enableLimitAndBackInStock","backInStockProps","className","availablePaymentMethods","renderImage","limitErrorNode","useMemo","jsx","S.ErrorText","children","errors","limitedToBuy","limitReached","limitErrorPer","getCardIcons","useCallback","hasPaymentMethods","Object","keys","filter","item","length","S.ImageWrap","map","key","S.PaymentImage","asset","sizes","footnotes","jsxs","Fragment","shipping","loading","S.SkeletonFootnote","maxWidth","value","S.IconTextWrap","S.IconWrap","StyleableSvgImage","box","S.FootnoteText","warranty","hasFootnotes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AAUG,QAAS,CAAAI,KAAA,EAChCpC,aAAa6B,SAAU,CAAAa,QAAA,CACzB,CACF;EAKA,MAAMC,YAAe,GAAApC,OAAA,CACnB,MAAM,CAAC,CAACsB,SAAA,CAAUe,KAAM,CAAAlC,QAAA,CAASU,MAAO,CAACyB,KAAmB,IAAA,CAAC,CAACA,KAAK,CAAE,CAAAvB,MAAA,EACrE,CAACO,SAAU,CAAAe,KAAA,CAAMlC,QAAQ,CAAA,CAC3B;EAKA,IAAI,CAACiC,YAAA,IAAgB,CAAC1C,yBAAA,IAA6B,CAACK,cAAgB,EAAA;IAC3D,OAAA,IAAA;EACT;EAEA,OAAA,eACGwB,IAAA,CAAAgB,IAAA,EAAA;IAAO3C,SACL;IAAAO,QAAA,EAAA,CAAAT,yBAAA,mBAEI6B,IAAA,CAAAC,QAAA,EAAA;MAAArB,QAAA,EAAA,CAAoBR,gBAAA,IAAA,eAAAM,GAAA,CAACuC,WAAa,EAAA;QAAA,GAAG7C;MAAkB,CAAA,CAAA,EACvDI,cAAA;KACH,CAAA,EAED,eAAAE,GAAA,CAAAwC,YAAA,EAAA;MAAgBtC,QAAU,EAAAmB;IAAA,CAAA,CAAA;EAC7B,CAAA,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"ProductWizardFootnotes.mjs","sources":["../../../src/components/ProductWizardFootnotes/ProductWizardFootnotes.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\n\nimport PaymentApplePay from \"../../assets/icons/payment-apple-pay.svg\";\nimport PaymentCard from \"../../assets/icons/payment-card.svg\";\nimport PaymentGooglePay from \"../../assets/icons/payment-google-pay.svg\";\nimport {\n box,\n // hand,\n warranty,\n} from \"../../assets/icons/wizard\";\nimport { BackInStock } from \"../BackInStock\";\nimport type { PaymentTypes } from \"../ProductWizard/ProductWizard.types\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./ProductWizardFootnotes.styles\";\nimport type { ProductWizardFootnotesProps } from \"./ProductWizardFootnotes.types\";\n\nconst PaymentCardSrcLink =\n typeof PaymentCard === \"string\" ? PaymentCard : PaymentCard.src;\nconst PaymentApplePaySrcLink =\n typeof PaymentApplePay === \"string\" ? PaymentApplePay : PaymentApplePay.src;\nconst PaymentGooglePaySrcLink =\n typeof PaymentGooglePay === \"string\"\n ? PaymentGooglePay\n : PaymentGooglePay.src;\n\nconst PaymentCardSrc = {\n src: PaymentCardSrcLink,\n alt: \"Card\",\n width: 24,\n height: 25,\n};\n\nconst PaymentApplePaySrc = {\n src: PaymentApplePaySrcLink,\n alt: \"Apple Pay\",\n width: 26,\n height: 19,\n};\n\nconst PaymentGooglePaySrc = {\n src: PaymentGooglePaySrcLink,\n alt: \"Google Pay\",\n width: 30,\n height: 19,\n};\n\nconst getPaymentIcon = (type: keyof PaymentTypes) => {\n switch (type) {\n case \"applePay\": {\n return PaymentApplePaySrc;\n }\n case \"googlePay\": {\n return PaymentGooglePaySrc;\n }\n case \"card\": {\n return PaymentCardSrc;\n }\n }\n};\n\nexport const ProductWizardFootnotes = ({\n maxRelevantLimitAddToCartQuantity,\n // relevantLimitQuantity,\n limitsDisabled,\n requiresLogin,\n showLimitError,\n translations,\n enableLimitAndBackInStock,\n backInStockProps,\n className,\n availablePaymentMethods,\n renderImage,\n}: ProductWizardFootnotesProps) => {\n // #############################################################################\n // Limitations\n // #############################################################################\n const limitErrorNode = useMemo(() => {\n if (limitsDisabled) {\n return;\n }\n\n if (requiresLogin) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitedToBuy}\n </S.ErrorText>\n );\n }\n\n if (maxRelevantLimitAddToCartQuantity === 0) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitReached}\n </S.ErrorText>\n );\n }\n\n if (\n maxRelevantLimitAddToCartQuantity != null &&\n maxRelevantLimitAddToCartQuantity > 0 &&\n showLimitError\n ) {\n return (\n <S.ErrorText data-test-id=\"max-limit-error\">\n {translations.errors.limitErrorPer}\n </S.ErrorText>\n );\n }\n\n return undefined;\n }, [\n limitsDisabled,\n requiresLogin,\n maxRelevantLimitAddToCartQuantity,\n showLimitError,\n translations.errors.limitedToBuy,\n translations.errors.limitReached,\n translations.errors.limitErrorPer,\n ]);\n\n const getCardIcons = useCallback(() => {\n const hasPaymentMethods =\n availablePaymentMethods &&\n Object.keys(availablePaymentMethods).filter((item) => {\n return !!availablePaymentMethods[\n item as keyof typeof availablePaymentMethods\n ];\n }).length > 0;\n\n if (!availablePaymentMethods || !hasPaymentMethods) {\n return;\n }\n\n return (\n <S.ImageWrap>\n {Object.keys(availablePaymentMethods).map((key) => {\n const src = getPaymentIcon(key);\n\n return (\n <S.PaymentImage\n key={key}\n renderImage={renderImage}\n asset={src}\n sizes={`${src.width}px`}\n />\n );\n })}\n </S.ImageWrap>\n );\n }, [availablePaymentMethods, renderImage]);\n\n const footnotes = useMemo(\n () => (\n <>\n {getCardIcons()}\n {translations?.footnotes?.shipping?.loading ? (\n <S.SkeletonFootnote maxWidth={120} />\n ) : (\n translations?.footnotes?.shipping?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={box} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.shipping.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )}\n {translations?.footnotes?.warranty && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={warranty} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>{translations.footnotes.warranty}</S.FootnoteText>\n </S.IconTextWrap>\n )}\n {/* Hide limits */}\n {/* {translations?.footnotes?.limit?.loading ? (\n <S.SkeletonFootnote maxWidth={200} />\n ) : (\n !!relevantLimitQuantity &&\n translations?.footnotes?.limit?.value && (\n <S.IconTextWrap>\n <S.IconWrap>\n <StyleableSvgImage src={hand} width={20} height={20} />\n </S.IconWrap>\n\n <S.FootnoteText>\n {translations.footnotes.limit.value}\n </S.FootnoteText>\n </S.IconTextWrap>\n )\n )} */}\n </>\n ),\n [\n getCardIcons,\n translations.footnotes.shipping?.loading,\n translations.footnotes.shipping.value,\n translations.footnotes.warranty,\n ],\n );\n\n /**\n * Does the footnotes have any content\n */\n const hasFootnotes = useMemo(\n () => !!footnotes.props.children.filter((child: unknown) => !!child).length,\n [footnotes.props.children],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n if (!hasFootnotes && !enableLimitAndBackInStock && !limitErrorNode) {\n return null;\n }\n\n return (\n <S.Wrap className={className}>\n {enableLimitAndBackInStock && (\n <>\n {backInStockProps && <BackInStock {...backInStockProps} />}\n {limitErrorNode}\n </>\n )}\n <S.FootnoteWrap>{footnotes}</S.FootnoteWrap>\n </S.Wrap>\n );\n};\n"],"names":["PaymentCardSrcLink","PaymentCard","src","PaymentApplePaySrcLink","PaymentApplePay","PaymentGooglePaySrcLink","PaymentGooglePay","PaymentCardSrc","alt","width","height","PaymentApplePaySrc","PaymentGooglePaySrc","getPaymentIcon","type","ProductWizardFootnotes","maxRelevantLimitAddToCartQuantity","limitsDisabled","requiresLogin","showLimitError","translations","enableLimitAndBackInStock","backInStockProps","className","availablePaymentMethods","renderImage","limitErrorNode","useMemo","jsx","S.ErrorText","children","errors","limitedToBuy","limitReached","limitErrorPer","getCardIcons","useCallback","hasPaymentMethods","Object","keys","filter","item","length","S.ImageWrap","map","key","S.PaymentImage","asset","sizes","footnotes","jsxs","Fragment","shipping","loading","S.SkeletonFootnote","maxWidth","value","S.IconTextWrap","S.IconWrap","StyleableSvgImage","box","S.FootnoteText","warranty","hasFootnotes","props","child","S.Wrap","BackInStock","S.FootnoteWrap"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAMA,kBACJ,GAAA,OAAOC,oBAAgB,KAAA,QAAA,GAAWA,uBAAcA,oBAAY,CAAAC,GAAA;AAC9D,MAAMC,sBACJ,GAAA,OAAOC,wBAAoB,KAAA,QAAA,GAAWA,2BAAkBA,wBAAgB,CAAAF,GAAA;AAC1E,MAAMG,uBACJ,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