@gem-sdk/components 24.1.0 → 25.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/article/components/ArticleList.js +1 -1
  2. package/dist/cjs/button/common/helpers.js +2 -2
  3. package/dist/cjs/common/components/Loading.js +1 -1
  4. package/dist/cjs/common/const.js +1 -1
  5. package/dist/cjs/common/helpers.js +1 -0
  6. package/dist/cjs/common/hooks/useElementWidth.js +1 -0
  7. package/dist/cjs/common/hooks/useLoadingProgress.js +1 -0
  8. package/dist/cjs/grid/components/section/Section.js +1 -1
  9. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
  10. package/dist/cjs/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
  11. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
  12. package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
  13. package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
  14. package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +15 -15
  15. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +21 -21
  16. package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +18 -18
  17. package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +1 -1
  18. package/dist/cjs/product/components/product-list/ProductList.js +1 -1
  19. package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
  20. package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
  21. package/dist/cjs/product/components/product-wrap/Product.js +1 -1
  22. package/dist/cjs/product/components/product-wrap/hook/useProductSetting.js +1 -1
  23. package/dist/cjs/video/common/attrs.js +1 -1
  24. package/dist/cjs/video/components/HTML5Embed.liquid.js +9 -9
  25. package/dist/esm/article/components/ArticleList.js +1 -1
  26. package/dist/esm/button/common/helpers.js +2 -2
  27. package/dist/esm/common/components/Loading.js +1 -1
  28. package/dist/esm/common/const.js +1 -1
  29. package/dist/esm/common/helpers.js +1 -0
  30. package/dist/esm/common/hooks/useElementWidth.js +1 -0
  31. package/dist/esm/common/hooks/useLoadingProgress.js +1 -0
  32. package/dist/esm/grid/components/section/Section.js +1 -1
  33. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
  34. package/dist/esm/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
  35. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
  36. package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
  37. package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
  38. package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +26 -26
  39. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +14 -14
  40. package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +14 -14
  41. package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +4 -4
  42. package/dist/esm/product/components/product-list/ProductList.js +1 -1
  43. package/dist/esm/product/components/product-list/common/helpers.js +1 -1
  44. package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
  45. package/dist/esm/product/components/product-wrap/Product.js +1 -1
  46. package/dist/esm/product/components/product-wrap/hook/useProductSetting.js +1 -1
  47. package/dist/esm/video/common/attrs.js +1 -1
  48. package/dist/esm/video/components/HTML5Embed.liquid.js +10 -10
  49. package/package.json +6 -6
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/const.js"),r=require("@gem-sdk/core"),o=require("react"),s=require("../../../common/components/Loading.js"),i=require("next/dynamic"),l=require("./hooks/useRelatedProductIDAssigned.js"),d=require("../SalePageProductListWarning.js"),u=require("../../../dialog/common/helpers.js"),c=require("./hooks/useProductRelatedQuery.js"),n=require("./ProductListCarouselLayout.js"),a=require("./constants/index.js"),g=require("./hooks/useCollectionQuery.js"),m=require("./hooks/useProductsQuery.js"),P=require("./ProductListGridLayout.js"),C=require("./common/classes.js"),h=require("./common/helpers.js"),T=require("./common/styles.js"),S=require("@gem-sdk/system"),O=require("next/head");const _=i(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:s.default});exports.default=i=>{let{children:p,styles:f,builderProps:R,setting:U,builderAttrs:j}=i,{isRelatedProduct:y,productSetting:D}=h.getData(i),{isEditMode:I,isPreviewSharePageMode:L}=r.useRenderMode(),k=r.useCurrentDevice(),x=r.usePageType(),q=r.usePageStore(e=>e.dynamicCollection),[E,b]=o.useState(1),[v,N]=o.useState(!0),w=o.useRef(),M="GP_FUNNEL_PAGE"===x;"GP_COLLECTION"!=x||[t.PRODUCT_LIST_PRODUCT_SOURCE.Collection,t.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection].includes(D?.productSrc)||(D.productSrc=t.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection);let A=D?.productSrc??t.PRODUCT_LIST_PRODUCT_SOURCE.Collection;A===t.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection&&(D.collectionId=q?.collectionId||"latest");let G=Number.isNaN(Number(U?.numberOfProducts))?a.DEFAULT_COLLECTION_NUMBER_OF_PRODUCTS:Number(U?.numberOfProducts),{relatedProductIdAssigned:B}=l.default({productSetting:D}),{isNotFoundRelatedProduct:F,relatedProducts:H,isNoRelatedProductData:Q,relatedTagString:z,isLoading:W}=c.default({productSetting:D,isRelatedProduct:y,relatedProductIdAssigned:B,numberOfProducts:G}),$=I||L,V=m.useProductsQuery({productIds:D?.productIds,defaultSelectedProductCount:D?.numOfSelectedProducts,productSrc:A,selectedStatus:$&&D?.productIds?.length?r.PICKED_PRODUCT_STATUSES:void 0}),K=g.useCollectionQuery({productSrc:A,collectionID:D?.collectionId??"latest",numberOfProducts:G,orderBy:U?.orderBy}),J=W||(A===t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?V.isLoading:K.isLoading),X=A===t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?V.error:K.error,Y=A===t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?V.isValidating:K.isValidating,Z=K.data?.collections?.edges?.[0]?.node,ee=A===t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?r.flattenConnection(V.data?.products):r.flattenConnection(Z?.products),et=r.usePageStore(e=>e.assignedProductIds),er=r.usePageStore(e=>e.isApplyAllProducts),eo=o.useMemo(()=>(et??[]).length>0&&!er||er,[et,er]),es=H?.data?.products&&eo?r.flattenConnection(H?.data?.products):[],ei=y?es:A===t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct&&D?.productIds?.length?D?.productIds?.map(e=>ee?.find(t=>t?.baseID===e)).filter(Boolean)??ee:A!==t.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?ee:ee.filter((e,t)=>t<(D?.numOfSelectedProducts??4)),el=o.useMemo(()=>F&&y&&I||!ei.length&&!J&&v&&I,[v,J,F,y,I,ei.length]),ed=o.useMemo(()=>!ei||F&&y,[F,y,ei]),eu=o.useMemo(()=>{if(!U?.sameHeight)return[];let e=0,t=Math.ceil((ei?.length??0)/+(U?.slidesToShow?.[k]??1));return Array.from(Array(ei?.length??0)).map((r,o)=>(o>=+(U?.slidesToShow?.[k]??1)*(e+1)&&++e,{gridRow:`${1+E*e}/${E+1+E*e}`,marginBottom:e+1<t?u.getPropertyByDevice(f?.horizontalGutter,k):void 0}))},[U?.sameHeight,U?.slidesToShow,E,ei?.length,k,f?.horizontalGutter]),ec=o.useMemo(()=>Y||J||X||!ei||F&&y,[X,J,F,y,Y,ei]);o.useEffect(()=>{if(!ec)return w.current=setTimeout(()=>{let{builderData:e}=R??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&b(r.childElementCount||1)},I?0:500),()=>{clearTimeout(w.current)}},[R,ec,I,ei]);let en=o.useMemo(()=>({collection:Z,products:ei,settings:{loop:U?.loop??{desktop:!1},scrollMode:U?.scrollMode??{desktop:"snap"},slidesToShow:U?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:f?.layout,dot:U?.dot,dotStyle:U?.dotStyle,arrow:U?.arrow,controlOverContent:U?.controlOverContent,sameHeight:U?.sameHeight},styles:{horizontalGutter:f?.horizontalGutter,verticalGutter:f?.verticalGutter,fullWidth:f?.fullWidth,spacing:f?.spacing,width:f?.width,height:f?.height}}),[Z,ei,U,f]);if(R?.isPreview&&M)return e.jsx(e.Fragment,{});if(el)return e.jsx(e.Fragment,{children:S.If(v,e.jsx(_,{builderAttrs:j,collectionHandle:Z?.handle,productSrc:A,onClose:()=>N(!1),children:p,relatedTagString:z,assignProductNoTags:Q,noAssignedProduct:!B}))});let{productListWrapStyle:ea,productListContentStyle:eg,productListWrapAlignStyle:em}=T.getStyle(i),{productListWrapClass:eP}=C.getClass(i);return e.jsxs("div",{...j,className:eP,style:ea,children:[!!f?.preloadBgImage&&e.jsxs(O,{children:[!!f.backgroundImage?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage.desktop.image.src,as:"image"}),!!f.backgroundImage?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage?.tablet?.image?.src,as:"image"}),!!f.backgroundImage?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:f.backgroundImage?.mobile?.image?.src,as:"image"})]}),J||Y?e.jsx(s.default,{}):X?e.jsxs("div",{children:["Error: ",X?.message]}):ed?e.jsx("div",{children:"Products not found"}):e.jsx(r.ProductListProvider,{...en,children:e.jsx("div",{className:"gp-flex gp-w-full",style:em,children:e.jsxs("div",{style:eg,children:[M&&e.jsx(d.default,{}),e.jsx(e.Fragment,{children:S.If(f?.layout==="grid",e.jsx(P.default,{...i,productSortedById:ei,generateGridRowArray:eu}),e.jsx(n.default,{...i,productSortedById:ei}))})]})})}),r.filterToolbarPreview(p,!0)]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../common/helpers.js"),r=require("../../../common/const.js"),o=require("@gem-sdk/core"),s=require("react"),l=require("../../../common/components/Loading.js"),i=require("next/dynamic"),d=require("./hooks/useRelatedProductIDAssigned.js"),u=require("../SalePageProductListWarning.js"),a=require("../../../dialog/common/helpers.js"),n=require("./hooks/useProductRelatedQuery.js"),c=require("./ProductListCarouselLayout.js"),g=require("./constants/index.js"),m=require("./hooks/useCollectionQuery.js"),P=require("./hooks/useProductsQuery.js"),C=require("./ProductListGridLayout.js"),h=require("./common/classes.js"),T=require("./common/helpers.js"),S=require("./common/styles.js"),O=require("@gem-sdk/system"),p=require("next/head");const _=i(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:l.default});exports.default=i=>{let{children:f,styles:R,builderProps:U,setting:y,builderAttrs:D}=i,{isRelatedProduct:j,productSetting:I}=T.getData(i),{isEditMode:L,isPreviewSharePageMode:b}=o.useRenderMode(),x=o.useCurrentDevice(),k=o.usePageType(),q=o.usePageStore(e=>e.dynamicCollection),[E,v]=s.useState(1),[N,w]=s.useState(!0),M=s.useRef(),A="GP_FUNNEL_PAGE"===k;"GP_COLLECTION"!=k||[r.PRODUCT_LIST_PRODUCT_SOURCE.Collection,r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection].includes(I?.productSrc)||(I.productSrc=r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection);let G=I?.productSrc??r.PRODUCT_LIST_PRODUCT_SOURCE.Collection;G===r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection&&(I.collectionId=q?.collectionId||"latest");let B=Number.isNaN(Number(y?.numberOfProducts))?g.DEFAULT_COLLECTION_NUMBER_OF_PRODUCTS:Number(y?.numberOfProducts),{relatedProductIdAssigned:F}=d.default({productSetting:I}),{isNotFoundRelatedProduct:Q,relatedProducts:H,isNoRelatedProductData:z,relatedTagString:W,isLoading:$}=n.default({productSetting:I,isRelatedProduct:j,relatedProductIdAssigned:F,numberOfProducts:B}),K=L||b,V=P.useProductsQuery({productIds:I?.productIds,defaultSelectedProductCount:I?.numOfSelectedProducts,productSrc:G,selectedStatus:K&&I?.productIds?.length?o.PICKED_PRODUCT_STATUSES:void 0}),J=m.useCollectionQuery({productSrc:G,collectionID:I?.collectionId??"latest",numberOfProducts:B,orderBy:y?.orderBy}),X=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct,Y=X?V:J,Z=X?!!I?.productIds:G===r.PRODUCT_LIST_PRODUCT_SOURCE.Collection||G===r.PRODUCT_LIST_PRODUCT_SOURCE.DynamicCollection,ee=$||t.isQueryLoading({hasQuery:Z,data:Y.data,error:Y.error,isLoading:Y.isLoading}),et=Y.error,er=Y.isValidating,eo=J.data?.collections?.edges?.[0]?.node,es=G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?o.flattenConnection(V.data?.products):o.flattenConnection(eo?.products),el=o.usePageStore(e=>e.assignedProductIds),ei=o.usePageStore(e=>e.isApplyAllProducts),ed=s.useMemo(()=>(el??[]).length>0&&!ei||ei,[el,ei]),eu=H?.data?.products&&ed?o.flattenConnection(H?.data?.products):[],ea=j?eu:G===r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct&&I?.productIds?.length?I?.productIds?.map(e=>es?.find(t=>t?.baseID===e)).filter(Boolean)??es:G!==r.PRODUCT_LIST_PRODUCT_SOURCE.PickProduct?es:es.filter((e,t)=>t<(I?.numOfSelectedProducts??4)),en=s.useMemo(()=>Q&&j&&L||!ea.length&&!ee&&N&&L,[N,ee,Q,j,L,ea.length]),ec=s.useMemo(()=>!ea||Q&&j,[Q,j,ea]),eg=s.useMemo(()=>{if(!y?.sameHeight)return[];let e=0,t=Math.ceil((ea?.length??0)/+(y?.slidesToShow?.[x]??1));return Array.from(Array(ea?.length??0)).map((r,o)=>(o>=+(y?.slidesToShow?.[x]??1)*(e+1)&&++e,{gridRow:`${1+E*e}/${E+1+E*e}`,marginBottom:e+1<t?a.getPropertyByDevice(R?.horizontalGutter,x):void 0}))},[y?.sameHeight,y?.slidesToShow,E,ea?.length,x,R?.horizontalGutter]),em=s.useMemo(()=>er||ee||et||!ea||Q&&j,[et,ee,Q,j,er,ea]);s.useEffect(()=>{if(!em)return M.current=setTimeout(()=>{let{builderData:e}=U??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&v(r.childElementCount||1)},L?0:500),()=>{clearTimeout(M.current)}},[U,em,L,ea]);let eP=s.useMemo(()=>({collection:eo,products:ea,settings:{loop:y?.loop??{desktop:!1},scrollMode:y?.scrollMode??{desktop:"snap"},slidesToShow:y?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:R?.layout,dot:y?.dot,dotStyle:y?.dotStyle,arrow:y?.arrow,controlOverContent:y?.controlOverContent,sameHeight:y?.sameHeight},styles:{horizontalGutter:R?.horizontalGutter,verticalGutter:R?.verticalGutter,fullWidth:R?.fullWidth,spacing:R?.spacing,width:R?.width,height:R?.height}}),[eo,ea,y,R]);if(U?.isPreview&&A)return e.jsx(e.Fragment,{});if(en)return e.jsx(e.Fragment,{children:O.If(N,e.jsx(_,{builderAttrs:D,collectionHandle:eo?.handle,productSrc:G,onClose:()=>w(!1),children:f,relatedTagString:W,assignProductNoTags:z,noAssignedProduct:!F}))});let{productListWrapStyle:eC,productListContentStyle:eh,productListWrapAlignStyle:eT}=S.getStyle(i),{productListWrapClass:eS}=h.getClass(i);return e.jsxs("div",{...D,className:eS,style:eC,children:[!!R?.preloadBgImage&&e.jsxs(p,{children:[!!R.backgroundImage?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage.desktop.image.src,as:"image"}),!!R.backgroundImage?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage?.tablet?.image?.src,as:"image"}),!!R.backgroundImage?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:R.backgroundImage?.mobile?.image?.src,as:"image"})]}),ee||er?e.jsx(l.default,{label:t.getElementLabel({builderData:U?.builderData})}):et?e.jsxs("div",{children:["Error: ",et?.message]}):ec?e.jsx("div",{children:"Products not found"}):e.jsx(o.ProductListProvider,{...eP,children:e.jsx("div",{className:"gp-flex gp-w-full",style:eT,children:e.jsxs("div",{style:eh,children:[A&&e.jsx(u.default,{}),e.jsx(e.Fragment,{children:O.If(R?.layout==="grid",e.jsx(C.default,{...i,productSortedById:ea,generateGridRowArray:eg}),e.jsx(c.default,{...i,productSortedById:ea}))})]})})}),o.filterToolbarPreview(f,!0)]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),t=require("../../../grid/components/ChildrenDroppable.js"),s=require("./hook/useProductSetting.js"),i=require("./common/helpers.js");require("../../../common/const.js"),require("react");var o=require("../../../common/components/Loading.js"),d=require("@gem-sdk/system"),n=require("../../../grid/components/row/Row.js"),u=require("next/dynamic");const c=u(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:o.default});exports.default=u=>{let{builderProps:l,children:a,setting:m,style:j,builderAttrs:g}=u,{isAuto:h}=m??{},{isLoading:p,isProductPage:x,isProductNotFound:q,showProductNotFound:f,errorLoadProduct:P,product:y,isEditor:v,productProviderData:b,setShowProductNotFound:F}=s.useProductSetting(u),{rowSetting:k,rowStyles:C}=i.getData(u);return x&&h?e.jsx(e.Fragment,{children:r.isEmptyChildren(a)?e.jsx(t.default,{}):a}):e.jsx(e.Fragment,{children:d.If(!q,e.jsx(e.Fragment,{children:p?e.jsx(o.default,{}):e.jsx(e.Fragment,{children:P?e.jsxs("div",{children:["Error: ",P?.message]}):y?e.jsx(r.ProductProvider,{...b,children:e.jsx(n.default,{builderProps:l,builderAttrs:g,style:j,styles:C,setting:k,customAttrs:v?{"data-product-id":y?.baseID?.replace("gid://shopify/Product/","")??""}:void 0,children:r.isEmptyChildren(a)?e.jsx(t.default,{}):a})}):null})}),e.jsx(e.Fragment,{children:d.If(f,e.jsx(c,{builderAttrs:g,productSrc:"PickProduct",onClose:()=>F(!1),children:a}))}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),t=require("../../../grid/components/ChildrenDroppable.js"),s=require("./hook/useProductSetting.js"),i=require("../../../common/helpers.js");require("../../../common/const.js"),require("react");var o=require("../../../common/components/Loading.js"),d=require("./common/helpers.js"),n=require("@gem-sdk/system"),u=require("../../../grid/components/row/Row.js"),l=require("next/dynamic");const c=l(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:o.default});exports.default=l=>{let{builderProps:a,children:m,setting:j,style:g,builderAttrs:h}=l,{isAuto:p}=j??{},{isLoadingProduct:x,isProductPage:q,isProductNotFound:f,showProductNotFound:P,errorLoadProduct:b,product:y,isEditor:v,productProviderData:F,setShowProductNotFound:D}=s.useProductSetting(l),{rowSetting:k,rowStyles:C}=d.getData(l);return q&&p?e.jsx(e.Fragment,{children:r.isEmptyChildren(m)?e.jsx(t.default,{}):m}):e.jsx(e.Fragment,{children:n.If(!f,e.jsx(e.Fragment,{children:x?e.jsx(o.default,{label:i.getElementLabel({builderData:a?.builderData})}):e.jsx(e.Fragment,{children:b?e.jsxs("div",{children:["Error: ",b?.message]}):y?e.jsx(r.ProductProvider,{...F,children:e.jsx(u.default,{builderProps:a,builderAttrs:h,style:g,styles:C,setting:k,customAttrs:v?{"data-product-id":y?.baseID?.replace("gid://shopify/Product/","")??""}:void 0,children:r.isEmptyChildren(m)?e.jsx(t.default,{}):m})}):null})}),e.jsx(e.Fragment,{children:n.If(P,e.jsx(c,{builderAttrs:h,productSrc:"PickProduct",onClose:()=>D(!1),children:m}))}))})};
@@ -1 +1 @@
1
- "use strict";var e=require("@gem-sdk/core"),t=require("./useProductQuery.js"),r=require("react");exports.useProductSetting=a=>{let{setting:d}=a,{productSetting:u,quantity:i,readOnly:s,isSyncProduct:c}=d??{},o=e.usePageType(),P=e.usePageStore(e=>e.dynamicProduct),{isEditMode:n}=e.useRenderMode(),l=u?.productId??"latest",S=u?.productStatus=="dynamic"?{...u,...P}:u,g=S?.initialVariantId,p=S?.initialVariantBaseId,{productData:{data:y,isLoading:m,error:h}}=t.default({id:l}),[q,I]=r.useState(!0),k=(h||!y&&!m)&&n,D=r.useMemo(()=>({product:y,initialVariantId:g,initialVariantBaseId:p,quantity:i,readOnly:s,isSyncProduct:c,key:`uid-${y?.id}-${g??""}`,hasPreSelected:u?.hasPreSelected}),[p,g,c,y,u?.hasPreSelected,i,s]);return{forceProductSetting:S,isProductPage:"PRODUCT"===o,isProductNotFound:k,showProductNotFound:q,isLoading:m,product:y,errorLoadProduct:h,isEditor:n,productProviderData:D,setShowProductNotFound:I}};
1
+ "use strict";var e=require("@gem-sdk/core"),r=require("../../../../common/helpers.js");require("../../../../common/const.js"),require("react/jsx-runtime");var t=require("react"),a=require("./useProductQuery.js");exports.useProductSetting=u=>{let{setting:d}=u,{productSetting:i,quantity:s,readOnly:o,isSyncProduct:c}=d??{},n=e.usePageType(),P=e.usePageStore(e=>e.dynamicProduct),{isEditMode:l}=e.useRenderMode(),m=i?.productId??"latest",y=i?.productStatus=="dynamic"?{...i,...P}:i,S=y?.initialVariantId,g=y?.initialVariantBaseId,{productData:{data:p,isLoading:q,error:h}}=a.default({id:m}),[j,I]=t.useState(!0),Q=r.isQueryLoading({hasQuery:!!m,data:p,error:h,isLoading:q}),k=(h||!p&&!Q)&&l,v=t.useMemo(()=>({product:p,initialVariantId:S,initialVariantBaseId:g,quantity:s,readOnly:o,isSyncProduct:c,key:`uid-${p?.id}-${S??""}`,hasPreSelected:i?.hasPreSelected}),[g,S,c,p,i?.hasPreSelected,s,o]);return{forceProductSetting:y,isProductPage:"PRODUCT"===n,isProductNotFound:k,showProductNotFound:j,isLoadingProduct:Q,product:p,errorLoadProduct:h,isEditor:l,productProviderData:v,setShowProductNotFound:I}};
@@ -1 +1 @@
1
- "use strict";exports.getAttr=({uid:t})=>({"data-id":t}),exports.getHtml5Attr=({videoId:t,title:e,autoplay:a,preloadThumbnail:r,offLazyLoad:d,src:s,thumbnail:o})=>({id:`${t}`,title:`${e}`,preload:`${a&&!r||d?"metadata":"none"}`,"data-src":`${s}`,poster:o||"","data-poster":o||""});
1
+ "use strict";exports.getAttr=({uid:t})=>({"data-id":t}),exports.getHtml5Attr=({videoId:t,title:e,autoplay:a,preloadThumbnail:r,offLazyLoad:d,src:s,thumbnail:o,shouldDeferPoster:p})=>({id:`${t}`,title:`${e}`,preload:`${a&&!r||d?"metadata":"none"}`,"data-src":`${s}`,poster:o&&!p?o:"","data-poster":o||""});
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common/classes.js"),t=require("@gem-sdk/core"),s=require("@gem-sdk/system"),o=require("../../image/components/NextImage.liquid.js"),a=require("../common/styles.js"),i=require("../../helpers.js"),r=require("../common/attrs.js");exports.default=l=>{let d=`gp-video-${l.uid}`,{thumbnail:n,muted:u,autoplay:c,loop:m,controls:v,src:p,style:g,title:y,className:f,lazy:$,poster:h,wrapperStyles:b}=l,L=c&&u&&!!n,A=!$&&l.isVideoComponent,P=!n||c&&u,E=A?p:void 0,C=s.createAttr({...r.getHtml5Attr({videoId:d,title:y,autoplay:c,preloadThumbnail:L,offLazyLoad:A,src:p,thumbnail:n})}),S=s.createClass({...e.getWrapThumbnailClasses(P)}),T=s.createStyle({...a.getPreloadImageStyle()}),w=s.createClass({...e.getButtonThumbnailClasses()}),j=s.createClass({...e.getImageThumbnailClasses()}),q=s.createClass({...e.getVideoYoutubeClasses(f,A)});return t.template`
2
- <gp-lite-html5-embed is-check-loaded="${l.isCheckLoaded??!1}" style="${b}">
3
- ${L?t.template`${o.default({src:n,alt:y,priority:h?.preload,style:T})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common/classes.js"),t=require("@gem-sdk/core"),s=require("@gem-sdk/system"),o=require("../../image/components/NextImage.liquid.js"),i=require("../common/styles.js"),a=require("../../helpers.js"),r=require("../common/attrs.js");exports.default=l=>{let d=`gp-video-${l.uid}`,{thumbnail:n,muted:u,autoplay:c,loop:m,controls:v,src:p,style:g,title:y,className:f,lazy:$,poster:h,thumbnailImage:b,wrapperStyles:L}=l,A=c&&u&&!!n,C=!$&&l.isVideoComponent,P=!n||c&&u,E=C?p:void 0,S=!l.isVideoComponent&&!P,T=s.createAttr({...r.getHtml5Attr({videoId:d,title:y,autoplay:c,preloadThumbnail:A,offLazyLoad:C,src:p,thumbnail:n,shouldDeferPoster:S})}),q=s.createClass({...e.getWrapThumbnailClasses(P)}),w=s.createStyle({...i.getPreloadImageStyle()}),I=s.createClass({...e.getButtonThumbnailClasses()}),j=s.createClass({...e.getImageThumbnailClasses()}),V=s.createClass({...e.getVideoYoutubeClasses(f,C)});return t.template`
2
+ <gp-lite-html5-embed is-check-loaded="${l.isCheckLoaded??!1}" style="${L}">
3
+ ${A?t.template`${o.default({src:n,alt:y,priority:h?.preload,style:w})}
4
4
  ${s.If(c,`<script>
5
5
  document.addEventListener("DOMContentLoaded", (event) => {
6
6
  const eventList = ["keydown", "mousemove", "wheel", "touchmove", "touchstart", "touchend"];
@@ -36,9 +36,9 @@
36
36
  </script>`)}
37
37
  `:""}
38
38
  <video
39
- ${{...C}}
39
+ ${{...T}}
40
40
  style="${g}"
41
- class="${q}"
41
+ class="${V}"
42
42
  ${v?"controls":void 0}
43
43
  ${m?"loop":void 0}
44
44
  ${u?"muted":void 0}
@@ -50,10 +50,10 @@
50
50
  <div
51
51
  role="presentation"
52
52
  style="${g}"
53
- class="${S}"
53
+ class="${q}"
54
54
  >
55
- ${o.default({id:"video-thumbnail",src:n??"",alt:h?.altText,title:h?.imageTitle,className:j,isDisableAspectStyle:!0,priority:h?.preload})}
56
- <button type="button" class="${w}" aria-label="Play">
55
+ ${o.default({id:"video-thumbnail",src:n??"",...b&&{srcIsLiquidCode:!0,srcset:b.srcset},alt:h?.altText,title:h?.imageTitle,className:j,isDisableAspectStyle:!0,priority:h?.preload})}
56
+ <button type="button" class="${I}" aria-label="Play">
57
57
  <svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
58
58
  <path
59
59
  fill="currentColor"
@@ -64,5 +64,5 @@
64
64
  </div>
65
65
  `)}
66
66
  </gp-lite-html5-embed>
67
- ${t.RenderIf(t.isLocalEnv,`<script ${i.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-lite-html5-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${i.getSettingPreloadData('class="gps-link" delay',"src")}="${t.baseAssetURL}/assets-v2/gp-lite-html5-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
67
+ ${t.RenderIf(t.isLocalEnv,`<script ${a.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-lite-html5-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${a.getSettingPreloadData('class="gps-link" delay',"src")}="${t.baseAssetURL}/assets-v2/gp-lite-html5-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
68
68
  `};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as i,splitStyle as l,composeAdvanceStyle as a,useBlogsQuery as r,useArticlesQuery as o,flattenConnection as d,filterToolbarPreview as n,ArticleListProvider as s,ArticleProvider as c,isEmptyChildren as m,cls as g,makeStyleResponsive as p,getResponsiveValueByScreen as h,getGradientBgrStyleByDevice as u,getStyleBackgroundByDevice as b,makeStyleWithDefault as f,makeWidth as w}from"@gem-sdk/core";import T from"../../grid/components/ChildrenDroppable.js";import y from"./ArticleNotFound.js";import"../../common/const.js";import{useState as A}from"react";import D from"../../common/components/Loading.js";let v=v=>{let S=i(),{styles:O,setting:k,className:I,children:E,builderProps:L,advanced:P,builderAttrs:G,style:_}=v??{},{articleSetting:j,numberOfArticle:x}=k??{},{articleIds:C,articlePickType:M}=j??{},{border:N,rounded:z,hasBoxShadow:B,boxShadow:F}=P??{},[R]=l(["pos","top","left","bottom","right","z","d"],_),U=a({border:N,rounded:z,hasBoxShadow:B,boxShadow:F,"spacing-setting":P?.["spacing-setting"]}),$={first:C?.length||50,where:{baseIDIn:[...j?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},V={first:1,where:{baseID:j?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[H,q]=A(!0),J=r("latest"===M?V:null,{revalidateOnMount:!0}),K=o("manually"===M?$:null,{revalidateOnMount:!0}),Q=J.data?.blogs?.edges?.[0]?.node,W="manually"===M?K.isLoading:J.isLoading,X="manually"===M?K.isValidating:J.isValidating,Y="manually"===M?K.error:J.error,Z=J?.data?.blogs?.edges?.[0]?.node,ee="latest"===M?d(Z?.articles):d(K?.data?.articles),et=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),ei="latest"===M?ee?.filter((e,t)=>t<+(x||4)).map(e=>et(e,Z)):"manually"===M&&j?.articleIds?.length?C?.map(e=>{let t=ee?.find(t=>t?.baseID===e);return et(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):ee.filter((e,t)=>t<(j?.numOfSelectedArticles||4)).map(e=>et(e,e?.blogs?.edges?.[0]?.node));return ei?.length||W||"edit"!=S?e("div",{...G,className:L?.builderData?.uid,style:R,children:[X||W?t(D,{}):Y?e("div",{children:["Error: ",Y?.message]}):ei?.length?t(s,{styles:{horizontalGutter:O?.horizontalGutter,verticalGutter:O?.verticalGutter,spacing:O?.spacing,width:O?.width,height:O?.height},settings:{slidesToShow:k?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:ei,children:t("div",{"data-id":L?.uid,className:"gp-relative",children:t("div",{style:{...U,...f("w",w(O?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...p("rg",O?.horizontalGutter),...p("cg",O?.verticalGutter),...b(k?.background),...u(k?.background),...p("gtc",{desktop:`repeat(${h(k?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:k?.slideToShow?.tablet&&`repeat(${h(k?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:k?.slideToShow?.mobile&&`repeat(${h(k?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:g(I,"gp-m-auto gp-grid gp-w-full"),children:ei.map(e=>t(c,{article:e,readOnly:!0,children:t("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:m(E)?t(T,{}):E})},e?.id))})})}):t("div",{children:"Articles not found"}),n(E,!0)]}):H?e("div",{...G,className:L?.builderData?.uid,children:[t(y,{blogHandle:Q?.handle,onClose:()=>q(!1),articlePickType:M??"manually",children:E}),n(E,!0)]}):null};export{v as default};
2
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as i,splitStyle as l,composeAdvanceStyle as r,useBlogsQuery as a,useArticlesQuery as o,flattenConnection as d,filterToolbarPreview as n,ArticleListProvider as s,ArticleProvider as c,isEmptyChildren as m,cls as g,makeStyleResponsive as p,getResponsiveValueByScreen as h,getGradientBgrStyleByDevice as u,getStyleBackgroundByDevice as b,makeStyleWithDefault as f,makeWidth as D}from"@gem-sdk/core";import w from"../../grid/components/ChildrenDroppable.js";import{getElementLabel as T,isQueryLoading as A}from"../../common/helpers.js";import"../../common/const.js";import{useState as y}from"react";import v from"../../common/components/Loading.js";import S from"./ArticleNotFound.js";let O=O=>{let k=i(),{styles:I,setting:E,className:L,children:P,builderProps:j,advanced:G,builderAttrs:_,style:x}=O??{},{articleSetting:C,numberOfArticle:M}=E??{},{articleIds:N,articlePickType:z}=C??{},{border:B,rounded:F,hasBoxShadow:R,boxShadow:U}=G??{},[$]=l(["pos","top","left","bottom","right","z","d"],x),H=r({border:B,rounded:F,hasBoxShadow:R,boxShadow:U,"spacing-setting":G?.["spacing-setting"]}),Q={first:N?.length||50,where:{baseIDIn:[...C?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},V={first:1,where:{baseID:C?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[q,J]=y(!0),K="manually"===z,W="latest"===z,X=a(W?V:null,{revalidateOnMount:!0}),Y=o(K?Q:null,{revalidateOnMount:!0}),Z=X.data?.blogs?.edges?.[0]?.node,ee=K?Y:X,et=ee.error,ei=ee.isValidating,el=A({hasQuery:K||W,data:ee.data,error:ee.error,isLoading:ee.isLoading}),er=X?.data?.blogs?.edges?.[0]?.node,ea="latest"===z?d(er?.articles):d(Y?.data?.articles),eo=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),ed="latest"===z?ea?.filter((e,t)=>t<+(M||4)).map(e=>eo(e,er)):"manually"===z&&C?.articleIds?.length?N?.map(e=>{let t=ea?.find(t=>t?.baseID===e);return eo(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):ea.filter((e,t)=>t<(C?.numOfSelectedArticles||4)).map(e=>eo(e,e?.blogs?.edges?.[0]?.node));return ed?.length||el||"edit"!=k?e("div",{..._,className:j?.builderData?.uid,style:$,children:[ei||el?t(v,{label:T({builderData:j?.builderData})}):et?e("div",{children:["Error: ",et?.message]}):ed?.length?t(s,{styles:{horizontalGutter:I?.horizontalGutter,verticalGutter:I?.verticalGutter,spacing:I?.spacing,width:I?.width,height:I?.height},settings:{slidesToShow:E?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:ed,children:t("div",{"data-id":j?.uid,className:"gp-relative",children:t("div",{style:{...H,...f("w",D(I?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...p("rg",I?.horizontalGutter),...p("cg",I?.verticalGutter),...b(E?.background),...u(E?.background),...p("gtc",{desktop:`repeat(${h(E?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:E?.slideToShow?.tablet&&`repeat(${h(E?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:E?.slideToShow?.mobile&&`repeat(${h(E?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:g(L,"gp-m-auto gp-grid gp-w-full"),children:ed.map(e=>t(c,{article:e,readOnly:!0,children:t("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:m(P)?t(w,{}):P})},e?.id))})})}):t("div",{children:"Articles not found"}),n(P,!0)]}):q?e("div",{..._,className:j?.builderData?.uid,children:[t(S,{blogHandle:Z?.handle,onClose:()=>J(!1),articlePickType:z??"manually",children:P}),n(P,!0)]}):null};export{O as default};
@@ -1,4 +1,4 @@
1
- import{normalizeMailto as t,isShopifyDomain as e,checkIsScrollToTop as l,checkIsOpenPopup as r,isLinkedToSalesPage as i,getDynamicSourceLocales as a,createSettingId as o}from"../../helpers.js";import{Button as n}from"../settings/configs/translate.js";import{splitStyle as s,convertHTML as g}from"@gem-sdk/core";import{HREF_TO_SALES_PAGE as p}from"../../constant.js";import{getCustomCssStyles as c}from"./styles.js";import d from"../../link/components/Link.js";let u=(t,e)=>{if(!e)return t;let l={...t};return["hover","focus"].forEach(t=>{delete l?.backgroundColorV2?.[t]}),l},h=({label:t,translateSetting:e,styles:l,pageContext:r,isUseTranslatedValue:i,builderProps:s,isLiquid:p=!1,isForceValue:c})=>{let d=!i||c?t:a({val:t,pageContext:r,settingId:o({id:e??n?.label?.id}),uid:s?.uidTranslate??s?.uid,isCapitalize:l?.typo?.attrs?.transform==="capitalize"});return p?d?.toString()??"":g(t)},f=(t,e)=>!!t&&e,m=(t,e)=>!!t||!e,b=({mode:t,options:e,isLiquid:l=!1})=>l?!e?.isCannotEditing:"edit"===t&&!e?.isCannotEditing,k=t=>!!t?.link?.startsWith("#")&&("_self"===t.target||"scroll-to"===t.type),C=t=>s(["pos","top","left","bottom","right","z"],t),I=t=>t?"loading":"idle",w=(t,e,l)=>t??(e||l)??"",y=({label:t,isLiquid:e=!1})=>e?t?.toString().replaceAll("'","&#039;").replaceAll('"',"'")??"":t?.toString()??"",L=({setting:a,htmlType:o,defaultTag:n,enableBtnLink:s,isLiquid:g=!1,pageType:c})=>{let u=["product.url"],h=["#","mailto:","tel:"],f=a?.link??"",m="/"===f,b=a?.link!==void 0&&""!==a.link,k=new RegExp(/^https?:\/\//i),C=b&&k.test(f);b&&f.toLowerCase().startsWith("mailto:")&&f.includes("+")&&(f=t(f));let I=i(a?.type),w=!!s&&(C||e(b,f)||(()=>{if(u.find(t=>f.includes(t)))return!0;let t=h.find(t=>f.startsWith(t));return!(!t||l(a)||"STATIC"===c&&r(a))})()||m||I),y=f;g&&(e(b,f)||m)&&(y=a?.isTranslate?"$locationOrigin"+f:"{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}"+f);let L={href:y,target:a?.target,...a?.noFollow&&{rel:"nofollow"}},S=w?L:b?{...L,type:o}:{type:o};return I&&(S={href:p,target:"_self"}),{HTMLTag:w?g?"a":d:n,urlData:S,shouldRenderLink:w}},S=t=>{let{style:e,dataId:l,pageContext:r,styles:i={},setting:a={},builderProps:o,builderAttrs:n,isUseTranslatedValue:s=!0}=t,{label:g,iconSvg:p,btnLink:d,loading:L,options:S,disabled:v,iconVisible:E,shouldClearSpace:T}=a,[x,A]=C(e),D=u(i,v),j=c({styles:i,uid:o?.uid,builderAttrs:n,enableHoverEffect:a.enableHoverEffect??!0}),z=I(L),H=w(o?.uidInteraction,l,o?.uid),_=t=>{let{isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a}=t??{};return h({pageContext:a??r??{},label:g,translateSetting:l,isForceValue:i,builderProps:o,styles:D,isLiquid:e,...e&&{isUseTranslatedValue:s}})},G=f(p,E),O=k(d);return{customCss:j,wrapStyle:x,restStyle:A,dataState:z,dataIdAttr:H,isShowIcon:G,isScrollToElement:O,getArialLabel:t=>{let{isLiquid:e}=t??{};return y({label:g,isLiquid:e})},getLabelToDisplay:_,checkIsShowLabel:t=>{let{isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a}=t??{},o=_({isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a??r??{}});return m(o,T)},checkIsEditableLabel:t=>{let{isLiquid:e,mode:l}=t??{};return b({options:S,isLiquid:e,...!e&&l&&{mode:l}})}}},v=`
1
+ import{normalizeMailto as t,isShopifyDomain as e,checkIsScrollToTop as l,checkIsOpenPopup as r,isLinkedToSalesPage as i,getDynamicSourceLocales as a,createSettingId as o}from"../../helpers.js";import{Button as n}from"../settings/configs/translate.js";import{splitStyle as s,convertHTML as p}from"@gem-sdk/core";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";import{getCustomCssStyles as c}from"./styles.js";import d from"../../link/components/Link.js";let u=(t,e)=>{if(!e)return t;let l={...t};return["hover","focus"].forEach(t=>{delete l?.backgroundColorV2?.[t]}),l},h=({label:t,translateSetting:e,styles:l,pageContext:r,isUseTranslatedValue:i,builderProps:s,isLiquid:g=!1,isForceValue:c})=>{let d=!i||c?t:a({val:t,pageContext:r,settingId:o({id:e??n?.label?.id}),uid:s?.uidTranslate??s?.uid,isCapitalize:l?.typo?.attrs?.transform==="capitalize"});return g?d?.toString()??"":p(t)},f=(t,e)=>!!t&&e,m=(t,e)=>!!t||!e,b=({mode:t,options:e,isLiquid:l=!1})=>l?!e?.isCannotEditing:"edit"===t&&!e?.isCannotEditing,k=t=>!!t?.link?.startsWith("#")&&("_self"===t.target||"scroll-to"===t.type),C=t=>s(["pos","top","left","bottom","right","z"],t),I=t=>t?"loading":"idle",w=(t,e,l)=>t??(e||l)??"",y=({label:t,isLiquid:e=!1})=>{let l=(t?.toString()??"").replace(/<br\s*\/?>|<\/(?:p|div|li)>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();return e?l.replaceAll("'","&#039;").replaceAll('"',"'"):l},v=({setting:a,htmlType:o,defaultTag:n,enableBtnLink:s,isLiquid:p=!1,pageType:c})=>{let u=["product.url"],h=["#","mailto:","tel:"],f=a?.link??"",m="/"===f,b=a?.link!==void 0&&""!==a.link,k=new RegExp(/^https?:\/\//i),C=b&&k.test(f);b&&f.toLowerCase().startsWith("mailto:")&&f.includes("+")&&(f=t(f));let I=i(a?.type),w=!!s&&(C||e(b,f)||(()=>{if(u.find(t=>f.includes(t)))return!0;let t=h.find(t=>f.startsWith(t));return!(!t||l(a)||"STATIC"===c&&r(a))})()||m||I),y=f;p&&(e(b,f)||m)&&(y=a?.isTranslate?"$locationOrigin"+f:"{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}"+f);let v={href:y,target:a?.target,...a?.noFollow&&{rel:"nofollow"}},L=w?v:b?{...v,type:o}:{type:o};return I&&(L={href:g,target:"_self"}),{HTMLTag:w?p?"a":d:n,urlData:L,shouldRenderLink:w}},L=t=>{let{style:e,dataId:l,pageContext:r,styles:i={},setting:a={},builderProps:o,builderAttrs:n,isUseTranslatedValue:s=!0}=t,{label:p,iconSvg:g,btnLink:d,loading:v,options:L,disabled:S,iconVisible:E,shouldClearSpace:T}=a,[x,A]=C(e),D=u(i,S),j=c({styles:i,uid:o?.uid,builderAttrs:n,enableHoverEffect:a.enableHoverEffect??!0}),z=I(v),H=w(o?.uidInteraction,l,o?.uid),_=t=>{let{isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a}=t??{};return h({pageContext:a??r??{},label:p,translateSetting:l,isForceValue:i,builderProps:o,styles:D,isLiquid:e,...e&&{isUseTranslatedValue:s}})},G=f(g,E),O=k(d);return{customCss:j,wrapStyle:x,restStyle:A,dataState:z,dataIdAttr:H,isShowIcon:G,isScrollToElement:O,getArialLabel:t=>{let{isLiquid:e}=t??{};return y({label:p,isLiquid:e})},getLabelToDisplay:_,checkIsShowLabel:t=>{let{isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a}=t??{},o=_({isLiquid:e,translateSetting:l,isForceValue:i,pageContext:a??r??{}});return m(o,T)},checkIsEditableLabel:t=>{let{isLiquid:e,mode:l}=t??{};return b({options:L,isLiquid:e,...!e&&l&&{mode:l}})}}},S=`
2
2
  <svg
3
3
  class="gp-invisible gp-absolute gp-h-5 gp-w-5 group-data-[state=loading]:gp-animate-spin group-data-[state=loading]:gp-visible"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -19,4 +19,4 @@ import{normalizeMailto as t,isShopifyDomain as e,checkIsScrollToTop as l,checkIs
19
19
  d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
20
20
  ></path>
21
21
  </svg>
22
- `;export{v as LOADING_INDICATOR,k as checkIsScrollToElement,f as checkIsShowIcon,u as getCleanedStyles,S as getData,w as getDataId,I as getDataState,L as getInsertLinkData,C as getSplitStyles,b as handleCheckIsEditableLabel,m as handleCheckIsShowLabel,y as handleGetArialLabel,h as handleGetLabelToDisplay};
22
+ `;export{S as LOADING_INDICATOR,k as checkIsScrollToElement,f as checkIsShowIcon,u as getCleanedStyles,L as getData,w as getDataId,I as getDataState,v as getInsertLinkData,C as getSplitStyles,b as handleCheckIsEditableLabel,m as handleCheckIsShowLabel,y as handleGetArialLabel,h as handleGetLabelToDisplay};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as g}from"react/jsx-runtime";let l=()=>e("div",{className:"gp-loading-placeholder gp-relative gp-my-0.5 gp-h-3 gp-w-full gp-overflow-hidden",children:[g("div",{className:"gp-absolute gp-h-full gp-w-full gp-bg-gray-200"}),g("div",{className:"gp-absolute gp-h-full gp-bg-green-500 gp-animate-progress-bar"})]});export{l as default};
2
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useLoadingProgress as l}from"../hooks/useLoadingProgress.js";import{getLoadingErrorText as g,getLoadingText as p}from"../helpers.js";import{useElementWidth as r}from"../hooks/useElementWidth.js";import{LOADING_MIN_WIDTH as o}from"../const.js";let t="gp-loading-placeholder gp-border-loading-frame gp-flex gp-w-full gp-flex-col gp-gap-4 gp-overflow-hidden gp-border-[0.5px] gp-border-solid gp-bg-white",d="gp-text-loading-label !gp-font-g-ui !gp-text-xs !gp-font-medium !gp-leading-5 gp-px-4 gp-text-center",a=({label:a,error:n,retry:s})=>{let m=l(),{ref:c,width:h}=r(),f=(({minWidth:e})=>void 0===h||h>e)({minWidth:o.SHOW_TEXT}),u=(({minWidth:e})=>void 0===h||h>e)({minWidth:o.SHOW_LABEL});return n?e("div",{ref:c,className:t,children:i("div",{className:`${d} gp-py-4`,children:[g({label:a,hasRoomForLabel:u}),!!s&&e("button",{type:"button",onClick:s,className:"gp-ml-1 gp-underline",children:"Retry"})]})}):i("div",{ref:c,className:t,children:[e("div",{className:"gp-h-0.5 gp-w-full gp-bg-loading-track",children:e("div",{className:"gp-bg-loading-bar gp-h-full gp-transition-[width] gp-duration-100 gp-ease-linear",style:{width:`${m}%`}})}),f&&e("div",{className:`${d} gp-pb-4`,children:p({label:a,percent:m,hasRoomForLabel:u})})]})};export{a as default};
@@ -1 +1 @@
1
- var o;let c={STICKY:999,DIALOG:100001,CART_DRAWER:100002,CART_DRAWER_CONFIRM_MODAL:100003};!function(o){o.Collection="Collection",o.PickProduct="PickProduct",o.DynamicCollection="DynamicCollection",o.RelatedProduct="RelatedProduct"}(o||(o={}));export{c as ELEMENT_Z_INDEX,o as PRODUCT_LIST_PRODUCT_SOURCE};
1
+ var e;let t={STICKY:999,DIALOG:100001,CART_DRAWER:100002,CART_DRAWER_CONFIRM_MODAL:100003};!function(e){e.Collection="Collection",e.PickProduct="PickProduct",e.DynamicCollection="DynamicCollection",e.RelatedProduct="RelatedProduct"}(e||(e={}));let c={TICK_MS:100,MILESTONES:[{atMs:0,percent:0},{atMs:500,percent:30},{atMs:1e3,percent:50},{atMs:3e3,percent:75},{atMs:5e3,percent:83},{atMs:1e4,percent:90},{atMs:2e4,percent:96}],MAX_PERCENT:99,TAIL_MS:6e4},_={SHOW_LABEL:154,SHOW_TEXT:55};export{t as ELEMENT_Z_INDEX,_ as LOADING_MIN_WIDTH,c as LOADING_PROGRESS,e as PRODUCT_LIST_PRODUCT_SOURCE};
@@ -0,0 +1 @@
1
+ let e=({builderData:e})=>e?.customLabel??e?.label,o=({label:e,percent:o,hasRoomForLabel:a})=>a?e?`Loading ${e}...${o}%`:`Loading ${o}%`:`${o}%`,a=({label:e,hasRoomForLabel:o})=>e&&o?`${e} failed to load.`:"Failed to load.",d=({hasQuery:e,data:o,error:a,isLoading:d})=>d||e&&void 0===o&&void 0===a;export{e as getElementLabel,a as getLoadingErrorText,o as getLoadingText,d as isQueryLoading};
@@ -0,0 +1 @@
1
+ import{useIsomorphicLayoutEffect as e}from"@gem-sdk/core";import{useRef as t,useState as r}from"react";let n=()=>{let n=t(null),[i,o]=r();return e(()=>{let e=n.current;if(!e||(o(e.getBoundingClientRect().width),"undefined"==typeof ResizeObserver))return;let t=new ResizeObserver(e=>{let t=e[0];t&&o(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]),{ref:n,width:i}};export{n as useElementWidth};
@@ -0,0 +1 @@
1
+ let e;import{useState as t,useEffect as r}from"react";import{LOADING_PROGRESS as a}from"../const.js";let{MILESTONES:l,MAX_PERCENT:o,TAIL_MS:n,TICK_MS:s}=a,u=l[l.length-1],f=({value:e,fromValue:t,toValue:r,fromResult:a,toResult:l})=>r===t?l:a+(l-a)*((e-t)/(r-t)),M=({elapsedMs:e})=>{if(e>=u.atMs){let t=f({value:e,fromValue:u.atMs,toValue:u.atMs+n,fromResult:u.percent,toResult:o});return Math.floor(Math.min(t,o))}let t=l.findIndex(t=>e<t.atMs),r=l[t-1]??l[0],a=l[t];return Math.floor(f({value:e,fromValue:r.atMs,toValue:a.atMs,fromResult:r.percent,toResult:a.percent}))},i=new Map,m=()=>{let e=Date.now();i.forEach((t,r)=>r(e-t))},c=t=>(i.set(t,Date.now()),e=e??setInterval(m,s),()=>{i.delete(t),!i.size&&e&&(clearInterval(e),e=void 0)}),p=()=>{let[e,a]=t(0);return r(()=>{let e=()=>{};return e=c(t=>{let r=M({elapsedMs:t});a(r),r>=o&&e()}),()=>e()},[]),e};export{M as getLoadingPercent,p as useLoadingProgress};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as o}from"react/jsx-runtime";import"../../../common/const.js";import"@gem-sdk/core";import{useMemo as t}from"react";import e from"../../../common/components/Loading.js";import r from"../row/Row.js";let m=m=>{let i=t(()=>{let{builderProps:o}=m;return o?.builderData?.name==="SectionLoading"},[m]);return i?o(e,{}):o(r,{...m,setting:{...m.setting,as:"section",isSection:!0}})};export{m as default};
2
+ import{jsx as o}from"react/jsx-runtime";import{getElementLabel as t}from"../../../common/helpers.js";import"../../../common/const.js";import"@gem-sdk/core";import{useMemo as e}from"react";import r from"../../../common/components/Loading.js";import m from"../row/Row.js";let i=i=>{let{builderProps:n}=i,a=e(()=>n?.builderData?.name==="SectionLoading",[n]);return a?o(r,{label:t({builderData:n?.builderData})}):o(m,{...i,setting:{...i.setting,as:"section",isSection:!0}})};export{i as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as o,Fragment as t}from"react/jsx-runtime";import{createElement as e}from"react";import{getProductOfferContainerClasses as r,getProductOfferWrapperClasses as m}from"../common/classes.js";import{getWrapperStyles as s,getContainerStyles as c}from"../common/styles.js";import{useProductOfferData as a}from"../hooks/useProductOfferData.js";import{createClass as d,createStyle as i}from"@gem-sdk/system";import{ProductOfferItem as l}from"./ProductOfferItem.js";import"../../../../../common/const.js";import"@gem-sdk/core";import n from"../../../../../common/components/Loading.js";let p=p=>{let{styles:f,builderAttrs:u,builderProps:h,setting:j}=p,{isLoading:P,productSortedById:y,totalProduct:g}=a(),k=d({...r(h?.uid)}),v=d({...m()}),x=i({...s(f)}),O=i({...c(j)});return o(t,{children:P?o(n,{}):y?.length?o("div",{...u,className:k,style:O,children:o("div",{className:v,style:x,children:y?.map((o,t)=>e(l,{...p,product:o,index:t,key:t,totalProduct:g}))})}):o("div",{children:"You haven't set up a product yet. Please go back to the sales funnel details to add a product."})})};export{p as default};
2
+ import{jsx as e,Fragment as o}from"react/jsx-runtime";import{createElement as r}from"react";import{getProductOfferContainerClasses as t,getProductOfferWrapperClasses as m}from"../common/classes.js";import{getWrapperStyles as s,getContainerStyles as i}from"../common/styles.js";import{useProductOfferData as a}from"../hooks/useProductOfferData.js";import{getOfferErrorText as d}from"../helpers/getOfferErrorText.js";import{getElementLabel as c}from"../../../../../common/helpers.js";import"../../../../../common/const.js";import{useEditorMode as l}from"@gem-sdk/core";import n from"../../../../../common/components/Loading.js";import{createClass as f,createStyle as p}from"@gem-sdk/system";import{ProductOfferItem as u}from"./ProductOfferItem.js";let h=h=>{let{styles:g,builderAttrs:j,builderProps:P,setting:y}=h,{isLoading:k,errorMsg:v,productSortedById:b,totalProduct:x}=a(),O=l(),D=f({...t(P?.uid)}),E=f({...m()}),N=p({...s(g)}),I=p({...i(y)}),L=!!v&&!b?.length,T=d({message:v?.message,isEditor:"edit"===O});return e(o,{children:k?e(n,{label:c({builderData:P?.builderData})}):L?e("div",{children:T}):b?.length?e("div",{...j,className:D,style:I,children:e("div",{className:E,style:N,children:b?.map((e,o)=>r(u,{...h,product:e,index:o,key:o,totalProduct:x}))})}):e("div",{children:"You haven't set up a product yet. Please go back to the sales funnel details to add a product."})})};export{h as default};
@@ -0,0 +1 @@
1
+ let e="Could not load the offer products",r=`${e}. Please reload the page.`,o=({message:o,isEditor:t})=>t?`${e}: ${o??"unknown error"}`:r;export{o as getOfferErrorText};
@@ -1 +1 @@
1
- import{usePageStore as o,useRenderMode as t,useProductOffersQuery as e,flattenConnection as r}from"@gem-sdk/core";import{productOfferPlaceholder as i}from"../../../constants/ProductOfferPlaceholder.js";import{hasPublicStoreFrontData as n,createStoreFrontFetcher as d}from"../../../helpers/index.js";import{useDynamicProduct as a}from"../../../hooks/useDynamicProduct.js";import{useMemo as p,useEffect as l}from"react";let s=()=>{let s=o(o=>o.productOffers),u=o(o=>o.publicStoreFrontData),{isDynamicProduct:c}=a(),f=o(o=>o.dynamicDiscountOffer),{isEditMode:m}=t(),P=p(()=>c?f?.appliedProductCount:s?.length,[f?.appliedProductCount,c,s?.length]),b=p(()=>s?.sort((o,t)=>o?.node?.position&&t?.node?.position?o.node.position-t.node.position:0).map(o=>o?.node?.objectBaseID).filter(Boolean),[s]),{isLoading:h,isValidating:C,data:D}=e(b||[],{revalidateOnMount:!0},{allStatus:!0,fetcher:n(u)?d(u):void 0}),v=p(()=>h||C,[h,C]),O=p(()=>r(D?.products),[D?.products]),g=p(()=>c&&f?.appliedProductCount?Array(f.appliedProductCount).fill(i):b?.map(o=>O?.find(t=>t?.baseID===o)).filter(Boolean),[c,f?.appliedProductCount,b,O]);return l(()=>{if(v||!m)return;let o=new CustomEvent("editor:toolbar:force-active-component",{bubbles:!0,detail:{}});window.dispatchEvent(o)},[v,m]),{isLoading:v,productSortedById:g,totalProduct:P}};export{s as useProductOfferData};
1
+ import{usePageStore as o,useRenderMode as t,useProductOffersQuery as e,flattenConnection as r}from"@gem-sdk/core";import{productOfferPlaceholder as i}from"../../../constants/ProductOfferPlaceholder.js";import{hasPublicStoreFrontData as n,createStoreFrontFetcher as d}from"../../../helpers/index.js";import{useDynamicProduct as p}from"../../../hooks/useDynamicProduct.js";import{isQueryLoading as s}from"../../../../../common/helpers.js";import"../../../../../common/const.js";import"react/jsx-runtime";import{useMemo as a,useEffect as c}from"react";let u=()=>{let u=o(o=>o.productOffers),l=o(o=>o.publicStoreFrontData),{isDynamicProduct:m}=p(),f=o(o=>o.dynamicDiscountOffer),{isEditMode:h}=t(),P=a(()=>m?f?.appliedProductCount:u?.length,[f?.appliedProductCount,m,u?.length]),b=a(()=>u?.sort((o,t)=>o?.node?.position&&t?.node?.position?o.node.position-t.node.position:0).map(o=>o?.node?.objectBaseID).filter(Boolean),[u]),{isLoading:j,isValidating:C,data:D,error:g}=e(b||[],{revalidateOnMount:!0},{allStatus:!0,fetcher:n(l)?d(l):void 0}),v=a(()=>C||s({hasQuery:!0,data:D,error:g,isLoading:j}),[D,g,j,C]),O=a(()=>r(D?.products),[D?.products]),y=a(()=>m&&f?.appliedProductCount?Array(f.appliedProductCount).fill(i):b?.map(o=>O?.find(t=>t?.baseID===o)).filter(Boolean),[m,f?.appliedProductCount,b,O]);return c(()=>{if(v||!h)return;let o=new CustomEvent("editor:toolbar:force-active-component",{bubbles:!0,detail:{}});window.dispatchEvent(o)},[v,h]),{isLoading:v,errorMsg:g,productSortedById:y,totalProduct:P}};export{u as useProductOfferData};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useI18nStore as m,useProduct as o,useCurrentVariant as t,useMoneyFormat as r,useCurrentDevice as i,useProductBundleDiscount as l,useEditorMode as c,useRenderMode as a,usePageType as n,useSafeGetProductListSettings as d,filterToolbarPreview as p}from"@gem-sdk/core";import{getContainerClasses as h,getWrapperClasses as y,getSubWrapperClass as f,getTextContainerClasses as N,getTextWrapperClasses as j,getTextContentClasses as u,getImageContainerClasses as g,getImageClasses as v}from"./common/classes.js";import{getContainerStyle as T,getSubWrapperStyle as k,getContentStyleInternal as x,getTextBadgeWrapperStyles as C,getTextContentStyle as H,getImageContainerStyles as S}from"./common/styles.js";import{getEditTooltipAttrs as b,getSubWrapperAttrs as w,getContainerAttrs as A,getTextContentAttrs as B,getImageAttr as D}from"./common/attrs.js";import{createClass as I,createStyle as M,createAttr as P,If as q}from"@gem-sdk/system";import"../../../common/const.js";import z from"../../../common/components/TooltipHover.js";import E from"../../../common/components/NoDataState.js";import{getBadgeContent as F,getIsNoDiscountState as G}from"./utils/common.js";import"./constants.js";let J=J=>{let{t:K}=m(),{setting:L,styles:O,children:Q,builderAttrs:R,...U}=J,V=o(),W=t(),{moneyFormat:X}=r(),Y=i(),{useProductCompareAtPrice:Z}=l(),$=U?.["bundle-item"],_=c(),{isEditMode:ee}=a(),es="STATIC"===n(),{settings:em}=d(),eo=em?.sameHeight,et=F({detail:V,currentVariant:W,bundleItem:$,useProductCompareAtPrice:Z},L?.displayContent,X),er=G({props:J,product:V,currentVariant:W,moneyFormat:X,useProductCompareAtPrice:Z}),ei=I({...h({mode:_,isInstant:es,product:V,currentVariant:W,props:J,isSameHeightInProductList:eo})}),el=M({...T(J)}),ec=P({...b(J,ee)}),ea=I({...y(J)}),en=I({...f(J,Y)}),ed=M({...k({props:J,product:V,currentVariant:W,isEditMode:ee})}),ep=P({...w(J,V)}),eh=x(J),ey=I({...N()}),ef=P({...A(J)}),eN=I({...j()}),ej=M({...C({setting:L,styles:O})}),eu=I({...u(O)}),eg=M({...H({setting:L,styles:O})}),ev=P({...B()}),eT=I({...g()}),ek=M({...S({setting:L,styles:O})}),ex=I({...v()}),eC=P({...D({setting:L})});return V?e("div",{...ef,style:el,className:ei,children:[q(ee&&er,s(z,{...ec,children:s(E,{...R,elementType:"secondary",description:K("No discount"),rawMode:!0})}),s("div",{className:ea,children:e("div",{...ep,className:en,style:ed,children:[s("style",{children:eh}),q(L?.shape!=="image",s("div",{className:ey,children:s("div",{className:eN,style:ej,children:s("pre",{...ev,className:eu,style:eg,children:et})})}),s("div",{className:eT,style:ek,children:s("img",{...eC,className:ex,alt:""})}))]})})),p(Q,!0)]}):null};export{J as default};
2
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useI18nStore as m,useProduct as o,useCurrentVariant as t,useMoneyFormat as r,useCurrentDevice as i,useProductBundleDiscount as l,useEditorMode as c,useRenderMode as a,usePageType as n,useSafeGetProductListSettings as d,filterToolbarPreview as p}from"@gem-sdk/core";import{getContainerClasses as h,getWrapperClasses as y,getSubWrapperClass as f,getTextContainerClasses as N,getTextWrapperClasses as j,getTextContentClasses as u,getImageContainerClasses as g,getImageClasses as v}from"./common/classes.js";import{getContainerStyle as T,getSubWrapperStyle as k,getContentStyleInternal as x,getTextBadgeWrapperStyles as C,getTextContentStyle as H,getImageContainerStyles as S}from"./common/styles.js";import{getEditTooltipAttrs as b,getSubWrapperAttrs as w,getContainerAttrs as A,getTextContentAttrs as B,getImageAttr as D}from"./common/attrs.js";import{createClass as I,createStyle as M,createAttr as P,If as q}from"@gem-sdk/system";import"../../../common/const.js";import z from"../../../common/components/TooltipHover.js";import E from"../../../common/components/NoDataState.js";import"react";import{getBadgeContent as F,getIsNoDiscountState as G}from"./utils/common.js";import"./constants.js";let J=J=>{let{t:K}=m(),{setting:L,styles:O,children:Q,builderAttrs:R,...U}=J,V=o(),W=t(),{moneyFormat:X}=r(),Y=i(),{useProductCompareAtPrice:Z}=l(),$=U?.["bundle-item"],_=c(),{isEditMode:ee}=a(),es="STATIC"===n(),{settings:em}=d(),eo=em?.sameHeight,et=F({detail:V,currentVariant:W,bundleItem:$,useProductCompareAtPrice:Z},L?.displayContent,X),er=G({props:J,product:V,currentVariant:W,moneyFormat:X,useProductCompareAtPrice:Z}),ei=I({...h({mode:_,isInstant:es,product:V,currentVariant:W,props:J,isSameHeightInProductList:eo})}),el=M({...T(J)}),ec=P({...b(J,ee)}),ea=I({...y(J)}),en=I({...f(J,Y)}),ed=M({...k({props:J,product:V,currentVariant:W,isEditMode:ee})}),ep=P({...w(J,V)}),eh=x(J),ey=I({...N()}),ef=P({...A(J)}),eN=I({...j()}),ej=M({...C({setting:L,styles:O})}),eu=I({...u(O)}),eg=M({...H({setting:L,styles:O})}),ev=P({...B()}),eT=I({...g()}),ek=M({...S({setting:L,styles:O})}),ex=I({...v()}),eC=P({...D({setting:L})});return V?e("div",{...ef,style:el,className:ei,children:[q(ee&&er,s(z,{...ec,children:s(E,{...R,elementType:"secondary",description:K("No discount"),rawMode:!0})}),s("div",{className:ea,children:e("div",{...ep,className:en,style:ed,children:[s("style",{children:eh}),q(L?.shape!=="image",s("div",{className:ey,children:s("div",{className:eN,style:ej,children:s("pre",{...ev,className:eu,style:eg,children:et})})}),s("div",{className:eT,style:ek,children:s("img",{...eC,className:ex,alt:""})}))]})})),p(Q,!0)]}):null};export{J as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{getWrapperTextClass as s,getContainerClass as o,getRootClass as i}from"./common/classes.js";import{getWrapperTextStyle as l,getContainerStyle as r}from"./common/styles.js";import{useI18nStore as m,makeStyleResponsive as n}from"@gem-sdk/core";import{createStyle as d,createClass as p,If as a}from"@gem-sdk/system";import{useGpDiscountTag as c}from"./hooks/useGpDiscountTag.js";import"../../../common/const.js";import u from"../../../common/components/TooltipHover.js";import x from"../../../common/components/NoDataState.js";import f from"../../../text/components/Text.js";let g=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:v}=y??{},{t:T}=m(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=c({setting:g,styles:y,builderProps:h,...b});if($)return e(u,{enable:!0,text:T("Not be displayed when published"),position:"bottom",width:"205px",children:e(x,{builderAttrs:h?.builderData,elementType:"secondary",description:T("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(l(y)),C=d(r(y)),I=p(s(y)),E=p(o()),G=p(i({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:G,style:{...n("ta",v)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:a(!w," ",e("div",{className:E,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all gp-items-center",children:[e(f,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(f,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(f,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{g as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{getWrapperTextClass as s,getContainerClass as o,getRootClass as i}from"./common/classes.js";import{getWrapperTextStyle as r,getContainerStyle as l}from"./common/styles.js";import{useI18nStore as m,makeStyleResponsive as n}from"@gem-sdk/core";import{createStyle as d,createClass as p,If as a}from"@gem-sdk/system";import{useGpDiscountTag as c}from"./hooks/useGpDiscountTag.js";import"../../../common/const.js";import u from"../../../common/components/TooltipHover.js";import x from"../../../common/components/NoDataState.js";import"react";import f from"../../../text/components/Text.js";let g=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:v}=y??{},{t:T}=m(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=c({setting:g,styles:y,builderProps:h,...b});if($)return e(u,{enable:!0,text:T("Not be displayed when published"),position:"bottom",width:"205px",children:e(x,{builderAttrs:h?.builderData,elementType:"secondary",description:T("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(r(y)),C=d(l(y)),I=p(s(y)),E=p(o()),G=p(i({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:G,style:{...n("ta",v)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:a(!w," ",e("div",{className:E,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all gp-items-center",children:[e(f,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(f,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(f,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{g as default};
@@ -1,4 +1,4 @@
1
- import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass as i}from"../../common/productFeaturedImage.js";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r}from"../../common/common.js";import{makeStyleResponsive as s,cls as d,template as o}from"@gem-sdk/core";import{getProductImagesClassName as u}from"../../composables/getProductImagesClassName.js";import l from"../../../../../carousel/components/item/CarouselItem.liquid.js";import{getProductImagesStyles as m}from"../../composables/getProductImagesStyles.js";import{getLiquidImageSrcset as g}from"../../../../../image/common/liquidSrcset.js";import n from"../../../../../carousel/components/root/Carousel.liquid.js";import{getProductImagesAttr as p}from"../../composables/getProductImagesAttr.js";import c from"../../../../../video/components/HTML5Embed.liquid.js";import f from"../../../../../image/components/NextImage.liquid.js";import h from"../../../../../image/components/Modal3d.liquid.js";import{LiquidIf as y,LiquidFor as M,Liquid as _,If as $}from"@gem-sdk/system";import b from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as v}from"../../../../helpers/function.js";let w=({builderPropUID:w,children:I,pageContext:q,...x})=>{let{featuredImageCarouselClasses:j,galleryItemClasses:z,featuredCarouselItemClasses:P}=u(x),{featuredImageCarouselStyle:S,featureImageStyle:T,featureImageCarouselOnlyOneImageStyle:R,featureImageOnlyOneImageStyle:W,featureImageCarouselItemStyle:C}=m(x),{featuredImageCarouselSettingAttrs:N}=p(x),k=t(x.ftShape),L=()=>`
1
+ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass as i}from"../../common/productFeaturedImage.js";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r}from"../../common/common.js";import{makeStyleResponsive as s,cls as d,template as o}from"@gem-sdk/core";import{getProductImagesClassName as u}from"../../composables/getProductImagesClassName.js";import l from"../../../../../carousel/components/item/CarouselItem.liquid.js";import{getProductImagesStyles as m}from"../../composables/getProductImagesStyles.js";import{getLiquidImageSrcset as g}from"../../../../../image/common/liquidSrcset.js";import n from"../../../../../carousel/components/root/Carousel.liquid.js";import{getProductImagesAttr as p}from"../../composables/getProductImagesAttr.js";import c from"../../../../../video/components/HTML5Embed.liquid.js";import f from"../../../../../image/components/NextImage.liquid.js";import y from"../../../../../image/components/Modal3d.liquid.js";import{LiquidIf as h,LiquidFor as M,Liquid as _,If as b}from"@gem-sdk/system";import $ from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as v}from"../../../../helpers/function.js";let w=({builderPropUID:w,children:I,pageContext:q,...x})=>{let{featuredImageCarouselClasses:P,galleryItemClasses:j,featuredCarouselItemClasses:T}=u(x),{featuredImageCarouselStyle:z,featureImageStyle:S,featureImageCarouselOnlyOneImageStyle:R,featureImageOnlyOneImageStyle:W,featureImageCarouselItemStyle:C}=m(x),{featuredImageCarouselSettingAttrs:k}=p(x),N=t(x.ftShape),L=()=>`
2
2
  {% case featureMedia.media_type %}
3
3
  {% when 'image' %}
4
4
  ${D()}
@@ -13,31 +13,31 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
13
13
  {% else %}
14
14
  ${F()}
15
15
  {% endcase %}
16
- `,E=()=>h({src:y("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:k}),O=()=>b({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:k}),A=()=>c({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,style:{width:"100%","max-height":"100%"},className:"gp-invisible"}),D=()=>o`
16
+ `,E=()=>y({src:h("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:N}),O=()=>$({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:N}),A=()=>{let e=g({liquidSrc:"featureMedia.preview_image",sizeTarget:"ProductFeatureImage",qualityType:x.qualityType,qualityPercent:x.qualityPercent});return c({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",thumbnailImage:{srcset:e&&h("featureMedia.preview_image != blank",e)},poster:{preload:x?.preload},isCheckLoaded:!0,style:{width:"100%","max-height":"100%"},className:"gp-invisible"})},D=()=>o`
17
17
  ${V(d("gp-w-full gp-transition-opacity",{"group-hover:gp-opacity-0":"other"==x.hoverEffect},"{{shouldHidden}}"))}
18
- ${$(x?.hoverEffect!=="none",`<div class="${d("zoom-element !gp-max-w-none",a())}">
18
+ ${b(x?.hoverEffect!=="none",`<div class="${d("zoom-element !gp-max-w-none",a())}">
19
19
  ${V("image-zoom",!0)}
20
20
  </div>`," ")}
21
- ${$(x?.hoverEffect=="zoom"&&x?.zoomType=="glasses",`<div class="${d("zoom-lens-element",i())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
21
+ ${b(x?.hoverEffect=="zoom"&&x?.zoomType=="glasses",`<div class="${d("zoom-lens-element",i())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
22
22
  `,V=(e,a)=>{let i=g({liquidSrc:"src",sizeTarget:"ProductFeatureImage",qualityType:x.qualityType,qualityPercent:x.qualityPercent});return o`
23
23
  {% assign src = featureMedia.src %}
24
- ${$(a&&"other"==x.hoverEffect,`{% assign media_length = product.media | size %}
24
+ ${b(a&&"other"==x.hoverEffect,`{% assign media_length = product.media | size %}
25
25
  {% assign other_image_index = ${x.otherImage} | plus: 0 %}
26
26
  {% if other_image_index >= media_length %}
27
27
  {% assign other_image_index = media_length | minus: 1 %}
28
28
  {% endif %}
29
29
  {% assign otherImage = product.media[other_image_index] %}
30
- ${y("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
30
+ ${h("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
31
31
  `)}
32
- ${f({srcIsLiquidCode:!0,src:y("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:y("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:i&&y("src != null",i),setting:{layout:x?.ftLayout,aspectRatio:k,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},priority:x?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e}`})}`},F=()=>o`
33
- ${f({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:x?.ftLayout,aspectRatio:k,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},priority:x?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none"})}`,H=r(x.ftShape),G=e(x),J="gp-featured-image-wrapper",B=y("product.media.size > 0",`${I||""} {% assign largestRatio = 0 %}
32
+ ${f({srcIsLiquidCode:!0,src:h("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:h("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:i&&h("src != null",i),setting:{layout:x?.ftLayout,aspectRatio:N,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},priority:x?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e}`})}`},F=()=>o`
33
+ ${f({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:x?.ftLayout,aspectRatio:N,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},priority:x?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none"})}`,H=r(x.ftShape),G=e(x),J="gp-featured-image-wrapper",B=h("product.media.size > 0",`${I||""} {% assign largestRatio = 0 %}
34
34
  ${M("featureMedia in product.media",`
35
35
  {% assign height = featureMedia.height | times: 1.0 %}
36
36
  {% assign width = featureMedia.width | times: 1.0 %}
37
37
  {% assign ratio = height | divided_by: width %}
38
- ${y("ratio > largestRatio","{% assign largestRatio = ratio %}")}
38
+ ${h("ratio > largestRatio","{% assign largestRatio = ratio %}")}
39
39
  `)}
40
- ${M("featureMedia in product.media",`${y("featureMedia.media_type == 'image'",`${M("image in product.images",y("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
40
+ ${M("featureMedia in product.media",`${h("featureMedia.media_type == 'image'",`${M("image in product.images",h("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
41
41
 
42
42
  ${_(`{% assign productImageWidth = 0 %}
43
43
  {% case featureMedia.media_type %}
@@ -46,24 +46,24 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
46
46
  {% else %}
47
47
  {% assign productImageWidth = featureMedia.preview_image.width %}
48
48
  {% endcase %}`)}
49
- ${l({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${z("gp-ft-image-item !gp-min-w-full !gp-max-w-full' undefined")}`,parentId:`${w}-{{section.id}}-{{product.id}}`,style:C,customStyle:{width:"{{productImageWidth}}px"},children:`
49
+ ${l({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${j("gp-ft-image-item !gp-min-w-full !gp-max-w-full' undefined")}`,parentId:`${w}-{{section.id}}-{{product.id}}`,style:C,customStyle:{width:"{{productImageWidth}}px"},children:`
50
50
  <div
51
- class="gp-w-full gp-relative ${y("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
52
- style="${v(s("pb",H))} ${y("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
51
+ class="gp-w-full gp-relative ${h("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
52
+ style="${v(s("pb",H))} ${h("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
53
53
  >
54
54
  ${L()}
55
55
  </div>
56
56
  `})}`)}
57
- `,f({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:x?.preload,setting:{layout:x?.ftLayout,aspectRatio:k,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return _(`
57
+ `,f({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:x?.preload,setting:{layout:x?.ftLayout,aspectRatio:N,qualityType:x?.qualityType,qualityPercent:x?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return _(`
58
58
  {% capture featureImageOnlyOne %}
59
59
  ${_(`
60
60
  {% assign featureMedia = variant.featured_media %}
61
61
  {% unless featureMedia %}
62
62
  {% assign featureMedia = product.featured_media %}
63
63
  {% endunless %}
64
- ${y("product.media.size > 1",(()=>{switch(x?.preDisplay){case"1st-images":return`
64
+ ${h("product.media.size > 1",(()=>{switch(x?.preDisplay){case"1st-images":return`
65
65
  {% assign featureMedia = product.media.first %}
66
- `;case"1st-3d-mode":return M("media in product.media",y("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return M("media in product.media",y("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
66
+ `;case"1st-3d-mode":return M("media in product.media",h("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return M("media in product.media",h("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
67
67
  {% assign featureMedia = variant.featured_media %}
68
68
  {% unless featureMedia %}
69
69
  {% assign featureMedia = product.featured_media %}
@@ -73,7 +73,7 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
73
73
  {% assign height = featureMedia.height | times: 1.0 %}
74
74
  {% assign width = featureMedia.width | times: 1.0 %}
75
75
  {% assign ratio = height | divided_by: width %}
76
- ${y("ratio > largestRatio","{% assign largestRatio = ratio %}")}
76
+ ${h("ratio > largestRatio","{% assign largestRatio = ratio %}")}
77
77
  {% assign productImageWidth = 0 %}
78
78
  {% case featureMedia.media_type %}
79
79
  {% when 'image' %}
@@ -81,10 +81,10 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
81
81
  {% else %}
82
82
  {% assign productImageWidth = featureMedia.preview_image.width %}
83
83
  {% endcase %}
84
- ${y("featureMedia == null","{% assign productImageWidth = 1600 %}")}
84
+ ${h("featureMedia == null","{% assign productImageWidth = 1600 %}")}
85
85
  <div
86
86
  class='gp-feature-image-carousel gp-feature-image-only'
87
- style="${v(T)}"
87
+ style="${v(S)}"
88
88
  >
89
89
  <div
90
90
  class="gp-relative"
@@ -95,12 +95,12 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
95
95
  type="gp-feature-image-only"
96
96
  product-id="{{product.id}}"
97
97
  product-media="{{product.media.size}}"
98
- class="${P(J)}"
98
+ class="${T(J)}"
99
99
  style="${v(R)}"
100
100
  >
101
101
  <div
102
- class="gp-w-full gp-relative ${y("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
103
- style="${v(s("pb",H))} ${y("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
102
+ class="gp-w-full gp-relative ${h("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
103
+ style="${v(s("pb",H))} ${h("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
104
104
  >
105
105
  ${L()}
106
106
  </div>
@@ -109,10 +109,10 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
109
109
  </div>
110
110
  `)}
111
111
  {% endcapture %}
112
- ${y("product.media.size > 1",`
113
- ${$(G,`
114
- ${n({builderProps:{uid:w},rootId:`ft-${w}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:J,rootClass:`${j}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:N,rootStyles:T,styles:S,style:{playSpeed:600},disableMarginAuto:!0,children:B})}
112
+ ${h("product.media.size > 1",`
113
+ ${b(G,`
114
+ ${n({builderProps:{uid:w},rootId:`ft-${w}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:J,rootClass:`${P}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:k,rootStyles:S,styles:z,style:{playSpeed:600},disableMarginAuto:!0,children:B})}
115
115
  `," ")}
116
- ${$(!G,"{{ featureImageOnlyOne }}"," ")}
116
+ ${b(!G,"{{ featureImageOnlyOne }}"," ")}
117
117
  `,"{{ featureImageOnlyOne }}")}
118
118
  `)};export{w as default};
@@ -1,4 +1,4 @@
1
- import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass as i,getVideoHeight as t}from"../../common/productFeaturedImage.js";import{getAspectRatio as r,getPaddingBottomByShapeSetting as s}from"../../common/common.js";import{FEATURE_MEDIA_CENTER_CLASSES as d}from"../../common/classes.js";import{makeStyleResponsive as o,cls as u,template as m}from"@gem-sdk/core";import l from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";import{getProductImagesClassName as p}from"../../composables/getProductImagesClassName.js";import g from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import{getProductImagesStyles as n}from"../../composables/getProductImagesStyles.js";import{getLiquidImageSrcset as c}from"../../../../../image/common/liquidSrcset.js";import{If as f,LiquidIf as h,LiquidFor as y,Liquid as M,createStyle as _}from"@gem-sdk/system";import{getProductImagesAttr as b}from"../../composables/getProductImagesAttr.js";import $ from"../../../../../video/components/HTML5Embed.liquid.js";import v from"../../../../../image/components/NextImage.liquid.js";import w from"../../../../../image/components/Modal3d.liquid.js";import I from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as q}from"../../../../helpers/function.js";let x=({builderPropUID:x,children:S,pageContext:j,...z})=>{let{featuredImageCarouselClasses:P,galleryItemClasses:T,featuredCarouselItemClasses:L}=p({...z,builderProps:{uid:x}}),{featuredImageCarouselStyle:R,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:C,featureImageOnlyOneImageStyle:N,featureImageCarouselItemStyle:k}=n(z),{featuredImageCarouselSettingAttrs:E}=b(z),O=r(z.ftShape),A=f("other"==z.hoverEffect,h("product.media.size > 1","group-hover:gp-opacity-0")),D=()=>`
1
+ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass as i,getVideoHeight as t}from"../../common/productFeaturedImage.js";import{getAspectRatio as r,getPaddingBottomByShapeSetting as s}from"../../common/common.js";import{FEATURE_MEDIA_CENTER_CLASSES as d}from"../../common/classes.js";import{makeStyleResponsive as o,cls as u,template as m}from"@gem-sdk/core";import l from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";import{getProductImagesClassName as p}from"../../composables/getProductImagesClassName.js";import g from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import{getProductImagesStyles as n}from"../../composables/getProductImagesStyles.js";import{getLiquidImageSrcset as c}from"../../../../../image/common/liquidSrcset.js";import{If as f,LiquidIf as h,LiquidFor as y,Liquid as M,createStyle as _}from"@gem-sdk/system";import{getProductImagesAttr as b}from"../../composables/getProductImagesAttr.js";import v from"../../../../../video/components/HTML5Embed.liquid.js";import w from"../../../../../image/components/NextImage.liquid.js";import $ from"../../../../../image/components/Modal3d.liquid.js";import I from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as q}from"../../../../helpers/function.js";let x=({builderPropUID:x,children:S,pageContext:P,...T})=>{let{featuredImageCarouselClasses:j,galleryItemClasses:z,featuredCarouselItemClasses:L}=p({...T,builderProps:{uid:x}}),{featuredImageCarouselStyle:R,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:C,featureImageOnlyOneImageStyle:k,featureImageCarouselItemStyle:N}=n(T),{featuredImageCarouselSettingAttrs:E}=b(T),O=r(T.ftShape),A=f("other"==T.hoverEffect,h("product.media.size > 1","group-hover:gp-opacity-0")),D=()=>`
2
2
  {% case featureMedia.media_type %}
3
3
  {% when 'image' %}
4
4
  ${B()}
@@ -13,24 +13,24 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
13
13
  {% else %}
14
14
  ${J()}
15
15
  {% endcase %}
16
- `,V=()=>w({src:h("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:O}),F=()=>I({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:O}),H=()=>{let e=_({...t({ftLayout:z?.ftLayout,ftShape:z?.ftShape}),...o("objf",z?.ftLayout)}),a=_({...t({ftLayout:z?.ftLayout,ftShape:z?.ftShape})});return $({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:a,poster:{altText:"{{featureMedia.alt | escape}}"},style:{width:"100%","max-height":"100%",...e},className:"gp-invisible"})},B=()=>m`
16
+ `,V=()=>$({src:h("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:O}),F=()=>I({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:O}),H=()=>{let e=_({...t({ftLayout:T?.ftLayout,ftShape:T?.ftShape}),...o("objf",T?.ftLayout)}),a=_({...t({ftLayout:T?.ftLayout,ftShape:T?.ftShape})}),i=c({liquidSrc:"featureMedia.preview_image",sizeTarget:"ProductFeatureImage",qualityType:T.qualityType,qualityPercent:T.qualityPercent});return v({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",thumbnailImage:{srcset:i&&h("featureMedia.preview_image != blank",i)},isCheckLoaded:!0,wrapperStyles:a,poster:{altText:"{{featureMedia.alt | escape}}",preload:T?.preload},style:{width:"100%","max-height":"100%",...e},className:"gp-invisible"})},B=()=>m`
17
17
  ${G(u("gp-w-full gp-transition-opacity",A,"{{shouldHidden}}"))}
18
- ${f(z?.hoverEffect!=="none",`<div class="${u("zoom-element !gp-max-w-none",a())}">
18
+ ${f(T?.hoverEffect!=="none",`<div class="${u("zoom-element !gp-max-w-none",a())}">
19
19
  ${G("image-zoom",!0)}
20
20
  </div>`," ")}
21
- ${f(z?.hoverEffect=="zoom"&&z?.zoomType=="glasses",`<div class="${u("zoom-lens-element",i())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
22
- `,G=(e,a)=>{let i=c({liquidSrc:"src",sizeTarget:"ProductFeatureImage",qualityType:z.qualityType,qualityPercent:z.qualityPercent});return m`
21
+ ${f(T?.hoverEffect=="zoom"&&T?.zoomType=="glasses",`<div class="${u("zoom-lens-element",i())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
22
+ `,G=(e,a)=>{let i=c({liquidSrc:"src",sizeTarget:"ProductFeatureImage",qualityType:T.qualityType,qualityPercent:T.qualityPercent});return m`
23
23
  {% assign src = featureMedia.src %}
24
- ${f(a&&"other"==z.hoverEffect,`{% assign media_length = product.media | size %}
25
- {% assign other_image_index = ${z.otherImage} | plus: 0 %}
24
+ ${f(a&&"other"==T.hoverEffect,`{% assign media_length = product.media | size %}
25
+ {% assign other_image_index = ${T.otherImage} | plus: 0 %}
26
26
  {% if other_image_index >= media_length %}
27
27
  {% assign other_image_index = media_length | minus: 1 %}
28
28
  {% endif %}
29
29
  {% assign otherImage = product.media[other_image_index] %}
30
30
  ${h("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
31
31
  `)}
32
- ${v({srcIsLiquidCode:!0,src:h("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:h("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:i&&h("src != null",i),setting:{layout:z?.ftLayout,aspectRatio:O,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e??""}`})}`},J=()=>m`
33
- ${v({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:z?.ftLayout,aspectRatio:O,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none"})}`,K=s(z.ftShape),Q=e(z),U="gp-featured-image-wrapper",X=h("product.media.size > 0",`{% assign largestRatio = 0 %}
32
+ ${w({srcIsLiquidCode:!0,src:h("src != null","{{src | image_url}}","https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:h("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:i&&h("src != null",i),setting:{layout:T?.ftLayout,aspectRatio:O,qualityType:T?.qualityType,qualityPercent:T?.qualityPercent},priority:T?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e??""}`})}`},J=()=>m`
33
+ ${w({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",setting:{layout:T?.ftLayout,aspectRatio:O,qualityType:T?.qualityType,qualityPercent:T?.qualityPercent},priority:T?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none"})}`,K=s(T.ftShape),Q=e(T),U="gp-featured-image-wrapper",X=h("product.media.size > 0",`{% assign largestRatio = 0 %}
34
34
  ${y("featureMedia in product.media",`
35
35
  ${h("featureMedia.media_type == 'video' and featureMedia.preview_image",`{% assign height = featureMedia.preview_image.height | times: 1.0 %}
36
36
  {% assign width = featureMedia.preview_image.width | times: 1.0 %}`,`{% assign height = featureMedia.height | times: 1.0 %}
@@ -47,7 +47,7 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
47
47
  {% else %}
48
48
  {% assign productImageWidth = featureMedia.preview_image.width %}
49
49
  {% endcase %}`)}
50
- ${l({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${T("gp-ft-image-item !gp-min-w-full !gp-max-w-full ")}`,parentId:`ft-${x}-{{section.id}}-{{product.id}}`,style:k,customStyle:{width:"{{productImageWidth}}px"},children:`
50
+ ${l({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${z("gp-ft-image-item !gp-min-w-full !gp-max-w-full ")}`,parentId:`ft-${x}-{{section.id}}-{{product.id}}`,style:N,customStyle:{width:"{{productImageWidth}}px"},children:`
51
51
  <div
52
52
  class="gp-w-full gp-relative ${h("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")} ${h("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'",`{{ '${d}' }}`)}"
53
53
  style="${q(o("pb",K))}"
@@ -55,14 +55,14 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
55
55
  ${D()}
56
56
  </div>
57
57
  `})}`)}
58
- `,v({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:z?.preload,setting:{layout:z?.ftLayout,aspectRatio:O,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return M(`
58
+ `,w({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:T?.preload,setting:{layout:T?.ftLayout,aspectRatio:O,qualityType:T?.qualityType,qualityPercent:T?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none"}));return M(`
59
59
  {% capture featureImageOnlyOne %}
60
60
  ${M(`
61
61
  {% assign featureMedia = variant.featured_media %}
62
62
  {% unless featureMedia %}
63
63
  {% assign featureMedia = product.featured_media %}
64
64
  {% endunless %}
65
- ${h("product.media.size > 1",(()=>{switch(z?.preDisplay){case"1st-images":return`
65
+ ${h("product.media.size > 1",(()=>{switch(T?.preDisplay){case"1st-images":return`
66
66
  {% assign featureMedia = product.media.first %}
67
67
  `;case"1st-3d-mode":return y("media in product.media",h("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return y("media in product.media",h("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
68
68
  {% assign featureMedia = variant.featured_media %}
@@ -89,7 +89,7 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
89
89
  >
90
90
  <div
91
91
  class="gp-relative"
92
- style="${q(N)}"
92
+ style="${q(k)}"
93
93
  >
94
94
  ${S}
95
95
  <div
@@ -112,7 +112,7 @@ import{checkRenderFeaturedCarousel as e,getZoomImageClass as a,getZoomLenClass a
112
112
  {% endcapture %}
113
113
  ${h("product.media.size > 1",`
114
114
  ${f(Q,`
115
- ${g({builderProps:{uid:x},rootId:`ft-${x}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:U,rootClass:`${P}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:E,rootStyles:W,styles:R,style:{playSpeed:600},disableMarginAuto:!0,children:X,productBadgeLiquid:S||"",carouselType:"feature_image"})}
115
+ ${g({builderProps:{uid:x},rootId:`ft-${x}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:U,rootClass:`${j}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:E,rootStyles:W,styles:R,style:{playSpeed:600},disableMarginAuto:!0,children:X,productBadgeLiquid:S||"",carouselType:"feature_image"})}
116
116
  `," ")}
117
117
  ${f(!Q,"{{ featureImageOnlyOne }}"," ")}
118
118
  `,"{{ featureImageOnlyOne }}")}