@gem-sdk/components 12.0.0-dev.57 → 12.0.0-dev.59

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 (27) hide show
  1. package/dist/cjs/article/components/ArticleContent.js +2 -2
  2. package/dist/cjs/article/components/ArticleExcerpt.js +1 -1
  3. package/dist/cjs/common/components/NoDataState.js +1 -1
  4. package/dist/cjs/product/components/ProductNotFound.js +1 -1
  5. package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
  6. package/dist/cjs/product/components/product-badge/common/attrs.js +1 -1
  7. package/dist/cjs/product/components/product-bundle/ProductBundleDiscount.js +1 -1
  8. package/dist/cjs/product/components/product-description/ProductDescription.js +1 -1
  9. package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
  10. package/dist/cjs/product/components/product-images-v2/ProductImageV2.js +2 -2
  11. package/dist/cjs/product/components/product-images-v3/ProductImageV3.js +2 -2
  12. package/dist/cjs/product/components/product-variants/ProductVariants.js +1 -1
  13. package/dist/cjs/video/components/HTML5Embed.liquid.js +27 -15
  14. package/dist/esm/article/components/ArticleContent.js +3 -3
  15. package/dist/esm/article/components/ArticleExcerpt.js +1 -1
  16. package/dist/esm/common/components/NoDataState.js +1 -1
  17. package/dist/esm/product/components/ProductNotFound.js +1 -1
  18. package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
  19. package/dist/esm/product/components/product-badge/common/attrs.js +1 -1
  20. package/dist/esm/product/components/product-bundle/ProductBundleDiscount.js +1 -1
  21. package/dist/esm/product/components/product-description/ProductDescription.js +1 -1
  22. package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
  23. package/dist/esm/product/components/product-images-v2/ProductImageV2.js +2 -2
  24. package/dist/esm/product/components/product-images-v3/ProductImageV3.js +2 -2
  25. package/dist/esm/product/components/product-variants/ProductVariants.js +1 -1
  26. package/dist/esm/video/components/HTML5Embed.liquid.js +28 -16
  27. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../common/components/NoDataState.js"),helpers=require("../common/helpers.js");const ArticleContent=({styles:e,builderProps:t})=>{let r=core.useArticleStore(e=>e.article),[i,o]=React.useState(!1),p=React.useRef(null),s=core.useCurrentDevice(),c=core.useShopStore(e=>e.storefrontUrl),n=core.getResponsiveValueByScreen(e?.hasLineClamp,s),a=core.getResponsiveValueByScreen(e?.lineClamp,s),l=()=>{if(!c)return;let e=new URL(c);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};React.useEffect(()=>{o(!1)},[n,a,r?.description]);let d=core.composeTypographyClassName(e?.typo,e?.typography),m=core.composeTypographyStyle(e?.typo,e?.typography),y=`
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../common/components/NoDataState.js"),helpers=require("../common/helpers.js");const ArticleContent=({styles:e,builderProps:t})=>{let r=core.useArticleStore(e=>e.article),[o,i]=React.useState(!1),p=React.useRef(null),s=core.useCurrentDevice(),c=core.useShopStore(e=>e.storefrontUrl),{t:n}=core.useI18nStore(),a=core.getResponsiveValueByScreen(e?.hasLineClamp,s),l=core.getResponsiveValueByScreen(e?.lineClamp,s),d=()=>{if(!c)return;let e=new URL(c);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};React.useEffect(()=>{i(!1)},[a,l,r?.description]);let m=core.composeTypographyClassName(e?.typo,e?.typography),y=core.composeTypographyStyle(e?.typo,e?.typography),u=`
3
3
  .gp-p-description-text a:empty,
4
4
  .gp-p-description-text ul:empty,
5
5
  .gp-p-description-text dl:empty,
@@ -16,4 +16,4 @@
16
16
  display: none;
17
17
  }
18
18
  ${helpers.styleOverride}
19
- `;return jsxRuntime.jsx("div",{"data-id":t?.uid,id:`shopify-text-element-${t?.uid}`,className:"gp-article-description","data-article-id":r?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:r?.content?.html?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!core.isSafari()&&jsxRuntime.jsx("style",{children:y}),jsxRuntime.jsx("div",{ref:p,className:core.cls("gp-p-description-text gp-content-text-override gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre",d),style:{...core.getGlobalColorStateStyle("c",e?.color),...core.makeStyleResponsive("ta",e?.textAlign),...n&&!i?core.makeStyleResponsive("line-clamp",e?.lineClamp):{},...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyle({tt:e?.transform}),...m},dangerouslySetInnerHTML:{__html:r?.content?.html}})]}):jsxRuntime.jsx("div",{children:jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Inform and provide value to the audience with article content.",descriptionActions:[{text:"Add article content",callback:l},{text:"sync data",callback:"syncArticle"}]})})})};exports.default=ArticleContent;
19
+ `;return jsxRuntime.jsx("div",{"data-id":t?.uid,id:`shopify-text-element-${t?.uid}`,className:"gp-article-description","data-article-id":r?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:r?.content?.html?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!core.isSafari()&&jsxRuntime.jsx("style",{children:u}),jsxRuntime.jsx("div",{ref:p,className:core.cls("gp-p-description-text gp-content-text-override gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre",m),style:{...core.getGlobalColorStateStyle("c",e?.color),...core.makeStyleResponsive("ta",e?.textAlign),...a&&!o?core.makeStyleResponsive("line-clamp",e?.lineClamp):{},...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyle({tt:e?.transform}),...y},dangerouslySetInnerHTML:{__html:r?.content?.html}})]}):jsxRuntime.jsx("div",{children:jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:n("Inform and provide value to the audience with article content."),descriptionActions:[{text:n("Add article content"),callback:d},{text:n("sync data"),callback:"syncArticle"}]})})})};exports.default=ArticleContent;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Link=require("next/link"),Text=require("../../text/components/Text.js"),core=require("@gem-sdk/core"),React=require("react"),useArticleLink=require("../hooks/useArticleLink.js"),NoDataState=require("../../common/components/NoDataState.js");const ArticleExcerpt=({setting:e,styles:t,builderProps:r})=>{let i=core.useArticleStore(e=>e.article),s=core.useShopStore(e=>e.storefrontUrl),c=React.useMemo(()=>i?.content?.excerptHtml,[i]),{shopifyArticleLink:l}=useArticleLink.useArticleLink(),n=()=>{if(!s)return;let e=new URL(s);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};return jsxRuntime.jsx("div",{id:`shopify-text-element-${r?.uid}`,"data-article-id":i?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:i&&c?e?.linkArticle?jsxRuntime.jsx(Link,{href:l,title:i?.title,children:jsxRuntime.jsx(Text.default,{builderProps:r,styles:t,setting:{...e,text:c,excludeFlex:!0}})}):jsxRuntime.jsx(Text.default,{builderProps:r,styles:t,setting:{...e,text:c,excludeFlex:!0}}):jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Provide a brief summary or teaser of the article. ",descriptionActions:[{text:"Add article excerpt",callback:n},{text:"sync data",callback:"syncArticle"}]})})};exports.default=ArticleExcerpt;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Link=require("next/link"),Text=require("../../text/components/Text.js"),core=require("@gem-sdk/core"),React=require("react"),useArticleLink=require("../hooks/useArticleLink.js"),NoDataState=require("../../common/components/NoDataState.js");const ArticleExcerpt=({setting:e,styles:t,builderProps:r})=>{let i=core.useArticleStore(e=>e.article),s=core.useShopStore(e=>e.storefrontUrl),c=React.useMemo(()=>i?.content?.excerptHtml,[i]),{shopifyArticleLink:n}=useArticleLink.useArticleLink(),{t:l}=core.useI18nStore(),o=()=>{if(!s)return;let e=new URL(s);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};return jsxRuntime.jsx("div",{id:`shopify-text-element-${r?.uid}`,"data-article-id":i?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:i&&c?e?.linkArticle?jsxRuntime.jsx(Link,{href:n,title:i?.title,children:jsxRuntime.jsx(Text.default,{builderProps:r,styles:t,setting:{...e,text:c,excludeFlex:!0}})}):jsxRuntime.jsx(Text.default,{builderProps:r,styles:t,setting:{...e,text:c,excludeFlex:!0}}):jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:l("Provide a brief summary or teaser of the article. "),descriptionActions:[{text:l("Add article excerpt"),callback:o},{text:l("sync data"),callback:"syncArticle"}]})})};exports.default=ArticleExcerpt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core");const NoDataState=({title:e,description:t,elementType:r,builderAttrs:n,descriptionActions:s,primaryBtnTitle:l,secondaryBtnTitle:p,primaryBtnCb:i,secondaryBtnCb:c,additionalMedia:o,customClass:a,icon:d=!0,rawMode:g,children:u})=>{let x=React.useRef(null),{isEditMode:m,isPreviewSharePageMode:b}=core.useRenderMode(),[f,j]=React.useState("row"),h=()=>{let e=x.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},C=()=>{let e=x.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},w=()=>{if(m)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:n?.["data-uid"]??n?.uid,value:!0,tag:n?.["data-component-tag"]??n?.tag}});window.dispatchEvent(e)},R={syncProduct:h,syncArticle:C};return(React.useEffect(()=>{let e=new ResizeObserver(()=>{let e=x.current?x.current?.offsetWidth:0;j(e>272?"row":"column")});return x.current&&e.observe(x.current),()=>{e?.disconnect()}},[]),b)?null:jsxRuntime.jsxs("div",{...n,ref:x,className:core.cls("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",g?"gp-p-0":"gp-p-2"),onClick:w,children:[jsxRuntime.jsxs("div",{className:core.cls("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===r?"gp-bg-[#FFF1DF]":"",g?"gp-justify-center":"",a||""),style:{flexDirection:f},children:[d&&!g&&jsxRuntime.jsx("div",{className:core.cls("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===r?"":"gp-bg-[#FDB913]"),children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===r?"#916A00":"#212121"})]})}),jsxRuntime.jsxs("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[e&&jsxRuntime.jsx("p",{className:core.cls("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:e}}),t&&jsxRuntime.jsxs("p",{className:core.cls(g?"gp-mb-0":"gp-mb-[4px]","primary"===r?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[t," ",s?.map((e,t)=>{let r=t?"or":"",n="string"==typeof e.callback?R?.[e.callback]:e.callback;return jsxRuntime.jsxs("span",{children:[" ",r," ",jsxRuntime.jsx("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:n,children:e.text})]},`description-action-${t}`)})]}),(l||p)&&jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[jsxRuntime.jsx("button",{onClick:i,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:l}),jsxRuntime.jsx("button",{onClick:c,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:p})]})]})]}),o&&jsxRuntime.jsx("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:o}}),core.filterToolbarPreview(u,!0)]})};exports.default=NoDataState;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core");const NoDataState=({title:e,description:t,elementType:r,builderAttrs:n,descriptionActions:s,primaryBtnTitle:l,secondaryBtnTitle:p,primaryBtnCb:i,secondaryBtnCb:c,additionalMedia:o,customClass:a,icon:d=!0,rawMode:g,children:u})=>{let{t:x}=core.useI18nStore(),m=React.useRef(null),{isEditMode:b,isPreviewSharePageMode:f}=core.useRenderMode(),[j,h]=React.useState("row"),C=()=>{let e=m.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},w=()=>{let e=m.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},R=()=>{if(b)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:n?.["data-uid"]??n?.uid,value:!0,tag:n?.["data-component-tag"]??n?.tag}});window.dispatchEvent(e)},v={syncProduct:C,syncArticle:w};return(React.useEffect(()=>{let e=new ResizeObserver(()=>{let e=m.current?m.current?.offsetWidth:0;h(e>272?"row":"column")});return m.current&&e.observe(m.current),()=>{e?.disconnect()}},[]),f)?null:jsxRuntime.jsxs("div",{...n,ref:m,className:core.cls("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",g?"gp-p-0":"gp-p-2"),onClick:R,children:[jsxRuntime.jsxs("div",{className:core.cls("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===r?"gp-bg-[#FFF1DF]":"",g?"gp-justify-center":"",a||""),style:{flexDirection:j},children:[d&&!g&&jsxRuntime.jsx("div",{className:core.cls("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===r?"":"gp-bg-[#FDB913]"),children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===r?"#916A00":"#212121"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===r?"#916A00":"#212121"})]})}),jsxRuntime.jsxs("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[e&&jsxRuntime.jsx("p",{className:core.cls("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:e}}),t&&jsxRuntime.jsxs("p",{className:core.cls(g?"gp-mb-0":"gp-mb-[4px]","primary"===r?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[t," ",s?.map((e,t)=>{let r=t?x("or"):"",n="string"==typeof e.callback?v?.[e.callback]:e.callback;return jsxRuntime.jsxs("span",{children:[" ",r," ",jsxRuntime.jsx("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:n,children:e.text})]},`description-action-${t}`)})]}),(l||p)&&jsxRuntime.jsxs("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[jsxRuntime.jsx("button",{onClick:i,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:l}),jsxRuntime.jsx("button",{onClick:c,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:p})]})]})]}),o&&jsxRuntime.jsx("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:o}}),core.filterToolbarPreview(u,!0)]})};exports.default=NoDataState;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../common/components/NoDataState.js");const ProductNotFound=({collectionHandle:t,productSrc:e,builderAttrs:o,children:r})=>{let n="STATIC"===core.usePageType(),c=core.useShopStore(t=>t.storefrontToken),a=core.useShopStore(t=>t.storefrontUrl),i="Collection"===e,[u,d]=React.useState(""),[s,l]=React.useState("get product"),[p,y]=React.useState("");React.useEffect(()=>{if(i){if(!t){d("We cannot find any collections from your Shopify store. Please try manually syncing the data from Shopify or add a new collection."),l("get collection"),y("collection");return}d("We cannot find any product of this collection from your Shopify store? Please try manually syncing the data from Shopify or add a new product to your collection."),l("get product of collection"),y("product");return}if(n&&!c){y("product"),d("We can not get your products from Shopify");return}y("product"),l("get product"),d("We cannot find any products from your Shopify store. Please try manually syncing the data from Shopify or add a new product.")},[t,i,n,c]);let f=React.useMemo(()=>{if(!a)return;let t=new URL(a);return i?`${t.protocol}//${t.host}/admin/collections`:`${t.protocol}//${t.host}/admin/products`},[i,a]),m=t=>{let e=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:t}});window.dispatchEvent(e)};return jsxRuntime.jsx(NoDataState.default,{elementType:"primary",children:r,builderAttrs:o,title:`Can not ${s} from Shopify`,description:u,primaryBtnTitle:`Add ${p}`,secondaryBtnTitle:"Sync from Shopify",primaryBtnCb:()=>{f&&window.open(f,"_blank")},secondaryBtnCb:()=>m(o?.["data-uid"]??o?.uid)})};exports.default=ProductNotFound;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../common/components/NoDataState.js");const ProductNotFound=({collectionHandle:t,productSrc:e,builderAttrs:o,children:r})=>{let n="STATIC"===core.usePageType(),c=core.useShopStore(t=>t.storefrontToken),a=core.useShopStore(t=>t.storefrontUrl),i="Collection"===e,[u,d]=React.useState(""),[s,l]=React.useState("get product"),[p,y]=React.useState(""),{t:f}=core.useI18nStore();React.useEffect(()=>{if(i){if(!t){d(f("We cannot find any collections from your Shopify store. Please try manually syncing the data from Shopify or add a new collection.")),l(f("get collection")),y(f("collection"));return}d(f("We cannot find any product of this collection from your Shopify store? Please try manually syncing the data from Shopify or add a new product to your collection.")),l(f("get product of collection")),y(f("product"));return}if(n&&!c){y(f("product")),d(f("We can not get your products from Shopify"));return}y(f("product")),l(f("get product")),d(f("We cannot find any products from your Shopify store. Please try manually syncing the data from Shopify or add a new product."))},[t,i,n,c]);let m=React.useMemo(()=>{if(!a)return;let t=new URL(a);return i?`${t.protocol}//${t.host}/admin/collections`:`${t.protocol}//${t.host}/admin/products`},[i,a]),S=t=>{let e=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:t}});window.dispatchEvent(e)};return jsxRuntime.jsx(NoDataState.default,{elementType:"primary",children:r,builderAttrs:o,title:f("Can not {textLink} from Shopify",{textLink:s}),description:u,primaryBtnTitle:f("Add {entity}",{entity:p}),secondaryBtnTitle:f("Sync from Shopify"),primaryBtnCb:()=>{m&&window.open(m,"_blank")},secondaryBtnCb:()=>S(o?.["data-uid"]??o?.uid)})};exports.default=ProductNotFound;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),common=require("./utils/common.js");require("./constants.js");var NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js");const ProductBadge=e=>{let{setting:s,styles:t,children:r,...a}=e,l=core.useProduct(),c=core.useCurrentVariant(),{moneyFormat:o}=core.useMoneyFormat(),n=core.useCurrentDevice(),{useProductCompareAtPrice:m}=core.useProductBundleDiscount(),i=a?.["bundle-item"],y=core.useEditorMode(),{isEditMode:u}=core.useRenderMode(),d="STATIC"===core.usePageType(),g=common.getBadgeContent({detail:l,currentVariant:c,bundleItem:i,useProductCompareAtPrice:m},s?.displayContent,o),j=common.getIsNoDiscountState({props:e,product:l,currentVariant:c,moneyFormat:o,useProductCompareAtPrice:m}),x=system.createClass({...classes.getContainerClasses({mode:y,isInstant:d,product:l,currentVariant:c,props:e})}),C=system.createStyle({...styles.getContainerStyle(e)}),p=system.createAttr({...attrs.getEditTooltipAttrs(e)}),S=system.createAttr({...attrs.getNoDataAttrs(e)}),v=system.createClass({...classes.getWrapperClasses(e)}),T=system.createClass({...classes.getSubWrapperClass(e,n)}),A=system.createStyle({...styles.getSubWrapperStyle({props:e,product:l,currentVariant:c,isEditMode:u})}),N=system.createAttr({...attrs.getSubWrapperAttrs(e,l)}),R=styles.getContentStyleInternal(e),h=system.createClass({...classes.getTextContainerClasses()}),q=system.createAttr({...attrs.getContainerAttrs(e)}),I=system.createClass({...classes.getTextWrapperClasses()}),f=system.createStyle({...styles.getTextBadgeWrapperStyles({setting:s,styles:t})}),D=system.createClass({...classes.getTextContentClasses(t)}),P=system.createStyle({...styles.getTextContentStyle({setting:s,styles:t})}),b=system.createAttr({...attrs.getTextContentAttrs()}),W=system.createClass({...classes.getImageContainerClasses()}),B=system.createStyle({...styles.getImageContainerStyles({setting:s,styles:t})}),M=system.createClass({...classes.getImageClasses()}),H=system.createAttr({...attrs.getImageAttr({setting:s})});return l?jsxRuntime.jsxs("div",{...q,style:C,className:x,children:[system.If(u&&j,jsxRuntime.jsx(TooltipHover.default,{...p,children:jsxRuntime.jsx(NoDataState.default,{...S})}),jsxRuntime.jsx("div",{className:v,children:jsxRuntime.jsxs("div",{...N,className:T,style:A,children:[jsxRuntime.jsx("style",{children:R}),system.If(s?.shape!=="image",jsxRuntime.jsx("div",{className:h,children:jsxRuntime.jsx("div",{className:I,style:f,children:jsxRuntime.jsx("pre",{...b,className:D,style:P,children:g})})}),jsxRuntime.jsx("div",{className:W,style:B,children:jsxRuntime.jsx("img",{...H,className:M,alt:""})}))]})})),core.filterToolbarPreview(r,!0)]}):null};exports.default=ProductBadge;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),common=require("./utils/common.js");require("./constants.js");var NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js");const ProductBadge=e=>{let{t:s}=core.useI18nStore(),{setting:t,styles:r,children:a,builderAttrs:l,...o}=e,c=core.useProduct(),n=core.useCurrentVariant(),{moneyFormat:m}=core.useMoneyFormat(),i=core.useCurrentDevice(),{useProductCompareAtPrice:y}=core.useProductBundleDiscount(),u=o?.["bundle-item"],d=core.useEditorMode(),{isEditMode:g}=core.useRenderMode(),j="STATIC"===core.usePageType(),x=common.getBadgeContent({detail:c,currentVariant:n,bundleItem:u,useProductCompareAtPrice:y},t?.displayContent,m),C=common.getIsNoDiscountState({props:e,product:c,currentVariant:n,moneyFormat:m,useProductCompareAtPrice:y}),p=system.createClass({...classes.getContainerClasses({mode:d,isInstant:j,product:c,currentVariant:n,props:e})}),S=system.createStyle({...styles.getContainerStyle(e)}),T=system.createAttr({...attrs.getEditTooltipAttrs(e)}),v=system.createClass({...classes.getWrapperClasses(e)}),N=system.createClass({...classes.getSubWrapperClass(e,i)}),R=system.createStyle({...styles.getSubWrapperStyle({props:e,product:c,currentVariant:n,isEditMode:g})}),A=system.createAttr({...attrs.getSubWrapperAttrs(e,c)}),h=styles.getContentStyleInternal(e),q=system.createClass({...classes.getTextContainerClasses()}),I=system.createAttr({...attrs.getContainerAttrs(e)}),f=system.createClass({...classes.getTextWrapperClasses()}),P=system.createStyle({...styles.getTextBadgeWrapperStyles({setting:t,styles:r})}),b=system.createClass({...classes.getTextContentClasses(r)}),D=system.createStyle({...styles.getTextContentStyle({setting:t,styles:r})}),W=system.createAttr({...attrs.getTextContentAttrs()}),B=system.createClass({...classes.getImageContainerClasses()}),M=system.createStyle({...styles.getImageContainerStyles({setting:t,styles:r})}),H=system.createClass({...classes.getImageClasses()}),k=system.createAttr({...attrs.getImageAttr({setting:t})});return c?jsxRuntime.jsxs("div",{...I,style:S,className:p,children:[system.If(g&&C,jsxRuntime.jsx(TooltipHover.default,{...T,children:jsxRuntime.jsx(NoDataState.default,{...l,elementType:"secondary",description:s("No discount"),rawMode:!0})}),jsxRuntime.jsx("div",{className:v,children:jsxRuntime.jsxs("div",{...A,className:N,style:R,children:[jsxRuntime.jsx("style",{children:h}),system.If(t?.shape!=="image",jsxRuntime.jsx("div",{className:q,children:jsxRuntime.jsx("div",{className:f,style:P,children:jsxRuntime.jsx("pre",{...W,className:b,style:D,children:x})})}),jsxRuntime.jsx("div",{className:B,style:M,children:jsxRuntime.jsx("img",{...k,className:H,alt:""})}))]})})),core.filterToolbarPreview(a,!0)]}):null};exports.default=ProductBadge;
@@ -1 +1 @@
1
- "use strict";const getImageAttr=({setting:t})=>({src:t?.image?.src,alt:t?.image?.alt,loading:"lazy"}),getContainerAttrs=t=>{let{builderAttrs:e,builderProps:r}=t;return{...e,"data-id":r?.uid||"",id:`g-product-badge-${r?.uid}`,"gp-data-hidden":"false"}},getEditTooltipAttrs=t=>{let{setting:e}=t,r=e?.positionWithImage==="outside";return{enable:!0,text:"Not be displayed when published",position:r?"bottom":"right",width:"205px"}},getNoDataAttrs=t=>{let{builderAttrs:e}=t;return{...e,elementType:"secondary",description:"No discount",rawMode:!0}},getSubWrapperAttrs=(t,e)=>{let{builderProps:r}=t,o=e?e?.baseID?.replace("gid://shopify/Product/",""):"";return{"data-product-id":o||"",id:r?.uid||""}},getTextContentAttrs=()=>({id:"product-badge-content"});exports.getContainerAttrs=getContainerAttrs,exports.getEditTooltipAttrs=getEditTooltipAttrs,exports.getImageAttr=getImageAttr,exports.getNoDataAttrs=getNoDataAttrs,exports.getSubWrapperAttrs=getSubWrapperAttrs,exports.getTextContentAttrs=getTextContentAttrs;
1
+ "use strict";const getImageAttr=({setting:t})=>({src:t?.image?.src,alt:t?.image?.alt,loading:"lazy"}),getContainerAttrs=t=>{let{builderAttrs:e,builderProps:r}=t;return{...e,"data-id":r?.uid||"",id:`g-product-badge-${r?.uid}`,"gp-data-hidden":"false"}},getEditTooltipAttrs=t=>{let{setting:e}=t,r=e?.positionWithImage==="outside";return{enable:!0,text:"Not be displayed when published",position:r?"bottom":"right",width:"205px"}},getSubWrapperAttrs=(t,e)=>{let{builderProps:r}=t,i=e?e?.baseID?.replace("gid://shopify/Product/",""):"";return{"data-product-id":i||"",id:r?.uid||""}},getTextContentAttrs=()=>({id:"product-badge-content"});exports.getContainerAttrs=getContainerAttrs,exports.getEditTooltipAttrs=getEditTooltipAttrs,exports.getImageAttr=getImageAttr,exports.getSubWrapperAttrs=getSubWrapperAttrs,exports.getTextContentAttrs=getTextContentAttrs;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useProductBundleDataState=require("./hooks/useProductBundleDataState.js"),useProductBundleDiscountState=require("./hooks/useProductBundleDiscountState.js"),ProductBundleDiscountChildrenItem=require("./ProductBundleDiscountChildrenItem.js");const ProductBundleDiscount=({builderAttrs:e,style:t,children:s,setting:u,styles:n,advanced:l})=>{let{isEditMode:r,isPreviewSharePageMode:a}=core.useRenderMode(),{isSelected:i,setSelected:d}=useProductBundleDiscountState.default(u),{emitRedirectSetupPage:c,redirectGuideline:o,svgVertical:m,svgHorizontal:y}=useProductBundleDataState.default(),j=system.createClass(classes.getContainerClasses(u,l?.cssClass)),S=system.createClass(classes.getNoDiscountClasses),h=system.createStyle(styles.getSizeSettings(n)?.gap),D=system.createStyle(styles.getContainerStyles(h,n,t));if(!u?.bundleItems?.length&&r)return jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Increase AOV with bundle quantity.",descriptionActions:[{text:"Setup bundle discount",callback:c},{text:"read guideline",callback:o}],additionalMedia:u?.layout=="horizontal-layout"?y:m});let x=(e,t)=>{if(u?.hideNoDiscountItem&&e?.discountType==="no_discount")return null;let l=s?.[t];if(React.isValidElement(l))return jsxRuntime.jsx(ProductBundleDiscountChildrenItem.default,{index:t,childItem:l,setting:u,styles:n,isSelected:i(t),setSelected:d,bundleItem:e},t)},p=(core.isEmptyChildren(s)||u?.bundleItems?.length==0)&&!a;return jsxRuntime.jsxs("div",{...e,className:j,style:D,children:[system.If(p,jsxRuntime.jsx("div",{className:S,children:"This product has no bundle discount"})),u?.bundleItems?.map((e,t)=>x(e,t))]})};exports.default=ProductBundleDiscount;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useProductBundleDataState=require("./hooks/useProductBundleDataState.js"),useProductBundleDiscountState=require("./hooks/useProductBundleDiscountState.js"),ProductBundleDiscountChildrenItem=require("./ProductBundleDiscountChildrenItem.js");const ProductBundleDiscount=({builderAttrs:e,style:t,children:s,setting:u,styles:n,advanced:l})=>{let{isEditMode:r,isPreviewSharePageMode:a}=core.useRenderMode(),{isSelected:i,setSelected:o}=useProductBundleDiscountState.default(u),{emitRedirectSetupPage:c,redirectGuideline:d,svgVertical:m,svgHorizontal:y}=useProductBundleDataState.default(),{t:S}=core.useI18nStore(),j=system.createClass(classes.getContainerClasses(u,l?.cssClass)),h=system.createClass(classes.getNoDiscountClasses),D=system.createStyle(styles.getSizeSettings(n)?.gap),x=system.createStyle(styles.getContainerStyles(D,n,t));if(!u?.bundleItems?.length&&r)return jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:S("Increase AOV with bundle quantity."),descriptionActions:[{text:S("Setup bundle discount"),callback:c},{text:S("read guideline"),callback:d}],additionalMedia:u?.layout=="horizontal-layout"?y:m});let p=(e,t)=>{if(u?.hideNoDiscountItem&&e?.discountType==="no_discount")return null;let l=s?.[t];if(React.isValidElement(l))return jsxRuntime.jsx(ProductBundleDiscountChildrenItem.default,{index:t,childItem:l,setting:u,styles:n,isSelected:i(t),setSelected:o,bundleItem:e},t)},g=(core.isEmptyChildren(s)||u?.bundleItems?.length==0)&&!a;return jsxRuntime.jsxs("div",{...e,className:j,style:x,children:[system.If(g,jsxRuntime.jsx("div",{className:h,children:"This product has no bundle discount"})),u?.bundleItems?.map((e,t)=>p(e,t))]})};exports.default=ProductBundleDiscount;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),helpers=require("./common/helpers.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useGpDescription=require("./hooks/useGpDescription.js");const ProductDescription=e=>{let{setting:s,advanced:t,builderProps:r}=e,{htmlTag:i}=s??{},a="html"===i?"div":"p",c=core.useProduct(),l=core.useCurrentDevice(),n=core.getResponsiveValueByScreen(s?.hasLineClamp,l),{ref:o,open:m,isShowViewMore:u,handleToggleShowMore:p,mode:d,redirectProductShopifyLink:y}=useGpDescription.useGpDescription(s),x=system.createClass({"gp-product-description":!0,[t?.cssClass]:!0}),j=system.createClass(classes.getClasses({setting:s,isLiquid:!1})),g=system.createClass(classes.getButtonClasses({setting:s})),h=system.createClass({"gp-show-more-text":!0}),C=system.createClass({"gp-show-more-icon gp-ml-1":!0,...m?{"gp-rotate-180":!0}:{}}),R=system.createClass(classes.getClassPreBuilt()),S=system.createStyle({...styles.getTextStyle({setting:s}),...m?{}:core.makeStyleResponsive("line-clamp",core.makeLineClamp(s?.lineClamp,s?.hasLineClamp))}),v=system.createStyle(styles.getButtonStyle({setting:s})),D=system.createAttr({"data-id":`${r?.uid}`}),N=system.createAttr({"data-gp-text":""}),{gpDescriptionCss:f,textDescriptionCss:k}=styles.getStaticCss(),q=!c?.descriptionHtml;return q&&"edit"===d?jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Highlight key benefits with product description.",descriptionActions:[{text:"Add description",callback:y},{text:"sync data",callback:"syncProduct"}]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(q,"",jsxRuntime.jsxs("div",{...D,className:x,children:[jsxRuntime.jsx("style",{children:k}),jsxRuntime.jsx("style",{children:f}),jsxRuntime.jsx("div",{className:R}),jsxRuntime.jsx(a,{ref:o,...N,className:j,style:S,dangerouslySetInnerHTML:{__html:c?.descriptionHtml||""}}),system.If(n&&u,jsxRuntime.jsxs("button",{className:g,style:v,onClick:p,children:[jsxRuntime.jsx("span",{className:h,children:system.If(m,s?.viewLessText||"",s?.viewMoreText)}),system.If(s?.enableViewMoreIcon,jsxRuntime.jsx("span",{className:C,dangerouslySetInnerHTML:{__html:helpers.ICON_SVG}}))]})," ")]}))})};exports.default=ProductDescription;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),helpers=require("./common/helpers.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),useGpDescription=require("./hooks/useGpDescription.js");const ProductDescription=e=>{let{setting:s,advanced:t,builderProps:r}=e,{htmlTag:i}=s??{},a="html"===i?"div":"p",c=core.useProduct(),l=core.useCurrentDevice(),n=core.getResponsiveValueByScreen(s?.hasLineClamp,l),{ref:o,open:m,isShowViewMore:u,handleToggleShowMore:p,mode:d,redirectProductShopifyLink:y}=useGpDescription.useGpDescription(s),{t:x}=core.useI18nStore(),j=system.createClass({"gp-product-description":!0,[t?.cssClass]:!0}),g=system.createClass(classes.getClasses({setting:s,isLiquid:!1})),h=system.createClass(classes.getButtonClasses({setting:s})),C=system.createClass({"gp-show-more-text":!0}),R=system.createClass({"gp-show-more-icon gp-ml-1":!0,...m?{"gp-rotate-180":!0}:{}}),S=system.createClass(classes.getClassPreBuilt()),v=system.createStyle({...styles.getTextStyle({setting:s}),...m?{}:core.makeStyleResponsive("line-clamp",core.makeLineClamp(s?.lineClamp,s?.hasLineClamp))}),D=system.createStyle(styles.getButtonStyle({setting:s})),N=system.createAttr({"data-id":`${r?.uid}`}),f=system.createAttr({"data-gp-text":""}),{gpDescriptionCss:k,textDescriptionCss:q}=styles.getStaticCss(),I=!c?.descriptionHtml;return I&&"edit"===d?jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:x("Highlight key benefits with product description."),descriptionActions:[{text:x("Add description"),callback:y},{text:x("sync data"),callback:"syncProduct"}]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(I,"",jsxRuntime.jsxs("div",{...N,className:j,children:[jsxRuntime.jsx("style",{children:q}),jsxRuntime.jsx("style",{children:k}),jsxRuntime.jsx("div",{className:S}),jsxRuntime.jsx(a,{ref:o,...f,className:g,style:v,dangerouslySetInnerHTML:{__html:c?.descriptionHtml||""}}),system.If(n&&u,jsxRuntime.jsxs("button",{className:h,style:D,onClick:p,children:[jsxRuntime.jsx("span",{className:C,children:system.If(m,s?.viewLessText||"",s?.viewMoreText)}),system.If(s?.enableViewMoreIcon,jsxRuntime.jsx("span",{className:R,dangerouslySetInnerHTML:{__html:helpers.ICON_SVG}}))]})," ")]}))})};exports.default=ProductDescription;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{mode:r,product:u,salePrice:n,priceSave:d,currentProductId:c,unitCustomDisplay:x,shouldPlaceholderNoDiscount:m}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(m)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let p=system.createStyle(styles.getWrapperTextStyle(s)),y=system.createStyle(styles.getContainerStyle(s)),j=system.createClass(classes.getWrapperTextClass(s)),g=system.createClass(classes.getContainerClass()),f=system.createClass(classes.getRootClass({mode:r,salePrice:n,priceSave:d,bundleItem:l}));return jsxRuntime.jsx("div",{className:f,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":c,"gp-data-hidden":"false",children:system.If(!u," ",jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsx("div",{className:j,style:p,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:x,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{t:r}=core.useI18nStore(),{mode:u,product:n,salePrice:d,priceSave:c,currentProductId:x,unitCustomDisplay:m,shouldPlaceholderNoDiscount:p}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(p)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:r("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let y=system.createStyle(styles.getWrapperTextStyle(s)),j=system.createStyle(styles.getContainerStyle(s)),g=system.createClass(classes.getWrapperTextClass(s)),f=system.createClass(classes.getContainerClass()),T=system.createClass(classes.getRootClass({mode:u,salePrice:d,priceSave:c,bundleItem:l}));return jsxRuntime.jsx("div",{className:T,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":x,"gp-data-hidden":"false",children:system.If(!n," ",jsxRuntime.jsx("div",{className:f,style:j,children:jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:m,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:o,builderProps:l,builderAttrs:r,style:C,children:s}=t,d=core.useProduct(),n=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),[p,f]=React.useState(!1),h=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,y=e=>e?.featuredImage,I=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,D=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),M=React.useMemo(()=>{if(D){let e;switch(i?.preDisplay){case"1st-images":e=y(d);break;case"1st-3d-mode":e=I(d);break;case"1st-video":e=h(d);break;case"1st-available-variant":e=c?.media}return g(e),e}},[D,i?.preDisplay,g,d,c?.media]),b=React.useMemo(()=>{let e=getProductGallery(d);return e?.length?e:[{id:d?.featuredImage?.id||"noImageError",baseID:d?.featuredImage?.baseID||"noImageError",src:d?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:d?.featuredImage?.width||480,height:d?.featuredImage?.height||480}]},[d]),x=React.useMemo(()=>b.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[b]),R=React.useMemo(()=>core.getResponsiveValueByScreen(o?.position,n),[n,o?.position]),E=(e,t)=>{v(e),t&&j()},j=()=>{f(!0)},v=e=>{if(!e)return;let t=x[e];if(void 0!==t){let e=b[t];e&&g(e)}};React.useEffect(()=>{if(c&&!D){let e=x[c?.mediaId];if(void 0!==e){let t=b[e]??d?.featuredImage;t&&g(t)}}},[c,x,b,d?.featuredImage,g,D]);let P=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,n)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,n);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,n,m]),L=()=>b.length>0?React.Children.map(core.filterToolbarPreview(s),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:o?.ftShape,imageAlign:o?.align,imageLayout:o?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,V=`
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:o,builderProps:r,builderAttrs:l,style:C,children:s}=t,d=core.useProduct(),n=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),{t:p}=core.useI18nStore(),[f,h]=React.useState(!1),y=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,I=e=>e?.featuredImage,D=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,M=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),b=React.useMemo(()=>{if(M){let e;switch(i?.preDisplay){case"1st-images":e=I(d);break;case"1st-3d-mode":e=D(d);break;case"1st-video":e=y(d);break;case"1st-available-variant":e=c?.media}return g(e),e}},[M,i?.preDisplay,g,d,c?.media]),x=React.useMemo(()=>{let e=getProductGallery(d);return e?.length?e:[{id:d?.featuredImage?.id||"noImageError",baseID:d?.featuredImage?.baseID||"noImageError",src:d?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:d?.featuredImage?.width||480,height:d?.featuredImage?.height||480}]},[d]),R=React.useMemo(()=>x.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[x]),E=React.useMemo(()=>core.getResponsiveValueByScreen(o?.position,n),[n,o?.position]),j=(e,t)=>{P(e),t&&v()},v=()=>{h(!0)},P=e=>{if(!e)return;let t=R[e];if(void 0!==t){let e=x[t];e&&g(e)}};React.useEffect(()=>{if(c&&!M){let e=R[c?.mediaId];if(void 0!==e){let t=x[e]??d?.featuredImage;t&&g(t)}}},[c,R,x,d?.featuredImage,g,M]);let L=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,n)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,n);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,n,m]),S=()=>x.length>0?React.Children.map(core.filterToolbarPreview(s),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:o?.ftShape,imageAlign:o?.align,imageLayout:o?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,V=`
3
3
  <svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
5
5
  <path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
@@ -23,4 +23,4 @@
23
23
  <path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
24
24
  <path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
25
25
  </svg>
26
- `,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:V}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...r,className:k,style:C,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...o},uid:l?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(R)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,gallery:b,priorityFeatureImage:M,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),"only-feature"===R&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:b,...t,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),["one-col","two-col"].includes(R)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:b,...t,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),P&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:b,builderPropUID:l?.uid,open:p,onHandleClose:()=>f(!1),imageRatio:common.getAspectRatio(o?.ftShape)}),core.filterToolbarPreview(s,!0)]})};exports.default=ProductImagesV2;
26
+ `,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:p("Catch your customer's attention with attracted media."),descriptionActions:[{text:p("Add image"),callback:a},{text:p("sync data"),callback:"syncProduct"}],additionalMedia:V}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...l,className:k,style:C,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...o},uid:r?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(E)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,gallery:x,priorityFeatureImage:b,onHandleClickImage:(e,t)=>j(e||"",t),noDataChildren:Z,children:S()}),"only-feature"===E&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:x,...t,onHandleClickImage:(e,t)=>j(e||"",t),noDataChildren:Z,children:S()}),["one-col","two-col"].includes(E)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:x,...t,onHandleClickImage:(e,t)=>j(e||"",t),noDataChildren:Z,children:S()}),L&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:x,builderPropUID:r?.uid,open:f,onHandleClose:()=>h(!1),imageRatio:common.getAspectRatio(o?.ftShape)}),core.filterToolbarPreview(s,!0)]})};exports.default=ProductImagesV2;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:l,builderProps:r,builderAttrs:o,style:s,children:C}=t,n=core.useProduct(),d=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),[p,f]=React.useState(!1),h=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,y=e=>e?.featuredImage,I=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,M=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),D=React.useMemo(()=>{if(M){let e;switch(i?.preDisplay){case"1st-images":e=y(n);break;case"1st-3d-mode":e=I(n);break;case"1st-video":e=h(n);break;case"1st-available-variant":e=c?.media}return g(e),e}},[M,i?.preDisplay,g,n,c?.media]),b=React.useMemo(()=>i?.filterByVariant==="selected_variant",[i?.filterByVariant]),R=React.useMemo(()=>{let e=getProductGallery(n);if(!e?.length)return[{id:n?.featuredImage?.id||"noImageError",baseID:n?.featuredImage?.baseID||"noImageError",src:n?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:n?.featuredImage?.width||480,height:n?.featuredImage?.height||480}];if(!b||!c?.selectedOptions?.length)return e;let t=c.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),l=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),l=i(a),r="all-variants"===t,o=t===l||t.includes(l);return r||o});return l?.length>0?l:e},[c?.selectedOptions,b,n]),x=React.useMemo(()=>R.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[R]),E=React.useMemo(()=>core.getResponsiveValueByScreen(l?.position,d),[d,l?.position]),v=(e,t)=>{V(e),t&&j()},j=()=>{f(!0)},V=e=>{if(!e)return;let t=x[e];if(void 0!==t){let e=R[t];e&&g(e)}};React.useEffect(()=>{if(c&&!M){let e=x[c?.mediaId];if(void 0!==e){let t=R[e]??n?.featuredImage;t&&g(t)}}},[c,x,R,n?.featuredImage,g,M]);let L=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,d)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,d);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,d,m]),P=()=>R.length>0?React.Children.map(core.filterToolbarPreview(C),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:l?.ftShape,imageAlign:l?.align,imageLayout:l?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,w=`
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:r,builderProps:l,builderAttrs:o,style:s,children:C}=t,n=core.useProduct(),d=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),[p,f]=React.useState(!1),h=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,y=e=>e?.featuredImage,I=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,M=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),D=React.useMemo(()=>{if(M){let e;switch(i?.preDisplay){case"1st-images":e=y(n);break;case"1st-3d-mode":e=I(n);break;case"1st-video":e=h(n);break;case"1st-available-variant":e=c?.media}return g(e),e}},[M,i?.preDisplay,g,n,c?.media]),b=React.useMemo(()=>i?.filterByVariant==="selected_variant",[i?.filterByVariant]),R=React.useMemo(()=>{let e=getProductGallery(n);if(!e?.length)return[{id:n?.featuredImage?.id||"noImageError",baseID:n?.featuredImage?.baseID||"noImageError",src:n?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:n?.featuredImage?.width||480,height:n?.featuredImage?.height||480}];if(!b||!c?.selectedOptions?.length)return e;let t=c.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),r=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),r=i(a),l="all-variants"===t,o=t===r||t.includes(r);return l||o});return r?.length>0?r:e},[c?.selectedOptions,b,n]),x=React.useMemo(()=>R.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[R]),E=React.useMemo(()=>core.getResponsiveValueByScreen(r?.position,d),[d,r?.position]),v=(e,t)=>{V(e),t&&j()},j=()=>{f(!0)},V=e=>{if(!e)return;let t=x[e];if(void 0!==t){let e=R[t];e&&g(e)}};React.useEffect(()=>{if(c&&!M){let e=x[c?.mediaId];if(void 0!==e){let t=R[e]??n?.featuredImage;t&&g(t)}}},[c,x,R,n?.featuredImage,g,M]);let L=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,d)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,d);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,d,m]),P=()=>R.length>0?React.Children.map(core.filterToolbarPreview(C),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:r?.ftShape,imageAlign:r?.align,imageLayout:r?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,w=`
3
3
  <svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
5
5
  <path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
@@ -23,4 +23,4 @@
23
23
  <path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
24
24
  <path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
25
25
  </svg>
26
- `,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:w}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...o,className:k,style:s,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...l},uid:r?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(E)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,isFilterByVariantEnabled:b,gallery:R,priorityFeatureImage:D,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),"only-feature"===E&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,isFilterByVariantEnabled:b,children:P()}),["one-col","two-col"].includes(E)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),L&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:R,builderPropUID:r?.uid,open:p,onHandleClose:()=>f(!1),imageRatio:common.getAspectRatio(l?.ftShape)}),core.filterToolbarPreview(C,!0)]})};exports.default=ProductImagesV3;
26
+ `,{t:S}=core.useI18nStore(),Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:S("Catch your customer's attention with attracted media."),descriptionActions:[{text:S("Add image"),callback:a},{text:S("sync data"),callback:"syncProduct"}],additionalMedia:w}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...o,className:k,style:s,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...r},uid:l?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(E)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,isFilterByVariantEnabled:b,gallery:R,priorityFeatureImage:D,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),"only-feature"===E&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,isFilterByVariantEnabled:b,children:P()}),["one-col","two-col"].includes(E)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),L&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:R,builderPropUID:l?.uid,open:p,onHandleClose:()=>f(!1),imageRatio:common.getAspectRatio(r?.ftShape)}),core.filterToolbarPreview(C,!0)]})};exports.default=ProductImagesV3;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../../text/components/Text.js"),index=require("./components/variants/index.js"),Dropdown=require("./components/dropdown-swatches/Dropdown.js"),DropdownGroup=require("./components/dropdown-group/DropdownGroup.js"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/main/styles.js"),getAttr=require("./common/main/getAttr.js"),classes=require("./common/main/classes.js"),getData=require("./common/main/getData.js"),useGpVariants=require("./hooks/useGpVariants.js"),classes$1=require("./common/variants/classes.js"),styles$1=require("./common/variants/styles.js");const ProductVariants=e=>{let{builderProps:t,styles:s,setting:a}=e,{align:r,optionTypo:o,swatchItemWidth:n,dropdownItemWidth:i,swatchSpacing:l,marginBottom:c}=s??{},{label:p,showAsSwatches:u,layout:m,hasPreSelected:d}=a??{},{uid:y}=t??{},x=core.useVariants(),{mode:j,options:g,variantId:f,elementRef:h,variantGroup:w,isChangeVariant:D,selectedOptions:S,isDefaultVariant:v,getVariantConfiguration:V,redirectProductShopifyLink:q}=useGpVariants.useGpVariants(e,x),R=()=>{let e={};return core.DEVICES.forEach(t=>{let s=core.getResponsiveValueByScreen(n,t);e[t]="auto"===s}),e},C=()=>{let e={};return core.DEVICES.forEach(t=>{e[t]=i?.[t]==="fill"}),e},N=()=>{let t=g?.filter(e=>{let t=V(e.name);return!t?.hide});return t?.map((n,i)=>{let j=V(n.name),h=j?j.optionType:n.optionType,w=j?j.presets[j.optionType||"rectangle_list"]?.spacing:l,v=(d||f)&&n.name?S?.[n.name]:void 0,q=system.createClass(classes.getVariantOptionGroupClass(r)),N=system.createStyle(styles.getVariantOptionGroupStyle(l,w)),T=getData.getTextVariantTitleData(e,"React",{optionName:n.name,hasPreSelected:d,selectedOptions:S,styleOptionSelected:h}),A=system.createClass(classes$1.getWrapVariantOptionClass(m,r)),G=i===t.length-1;return jsxRuntime.jsxs("div",{className:A,style:system.createStyle(styles$1.getMarginBottomStyle(c,G)),children:[system.If(p,jsxRuntime.jsx(Text.default,{...T})),jsxRuntime.jsxs("div",{className:q,style:N,children:[u&&core.OptionSpecialStyle.includes(`${h}`)&&n.values.map(e=>{let t=(!!d||!!D||!!f)&&!!n.name&&S?.[n.name]===e.label;return jsxRuntime.jsx(index.default,{variantKey:`${n.id}-${e.id}`,showAsSwatches:u,uid:y,optionName:n.name??"",optionValue:e.label??"",name:n.name,value:e,optionNumber:g.length,optionPosition:i,...s,...a,presetConfiguration:V(n.name),checked:t,typeOfOption:h||"dropdown",swatchAutoWidth:R(),optionTypo:o},e.id)}),system.If(("dropdown"===h||u&&!core.OptionSpecialStyle.includes(`${h}`))&&"radio_buttons"!==h,jsxRuntime.jsx(Dropdown.default,{...s,...a,variants:x,option:n,initValue:v,presetConfiguration:V(n.name),swatchAutoWidth:C(),optionTypo:o,optionPosition:i,optionNumber:g.length}))]})]},n.id)})},T=system.createClass(classes.getWrapDropdownClass(r)),A=getData.getDropdownGroupData(e),G=()=>jsxRuntime.jsx("div",{className:T,children:jsxRuntime.jsx(DropdownGroup.default,{...A})});if(v&&"edit"===j)return jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Setup options like colors, sizes with product variant.",descriptionActions:[{text:"Add new variant",callback:q},{text:"sync data",callback:"syncProduct"}]});if(v)return;let b=system.createAttr(getAttr.getAttrs({uid:y,hasPreSelected:d})),O=system.createStyle(styles.getWrapperStyle(e)),$=system.createClass({"gp-flex gp-flex-col !gp-ml-0":!0});return jsxRuntime.jsx("div",{ref:h,...b,className:$,style:O,children:system.If(w,G(),N())})};exports.default=ProductVariants;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Text=require("../../../text/components/Text.js"),index=require("./components/variants/index.js"),Dropdown=require("./components/dropdown-swatches/Dropdown.js"),DropdownGroup=require("./components/dropdown-group/DropdownGroup.js"),NoDataState=require("../../../common/components/NoDataState.js"),system=require("@gem-sdk/system"),styles=require("./common/main/styles.js"),getAttr=require("./common/main/getAttr.js"),classes=require("./common/main/classes.js"),getData=require("./common/main/getData.js"),useGpVariants=require("./hooks/useGpVariants.js"),classes$1=require("./common/variants/classes.js"),styles$1=require("./common/variants/styles.js");const ProductVariants=e=>{let{t}=core.useI18nStore(),{builderProps:s,styles:a,setting:r}=e,{align:o,optionTypo:n,swatchItemWidth:i,dropdownItemWidth:l,swatchSpacing:c,marginBottom:p}=a??{},{label:u,showAsSwatches:m,layout:d,hasPreSelected:y}=r??{},{uid:x}=s??{},j=core.useVariants(),{mode:g,options:f,variantId:h,elementRef:w,variantGroup:D,isChangeVariant:S,selectedOptions:v,isDefaultVariant:V,getVariantConfiguration:q,redirectProductShopifyLink:R}=useGpVariants.useGpVariants(e,j),C=()=>{let e={};return core.DEVICES.forEach(t=>{let s=core.getResponsiveValueByScreen(i,t);e[t]="auto"===s}),e},N=()=>{let e={};return core.DEVICES.forEach(t=>{e[t]=l?.[t]==="fill"}),e},T=()=>{let t=f?.filter(e=>{let t=q(e.name);return!t?.hide});return t?.map((s,i)=>{let l=q(s.name),g=l?l.optionType:s.optionType,w=l?l.presets[l.optionType||"rectangle_list"]?.spacing:c,D=(y||h)&&s.name?v?.[s.name]:void 0,V=system.createClass(classes.getVariantOptionGroupClass(o)),R=system.createStyle(styles.getVariantOptionGroupStyle(c,w)),T=getData.getTextVariantTitleData(e,"React",{optionName:s.name,hasPreSelected:y,selectedOptions:v,styleOptionSelected:g}),A=system.createClass(classes$1.getWrapVariantOptionClass(d,o)),G=i===t.length-1;return jsxRuntime.jsxs("div",{className:A,style:system.createStyle(styles$1.getMarginBottomStyle(p,G)),children:[system.If(u,jsxRuntime.jsx(Text.default,{...T})),jsxRuntime.jsxs("div",{className:V,style:R,children:[m&&core.OptionSpecialStyle.includes(`${g}`)&&s.values.map(e=>{let t=(!!y||!!S||!!h)&&!!s.name&&v?.[s.name]===e.label;return jsxRuntime.jsx(index.default,{variantKey:`${s.id}-${e.id}`,showAsSwatches:m,uid:x,optionName:s.name??"",optionValue:e.label??"",name:s.name,value:e,optionNumber:f.length,optionPosition:i,...a,...r,presetConfiguration:q(s.name),checked:t,typeOfOption:g||"dropdown",swatchAutoWidth:C(),optionTypo:n},e.id)}),system.If(("dropdown"===g||m&&!core.OptionSpecialStyle.includes(`${g}`))&&"radio_buttons"!==g,jsxRuntime.jsx(Dropdown.default,{...a,...r,variants:j,option:s,initValue:D,presetConfiguration:q(s.name),swatchAutoWidth:N(),optionTypo:n,optionPosition:i,optionNumber:f.length}))]})]},s.id)})},A=system.createClass(classes.getWrapDropdownClass(o)),G=getData.getDropdownGroupData(e),b=()=>jsxRuntime.jsx("div",{className:A,children:jsxRuntime.jsx(DropdownGroup.default,{...G})});if(V&&"edit"===g)return jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:t("Setup options like colors, sizes with product variant."),descriptionActions:[{text:t("Add new variant"),callback:R},{text:t("sync data"),callback:"syncProduct"}]});if(V)return;let O=system.createAttr(getAttr.getAttrs({uid:x,hasPreSelected:y})),$=system.createStyle(styles.getWrapperStyle(e)),k=system.createClass({"gp-flex gp-flex-col !gp-ml-0":!0});return jsxRuntime.jsx("div",{ref:w,...O,className:k,style:$,children:system.If(D,b(),T())})};exports.default=ProductVariants;
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),NextImage_liquid=require("../../image/components/NextImage.liquid.js"),helpers=require("../../helpers.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),attrs=require("../common/attrs.js");const HTML5Embed=e=>{let t=`gp-video-${e.uid}`,{thumbnail:s,muted:a,autoplay:l,loop:o,controls:r,src:i,style:d,title:n,className:c,lazy:u,poster:m,wrapperStyles:p}=e,y=l&&a&&!!s,g=!u&&e.isVideoComponent,v=!s||l&&a,$=g?i:void 0,h=system.createAttr({...attrs.getHtml5Attr({videoId:t,title:n,autoplay:l,preloadThumbnail:y,offLazyLoad:g,src:i,thumbnail:s})}),b=system.createClass({...classes.getWrapThumbnailClasses(v)}),f=system.createStyle({...styles.getPreloadImageStyle()}),L=system.createClass({...classes.getButtonThumbnailClasses()}),E=system.createClass({...classes.getImageThumbnailClasses()}),I=system.createClass({...classes.getVideoYoutubeClasses(c,g)}),A=()=>y?core.template`${NextImage_liquid.default({src:s,alt:n,priority:m?.preload,enableLazyLoadImage:!0,style:f})}
2
- ${system.If(l,`<script>
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),NextImage_liquid=require("../../image/components/NextImage.liquid.js"),helpers=require("../../helpers.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),attrs=require("../common/attrs.js");const HTML5Embed=e=>{let t=`gp-video-${e.uid}`,{thumbnail:s,muted:a,autoplay:o,loop:r,controls:i,src:l,style:d,title:n,className:c,lazy:u,poster:m,wrapperStyles:v}=e,p=o&&a&&!!s,y=!u&&e.isVideoComponent,g=!s||o&&a,f=y?l:void 0,$=system.createAttr({...attrs.getHtml5Attr({videoId:t,title:n,autoplay:o,preloadThumbnail:p,offLazyLoad:y,src:l,thumbnail:s})}),h=system.createClass({...classes.getWrapThumbnailClasses(g)}),b=system.createStyle({...styles.getPreloadImageStyle()}),L=system.createClass({...classes.getButtonThumbnailClasses()}),E=system.createClass({...classes.getImageThumbnailClasses()}),A=system.createClass({...classes.getVideoYoutubeClasses(c,y)}),P=()=>p?core.template`${NextImage_liquid.default({src:s,alt:n,priority:m?.preload,enableLazyLoadImage:!0,style:b})}
2
+ ${system.If(o,`<script>
3
3
  document.addEventListener("DOMContentLoaded", (event) => {
4
4
  const eventList = ["keydown", "mousemove", "wheel", "touchmove", "touchstart", "touchend"];
5
5
  const autoLoadTimeout = setTimeout(runAutoPlayVideo, 0);
@@ -14,9 +14,21 @@
14
14
  });
15
15
  }
16
16
  function runAutoPlayVideo() {
17
- document.getElementById('${t}').setAttribute('autoplay','true');
18
- document.getElementById('${t}').setAttribute('playsinline','true');
19
- document.getElementById('${t}').play();
17
+ var video = document.getElementById('${t}');
18
+ if (!video) return;
19
+ video.setAttribute('autoplay','true');
20
+ video.setAttribute('playsinline','true');
21
+ var playPromise = video.play();
22
+ if (playPromise !== undefined) {
23
+ playPromise.catch(function(error) {
24
+ if (error.name === 'AbortError') {
25
+ video.addEventListener('loadeddata', function onLoaded() {
26
+ video.removeEventListener('loadeddata', onLoaded);
27
+ video.play();
28
+ });
29
+ }
30
+ });
31
+ }
20
32
  }
21
33
  });
22
34
  </script>`)}
@@ -24,7 +36,7 @@
24
36
  <div
25
37
  role="presentation"
26
38
  style="${d}"
27
- class="${b}"
39
+ class="${h}"
28
40
  >
29
41
  ${NextImage_liquid.default({id:"video-thumbnail",src:s??"",alt:m?.altText,title:m?.imageTitle,className:E,isDisableAspectStyle:!0,priority:m?.preload,enableLazyLoadImage:!0})}
30
42
  <button type="button" class="${L}" aria-label="Play">
@@ -37,20 +49,20 @@
37
49
  </button>
38
50
  </div>
39
51
  `;return core.template`
40
- <gp-lite-html5-embed is-check-loaded="${e.isCheckLoaded??!1}" style="${p}">
41
- ${A()}
52
+ <gp-lite-html5-embed is-check-loaded="${e.isCheckLoaded??!1}" style="${v}">
53
+ ${P()}
42
54
  <video
43
- ${{...h}}
55
+ ${{...$}}
44
56
  style="${d}"
45
- class="${I}"
46
- ${r?"controls":void 0}
47
- ${o?"loop":void 0}
57
+ class="${A}"
58
+ ${i?"controls":void 0}
59
+ ${r?"loop":void 0}
48
60
  ${a?"muted":void 0}
49
- ${l?"autoplay":void 0}
61
+ ${o?"autoplay":void 0}
50
62
  playsinline
51
- ${$?`src="${$}"`:""}
63
+ ${f?`src="${f}"`:""}
52
64
  ></video>
53
- ${system.If(!v,C())}
65
+ ${system.If(!g,C())}
54
66
  </gp-lite-html5-embed>
55
67
  ${core.RenderIf(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-lite-html5-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-lite-html5-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
56
68
  `};exports.default=HTML5Embed;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import{jsx as t,jsxs as e,Fragment as p}from"react/jsx-runtime";import{useArticleStore as i,useCurrentDevice as o,useShopStore as r,getResponsiveValueByScreen as n,composeTypographyClassName as c,composeTypographyStyle as a,isSafari as l,cls as s,getGlobalColorStateStyle as d,makeStyleResponsive as m,getStyleShadow as y,makeStyle as h}from"@gem-sdk/core";import{useState as g,useRef as x,useEffect as f}from"react";import u from"../../common/components/NoDataState.js";import{styleOverride as w}from"../common/helpers.js";let ArticleContent=({styles:v,builderProps:A})=>{let S=i(t=>t.article),[b,C]=g(!1),k=x(null),$=o(),_=r(t=>t.storefrontUrl),j=n(v?.hasLineClamp,$),I=n(v?.lineClamp,$),L=()=>{if(!_)return;let t=new URL(_);window.open(`${t.protocol}//${t.host}/admin/content/articles`)};f(()=>{C(!1)},[j,I,S?.description]);let N=c(v?.typo,v?.typography),T=a(v?.typo,v?.typography),D=`
2
+ import{jsx as t,jsxs as e,Fragment as p}from"react/jsx-runtime";import{useArticleStore as i,useCurrentDevice as o,useShopStore as r,useI18nStore as n,getResponsiveValueByScreen as c,composeTypographyClassName as a,composeTypographyStyle as l,isSafari as s,cls as d,getGlobalColorStateStyle as m,makeStyleResponsive as y,getStyleShadow as h,makeStyle as g}from"@gem-sdk/core";import{useState as x,useRef as f,useEffect as u}from"react";import w from"../../common/components/NoDataState.js";import{styleOverride as v}from"../common/helpers.js";let ArticleContent=({styles:A,builderProps:S})=>{let b=i(t=>t.article),[C,k]=x(!1),$=f(null),_=o(),j=r(t=>t.storefrontUrl),{t:I}=n(),L=c(A?.hasLineClamp,_),N=c(A?.lineClamp,_),T=()=>{if(!j)return;let t=new URL(j);window.open(`${t.protocol}//${t.host}/admin/content/articles`)};u(()=>{k(!1)},[L,N,b?.description]);let D=a(A?.typo,A?.typography),U=l(A?.typo,A?.typography),E=`
3
3
  .gp-p-description-text a:empty,
4
4
  .gp-p-description-text ul:empty,
5
5
  .gp-p-description-text dl:empty,
@@ -15,5 +15,5 @@ import{jsx as t,jsxs as e,Fragment as p}from"react/jsx-runtime";import{useArticl
15
15
  .gp-p-description-text h6:empty {
16
16
  display: none;
17
17
  }
18
- ${w}
19
- `;return t("div",{"data-id":A?.uid,id:`shopify-text-element-${A?.uid}`,className:"gp-article-description","data-article-id":S?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:S?.content?.html?e(p,{children:[!l()&&t("style",{children:D}),t("div",{ref:k,className:s("gp-p-description-text gp-content-text-override gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre",N),style:{...d("c",v?.color),...m("ta",v?.textAlign),...j&&!b?m("line-clamp",v?.lineClamp):{},...y({value:v?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:v?.typo?.custom?.hasShadowText}),...h({tt:v?.transform}),...T},dangerouslySetInnerHTML:{__html:S?.content?.html}})]}):t("div",{children:t(u,{elementType:"secondary",description:"Inform and provide value to the audience with article content.",descriptionActions:[{text:"Add article content",callback:L},{text:"sync data",callback:"syncArticle"}]})})})};export{ArticleContent as default};
18
+ ${v}
19
+ `;return t("div",{"data-id":S?.uid,id:`shopify-text-element-${S?.uid}`,className:"gp-article-description","data-article-id":b?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:b?.content?.html?e(p,{children:[!s()&&t("style",{children:E}),t("div",{ref:$,className:d("gp-p-description-text gp-content-text-override gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre",D),style:{...m("c",A?.color),...y("ta",A?.textAlign),...L&&!C?y("line-clamp",A?.lineClamp):{},...h({value:A?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:A?.typo?.custom?.hasShadowText}),...g({tt:A?.transform}),...U},dangerouslySetInnerHTML:{__html:b?.content?.html}})]}):t("div",{children:t(w,{elementType:"secondary",description:I("Inform and provide value to the audience with article content."),descriptionActions:[{text:I("Add article content"),callback:T},{text:I("sync data"),callback:"syncArticle"}]})})})};export{ArticleContent as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e}from"react/jsx-runtime";import t from"next/link";import r from"../../text/components/Text.js";import{useArticleStore as i,useShopStore as o}from"@gem-sdk/core";import{useMemo as l}from"react";import{useArticleLink as c}from"../hooks/useArticleLink.js";import n from"../../common/components/NoDataState.js";let ArticleExcerpt=({setting:s,styles:a,builderProps:m})=>{let p=i(e=>e.article),d=o(e=>e.storefrontUrl),x=l(()=>p?.content?.excerptHtml,[p]),{shopifyArticleLink:f}=c(),u=()=>{if(!d)return;let e=new URL(d);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};return e("div",{id:`shopify-text-element-${m?.uid}`,"data-article-id":p?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:p&&x?s?.linkArticle?e(t,{href:f,title:p?.title,children:e(r,{builderProps:m,styles:a,setting:{...s,text:x,excludeFlex:!0}})}):e(r,{builderProps:m,styles:a,setting:{...s,text:x,excludeFlex:!0}}):e(n,{elementType:"secondary",description:"Provide a brief summary or teaser of the article. ",descriptionActions:[{text:"Add article excerpt",callback:u},{text:"sync data",callback:"syncArticle"}]})})};export{ArticleExcerpt as default};
2
+ import{jsx as e}from"react/jsx-runtime";import t from"next/link";import r from"../../text/components/Text.js";import{useArticleStore as i,useShopStore as o,useI18nStore as l}from"@gem-sdk/core";import{useMemo as c}from"react";import{useArticleLink as n}from"../hooks/useArticleLink.js";import s from"../../common/components/NoDataState.js";let ArticleExcerpt=({setting:a,styles:m,builderProps:p})=>{let d=i(e=>e.article),x=o(e=>e.storefrontUrl),f=c(()=>d?.content?.excerptHtml,[d]),{shopifyArticleLink:u}=n(),{t:y}=l(),h=()=>{if(!x)return;let e=new URL(x);window.open(`${e.protocol}//${e.host}/admin/content/articles`)};return e("div",{id:`shopify-text-element-${p?.uid}`,"data-article-id":d?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:d&&f?a?.linkArticle?e(t,{href:u,title:d?.title,children:e(r,{builderProps:p,styles:m,setting:{...a,text:f,excludeFlex:!0}})}):e(r,{builderProps:p,styles:m,setting:{...a,text:f,excludeFlex:!0}}):e(s,{elementType:"secondary",description:y("Provide a brief summary or teaser of the article. "),descriptionActions:[{text:y("Add article excerpt"),callback:h},{text:y("sync data"),callback:"syncArticle"}]})})};export{ArticleExcerpt as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as p,useEffect as l}from"react";import{useRenderMode as n,cls as i,filterToolbarPreview as g}from"@gem-sdk/core";let NoDataState=({title:a,description:d,elementType:o,builderAttrs:c,descriptionActions:s,primaryBtnTitle:u,secondaryBtnTitle:m,primaryBtnCb:b,secondaryBtnCb:f,additionalMedia:x,customClass:h,icon:C=!0,rawMode:w,children:v})=>{let y=r(null),{isEditMode:N,isPreviewSharePageMode:k}=n(),[A,E]=p("row"),L=()=>{let e=y.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},M=()=>{let e=y.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},D=()=>{if(N)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:c?.["data-uid"]??c?.uid,value:!0,tag:c?.["data-component-tag"]??c?.tag}});window.dispatchEvent(e)},F={syncProduct:L,syncArticle:M};return(l(()=>{let e=new ResizeObserver(()=>{let e=y.current?y.current?.offsetWidth:0;E(e>272?"row":"column")});return y.current&&e.observe(y.current),()=>{e?.disconnect()}},[]),k)?null:e("div",{...c,ref:y,className:i("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",w?"gp-p-0":"gp-p-2"),onClick:D,children:[e("div",{className:i("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===o?"gp-bg-[#FFF1DF]":"",w?"gp-justify-center":"",h||""),style:{flexDirection:A},children:[C&&!w&&t("div",{className:i("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===o?"":"gp-bg-[#FDB913]"),children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===o?"#916A00":"#212121"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===o?"#916A00":"#212121"})]})}),e("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[a&&t("p",{className:i("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:a}}),d&&e("p",{className:i(w?"gp-mb-0":"gp-mb-[4px]","primary"===o?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[d," ",s?.map((r,p)=>{let l=p?"or":"",n="string"==typeof r.callback?F?.[r.callback]:r.callback;return e("span",{children:[" ",l," ",t("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:n,children:r.text})]},`description-action-${p}`)})]}),(u||m)&&e("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[t("button",{onClick:b,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:u}),t("button",{onClick:f,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:m})]})]})]}),x&&t("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:x}}),g(v,!0)]})};export{NoDataState as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as r,useState as p,useEffect as l}from"react";import{useI18nStore as n,useRenderMode as i,cls as g,filterToolbarPreview as a}from"@gem-sdk/core";let NoDataState=({title:d,description:o,elementType:c,builderAttrs:s,descriptionActions:u,primaryBtnTitle:m,secondaryBtnTitle:b,primaryBtnCb:f,secondaryBtnCb:x,additionalMedia:h,customClass:C,icon:w=!0,rawMode:v,children:y})=>{let{t:N}=n(),k=r(null),{isEditMode:A,isPreviewSharePageMode:E}=i(),[L,M]=p("row"),D=()=>{let e=k.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},F=()=>{let e=k.current?.closest('[data-component-type="component"]')?.getAttribute("data-uid");if(!e)return;let t=new CustomEvent("editor:sync-article",{bubbles:!0,detail:{uid:e}});window.dispatchEvent(t)},j=()=>{if(A)return;let e=new CustomEvent("editor:product-source-no-data-warning",{bubbles:!0,detail:{uid:s?.["data-uid"]??s?.uid,value:!0,tag:s?.["data-component-tag"]??s?.tag}});window.dispatchEvent(e)},S={syncProduct:D,syncArticle:F};return(l(()=>{let e=new ResizeObserver(()=>{let e=k.current?k.current?.offsetWidth:0;M(e>272?"row":"column")});return k.current&&e.observe(k.current),()=>{e?.disconnect()}},[]),E)?null:e("div",{...s,ref:k,className:g("gp-font-[Inter] gp-bg-white gp-border gp-border-dashed gp-border-box gp-rounded-lg gp-flex gp-flex-col",v?"gp-p-0":"gp-p-2"),onClick:j,children:[e("div",{className:g("gp-w-full gp-h-full gp-rounded-lg gp-flex gp-p-2 gp-gap-2","primary"===c?"gp-bg-[#FFF1DF]":"",v?"gp-justify-center":"",C||""),style:{flexDirection:L},children:[w&&!v&&t("div",{className:g("gp-w-[28px] gp-h-[28px] gp-min-w-[28px] gp-flex gp-items-center gp-justify-center gp-rounded-[8px]","primary"===c?"":"gp-bg-[#FDB913]"),children:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M9.99997 6.75C10.4142 6.75 10.75 7.08579 10.75 7.5V11C10.75 11.4142 10.4142 11.75 9.99997 11.75C9.58576 11.75 9.24997 11.4142 9.24997 11V7.5C9.24997 7.08579 9.58576 6.75 9.99997 6.75Z",fill:"primary"===c?"#916A00":"#212121"}),t("path",{d:"M11 13.5C11 14.0523 10.5523 14.5 10 14.5C9.44775 14.5 9.00003 14.0523 9.00003 13.5C9.00003 12.9477 9.44775 12.5 10 12.5C10.5523 12.5 11 12.9477 11 13.5Z",fill:"primary"===c?"#916A00":"#212121"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 3.5C8.95474 3.5 8.21619 4.20232 7.84765 4.94672C7.65568 5.33448 6.75987 7.0441 5.84308 8.79353L5.81534 8.84646C4.92293 10.5493 4.01717 12.2777 3.80719 12.702C3.43513 13.4537 3.32934 14.4519 3.89956 15.316C4.46914 16.1791 5.44225 16.5 6.3636 16.5L13.6364 16.5C14.5577 16.5 15.5309 16.1791 16.1005 15.316C16.6707 14.4519 16.5649 13.4537 16.1928 12.702C15.9832 12.2784 15.08 10.555 14.189 8.85476L14.1569 8.79352C13.24 7.044 12.3443 5.33454 12.1525 4.94693C11.784 4.20242 11.0455 3.5 10.0001 3.5ZM9.19193 5.61225C9.59608 4.79592 10.4041 4.79592 10.8081 5.61225C11.0102 6.02061 11.9201 7.75686 12.8297 9.49243C13.7383 11.2262 14.6466 12.9594 14.8485 13.3673C15.2525 14.1837 14.8485 15 13.6364 15L6.3636 15C5.15153 15 4.74749 14.1837 5.15153 13.3673C5.35379 12.9587 6.26471 11.2205 7.17483 9.4838C8.08286 7.75111 8.99008 6.01994 9.19193 5.61225Z",fill:"primary"===c?"#916A00":"#212121"})]})}),e("div",{className:"gp-flex-col gp-flex gp-justify-between",children:[d&&t("p",{className:g("gp-text-[#916A00] gp-text-[13px] gp-font-semibold"),dangerouslySetInnerHTML:{__html:d}}),o&&e("p",{className:g(v?"gp-mb-0":"gp-mb-[4px]","primary"===c?"gp-text-[#916A00] gp-text-[13px]":"gp-text-[#212121] gp-text-[12px]"),children:[o," ",u?.map((r,p)=>{let l=p?N("or"):"",n="string"==typeof r.callback?S?.[r.callback]:r.callback;return e("span",{children:[" ",l," ",t("span",{role:"presentation",className:"gp-underline gp-cursor-pointer gp-leading-5",onClick:n,children:r.text})]},`description-action-${p}`)})]}),(m||b)&&e("div",{className:"gp-flex gp-flex-wrap gp-gap-2 gp-rounded-4 gp-border-box",children:[t("button",{onClick:f,className:"w-h-7 gp-bg-[#212121] gp-rounded-8 gp-p-2 gp-text-xs hover:gp-bg-[#3b3b3b] gp-text-white gp-rounded-lg",children:m}),t("button",{onClick:x,className:"w-h-7 gp-bg-white gp-text-[#212121] hover:gp-bg-[#f6f6f6] gp-text-xs gp-p-2 gp-rounded-lg",children:b})]})]})]}),h&&t("div",{className:"gp-w-full",dangerouslySetInnerHTML:{__html:h}}),a(y,!0)]})};export{NoDataState as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as o}from"react/jsx-runtime";import{usePageType as t,useShopStore as r}from"@gem-sdk/core";import{useState as e,useEffect as n,useMemo as i}from"react";import c from"../../common/components/NoDataState.js";let ProductNotFound=({collectionHandle:d,productSrc:a,builderAttrs:l,children:u})=>{let p="STATIC"===t(),f=r(o=>o.storefrontToken),y=r(o=>o.storefrontUrl),m="Collection"===a,[s,h]=e(""),[S,g]=e("get product"),[w,b]=e("");n(()=>{if(m){if(!d){h("We cannot find any collections from your Shopify store. Please try manually syncing the data from Shopify or add a new collection."),g("get collection"),b("collection");return}h("We cannot find any product of this collection from your Shopify store? Please try manually syncing the data from Shopify or add a new product to your collection."),g("get product of collection"),b("product");return}if(p&&!f){b("product"),h("We can not get your products from Shopify");return}b("product"),g("get product"),h("We cannot find any products from your Shopify store. Please try manually syncing the data from Shopify or add a new product.")},[d,m,p,f]);let C=i(()=>{if(!y)return;let o=new URL(y);return m?`${o.protocol}//${o.host}/admin/collections`:`${o.protocol}//${o.host}/admin/products`},[m,y]),T=o=>{let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:o}});window.dispatchEvent(t)};return o(c,{elementType:"primary",children:u,builderAttrs:l,title:`Can not ${S} from Shopify`,description:s,primaryBtnTitle:`Add ${w}`,secondaryBtnTitle:"Sync from Shopify",primaryBtnCb:()=>{C&&window.open(C,"_blank")},secondaryBtnCb:()=>T(l?.["data-uid"]??l?.uid)})};export{ProductNotFound as default};
2
+ import{jsx as o}from"react/jsx-runtime";import{usePageType as t,useShopStore as r,useI18nStore as e}from"@gem-sdk/core";import{useState as n,useEffect as i,useMemo as c}from"react";import d from"../../common/components/NoDataState.js";let ProductNotFound=({collectionHandle:a,productSrc:l,builderAttrs:u,children:p})=>{let y="STATIC"===t(),f=r(o=>o.storefrontToken),m=r(o=>o.storefrontUrl),s="Collection"===l,[h,S]=n(""),[g,w]=n("get product"),[b,C]=n(""),{t:T}=e();i(()=>{if(s){if(!a){S(T("We cannot find any collections from your Shopify store. Please try manually syncing the data from Shopify or add a new collection.")),w(T("get collection")),C(T("collection"));return}S(T("We cannot find any product of this collection from your Shopify store? Please try manually syncing the data from Shopify or add a new product to your collection.")),w(T("get product of collection")),C(T("product"));return}if(y&&!f){C(T("product")),S(T("We can not get your products from Shopify"));return}C(T("product")),w(T("get product")),S(T("We cannot find any products from your Shopify store. Please try manually syncing the data from Shopify or add a new product."))},[a,s,y,f]);let P=c(()=>{if(!m)return;let o=new URL(m);return s?`${o.protocol}//${o.host}/admin/collections`:`${o.protocol}//${o.host}/admin/products`},[s,m]),k=o=>{let t=new CustomEvent("editor:sync-product",{bubbles:!0,detail:{uid:o}});window.dispatchEvent(t)};return o(d,{elementType:"primary",children:p,builderAttrs:u,title:T("Can not {textLink} from Shopify",{textLink:g}),description:h,primaryBtnTitle:T("Add {entity}",{entity:b}),secondaryBtnTitle:T("Sync from Shopify"),primaryBtnCb:()=>{P&&window.open(P,"_blank")},secondaryBtnCb:()=>k(u?.["data-uid"]??u?.uid)})};export{ProductNotFound as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as m}from"react/jsx-runtime";import{useProduct as s,useCurrentVariant as o,useMoneyFormat as t,useCurrentDevice as r,useProductBundleDiscount as l,useEditorMode as i,useRenderMode as a,usePageType as c,filterToolbarPreview as n}from"@gem-sdk/core";import{getBadgeContent as d,getIsNoDiscountState as p}from"./utils/common.js";import"./constants.js";import f from"../../../common/components/NoDataState.js";import h from"../../../common/components/TooltipHover.js";import{createClass as y,createStyle as N,createAttr as j,If as u}from"@gem-sdk/system";import{getEditTooltipAttrs as v,getNoDataAttrs as g,getSubWrapperAttrs as T,getContainerAttrs as k,getTextContentAttrs as x,getImageAttr as B}from"./common/attrs.js";import{getContainerClasses as C,getWrapperClasses as P,getSubWrapperClass as S,getTextContainerClasses as b,getTextWrapperClasses as A,getTextContentClasses as D,getImageContainerClasses as H,getImageClasses as I}from"./common/classes.js";import{getContainerStyle as q,getSubWrapperStyle as w,getContentStyleInternal as z,getTextBadgeWrapperStyles as E,getTextContentStyle as F,getImageContainerStyles as G}from"./common/styles.js";let ProductBadge=J=>{let{setting:K,styles:L,children:M,...O}=J,Q=s(),R=o(),{moneyFormat:U}=t(),V=r(),{useProductCompareAtPrice:W}=l(),X=O?.["bundle-item"],Y=i(),{isEditMode:Z}=a(),$="STATIC"===c(),_=d({detail:Q,currentVariant:R,bundleItem:X,useProductCompareAtPrice:W},K?.displayContent,U),ee=p({props:J,product:Q,currentVariant:R,moneyFormat:U,useProductCompareAtPrice:W}),em=y({...C({mode:Y,isInstant:$,product:Q,currentVariant:R,props:J})}),es=N({...q(J)}),eo=j({...v(J)}),et=j({...g(J)}),er=y({...P(J)}),el=y({...S(J,V)}),ei=N({...w({props:J,product:Q,currentVariant:R,isEditMode:Z})}),ea=j({...T(J,Q)}),ec=z(J),en=y({...b()}),ed=j({...k(J)}),ep=y({...A()}),ef=N({...E({setting:K,styles:L})}),eh=y({...D(L)}),ey=N({...F({setting:K,styles:L})}),eN=j({...x()}),ej=y({...H()}),eu=N({...G({setting:K,styles:L})}),ev=y({...I()}),eg=j({...B({setting:K})});return Q?e("div",{...ed,style:es,className:em,children:[u(Z&&ee,m(h,{...eo,children:m(f,{...et})}),m("div",{className:er,children:e("div",{...ea,className:el,style:ei,children:[m("style",{children:ec}),u(K?.shape!=="image",m("div",{className:en,children:m("div",{className:ep,style:ef,children:m("pre",{...eN,className:eh,style:ey,children:_})})}),m("div",{className:ej,style:eu,children:m("img",{...eg,className:ev,alt:""})}))]})})),n(M,!0)]}):null};export{ProductBadge as default};
2
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useI18nStore as o,useProduct as m,useCurrentVariant as t,useMoneyFormat as r,useCurrentDevice as l,useProductBundleDiscount as i,useEditorMode as a,useRenderMode as c,usePageType as n,filterToolbarPreview as d}from"@gem-sdk/core";import{getBadgeContent as p,getIsNoDiscountState as y}from"./utils/common.js";import"./constants.js";import f from"../../../common/components/NoDataState.js";import h from"../../../common/components/TooltipHover.js";import{createClass as N,createStyle as u,createAttr as j,If as v}from"@gem-sdk/system";import{getEditTooltipAttrs as g,getSubWrapperAttrs as T,getContainerAttrs as k,getTextContentAttrs as x,getImageAttr as B}from"./common/attrs.js";import{getContainerClasses as C,getWrapperClasses as P,getSubWrapperClass as S,getTextContainerClasses as b,getTextWrapperClasses as w,getTextContentClasses as A,getImageContainerClasses as D,getImageClasses as H}from"./common/classes.js";import{getContainerStyle as I,getSubWrapperStyle as M,getContentStyleInternal as q,getTextBadgeWrapperStyles as z,getTextContentStyle as E,getImageContainerStyles as F}from"./common/styles.js";let ProductBadge=G=>{let{t:J}=o(),{setting:K,styles:L,children:O,builderAttrs:Q,...R}=G,U=m(),V=t(),{moneyFormat:W}=r(),X=l(),{useProductCompareAtPrice:Y}=i(),Z=R?.["bundle-item"],$=a(),{isEditMode:_}=c(),ee="STATIC"===n(),es=p({detail:U,currentVariant:V,bundleItem:Z,useProductCompareAtPrice:Y},K?.displayContent,W),eo=y({props:G,product:U,currentVariant:V,moneyFormat:W,useProductCompareAtPrice:Y}),em=N({...C({mode:$,isInstant:ee,product:U,currentVariant:V,props:G})}),et=u({...I(G)}),er=j({...g(G)}),el=N({...P(G)}),ei=N({...S(G,X)}),ea=u({...M({props:G,product:U,currentVariant:V,isEditMode:_})}),ec=j({...T(G,U)}),en=q(G),ed=N({...b()}),ep=j({...k(G)}),ey=N({...w()}),ef=u({...z({setting:K,styles:L})}),eh=N({...A(L)}),eN=u({...E({setting:K,styles:L})}),eu=j({...x()}),ej=N({...D()}),ev=u({...F({setting:K,styles:L})}),eg=N({...H()}),eT=j({...B({setting:K})});return U?e("div",{...ep,style:et,className:em,children:[v(_&&eo,s(h,{...er,children:s(f,{...Q,elementType:"secondary",description:J("No discount"),rawMode:!0})}),s("div",{className:el,children:e("div",{...ec,className:ei,style:ea,children:[s("style",{children:en}),v(K?.shape!=="image",s("div",{className:ed,children:s("div",{className:ey,style:ef,children:s("pre",{...eu,className:eh,style:eN,children:es})})}),s("div",{className:ej,style:ev,children:s("img",{...eT,className:eg,alt:""})}))]})})),d(O,!0)]}):null};export{ProductBadge as default};
@@ -1 +1 @@
1
- let getImageAttr=({setting:t})=>({src:t?.image?.src,alt:t?.image?.alt,loading:"lazy"}),getContainerAttrs=t=>{let{builderAttrs:e,builderProps:r}=t;return{...e,"data-id":r?.uid||"",id:`g-product-badge-${r?.uid}`,"gp-data-hidden":"false"}},getEditTooltipAttrs=t=>{let{setting:e}=t,r=e?.positionWithImage==="outside";return{enable:!0,text:"Not be displayed when published",position:r?"bottom":"right",width:"205px"}},getNoDataAttrs=t=>{let{builderAttrs:e}=t;return{...e,elementType:"secondary",description:"No discount",rawMode:!0}},getSubWrapperAttrs=(t,e)=>{let{builderProps:r}=t,i=e?e?.baseID?.replace("gid://shopify/Product/",""):"";return{"data-product-id":i||"",id:r?.uid||""}},getTextContentAttrs=()=>({id:"product-badge-content"});export{getContainerAttrs,getEditTooltipAttrs,getImageAttr,getNoDataAttrs,getSubWrapperAttrs,getTextContentAttrs};
1
+ let getImageAttr=({setting:t})=>({src:t?.image?.src,alt:t?.image?.alt,loading:"lazy"}),getContainerAttrs=t=>{let{builderAttrs:e,builderProps:r}=t;return{...e,"data-id":r?.uid||"",id:`g-product-badge-${r?.uid}`,"gp-data-hidden":"false"}},getEditTooltipAttrs=t=>{let{setting:e}=t,r=e?.positionWithImage==="outside";return{enable:!0,text:"Not be displayed when published",position:r?"bottom":"right",width:"205px"}},getSubWrapperAttrs=(t,e)=>{let{builderProps:r}=t,i=e?e?.baseID?.replace("gid://shopify/Product/",""):"";return{"data-product-id":i||"",id:r?.uid||""}},getTextContentAttrs=()=>({id:"product-badge-content"});export{getContainerAttrs,getEditTooltipAttrs,getImageAttr,getSubWrapperAttrs,getTextContentAttrs};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRenderMode as o,isEmptyChildren as s}from"@gem-sdk/core";import{isValidElement as n}from"react";import r from"../../../common/components/NoDataState.js";import{createClass as i,createStyle as l,If as d}from"@gem-sdk/system";import{getSizeSettings as m,getContainerStyles as u}from"./common/styles.js";import{getContainerClasses as c,getNoDiscountClasses as a}from"./common/classes.js";import p from"./hooks/useProductBundleDataState.js";import f from"./hooks/useProductBundleDiscountState.js";import h from"./ProductBundleDiscountChildrenItem.js";let ProductBundleDiscount=({builderAttrs:y,style:b,children:I,setting:g,styles:j,advanced:D})=>{let{isEditMode:k,isPreviewSharePageMode:S}=o(),{isSelected:x,setSelected:B}=f(g),{emitRedirectSetupPage:P,redirectGuideline:N,svgVertical:T,svgHorizontal:v}=p(),A=i(c(g,D?.cssClass)),C=i(a),q=l(m(j)?.gap),w=l(u(q,j,b));if(!g?.bundleItems?.length&&k)return t(r,{elementType:"secondary",description:"Increase AOV with bundle quantity.",descriptionActions:[{text:"Setup bundle discount",callback:P},{text:"read guideline",callback:N}],additionalMedia:g?.layout=="horizontal-layout"?v:T});let z=(e,o)=>{if(g?.hideNoDiscountItem&&e?.discountType==="no_discount")return null;let s=I?.[o];if(n(s))return t(h,{index:o,childItem:s,setting:g,styles:j,isSelected:x(o),setSelected:B,bundleItem:e},o)},M=(s(I)||g?.bundleItems?.length==0)&&!S;return e("div",{...y,className:A,style:w,children:[d(M,t("div",{className:C,children:"This product has no bundle discount"})),g?.bundleItems?.map((t,e)=>z(t,e))]})};export{ProductBundleDiscount as default};
2
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRenderMode as o,useI18nStore as s,isEmptyChildren as n}from"@gem-sdk/core";import{isValidElement as r}from"react";import i from"../../../common/components/NoDataState.js";import{createClass as l,createStyle as d,If as m}from"@gem-sdk/system";import{getSizeSettings as u,getContainerStyles as c}from"./common/styles.js";import{getContainerClasses as a,getNoDiscountClasses as p}from"./common/classes.js";import f from"./hooks/useProductBundleDataState.js";import h from"./hooks/useProductBundleDiscountState.js";import y from"./ProductBundleDiscountChildrenItem.js";let ProductBundleDiscount=({builderAttrs:b,style:I,children:g,setting:j,styles:D,advanced:k})=>{let{isEditMode:S,isPreviewSharePageMode:x}=o(),{isSelected:B,setSelected:P}=h(j),{emitRedirectSetupPage:N,redirectGuideline:T,svgVertical:v,svgHorizontal:A}=f(),{t:C}=s(),q=l(a(j,k?.cssClass)),w=l(p),z=d(u(D)?.gap),M=d(c(z,D,I));if(!j?.bundleItems?.length&&S)return t(i,{elementType:"secondary",description:C("Increase AOV with bundle quantity."),descriptionActions:[{text:C("Setup bundle discount"),callback:N},{text:C("read guideline"),callback:T}],additionalMedia:j?.layout=="horizontal-layout"?A:v});let O=(e,o)=>{if(j?.hideNoDiscountItem&&e?.discountType==="no_discount")return null;let s=g?.[o];if(r(s))return t(y,{index:o,childItem:s,setting:j,styles:D,isSelected:B(o),setSelected:P,bundleItem:e},o)},V=(n(g)||j?.bundleItems?.length==0)&&!x;return e("div",{...b,className:q,style:M,children:[m(V,t("div",{className:w,children:"This product has no bundle discount"})),j?.bundleItems?.map((t,e)=>O(t,e))]})};export{ProductBundleDiscount as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import{useProduct as o,useCurrentDevice as i,getResponsiveValueByScreen as r,makeStyleResponsive as c,makeLineClamp as m}from"@gem-sdk/core";import n from"../../../common/components/NoDataState.js";import{ICON_SVG as l}from"./common/helpers.js";import{createClass as a,createStyle as p,createAttr as d,If as h}from"@gem-sdk/system";import{getClasses as u,getButtonClasses as y,getClassPreBuilt as g}from"./common/classes.js";import{getTextStyle as f,getButtonStyle as x,getStaticCss as k}from"./common/styles.js";import{useGpDescription as N}from"./hooks/useGpDescription.js";let ProductDescription=j=>{let{setting:w,advanced:L,builderProps:b}=j,{htmlTag:v}=w??{},C="html"===v?"div":"p",H=o(),T=i(),D=r(w?.hasLineClamp,T),{ref:M,open:_,isShowViewMore:I,handleToggleShowMore:P,mode:S,redirectProductShopifyLink:A}=N(w),q=a({"gp-product-description":!0,[L?.cssClass]:!0}),G=a(u({setting:w,isLiquid:!1})),V=a(y({setting:w})),$=a({"gp-show-more-text":!0}),z=a({"gp-show-more-icon gp-ml-1":!0,..._?{"gp-rotate-180":!0}:{}}),B=a(g()),E=p({...f({setting:w}),..._?{}:c("line-clamp",m(w?.lineClamp,w?.hasLineClamp))}),F=p(x({setting:w})),J=d({"data-id":`${b?.uid}`}),K=d({"data-gp-text":""}),{gpDescriptionCss:O,textDescriptionCss:Q}=k(),R=!H?.descriptionHtml;return R&&"edit"===S?e(n,{elementType:"secondary",description:"Highlight key benefits with product description.",descriptionActions:[{text:"Add description",callback:A},{text:"sync data",callback:"syncProduct"}]}):e(t,{children:h(R,"",s("div",{...J,className:q,children:[e("style",{children:Q}),e("style",{children:O}),e("div",{className:B}),e(C,{ref:M,...K,className:G,style:E,dangerouslySetInnerHTML:{__html:H?.descriptionHtml||""}}),h(D&&I,s("button",{className:V,style:F,onClick:P,children:[e("span",{className:$,children:h(_,w?.viewLessText||"",w?.viewMoreText)}),h(w?.enableViewMoreIcon,e("span",{className:z,dangerouslySetInnerHTML:{__html:l}}))]})," ")]}))})};export{ProductDescription as default};
2
+ import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import{useProduct as o,useCurrentDevice as i,getResponsiveValueByScreen as r,useI18nStore as c,makeStyleResponsive as m,makeLineClamp as n}from"@gem-sdk/core";import l from"../../../common/components/NoDataState.js";import{ICON_SVG as a}from"./common/helpers.js";import{createClass as p,createStyle as d,createAttr as h,If as u}from"@gem-sdk/system";import{getClasses as y,getButtonClasses as g,getClassPreBuilt as f}from"./common/classes.js";import{getTextStyle as x,getButtonStyle as k,getStaticCss as N}from"./common/styles.js";import{useGpDescription as j}from"./hooks/useGpDescription.js";let ProductDescription=w=>{let{setting:L,advanced:b,builderProps:v}=w,{htmlTag:C}=L??{},H="html"===C?"div":"p",T=o(),D=i(),M=r(L?.hasLineClamp,D),{ref:_,open:I,isShowViewMore:P,handleToggleShowMore:S,mode:A,redirectProductShopifyLink:q}=j(L),{t:G}=c(),V=p({"gp-product-description":!0,[b?.cssClass]:!0}),$=p(y({setting:L,isLiquid:!1})),z=p(g({setting:L})),B=p({"gp-show-more-text":!0}),E=p({"gp-show-more-icon gp-ml-1":!0,...I?{"gp-rotate-180":!0}:{}}),F=p(f()),J=d({...x({setting:L}),...I?{}:m("line-clamp",n(L?.lineClamp,L?.hasLineClamp))}),K=d(k({setting:L})),O=h({"data-id":`${v?.uid}`}),Q=h({"data-gp-text":""}),{gpDescriptionCss:R,textDescriptionCss:U}=N(),W=!T?.descriptionHtml;return W&&"edit"===A?e(l,{elementType:"secondary",description:G("Highlight key benefits with product description."),descriptionActions:[{text:G("Add description"),callback:q},{text:G("sync data"),callback:"syncProduct"}]}):e(t,{children:u(W,"",s("div",{...O,className:V,children:[e("style",{children:U}),e("style",{children:R}),e("div",{className:F}),e(H,{ref:_,...Q,className:$,style:J,dangerouslySetInnerHTML:{__html:T?.descriptionHtml||""}}),u(M&&P,s("button",{className:z,style:K,onClick:S,children:[e("span",{className:B,children:u(I,L?.viewLessText||"",L?.viewMoreText)}),u(L?.enableViewMoreIcon,e("span",{className:E,dangerouslySetInnerHTML:{__html:a}}))]})," ")]}))})};export{ProductDescription as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{makeStyleResponsive as s}from"@gem-sdk/core";import o from"../../../common/components/NoDataState.js";import i from"../../../common/components/TooltipHover.js";import l from"../../../text/components/Text.js";import{createStyle as r,createClass as d,If as m}from"@gem-sdk/system";import{getWrapperTextStyle as n,getContainerStyle as a}from"./common/styles.js";import{getWrapperTextClass as p,getContainerClass as c,getRootClass as u}from"./common/classes.js";import{useGpDiscountTag as x}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:f,styles:g,builderProps:y,...h})=>{let{customContent:b}=f??{},j=h["bundle-item"],{textAlign:N}=g??{},{mode:T,product:v,salePrice:k,priceSave:w,currentProductId:A,unitCustomDisplay:D,shouldPlaceholderNoDiscount:F}=x({setting:f,styles:g,builderProps:y,...h});if(F)return e(i,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(o,{builderAttrs:y?.builderData,elementType:"secondary",description:"No discount",rawMode:!0,customClass:"!gp-p-[5px]"})});let S=r(n(g)),$=r(a(g)),q=d(p(g)),C=d(c()),I=d(u({mode:T,salePrice:k,priceSave:w,bundleItem:j}));return e("div",{className:I,style:{...s("ta",N)},id:`shopify-text-element-${y?.uid}`,"data-id":y?.uid,"data-product-id":A,"gp-data-hidden":"false",children:m(!v," ",e("div",{className:C,style:$,children:e("div",{className:q,style:S,children:t("div",{className:"gp-flex gp-break-all",children:[e(l,{styles:g,setting:{...f,text:b?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${y?.uid}-prefix`},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:D,options:{isCannotEditing:!0},excludeFlex:!0}}),e(l,{styles:g,setting:{...f,text:b?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${y?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useI18nStore as s,makeStyleResponsive as o}from"@gem-sdk/core";import i from"../../../common/components/NoDataState.js";import l from"../../../common/components/TooltipHover.js";import r from"../../../text/components/Text.js";import{createStyle as d,createClass as m,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as a,getContainerStyle as p}from"./common/styles.js";import{getWrapperTextClass as c,getContainerClass as u,getRootClass as x}from"./common/classes.js";import{useGpDiscountTag as f}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:T}=y??{},{t:v}=s(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=f({setting:g,styles:y,builderProps:h,...b});if($)return e(l,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(i,{builderAttrs:h?.builderData,elementType:"secondary",description:v("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(a(y)),C=d(p(y)),I=m(c(y)),P=m(u()),E=m(x({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:E,style:{...o("ta",T)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:n(!w," ",e("div",{className:P,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all",children:[e(r,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as C,useProduct as o,useCurrentDevice as l,useCurrentVariant as r,useSelectedOption as d,useEditorMode as n,useProductStore as s,getResponsiveValueByScreen as p,filterToolbarPreview as m}from"@gem-sdk/core";import{useMemo as c,useState as g,useEffect as f,Children as h,isValidElement as u}from"react";import y from"./components/feature-gallery/FeatureImageWithGallery.js";import I from"./components/feature-only/OnlyFeatureImage.js";import D from"./components/lightbox/ProductImagesLightBox.js";import b from"../../../common/components/NoDataState.js";import{getProductImagesClassName as M}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as E}from"./common/getBorderActiveCss.js";import Z from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=k=>{let w=c(()=>a(k),[k]),{redirectProductShopifyLink:L}=C(),{setting:A,styles:V,builderProps:v,builderAttrs:x,style:H,children:P}=w,G=o(),O=l(),T=r(),{isChangeSelectedOption:_}=d(),S=n(),j=s(e=>e.setProductFeaturedImage),[F,B]=g(!1),R=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,N=e=>e?.featuredImage,U=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,Y=c(()=>A?.typeDisplay==="all-images"&&!_,[_,A?.typeDisplay]),z=c(()=>{if(Y){let e;switch(A?.preDisplay){case"1st-images":e=N(G);break;case"1st-3d-mode":e=U(G);break;case"1st-video":e=R(G);break;case"1st-available-variant":e=T?.media}return j(e),e}},[Y,A?.preDisplay,j,G,T?.media]),J=c(()=>{let e=getProductGallery(G);return e?.length?e:[{id:G?.featuredImage?.id||"noImageError",baseID:G?.featuredImage?.baseID||"noImageError",src:G?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:G?.featuredImage?.width||480,height:G?.featuredImage?.height||480}]},[G]),W=c(()=>J.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[J]),X=c(()=>p(V?.position,O),[O,V?.position]),q=(e,t)=>{Q(e),t&&K()},K=()=>{B(!0)},Q=e=>{if(!e)return;let t=W[e];if(void 0!==t){let e=J[t];e&&j(e)}};f(()=>{if(T&&!Y){let e=W[T?.mediaId];if(void 0!==e){let t=J[e]??G?.featuredImage;t&&j(t)}}},[T,W,J,G?.featuredImage,j,Y]);let $=c(()=>{let e="popup"===p(A?.ftClickOpenLightBox,O)||p(A?.clickOpenLightBox,O);return e||"edit"!==S||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[A?.ftClickOpenLightBox,A?.clickOpenLightBox,O,S]),ee=()=>J.length>0?h.map(m(P),e=>u(e)?t(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:A?.ftNavigationPosition,imageData:{imageShape:V?.ftShape,imageAlign:V?.align,imageLayout:V?.position},dotData:{dotSize:A?.ftDotSize,dotGapToCarousel:A?.ftDotGapToCarousel,dotStyle:A?.ftDotStyle}}):null):null,et=`
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as C,useProduct as o,useCurrentDevice as l,useCurrentVariant as r,useSelectedOption as d,useEditorMode as n,useProductStore as s,useI18nStore as p,getResponsiveValueByScreen as m,filterToolbarPreview as c}from"@gem-sdk/core";import{useMemo as g,useState as f,useEffect as h,Children as u,isValidElement as y}from"react";import I from"./components/feature-gallery/FeatureImageWithGallery.js";import D from"./components/feature-only/OnlyFeatureImage.js";import b from"./components/lightbox/ProductImagesLightBox.js";import M from"../../../common/components/NoDataState.js";import{getProductImagesClassName as E}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as Z}from"./common/getBorderActiveCss.js";import k from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=w=>{let L=g(()=>a(w),[w]),{redirectProductShopifyLink:A}=C(),{setting:V,styles:v,builderProps:x,builderAttrs:H,style:P,children:G}=L,O=o(),T=l(),_=r(),{isChangeSelectedOption:S}=d(),j=n(),F=s(e=>e.setProductFeaturedImage),{t:B}=p(),[R,N]=f(!1),U=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,Y=e=>e?.featuredImage,z=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,J=g(()=>V?.typeDisplay==="all-images"&&!S,[S,V?.typeDisplay]),W=g(()=>{if(J){let e;switch(V?.preDisplay){case"1st-images":e=Y(O);break;case"1st-3d-mode":e=z(O);break;case"1st-video":e=U(O);break;case"1st-available-variant":e=_?.media}return F(e),e}},[J,V?.preDisplay,F,O,_?.media]),X=g(()=>{let e=getProductGallery(O);return e?.length?e:[{id:O?.featuredImage?.id||"noImageError",baseID:O?.featuredImage?.baseID||"noImageError",src:O?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:O?.featuredImage?.width||480,height:O?.featuredImage?.height||480}]},[O]),q=g(()=>X.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[X]),K=g(()=>m(v?.position,T),[T,v?.position]),Q=(e,t)=>{ee(e),t&&$()},$=()=>{N(!0)},ee=e=>{if(!e)return;let t=q[e];if(void 0!==t){let e=X[t];e&&F(e)}};h(()=>{if(_&&!J){let e=q[_?.mediaId];if(void 0!==e){let t=X[e]??O?.featuredImage;t&&F(t)}}},[_,q,X,O?.featuredImage,F,J]);let et=g(()=>{let e="popup"===m(V?.ftClickOpenLightBox,T)||m(V?.clickOpenLightBox,T);return e||"edit"!==j||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[V?.ftClickOpenLightBox,V?.clickOpenLightBox,T,j]),ea=()=>X.length>0?u.map(c(G),t=>y(t)?e(t.type,{...t.props,isInsideProductImage:!0,navigationPosition:V?.ftNavigationPosition,imageData:{imageShape:v?.ftShape,imageAlign:v?.align,imageLayout:v?.position},dotData:{dotSize:V?.ftDotSize,dotGapToCarousel:V?.ftDotGapToCarousel,dotStyle:V?.ftDotStyle}}):null):null,ei=`
3
3
  <svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
5
5
  <path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
@@ -23,4 +23,4 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineS
23
23
  <path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
24
24
  <path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
25
25
  </svg>
26
- `,ea=t(b,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:L},{text:"sync data",callback:"syncProduct"}],additionalMedia:et}),{wrapperClasses:ei}=M(k);return e("div",{...x,className:ei,style:H,children:[t("style",{dangerouslySetInnerHTML:{__html:E({settings:{...A,...V},uid:v?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(X)&&t(y,{...w,gallery:J,priorityFeatureImage:z,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),"only-feature"===X&&t(I,{gallery:J,...w,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),["one-col","two-col"].includes(X)&&t(Z,{gallery:J,...w,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),$&&t(D,{productImages:J,builderPropUID:v?.uid,open:F,onHandleClose:()=>B(!1),imageRatio:i(V?.ftShape)}),m(P,!0)]})};export{ProductImagesV2 as default};
26
+ `,eC=e(M,{elementType:"secondary",description:B("Catch your customer's attention with attracted media."),descriptionActions:[{text:B("Add image"),callback:A},{text:B("sync data"),callback:"syncProduct"}],additionalMedia:ei}),{wrapperClasses:eo}=E(w);return t("div",{...H,className:eo,style:P,children:[e("style",{dangerouslySetInnerHTML:{__html:Z({settings:{...V,...v},uid:x?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(K)&&e(I,{...L,gallery:X,priorityFeatureImage:W,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,children:ea()}),"only-feature"===K&&e(D,{gallery:X,...L,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,children:ea()}),["one-col","two-col"].includes(K)&&e(k,{gallery:X,...L,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,children:ea()}),et&&e(b,{productImages:X,builderPropUID:x?.uid,open:R,onHandleClose:()=>N(!1),imageRatio:i(v?.ftShape)}),c(G,!0)]})};export{ProductImagesV2 as default};
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as l,useProduct as C,useCurrentDevice as o,useCurrentVariant as r,useSelectedOption as n,useEditorMode as d,useProductStore as s,getResponsiveValueByScreen as p,filterToolbarPreview as c}from"@gem-sdk/core";import{useMemo as m,useState as f,useEffect as g,Children as h,isValidElement as u}from"react";import y from"./components/feature-gallery/FeatureImageWithGallery.js";import I from"./components/feature-only/OnlyFeatureImage.js";import D from"./components/lightbox/ProductImagesLightBox.js";import b from"../../../common/components/NoDataState.js";import{getProductImagesClassName as M}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as E}from"./common/getBorderActiveCss.js";import Z from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=w=>{let L=m(()=>a(w),[w]),{redirectProductShopifyLink:V}=l(),{setting:k,styles:v,builderProps:A,builderAttrs:O,style:_,children:x}=L,B=C(),H=o(),P=r(),{isChangeSelectedOption:F}=n(),G=d(),T=s(e=>e.setProductFeaturedImage),[j,S]=f(!1),R=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,N=e=>e?.featuredImage,U=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,Y=m(()=>k?.typeDisplay==="all-images"&&!F,[F,k?.typeDisplay]),z=m(()=>{if(Y){let e;switch(k?.preDisplay){case"1st-images":e=N(B);break;case"1st-3d-mode":e=U(B);break;case"1st-video":e=R(B);break;case"1st-available-variant":e=P?.media}return T(e),e}},[Y,k?.preDisplay,T,B,P?.media]),J=m(()=>k?.filterByVariant==="selected_variant",[k?.filterByVariant]),W=m(()=>{let e=getProductGallery(B);if(!e?.length)return[{id:B?.featuredImage?.id||"noImageError",baseID:B?.featuredImage?.baseID||"noImageError",src:B?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:B?.featuredImage?.width||480,height:B?.featuredImage?.height||480}];if(!J||!P?.selectedOptions?.length)return e;let t=P.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),l=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),l=i(a),C="all-variants"===t,o=t===l||t.includes(l);return C||o});return l?.length>0?l:e},[P?.selectedOptions,J,B]),X=m(()=>W.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[W]),q=m(()=>p(v?.position,H),[H,v?.position]),K=(e,t)=>{$(e),t&&Q()},Q=()=>{S(!0)},$=e=>{if(!e)return;let t=X[e];if(void 0!==t){let e=W[t];e&&T(e)}};g(()=>{if(P&&!Y){let e=X[P?.mediaId];if(void 0!==e){let t=W[e]??B?.featuredImage;t&&T(t)}}},[P,X,W,B?.featuredImage,T,Y]);let ee=m(()=>{let e="popup"===p(k?.ftClickOpenLightBox,H)||p(k?.clickOpenLightBox,H);return e||"edit"!==G||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[k?.ftClickOpenLightBox,k?.clickOpenLightBox,H,G]),et=()=>W.length>0?h.map(c(x),e=>u(e)?t(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:k?.ftNavigationPosition,imageData:{imageShape:v?.ftShape,imageAlign:v?.align,imageLayout:v?.position},dotData:{dotSize:k?.ftDotSize,dotGapToCarousel:k?.ftDotGapToCarousel,dotStyle:k?.ftDotStyle}}):null):null,ea=`
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as l,useProduct as C,useCurrentDevice as o,useCurrentVariant as r,useSelectedOption as n,useEditorMode as d,useProductStore as s,getResponsiveValueByScreen as p,useI18nStore as c,filterToolbarPreview as m}from"@gem-sdk/core";import{useMemo as f,useState as g,useEffect as h,Children as u,isValidElement as y}from"react";import I from"./components/feature-gallery/FeatureImageWithGallery.js";import D from"./components/feature-only/OnlyFeatureImage.js";import b from"./components/lightbox/ProductImagesLightBox.js";import M from"../../../common/components/NoDataState.js";import{getProductImagesClassName as E}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as Z}from"./common/getBorderActiveCss.js";import w from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=L=>{let V=f(()=>a(L),[L]),{redirectProductShopifyLink:k}=l(),{setting:v,styles:A,builderProps:O,builderAttrs:_,style:x,children:B}=V,H=C(),P=o(),F=r(),{isChangeSelectedOption:G}=n(),T=d(),j=s(e=>e.setProductFeaturedImage),[S,R]=g(!1),N=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,U=e=>e?.featuredImage,Y=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,z=f(()=>v?.typeDisplay==="all-images"&&!G,[G,v?.typeDisplay]),J=f(()=>{if(z){let e;switch(v?.preDisplay){case"1st-images":e=U(H);break;case"1st-3d-mode":e=Y(H);break;case"1st-video":e=N(H);break;case"1st-available-variant":e=F?.media}return j(e),e}},[z,v?.preDisplay,j,H,F?.media]),W=f(()=>v?.filterByVariant==="selected_variant",[v?.filterByVariant]),X=f(()=>{let e=getProductGallery(H);if(!e?.length)return[{id:H?.featuredImage?.id||"noImageError",baseID:H?.featuredImage?.baseID||"noImageError",src:H?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:H?.featuredImage?.width||480,height:H?.featuredImage?.height||480}];if(!W||!F?.selectedOptions?.length)return e;let t=F.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),l=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),l=i(a),C="all-variants"===t,o=t===l||t.includes(l);return C||o});return l?.length>0?l:e},[F?.selectedOptions,W,H]),q=f(()=>X.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[X]),K=f(()=>p(A?.position,P),[P,A?.position]),Q=(e,t)=>{ee(e),t&&$()},$=()=>{R(!0)},ee=e=>{if(!e)return;let t=q[e];if(void 0!==t){let e=X[t];e&&j(e)}};h(()=>{if(F&&!z){let e=q[F?.mediaId];if(void 0!==e){let t=X[e]??H?.featuredImage;t&&j(t)}}},[F,q,X,H?.featuredImage,j,z]);let et=f(()=>{let e="popup"===p(v?.ftClickOpenLightBox,P)||p(v?.clickOpenLightBox,P);return e||"edit"!==T||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[v?.ftClickOpenLightBox,v?.clickOpenLightBox,P,T]),ea=()=>X.length>0?u.map(m(B),t=>y(t)?e(t.type,{...t.props,isInsideProductImage:!0,navigationPosition:v?.ftNavigationPosition,imageData:{imageShape:A?.ftShape,imageAlign:A?.align,imageLayout:A?.position},dotData:{dotSize:v?.ftDotSize,dotGapToCarousel:v?.ftDotGapToCarousel,dotStyle:v?.ftDotStyle}}):null):null,ei=`
3
3
  <svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
5
5
  <path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
@@ -23,4 +23,4 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineS
23
23
  <path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
24
24
  <path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
25
25
  </svg>
26
- `,ei=t(b,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:V},{text:"sync data",callback:"syncProduct"}],additionalMedia:ea}),{wrapperClasses:el}=M(w);return e("div",{...O,className:el,style:_,children:[t("style",{dangerouslySetInnerHTML:{__html:E({settings:{...k,...v},uid:A?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(q)&&t(y,{...L,isFilterByVariantEnabled:J,gallery:W,priorityFeatureImage:z,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,children:et()}),"only-feature"===q&&t(I,{gallery:W,...L,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,isFilterByVariantEnabled:J,children:et()}),["one-col","two-col"].includes(q)&&t(Z,{gallery:W,...L,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,children:et()}),ee&&t(D,{productImages:W,builderPropUID:A?.uid,open:j,onHandleClose:()=>S(!1),imageRatio:i(v?.ftShape)}),c(x,!0)]})};export{ProductImagesV3 as default};
26
+ `,{t:el}=c(),eC=e(M,{elementType:"secondary",description:el("Catch your customer's attention with attracted media."),descriptionActions:[{text:el("Add image"),callback:k},{text:el("sync data"),callback:"syncProduct"}],additionalMedia:ei}),{wrapperClasses:eo}=E(L);return t("div",{..._,className:eo,style:x,children:[e("style",{dangerouslySetInnerHTML:{__html:Z({settings:{...v,...A},uid:O?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(K)&&e(I,{...V,isFilterByVariantEnabled:W,gallery:X,priorityFeatureImage:J,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,children:ea()}),"only-feature"===K&&e(D,{gallery:X,...V,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,isFilterByVariantEnabled:W,children:ea()}),["one-col","two-col"].includes(K)&&e(w,{gallery:X,...V,onHandleClickImage:(e,t)=>Q(e||"",t),noDataChildren:eC,children:ea()}),et&&e(b,{productImages:X,builderPropUID:O?.uid,open:S,onHandleClose:()=>R(!1),imageRatio:i(A?.ftShape)}),m(B,!0)]})};export{ProductImagesV3 as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useVariants as e,OptionSpecialStyle as n,DEVICES as r,getResponsiveValueByScreen as i}from"@gem-sdk/core";import a from"../../../text/components/Text.js";import s from"./components/variants/index.js";import m from"./components/dropdown-swatches/Dropdown.js";import p from"./components/dropdown-group/DropdownGroup.js";import l from"../../../common/components/NoDataState.js";import{createClass as c,createAttr as d,createStyle as u,If as f}from"@gem-sdk/system";import{getWrapperStyle as h,getVariantOptionGroupStyle as y}from"./common/main/styles.js";import{getAttrs as g}from"./common/main/getAttr.js";import{getWrapDropdownClass as v,getVariantOptionGroupClass as j}from"./common/main/classes.js";import{getDropdownGroupData as w,getTextVariantTitleData as x}from"./common/main/getData.js";import{useGpVariants as N}from"./hooks/useGpVariants.js";import{getWrapVariantOptionClass as b}from"./common/variants/classes.js";import{getMarginBottomStyle as k}from"./common/variants/styles.js";let ProductVariants=T=>{let{builderProps:A,styles:P,setting:V}=T,{align:D,optionTypo:$,swatchItemWidth:S,dropdownItemWidth:C,swatchSpacing:E,marginBottom:G}=P??{},{label:O,showAsSwatches:W,layout:_,hasPreSelected:z}=V??{},{uid:K}=A??{},R=e(),{mode:q,options:B,variantId:F,elementRef:H,variantGroup:I,isChangeVariant:J,selectedOptions:L,isDefaultVariant:M,getVariantConfiguration:Q,redirectProductShopifyLink:U}=N(T,R),X=()=>{let o={};return r.forEach(t=>{let e=i(S,t);o[t]="auto"===e}),o},Y=()=>{let o={};return r.forEach(t=>{o[t]=C?.[t]==="fill"}),o},Z=()=>{let e=B?.filter(o=>{let t=Q(o.name);return!t?.hide});return e?.map((r,i)=>{let p=Q(r.name),l=p?p.optionType:r.optionType,d=p?p.presets[p.optionType||"rectangle_list"]?.spacing:E,h=(z||F)&&r.name?L?.[r.name]:void 0,g=c(j(D)),v=u(y(E,d)),w=x(T,"React",{optionName:r.name,hasPreSelected:z,selectedOptions:L,styleOptionSelected:l}),N=c(b(_,D)),A=i===e.length-1;return t("div",{className:N,style:u(k(G,A)),children:[f(O,o(a,{...w})),t("div",{className:g,style:v,children:[W&&n.includes(`${l}`)&&r.values.map(t=>{let e=(!!z||!!J||!!F)&&!!r.name&&L?.[r.name]===t.label;return o(s,{variantKey:`${r.id}-${t.id}`,showAsSwatches:W,uid:K,optionName:r.name??"",optionValue:t.label??"",name:r.name,value:t,optionNumber:B.length,optionPosition:i,...P,...V,presetConfiguration:Q(r.name),checked:e,typeOfOption:l||"dropdown",swatchAutoWidth:X(),optionTypo:$},t.id)}),f(("dropdown"===l||W&&!n.includes(`${l}`))&&"radio_buttons"!==l,o(m,{...P,...V,variants:R,option:r,initValue:h,presetConfiguration:Q(r.name),swatchAutoWidth:Y(),optionTypo:$,optionPosition:i,optionNumber:B.length}))]})]},r.id)})},oo=c(v(D)),ot=w(T),oe=()=>o("div",{className:oo,children:o(p,{...ot})});if(M&&"edit"===q)return o(l,{elementType:"secondary",description:"Setup options like colors, sizes with product variant.",descriptionActions:[{text:"Add new variant",callback:U},{text:"sync data",callback:"syncProduct"}]});if(M)return;let on=d(g({uid:K,hasPreSelected:z})),or=u(h(T)),oi=c({"gp-flex gp-flex-col !gp-ml-0":!0});return o("div",{ref:H,...on,className:oi,style:or,children:f(I,oe(),Z())})};export{ProductVariants as default};
2
+ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useI18nStore as e,useVariants as n,OptionSpecialStyle as r,DEVICES as i,getResponsiveValueByScreen as a}from"@gem-sdk/core";import s from"../../../text/components/Text.js";import m from"./components/variants/index.js";import p from"./components/dropdown-swatches/Dropdown.js";import l from"./components/dropdown-group/DropdownGroup.js";import c from"../../../common/components/NoDataState.js";import{createClass as d,createAttr as u,createStyle as f,If as h}from"@gem-sdk/system";import{getWrapperStyle as y,getVariantOptionGroupStyle as g}from"./common/main/styles.js";import{getAttrs as v}from"./common/main/getAttr.js";import{getWrapDropdownClass as j,getVariantOptionGroupClass as w}from"./common/main/classes.js";import{getDropdownGroupData as x,getTextVariantTitleData as N}from"./common/main/getData.js";import{useGpVariants as b}from"./hooks/useGpVariants.js";import{getWrapVariantOptionClass as k}from"./common/variants/classes.js";import{getMarginBottomStyle as T}from"./common/variants/styles.js";let ProductVariants=A=>{let{t:P}=e(),{builderProps:V,styles:D,setting:$}=A,{align:S,optionTypo:C,swatchItemWidth:E,dropdownItemWidth:G,swatchSpacing:O,marginBottom:W}=D??{},{label:_,showAsSwatches:z,layout:K,hasPreSelected:R}=$??{},{uid:q}=V??{},B=n(),{mode:F,options:H,variantId:I,elementRef:J,variantGroup:L,isChangeVariant:M,selectedOptions:Q,isDefaultVariant:U,getVariantConfiguration:X,redirectProductShopifyLink:Y}=b(A,B),Z=()=>{let o={};return i.forEach(t=>{let e=a(E,t);o[t]="auto"===e}),o},oo=()=>{let o={};return i.forEach(t=>{o[t]=G?.[t]==="fill"}),o},ot=()=>{let e=H?.filter(o=>{let t=X(o.name);return!t?.hide});return e?.map((n,i)=>{let a=X(n.name),l=a?a.optionType:n.optionType,c=a?a.presets[a.optionType||"rectangle_list"]?.spacing:O,u=(R||I)&&n.name?Q?.[n.name]:void 0,y=d(w(S)),v=f(g(O,c)),j=N(A,"React",{optionName:n.name,hasPreSelected:R,selectedOptions:Q,styleOptionSelected:l}),x=d(k(K,S)),b=i===e.length-1;return t("div",{className:x,style:f(T(W,b)),children:[h(_,o(s,{...j})),t("div",{className:y,style:v,children:[z&&r.includes(`${l}`)&&n.values.map(t=>{let e=(!!R||!!M||!!I)&&!!n.name&&Q?.[n.name]===t.label;return o(m,{variantKey:`${n.id}-${t.id}`,showAsSwatches:z,uid:q,optionName:n.name??"",optionValue:t.label??"",name:n.name,value:t,optionNumber:H.length,optionPosition:i,...D,...$,presetConfiguration:X(n.name),checked:e,typeOfOption:l||"dropdown",swatchAutoWidth:Z(),optionTypo:C},t.id)}),h(("dropdown"===l||z&&!r.includes(`${l}`))&&"radio_buttons"!==l,o(p,{...D,...$,variants:B,option:n,initValue:u,presetConfiguration:X(n.name),swatchAutoWidth:oo(),optionTypo:C,optionPosition:i,optionNumber:H.length}))]})]},n.id)})},oe=d(j(S)),on=x(A),or=()=>o("div",{className:oe,children:o(l,{...on})});if(U&&"edit"===F)return o(c,{elementType:"secondary",description:P("Setup options like colors, sizes with product variant."),descriptionActions:[{text:P("Add new variant"),callback:Y},{text:P("sync data"),callback:"syncProduct"}]});if(U)return;let oi=u(v({uid:q,hasPreSelected:R})),oa=f(y(A)),os=d({"gp-flex gp-flex-col !gp-ml-0":!0});return o("div",{ref:J,...oi,className:os,style:oa,children:h(L,or(),ot())})};export{ProductVariants as default};
@@ -1,5 +1,5 @@
1
- import{template as e,RenderIf as t,isLocalEnv as o,baseAssetURL as s}from"@gem-sdk/core";import i from"../../image/components/NextImage.liquid.js";import{getSettingPreloadData as l}from"../../helpers.js";import{createAttr as r,createClass as a,createStyle as n,If as d}from"@gem-sdk/system";import{getWrapThumbnailClasses as m,getButtonThumbnailClasses as c,getImageThumbnailClasses as u,getVideoYoutubeClasses as p}from"../common/classes.js";import{getPreloadImageStyle as v}from"../common/styles.js";import{getHtml5Attr as y}from"../common/attrs.js";let HTML5Embed=g=>{let $=`gp-video-${g.uid}`,{thumbnail:f,muted:h,autoplay:L,loop:b,controls:E,src:A,style:w,title:T,className:P,lazy:j,poster:k,wrapperStyles:I}=g,S=L&&h&&!!f,V=!j&&g.isVideoComponent,x=!f||L&&h,C=V?A:void 0,M=r({...y({videoId:$,title:T,autoplay:L,preloadThumbnail:S,offLazyLoad:V,src:A,thumbnail:f})}),B=a({...m(x)}),N=n({...v()}),z=a({...c()}),D=a({...u()}),G=a({...p(P,V)}),H=()=>S?e`${i({src:f,alt:T,priority:k?.preload,enableLazyLoadImage:!0,style:N})}
2
- ${d(L,`<script>
1
+ import{template as e,RenderIf as t,isLocalEnv as o,baseAssetURL as i}from"@gem-sdk/core";import r from"../../image/components/NextImage.liquid.js";import{getSettingPreloadData as s}from"../../helpers.js";import{createAttr as a,createClass as d,createStyle as l,If as n}from"@gem-sdk/system";import{getWrapThumbnailClasses as m,getButtonThumbnailClasses as c,getImageThumbnailClasses as u,getVideoYoutubeClasses as p}from"../common/classes.js";import{getPreloadImageStyle as v}from"../common/styles.js";import{getHtml5Attr as y}from"../common/attrs.js";let HTML5Embed=f=>{let g=`gp-video-${f.uid}`,{thumbnail:$,muted:L,autoplay:h,loop:b,controls:E,src:A,style:P,title:w,className:T,lazy:j,poster:k,wrapperStyles:S}=f,V=h&&L&&!!$,x=!j&&f.isVideoComponent,C=!$||h&&L,I=x?A:void 0,M=a({...y({videoId:g,title:w,autoplay:h,preloadThumbnail:V,offLazyLoad:x,src:A,thumbnail:$})}),N=d({...m(C)}),z=l({...v()}),B=d({...c()}),D=d({...u()}),G=d({...p(T,x)}),H=()=>V?e`${r({src:$,alt:w,priority:k?.preload,enableLazyLoadImage:!0,style:z})}
2
+ ${n(h,`<script>
3
3
  document.addEventListener("DOMContentLoaded", (event) => {
4
4
  const eventList = ["keydown", "mousemove", "wheel", "touchmove", "touchstart", "touchend"];
5
5
  const autoLoadTimeout = setTimeout(runAutoPlayVideo, 0);
@@ -14,20 +14,32 @@ import{template as e,RenderIf as t,isLocalEnv as o,baseAssetURL as s}from"@gem-s
14
14
  });
15
15
  }
16
16
  function runAutoPlayVideo() {
17
- document.getElementById('${$}').setAttribute('autoplay','true');
18
- document.getElementById('${$}').setAttribute('playsinline','true');
19
- document.getElementById('${$}').play();
17
+ var video = document.getElementById('${g}');
18
+ if (!video) return;
19
+ video.setAttribute('autoplay','true');
20
+ video.setAttribute('playsinline','true');
21
+ var playPromise = video.play();
22
+ if (playPromise !== undefined) {
23
+ playPromise.catch(function(error) {
24
+ if (error.name === 'AbortError') {
25
+ video.addEventListener('loadeddata', function onLoaded() {
26
+ video.removeEventListener('loadeddata', onLoaded);
27
+ video.play();
28
+ });
29
+ }
30
+ });
31
+ }
20
32
  }
21
33
  });
22
34
  </script>`)}
23
35
  `:"",O=()=>e`
24
36
  <div
25
37
  role="presentation"
26
- style="${w}"
27
- class="${B}"
38
+ style="${P}"
39
+ class="${N}"
28
40
  >
29
- ${i({id:"video-thumbnail",src:f??"",alt:k?.altText,title:k?.imageTitle,className:D,isDisableAspectStyle:!0,priority:k?.preload,enableLazyLoadImage:!0})}
30
- <button type="button" class="${z}" aria-label="Play">
41
+ ${r({id:"video-thumbnail",src:$??"",alt:k?.altText,title:k?.imageTitle,className:D,isDisableAspectStyle:!0,priority:k?.preload,enableLazyLoadImage:!0})}
42
+ <button type="button" class="${B}" aria-label="Play">
31
43
  <svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
32
44
  <path
33
45
  fill="currentColor"
@@ -37,20 +49,20 @@ import{template as e,RenderIf as t,isLocalEnv as o,baseAssetURL as s}from"@gem-s
37
49
  </button>
38
50
  </div>
39
51
  `;return e`
40
- <gp-lite-html5-embed is-check-loaded="${g.isCheckLoaded??!1}" style="${I}">
52
+ <gp-lite-html5-embed is-check-loaded="${f.isCheckLoaded??!1}" style="${S}">
41
53
  ${H()}
42
54
  <video
43
55
  ${{...M}}
44
- style="${w}"
56
+ style="${P}"
45
57
  class="${G}"
46
58
  ${E?"controls":void 0}
47
59
  ${b?"loop":void 0}
48
- ${h?"muted":void 0}
49
- ${L?"autoplay":void 0}
60
+ ${L?"muted":void 0}
61
+ ${h?"autoplay":void 0}
50
62
  playsinline
51
- ${C?`src="${C}"`:""}
63
+ ${I?`src="${I}"`:""}
52
64
  ></video>
53
- ${d(!x,O())}
65
+ ${n(!C,O())}
54
66
  </gp-lite-html5-embed>
55
- ${t(o,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-lite-html5-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${s}/assets-v2/gp-lite-html5-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
67
+ ${t(o,`<script ${s('class="gps-link" delay',"src")}="{{ 'gp-lite-html5-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${s('class="gps-link" delay',"src")}="${i}/assets-v2/gp-lite-html5-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
56
68
  `};export{HTML5Embed as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "12.0.0-dev.57",
3
+ "version": "12.0.0-dev.59",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -23,11 +23,11 @@
23
23
  "relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/element-relationship/index.js",
24
24
  "update-img-src-3rd": "node ./scripts/update-img-src-3rd.js",
25
25
  "generate-tailwind": "node ./scripts/generateTailwind.js",
26
- "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/extract-texts-to-locales.js",
27
- "i18n:generate-keys-usage": "node ./scripts/en-keys-usage.js"
26
+ "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js",
27
+ "i18n:generate-keys-usage": "node ./scripts/translate/en-keys-usage.js"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/core": "12.0.0-dev.57",
30
+ "@gem-sdk/core": "12.0.0-dev.58",
31
31
  "@gem-sdk/styles": "12.0.0-dev.53",
32
32
  "@gem-sdk/system": "12.0.0-dev.53",
33
33
  "@types/react-transition-group": "^4.4.12",