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

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 (216) hide show
  1. package/dist/cjs/builder.js +1 -1
  2. package/dist/cjs/carousel-v3/common/selectors.js +1 -0
  3. package/dist/cjs/carousel-v3/components/arrow/Arrow.liquid.js +8 -8
  4. package/dist/cjs/carousel-v3/components/arrow/common/classes.js +1 -1
  5. package/dist/cjs/carousel-v3/components/dot/common/helpers.js +1 -1
  6. package/dist/cjs/carousel-v3/components/item/CarouselItem.js +1 -1
  7. package/dist/cjs/carousel-v3/components/root/Carousel.js +1 -1
  8. package/dist/cjs/carousel-v3/components/root/Carousel.liquid.js +1 -1
  9. package/dist/cjs/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
  10. package/dist/cjs/carousel-v3/components/root/common/attrs.js +1 -1
  11. package/dist/cjs/carousel-v3/components/root/common/helpers.js +1 -1
  12. package/dist/cjs/carousel-v3/components/swiper/Swiper.js +1 -1
  13. package/dist/cjs/carousel-v3/hooks/useCarousel.js +1 -1
  14. package/dist/cjs/carousel-v3/index.js +1 -1
  15. package/dist/cjs/carousel-v3/settings/configs/ui-v2.js +1 -1
  16. package/dist/cjs/code/common/helpers.js +1 -0
  17. package/dist/cjs/code/hooks/useCSSCode.js +4 -10
  18. package/dist/cjs/estimate-delivery/common/helpers.js +1 -1
  19. package/dist/cjs/grid/components/row/Row.liquid.js +12 -12
  20. package/dist/cjs/hero-banner/common/classes.js +1 -1
  21. package/dist/cjs/hero-banner/components/HeroBanner.js +1 -1
  22. package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +10 -10
  23. package/dist/cjs/hero-banner/components/HeroBannerItem.js +1 -1
  24. package/dist/cjs/hero-banner/components/HeroBannerItem.liquid.js +9 -9
  25. package/dist/cjs/image/common/attrs.js +1 -1
  26. package/dist/cjs/image/components/AdaptiveImage.js +1 -1
  27. package/dist/cjs/image/components/AdaptiveImage.liquid.js +8 -8
  28. package/dist/cjs/image/components/Image.liquid.js +10 -10
  29. package/dist/cjs/image/components/NextImage.js +1 -1
  30. package/dist/cjs/image/components/NextImage.liquid.js +2 -2
  31. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +10 -10
  32. package/dist/cjs/index.js +1 -1
  33. package/dist/cjs/index.liquid.js +1 -1
  34. package/dist/cjs/post-purchase/link/components/PostPurchaseLink.js +1 -1
  35. package/dist/cjs/post-purchase/link/settings/configs/settings.js +1 -1
  36. package/dist/cjs/post-purchase/link/settings/configs/ui-v2.js +1 -1
  37. package/dist/cjs/post-purchase/product/components/ProductTitle.js +1 -1
  38. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
  39. package/dist/cjs/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
  40. package/dist/cjs/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
  41. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
  42. package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
  43. package/dist/cjs/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
  44. package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
  45. package/dist/cjs/product/components/product-badge/ProductBadge.liquid.js +12 -12
  46. package/dist/cjs/product/components/product-badge/common/classes.js +1 -1
  47. package/dist/cjs/product/components/product-badge/utils/renderBadgeILP.js +1 -1
  48. package/dist/cjs/product/components/product-badge/utils/renderBadgeLiquid.js +7 -5
  49. package/dist/cjs/product/components/product-button/ProductButton.liquid.js +11 -8
  50. package/dist/cjs/product/components/product-button/common/helpers.js +1 -1
  51. package/dist/cjs/product/components/product-button/hooks/useAddToCart.js +1 -1
  52. package/dist/cjs/product/components/product-description/ProductDescription.js +1 -1
  53. package/dist/cjs/product/components/product-description/ProductDescription.liquid.js +2 -3
  54. package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
  55. package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +15 -15
  56. package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
  57. package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
  58. package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
  59. package/dist/cjs/product/components/product-images-v3/ProductImageV3.js +2 -2
  60. package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +15 -15
  61. package/dist/cjs/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
  62. package/dist/cjs/product/components/product-images-v3/common/classes.js +1 -1
  63. package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
  64. package/dist/cjs/product/components/product-images-v3/common/getBorderActiveCss.js +3 -2
  65. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
  66. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageCarousel.js +1 -1
  67. package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
  68. package/dist/cjs/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -2
  69. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
  70. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +29 -29
  71. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
  72. package/dist/cjs/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
  73. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
  74. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +8 -8
  75. package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
  76. package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
  77. package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
  78. package/dist/cjs/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
  79. package/dist/cjs/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
  80. package/dist/cjs/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
  81. package/dist/cjs/product/components/product-list/ProductList.js +1 -1
  82. package/dist/cjs/product/components/product-list/ProductList.liquid.js +10 -9
  83. package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
  84. package/dist/cjs/product/components/product-list-v3/ProductList.liquid.js +10 -9
  85. package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +6 -6
  86. package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
  87. package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
  88. package/dist/cjs/product/components/product-wrap/Product.liquid.js +12 -9
  89. package/dist/cjs/product/index.js +1 -1
  90. package/dist/cjs/product/settings/product-image-v3/configs/ui-v2.js +1 -1
  91. package/dist/cjs/sticky/hooks/useSticky.js +1 -1
  92. package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
  93. package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
  94. package/dist/cjs/third-party/components/EcomsendBackInStockAlert.js +1 -1
  95. package/dist/cjs/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
  96. package/dist/cjs/third-party/configs/EcomsendBackInStockAlert.js +1 -1
  97. package/dist/cjs/third-party/index.js +1 -1
  98. package/dist/cjs/third-party/next.js +1 -1
  99. package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
  100. package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
  101. package/dist/cjs/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
  102. package/dist/cjs/video/components/HTML5Embed.js +1 -1
  103. package/dist/cjs/video/components/HTML5Embed.liquid.js +12 -12
  104. package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +13 -13
  105. package/dist/cjs/video/components/LiteYouTubeEmbed.js +1 -1
  106. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +11 -11
  107. package/dist/cjs/video/components/Video.liquid.js +1 -1
  108. package/dist/esm/builder.js +1 -1
  109. package/dist/esm/carousel-v3/common/selectors.js +1 -0
  110. package/dist/esm/carousel-v3/components/arrow/Arrow.liquid.js +6 -6
  111. package/dist/esm/carousel-v3/components/arrow/common/classes.js +1 -1
  112. package/dist/esm/carousel-v3/components/dot/common/helpers.js +1 -1
  113. package/dist/esm/carousel-v3/components/item/CarouselItem.js +1 -1
  114. package/dist/esm/carousel-v3/components/root/Carousel.js +1 -1
  115. package/dist/esm/carousel-v3/components/root/Carousel.liquid.js +4 -4
  116. package/dist/esm/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
  117. package/dist/esm/carousel-v3/components/root/common/attrs.js +1 -1
  118. package/dist/esm/carousel-v3/components/root/common/helpers.js +1 -1
  119. package/dist/esm/carousel-v3/components/swiper/Swiper.js +1 -1
  120. package/dist/esm/carousel-v3/hooks/useCarousel.js +1 -1
  121. package/dist/esm/carousel-v3/index.js +1 -1
  122. package/dist/esm/carousel-v3/settings/configs/ui-v2.js +1 -1
  123. package/dist/esm/code/common/helpers.js +1 -0
  124. package/dist/esm/code/hooks/useCSSCode.js +4 -10
  125. package/dist/esm/estimate-delivery/common/helpers.js +1 -1
  126. package/dist/esm/grid/components/row/Row.liquid.js +11 -11
  127. package/dist/esm/hero-banner/common/classes.js +1 -1
  128. package/dist/esm/hero-banner/components/HeroBanner.js +1 -1
  129. package/dist/esm/hero-banner/components/HeroBanner.liquid.js +10 -10
  130. package/dist/esm/hero-banner/components/HeroBannerItem.js +1 -1
  131. package/dist/esm/hero-banner/components/HeroBannerItem.liquid.js +10 -10
  132. package/dist/esm/image/common/attrs.js +1 -1
  133. package/dist/esm/image/components/AdaptiveImage.js +1 -1
  134. package/dist/esm/image/components/AdaptiveImage.liquid.js +11 -11
  135. package/dist/esm/image/components/Image.liquid.js +10 -10
  136. package/dist/esm/image/components/NextImage.js +1 -1
  137. package/dist/esm/image/components/NextImage.liquid.js +1 -1
  138. package/dist/esm/image-comparison/components/CompareImage.liquid.js +12 -12
  139. package/dist/esm/index.js +1 -1
  140. package/dist/esm/index.liquid.js +1 -1
  141. package/dist/esm/post-purchase/link/components/PostPurchaseLink.js +1 -1
  142. package/dist/esm/post-purchase/link/settings/configs/settings.js +1 -1
  143. package/dist/esm/post-purchase/link/settings/configs/ui-v2.js +1 -1
  144. package/dist/esm/post-purchase/product/components/ProductTitle.js +1 -1
  145. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
  146. package/dist/esm/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
  147. package/dist/esm/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
  148. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
  149. package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
  150. package/dist/esm/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
  151. package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
  152. package/dist/esm/product/components/product-badge/ProductBadge.liquid.js +12 -12
  153. package/dist/esm/product/components/product-badge/common/classes.js +1 -1
  154. package/dist/esm/product/components/product-badge/utils/renderBadgeILP.js +1 -1
  155. package/dist/esm/product/components/product-badge/utils/renderBadgeLiquid.js +5 -3
  156. package/dist/esm/product/components/product-button/ProductButton.liquid.js +11 -8
  157. package/dist/esm/product/components/product-button/common/helpers.js +1 -1
  158. package/dist/esm/product/components/product-button/hooks/useAddToCart.js +1 -1
  159. package/dist/esm/product/components/product-description/ProductDescription.js +1 -1
  160. package/dist/esm/product/components/product-description/ProductDescription.liquid.js +3 -4
  161. package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
  162. package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +15 -15
  163. package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
  164. package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
  165. package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
  166. package/dist/esm/product/components/product-images-v3/ProductImageV3.js +2 -2
  167. package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +15 -15
  168. package/dist/esm/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
  169. package/dist/esm/product/components/product-images-v3/common/classes.js +1 -1
  170. package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
  171. package/dist/esm/product/components/product-images-v3/common/getBorderActiveCss.js +1 -0
  172. package/dist/esm/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
  173. package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageCarousel.js +1 -1
  174. package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
  175. package/dist/esm/product/components/product-images-v3/components/child/ProductGalleryGrid.js +1 -2
  176. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
  177. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +45 -45
  178. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
  179. package/dist/esm/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
  180. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
  181. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +14 -14
  182. package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
  183. package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
  184. package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
  185. package/dist/esm/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
  186. package/dist/esm/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
  187. package/dist/esm/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
  188. package/dist/esm/product/components/product-list/ProductList.js +1 -1
  189. package/dist/esm/product/components/product-list/ProductList.liquid.js +18 -17
  190. package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
  191. package/dist/esm/product/components/product-list-v3/ProductList.liquid.js +18 -17
  192. package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +9 -9
  193. package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
  194. package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
  195. package/dist/esm/product/components/product-wrap/Product.liquid.js +16 -13
  196. package/dist/esm/product/index.js +1 -1
  197. package/dist/esm/product/settings/product-image-v3/configs/ui-v2.js +1 -1
  198. package/dist/esm/sticky/hooks/useSticky.js +1 -1
  199. package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
  200. package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
  201. package/dist/esm/third-party/components/EcomsendBackInStockAlert.js +1 -1
  202. package/dist/esm/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
  203. package/dist/esm/third-party/configs/EcomsendBackInStockAlert.js +1 -1
  204. package/dist/esm/third-party/index.js +1 -1
  205. package/dist/esm/third-party/next.js +1 -1
  206. package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
  207. package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
  208. package/dist/esm/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
  209. package/dist/esm/video/components/HTML5Embed.js +1 -1
  210. package/dist/esm/video/components/HTML5Embed.liquid.js +12 -12
  211. package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +14 -14
  212. package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
  213. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +10 -10
  214. package/dist/esm/video/components/Video.liquid.js +1 -1
  215. package/dist/types/index.d.ts +44 -14
  216. package/package.json +5 -5
@@ -0,0 +1,46 @@
1
+ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import i from"../../../../../image/components/NextImage.liquid.js";import{getGalleryCarouselShouldInitByLayout as o,getAspectRatio as r,getDisplayStyle as s,getSrcImage as a}from"../../common/common.js";import{getShapeByLayout as p,getMinHeightByPosition as l,getZoomDisplay as d,checkDisplayGalleryByWidth as m,getCarouselVerticalConfigByPosition as g}from"../../common/productGallery.js";import{getStyleOfObject as n}from"../../../../helpers/function.js";import{getProductImagesStyles as c}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as u}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as C}from"../../composables/getProductImagesAttr.js";import{LiquidIf as h,LiquidFor as y}from"@gem-sdk/system";import v from"../../../../../carousel-v3/components/root/CarouselEmbla.liquid.js";import b from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";let f=({builderPropUID:f,children:w,pageContext:L,...F})=>{let{featuredImageGalleryClasses:x,galleryItemClasses:$}=u(F),{galleryCarouselSettingAttrs:I}=C(F),{galleryCarouselStyle:_,galleryCarouselItemStyle:k}=c(F),j=p({shape:F.shape,shapeForBottom:F.shapeForBottom,shapeFor1Col:F.shapeFor1Col,shapeFor2Col:F.shapeFor2Col,shapeForFtOnly:F.shapeForFtOnly,shapeForInsideBottom:F.shapeForInsideBottom,shapeForInside:F.shapeForInside},F.position),V=(t,o)=>e`${i({srcIsLiquidCode:!0,src:`${a("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:t,baseSrc:"{{media.preview_image | image_url}}",style:o,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer",pageContext:L})}`,M=e=>`
2
+ ${h("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
+ ${h("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
+ ${h("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
+ ${b({id:"{{imageID}}",contentType:"productImage",className:`${$(`gp-gallery-image-item ${e??""}`)}`,parentId:`${f}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:k,children:`
6
+ <div class="gp-w-full gp-relative gp-h-full"
7
+
8
+ >
9
+ ${V({aspectRatio:r(j),layout:F?.layout,qualityPercent:F?.qualityPercent,qualityType:F?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
10
+
11
+ ${h("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
12
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
13
+ <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
14
+ <path d="M17.6869 12.2646L17.6868 12.2646L6.78379 18.4464C6.78378 18.4464 6.78376 18.4464 6.78374 18.4464C6.52931 18.5903 6.1665 18.4179 6.1665 18.0416V5.95844C6.1665 5.58218 6.52917 5.40981 6.7836 5.55354C6.78366 5.55357 6.78373 5.55361 6.78379 5.55365L17.6868 11.7354L17.6869 11.7354C17.8819 11.846 17.8819 12.154 17.6869 12.2646Z" stroke="#F9F9F9" stroke-miterlimit="10"/>
15
+ </svg>
16
+ </div>`)}
17
+ ${h("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
18
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
20
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7441 4.57034C11.9017 4.47655 12.098 4.47655 12.2555 4.57034L18.5889 8.33957C18.7404 8.42971 18.8332 8.59296 18.8332 8.76923V15.2308C18.8332 15.407 18.7404 15.5703 18.5889 15.6604L12.2555 19.4297C12.098 19.5234 11.9017 19.5234 11.7441 19.4297L5.41079 15.6604C5.25932 15.5703 5.1665 15.407 5.1665 15.2308V8.76923C5.1665 8.59296 5.25932 8.42971 5.41079 8.33957L11.7441 4.57034ZM6.1665 9.64865V14.9465L11.4998 18.1206V12.8227L6.1665 9.64865ZM12.4998 12.8227V18.1206L17.8332 14.9465V9.64865L12.4998 12.8227ZM17.3555 8.76923L11.9998 11.9566L6.64417 8.76923L11.9998 5.58185L17.3555 8.76923Z" fill="#F9F9F9"/>
21
+ </svg>
22
+ </div>`)}
23
+
24
+ <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
25
+ style="${n(d(F?.clickOpenLightBox))}"
26
+ >
27
+ <svg
28
+ height="100%"
29
+ width="100%"
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ class="gp-h-6 gp-w-6"
32
+ viewBox="0 0 512 512"
33
+ color="#fff"
34
+ ><path
35
+ fill="currentColor"
36
+ stroke-linecap="round"
37
+ stroke-linejoin="round"
38
+ d="M62.2467 345.253C43.7072 326.714 29.1474 305.116 18.9714 281.057C8.42839 256.13 3.08301 229.671 3.08301 202.418C3.08301 175.165 8.43012 148.707 18.974 123.78C29.15 99.7213 43.7098 78.123 62.2485 59.5834C80.788 41.0439 102.386 26.4841 126.445 16.3081C151.372 5.76422 177.831 0.417969 205.084 0.417969C232.337 0.417969 258.794 5.76421 283.722 16.3064C307.78 26.4823 329.379 41.0422 347.918 59.5817C366.458 78.1212 381.017 99.7196 391.194 123.778C401.737 148.706 407.083 175.163 407.083 202.417C407.083 229.671 401.737 256.129 391.194 281.056C388.406 287.648 385.277 294.048 381.839 300.257L493.397 411.815C514.091 432.511 514.091 466.187 493.395 486.883L484.272 496.006C474.245 506.032 460.915 511.553 446.738 511.553C432.559 511.553 419.228 506.032 409.202 496.006L296.022 382.824C291.996 384.854 287.898 386.762 283.721 388.528C258.794 399.073 232.336 404.419 205.082 404.419C177.828 404.419 151.371 399.071 126.443 388.528C102.385 378.352 80.7863 363.793 62.2467 345.253ZM301.699 336.166C313.928 327.317 324.896 316.835 334.282 305.034C342.149 295.142 348.9 284.325 354.355 272.775C364.433 251.432 370.076 227.586 370.076 202.419C370.076 111.296 296.206 37.4253 205.083 37.4253C113.96 37.4253 40.0895 111.294 40.0895 202.418C40.0895 293.541 113.96 367.411 205.084 367.411C227.413 367.411 248.701 362.967 268.126 354.928C280.091 349.976 291.347 343.658 301.699 336.166ZM467.229 460.716C473.507 454.439 473.507 444.26 467.229 437.982L360.595 331.348C356.601 336.153 352.378 340.794 347.919 345.253C341.671 351.502 335.068 357.286 328.147 362.615L435.371 469.839C438.511 472.977 442.624 474.547 446.739 474.547C450.853 474.547 454.967 472.978 458.106 469.839L467.229 460.716ZM223.582 183.91H281.071C291.292 183.91 299.574 192.194 299.575 202.414C299.575 206.778 298.062 210.786 295.533 213.951C292.143 218.195 286.926 220.916 281.072 220.916H228.303H223.583V225.63V278.406C223.583 287.081 217.613 294.358 209.559 296.361C208.124 296.717 206.625 296.909 205.08 296.909C194.861 296.909 186.577 288.625 186.577 278.406V220.917H129.087C118.868 220.917 110.584 212.633 110.584 202.414C110.584 192.195 118.868 183.911 129.087 183.911H186.576V126.421C186.576 116.202 194.86 107.918 205.079 107.918C215.298 107.918 223.582 116.202 223.582 126.421V183.91Z"
39
+ />
40
+ </svg>
41
+ </div>
42
+ </div>
43
+ `})}`,B=h("product.media.size > 1",y("media in product.media",`${h("media.media_type == 'image'",y("image in product.images",h("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
+ ${h("media.id == product.featured_media.id ",M(F?.borderActive?.border!=="none"?"active":""),M())}`));return e`
45
+ ${v({builderProps:{uid:f},rootId:`${f}-{{product.id}}`,rootClass:`${x}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=g(F.position),t=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${t.join(" ")}`})(),slidesClass:l(F.position,F.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:I,rootStyles:{...(()=>{let e=(e,i,o)=>{let r=t(i,o),s=t(e,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),p=["left","right","inside-left","inside-right"].includes(r??"");return p||a},i=m({shapeByLayout:j}),o={desktop:i.desktop&&e(F.type,F.position,"desktop"),tablet:i.tablet&&e(F.type,F.position,"tablet"),mobile:i.mobile&&e(F.type,F.position,"mobile")};return s(e=>!o[e],"flex")})()},styles:_,disableMarginAuto:!0,children:B,shouldInitByLayout:o(F.position),carouselType:"feature_image_thumbs"})}
46
+ `};export{f as default};
@@ -1,12 +1,12 @@
1
- import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cls as t}from"@gem-sdk/core";import{Liquid as o,LiquidFor as s,LiquidIf as d,If as r}from"@gem-sdk/system";import l from"../../../../../image/components/Modal3d.liquid.js";import m from"../../../../../image/components/NextImage.liquid.js";import p from"../../../../../image/components/Video.liquid.js";import n from"../../../../../video/components/HTML5Embed.liquid.js";import{getStyleOfObject as g}from"../../../../helpers/function.js";import{getAspectRatio as c,getSrcImage as u}from"../../common/common.js";import{getZoomImageClass as h,getZoomLenClass as y}from"../../common/productFeaturedImage.js";import{getShapeByLayout as C,getZoomDisplay as v}from"../../common/productGallery.js";import{getProductImagesClassName as f}from"../../composables/getProductImagesClassName.js";import{getProductImagesStyles as w}from"../../composables/getProductImagesStyles.js";let _=({builderPropUID:_,wrapperStyle:$,children:b,enableLazyLoadImage:x,...L})=>{let{galleryItemClasses:F,galleryGridWrapperClasses:V}=f(L),{galleryGridStyles:q,galleryGridItemStyles:I}=w(L),M=C({shape:L.shape,shapeForBottom:L.shapeForBottom,shapeFor1Col:L.shapeFor1Col,shapeFor2Col:L.shapeFor2Col,shapeForFtOnly:L.shapeForFtOnly,shapeForInsideBottom:L.shapeForInsideBottom,shapeForInside:L.shapeForInside},L.position),j=(i=!1)=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(e=>{let o=a(L?.position,e)||"",s="one-col"===o||"two-col"===o;t[e]=(i?!s:s)?"block":"none"}),e("d",t)},k=()=>j(),S=()=>j(!0),Z=(e,a)=>i`
2
- ${m({srcIsLiquidCode:!0,src:`${u("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",baseSrc:"{{media.preview_image | image_url}}",setting:e,style:a,className:"!gp-rounded-none",customLazyload:!1,enableLazyLoadImage:x})}
1
+ import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cls as t}from"@gem-sdk/core";import{Liquid as o,LiquidFor as s,LiquidIf as d,If as r}from"@gem-sdk/system";import l from"../../../../../image/components/Modal3d.liquid.js";import m from"../../../../../image/components/NextImage.liquid.js";import p from"../../../../../image/components/Video.liquid.js";import n from"../../../../../video/components/HTML5Embed.liquid.js";import{getStyleOfObject as g}from"../../../../helpers/function.js";import{getAspectRatio as c,getSrcImage as u}from"../../common/common.js";import{getZoomImageClass as h,getZoomLenClass as y}from"../../common/productFeaturedImage.js";import{getShapeByLayout as C,getZoomDisplay as v}from"../../common/productGallery.js";import{getProductImagesClassName as f}from"../../composables/getProductImagesClassName.js";import{getProductImagesStyles as w}from"../../composables/getProductImagesStyles.js";let _=({builderPropUID:_,wrapperStyle:$,children:b,pageContext:x,...L})=>{let{galleryItemClasses:F,galleryGridWrapperClasses:V}=f(L),{galleryGridStyles:q,galleryGridItemStyles:I}=w(L),M=C({shape:L.shape,shapeForBottom:L.shapeForBottom,shapeFor1Col:L.shapeFor1Col,shapeFor2Col:L.shapeFor2Col,shapeForFtOnly:L.shapeForFtOnly,shapeForInsideBottom:L.shapeForInsideBottom,shapeForInside:L.shapeForInside},L.position),j=(i=!1)=>{let t={desktop:"none",tablet:"none",mobile:"none"};return["desktop","mobile","tablet"].forEach(e=>{let o=a(L?.position,e)||"",s="one-col"===o||"two-col"===o;t[e]=(i?!s:s)?"block":"none"}),e("d",t)},k=()=>j(),S=()=>j(!0),Z=(e,a)=>i`
2
+ ${m({srcIsLiquidCode:!0,src:`${u("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",baseSrc:"{{media.preview_image | image_url}}",setting:e,style:a,className:"!gp-rounded-none",customLazyload:!1,pageContext:x})}
3
3
  ${r(L?.galleryHoverEffect!=="none",`<div class="${t("zoom-element !gp-max-w-none gp-w-full gp-h-full",h())}">
4
- ${m({srcIsLiquidCode:!0,src:`${u("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",baseSrc:"{{media.preview_image | image_url}}",alt:"{{media.alt | escape}}",setting:e,style:a,className:"!gp-rounded-none gp-w-full gp-h-full",customLazyload:!1,enableLazyLoadImage:x})}
4
+ ${m({srcIsLiquidCode:!0,src:`${u("media.preview_image")}`,width:"{{media.width}}",height:"{{media.height}}",baseSrc:"{{media.preview_image | image_url}}",alt:"{{media.alt | escape}}",setting:e,style:a,className:"!gp-rounded-none gp-w-full gp-h-full",customLazyload:!1,pageContext:x})}
5
5
  </div>`," ")}
6
6
  ${r(L?.galleryHoverEffect=="zoom"&&L?.galleryZoomType=="glasses",`<div class="${t("zoom-lens-element",y())}" style="opacity: 0; background-image: url('{{media.preview_image | product_img_url: '1024x1024'}}')">
7
7
  </div>
8
8
  `," ")}
9
- `,z=()=>l({src:d("media.sources.first.url contains '.glb'","{{ media.sources.first.url }}","{{media.sources.last.url}}"),alt:"{{media.preview_image.alt}}",poster:"{{media.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%",height:"100%"},aspectRatio:c(M)}),B=()=>p({src:"{{mediaSourceVideo}}",alt:"{{media.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"}}),H=()=>n({src:"{{mediaSourceVideo}}",title:"{{media.alt | escape}}",autoplay:!1,controls:!0,style:{width:"100%","max-height":"100%"}}),P=()=>i`
9
+ `,z=()=>l({src:d("media.sources.first.url contains '.glb'","{{ media.sources.first.url }}","{{media.sources.last.url}}"),alt:"{{media.preview_image.alt}}",poster:"{{media.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%",height:"100%"},aspectRatio:c(M)}),B=()=>p({src:"{{mediaSourceVideo}}",alt:"{{media.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"}}),H=()=>n({src:"{{mediaSourceVideo}}",title:"{{media.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{media.preview_image.src | product_img_url: '1024x1024'}}",poster:{altText:"{{media.alt | escape}}"},style:{width:"100%","max-height":"100%"},pageContext:x}),P=()=>i`
10
10
  ${d("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
11
11
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
12
12
  <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
@@ -39,7 +39,7 @@ import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cl
39
39
  />
40
40
  </svg>
41
41
  </div>
42
- `,N=i=>`
42
+ `,T=i=>`
43
43
  ${d("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
44
44
  ${d("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}{% assign mediaSource = media | json %}")}
45
45
  ${d("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
@@ -61,7 +61,7 @@ import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cl
61
61
  ${d("media.media_type == 'external_video' or media.media_type == 'video'","{% assign isVideo = true %}")}
62
62
 
63
63
  <div class="gp-w-full" style="${d("media == null or media.media_type == 'image'","display: block !important;")} ${d("isVideo == true",g({...S()}))}">
64
- ${d("media != null",P(),T())}
64
+ ${d("media != null",P(),N())}
65
65
  </div>
66
66
 
67
67
  <div class="${d("isMedia","gp-flex gp-justify-center gp-items-center")}"
@@ -80,14 +80,14 @@ import{makeStyleResponsive as e,template as i,getResponsiveValueByScreen as a,cl
80
80
  </div>
81
81
  {% assign isVideo= false %}
82
82
  {% assign isMedia= false %}
83
- </div>`,T=()=>i`
84
- ${m({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{aspectRatio:c(M),layout:L?.layout,qualityType:L?.qualityType,qualityPercent:L?.qualityPercent},className:"!gp-rounded-none",customLazyload:!1,enableLazyLoadImage:x})}`;return o(`
83
+ </div>`,N=()=>i`
84
+ ${m({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{aspectRatio:c(M),layout:L?.layout,qualityType:L?.qualityType,qualityPercent:L?.qualityPercent},className:"!gp-rounded-none",customLazyload:!1,pageContext:x})}`;return o(`
85
85
  <div type="grid-gallery"
86
86
  class="${V}"
87
87
  style="${g(q)}}"
88
88
  >
89
89
  ${s("media in product.media",`${d("media.media_type == 'image'",s("image in product.images",d("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
90
- ${d("media.id == product.featured_media.id ",N(L?.borderActive?.border!=="none"?"active":""),N())}`)}
90
+ ${d("media.id == product.featured_media.id ",T(L?.borderActive?.border!=="none"?"active":""),T())}`)}
91
91
  ${d("product.media.size > 0",b)}
92
- ${d("product.media.size < 1",N())}
92
+ ${d("product.media.size < 1",T())}
93
93
  </div>`)};export{_ as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useFeaturedImageGlobal as i,useEditorMode as l,cls as s}from"@gem-sdk/core";import d from"../../../../../carousel-v3/components/root/Carousel.js";import n from"../../../../../carousel-v3/components/item/CarouselItem.js";import r from"../../../../../image/components/NextImage.js";import"../../../../../modal/components/confirm.js";import p from"../../../../../modal/components/Modal.js";import{useMemo as m}from"react";import{isFeatureMedia as a}from"../../common/productFeaturedImage.js";import c from"../child/ProductFeatureVideo.js";import g from"../child/MediaIcon.js";let h=({builderPropUID:h,productImages:u,open:b,imageRatio:f,onHandleClose:k})=>{let y=i(),E=m(()=>{let e=u?.findIndex(e=>e.id===y?.id);return e&&e>0?e:0},[u,y]),I={desktop:u&&u.length>1,mobile:u&&u?.length>1,tablet:u&&u?.length>1},j=l(),C=e=>"edit"!==j&&["VIDEO","EXTERNAL_VIDEO"].includes(e?.contentType||"");return e(p,{setting:{open:b},styles:{width:"80%"},closeOnClickOutside:!0,onClose:()=>{k(),console.log("onHandleClose")},disableIframeClickEvent:!0,contentClass:"mobile:!gp-w-[100%] gp-px-2 gp-pb-10",children:e(d,{setting:{loop:{desktop:!1,mobile:!1,tablet:!1},slidesToShow:{desktop:1,tablet:1,mobile:1},defaultCurrentSlider:E,dot:{desktop:!0,mobile:!0,tablet:!0},dotStyle:{desktop:"outside",mobile:"outside",tablet:"outside"},dotColor:{desktop:"#E2E2E2",mobile:"#E2E2E2",tablet:"#E2E2E2"},dotActiveColor:{desktop:"#121212",mobile:"#121212",tablet:"#121212"},dotSize:{desktop:12},dotGapToCarousel:{desktop:12},navigationEnable:I,navigationStyle:{desktop:"outside"},arrowIconSize:{desktop:24},initialSlide:E},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}},playSpeed:0},moveToIdx:E,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,isDisableResetSlide:!0,builderProps:{uid:h},fullHeight:!0,children:u?.map(i=>e(n,{className:`gem-slider-item gem-slider-item-${h} gp-flex gp-items-center gp-justify-center gp-px-4`,children:C(i)?e(c,{type:i?.contentType,url:i.src??"",aspectRatio:f}):t(o,{children:[e(r,{src:a(i?.contentType)?i?.previewImage:i?.src,width:i?.width,height:i?.height,alt:i?.alt,"content-type":i?.contentType,setting:{aspectRatio:f},className:s("gp-h-full gp-w-full gp-object-contain")},i?.id),e(g,{contentType:i?.contentType??""})]})},i?.id))})})};export{h as default};
2
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{useFeaturedImageGlobal as i,useEditorMode as l,cls as s}from"@gem-sdk/core";import d from"../../../../../carousel-v3/components/root/Carousel.js";import n from"../../../../../carousel-v3/components/item/CarouselItem.js";import r from"../../../../../image/components/NextImage.js";import"../../../../../modal/components/confirm.js";import p from"../../../../../modal/components/Modal.js";import{useMemo as m}from"react";import{isFeatureMedia as a}from"../../common/productFeaturedImage.js";import c from"../child/ProductFeatureVideo.js";import g from"../child/MediaIcon.js";let h=({builderPropUID:h,productImages:u,open:b,imageRatio:f,onHandleClose:k})=>{let y=i(),E=m(()=>{let e=u?.findIndex(e=>e.id===y?.id);return e&&e>0?e:0},[u,y]),I={desktop:u&&u.length>1,mobile:u&&u?.length>1,tablet:u&&u?.length>1},j=l(),v=e=>"edit"!==j&&["VIDEO","EXTERNAL_VIDEO"].includes(e?.contentType||"");return e(p,{setting:{open:b},styles:{width:"80%"},closeOnClickOutside:!0,onClose:()=>{k(),console.log("onHandleClose")},disableIframeClickEvent:!0,contentClass:"mobile:!gp-w-[100%] gp-px-2 gp-pb-10",children:e(d,{setting:{loop:{desktop:!1,mobile:!1,tablet:!1},slidesToShow:{desktop:1,tablet:1,mobile:1},defaultCurrentSlider:E,dot:{desktop:!0,mobile:!0,tablet:!0},dotStyle:{desktop:"outside",mobile:"outside",tablet:"outside"},dotColor:{desktop:"#E2E2E2",mobile:"#E2E2E2",tablet:"#E2E2E2"},dotActiveColor:{desktop:"#121212",mobile:"#121212",tablet:"#121212"},dotSize:{desktop:12},dotGapToCarousel:{desktop:12},navigationEnable:I,navigationStyle:{desktop:"outside"},arrowIconSize:{desktop:24},initialSlide:E},styles:{sizeSetting:{desktop:{height:"80vh"},tablet:{height:"80vh"},mobile:{height:"60vh"}},playSpeed:0},moveToIdx:E,hiddenDotWhenOnlyOne:!0,isHiddenArrowWhenDisabled:!0,isDisableResetSlide:!0,builderProps:{uid:h},fullHeight:!0,children:u?.map(i=>e(n,{className:`gem-slider-item gem-slider-item-${h} gp-flex gp-items-center gp-justify-center gp-px-4`,children:v(i)?e(c,{type:i?.contentType,url:i.src??"",thumbnail:i?.previewImage,aspectRatio:f}):t(o,{children:[e(r,{src:a(i?.contentType)?i?.previewImage:i?.src,width:i?.width,height:i?.height,alt:i?.alt,"content-type":i?.contentType,setting:{aspectRatio:f},className:s("gp-h-full gp-w-full gp-object-contain")},i?.id),e(g,{contentType:i?.contentType??""})]})},i?.id))})})};export{h as default};
@@ -1 +1 @@
1
- import{useCurrentDevice as e,useFeaturedImageGlobal as r,useEditorMode as t,getResponsiveValueByScreen as o}from"@gem-sdk/core";import{useState as i,useRef as a,useEffect as s,useMemo as l,useCallback as n}from"react";import{useFilterImagesByVariant as p}from"./useFilterImagesByVariant.js";import{handleSetSrcForProductImageList as m}from"../../../../image/common/helpers.js";import{getShapeByLayout as d,checkDisplayGalleryByWidth as c}from"../common/productGallery.js";let u=u=>{let{builderPropUID:h,productImages:F,onHandleClick:y,activeIndexFormFeatureImage:B,onClickFeatureArrow:f,builderPropsClass:I,arrow:C,priorityFeatureImage:g,...q}=u,T=e(),b=r(),[v,O]=i(f||""),x=t(),[k,j]=i(0),P=a(),[S,V]=i(k),[A,G]=i(!1),{filteredProductImages:L}=p({productImages:F,displayByVariant:q?.displayByVariant,variantSelect:q?.variantSelect});s(()=>{O(f||"")},[f]),s(()=>{P.current&&clearTimeout(P.current),v&&(P.current=setTimeout(()=>{j(B||0),O("")}))},[B]),s(()=>{if(g){let e=L?.findIndex(e=>e.id===g.id)||0;j(e),O("")}},[g,L]),s(()=>{let e=L?.findIndex(e=>e.id===b?.id);j(e||0),O("")},[b,L]);let w=l(()=>d({shape:q.shape,shapeForBottom:q.shapeForBottom,shapeFor1Col:q.shapeFor1Col,shapeFor2Col:q.shapeFor2Col,shapeForFtOnly:q.shapeForFtOnly,shapeForInsideBottom:q.shapeForInsideBottom,shapeForInside:q.shapeForInside},q.position),[q.shape,q.shapeForBottom,q.shapeFor1Col,q.shapeFor2Col,q.shapeForFtOnly,q.position,q.shapeForInsideBottom,q.shapeForInside]),z=n(()=>{m({builderPropUID:h,shapeByLayout:w,qualityType:q.qualityType,qualityPercent:q.qualityPercent})},[w,q.qualityPercent,q.qualityType,h]);s(()=>{if("edit"===x)return;let e=document?.querySelector(`.gem-slider-item-${h} .product-list-image`);if(!e)return;z();let r=new ResizeObserver(()=>{z()});return r?.observe(e,{}),()=>{r?.disconnect()}},[z,h,x]);let R=o(q.clickOpenLightBox,T),$=l(()=>{let e=c({shapeByLayout:w});return o(e,T)},[w,T]),D=l(()=>q?.borderActive?.border!=="none",[q?.borderActive?.border]),E=o(q?.clickOpenLightBox,T);return s(()=>{let e;return L&&L.length>0&&A&&(e=setTimeout(()=>{V(k)},80)),()=>{e&&clearTimeout(e)}},[k,L,A]),{moveToIdx:k,isDisplay:$,shapeByLayout:w,isEnableBorderActive:D,isShowButtonLightbox:E,filteredProductImages:L,handleClickCarouselItem:e=>{y&&y(e||"",R)},setSliderReady:G,safeMoveToIdx:S}};export{u as useGalleryCarousel};
1
+ import{useCurrentDevice as e,useFeaturedImageGlobal as r,useEditorMode as t,getResponsiveValueByScreen as o}from"@gem-sdk/core";import{useState as i,useRef as a,useEffect as s,useMemo as l,useCallback as n}from"react";import{useFilterImagesByVariant as p}from"./useFilterImagesByVariant.js";import{handleSetSrcForProductImageList as m}from"../../../../image/common/helpers.js";import{getShapeByLayout as d,checkDisplayGalleryByWidth as c}from"../common/productGallery.js";let u=e=>void 0!==e&&e>=0?e:0,h=h=>{let{builderPropUID:F,productImages:y,onHandleClick:B,activeIndexFormFeatureImage:f,onClickFeatureArrow:I,builderPropsClass:C,arrow:g,priorityFeatureImage:v,...q}=h,T=e(),b=r(),[O,x]=i(I||""),k=t(),[j,P]=i(0),S=a(),[V,A]=i(j),[G,L]=i(!1),{filteredProductImages:w}=p({productImages:y,displayByVariant:q?.displayByVariant,variantSelect:q?.variantSelect});s(()=>{x(I||"")},[I]),s(()=>{S.current&&clearTimeout(S.current),O&&(S.current=setTimeout(()=>{void 0!==f&&P(f),x("")}))},[f]),s(()=>{if(v){let e=w?.findIndex(e=>e.id===v.id);P(u(e)),x("")}},[v,w]),s(()=>{let e=w?.findIndex(e=>e.id===b?.id);P(u(e)),x("")},[b,w]);let z=l(()=>d({shape:q.shape,shapeForBottom:q.shapeForBottom,shapeFor1Col:q.shapeFor1Col,shapeFor2Col:q.shapeFor2Col,shapeForFtOnly:q.shapeForFtOnly,shapeForInsideBottom:q.shapeForInsideBottom,shapeForInside:q.shapeForInside},q.position),[q.shape,q.shapeForBottom,q.shapeFor1Col,q.shapeFor2Col,q.shapeForFtOnly,q.position,q.shapeForInsideBottom,q.shapeForInside]),R=n(()=>{m({builderPropUID:F,shapeByLayout:z,qualityType:q.qualityType,qualityPercent:q.qualityPercent})},[z,q.qualityPercent,q.qualityType,F]);s(()=>{if("edit"===k)return;let e=document?.querySelector(`.gem-slider-item-${F} .product-list-image`);if(!e)return;R();let r=new ResizeObserver(()=>{R()});return r?.observe(e,{}),()=>{r?.disconnect()}},[R,F,k]);let $=o(q.clickOpenLightBox,T),D=l(()=>{let e=c({shapeByLayout:z});return o(e,T)},[z,T]),E=l(()=>q?.borderActive?.border!=="none",[q?.borderActive?.border]),H=o(q?.clickOpenLightBox,T);return s(()=>{let e;return w&&w.length>0&&G&&(e=setTimeout(()=>{A(j)},80)),()=>{e&&clearTimeout(e)}},[j,w,G]),{moveToIdx:j,isDisplay:D,shapeByLayout:z,isEnableBorderActive:E,isShowButtonLightbox:H,filteredProductImages:w,handleClickCarouselItem:e=>{B&&B(e||"",$)},setSliderReady:L,safeMoveToIdx:V}};export{h as useGalleryCarousel};
@@ -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};