@gem-sdk/components 19.0.0-staging.6 → 19.0.0-staging.60

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 (212) hide show
  1. package/dist/cjs/builder.js +1 -1
  2. package/dist/cjs/carousel-v3/components/arrow/Arrow.liquid.js +8 -8
  3. package/dist/cjs/carousel-v3/components/arrow/common/classes.js +1 -1
  4. package/dist/cjs/carousel-v3/components/dot/common/helpers.js +1 -1
  5. package/dist/cjs/carousel-v3/components/item/CarouselItem.js +1 -1
  6. package/dist/cjs/carousel-v3/components/root/Carousel.js +1 -1
  7. package/dist/cjs/carousel-v3/components/root/Carousel.liquid.js +1 -1
  8. package/dist/cjs/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
  9. package/dist/cjs/carousel-v3/components/root/common/helpers.js +1 -1
  10. package/dist/cjs/carousel-v3/components/swiper/Swiper.js +1 -1
  11. package/dist/cjs/carousel-v3/hooks/useCarousel.js +1 -1
  12. package/dist/cjs/carousel-v3/index.js +1 -1
  13. package/dist/cjs/carousel-v3/settings/configs/ui-v2.js +1 -1
  14. package/dist/cjs/code/common/helpers.js +1 -0
  15. package/dist/cjs/code/hooks/useCSSCode.js +4 -10
  16. package/dist/cjs/estimate-delivery/common/helpers.js +1 -1
  17. package/dist/cjs/grid/components/row/Row.liquid.js +12 -12
  18. package/dist/cjs/hero-banner/common/classes.js +1 -1
  19. package/dist/cjs/hero-banner/components/HeroBanner.js +1 -1
  20. package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +10 -10
  21. package/dist/cjs/hero-banner/components/HeroBannerItem.js +1 -1
  22. package/dist/cjs/hero-banner/components/HeroBannerItem.liquid.js +9 -9
  23. package/dist/cjs/image/common/attrs.js +1 -1
  24. package/dist/cjs/image/components/AdaptiveImage.js +1 -1
  25. package/dist/cjs/image/components/AdaptiveImage.liquid.js +8 -8
  26. package/dist/cjs/image/components/Image.liquid.js +10 -10
  27. package/dist/cjs/image/components/NextImage.js +1 -1
  28. package/dist/cjs/image/components/NextImage.liquid.js +2 -2
  29. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +10 -10
  30. package/dist/cjs/index.js +1 -1
  31. package/dist/cjs/index.liquid.js +1 -1
  32. package/dist/cjs/post-purchase/link/components/PostPurchaseLink.js +1 -1
  33. package/dist/cjs/post-purchase/link/settings/configs/settings.js +1 -1
  34. package/dist/cjs/post-purchase/link/settings/configs/ui-v2.js +1 -1
  35. package/dist/cjs/post-purchase/product/components/ProductTitle.js +1 -1
  36. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
  37. package/dist/cjs/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
  38. package/dist/cjs/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
  39. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
  40. package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
  41. package/dist/cjs/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
  42. package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
  43. package/dist/cjs/product/components/product-badge/ProductBadge.liquid.js +12 -12
  44. package/dist/cjs/product/components/product-badge/common/classes.js +1 -1
  45. package/dist/cjs/product/components/product-badge/utils/renderBadgeILP.js +1 -1
  46. package/dist/cjs/product/components/product-badge/utils/renderBadgeLiquid.js +7 -5
  47. package/dist/cjs/product/components/product-button/ProductButton.liquid.js +11 -8
  48. package/dist/cjs/product/components/product-button/common/helpers.js +1 -1
  49. package/dist/cjs/product/components/product-button/hooks/useAddToCart.js +1 -1
  50. package/dist/cjs/product/components/product-description/ProductDescription.js +1 -1
  51. package/dist/cjs/product/components/product-description/ProductDescription.liquid.js +2 -3
  52. package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
  53. package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +15 -15
  54. package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
  55. package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
  56. package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
  57. package/dist/cjs/product/components/product-images-v3/ProductImageV3.js +2 -2
  58. package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +15 -15
  59. package/dist/cjs/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
  60. package/dist/cjs/product/components/product-images-v3/common/classes.js +1 -1
  61. package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
  62. package/dist/cjs/product/components/product-images-v3/common/getBorderActiveCss.js +3 -2
  63. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
  64. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageCarousel.js +1 -1
  65. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
  66. package/dist/cjs/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -2
  67. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
  68. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +29 -29
  69. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
  70. package/dist/cjs/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
  71. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
  72. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +8 -8
  73. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
  74. package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
  75. package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
  76. package/dist/cjs/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
  77. package/dist/cjs/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
  78. package/dist/cjs/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
  79. package/dist/cjs/product/components/product-list/ProductList.js +1 -1
  80. package/dist/cjs/product/components/product-list/ProductList.liquid.js +10 -9
  81. package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
  82. package/dist/cjs/product/components/product-list-v3/ProductList.liquid.js +10 -9
  83. package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +6 -6
  84. package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
  85. package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
  86. package/dist/cjs/product/components/product-wrap/Product.liquid.js +12 -9
  87. package/dist/cjs/product/index.js +1 -1
  88. package/dist/cjs/product/settings/product-image-v3/configs/ui-v2.js +1 -1
  89. package/dist/cjs/sticky/hooks/useSticky.js +1 -1
  90. package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
  91. package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
  92. package/dist/cjs/third-party/components/EcomsendBackInStockAlert.js +1 -1
  93. package/dist/cjs/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
  94. package/dist/cjs/third-party/configs/EcomsendBackInStockAlert.js +1 -1
  95. package/dist/cjs/third-party/index.js +1 -1
  96. package/dist/cjs/third-party/next.js +1 -1
  97. package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
  98. package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
  99. package/dist/cjs/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
  100. package/dist/cjs/video/components/HTML5Embed.js +1 -1
  101. package/dist/cjs/video/components/HTML5Embed.liquid.js +12 -12
  102. package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +13 -13
  103. package/dist/cjs/video/components/LiteYouTubeEmbed.js +1 -1
  104. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +11 -11
  105. package/dist/cjs/video/components/Video.liquid.js +1 -1
  106. package/dist/esm/builder.js +1 -1
  107. package/dist/esm/carousel-v3/components/arrow/Arrow.liquid.js +6 -6
  108. package/dist/esm/carousel-v3/components/arrow/common/classes.js +1 -1
  109. package/dist/esm/carousel-v3/components/dot/common/helpers.js +1 -1
  110. package/dist/esm/carousel-v3/components/item/CarouselItem.js +1 -1
  111. package/dist/esm/carousel-v3/components/root/Carousel.js +1 -1
  112. package/dist/esm/carousel-v3/components/root/Carousel.liquid.js +4 -4
  113. package/dist/esm/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
  114. package/dist/esm/carousel-v3/components/root/common/helpers.js +1 -1
  115. package/dist/esm/carousel-v3/components/swiper/Swiper.js +1 -1
  116. package/dist/esm/carousel-v3/hooks/useCarousel.js +1 -1
  117. package/dist/esm/carousel-v3/index.js +1 -1
  118. package/dist/esm/carousel-v3/settings/configs/ui-v2.js +1 -1
  119. package/dist/esm/code/common/helpers.js +1 -0
  120. package/dist/esm/code/hooks/useCSSCode.js +4 -10
  121. package/dist/esm/estimate-delivery/common/helpers.js +1 -1
  122. package/dist/esm/grid/components/row/Row.liquid.js +11 -11
  123. package/dist/esm/hero-banner/common/classes.js +1 -1
  124. package/dist/esm/hero-banner/components/HeroBanner.js +1 -1
  125. package/dist/esm/hero-banner/components/HeroBanner.liquid.js +10 -10
  126. package/dist/esm/hero-banner/components/HeroBannerItem.js +1 -1
  127. package/dist/esm/hero-banner/components/HeroBannerItem.liquid.js +10 -10
  128. package/dist/esm/image/common/attrs.js +1 -1
  129. package/dist/esm/image/components/AdaptiveImage.js +1 -1
  130. package/dist/esm/image/components/AdaptiveImage.liquid.js +11 -11
  131. package/dist/esm/image/components/Image.liquid.js +10 -10
  132. package/dist/esm/image/components/NextImage.js +1 -1
  133. package/dist/esm/image/components/NextImage.liquid.js +1 -1
  134. package/dist/esm/image-comparison/components/CompareImage.liquid.js +12 -12
  135. package/dist/esm/index.js +1 -1
  136. package/dist/esm/index.liquid.js +1 -1
  137. package/dist/esm/post-purchase/link/components/PostPurchaseLink.js +1 -1
  138. package/dist/esm/post-purchase/link/settings/configs/settings.js +1 -1
  139. package/dist/esm/post-purchase/link/settings/configs/ui-v2.js +1 -1
  140. package/dist/esm/post-purchase/product/components/ProductTitle.js +1 -1
  141. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
  142. package/dist/esm/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
  143. package/dist/esm/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
  144. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
  145. package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
  146. package/dist/esm/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
  147. package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
  148. package/dist/esm/product/components/product-badge/ProductBadge.liquid.js +12 -12
  149. package/dist/esm/product/components/product-badge/common/classes.js +1 -1
  150. package/dist/esm/product/components/product-badge/utils/renderBadgeILP.js +1 -1
  151. package/dist/esm/product/components/product-badge/utils/renderBadgeLiquid.js +5 -3
  152. package/dist/esm/product/components/product-button/ProductButton.liquid.js +11 -8
  153. package/dist/esm/product/components/product-button/common/helpers.js +1 -1
  154. package/dist/esm/product/components/product-button/hooks/useAddToCart.js +1 -1
  155. package/dist/esm/product/components/product-description/ProductDescription.js +1 -1
  156. package/dist/esm/product/components/product-description/ProductDescription.liquid.js +3 -4
  157. package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
  158. package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +15 -15
  159. package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
  160. package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
  161. package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
  162. package/dist/esm/product/components/product-images-v3/ProductImageV3.js +2 -2
  163. package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +15 -15
  164. package/dist/esm/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
  165. package/dist/esm/product/components/product-images-v3/common/classes.js +1 -1
  166. package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
  167. package/dist/esm/product/components/product-images-v3/common/getBorderActiveCss.js +1 -0
  168. package/dist/esm/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
  169. package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageCarousel.js +1 -1
  170. package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
  171. package/dist/esm/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -2
  172. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
  173. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +45 -45
  174. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
  175. package/dist/esm/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
  176. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
  177. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +14 -14
  178. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
  179. package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
  180. package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
  181. package/dist/esm/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
  182. package/dist/esm/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
  183. package/dist/esm/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
  184. package/dist/esm/product/components/product-list/ProductList.js +1 -1
  185. package/dist/esm/product/components/product-list/ProductList.liquid.js +18 -17
  186. package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
  187. package/dist/esm/product/components/product-list-v3/ProductList.liquid.js +18 -17
  188. package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +9 -9
  189. package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
  190. package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
  191. package/dist/esm/product/components/product-wrap/Product.liquid.js +16 -13
  192. package/dist/esm/product/index.js +1 -1
  193. package/dist/esm/product/settings/product-image-v3/configs/ui-v2.js +1 -1
  194. package/dist/esm/sticky/hooks/useSticky.js +1 -1
  195. package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
  196. package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
  197. package/dist/esm/third-party/components/EcomsendBackInStockAlert.js +1 -1
  198. package/dist/esm/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
  199. package/dist/esm/third-party/configs/EcomsendBackInStockAlert.js +1 -1
  200. package/dist/esm/third-party/index.js +1 -1
  201. package/dist/esm/third-party/next.js +1 -1
  202. package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
  203. package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
  204. package/dist/esm/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
  205. package/dist/esm/video/components/HTML5Embed.js +1 -1
  206. package/dist/esm/video/components/HTML5Embed.liquid.js +12 -12
  207. package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +14 -14
  208. package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
  209. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +10 -10
  210. package/dist/esm/video/components/Video.liquid.js +1 -1
  211. package/dist/types/index.d.ts +44 -14
  212. package/package.json +5 -5
@@ -1 +1 @@
1
- import{useFeaturedImageGlobal as e,useCurrentDevice as t,useInteraction as r,useEditorMode as i,getResponsiveValueByScreen as o}from"@gem-sdk/core";import{createRef as n,useMemo as a,useCallback as l,useEffect as m}from"react";import{getAspectRatio as c}from"../common/common.js";import{checkRenderFeaturedCarousel as u}from"../common/productFeaturedImage.js";import{useFilterImagesByVariant as d}from"./useFilterImagesByVariant.js";import{handleSetSrcForFeatureProductImage as h}from"../../../../image/common/helpers.js";let p=p=>{let g;let{productImages:s,imgRef:f,onHandleClick:y,onClickArrow:S,onHandleLoaded:v,onHandleUpdateActiveIndex:I,builderPropUID:q,builderPropsClass:k,children:b,parentUid:x,...w}=p,T=e(),$=t(),B=n(),{onListener:j,ref:F}=r(),P=i(),{filteredProductImages:C}=d({productImages:s,displayByVariant:w?.displayByVariant,variantSelect:w?.variantSelect}),E=a(()=>{let e=C?.findIndex(e=>e.id===T?.id);return e&&e>=0?e:0},[C,T]),O=a(()=>u(w),[w]),R=a(()=>{if(C?.length)return T||C?.[0]},[C,T]),V=a(()=>"popup"===o(w.ftClickOpenLightBox,$),[w.ftClickOpenLightBox,$]),A=a(()=>w?.otherImage?C&&w.otherImage>=C.length-1||C&&-1===w.otherImage?C.length-1:w.otherImage:0,[w?.otherImage,C]),L=a(()=>w?.hoverEffect==="other"?C?.[A]:C?.find(e=>e.id===T?.id)||C?.[0],[T?.id,A,C,w?.hoverEffect]),z=e=>{let t="1/1",r=0;return e?e.width&&e.height&&(t=`${e.width}/${e.height}`):C?.forEach(e=>{if(e.width&&e.height){let i=e.height/e.width;i>r&&(r=i,t=`${e.width}/${e.height}`)}}),t},K=l(()=>{h({builderPropUID:q,ftShape:w.ftShape,qualityType:w.qualityType,qualityPercent:w.qualityPercent})},[w.ftShape,w.qualityPercent,w.qualityType,q]),M=()=>{let e=`[data-id="${q}"]`;j({event:"gp:change-image-step",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.moveToSlideInteraction({element:r,data:i,isRollback:o,key:n})}),j({event:"gp:change-next-slide",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.nextSlideInteraction({element:r,data:i,isRollback:o,key:n})}),j({event:"gp:change-previous-slide",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.previousSlideInteraction({element:r,data:i,isRollback:o,key:n})})};return m(()=>{if("edit"===P)return;let e=document?.querySelector(`.gem-slider-item-${q} .featured-image-only`);if(!e)return;K();let t=new ResizeObserver(()=>{K()});return t?.observe(e,{}),()=>{t?.disconnect()}},[K,q,P]),m(()=>{M()},[]),m(()=>{!O&&v&&v(!0,0)},[O,v]),{ref:F,imageActive:R,imageActiveIndex:E,imageShowWhenHover:L,enableOpenLightBox:V,filteredProductImages:C,isRenderFeatureCarousel:O,genRandomKey:function(){return Math.random().toString(36).substr(2,5)},getAspectRatioFinal:e=>{let t=c(w.ftShape),r=z(e);return{desktop:t.desktop??r,tablet:t.tablet??r,mobile:t.mobile??r}},emitUpdateActiveIndex:e=>{g&&clearTimeout(g),g=setTimeout(()=>I&&I(e),500)}}};export{p as useProductFeaturedImageCarousel};
1
+ import{useFeaturedImageGlobal as e,useCurrentDevice as t,useInteraction as r,useEditorMode as i,getResponsiveValueByScreen as o}from"@gem-sdk/core";import{createRef as n,useMemo as a,useCallback as l,useEffect as m}from"react";import{getAspectRatio as c}from"../common/common.js";import{checkRenderFeaturedCarousel as u}from"../common/productFeaturedImage.js";import{useFilterImagesByVariant as d}from"./useFilterImagesByVariant.js";import{handleSetSrcForFeatureProductImage as h}from"../../../../image/common/helpers.js";let p=p=>{let g;let{productImages:s,imgRef:f,onHandleClick:y,onClickArrow:S,onHandleLoaded:v,onHandleUpdateActiveIndex:I,builderPropUID:q,builderPropsClass:k,children:b,parentUid:x,...w}=p,T=e(),$=t(),B=n(),{onListener:j,ref:F}=r(),P=i(),{filteredProductImages:C}=d({productImages:s,displayByVariant:w?.displayByVariant,variantSelect:w?.variantSelect}),E=a(()=>{let e=C?.findIndex(e=>e.id===T?.id);return e&&e>=0?e:0},[C,T]),O=a(()=>u(w),[w]),R=a(()=>{if(C?.length)return T||C?.[0]},[C,T]),V=a(()=>"popup"===o(w.ftClickOpenLightBox,$),[w.ftClickOpenLightBox,$]),A=a(()=>w?.otherImage?C&&w.otherImage>=C.length-1||C&&-1===w.otherImage?C.length-1:w.otherImage:0,[w?.otherImage,C]),L=a(()=>w?.hoverEffect==="other"?C?.[A]:C?.find(e=>e.id===T?.id)||C?.[0],[T?.id,A,C,w?.hoverEffect]),z=e=>{let t="1/1",r=0;return e?e.width&&e.height&&(t=`${e.width}/${e.height}`):C?.forEach(e=>{if(e.width&&e.height){let i=e.height/e.width;i>r&&(r=i,t=`${e.width}/${e.height}`)}}),t},K=l(()=>{h({builderPropUID:q,ftShape:w.ftShape,qualityType:w.qualityType,qualityPercent:w.qualityPercent})},[w.ftShape,w.qualityPercent,w.qualityType,q]),M=()=>{let e=`[data-id="${q}"]`;j({event:"gp:change-image-step",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.moveToSlideInteraction({element:r,data:i,isRollback:o,key:n})}),j({event:"gp:change-next-slide",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.nextSlideInteraction({element:r,data:i,isRollback:o,key:n})}),j({event:"gp:change-previous-slide",selector:e},t=>{let r=(F.current||document).querySelector(e),{data:i,isRollback:o,uniqueStorageKey:n}=t||{};B?.current?.previousSlideInteraction({element:r,data:i,isRollback:o,key:n})})};return m(()=>{if("edit"===P)return;let e=document?.querySelector(`.gem-slider-item-${q} .featured-image-only`);if(!e)return;K();let t=new ResizeObserver(()=>{K()});return t?.observe(e,{}),()=>{t?.disconnect()}},[K,q,P]),m(()=>{M()},[]),m(()=>{!O&&v&&v(!0,0)},[O,v]),{ref:F,imageActive:R,imageActiveIndex:E,imageShowWhenHover:L,enableOpenLightBox:V,filteredProductImages:C,isRenderFeatureCarousel:O,genRandomKey:function(){return Math.random().toString(36).substr(2,5)},getAspectRatioFinal:e=>{let t=c(w.ftShape),r=z(e);return{desktop:t.desktop||r,tablet:t.tablet||r,mobile:t.mobile||r}},emitUpdateActiveIndex:e=>{g&&clearTimeout(g),g=setTimeout(()=>I&&I(e),500)}}};export{p as useProductFeaturedImageCarousel};
@@ -1 +1 @@
1
- import{useCurrentDevice as e,useFeaturedImageGlobal as r,useEditorMode as o,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{useState as i,useCallback as a,useEffect as s}from"react";import{getShapeByLayout as l,checkDisplayGalleryByWidth as n}from"../common/productGallery.js";import{useFilterImagesByVariant as p}from"./useFilterImagesByVariant.js";import{handleSetSrcForProductImageList as m}from"../../../../image/common/helpers.js";let d=d=>{let{builderPropUID:y,productImages:c,activeIndexFromFeatureImage:h,children:u,isHiddenInteraction:F,...f}=d,B=e(),q=r(),[g,I]=i(0),v=o(),{filteredProductImages:b}=p({productImages:c,displayByVariant:f?.displayByVariant,variantSelect:f?.variantSelect}),C=l({shape:f.shape,shapeForBottom:f.shapeForBottom,shapeFor1Col:f.shapeFor1Col,shapeFor2Col:f.shapeFor2Col,shapeForFtOnly:f.shapeForFtOnly,shapeForInsideBottom:f.shapeForInsideBottom,shapeForInside:f.shapeForInside},f.position),O=t(f.clickOpenLightBox,B),P=n({shapeByLayout:C}),j=t(P,B),x=f?.borderActive?.border!=="none",G=a(()=>{m({builderPropUID:y,shapeByLayout:C,qualityType:f.qualityType,qualityPercent:f.qualityPercent})},[C,f.qualityPercent,f.qualityType,y]);return s(()=>{I(h||0)},[h]),s(()=>{let e=b?.findIndex(e=>e.id===q?.id);I(e&&e>0?e:0)},[q,b]),s(()=>{if("edit"===v)return;let e=document?.querySelector(".grid-gallery");if(!e)return;G();let r=new ResizeObserver(()=>{G()});return r?.observe(e,{}),()=>{r?.disconnect()}},[G,y,v]),{isDisplay:j,shapeByLayout:C,imageActiveIndex:g,enableOpenLightBox:O,isEnableBorderActive:x,filteredProductImages:b}};export{d as useProductGalleryGrid};
1
+ import{useCurrentDevice as e,useFeaturedImageGlobal as r,useEditorMode as o,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{useState as i,useCallback as a,useEffect as s}from"react";import{getShapeByLayout as l,checkDisplayGalleryByWidth as n}from"../common/productGallery.js";import{useFilterImagesByVariant as p}from"./useFilterImagesByVariant.js";import{handleSetSrcForProductImageList as m}from"../../../../image/common/helpers.js";let d=d=>{let{builderPropUID:y,productImages:c,activeIndexFromFeatureImage:h,children:u,isHiddenInteraction:F,...f}=d,B=e(),q=r(),[g,v]=i(0),I=o(),{filteredProductImages:b}=p({productImages:c,displayByVariant:f?.displayByVariant,variantSelect:f?.variantSelect}),C=l({shape:f.shape,shapeForBottom:f.shapeForBottom,shapeFor1Col:f.shapeFor1Col,shapeFor2Col:f.shapeFor2Col,shapeForFtOnly:f.shapeForFtOnly,shapeForInsideBottom:f.shapeForInsideBottom,shapeForInside:f.shapeForInside},f.position),O=t(f.clickOpenLightBox,B),P=n({shapeByLayout:C}),j=t(P,B),x=f?.borderActive?.border!=="none",G=a(()=>{m({builderPropUID:y,shapeByLayout:C,qualityType:f.qualityType,qualityPercent:f.qualityPercent})},[C,f.qualityPercent,f.qualityType,y]);return s(()=>{void 0!==h&&v(h)},[h]),s(()=>{let e=b?.findIndex(e=>e.id===q?.id);v(e&&e>0?e:0)},[q,b]),s(()=>{if("edit"===I)return;let e=document?.querySelector(".grid-gallery");if(!e)return;G();let r=new ResizeObserver(()=>{G()});return r?.observe(e,{}),()=>{r?.disconnect()}},[G,y,I]),{isDisplay:j,shapeByLayout:C,imageActiveIndex:g,enableOpenLightBox:O,isEnableBorderActive:x,filteredProductImages:b}};export{d as useProductGalleryGrid};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as a,useMemo as l,useEffect as i}from"react";import{useRenderMode as c,useCurrentDevice as s,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as f,useProductsQuery as P,useCollectionQuery as b,flattenConnection as k,ProductListProvider as T,filterToolbarPreview as I}from"@gem-sdk/core";import v from"../SalePageProductListWarning.js";import y from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as S}from"./common/styles.js";import{If as C}from"@gem-sdk/system";import{getClass as E}from"./common/classes.js";import{getData as N}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let W=o(()=>import("../ProductNotFound.js"),{loading:d}),j=o=>{let{children:j,styles:x,builderProps:G,setting:M,builderAttrs:B}=o,{isRelatedProduct:A,productSetting:Q}=N(o),z=Q.relatedTag&&Q.relatedTag[0],{isEditMode:D,isPreviewSharePageMode:F}=c(),H=s(),R=n(),$=u(e=>e.dynamicProduct),_=u(e=>e.dynamicCollection),[V,q]=a(1),[U,J]=a(!0),[K,X]=a(),[Y,Z]=a(!1),ee="GP_FUNNEL_PAGE"===R;"GP_COLLECTION"==R&&(Q.productSrc="DynamicCollection",Q.collectionId=_?.collectionId??"latest");let et=Q?.productSrc??"Collection",er=$?.productId&&$?.productId!==Q.relatedProductId?$?.productId:Q.relatedProductId,eo=m(),ed=u(e=>e.publicStoreFrontData),ea=l(()=>g(ed)?h(ed):eo,[ed]),{data:el}=p(A&&er?er:void 0,{revalidateOnMount:D||F},ea),ei=Q.relatedTag&&"tags"===Q.relatedTag[0]&&(!el?.tags||el?.tags.length===0),ec=Q.relatedTag&&"collection"===Q.relatedTag[0]&&(!el?.collections?.edges||el?.collections.edges.length===0),es=Q.relatedTag&&"vendor"===Q.relatedTag[0]&&!el?.vendor,en=f(K,{revalidateOnMount:D||F},ea),eu=D||F,em=P("PickProduct"===et?Q?.productIds:void 0,{revalidateOnMount:eu},{defaultSelectedProductCount:Q?.numOfSelectedProducts}),eg=l(()=>({id:Q?.collectionId??"latest",numberOfProducts:M?.numberOfProducts??4,orderBy:M?.orderBy}),[Q?.collectionId,Number(M?.numberOfProducts),M?.orderBy]),eh=b("PickProduct"!==et?eg:void 0,{revalidateOnMount:eu});i(()=>{if(A&&el&&Q.relatedTag&&"recommended-product"!==Q.relatedType){let e;switch(Z(!1),Q.hasRelatedExclude&&(e=Q?.relatedExclude&&Q.relatedExclude.split(",").map(e=>e.trim())),Q.relatedTag[0]){case"vendor":X({first:M?.numberOfProducts,where:{vendor:Q.relatedTag&&"vendor"===Q.relatedTag[0]?el?.vendor:"",idNEQ:el.id}});break;case"collection":{let t=el?.collections?.edges.map(e=>e.node?.id);if(!t||t?.length===0){Z(!0);break}X(e&&e.length>0?{first:M?.numberOfProducts,where:{idNEQ:el.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}}:{first:M?.numberOfProducts,where:{idNEQ:el.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t}]}]}});break}case"tags":if(!el.tags||0===el.tags.length){Z(!0);break}X(e&&e.length>0?{first:M?.numberOfProducts,where:{idNEQ:el.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:el.tags},{nameNotIn:e}]}]}}:{first:M?.numberOfProducts,where:{idNEQ:el.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:el.tags}]}]}})}}},[el,Q.relatedType,Q.relatedTag,M?.numberOfProducts,Q.relatedExclude,Q.hasRelatedExclude,A]);let ep="PickProduct"===et?em.isValidating:eh.isValidating,ef="PickProduct"===et?em.isLoading:eh.isLoading,eP="PickProduct"===et?em.error:eh.error,eb=eh.data?.collections?.edges?.[0]?.node,ek="PickProduct"===et?k(em.data?.products):k(eb?.products),eT=en?.data?.products?k(en?.data?.products):void 0,eI=A&&eT?eT:"PickProduct"===et&&Q?.productIds?.length?Q?.productIds?.map(e=>ek?.find(t=>t?.baseID===e)).filter(Boolean)??ek:"PickProduct"!==et?ek:ek.filter((e,t)=>t<(Q?.numOfSelectedProducts??4)),ev=l(()=>Y&&A&&D||!eI.length&&!ef&&U&&D,[U,ef,Y,A,D,eI.length]),ey=l(()=>!eI||Y&&A,[Y,A,eI]),eO=l(()=>{if(!M?.sameHeight)return[];let e=0,t=Math.ceil((eI?.length??0)/+(M?.slidesToShow?.[H]??1));return Array.from(Array(eI?.length??0)).map((r,o)=>(o>=+(M?.slidesToShow?.[H]??1)*(e+1)&&++e,{gridRow:`${1+V*e}/${V+1+V*e}`,marginBottom:e+1<t?L(x?.horizontalGutter,H):void 0}))},[M?.sameHeight,M?.slidesToShow,V,eI?.length,H,x?.horizontalGutter]),ew=l(()=>ep||ef||eP||!eI||Y&&A,[eP,ef,Y,A,ep,eI]);i(()=>{ew||setTimeout(()=>{let{builderData:e}=G??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&q(r.childElementCount||1)},D?0:500)},[G,ew,D]);let eS=l(()=>({collection:eb,products:eI,settings:{loop:M?.loop??{desktop:!1},scrollMode:M?.scrollMode??{desktop:"snap"},slidesToShow:M?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:x?.layout,dot:M?.dot,dotStyle:M?.dotStyle,arrow:M?.arrow,controlOverContent:M?.controlOverContent},styles:{horizontalGutter:x?.horizontalGutter,verticalGutter:x?.verticalGutter,fullWidth:x?.fullWidth,spacing:x?.spacing,width:x?.width,height:x?.height}}),[eb,eI,M,x]);if(G?.isPreview&&ee)return e(t,{});if(ev)return e(t,{children:C(U,e(W,{builderAttrs:B,collectionHandle:eb?.handle,productSrc:et,onClose:()=>J(!1),children:j,relatedTagString:z,assignProductNoTags:ei||ec||es,noAssignedProduct:!er}))});let{productListWrapStyle:eC,productListContentStyle:eE,productListWrapAlignStyle:eN}=S(o),{productListWrapClass:eL}=E(o);return r("div",{...B,className:eL,style:eC,children:[!!x?.preloadBgImage&&r(y,{children:[!!x.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage.desktop.image.src,as:"image"}),!!x.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.tablet?.image?.src,as:"image"}),!!x.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.mobile?.image?.src,as:"image"})]}),ep||ef?e(d,{}):eP?r("div",{children:["Error: ",eP?.message]}):ey?e("div",{children:"Products not found"}):e(T,{...eS,children:e("div",{className:"gp-flex gp-w-full",style:eN,children:r("div",{style:eE,children:[ee&&e(v,{}),e(t,{children:C(x?.layout==="grid",e(O,{...o,productSortedById:eI,generateGridRowArray:eO}),e(w,{...o,productSortedById:eI}))})]})})}),I(j,!0)]})};export{j as default};
1
+ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as a,useMemo as l,useEffect as i}from"react";import{useRenderMode as c,useCurrentDevice as s,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as f,useProductsQuery as P,useCollectionQuery as b,flattenConnection as k,ProductListProvider as T,filterToolbarPreview as I}from"@gem-sdk/core";import v from"../SalePageProductListWarning.js";import y from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as S}from"./common/styles.js";import{If as C}from"@gem-sdk/system";import{getClass as E}from"./common/classes.js";import{getData as N}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let W=o(()=>import("../ProductNotFound.js"),{loading:d}),j=o=>{let{children:j,styles:x,builderProps:G,setting:M,builderAttrs:B}=o,{isRelatedProduct:A,productSetting:H}=N(o),Q=H.relatedTag&&H.relatedTag[0],{isEditMode:z,isPreviewSharePageMode:D}=c(),F=s(),R=n(),$=u(e=>e.dynamicProduct),_=u(e=>e.dynamicCollection),[V,q]=a(1),[U,J]=a(!0),[K,X]=a(),[Y,Z]=a(!1),ee="GP_FUNNEL_PAGE"===R;"GP_COLLECTION"==R&&(H.productSrc="DynamicCollection",H.collectionId=_?.collectionId??"latest");let et=H?.productSrc??"Collection",er=$?.productId&&$?.productId!==H.relatedProductId?$?.productId:H.relatedProductId,eo=m(),ed=u(e=>e.publicStoreFrontData),ea=l(()=>g(ed)?h(ed):eo,[ed]),{data:el}=p(A&&er?er:void 0,{revalidateOnMount:z||D},ea),ei=H.relatedTag&&"tags"===H.relatedTag[0]&&(!el?.tags||el?.tags.length===0),ec=H.relatedTag&&"collection"===H.relatedTag[0]&&(!el?.collections?.edges||el?.collections.edges.length===0),es=H.relatedTag&&"vendor"===H.relatedTag[0]&&!el?.vendor,en=f(K,{revalidateOnMount:z||D},ea),eu=z||D,em=P("PickProduct"===et?H?.productIds:void 0,{revalidateOnMount:eu},{defaultSelectedProductCount:H?.numOfSelectedProducts}),eg=l(()=>({id:H?.collectionId??"latest",numberOfProducts:M?.numberOfProducts??4,orderBy:M?.orderBy}),[H?.collectionId,Number(M?.numberOfProducts),M?.orderBy]),eh=b("PickProduct"!==et?eg:void 0,{revalidateOnMount:eu});i(()=>{if(A&&el&&H.relatedTag&&"recommended-product"!==H.relatedType){let e;switch(Z(!1),H.hasRelatedExclude&&(e=H?.relatedExclude&&H.relatedExclude.split(",").map(e=>e.trim())),H.relatedTag[0]){case"vendor":X({first:M?.numberOfProducts,where:{vendor:H.relatedTag&&"vendor"===H.relatedTag[0]?el?.vendor:"",idNEQ:el.id}});break;case"collection":{let t=el?.collections?.edges.map(e=>e.node?.id);if(!t||t?.length===0){Z(!0);break}X(e&&e.length>0?{first:M?.numberOfProducts,where:{idNEQ:el.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}}:{first:M?.numberOfProducts,where:{idNEQ:el.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t}]}]}});break}case"tags":if(!el.tags||0===el.tags.length){Z(!0);break}X(e&&e.length>0?{first:M?.numberOfProducts,where:{idNEQ:el.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:el.tags},{nameNotIn:e}]}]}}:{first:M?.numberOfProducts,where:{idNEQ:el.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:el.tags}]}]}})}}},[el,H.relatedType,H.relatedTag,M?.numberOfProducts,H.relatedExclude,H.hasRelatedExclude,A]);let ep="PickProduct"===et?em.isValidating:eh.isValidating,ef="PickProduct"===et?em.isLoading:eh.isLoading,eP="PickProduct"===et?em.error:eh.error,eb=eh.data?.collections?.edges?.[0]?.node,ek="PickProduct"===et?k(em.data?.products):k(eb?.products),eT=en?.data?.products?k(en?.data?.products):void 0,eI=A&&eT?eT:"PickProduct"===et&&H?.productIds?.length?H?.productIds?.map(e=>ek?.find(t=>t?.baseID===e)).filter(Boolean)??ek:"PickProduct"!==et?ek:ek.filter((e,t)=>t<(H?.numOfSelectedProducts??4)),ev=l(()=>Y&&A&&z||!eI.length&&!ef&&U&&z,[U,ef,Y,A,z,eI.length]),ey=l(()=>!eI||Y&&A,[Y,A,eI]),eO=l(()=>{if(!M?.sameHeight)return[];let e=0,t=Math.ceil((eI?.length??0)/+(M?.slidesToShow?.[F]??1));return Array.from(Array(eI?.length??0)).map((r,o)=>(o>=+(M?.slidesToShow?.[F]??1)*(e+1)&&++e,{gridRow:`${1+V*e}/${V+1+V*e}`,marginBottom:e+1<t?L(x?.horizontalGutter,F):void 0}))},[M?.sameHeight,M?.slidesToShow,V,eI?.length,F,x?.horizontalGutter]),ew=l(()=>ep||ef||eP||!eI||Y&&A,[eP,ef,Y,A,ep,eI]);i(()=>{ew||setTimeout(()=>{let{builderData:e}=G??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&q(r.childElementCount||1)},z?0:500)},[G,ew,z]);let eS=l(()=>({collection:eb,products:eI,settings:{loop:M?.loop??{desktop:!1},scrollMode:M?.scrollMode??{desktop:"snap"},slidesToShow:M?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:x?.layout,dot:M?.dot,dotStyle:M?.dotStyle,arrow:M?.arrow,controlOverContent:M?.controlOverContent,sameHeight:M?.sameHeight},styles:{horizontalGutter:x?.horizontalGutter,verticalGutter:x?.verticalGutter,fullWidth:x?.fullWidth,spacing:x?.spacing,width:x?.width,height:x?.height}}),[eb,eI,M,x]);if(G?.isPreview&&ee)return e(t,{});if(ev)return e(t,{children:C(U,e(W,{builderAttrs:B,collectionHandle:eb?.handle,productSrc:et,onClose:()=>J(!1),children:j,relatedTagString:Q,assignProductNoTags:ei||ec||es,noAssignedProduct:!er}))});let{productListWrapStyle:eC,productListContentStyle:eE,productListWrapAlignStyle:eN}=S(o),{productListWrapClass:eL}=E(o);return r("div",{...B,className:eL,style:eC,children:[!!x?.preloadBgImage&&r(y,{children:[!!x.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage.desktop.image.src,as:"image"}),!!x.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.tablet?.image?.src,as:"image"}),!!x.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.mobile?.image?.src,as:"image"})]}),ep||ef?e(d,{}):eP?r("div",{children:["Error: ",eP?.message]}):ey?e("div",{children:"Products not found"}):e(T,{...eS,children:e("div",{className:"gp-flex gp-w-full",style:eN,children:r("div",{style:eE,children:[ee&&e(v,{}),e(t,{children:C(x?.layout==="grid",e(O,{...o,productSortedById:eI,generateGridRowArray:eO}),e(w,{...o,productSortedById:eI}))})]})})}),I(j,!0)]})};export{j as default};
@@ -1,6 +1,6 @@
1
- import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let g=g=>{let{setting:p,styles:f,pageContext:m}=g,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:x,sortedBy:S,isReverse:b,productSrc:A,productNumber:L,isSorted:R,relatedTag:I,collectionHandle:F}=u(g),j=()=>i`
2
- ${e("RelatedProduct"===A,`
3
- assign relatedTag = '${I}'
1
+ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as g}from"./common/helpers.js";let u=u=>{let{setting:p,styles:f,pageContext:m}=u,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:S,sortedBy:x,isReverse:b,productSrc:L,productNumber:A,isSorted:R,relatedTag:H,collectionHandle:I}=g(u),F=()=>i`
2
+ ${e("RelatedProduct"===L,`
3
+ assign relatedTag = '${H}'
4
4
  assign assignProduct = product
5
5
  assign idAssignProduct = assignProduct.id
6
6
  paginate collections.all.products by 10000
@@ -95,7 +95,7 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
95
95
  assign products = products
96
96
  endpaginate
97
97
  `)}
98
- `,{productListWrapStyle:w,productListContentStyle:H,productListWrapAlignStyle:q}=c(g),{productListWrapClass:G}=l(g);return i`
98
+ `,{productListWrapStyle:j,productListContentStyle:w,productListWrapAlignStyle:q}=c(u),{productListWrapClass:G}=l(u);return i`
99
99
  ${e(s,`
100
100
  <script ${d('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>
101
101
  ${p?.sameHeight?`<script ${d('class="gps-link" delay',"src")}="{{ 'gp-same-height-v7-5.js' | asset_url }}" defer="defer"></script>`:""}
@@ -107,16 +107,16 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
107
107
  ${e(!!f?.preloadBgImage,`${e(!!f?.backgroundImage?.desktop?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.desktop?.image?.src}" as="image" />`)}${e(!!f?.backgroundImage?.tablet?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.tablet?.image?.src}" as="image" />`)}${e(!!f?.backgroundImage?.mobile?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.mobile?.image?.src}" as="image" />`)}`)}
108
108
  <div
109
109
  class="${G}"
110
- style="${w}"
110
+ style="${j}"
111
111
  >
112
112
  <div class='gp-flex gp-w-full' style="${q}">
113
113
  <div
114
- style="${H}"
114
+ style="${w}"
115
115
  >
116
116
  {%- assign gpBkProduct = product -%}
117
117
  {%- assign gpBkProducts = products -%}
118
- ${(()=>{let e=F?`
119
- assign target_collection = collections['${F}']
118
+ ${(()=>{let e=I?`
119
+ assign target_collection = collections['${I}']
120
120
  if target_collection == empty
121
121
  for collection in collections
122
122
  if collection.id == ${_}
@@ -134,12 +134,13 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
134
134
  endfor
135
135
  `;return i`
136
136
  {%- liquid
137
- assign productHandles = '${x.toString()}'| split: ','
137
+ assign productHandles = '${S.toString()}'| split: ','
138
138
  assign products = null
139
139
  assign target_collection = null
140
- assign productSrc = '${A}'
140
+ assign productSrc = '${L}'
141
141
  assign c = 0
142
- assign limit = ${L??4}
142
+ assign limit = ${A??4}
143
+ assign isSettingSameHeightProductList = ${p?.sameHeight??!1}
143
144
 
144
145
  if request.page_type == 'collection' or preview_page_type == 'collection'
145
146
  assign target_collection = collection
@@ -151,11 +152,11 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
151
152
  endif
152
153
  endif
153
154
  paginate target_collection.products by ${E||4}
154
- assign products = target_collection.products ${R?S:""} ${b?"| reverse":""}
155
+ assign products = target_collection.products ${R?x:""} ${b?"| reverse":""}
155
156
  endpaginate
156
157
  else
157
158
  if productSrc == 'RelatedProduct'
158
- ${j()}
159
+ ${F()}
159
160
  elsif productSrc == 'PickProduct'
160
161
  unless ${y}
161
162
  assign products = null | sort
@@ -178,7 +179,7 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
178
179
  ${e}
179
180
  endif
180
181
  paginate target_collection.products by ${E||4}
181
- assign products = target_collection.products ${R?S:""} ${b?"| reverse":""}
182
+ assign products = target_collection.products ${R?x:""} ${b?"| reverse":""}
182
183
  endpaginate
183
184
  endif
184
185
  endif
@@ -187,14 +188,14 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
187
188
  ${i`
188
189
  {%- if products == null -%}
189
190
  {%- if count == 0 and ${k.length} == 0 -%}
190
- {% if '${A}' == 'RelatedProduct' -%}
191
+ {% if '${L}' == 'RelatedProduct' -%}
191
192
  <div>${o("ProductList","no_related_products")}</div>
192
193
  {% else %}
193
194
  <div>${o("ProductList","no_products_found")}</div>
194
195
  {%- endif -%}
195
196
  {%- endif -%}
196
197
  {%-else-%}
197
- ${r(v,i`${n({...g,productListId:k,productSrc:A})}`,i`${a({...g,productListId:k,productSrc:A})}`)}
198
+ ${r(v,i`${n({...u,productListId:k,productSrc:L})}`,i`${a({...u,productListId:k,productSrc:L})}`)}
198
199
  {%- endif -%}
199
200
  `}
200
201
  {%- assign product = gpBkProduct -%}
@@ -202,4 +203,4 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
202
203
  </div>
203
204
  </div>
204
205
  </div>
205
- `};export{g as default};
206
+ `};export{u as default};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as l,useMemo as a,useEffect as i}from"react";import{useRenderMode as c,useCurrentDevice as s,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as f,useProductsQuery as P,useCollectionQuery as b,flattenConnection as k,ProductListProvider as I,filterToolbarPreview as T}from"@gem-sdk/core";import y from"../SalePageProductListWarning.js";import v from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as S}from"./common/styles.js";import{If as C}from"@gem-sdk/system";import{getClass as E}from"./common/classes.js";import{getData as N}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let W=o(()=>import("../ProductNotFound.js"),{loading:d}),j=o=>{let{children:j,styles:x,builderProps:G,setting:A,builderAttrs:M}=o,{isRelatedProduct:B,productSetting:Q}=N(o),z=Q.relatedTag&&Q.relatedTag[0],{isEditMode:D,isPreviewSharePageMode:F}=c(),H=s(),R=n(),$=u(e=>e.dynamicProduct),_=u(e=>e.dynamicCollection),[V,q]=l(1),[U,J]=l(!0),[K,X]=l(),[Y,Z]=l(!1),ee="GP_FUNNEL_PAGE"===R;"GP_COLLECTION"==R&&(Q.productSrc="DynamicCollection",Q.collectionId=_?.collectionId??"latest");let et=Q?.productSrc??"Collection",er=$?.productId&&$?.productId!==Q.relatedProductId?$?.productId:Q.relatedProductId,eo=m(),ed=u(e=>e.publicStoreFrontData),el=a(()=>g(ed)?h(ed):eo,[ed]),{data:ea}=p(B&&er?er:void 0,{revalidateOnMount:D||F},el),ei=Q.relatedTag&&"tags"===Q.relatedTag[0]&&(!ea?.tags||ea?.tags.length===0),ec=Q.relatedTag&&"collection"===Q.relatedTag[0]&&(!ea?.collections?.edges||ea?.collections.edges.length===0),es=Q.relatedTag&&"vendor"===Q.relatedTag[0]&&!ea?.vendor,en=f(K,{revalidateOnMount:D||F},el),eu=D||F,em=P("PickProduct"===et?Q?.productIds:void 0,{revalidateOnMount:eu},{defaultSelectedProductCount:Q?.numOfSelectedProducts}),eg=a(()=>({id:Q?.collectionId??"latest",numberOfProducts:A?.numberOfProducts??4,orderBy:A?.orderBy}),[Q?.collectionId,Number(A?.numberOfProducts),A?.orderBy]),eh=b("PickProduct"!==et?eg:void 0,{revalidateOnMount:eu});i(()=>{if(B&&ea&&Q.relatedTag&&"recommended-product"!==Q.relatedType){let e;switch(Z(!1),Q.hasRelatedExclude&&(e=Q?.relatedExclude&&Q.relatedExclude.split(",").map(e=>e.trim())),Q.relatedTag[0]){case"vendor":X({first:A?.numberOfProducts,where:{vendor:Q.relatedTag&&"vendor"===Q.relatedTag[0]?ea?.vendor:"",idNEQ:ea.id}});break;case"collection":{let t=ea?.collections?.edges.map(e=>e.node?.id);if(!t||t?.length===0){Z(!0);break}X(e&&e.length>0?{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}}:{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t}]}]}});break}case"tags":if(!ea.tags||0===ea.tags.length){Z(!0);break}X(e&&e.length>0?{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags},{nameNotIn:e}]}]}}:{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags}]}]}})}}},[ea,Q.relatedType,Q.relatedTag,A?.numberOfProducts,Q.relatedExclude,Q.hasRelatedExclude,B]);let ep="PickProduct"===et?em.isValidating:eh.isValidating,ef="PickProduct"===et?em.isLoading:eh.isLoading,eP="PickProduct"===et?em.error:eh.error,eb=eh.data?.collections?.edges?.[0]?.node,ek="PickProduct"===et?k(em.data?.products):k(eb?.products),eI=u(e=>e.assignedProductIds),eT=u(e=>e.isApplyAllProducts),ey=a(()=>(eI??[]).length>0&&!eT||eT,[eI,eT]),ev=en?.data?.products&&ey?k(en?.data?.products):[],eO=B?ev:"PickProduct"===et&&Q?.productIds?.length?Q?.productIds?.map(e=>ek?.find(t=>t?.baseID===e)).filter(Boolean)??ek:"PickProduct"!==et?ek:ek.filter((e,t)=>t<(Q?.numOfSelectedProducts??4)),ew=a(()=>Y&&B&&D||!eO.length&&!ef&&U&&D,[U,ef,Y,B,D,eO.length]),eS=a(()=>!eO||Y&&B,[Y,B,eO]),eC=a(()=>{if(!A?.sameHeight)return[];let e=0,t=Math.ceil((eO?.length??0)/+(A?.slidesToShow?.[H]??1));return Array.from(Array(eO?.length??0)).map((r,o)=>(o>=+(A?.slidesToShow?.[H]??1)*(e+1)&&++e,{gridRow:`${1+V*e}/${V+1+V*e}`,marginBottom:e+1<t?L(x?.horizontalGutter,H):void 0}))},[A?.sameHeight,A?.slidesToShow,V,eO?.length,H,x?.horizontalGutter]),eE=a(()=>ep||ef||eP||!eO||Y&&B,[eP,ef,Y,B,ep,eO]),eN=ea?.collections?.edges.map(e=>e.node?.id)??[];i(()=>{eE||setTimeout(()=>{let{builderData:e}=G??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&q(r.childElementCount||1)},D?0:500)},[G,eE,D,eN]);let eL=a(()=>({collection:eb,products:eO,settings:{loop:A?.loop??{desktop:!1},scrollMode:A?.scrollMode??{desktop:"snap"},slidesToShow:A?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:x?.layout,dot:A?.dot,dotStyle:A?.dotStyle,arrow:A?.arrow,controlOverContent:A?.controlOverContent},styles:{horizontalGutter:x?.horizontalGutter,verticalGutter:x?.verticalGutter,fullWidth:x?.fullWidth,spacing:x?.spacing,width:x?.width,height:x?.height}}),[eb,eO,A,x]);if(G?.isPreview&&ee)return e(t,{});if(ew)return e(t,{children:C(U,e(W,{builderAttrs:M,collectionHandle:eb?.handle,productSrc:et,onClose:()=>J(!1),children:j,relatedTagString:z,assignProductNoTags:ei||ec||es,noAssignedProduct:!er}))});let{productListWrapStyle:eW,productListContentStyle:ej,productListWrapAlignStyle:ex}=S(o),{productListWrapClass:eG}=E(o);return r("div",{...M,className:eG,style:eW,children:[!!x?.preloadBgImage&&r(v,{children:[!!x.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage.desktop.image.src,as:"image"}),!!x.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.tablet?.image?.src,as:"image"}),!!x.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.mobile?.image?.src,as:"image"})]}),ep||ef?e(d,{}):eP?r("div",{children:["Error: ",eP?.message]}):eS?e("div",{children:"Products not found"}):e(I,{...eL,children:e("div",{className:"gp-flex gp-w-full",style:ex,children:r("div",{style:ej,children:[ee&&e(y,{}),e(t,{children:C(x?.layout==="grid",e(O,{...o,productSortedById:eO,generateGridRowArray:eC}),e(w,{...o,productSortedById:eO}))})]})})}),T(j,!0)]})};export{j as default};
1
+ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as l,useMemo as a,useEffect as i}from"react";import{useRenderMode as s,useCurrentDevice as c,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as f,useProductsQuery as P,useCollectionQuery as b,flattenConnection as k,ProductListProvider as I,filterToolbarPreview as T}from"@gem-sdk/core";import y from"../SalePageProductListWarning.js";import v from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as S}from"./common/styles.js";import{If as C}from"@gem-sdk/system";import{getClass as E}from"./common/classes.js";import{getData as N}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let W=o(()=>import("../ProductNotFound.js"),{loading:d}),j=o=>{let{children:j,styles:x,builderProps:G,setting:A,builderAttrs:M}=o,{isRelatedProduct:B,productSetting:H}=N(o),Q=H.relatedTag&&H.relatedTag[0],{isEditMode:z,isPreviewSharePageMode:D}=s(),F=c(),R=n(),$=u(e=>e.dynamicProduct),_=u(e=>e.dynamicCollection),[V,q]=l(1),[U,J]=l(!0),[K,X]=l(),[Y,Z]=l(!1),ee="GP_FUNNEL_PAGE"===R;"GP_COLLECTION"==R&&(H.productSrc="DynamicCollection",H.collectionId=_?.collectionId??"latest");let et=H?.productSrc??"Collection",er=$?.productId&&$?.productId!==H.relatedProductId?$?.productId:H.relatedProductId,eo=m(),ed=u(e=>e.publicStoreFrontData),el=a(()=>g(ed)?h(ed):eo,[ed]),{data:ea}=p(B&&er?er:void 0,{revalidateOnMount:z||D},el),ei=H.relatedTag&&"tags"===H.relatedTag[0]&&(!ea?.tags||ea?.tags.length===0),es=H.relatedTag&&"collection"===H.relatedTag[0]&&(!ea?.collections?.edges||ea?.collections.edges.length===0),ec=H.relatedTag&&"vendor"===H.relatedTag[0]&&!ea?.vendor,en=f(K,{revalidateOnMount:z||D},el),eu=z||D,em=P("PickProduct"===et?H?.productIds:void 0,{revalidateOnMount:eu},{defaultSelectedProductCount:H?.numOfSelectedProducts}),eg=a(()=>({id:H?.collectionId??"latest",numberOfProducts:A?.numberOfProducts??4,orderBy:A?.orderBy}),[H?.collectionId,Number(A?.numberOfProducts),A?.orderBy]),eh=b("PickProduct"!==et?eg:void 0,{revalidateOnMount:eu});i(()=>{if(B&&ea&&H.relatedTag&&"recommended-product"!==H.relatedType){let e;switch(Z(!1),H.hasRelatedExclude&&(e=H?.relatedExclude&&H.relatedExclude.split(",").map(e=>e.trim())),H.relatedTag[0]){case"vendor":X({first:A?.numberOfProducts,where:{vendor:H.relatedTag&&"vendor"===H.relatedTag[0]?ea?.vendor:"",idNEQ:ea.id}});break;case"collection":{let t=ea?.collections?.edges.map(e=>e.node?.id);if(!t||t?.length===0){Z(!0);break}X(e&&e.length>0?{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t},{titleNotIn:e}]}]}}:{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:t}]}]}});break}case"tags":if(!ea.tags||0===ea.tags.length){Z(!0);break}X(e&&e.length>0?{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags},{nameNotIn:e}]}]}}:{first:A?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags}]}]}})}}},[ea,H.relatedType,H.relatedTag,A?.numberOfProducts,H.relatedExclude,H.hasRelatedExclude,B]);let ep="PickProduct"===et?em.isValidating:eh.isValidating,ef="PickProduct"===et?em.isLoading:eh.isLoading,eP="PickProduct"===et?em.error:eh.error,eb=eh.data?.collections?.edges?.[0]?.node,ek="PickProduct"===et?k(em.data?.products):k(eb?.products),eI=u(e=>e.assignedProductIds),eT=u(e=>e.isApplyAllProducts),ey=a(()=>(eI??[]).length>0&&!eT||eT,[eI,eT]),ev=en?.data?.products&&ey?k(en?.data?.products):[],eO=B?ev:"PickProduct"===et&&H?.productIds?.length?H?.productIds?.map(e=>ek?.find(t=>t?.baseID===e)).filter(Boolean)??ek:"PickProduct"!==et?ek:ek.filter((e,t)=>t<(H?.numOfSelectedProducts??4)),ew=a(()=>Y&&B&&z||!eO.length&&!ef&&U&&z,[U,ef,Y,B,z,eO.length]),eS=a(()=>!eO||Y&&B,[Y,B,eO]),eC=a(()=>{if(!A?.sameHeight)return[];let e=0,t=Math.ceil((eO?.length??0)/+(A?.slidesToShow?.[F]??1));return Array.from(Array(eO?.length??0)).map((r,o)=>(o>=+(A?.slidesToShow?.[F]??1)*(e+1)&&++e,{gridRow:`${1+V*e}/${V+1+V*e}`,marginBottom:e+1<t?L(x?.horizontalGutter,F):void 0}))},[A?.sameHeight,A?.slidesToShow,V,eO?.length,F,x?.horizontalGutter]),eE=a(()=>ep||ef||eP||!eO||Y&&B,[eP,ef,Y,B,ep,eO]),eN=ea?.collections?.edges.map(e=>e.node?.id)??[];i(()=>{eE||setTimeout(()=>{let{builderData:e}=G??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&q(r.childElementCount||1)},z?0:500)},[G,eE,z,eN]);let eL=a(()=>({collection:eb,products:eO,settings:{loop:A?.loop??{desktop:!1},scrollMode:A?.scrollMode??{desktop:"snap"},slidesToShow:A?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:x?.layout,dot:A?.dot,dotStyle:A?.dotStyle,arrow:A?.arrow,controlOverContent:A?.controlOverContent,sameHeight:A?.sameHeight},styles:{horizontalGutter:x?.horizontalGutter,verticalGutter:x?.verticalGutter,fullWidth:x?.fullWidth,spacing:x?.spacing,width:x?.width,height:x?.height}}),[eb,eO,A,x]);if(G?.isPreview&&ee)return e(t,{});if(ew)return e(t,{children:C(U,e(W,{builderAttrs:M,collectionHandle:eb?.handle,productSrc:et,onClose:()=>J(!1),children:j,relatedTagString:Q,assignProductNoTags:ei||es||ec,noAssignedProduct:!er}))});let{productListWrapStyle:eW,productListContentStyle:ej,productListWrapAlignStyle:ex}=S(o),{productListWrapClass:eG}=E(o);return r("div",{...M,className:eG,style:eW,children:[!!x?.preloadBgImage&&r(v,{children:[!!x.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage.desktop.image.src,as:"image"}),!!x.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.tablet?.image?.src,as:"image"}),!!x.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:x.backgroundImage?.mobile?.image?.src,as:"image"})]}),ep||ef?e(d,{}):eP?r("div",{children:["Error: ",eP?.message]}):eS?e("div",{children:"Products not found"}):e(I,{...eL,children:e("div",{className:"gp-flex gp-w-full",style:ex,children:r("div",{style:ej,children:[ee&&e(y,{}),e(t,{children:C(x?.layout==="grid",e(O,{...o,productSortedById:eO,generateGridRowArray:eC}),e(w,{...o,productSortedById:eO}))})]})})}),T(j,!0)]})};export{j as default};
@@ -1,6 +1,6 @@
1
- import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let g=g=>{let{setting:p,styles:f,pageContext:m}=g,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:x,sortedBy:S,isReverse:b,productSrc:A,productNumber:L,isSorted:R,relatedTag:I,collectionHandle:F}=u(g),j=()=>i`
2
- ${e("RelatedProduct"===A,`
3
- assign relatedTag = '${I}'
1
+ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as g}from"./common/helpers.js";let u=u=>{let{setting:p,styles:f,pageContext:m}=u,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:S,sortedBy:x,isReverse:b,productSrc:L,productNumber:A,isSorted:R,relatedTag:H,collectionHandle:I}=g(u),F=()=>i`
2
+ ${e("RelatedProduct"===L,`
3
+ assign relatedTag = '${H}'
4
4
  assign assignProduct = product
5
5
  assign idAssignProduct = assignProduct.id
6
6
  paginate collections.all.products by 10000
@@ -95,7 +95,7 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
95
95
  assign products = products
96
96
  endpaginate
97
97
  `)}
98
- `,{productListWrapStyle:w,productListContentStyle:H,productListWrapAlignStyle:q}=c(g),{productListWrapClass:G}=l(g);return i`
98
+ `,{productListWrapStyle:j,productListContentStyle:w,productListWrapAlignStyle:q}=c(u),{productListWrapClass:G}=l(u);return i`
99
99
  ${e(s,`
100
100
  <script ${d('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>
101
101
  ${p?.sameHeight?`<script ${d('class="gps-link" delay',"src")}="{{ 'gp-same-height-v7-5.js' | asset_url }}" defer="defer"></script>`:""}
@@ -107,16 +107,16 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
107
107
  ${e(!!f?.preloadBgImage,`${e(!!f?.backgroundImage?.desktop?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.desktop?.image?.src}" as="image" />`)}${e(!!f?.backgroundImage?.tablet?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.tablet?.image?.src}" as="image" />`)}${e(!!f?.backgroundImage?.mobile?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.mobile?.image?.src}" as="image" />`)}`)}
108
108
  <div
109
109
  class="${G}"
110
- style="${w}"
110
+ style="${j}"
111
111
  >
112
112
  <div class='gp-flex gp-w-full' style="${q}">
113
113
  <div
114
- style="${H}"
114
+ style="${w}"
115
115
  >
116
116
  {%- assign gpBkProduct = product -%}
117
117
  {%- assign gpBkProducts = products -%}
118
- ${(()=>{let e=F?`
119
- assign target_collection = collections['${F}']
118
+ ${(()=>{let e=I?`
119
+ assign target_collection = collections['${I}']
120
120
  if target_collection == empty
121
121
  for collection in collections
122
122
  if collection.id == ${_}
@@ -134,12 +134,13 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
134
134
  endfor
135
135
  `;return i`
136
136
  {%- liquid
137
- assign productHandles = '${x.toString()}'| split: ','
137
+ assign productHandles = '${S.toString()}'| split: ','
138
138
  assign products = null
139
139
  assign target_collection = null
140
- assign productSrc = '${A}'
140
+ assign productSrc = '${L}'
141
141
  assign c = 0
142
- assign limit = ${L??4}
142
+ assign limit = ${A??4}
143
+ assign isSettingSameHeightProductList = ${p?.sameHeight??!1}
143
144
 
144
145
  if request.page_type == 'collection' or preview_page_type == 'collection'
145
146
  assign target_collection = collection
@@ -151,11 +152,11 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
151
152
  endif
152
153
  endif
153
154
  paginate target_collection.products by ${E||4}
154
- assign products = target_collection.products ${R?S:""} ${b?"| reverse":""}
155
+ assign products = target_collection.products ${R?x:""} ${b?"| reverse":""}
155
156
  endpaginate
156
157
  else
157
158
  if productSrc == 'RelatedProduct'
158
- ${j()}
159
+ ${F()}
159
160
  elsif productSrc == 'PickProduct'
160
161
  unless ${y}
161
162
  assign products = null | sort
@@ -178,7 +179,7 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
178
179
  ${e}
179
180
  endif
180
181
  paginate target_collection.products by ${E||4}
181
- assign products = target_collection.products ${R?S:""} ${b?"| reverse":""}
182
+ assign products = target_collection.products ${R?x:""} ${b?"| reverse":""}
182
183
  endpaginate
183
184
  endif
184
185
  endif
@@ -187,14 +188,14 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
187
188
  ${i`
188
189
  {%- if products == null -%}
189
190
  {%- if count == 0 and ${k.length} == 0 -%}
190
- {% if '${A}' == 'RelatedProduct' -%}
191
+ {% if '${L}' == 'RelatedProduct' -%}
191
192
  <div>${o("ProductList","no_related_products")}</div>
192
193
  {% else %}
193
194
  <div>${o("ProductList","no_products_found")}</div>
194
195
  {%- endif -%}
195
196
  {%- endif -%}
196
197
  {%-else-%}
197
- ${r(v,i`${n({...g,productListId:k,productSrc:A})}`,i`${a({...g,productListId:k,productSrc:A})}`)}
198
+ ${r(v,i`${n({...u,productListId:k,productSrc:L})}`,i`${a({...u,productListId:k,productSrc:L})}`)}
198
199
  {%- endif -%}
199
200
  `}
200
201
  {%- assign product = gpBkProduct -%}
@@ -202,4 +203,4 @@ import{RenderIf as e,isLocalEnv as s,baseAssetURL as t,template as i}from"@gem-s
202
203
  </div>
203
204
  </div>
204
205
  </div>
205
- `};export{g as default};
206
+ `};export{u as default};
@@ -1,22 +1,22 @@
1
- import{template as o}from"@gem-sdk/core";import t from"../../../carousel-v3/components/item/CarouselItem.liquid.js";import r from"../../../carousel-v3/components/root/Carousel.liquid.js";import{getData as e}from"./common/helpers.js";import{getClass as i}from"./common/classes.js";import{getStyle as s}from"./common/styles.js";import{getStaticLocale as d}from"../../../helpers.js";import u from"./ProductListCarouselItem.liquid.js";let n=n=>{let{builderProps:c,advanced:l,productSrc:a,productListId:p}=n,{carouselConfigSetting:m,carouselConfigStyle:f}=e(n),{carouselItemStyle:g}=s(n),{carouselClass:$}=i(n);return o`
2
- ${r({advanced:l,builderProps:{...c},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${c?.uid}`,rootClass:$,setting:m,styles:f,isProductList:!0,children:`
1
+ import{template as o}from"@gem-sdk/core";import t from"../../../carousel-v3/components/item/CarouselItem.liquid.js";import r from"../../../carousel-v3/components/root/Carousel.liquid.js";import{getData as e}from"./common/helpers.js";import{getClass as i}from"./common/classes.js";import{getStyle as s}from"./common/styles.js";import{getStaticLocale as d}from"../../../helpers.js";import u from"./ProductListCarouselItem.liquid.js";let c=c=>{let{builderProps:l,advanced:n,productSrc:p,productListId:a}=c,{carouselConfigSetting:m,carouselConfigStyle:f}=e(c),{carouselItemStyle:g}=s(c),{carouselClass:$}=i(c);return o`
2
+ ${r({advanced:n,builderProps:{...l},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${l?.uid}`,rootClass:$,setting:m,styles:f,isProductList:!0,children:`
3
3
  {%- assign count = 0 -%}
4
4
  {%- for product in products limit: limit -%}
5
5
  {%- if product.id != empty -%}
6
6
  {%- assign count = count | plus: 1 -%}
7
7
  {%- assign variant = product.selected_or_first_available_variant -%}
8
- {%- assign product_form_id = 'product-form-' | append: "${c?.uid}" | append: product.id -%}
9
- ${t({builderProps:{...c},style:g,parentId:`product-list-carousel-${c?.uid} gp-child-item-${c?.uid}`,parentStyle:f,parentSettings:m,background:m?.background,children:`
10
- ${u({...n})}
8
+ {%- assign product_form_id = 'product-form-' | append: "${l?.uid}" | append: product.id -%}
9
+ ${t({builderProps:{...l},style:g,parentId:`product-list-carousel-${l?.uid} gp-child-item-${l?.uid}`,parentStyle:f,parentSettings:m,background:m?.background,children:`
10
+ ${u({...c})}
11
11
  `})}
12
12
  {%- endif -%}
13
13
  {% endfor %}
14
- {%- if count == 0 and ${p.length} == 0 -%}
15
- {% if '${a}' == 'RelatedProduct' -%}
14
+ {%- if count == 0 and ${a.length} == 0 -%}
15
+ {% if '${p}' == 'RelatedProduct' -%}
16
16
  <div>${d("ProductList","no_related_products")}</div>
17
17
  {% else %}
18
18
  <div>${d("ProductList","no_products_found")}</div>
19
19
  {%- endif -%}
20
20
  {%- endif -%}
21
- `})}
22
- `};export{n as default};
21
+ `,carouselType:"product_list"})}
22
+ `};export{c as default};
@@ -2,6 +2,16 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
2
2
  ${s("{%- assign optionRendered = false -%}")}
3
3
  ${s("{%- assign swatches = shop.metafields.GEMPAGES.swatchesJSONFormat.value -%}")}
4
4
 
5
+ ${s(`{%- assign variantPresetString = "${r}" -%}
6
+ {%- assign optionName = option.name | replace: "'", "&apos;" | replace: '"', "&quot;" -%}
7
+ {%- assign items = variantPresetString | split: '($2)' -%}
8
+ {%- assign type = 'dropdown' -%}
9
+ {% for item in items %}
10
+ {%- assign itemPreset = item | split: '($1)' -%}
11
+ {% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
12
+ {% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
13
+ {% endfor %}`)}
14
+
5
15
  ${s(`{% for swatch in swatches %}
6
16
  {%- assign optionTitle = swatch.optionTitle -%}
7
17
  {%- assign optionType = swatch.optionType -%}
@@ -21,21 +31,10 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
21
31
  {%- assign imageUrls = imageUrlsString | split: '${n}' | slice: 0, imageUrlsString.size -%}
22
32
 
23
33
  {% if optionTitle == option.name %}
24
- {%- assign variantPresetString = "${r}" -%}
25
- {%- assign optionName = option.name | replace: "'", "&apos;" | replace: '"', "&quot;" -%}
26
- {%- assign items = variantPresetString | split: '($2)' -%}
27
- {%- assign type = 'dropdown' -%}
28
-
29
- {% for item in items %}
30
- {%- assign itemPreset = item | split: '($1)' -%}
31
- {% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
32
- {% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
33
- {% endfor %}
34
34
  {%- assign optionRendered = true -%}
35
-
36
35
  ${o({showDropdown:!0})}
37
36
  {% endif %}
38
37
  {% endfor %}`)}
39
38
 
40
- ${i("optionRendered == false",o({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
39
+ ${i("optionRendered == false",o({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
41
40
  `};export{t as renderOptionValuesNewFormatSwatches};
@@ -3,6 +3,16 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
3
3
  ${e("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
4
4
  ${e("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
5
5
 
6
+ ${e(`{%- assign variantPresetString = "${o}" -%}
7
+ {%- assign optionName = option.name | replace: "'", "&apos;" | replace: '"', "&quot;" -%}
8
+ {%- assign items = variantPresetString | split: '($2)' -%}
9
+ {%- assign type = 'dropdown' -%}
10
+ {% for item in items %}
11
+ {%- assign itemPreset = item | split: '($1)' -%}
12
+ {% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
13
+ {% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
14
+ {% endfor %}`)}
15
+
6
16
  ${s("swatchesItem in swatchesItems",`
7
17
  ${e('{%- assign colorArraysString = "" -%}')}
8
18
  ${e('{%- assign labelsString = "" -%}')}
@@ -48,19 +58,10 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
48
58
  ${e("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
49
59
 
50
60
  ${t("optionTitle == option.name",`
51
- ${e(`{%- assign variantPresetString = "${o}" -%}`)}
52
- ${e('{%- assign optionName = option.name | replace: "\'", "&apos;" | replace: \'"\', "&quot;" -%}')}
53
- ${e("{%- assign items = variantPresetString | split:'($2)' -%}")}
54
- ${e("{%- assign type = 'dropdown' -%}")}
55
- ${s("item in items",`
56
- ${e("{%- assign itemPreset = item | split:'($1)' -%}")}
57
- ${t("itemPreset[0] == optionName",e("{%- assign type = itemPreset[1] -%}"))}
58
- ${t('itemPreset[0] == "base"',e("{%- assign type = itemPreset[1] -%}"))}
59
- `)}
60
61
  ${e("{%- assign optionRendered = true -%}")}
61
62
  ${n({showDropdown:!0})}
62
63
  `)}
63
64
  `)}
64
65
 
65
- ${t("optionRendered == false",n({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
66
+ ${t("optionRendered == false",n({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
66
67
  `};export{a as renderOptionValuesOld};
@@ -1,11 +1,11 @@
1
- import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-sdk/core";import a from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as d,If as o}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as p,STATIC_PRODUCT_STATUS as l,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let f=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:S,productSetting:I}=g??{},b=I?.hasPreSelected??!1,{rowSetting:j,rowStyles:h,formatVariantId:q,formatProductId:P,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=c(f);return r`
1
+ import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-sdk/core";import a from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as d,If as o}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as l,STATIC_PRODUCT_STATUS as p,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let f=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:S,productSetting:h}=g??{},I=h?.hasPreSelected??!1,{rowSetting:b,rowStyles:j,formatVariantId:P,formatProductId:q,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=c(f);return r`
2
2
  ${r`
3
3
  {%- assign gpBkProduct = product -%}
4
- ${o(V==p,r`
4
+ ${o(V==l,r`
5
5
  {%- liquid
6
6
  if request.page_type != 'product'
7
7
  assign product = all_products['${w}']
8
- assign productId = '${P}' | times: 1
8
+ assign productId = '${q}' | times: 1
9
9
  if product == empty or product == null
10
10
  paginate collections.all.products by 100000
11
11
  for item in collections.all.products
@@ -20,14 +20,14 @@ import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-s
20
20
  `,r`
21
21
  {%- liquid
22
22
  if request.page_type == 'product'
23
- if '${V}' == '${l}'
24
- if '${P}' == '${u}'
23
+ if '${V}' == '${p}'
24
+ if '${q}' == '${u}'
25
25
  paginate collections.all.products by 100000
26
26
  assign product = collections.all.products | sort: 'created_at' | reverse | first
27
27
  endpaginate
28
28
  else
29
29
  assign product = all_products['${w}']
30
- assign productId = '${P}' | times: 1
30
+ assign productId = '${q}' | times: 1
31
31
  if product == empty or product == null
32
32
  paginate collections.all.products by 100000
33
33
  for item in collections.all.products
@@ -40,13 +40,13 @@ import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-s
40
40
  endif
41
41
  endif
42
42
  else
43
- if '${P}' == '${u}'
43
+ if '${q}' == '${u}'
44
44
  paginate collections.all.products by 100000
45
45
  assign product = collections.all.products | sort: 'created_at'| reverse | first
46
46
  endpaginate
47
47
  else
48
48
  assign product = all_products['${w}']
49
- assign productId = '${P}' | times: 1
49
+ assign productId = '${q}' | times: 1
50
50
  if product == empty or product == null
51
51
  paginate collections.all.products by 100000
52
52
  for item in collections.all.products
@@ -63,23 +63,26 @@ import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-s
63
63
  `}
64
64
  ${d("product != empty and product != null",r`
65
65
  ${r`
66
- {%- assign initVariantId = ${q} -%}
66
+ {%- assign initVariantId = ${P} -%}
67
67
  {%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
68
- ${q?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
69
- ${q?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
68
+ ${P?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
69
+ ${P?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
70
70
  {%-if productSelectedVariant == empty or productSelectedVariant == null -%}
71
71
  {%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
72
72
  {%- endif -%}
73
73
  {%-if variant == empty or variant == null -%}
74
74
  {%- assign variant = product.selected_or_first_available_variant -%}
75
75
  {%- endif -%}
76
+ {% unless isSettingSameHeightProductList %}
77
+ {%- assign isSettingSameHeightProductList = false -%}
78
+ {% endunless %}
76
79
  `}
77
80
  <gp-product
78
81
  data-uid="${v?.uid}"
79
82
  data-id="${v?.uid}"
80
83
  style="${E}"
81
84
  class="${$?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${b}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
85
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${I}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
86
  gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}'
84
87
  >
85
88
  <product-form class="product-form">
@@ -87,7 +90,7 @@ import{RenderIf as t,isLocalEnv as e,baseAssetURL as i,template as r}from"@gem-s
87
90
  <input type="hidden" name="id" value="{{ variant.id }}" />
88
91
  <input type="hidden" name="quantity" value="{{ quantity }}" />
89
92
  <button type="submit" onclick="return false;" style="display:none;"></button>
90
- ${a({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:h,setting:j,children:m,rawChildren:_})}
93
+ ${a({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:j,setting:b,children:m,rawChildren:_})}
91
94
  {%- endform -%}
92
95
  </product-form>
93
96
  </gp-product>
@@ -1 +1 @@
1
- export{default as Product}from"./components/product-wrap/Product.js";import"react/jsx-runtime";import"next/link";import"@gem-sdk/core";import"react";import"@gem-sdk/system";import"../notification/components/Notifications.js";import"../notification/components/Notice.js";import"./components/product-button/types.js";import"./components/product-variants/components/variants/index.js";import"next/image";import"../modal/components/confirm.js";import"react-dom";import"../video/components/Video.js";import"@gem-sdk/keen-slider/react";export{default as ProductQuickView}from"./components/product-quick-view/QuickView.js";import"./components/constants/product-bundle.js";export{default as ProductListV3}from"./components/product-list-v3/ProductList.js";export{default as ProductList}from"./components/product-list/ProductList.js";import"./components/product-bundle/common/styles.js";import"./components/product-bundle/common/classes.js";import"./components/product-badge/constants.js";import"./components/product-badge/types.js";import"./components/product-badge/utils/shape.js";import t from"./settings/Product.js";import o from"./settings/ProductQuantity.js";import r from"./settings/ProductTitle.js";import s from"./settings/ProductButton.js";import i from"./settings/ProductPrice.js";import e from"./settings/ProductVariants.js";import m from"./settings/ProductImages.js";import c from"./settings/product-image-v3/ProductImages.js";import n from"./settings/product-image-v2/ProductImages.js";import d from"./settings/ProductDescription.js";import p from"./settings/ProductProperties.js";import u from"./settings/ProductTag.js";import a from"./settings/ProductListV3.js";import P from"./settings/ProductList.js";import g from"./settings/DynamicCheckout.js";import j from"./settings/Vendor.js";import f from"./settings/Sku.js";import l from"./components/product-bundle/setting/ProductBundleDiscount.js";import V from"./components/product-bundle/setting/ProductBundleDiscountItem.js";import k from"./settings/ProductViewMore.js";import x from"./settings/ProductBadge.js";import b from"./components/file-upload/settings/index.js";let y={Product:t,ProductQuantity:o,ProductTitle:r,ProductButton:s,ProductPrice:i,ProductVariants:e,ProductImages:m,ProductImagesV2:n,ProductImagesV3:c,ProductDescription:d,ProductProperties:p,ProductTag:u,ProductListV3:a,ProductList:P,DynamicCheckout:g,ProductVendor:j,ProductSku:f,ProductBundleDiscount:l,ProductBundleDiscountItem:V,ProductViewMore:k,ProductBadge:x,FileUpload:b};export{y as productSetting};
1
+ export{default as Product}from"./components/product-wrap/Product.js";import"react/jsx-runtime";import"next/link";import"@gem-sdk/core";import"react";import"@gem-sdk/system";import"../notification/components/Notifications.js";import"../notification/components/Notice.js";import"./components/product-button/types.js";import"./components/product-variants/components/variants/index.js";import"next/image";import"../carousel-v3/components/swiper/Swiper.js";import"../modal/components/confirm.js";import"react-dom";import"../video/components/Video.js";import"@gem-sdk/keen-slider/react";export{default as ProductQuickView}from"./components/product-quick-view/QuickView.js";import"./components/constants/product-bundle.js";export{default as ProductListV3}from"./components/product-list-v3/ProductList.js";export{default as ProductList}from"./components/product-list/ProductList.js";import"./components/product-bundle/common/styles.js";import"./components/product-bundle/common/classes.js";import"./components/product-badge/constants.js";import"./components/product-badge/types.js";import"./components/product-badge/utils/shape.js";import t from"./settings/Product.js";import o from"./settings/ProductQuantity.js";import r from"./settings/ProductTitle.js";import s from"./settings/ProductButton.js";import i from"./settings/ProductPrice.js";import e from"./settings/ProductVariants.js";import m from"./settings/ProductImages.js";import c from"./settings/product-image-v3/ProductImages.js";import n from"./settings/product-image-v2/ProductImages.js";import p from"./settings/ProductDescription.js";import u from"./settings/ProductProperties.js";import d from"./settings/ProductTag.js";import a from"./settings/ProductListV3.js";import P from"./settings/ProductList.js";import g from"./settings/DynamicCheckout.js";import j from"./settings/Vendor.js";import f from"./settings/Sku.js";import l from"./components/product-bundle/setting/ProductBundleDiscount.js";import V from"./components/product-bundle/setting/ProductBundleDiscountItem.js";import k from"./settings/ProductViewMore.js";import x from"./settings/ProductBadge.js";import b from"./components/file-upload/settings/index.js";let v={Product:t,ProductQuantity:o,ProductTitle:r,ProductButton:s,ProductPrice:i,ProductVariants:e,ProductImages:m,ProductImagesV2:n,ProductImagesV3:c,ProductDescription:p,ProductProperties:u,ProductTag:d,ProductListV3:a,ProductList:P,DynamicCheckout:g,ProductVendor:j,ProductSku:f,ProductBundleDiscount:l,ProductBundleDiscountItem:V,ProductViewMore:k,ProductBadge:x,FileUpload:b};export{v as productSetting};
@@ -1 +1 @@
1
- import{ImageListNavigation as i}from"./ui/ImageListNavigation.js";import{FeatureNavigation as o}from"./ui/FeatureNavigation.js";import{FeatureDots as t}from"./ui/FeatureDots.js";let e='((type == "slider" || position == "left" || position == "right") && position !== "one-col" && position != "two-col")',n='(["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position))',l=[{label:"Layout",controls:[{layout:"vertical",setting:{id:"position"},options:{isComboLayout:!0},controls:[{label:"Ratio",type:"control",setting:{id:"ratioLayout"},layout:"vertical",conditionDisplay:'position == "left"'},{label:"Ratio",type:"control",setting:{id:"ratioLayoutRight"},layout:"vertical",conditionDisplay:'position == "right"'}]}]},{label:"Featured image",conditionDisplay:n,controls:[{setting:{id:"ftShape"},hiddenOnMobile:!0,layout:"vertical",controlChangeTrigger:{settings:[{condition:"ftShape.shape === 'original'",source:["ftShape"],action:{controlId:"ftLayout",newValue:"contain",groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}},{conditionDisplay:"ftShape.shape !== 'original'",label:"Image scale",setting:{id:"ftLayout"}},{...t,hiddenOnMobile:!0,conditionDisplay:`${n} && position === "only-feature"`},{...o,hiddenOnMobile:!0,conditionDisplay:`${n}`}],moreSettings:{type:"collapse",controls:[{label:"Corner",setting:{id:"ftCorner"},hiddenOnMobile:!0},{type:"combo",label:"Hover action",conditionDisplay:n,iconName:"gp-trigger-action-hover",getValueFromSettingID:"hoverEffect",isShowSettingTitle:!0,defaultValueWhenClear:"none",compoDefaultValue:"zoom",hiddenOnMobile:!0,controls:[{label:"When hover",setting:{id:"hoverEffect"}},{label:"Zoom type",conditionDisplay:'hoverEffect == "zoom"',setting:{id:"zoomType"}},{label:"Zoom value",conditionDisplay:'hoverEffect == "zoom"',setting:{id:"zoom"}},{label:"Other image",conditionDisplay:'hoverEffect == "other"',setting:{id:"otherImage"}}]},{type:"combo",label:"Click action",hiddenOnMobile:!0,iconName:"gp-trigger-action-click",conditionDisplay:n,getValueFromSettingID:"ftClickOpenLightBox",isShowSettingTitle:!0,defaultValueWhenClear:"none",compoDefaultValue:"popup",controls:[{label:"After click",setting:{id:"ftClickOpenLightBox"}},{label:"Open new tab",setting:{id:"ftClickOpenNewTab"},conditionDisplay:'ftClickOpenLightBox === "product-link"'}]},{type:"control",label:"Slide speed",setting:{id:"ftAnimationSpeed"}},{type:"control",label:"Animation",setting:{id:"ftAnimationMode"}},{label:"Drag / swipe",setting:{id:"ftDragToScroll"}},{label:"Infinity loop",setting:{id:"ftLoop"}}]}},{label:"Image list",conditionDisplay:'(position !== "only-feature")',controls:[{label:"Display",hiddenOnMobile:!0,conditionDisplay:'position === "bottom-center" || position === "bottom-left" || position === "inside-bottom"',setting:{id:"type"}},{setting:{id:"shape"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["left", "right"].includes(position)'},{setting:{id:"shapeForBottom"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["bottom-left", "bottom-center"].includes(position)'},{setting:{id:"shapeForInsideBottom"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["inside-bottom"].includes(position)'},{setting:{id:"shapeForInside"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["inside-left", "inside-right"].includes(position)'},{setting:{id:"shapeForFtOnly"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "only-feature"'},{setting:{id:"shapeFor2Col"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "two-col"'},{setting:{id:"shapeFor1Col"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "one-col"'},{label:"Image gap",setting:{id:"itemSpacing"}},{conditionDisplay:"(position == 'one-col' && shapeFor1Col.shape !== 'original') || (position == 'two-col' && shapeFor2Col.shape !== 'original') || (position == 'only-feature' && shapeForFtOnly.shape !== 'original') || ([\"inside-left\", \"inside-right\"].includes(position) && shapeForInside.shape !== 'original') || ([\"inside-bottom\"].includes(position) && shapeForInsideBottom.shape !== 'original') || ([\"bottom-left\", \"bottom-center\"].includes(position) && shapeForBottom.shape !== 'original') || ([\"left\", \"right\"].includes(position) && shape.shape !== 'original')",label:"Image scale",setting:{id:"layout"}},{...i,hiddenOnMobile:!0,conditionDisplay:e}],moreSettings:{type:"collapse",controls:[{label:"Corner",hiddenOnMobile:!0,setting:{id:"corner"}},{label:"Active border",hiddenOnMobile:!0,conditionDisplay:'!["one-col", "two-col"].includes(position)',setting:{id:"borderActive"}},{type:"combo",label:"Hover action",conditionDisplay:'(position == "one-col" || position == "two-col")',iconName:"gp-trigger-action-hover",getValueFromSettingID:"galleryHoverEffect",defaultValueWhenClear:"none",hiddenOnMobile:!0,compoDefaultValue:"zoom",controls:[{label:"When hover",setting:{id:"galleryHoverEffect"},conditionDisplay:'galleryHoverEffect == "none"'},{label:"Zoom type",conditionDisplay:'galleryHoverEffect == "zoom"',setting:{id:"galleryZoomType"}},{label:"Zoom value",conditionDisplay:'galleryHoverEffect == "zoom"',setting:{id:"galleryZoom"}},{label:"Other image",conditionDisplay:'galleryHoverEffect == "other"',setting:{id:"otherImage"}}]},{label:"Click action",setting:{id:"clickOpenLightBox"}},{conditionDisplay:e,label:"Drag / swipe",setting:{id:"dragToScroll"}},{conditionDisplay:e,label:"Infinity loop",setting:{id:"loop"}}]}},{label:"Item spacing",hiddenOnMobile:!0,conditionDisplay:'["bottom-center", "left", "right", "inside-bottom", "inside-left", "inside-right"].includes(position)',controls:[{label:"Gap",setting:{id:"spacing"}}]},{label:"Display condition",controls:[{conditionDisplay:'["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position)',label:"Default item",setting:{id:"preDisplay"}},{label:"Image list",setting:{id:"filterByVariant"}}],messageConfig:{type:"info",message:'Image list can display based on the selected variants. <a class="text-white" target="_blank" href="https://gempages.co/display-selected-variant">How to setup</a>'}},{label:"Optimize LCP",controls:[{label:"Preload",conditionDisplay:'["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position)',setting:{id:"preload"}},{label:"Quality",setting:{id:"qualityType"},conditionDisplay:"preload === false"},{layout:"horizontal",label:"Quality",conditionDisplay:'qualityType == "custom" && preload === false',setting:{id:"qualityPercent"}}]},{hiddenOnMobile:!0,controls:[{label:"Align",setting:{id:"align"},options:{labelVariant:"primary"}}]}];export{l as SettingUIV2};
1
+ import{ImageListNavigation as i}from"./ui/ImageListNavigation.js";import{FeatureNavigation as o}from"./ui/FeatureNavigation.js";import{FeatureDots as t}from"./ui/FeatureDots.js";let e='((type == "slider" || position == "left" || position == "right") && position !== "one-col" && position != "two-col")',n='(["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position))',l=[{label:"Layout",controls:[{layout:"vertical",setting:{id:"position"},options:{isComboLayout:!0},controls:[{label:"Ratio",type:"control",setting:{id:"ratioLayout"},layout:"vertical",conditionDisplay:'position == "left"'},{label:"Ratio",type:"control",setting:{id:"ratioLayoutRight"},layout:"vertical",conditionDisplay:'position == "right"'}]}]},{label:"Featured image",conditionDisplay:n,controls:[{setting:{id:"ftShape"},hiddenOnMobile:!0,layout:"vertical",controlChangeTrigger:{settings:[{condition:"ftShape.shape === 'original'",source:["ftShape"],action:{controlId:"ftLayout",newValue:"contain",groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}},{conditionDisplay:"ftShape.shape !== 'original'",label:"Image scale",setting:{id:"ftLayout"}},{...t,hiddenOnMobile:!0,conditionDisplay:`${n} && position === "only-feature"`},{...o,hiddenOnMobile:!0,conditionDisplay:`${n}`}],moreSettings:{type:"collapse",controls:[{label:"Corner",setting:{id:"ftCorner"},hiddenOnMobile:!0},{type:"combo",label:"Hover action",conditionDisplay:n,iconName:"gp-trigger-action-hover",getValueFromSettingID:"hoverEffect",isShowSettingTitle:!0,defaultValueWhenClear:"none",compoDefaultValue:"zoom",hiddenOnMobile:!0,controls:[{label:"When hover",setting:{id:"hoverEffect"}},{label:"Zoom type",conditionDisplay:'hoverEffect == "zoom"',setting:{id:"zoomType"}},{label:"Zoom value",conditionDisplay:'hoverEffect == "zoom"',setting:{id:"zoom"}},{label:"Other image",conditionDisplay:'hoverEffect == "other"',setting:{id:"otherImage"}}]},{type:"combo",label:"Click action",hiddenOnMobile:!0,iconName:"gp-trigger-action-click",conditionDisplay:n,getValueFromSettingID:"ftClickOpenLightBox",isShowSettingTitle:!0,defaultValueWhenClear:"none",compoDefaultValue:"popup",controls:[{label:"After click",setting:{id:"ftClickOpenLightBox"}},{label:"Open new tab",setting:{id:"ftClickOpenNewTab"},conditionDisplay:'ftClickOpenLightBox === "product-link"'}]},{type:"control",label:"Slide speed",setting:{id:"ftAnimationSpeed"}},{type:"control",label:"Animation",setting:{id:"ftAnimationMode"}},{label:"Drag / swipe",setting:{id:"ftDragToScroll"}},{label:"Infinity loop",setting:{id:"ftLoop"}}]}},{label:"Image list",conditionDisplay:'(position !== "only-feature")',controls:[{label:"Display",hiddenOnMobile:!0,conditionDisplay:'position === "bottom-center" || position === "bottom-left" || position === "inside-bottom"',setting:{id:"type"}},{setting:{id:"shape"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["left", "right"].includes(position)'},{setting:{id:"shapeForBottom"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["bottom-left", "bottom-center"].includes(position)'},{setting:{id:"shapeForInsideBottom"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["inside-bottom"].includes(position)'},{setting:{id:"shapeForInside"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'["inside-left", "inside-right"].includes(position)'},{setting:{id:"shapeForFtOnly"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "only-feature"'},{setting:{id:"shapeFor2Col"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "two-col"'},{setting:{id:"shapeFor1Col"},hiddenOnMobile:!0,layout:"vertical",conditionDisplay:'position == "one-col"'},{label:"Image gap",setting:{id:"itemSpacing"}},{conditionDisplay:"(position == 'one-col' && shapeFor1Col.shape !== 'original') || (position == 'two-col' && shapeFor2Col.shape !== 'original') || (position == 'only-feature' && shapeForFtOnly.shape !== 'original') || ([\"inside-left\", \"inside-right\"].includes(position) && shapeForInside.shape !== 'original') || ([\"inside-bottom\"].includes(position) && shapeForInsideBottom.shape !== 'original') || ([\"bottom-left\", \"bottom-center\"].includes(position) && shapeForBottom.shape !== 'original') || ([\"left\", \"right\"].includes(position) && shape.shape !== 'original')",label:"Image scale",setting:{id:"layout"}},{...i,hiddenOnMobile:!0,conditionDisplay:e}],moreSettings:{type:"collapse",controls:[{label:"Corner",hiddenOnMobile:!0,setting:{id:"corner"}},{label:"Active border",hiddenOnMobile:!0,conditionDisplay:'!["one-col", "two-col"].includes(position)',setting:{id:"borderActive"}},{type:"combo",label:"Hover action",conditionDisplay:'(position == "one-col" || position == "two-col")',iconName:"gp-trigger-action-hover",getValueFromSettingID:"galleryHoverEffect",defaultValueWhenClear:"none",hiddenOnMobile:!0,compoDefaultValue:"zoom",controls:[{label:"When hover",setting:{id:"galleryHoverEffect"},conditionDisplay:'galleryHoverEffect == "none"'},{label:"Zoom type",conditionDisplay:'galleryHoverEffect == "zoom"',setting:{id:"galleryZoomType"}},{label:"Zoom value",conditionDisplay:'galleryHoverEffect == "zoom"',setting:{id:"galleryZoom"}},{label:"Other image",conditionDisplay:'galleryHoverEffect == "other"',setting:{id:"otherImage"}}]},{label:"Click action",setting:{id:"clickOpenLightBox"}},{conditionDisplay:e,label:"Drag / swipe",setting:{id:"dragToScroll"}},{conditionDisplay:e,label:"Infinity loop",setting:{id:"loop"}}]}},{label:"Item spacing",hiddenOnMobile:!0,conditionDisplay:'["bottom-center", "left", "right", "inside-bottom", "inside-left", "inside-right"].includes(position)',controls:[{label:"Gap",setting:{id:"spacing"}}]},{label:"Display condition",controls:[{conditionDisplay:'["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position)',label:"Default item",setting:{id:"preDisplay"}},{label:"Image list",setting:{id:"filterByVariant"}}],messageConfig:{type:"info",message:'Image list can display based on the selected variants. <a class="text-white" target="_blank" href="https://gempages.co/display-selected-variant">How to setup</a>'}},{label:"Optimize LCP",controls:[{label:"Preload",conditionDisplay:'["bottom-center", "left", "right", "only-feature", "inside-bottom", "inside-left", "inside-right"].includes(position)',setting:{id:"preload"}},{label:"Quality",setting:{id:"qualityType"},conditionDisplay:'preload === false || (preload === true && (position === "one-col" || position === "two-col"))'},{layout:"horizontal",label:"Quality",conditionDisplay:'qualityType == "custom" && (preload === false || (preload === true && (position === "one-col" || position === "two-col")))',setting:{id:"qualityPercent"}}]},{hiddenOnMobile:!0,controls:[{label:"Align",setting:{id:"align"},options:{labelVariant:"primary"}}]}];export{l as SettingUIV2};
@@ -1 +1 @@
1
- import{makeStyleResponsive as t,usePageStore as e,useCurrentDevice as o}from"@gem-sdk/core";import{useMemo as l}from"react";let p=p=>{let{width:a,position:s}=p??{},b=t("w",a),d=e(t=>"interaction"===t.sidebarMode),i=o(),k=(t,e)=>({[`--left${e}`]:"top"==t?"0":"50%",[`--t${e}`]:"top"==t?"unset":"translateX(-50%)"}),m=l(()=>({...k(s?.desktop,""),...k(s?.tablet??s?.desktop,"-tablet"),...k(s?.mobile??s?.tablet??s?.desktop,"-mobile")}),[s?.desktop,s?.mobile,s?.tablet]),r=l(()=>{if(d&&s?.[i]==="top")return"40px"},[i,d,s]),y=l(()=>({"--d":(p?.display?.desktop,"block"),"--d-tablet":(p?.display?.tablet??p?.display?.desktop,"block"),"--d-mobile":(p?.display?.mobile??p?.display?.tablet??p?.display?.desktop,"block")}),[p?.display?.desktop,p?.display?.mobile,p?.display?.tablet]),c=l(()=>({"--top":r??"auto","--top-tablet":r??"auto","--top-mobile":r??"auto",[`--${s?.desktop}`]:r??"0px",[`--${s?.tablet??s?.desktop}-tablet`]:r??"0px",[`--${s?.mobile??s?.tablet??s?.desktop}-mobile`]:r??"0px"}),[r,s?.desktop,s?.mobile,s?.tablet]),u=t=>"top"==t?"sticky":"fixed",f=l(()=>({"--pos":u(s?.desktop),"--pos-tablet":u(s?.tablet??s?.desktop),"--pos-mobile":u(s?.mobile??s?.tablet??s?.desktop)}),[s?.desktop,s?.mobile,s?.tablet]);return{w:b,displayStyle:c,positionStyle:f,getCSSAlign:m,makeDisplaySettingStyles:y}};export{p as default};
1
+ import{makeStyleResponsive as t,usePageStore as e,useCurrentDevice as o,useStickyStore as l}from"@gem-sdk/core";import{useState as b,useMemo as i,useEffect as s}from"react";let p=p=>{let{width:r,position:a}=p??{},{desktop:d,tablet:n,mobile:m}=p?.display||{},k=t("w",r),u=e(t=>"interaction"===t.sidebarMode),c=o(),[f,x]=b(!1),$=l(t=>t.getFirstVisibleElement(c)),g=(t,e)=>({[`--left${e}`]:"top"==t?"0":"50%",[`--t${e}`]:"top"==t?"unset":"translateX(-50%)"}),y=i(()=>({...g(a?.desktop,""),...g(a?.tablet??a?.desktop,"-tablet"),...g(a?.mobile??a?.tablet??a?.desktop,"-mobile")}),[a?.desktop,a?.mobile,a?.tablet]),v=i(()=>{if(u&&a?.[c]==="top")return"40px"},[c,u,a]),w=i(()=>{let t=t=>"after-first-cart-button"!==t||f?"block":"none";return{"--d":t(d),"--d-tablet":t(n??d),"--d-mobile":t(m??n??d)}},[d,n,m,f]),I=i(()=>({"--top":v??"auto","--top-tablet":v??"auto","--top-mobile":v??"auto",[`--${a?.desktop}`]:v??"0px",[`--${a?.tablet??a?.desktop}-tablet`]:v??"0px",[`--${a?.mobile??a?.tablet??a?.desktop}-mobile`]:v??"0px"}),[v,a?.desktop,a?.mobile,a?.tablet]),C=t=>"top"==t?"sticky":"fixed",E=i(()=>({"--pos":C(a?.desktop),"--pos-tablet":C(a?.tablet??a?.desktop),"--pos-mobile":C(a?.mobile??a?.tablet??a?.desktop)}),[a?.desktop,a?.mobile,a?.tablet]);return s(()=>{if(!$)return;let t=new IntersectionObserver(([t])=>{t&&x(t.isIntersecting||t.boundingClientRect.top<=0)});return t.observe($),()=>t.disconnect()},[$]),s(()=>{x(!1)},[c]),{w:k,displayStyle:I,positionStyle:E,getCSSAlign:y,makeDisplaySettingStyles:w}};export{p as default};