@gem-sdk/core 11.2.0 → 12.0.0-dev.101

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 (84) hide show
  1. package/dist/cjs/components/ComponentToolbarPreview.js +1 -1
  2. package/dist/cjs/components/InteractionSuffix.js +1 -1
  3. package/dist/cjs/components/Render.liquid.js +2 -2
  4. package/dist/cjs/components/RenderCustomCode.js +1 -1
  5. package/dist/cjs/components/ai-generator/AIContentGenerator.js +1 -1
  6. package/dist/cjs/components/ai-generator/components/PickProduct.js +1 -1
  7. package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +1 -1
  8. package/dist/cjs/components/constant.js +1 -1
  9. package/dist/cjs/components/resize/Spacing.js +1 -1
  10. package/dist/cjs/components/theme-section/CreateThemeSection.js +1 -1
  11. package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -2
  12. package/dist/cjs/components/toolbar/SectionErrorBanner.js +2 -0
  13. package/dist/cjs/contexts/BuilderPreviewContext.js +1 -1
  14. package/dist/cjs/contexts/PageContext.js +1 -1
  15. package/dist/cjs/contexts/ProductContext.js +1 -1
  16. package/dist/cjs/graphql/fragments/media.generated.js +1 -0
  17. package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +0 -4
  18. package/dist/cjs/graphql/fragments/product-little.generated.js +1 -1
  19. package/dist/cjs/graphql/fragments/product-variants-with-selling-plans-select.generated.js +43 -0
  20. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +11 -2
  21. package/dist/cjs/graphql/queries/product-value-label.generated.js +4 -6
  22. package/dist/cjs/graphql/queries/product-variant-with-selling-plans.generated.js +25 -0
  23. package/dist/cjs/graphql/queries/products-with-selling-plans.generated.js +82 -0
  24. package/dist/cjs/graphql/queries/products.generated.js +6 -0
  25. package/dist/cjs/graphql/queries/published-theme-pages.generated.js +5 -2
  26. package/dist/cjs/graphql-app-api/queries/ThemePageMeta.generated.js +30 -0
  27. package/dist/cjs/helpers/background.js +1 -1
  28. package/dist/cjs/helpers/interaction/index.js +1 -1
  29. package/dist/cjs/helpers/liquid.js +1 -0
  30. package/dist/cjs/helpers/make-style.js +1 -1
  31. package/dist/cjs/helpers/queries/get-products.js +1 -1
  32. package/dist/cjs/helpers/queries/getProductOffers.js +1 -0
  33. package/dist/cjs/hooks/animation/animations.js +0 -1
  34. package/dist/cjs/hooks/shop/use-products-query.js +0 -1
  35. package/dist/cjs/hooks/shop/useProductOffersQuery.js +2 -0
  36. package/dist/cjs/hooks/useAnimations.js +1 -1
  37. package/dist/cjs/hooks/useFormatMoney.js +1 -1
  38. package/dist/cjs/hooks/useI18n.js +1 -1
  39. package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -2
  40. package/dist/cjs/hooks/useProduct.js +1 -1
  41. package/dist/cjs/index.js +1 -1
  42. package/dist/esm/components/ComponentToolbarPreview.js +1 -1
  43. package/dist/esm/components/InteractionSuffix.js +1 -1
  44. package/dist/esm/components/Render.liquid.js +2 -2
  45. package/dist/esm/components/RenderCustomCode.js +1 -1
  46. package/dist/esm/components/ai-generator/AIContentGenerator.js +1 -1
  47. package/dist/esm/components/ai-generator/components/PickProduct.js +1 -1
  48. package/dist/esm/components/ai-generator/components/ToneAndVoice.js +1 -1
  49. package/dist/esm/components/constant.js +1 -1
  50. package/dist/esm/components/resize/Spacing.js +1 -1
  51. package/dist/esm/components/theme-section/CreateThemeSection.js +1 -1
  52. package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -2
  53. package/dist/esm/components/toolbar/SectionErrorBanner.js +2 -0
  54. package/dist/esm/contexts/BuilderPreviewContext.js +1 -1
  55. package/dist/esm/contexts/PageContext.js +1 -1
  56. package/dist/esm/contexts/ProductContext.js +1 -1
  57. package/dist/esm/graphql/fragments/media.generated.js +1 -0
  58. package/dist/esm/graphql/fragments/preview-theme-page.generated.js +0 -4
  59. package/dist/esm/graphql/fragments/product-little.generated.js +1 -1
  60. package/dist/esm/graphql/fragments/product-variants-with-selling-plans-select.generated.js +43 -0
  61. package/dist/esm/graphql/fragments/published-theme-page.generated.js +11 -2
  62. package/dist/esm/graphql/queries/product-value-label.generated.js +4 -6
  63. package/dist/esm/graphql/queries/product-variant-with-selling-plans.generated.js +25 -0
  64. package/dist/esm/graphql/queries/products-with-selling-plans.generated.js +82 -0
  65. package/dist/esm/graphql/queries/products.generated.js +6 -0
  66. package/dist/esm/graphql/queries/published-theme-pages.generated.js +5 -2
  67. package/dist/esm/graphql-app-api/queries/ThemePageMeta.generated.js +30 -0
  68. package/dist/esm/helpers/background.js +1 -1
  69. package/dist/esm/helpers/interaction/index.js +1 -1
  70. package/dist/esm/helpers/liquid.js +1 -0
  71. package/dist/esm/helpers/make-style.js +1 -1
  72. package/dist/esm/helpers/queries/get-products.js +1 -1
  73. package/dist/esm/helpers/queries/getProductOffers.js +1 -0
  74. package/dist/esm/hooks/animation/animations.js +0 -1
  75. package/dist/esm/hooks/shop/use-products-query.js +0 -1
  76. package/dist/esm/hooks/shop/useProductOffersQuery.js +2 -0
  77. package/dist/esm/hooks/useAnimations.js +1 -1
  78. package/dist/esm/hooks/useFormatMoney.js +1 -1
  79. package/dist/esm/hooks/useI18n.js +1 -1
  80. package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -2
  81. package/dist/esm/hooks/useProduct.js +1 -1
  82. package/dist/esm/index.js +1 -1
  83. package/dist/types/index.d.ts +10718 -2201
  84. package/package.json +12 -12
@@ -0,0 +1,82 @@
1
+ import{ProductOptionSelect as e}from"../fragments/product-option.generated.js";import{ProductOptionValueSelect as r}from"../fragments/product-option-value.generated.js";import{MediaSelect as t}from"../fragments/media.generated.js";import{ProductVariantsWithSellingPlansSelect as a}from"../fragments/product-variants-with-selling-plans-select.generated.js";import{SelectedOptionSelect as n}from"../fragments/selected-option.generated.js";let ProductWithSellingPlansSelectFragment=`
2
+ fragment ProductWithSellingPlansSelectFragment on ProductEdge {
3
+ cursor
4
+ node {
5
+ id
6
+ title
7
+ createdAt
8
+ description
9
+ descriptionHtml
10
+ handle
11
+ averageRating
12
+ isStorefront
13
+ isSample
14
+ baseID
15
+ sku
16
+ requiresSellingPlan
17
+ options {
18
+ ...ProductOptionSelect
19
+ }
20
+ vendor
21
+ featuredImage {
22
+ ...MediaSelect
23
+ }
24
+ collections {
25
+ edges {
26
+ node {
27
+ id
28
+ title
29
+ }
30
+ }
31
+ }
32
+ tags
33
+ sellingPlanGroups {
34
+ appID
35
+ baseID
36
+ id
37
+ name
38
+ }
39
+ medias(first: $firstMedia, after: $afterMedia, orderBy: $orderByMedia) {
40
+ edges {
41
+ cursor
42
+ node {
43
+ ...MediaSelect
44
+ }
45
+ }
46
+ pageInfo {
47
+ endCursor
48
+ hasNextPage
49
+ }
50
+ }
51
+ variants(first: $firstVariant, after: $afterVariant) {
52
+ edges {
53
+ cursor
54
+ node {
55
+ ...ProductVariantsWithSellingPlansSelect
56
+ }
57
+ }
58
+ pageInfo {
59
+ hasNextPage
60
+ endCursor
61
+ }
62
+ }
63
+ }
64
+ }
65
+ `,ProductsWithSellingPlansDocument=`
66
+ query ProductsWithSellingPlans($first: Int, $where: ProductWhereInput, $firstMedia: Int, $orderBy: ProductOrder, $after: Cursor, $firstVariant: Int, $afterVariant: Cursor, $afterMedia: Cursor, $orderByMedia: MediaOrder) {
67
+ products(first: $first, where: $where, orderBy: $orderBy, after: $after) {
68
+ edges {
69
+ ...ProductWithSellingPlansSelectFragment
70
+ }
71
+ pageInfo {
72
+ endCursor
73
+ hasNextPage
74
+ }
75
+ }
76
+ }
77
+ ${ProductWithSellingPlansSelectFragment}
78
+ ${e}
79
+ ${r}
80
+ ${t}
81
+ ${a}
82
+ ${n}`;export{ProductWithSellingPlansSelectFragment,ProductsWithSellingPlansDocument};
@@ -4,6 +4,12 @@ import{ProductSelect as e}from"../fragments/product.generated.js";import{Product
4
4
  node {
5
5
  ...ProductSelect
6
6
  tags
7
+ sellingPlanGroups {
8
+ appID
9
+ baseID
10
+ id
11
+ name
12
+ }
7
13
  collections {
8
14
  edges {
9
15
  node {
@@ -1,4 +1,4 @@
1
- import{PublishedThemePageSelect as e}from"../fragments/published-theme-page.generated.js";import{PublishedCustomSectionSelect as s}from"../fragments/published-custom-section.generated.js";import{PublishedPageSectionSelect as t}from"../fragments/published-page-section.generated.js";import{PublishedThemeStyleSelect as m}from"../fragments/published-theme-style.generated.js";import{CustomFontSelect as g}from"../fragments/custom-font.generated.js";let PublishedThemePagesDocument=`
1
+ import{PublishedThemePageSelect as e}from"../fragments/published-theme-page.generated.js";import{PublishedPageSectionSelect as s}from"../fragments/published-page-section.generated.js";import{PublishedCustomSectionSelect as t}from"../fragments/published-custom-section.generated.js";import{DataSeoSelect as m}from"../fragments/data-seo.generated.js";import{PublishedThemeStyleSelect as r}from"../fragments/published-theme-style.generated.js";import{AnalyticSelect as g}from"../fragments/analytic.generated.js";import{CustomCodeSelect as a}from"../fragments/custom-code.generated.js";import{CustomFontSelect as o}from"../fragments/custom-font.generated.js";let PublishedThemePagesDocument=`
2
2
  query publishedThemePages($slug: String, $slugType: PublishedThemePageType!) {
3
3
  publishedThemePages(slug: $slug, slugType: $slugType) {
4
4
  ...PublishedThemePageSelect
@@ -8,4 +8,7 @@ import{PublishedThemePageSelect as e}from"../fragments/published-theme-page.gene
8
8
  ${s}
9
9
  ${t}
10
10
  ${m}
11
- ${g}`;export{PublishedThemePagesDocument};
11
+ ${r}
12
+ ${g}
13
+ ${a}
14
+ ${o}`;export{PublishedThemePagesDocument};
@@ -0,0 +1,30 @@
1
+ let ThemePageMetaDocument=`
2
+ query themePageMeta($after: Cursor, $before: Cursor, $first: Int, $last: Int, $themePageID: ID!, $where: ThemePageMetaWhereInput) {
3
+ themePageMeta(
4
+ after: $after
5
+ before: $before
6
+ first: $first
7
+ last: $last
8
+ themePageID: $themePageID
9
+ where: $where
10
+ ) {
11
+ edges {
12
+ cursor
13
+ node {
14
+ createdAt
15
+ id
16
+ key
17
+ updatedAt
18
+ value
19
+ }
20
+ }
21
+ pageInfo {
22
+ endCursor
23
+ hasNextPage
24
+ hasPreviousPage
25
+ startCursor
26
+ }
27
+ totalCount
28
+ }
29
+ }
30
+ `;export{ThemePageMetaDocument};
@@ -1 +1 @@
1
- import{devicesMapping as e}from"./constant.js";import{isColor as t,getSingleColorVariable as g}from"./colors.js";import{makeStyleResponsive as o}from"./make-style.js";import{getResponsiveValueByScreen as i}from"./get-resonsive-value.js";import{DEVICES as r}from"../constants/device.js";let isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return o("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?t(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return o("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,l=e?.[t]?.image?.src,a=i,B=l?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(i&&B&&B!=i&&(a=B),"FILE_CONTENT"===r&&g?.liquid&&a&&(l=`{{ "${a.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&a&&(l=`{{ "${a}" | asset_url }}`),"string"==typeof l&&l)?`url(${l})`:void 0!==l?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return o("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return o("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return o("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return o("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${g(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(t,g)=>{let o=e[t]??"";return"fixed"===g?{wrapper:{[`--pos${o}`]:"absolute",[`--top${o}`]:"0",[`--left${o}`]:"0",[`--w${o}`]:"100%",[`--h${o}`]:"100%"},content:{[`--pos${o}`]:"fixed",[`--w${o}`]:"100vw",[`--h${o}`]:"100vh",[`--bga${o}`]:"unset"}}:{wrapper:{[`--pos${o}`]:"absolute"},content:{[`--w${o}`]:"100%",[`--h${o}`]:"100%",[`--pos${o}`]:"absolute",[`--bga${o}`]:g}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url('${g?.src}'), ${t}`:o?`url('${g?.src}')`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return r.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return r.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:i(g,"desktop"),tablet:i(g,"tablet"),mobile:i(g,"mobile")},l={};return r.forEach(e=>{let r=i(t,e),a=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(l,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),a&&"none"!==a&&Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:a})}),{...l,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment};
1
+ import{devicesMapping as e}from"./constant.js";import{isColor as t,getSingleColorVariable as g}from"./colors.js";import{makeStyleResponsive as o}from"./make-style.js";import{getResponsiveValueByScreen as i}from"./get-resonsive-value.js";import{DEVICES as r}from"../constants/device.js";import{hasTranslatedLiquid as l}from"./liquid.js";let isEmptyBg=e=>e?.videoHtml5===void 0&&e?.video===void 0&&!e?.videoType,getBgVideoByDevice=(e,t="desktop")=>{let g=e?.[t];if(isEmptyBg(g)&&"desktop"!==t){let t=e?.tablet;g=isEmptyBg(t)?e?.desktop:t}return g},getStyleBackgroundByDevice=(e,t)=>e?{...t?.ignoreBackgroundColor?{}:{...getStyleBgColor(e)},...t?.ignoreBackgroundImage?{}:{...getStyleBgImage(e,t)},...t?.ignoreBackgroundImageProperties?{}:{...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e)},...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return o("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?t(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let g={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return o("bgi",g)},getBgImageByDevice=(e,t,g)=>{let o=e?.[t]?.type==="video";if(o)return;if(e?.[t]?.type==="color")return"url()";let i=e?.[t]?.image?.backupFileKey,r=e?.[t]?.image?.storage,a=e?.[t]?.image?.src,B=l(a)?"":i,c=a?.match(/\/files\/([^\/]+\.(jpg|jpeg|gif|png|webp|svg))/)?.[1];return(B&&c&&c!=i&&(B=c),"FILE_CONTENT"===r&&g?.liquid&&B&&(a=`{{ "${B.replace(".jpeg",".jpg")}" | file_url }}`),("THEME"===r||!r)&&g?.liquid&&B&&(a=`{{ "${B}" | asset_url }}`),"string"==typeof a&&a)?`url(${a})`:void 0!==a?"none":void 0},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return o("bgp",t)},getBgPositionByDevice=(e,t)=>{let g=e?.[t]?.position;return g&&`${g.x}% ${g.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return o("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return o("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return o("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${g(e)};`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},g={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...g.desktop?.wrapper,...g.tablet?.wrapper,...g.mobile?.wrapper},content:{...g.desktop?.content,...g.tablet?.content,...g.mobile?.content}}},makeFixedBgAttachmentByDevice=(t,g)=>{let o=e[t]??"";return"fixed"===g?{wrapper:{[`--pos${o}`]:"absolute",[`--top${o}`]:"0",[`--left${o}`]:"0",[`--w${o}`]:"100%",[`--h${o}`]:"100%"},content:{[`--pos${o}`]:"fixed",[`--w${o}`]:"100vw",[`--h${o}`]:"100vh",[`--bga${o}`]:"unset"}}:{wrapper:{[`--pos${o}`]:"absolute"},content:{[`--w${o}`]:"100%",[`--h${o}`]:"100%",[`--pos${o}`]:"absolute",[`--bga${o}`]:g}}},getGradientBgrStyleForButton=e=>{if(!e)return;let t={};for(let g of Object.keys(e)){let o=e[g];if(!o?.startsWith(GRADIENT_BGR_KEY))continue;let i="normal"===g?"--bgi":"--hvr-bgi";t[i]=o}return t},GRADIENT_BGR_KEY="linear-gradient",getCombinedBackgroundImage=e=>{if(!e)return;let{color:t,image:g}=e,o=g?.src&&g?.src?.trim()!=="",i=t?.includes(GRADIENT_BGR_KEY);return o&&i?`url('${g?.src}'), ${t}`:o?`url('${g?.src}')`:i?t:void 0},getGradientImageBgrStyleByDevice=e=>{if(!e)return;let t={};return r.forEach(g=>{let o=e[g];if(!o)return;let i="desktop"!==g?`-${g}`:"";o.color&&Object.assign(t,{[`--bgc${i}`]:o.color});let r=getCombinedBackgroundImage(o);r&&Object.assign(t,{[`--bgi${i}`]:r})}),t},getGradientBgrStyleByDevice=(e,t)=>{if(!e)return;let g={};return r.forEach(o=>{if(e[o]?.color?.includes(GRADIENT_BGR_KEY)){let i=`${getBgImageByDevice(e,o)||"url()"}, ${e[o]?.color}`;Object.assign(g,{[`--bgc${"desktop"!==o?"-"+o:""}`]:e[o]?.color,[`--bgi${"desktop"!==o?"-"+o:""}`]:t?.[o]?i:`${e[o]?.color}`})}}),g},getBgByDevice=e=>{let{backgroundColor:t,backgroundImage:g}=e;if(!t&&!g)return;let o={desktop:i(g,"desktop"),tablet:i(g,"tablet"),mobile:i(g,"mobile")},l={};return r.forEach(e=>{let r=i(t,e),a=g?getBgImageByDevice(o,e):void 0;r?.includes(GRADIENT_BGR_KEY)?Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:r}):Object.assign(l,{[`--bgc${"desktop"!==e?"-"+e:""}`]:r,[`--bgi${"desktop"!==e?"-"+e:""}`]:"none"}),a&&"none"!==a&&Object.assign(l,{[`--bgi${"desktop"!==e?"-"+e:""}`]:a})}),{...l,...getStyleBgPosition(g),...getStyleBgSize(g),...getStyleBgRepeat(g),...getStyleBgAttachment(g)}};export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useRef as t,useMemo as e,useCallback as i}from"react";import"react/jsx-runtime";import"zustand";import{usePageStore as n}from"../../contexts/PageContext.js";import"react-transition-group";import"@gem-sdk/core";import"swr";import"swr/infinite";import"classnames";import"dayjs";import"../convert.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../hooks/useStickyStore.js";import"../../types/builder.js";import"../../types/custom.js";import"../../types/animations.js";let useInteraction=()=>{let r=t(),o=n(t=>t.setInteractionIsSelectOnPage),a=n(t=>t.sidebarMode),s=n(t=>t.interactionData?.selectType),c=n(t=>t.interactionData);function l(t,e){return!(t instanceof Document)&&t?.matches(e)?t:t?.querySelector(e)}let d=(t,e,i)=>{let n=t=>{let e=t.detail;i&&i(e)};return t.addEventListener(e,n),()=>t.removeEventListener(e,n)},m=({event:t,selector:e,elementRef:i},n)=>{let o=l(i?.current||r.current||document,e);if(o)return d(o,t,n)},p=({event:t,data:e,selector:i,element:n})=>{let r=n||document.body?.querySelector(i);if(!r)return;let o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:{data:e}});r.dispatchEvent(o)},u=(t,e,i)=>{if(!t)return;let n=t.getAttribute("gp-data-interaction"),r=JSON.parse(n||"{}");t.setAttribute("gp-data-interaction",JSON.stringify({...r,[e]:i}))},b=(t,e)=>{let i=t.getAttribute("gp-data-interaction"),n=JSON.parse(i||"{}");return{previousData:n[e],interactionDataJson:n}},g=()=>{o(!1);let t=new CustomEvent("editor:interaction:change-select-on-page",{bubbles:!0,detail:!1});window.dispatchEvent(t)},w=t=>{let e=new CustomEvent("editor:interaction:change-select-mode",{bubbles:!0,detail:t});window.dispatchEvent(e)},v=({componentUid:t,settingType:e,$target:i})=>{let n=new CustomEvent("editor:interaction:select-element",{bubbles:!0,detail:{componentUid:t,settingType:e,$target:i}});window.dispatchEvent(n)},f=e(()=>"interaction"===a&&(!c?.isSelectOnPage||"PAGE"===s),[a,c?.isSelectOnPage,s]),y=e(()=>c?.isSelectOnPage,[c?.isSelectOnPage]),E=i(t=>{if(window.interactionLoaded){t();return}window.addEventListener("gp:flow-actions-loaded",()=>{t()})},[]);return{onListener:m,trigger:p,saveToElementInteractionData:u,closeSelectOnPage:g,ref:r,findElementIncludingSelf:l,getInteractionPreviousData:b,changeSelectMode:w,selectInteractionElement:v,isInteractionMode:f,isSelectOnPage:y,interactionListenerLoaded:E}};export{useInteraction};
2
+ import{useRef as t,useMemo as e,useCallback as i}from"react";import"react/jsx-runtime";import"zustand";import{usePageStore as n}from"../../contexts/PageContext.js";import"react-transition-group";import"swr";import"swr/infinite";import"classnames";import"dayjs";import"@gem-sdk/core";import"../convert.js";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../hooks/useStickyStore.js";import"../../types/builder.js";import"../../types/custom.js";import"../../types/animations.js";let useInteraction=()=>{let r=t(),o=n(t=>t.setInteractionIsSelectOnPage),a=n(t=>t.sidebarMode),s=n(t=>t.interactionData?.selectType),c=n(t=>t.interactionData);function l(t,e){return!(t instanceof Document)&&t?.matches(e)?t:t?.querySelector(e)}let d=(t,e,i)=>{let n=t=>{let e=t.detail;i&&i(e)};return t.addEventListener(e,n),()=>t.removeEventListener(e,n)},m=({event:t,selector:e,elementRef:i},n)=>{let o=l(i?.current||r.current||document,e);if(o)return d(o,t,n)},p=({event:t,data:e,selector:i,element:n})=>{let r=n||document.body?.querySelector(i);if(!r)return;let o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:{data:e}});r.dispatchEvent(o)},u=(t,e,i)=>{if(!t)return;let n=t.getAttribute("gp-data-interaction"),r=JSON.parse(n||"{}");t.setAttribute("gp-data-interaction",JSON.stringify({...r,[e]:i}))},b=(t,e)=>{let i=t.getAttribute("gp-data-interaction"),n=JSON.parse(i||"{}");return{previousData:n[e],interactionDataJson:n}},g=()=>{o(!1);let t=new CustomEvent("editor:interaction:change-select-on-page",{bubbles:!0,detail:!1});window.dispatchEvent(t)},w=t=>{let e=new CustomEvent("editor:interaction:change-select-mode",{bubbles:!0,detail:t});window.dispatchEvent(e)},v=({componentUid:t,settingType:e,$target:i})=>{let n=new CustomEvent("editor:interaction:select-element",{bubbles:!0,detail:{componentUid:t,settingType:e,$target:i}});window.dispatchEvent(n)},f=e(()=>"interaction"===a&&(!c?.isSelectOnPage||"PAGE"===s),[a,c?.isSelectOnPage,s]),y=e(()=>c?.isSelectOnPage,[c?.isSelectOnPage]),E=i(t=>{if(window.interactionLoaded){t();return}window.addEventListener("gp:flow-actions-loaded",()=>{t()})},[]);return{onListener:m,trigger:p,saveToElementInteractionData:u,closeSelectOnPage:g,ref:r,findElementIncludingSelf:l,getInteractionPreviousData:b,changeSelectMode:w,selectInteractionElement:v,isInteractionMode:f,isSelectOnPage:y,interactionListenerLoaded:E}};export{useInteraction};
@@ -0,0 +1 @@
1
+ let hasTranslatedLiquid=s=>!!(s&&s.includes("{{ section.settings."));export{hasTranslatedLiquid};
@@ -1 +1 @@
1
- import{getResponsiveValueByScreen as e}from"./get-resonsive-value.js";let removeNullUndefined=e=>Object.entries(e).reduce((e,[t,o])=>null==o?e:{...e,[t]:o},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,o)=>({[`--${e}`]:o?`${t?.desktop}${o}`:t?.desktop,[`--${e}-tablet`]:o?`${t?.tablet}${o}`:t?.tablet,[`--${e}-mobile`]:o?`${t?.mobile}${o}`:t?.mobile}),makeStyleResponsiveByScreen=(t,o,l)=>({[`--${t}`]:l?`${e(o,"desktop")}${l}`:e(o,"desktop"),[`--${t}-tablet`]:l?`${e(o,"tablet")}${l}`:e(o,"tablet"),[`--${t}-mobile`]:l?`${e(o,"mobile")}${l}`:e(o,"mobile")}),makeWidth=(t,o)=>{let l=(t,o,l)=>{let i=e(o,t),a=l?.[t]===void 0?l?.desktop:l?.[t];return a?"100%":!1===a?i??i:i||"auto"};return{desktop:l("desktop",t,o),tablet:l("tablet",t,o),mobile:l("mobile",t,o)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let o=(e,t,o)=>{let l=t?.[e],i=o?.[e];return i?"auto":!1===i?l??l:l};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeAspectRatio=(t,o,l)=>{let i={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let s=e(t,a);"none"!==s&&(i={...i,[a]:"custom"!==s?s:`${e(o,"desktop")}/${e(l,"desktop")}`})}),i},makeLineClamp=(t,o)=>{let l=(t,o,l)=>{let i=e(o,t),a=e(l,t);return 0===i?"0":a||void 0===a?i:"unset"};return{desktop:l("desktop",t,o),tablet:l("tablet",t,o),mobile:l("mobile",t,o)}},getResponsiveWidthValue=(e,t,o)=>o?`${t?.[e]}${o}`:t?.[e]==="default"?"1200px":t?.[e],makeStyleResponsiveWidth=(e,t)=>({"--w":getResponsiveWidthValue("desktop",e,t),"--w-tablet":getResponsiveWidthValue("tablet",e,t),"--w-mobile":getResponsiveWidthValue("mobile",e,t)}),getResponsiveWidthValueWithoutAuto=(e,t,o)=>{if(o)return`${t?.[e]}${o}`;switch(t?.[e]){case"default":return"1200px";case"Auto":return"100%";default:return t?.[e]}},makeStyleResponsiveWidthWithoutAuto=(e,t)=>({"--w":getResponsiveWidthValueWithoutAuto("desktop",e,t),"--w-tablet":getResponsiveWidthValueWithoutAuto("tablet",e,t),"--w-mobile":getResponsiveWidthValueWithoutAuto("mobile",e,t)});export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveByScreen,makeStyleResponsiveState,makeStyleResponsiveWidth,makeStyleResponsiveWidthWithoutAuto,makeStyleState,makeWidth,removeNullUndefined};
1
+ import{getResponsiveValueByScreen as e}from"./get-resonsive-value.js";let removeNullUndefined=e=>Object.entries(e).reduce((e,[t,o])=>null==o?e:{...e,[t]:o},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,o)=>{let l=o?`${t?.desktop}${o}`:t?.desktop,i=o?`${t?.tablet}${o}`:t?.tablet,a=o?`${t?.mobile}${o}`:t?.mobile,s={};return l&&(s[`--${e}`]=l),i&&i!==l&&(s[`--${e}-tablet`]=i),a&&a!==i&&(s[`--${e}-mobile`]=a),s},makeWidth=(t,o)=>{let l=(t,o,l)=>{let i=e(o,t),a=l?.[t]===void 0?l?.desktop:l?.[t];return a?"100%":!1===a?i??i:i||"auto"},i=l("desktop",t,o),a=l("tablet",t,o),s=l("mobile",t,o),m={};return i&&(m.desktop=i),a&&a!==i&&(m.tablet=a),s&&s!==a&&(m.mobile=s),m},makeGlobalSizeWidthResponsive=e=>{let t=e?.desktop?.width,o=e?.tablet?.width,l=e?.mobile?.width,i={};return t&&(i["--w"]=t),o&&o!==t&&(i["--w-tablet"]=o),l&&l!==o&&(i["--w-mobile"]=l),i},makeGlobalSizeHeightResponsive=e=>{let t=e?.desktop?.height,o=e?.tablet?.height,l=e?.mobile?.height,i={};return t&&(i["--h"]=t),o&&o!==t&&(i["--h-tablet"]=o),l&&l!==o&&(i["--h-mobile"]=l),i},makeHeight=(e,t)=>{let o=(e,t,o)=>{let l=t?.[e],i=o?.[e];return i?"auto":!1===i?l??l:l},l=o("desktop",e,t),i=o("tablet",e,t),a=o("mobile",e,t),s={};return l&&(s.desktop=l),i&&i!==l&&(s.tablet=i),a&&a!==i&&(s.mobile=a),s},makeAspectRatio=(t,o,l)=>{let i={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let s=e(t,a);"none"!==s&&(i={...i,[a]:"custom"!==s?s:`${e(o,"desktop")}/${e(l,"desktop")}`})}),i},makeLineClamp=(t,o)=>{let l=(t,o,l)=>{let i=e(o,t),a=e(l,t);return 0===i?"0":a||void 0===a?i:"unset"},i=l("desktop",t,o),a=l("tablet",t,o),s=l("mobile",t,o),m={};return i&&(m.desktop=i),a&&a!==i&&(m.tablet=a),s&&s!==a&&(m.mobile=s),m},getResponsiveWidthValue=(e,t,o)=>o?`${t?.[e]}${o}`:t?.[e]==="default"?"1200px":t?.[e],makeStyleResponsiveWidth=(e,t)=>{let o=getResponsiveWidthValue("desktop",e,t),l=getResponsiveWidthValue("tablet",e,t),i=getResponsiveWidthValue("mobile",e,t),a={};return o&&(a["--w"]=o),l&&l!==o&&(a["--w-tablet"]=l),i&&i!==l&&(a["--w-mobile"]=i),a},getResponsiveWidthValueWithoutAuto=(e,t,o)=>{if(o)return`${t?.[e]}${o}`;switch(t?.[e]){case"default":return"1200px";case"Auto":return"100%";default:return t?.[e]}},makeStyleResponsiveWidthWithoutAuto=(e,t)=>{let o=getResponsiveWidthValueWithoutAuto("desktop",e,t),l=getResponsiveWidthValueWithoutAuto("tablet",e,t),i=getResponsiveWidthValueWithoutAuto("mobile",e,t),a={};return o&&(a["--w"]=o),l&&l!==o&&(a["--w-tablet"]=l),i&&i!==l&&(a["--w-mobile"]=i),a};export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveState,makeStyleResponsiveWidth,makeStyleResponsiveWidthWithoutAuto,makeStyleState,makeWidth,removeNullUndefined};
@@ -1 +1 @@
1
- import{ProductsDocument as e}from"../../graphql/queries/products.generated.js";import{calculateFirstProduct as t}from"./get-collection.js";import{fetchVariants as r,fetchMedias as d}from"./get-product.js";let getProducts=async(e,{ids:t,isSample:r,isStorefront:d,defaultSelectedProductCount:s,allStatus:o})=>{let a=await loopFetchProducts(e,{ids:t,isSample:r,isStorefront:d,defaultSelectedProductCount:s,allStatus:o});if(!a)throw Error("Product not found");let[i,c]=await Promise.all([mergeVariantsToProducts({fetcher:e,products:a,isSample:r,isStorefront:d}),mergeMediasToProducts({fetcher:e,products:a,isSample:r,isStorefront:d})]);return{...a,products:{...a.products,edges:a.products?.edges.map(e=>{let t=c.find(t=>t.productId===e.node?.baseID),r=i.find(t=>t.productId===e.node?.baseID);return e.node?{...e,node:{...e.node,variants:{...e.node?.variants,edges:r?.items??[]},medias:{...e.node?.medias,edges:t?.items??[]}}}:e})??[]}}},getProductQueryAll=async(e,t)=>{let r=t?.limit||4;delete t.limit;let d={first:r,firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{status:"ACTIVE",...t}},s=await fetchProducts(e,d);return s},getListProductByVariables=async(e,t)=>{let r={first:t.first||8,firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{status:"ACTIVE",...t.where},after:t.after},d=await fetchProducts(e,r);return d},fetchProducts=async(t,r)=>t([e,r]),loopFetchProducts=async(e,{ids:r,isSample:d,isStorefront:s,defaultSelectedProductCount:o,allStatus:a})=>{let i,c,n,u,l;let f=o||4,g=(r?.length==0?f:r?.length)??f,p=1,P=Math.ceil(g/8);for(;p<=P&&!1!==u;){let o=a?{}:{status:"ACTIVE"};i={first:t(g,p,8),firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{...o,isSample:d,...s&&{isStorefront:s},...r?.length?{baseIDIn:r}:{}},after:c};let f=await fetchProducts(e,i);if(c=f?.products?.pageInfo?.endCursor,1===p?(n=f,l=f):l?.products&&f?.products?.edges.length&&(l.products={edges:l.products.edges.concat(f?.products?.edges),pageInfo:f?.products?.pageInfo}),p++,!l){u=!1;break}}return n},mergeVariantsToProducts=async({fetcher:e,products:t,isSample:d,isStorefront:s})=>{let o=await Promise.all(t?.products?.edges?.map(async t=>{let o=await r(e,{id:t?.node?.baseID,isSample:d,isStorefront:s});return{productId:t?.node?.baseID,items:o}})??[]);return o},mergeMediasToProducts=async({fetcher:e,products:t,isSample:r,isStorefront:s})=>{let o=await Promise.all(t?.products?.edges?.map(async t=>{let o=await d(e,{id:t?.node?.baseID,isSample:r,isStorefront:s});return{productId:t?.node?.baseID,items:o}})??[]);return o};export{getListProductByVariables,getProductQueryAll,getProducts};
1
+ import{ProductsDocument as e}from"../../graphql/queries/products.generated.js";import{calculateFirstProduct as t}from"./get-collection.js";import{fetchVariants as r,fetchMedias as d}from"./get-product.js";let getProducts=async(e,{ids:t,isSample:r,isStorefront:d,defaultSelectedProductCount:s,allStatus:o})=>{let a=await loopFetchProducts(e,{ids:t,isSample:r,isStorefront:d,defaultSelectedProductCount:s,allStatus:o});if(!a)throw Error("Product not found");let[i,c]=await Promise.all([mergeVariantsToProducts({fetcher:e,products:a,isSample:r,isStorefront:d}),mergeMediasToProducts({fetcher:e,products:a,isSample:r,isStorefront:d})]);return{...a,products:{...a.products,edges:a.products?.edges.map(e=>{let t=c.find(t=>t.productId===e.node?.baseID),r=i.find(t=>t.productId===e.node?.baseID);return e.node?{...e,node:{...e.node,variants:{...e.node?.variants,edges:r?.items??[]},medias:{...e.node?.medias,edges:t?.items??[]}}}:e})??[]}}},getProductQueryAll=async(e,t)=>{let r={first:t.first||4,firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{status:"ACTIVE",...t}},d=await fetchProducts(e,r);return d},getListProductByVariables=async(e,t)=>{let r={first:t.first||8,firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{status:"ACTIVE",...t.where},after:t.after},d=await fetchProducts(e,r);return d},fetchProducts=async(t,r)=>t([e,r]),loopFetchProducts=async(e,{ids:r,isSample:d,isStorefront:s,defaultSelectedProductCount:o,allStatus:a})=>{let i,c,n,u,l;let f=o||4,g=(r?.length==0?f:r?.length)??f,p=1,P=Math.ceil(g/8);for(;p<=P&&!1!==u;){let o=a?{}:{status:"ACTIVE"};i={first:t(g,p,8),firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{...o,isSample:d,...s&&{isStorefront:s},...r?.length?{baseIDIn:r}:{}},after:c};let f=await fetchProducts(e,i);if(c=f?.products?.pageInfo?.endCursor,1===p?(n=f,l=f):l?.products&&f?.products?.edges.length&&(l.products={edges:l.products.edges.concat(f?.products?.edges),pageInfo:f?.products?.pageInfo}),p++,!l){u=!1;break}}return n},mergeVariantsToProducts=async({fetcher:e,products:t,isSample:d,isStorefront:s})=>{let o=await Promise.all(t?.products?.edges?.map(async t=>{let o=await r(e,{id:t?.node?.baseID,isSample:d,isStorefront:s});return{productId:t?.node?.baseID,items:o}})??[]);return o},mergeMediasToProducts=async({fetcher:e,products:t,isSample:r,isStorefront:s})=>{let o=await Promise.all(t?.products?.edges?.map(async t=>{let o=await d(e,{id:t?.node?.baseID,isSample:r,isStorefront:s});return{productId:t?.node?.baseID,items:o}})??[]);return o};export{getListProductByVariables,getProductQueryAll,getProducts};
@@ -0,0 +1 @@
1
+ import{ProductVariantsWithSellingPlansDocument as e}from"../../graphql/queries/product-variant-with-selling-plans.generated.js";import{ProductsWithSellingPlansDocument as t}from"../../graphql/queries/products-with-selling-plans.generated.js";import{calculateFirstProduct as r}from"./get-collection.js";import{fetchMedias as a}from"./get-product.js";let getProductOffers=async(e,{ids:t,isSample:r,isStorefront:a,defaultSelectedProductCount:s,allStatus:o})=>{let d=await loopFetchProducts(e,{ids:t,isSample:r,isStorefront:a,defaultSelectedProductCount:s,allStatus:o});if(!d)throw Error("Product not found");let[n,i]=await Promise.all([getVariantsOfProducts({fetcher:e,products:d,isSample:r,isStorefront:a}),getMediasOfProduct({fetcher:e,products:d,isSample:r,isStorefront:a})]);return{...d,products:{...d.products,edges:d.products?.edges.map(e=>{let t=i.find(t=>t.productId===e.node?.baseID),r=n.find(t=>t.productId===e.node?.baseID);return e.node?{...e,node:{...e.node,variants:{...e.node?.variants,edges:r?.items??[]},medias:{...e.node?.medias,edges:t?.items??[]}}}:e})??[]}}},loopFetchProducts=async(e,{ids:a,isSample:s,isStorefront:o,defaultSelectedProductCount:d,allStatus:n})=>{let i,c,u,l,p;let g=d||4,f=(a?.length==0?g:a?.length)??g,I=1,m=Math.ceil(f/8);for(;I<=m&&!1!==l;){let d=n?{}:{status:"ACTIVE"};i={first:r(f,I,8),firstMedia:1,firstVariant:1,orderBy:{field:"PLATFORM_CREATED_AT",direction:"DESC"},orderByMedia:{field:"POSITION",direction:"ASC"},where:{...d,isSample:s,...o&&{isStorefront:o},...a?.length?{baseIDIn:a}:{}},after:c};let g=await e([t,i]);if(c=g?.products?.pageInfo?.endCursor,1===I?(u=g,p=g):p?.products&&g?.products?.edges.length&&(p.products={edges:p.products.edges.concat(g?.products?.edges),pageInfo:g?.products?.pageInfo}),I++,!p){l=!1;break}}return u},getVariantsOfProducts=async({fetcher:e,products:t,isSample:r,isStorefront:a})=>{let s=await Promise.all(t?.products?.edges?.map(async t=>{let s=await fetchVariants(e,{id:t?.node?.baseID,isSample:r,isStorefront:a});return{productId:t?.node?.baseID,items:s}})??[]);return s},getMediasOfProduct=async({fetcher:e,products:t,isSample:r,isStorefront:s})=>{let o=await Promise.all(t?.products?.edges?.map(async t=>{let o=await a(e,{id:t?.node?.baseID,isSample:r,isStorefront:s});return{productId:t?.node?.baseID,items:o}})??[]);return o},fetchVariants=async(t,{id:r,isSample:a,isStorefront:s})=>{let o={field:"CREATED_AT",direction:"DESC"},d={orderBy:o,where:{isSample:a,...s&&{isStorefront:s},...(!r||r&&"latest"==r.toLowerCase())&&{status:"ACTIVE"},...r&&"latest"!==r.toLowerCase()&&{baseID:r}},orderByVariant:{field:"POSITION",direction:"ASC"}},n=async(r,a)=>{try{let s=await t([e,r]),o=s.variants?.edges?.[0],d=a?.concat(o?.node?.variants?.edges??[]);if(o?.node?.variants?.pageInfo?.hasNextPage)return n({...r,afterVariant:o?.node?.variants?.pageInfo.endCursor},d);return d??[]}catch{return a??[]}};return n(d,[])};export{getProductOffers};
@@ -1,2 +1 @@
1
- 'use client';
2
1
  let EASING={ease:"cubic-bezier(0.46,0.03,0.52,0.96)","ease-in":"cubic-bezier(0.55,0.08,0.68,0.53)","ease-out":"cubic-bezier(0.46,0.03,0.52,0.96)",linear:"linear"},animations=()=>{let t=t=>{let e=JSON.parse(JSON.stringify(t)),r=["delay","speed","scale","intensity"];return r.forEach(t=>{if(!e?.[t])return;if("scale"===t){if(!e?.zoomDirection)throw TypeError("zoomDirection not found on zoom preset");let[r,a]=e?.scale?.in??[1,1],[n,o]=e?.scale?.out??[1,1];e[t]={in:[Number(r)/100,Number(a)/100],out:[Number(n)/100,Number(o)/100]};return}let r=Number(e?.[t]);if("delay"===t?e[t]=1e3*r:e[t]=r,!isFinite(r))throw TypeError(`${t} must be a number`)}),e},e=(e,r)=>{let n=t(r),{direction:l,distance:s}=n,p=["left","right"].includes(l??"")?"X":"Y",u=["left","down"].includes(l??"")?"-":"",f=o(e),y=[{display:f,opacity:0,transform:`translate${p}(${u}${s??50}%)`},{display:f,opacity:i(e),transform:`translate${p}(0)`}];return c(e,y,{...a(n,500),fill:"forwards"})},r=(e,r)=>{let n=t(r),o=[{opacity:0},{opacity:i(e)}];return c(e,o,{...a(n,500)})},a=(t,e)=>{let r=t=>t?1.5/t*1e3:e,{loop:a,delay:n,speed:o,easing:i}=t??{},l=r(o),s=n??0,c=a?l+s:l;return{iterations:a?1/0:1,duration:c,delay:s,easing:EASING[i??"linear"]}},n=(e,r)=>{let n=t(r),{scale:l,zoomDirection:s,isFade:p}=n,[u,f]=l.in,[y,m]=l.out,d=o(e),b=i(e),$=[{display:d,transform:`scale(${u}, ${u})`,opacity:p?0:1},{display:d,transform:`scale(${f??1.2}, ${f??1.2})`,opacity:b}],w=[{display:d,transform:`scale(${y}, ${y})`,opacity:p?0:1},{display:d,transform:`scale(${m??.8}, ${m??.8})`,opacity:b}],x="in"===s?$:w;return c(e,x,{...a(n,700),fill:"forwards"})},o=t=>{let e="inline"===window.getComputedStyle(t,null).getPropertyValue("display");return e?"block":void 0},i=t=>window.getComputedStyle(t,null).getPropertyValue("opacity"),l=(t,e,r)=>{if(!e)return t;let a=e/r,n=[...t].pop();return[...t,{...n,offset:1-a}]},s=(e,r)=>{let n=t(r),{intensity:l}=n??{},s=o(e),p=i(e),u=[{transform:"translate3d(0, 0, 0)",opacity:p,display:s}],f=[{transform:"translate3d(4px, 0, 0)",opacity:p,display:s},{transform:"translate3d(-4px, 0, 0)",opacity:p,display:s},{transform:"translate3d(4px, 0, 0)",opacity:p,display:s}],y=[];Array.from(Array(l??1).keys()).forEach(()=>{y=[...y,...f]});let m=[{transform:"translate3d(-1px, 0, 0)",opacity:p,display:s},{transform:"translate3d(2px, 0, 0)",opacity:p,display:s},{transform:"translate3d(-4px, 0, 0)",opacity:p,display:s},...y,{transform:"translate3d(-4px, 0, 0)",opacity:p,display:s},{transform:"translate3d(2px, 0, 0)",opacity:p,display:s},{transform:"translate3d(-1px, 0, 0)",opacity:p,display:s}];return c(e,l?m:u,{...a(n??{},820)})},c=(t,e,r)=>{let a=new KeyframeEffect(t,r.iterations&&1===r.iterations?e:l(e,r?.delay??0,r?.duration??0),{...r});return new Animation(a,document.timeline)};return{zoom:n,shake:s,fade:r,slide:e}};export{animations};
@@ -1,2 +1 @@
1
- 'use client';
2
1
  import e from"swr";import r from"swr/infinite";import{getProducts as t,getProductQueryAll as u,getListProductByVariables as o}from"../../helpers/queries/get-products.js";import{generateProductsQueryKey as s}from"../../helpers/query.js";import{useIsSampleProduct as l,useIsStorefrontProduct as c}from"../shop.js";import{useFetchHandle as p}from"../useFetchHandle.js";import{useMemo as n}from"react";import{usePageStore as a}from"../../contexts/PageContext.js";import{hasPublicStoreFrontData as d,createStoreFrontFetcher as f}from"../../helpers/create-store-front-fetcher.js";let useProductsQuery=(r,u,o)=>{let m=p(),i=a(e=>e.publicStoreFrontData),y=n(()=>d(i)?f(i):m,[i]),P=l(),h=c();return e(r?s({ids:r,isSample:P,isStorefront:h,defaultSelectedProductCount:o?.defaultSelectedProductCount,allStatus:o?.allStatus}):null,async([,e])=>t(o?.fetcher||y,e),u)},getKey=e=>(r,t)=>e&&(!t||t.products?.pageInfo?.hasNextPage)?0===r?["query/products",e]:["query/products",{...e,after:t.products?.pageInfo?.endCursor}]:null,useListProductQuery=(e,t)=>{let u=p(),s=r(getKey(e),async([,e])=>o(u,e),t);return s},useProductsQueryAll=(r,t,o)=>{let s=p();return e(r?["query/products",r]:null,async([,e])=>u(o||s,e),t)};export{useListProductQuery,useProductsQuery,useProductsQueryAll};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import e from"swr";import{generateProductsQueryKey as r}from"../../helpers/query.js";import{useIsSampleProduct as t,useIsStorefrontProduct as o}from"../shop.js";import{useFetchHandle as s}from"../useFetchHandle.js";import{useMemo as u}from"react";import{usePageStore as f}from"../../contexts/PageContext.js";import{hasPublicStoreFrontData as l,createStoreFrontFetcher as m}from"../../helpers/create-store-front-fetcher.js";import{getProductOffers as c}from"../../helpers/queries/getProductOffers.js";let useProductOffersQuery=(p,a,d)=>{let i=s(),n=f(e=>e.publicStoreFrontData),h=u(()=>l(n)?m(n):i,[n]),j=t(),P=o();return e(p?r({ids:p,isSample:j,isStorefront:P,defaultSelectedProductCount:d?.defaultSelectedProductCount,allStatus:d?.allStatus}):null,async([,e])=>c(d?.fetcher||h,e),a)};export{useProductOffersQuery};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{animations as t}from"../helpers/animations.js";import"react";import"react/jsx-runtime";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import"./useStickyStore.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"@gem-sdk/core";import"classnames";import"dayjs";import"../helpers/convert.js";let useAnimations=()=>{let{zoom:r,shake:i,fade:o,slide:s}=t();return{zoom:r,shake:i,fade:o,slide:s}};export{useAnimations};
2
+ import{animations as t}from"../helpers/animations.js";import"react";import"react/jsx-runtime";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import"./useStickyStore.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"classnames";import"dayjs";import"@gem-sdk/core";import"../helpers/convert.js";let useAnimations=()=>{let{zoom:r,shake:i,fade:o,slide:s}=t();return{zoom:r,shake:i,fade:o,slide:s}};export{useAnimations};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useMoneyFormat as e}from"./shop.js";let shopifyPriceRounding=(e,a)=>parseFloat(`${e}`).toFixed(Number(a)),formatMoney=function(e,a){let o="",r=/\{\{\s*(\w+)\s*\}\}/,t="string"!=typeof a?a:a.replace(/<[^>]*>/g,""),n=t||"${{amount}}";function s(e,a){return void 0===e?a:e}function i(e,a,o,r){if(a=s(a,2),o=s(o,","),r=s(r,"."),isNaN(e)||null==e)return 0;e=shopifyPriceRounding(e,Number(a));let t=e.split("."),n=t[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+o),i=t[1]?r+t[1]:"";return n+i}let c=n.match(r);if(!c)return n;switch(c[1]){case"amount":o=i(e,2);break;case"amount_no_decimals":o=i(e,0);break;case"amount_with_comma_separator":o=i(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":o=i(e,0,".",",");break;case"amount_with_apostrophe_separator":o=i(e,2,"'",".");break;case"amount_no_decimals_with_space_separator":o=i(e,0," ");break;case"amount_with_space_separator":o=i(e,2," ",",");break;case"amount_with_period_and_space_separator":o=i(e,2," ",".")}return n.replace(r,o)},useFormatMoney=(a,o)=>{let{moneyFormat:r,moneyWithCurrencyFormat:t}=e();return o?formatMoney(`${a}`,t||r):formatMoney(`${a}`,r)};export{formatMoney,shopifyPriceRounding,useFormatMoney};
2
+ import{useMoneyFormat as e}from"./shop.js";let convertDecimalToNumber=(e,a=0)=>{if(null==e)return e;let r=parseFloat(String(e));return isNaN(r)?a:r},shopifyPriceRounding=(e,a)=>parseFloat(`${e}`).toFixed(Number(a)),formatMoney=function(e,a){let r="",t=/\{\{\s*(\w+)\s*\}\}/,o="string"!=typeof a?a:a.replace(/<[^>]*>/g,""),n=o||"${{amount}}";function s(e,a){return void 0===e?a:e}function i(e,a,r,t){if(a=s(a,2),r=s(r,","),t=s(t,"."),isNaN(e)||null==e)return 0;e=shopifyPriceRounding(e,Number(a));let o=e.split("."),n=o[0]?.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),i=o[1]?t+o[1]:"";return n+i}let c=n.match(t);if(!c)return n;switch(c[1]){case"amount":r=i(e,2);break;case"amount_no_decimals":r=i(e,0);break;case"amount_with_comma_separator":r=i(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":r=i(e,0,".",",");break;case"amount_with_apostrophe_separator":r=i(e,2,"'",".");break;case"amount_no_decimals_with_space_separator":r=i(e,0," ");break;case"amount_with_space_separator":r=i(e,2," ",",");break;case"amount_with_period_and_space_separator":r=i(e,2," ",".")}return n.replace(t,r)},useFormatMoney=(a,r)=>{let{moneyFormat:t,moneyWithCurrencyFormat:o}=e();return r?formatMoney(`${a}`,o||t):formatMoney(`${a}`,t)};export{convertDecimalToNumber,formatMoney,shopifyPriceRounding,useFormatMoney};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useState as e,useCallback as t,useEffect as n}from"react";let useI18n=()=>{let[r,a]=e(null),i=e=>{let t=e.detail;t&&a(t)},l=t(e=>r?r?.t(e):e,[r]);return n(()=>(window.addEventListener("editor:change-language",i),()=>{window.removeEventListener("editor:change-language",i)}),[]),{t:l}};export{useI18n};
2
+ let tGlobal;import{useState as e,useCallback as l,useEffect as t}from"react";let useI18n=()=>{let[a,n]=e(null),o=e=>{let l=e.detail;l&&(n(l),tGlobal=l.global.t)},r=l((e,l)=>a?.global?.t&&a.global.t(e,l)||e,[a]);return t(()=>(window.addEventListener("editor:change-language",o),()=>{window.removeEventListener("editor:change-language",o)}),[]),{t:r}};export{tGlobal,useI18n};
@@ -1,2 +1 @@
1
- 'use client';
2
- import e from"swr";import{ProductOptionNameDocument as t}from"../graphql/queries/product-value-label.generated.js";import{colorPreset as o}from"../components/src/product/helpers/variant-presets.js";import{useSwatches as a}from"./shop.js";import{useFetchHandle as r}from"./useFetchHandle.js";import{useShopStore as s}from"../contexts/ShopContext.js";import"react";import"react/jsx-runtime";import"zustand";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import"./useStickyStore.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"@gem-sdk/core";import"classnames";import"dayjs";import l from"../helpers/is-browser.js";import"../helpers/convert.js";let swatchChange=!1,colorChange=!1,useInitialSwatchesOptions=t=>{let o=r(),i=s(e=>e.changeSwatches),{swatches:p}=a(),{data:n}=e(["/query/productOptionName",{}],async()=>fetchProductValueLabel(o),{revalidateOnMount:!0}),c=[];if(p?.forEach(e=>{c.push(e.optionTitle)}),n?.productOptionName?.forEach(e=>{c.includes(e)||(swatchChange=!0,p?.push({optionTitle:e,optionType:"rectangle_list",optionValues:[]}))}),!t)return[];setDefaultSwatches(p,t),l()&&p?.length&&(swatchChange||colorChange)&&(window?.parent?.postMessage?.(JSON.stringify({type:"update-swatches",swatches:p}),"*"),i(p)),swatchChange=!1},getColorDefault=(e,t)=>{let a=e?o[e.toLocaleLowerCase()]:void 0,r=a?[a]:[],s=t?.[0];return!s&&r.length&&(colorChange=!0),s?[s]:r},getProductOptionsLabelByName=(e,t)=>{let o=[],a=e.find(e=>e.name===t);return a?.values.forEach(e=>{e.label&&!o.includes(e.label)&&o.push(e.label)}),o},getSwatchesOptionsLabel=e=>{let t=[];return e.forEach(e=>{e.label&&!t.includes(e.label)&&t.push(e.label)}),t},setDefaultSwatches=(e,t)=>(e&&e?.map(e=>{let o=getProductOptionsLabelByName(t,e.optionTitle),a=getSwatchesOptionsLabel(e.optionValues);o.forEach(t=>{a.includes(t)||e.optionValues.push({label:t,colors:getColorDefault(t),imageUrl:""})}),e.optionValues=e.optionValues.map(e=>(void 0===e.imageUrl&&(swatchChange=!0),{label:e.label??"",colors:getColorDefault(e.label,e.colors),imageUrl:e.imageUrl??""}))}),e),fetchProductValueLabel=async e=>{let o={},a=async o=>{let a=await e([t,o]);return a};return a(o)};export{useInitialSwatchesOptions as default};
1
+ import e from"swr";import{ProductOptionNameDocument as t}from"../graphql/queries/product-value-label.generated.js";import{colorPreset as o}from"../components/src/product/helpers/variant-presets.js";import{useSwatches as a}from"./shop.js";import{useFetchHandle as r}from"./useFetchHandle.js";import{useShopStore as s}from"../contexts/ShopContext.js";import"react";import"react/jsx-runtime";import"zustand";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import"./useStickyStore.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"classnames";import"dayjs";import"@gem-sdk/core";import l from"../helpers/is-browser.js";import"../helpers/convert.js";let swatchChange=!1,colorChange=!1,useInitialSwatchesOptions=t=>{let o=r(),i=s(e=>e.changeSwatches),{swatches:p}=a(),{data:n}=e(["/query/productOptionName",{productOptionName:[]}],async()=>fetchProductValueLabel(o),{revalidateOnMount:!0}),c=[];if(p?.forEach(e=>{c.push(e.optionTitle)}),n?.productOptionName?.forEach(e=>{c.includes(e)||(swatchChange=!0,p?.push({optionTitle:e,optionType:"rectangle_list",optionValues:[]}))}),!t)return[];setDefaultSwatches(p,t),l()&&p?.length&&(swatchChange||colorChange)&&(window?.parent?.postMessage?.(JSON.stringify({type:"update-swatches",swatches:p}),"*"),i(p)),swatchChange=!1},getColorDefault=(e,t)=>{let a=e?o[e.toLocaleLowerCase()]:void 0,r=a?[a]:[],s=t?.[0];return!s&&r.length&&(colorChange=!0),s?[s]:r},getProductOptionsLabelByName=(e,t)=>{let o=[],a=e.find(e=>e.name===t);return a?.values.forEach(e=>{e.label&&!o.includes(e.label)&&o.push(e.label)}),o},getSwatchesOptionsLabel=e=>{let t=[];return e.forEach(e=>{e.label&&!t.includes(e.label)&&t.push(e.label)}),t},setDefaultSwatches=(e,t)=>(e&&e?.map(e=>{let o=getProductOptionsLabelByName(t,e.optionTitle),a=getSwatchesOptionsLabel(e.optionValues);o.forEach(t=>{a.includes(t)||e.optionValues.push({label:t,colors:getColorDefault(t),imageUrl:""})}),e.optionValues=e.optionValues.map(e=>(void 0===e.imageUrl&&(swatchChange=!0),{label:e.label??"",colors:getColorDefault(e.label,e.colors),imageUrl:e.imageUrl??""}))}),e),fetchProductValueLabel=async e=>{let o={},a=async o=>{let a=await e([t,o]);return a};return a(o)};export{useInitialSwatchesOptions as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useCallback as e,useEffect as t,useMemo as r}from"react";import{useProductStore as s}from"../contexts/ProductContext.js";import"react/jsx-runtime";import"zustand";import{usePageStore as o}from"../contexts/PageContext.js";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import"./useStickyStore.js";import{checkInStock as u}from"../helpers/variant.js";import{useShopifyLink as i}from"./shop/useShopifyLink.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"@gem-sdk/core";import"classnames";import"dayjs";import{flattenConnection as n}from"../helpers/flatten-connection.js";import"../helpers/convert.js";import{getSelectedVariant as a}from"../helpers/product.js";let useUniqProductID=()=>s(e=>e.uiqueId),useProduct=()=>s(e=>e.product),useFeaturedImageGlobal=()=>s(e=>e.featuredImageGlobal),useProductProperties=()=>s(e=>e.properties),useIsSyncProduct=()=>s(e=>e.isSyncProduct),useProductBundleDiscount=()=>{let e=s(e=>e.useProductCompareAtPrice),t=s(e=>e.setUseProductCompareAtPrice);return{useProductCompareAtPrice:e,seUseProductCompareAtPrice:t}},useProductShopifyEditLink=()=>{let e=s(e=>e.product),t=e?.baseID?.replace("gid://shopify/Product/",""),{linkEditProduct:r}=i({productId:t}),o=()=>{r&&window.open(r,"_blank")};return{linkEditProduct:r,redirectProductShopifyLink:o}},useQuantity=()=>{let o=s(e=>e.quantity),u=s(e=>e.updatePrice),i=s(e=>e.decrementQuantity),n=s(e=>e.incrementQuantity),a=s(e=>e.setQuantity),c=s(e=>e.setHasUpdatePriceFollowQuantity),d=s(e=>e.isSyncProduct),l=s(e=>e.product),p=l?.id,m=e(()=>{a(1)},[a]);return t(()=>{if(d){let e=new CustomEvent("set-product-quantity",{bubbles:!0,cancelable:!0,composed:!0,detail:{quantity:o,productId:p}});window.dispatchEvent(e)}},[o,d,p]),r(()=>({quantity:o,hasUpdatePrice:u,increment:n,decrement:i,reset:m,setQuantity:a,setUpdatePrice:c}),[i,n,o,m,a,c,u])},useHasPreSelected=()=>{let e=s(e=>e.hasPreSelected),t=s(e=>e.setHasPreSelected);return r(()=>({hasPreSelected:e,setHasPreSelected:t}),[e,t])},useSelectedOption=()=>{let t=s(e=>e.setSelectedOption),o=s(e=>e.selectedOptions),u=s(e=>e.forceSelectedOption),i=s(e=>e.isSyncProduct),n=s(e=>e.isChangeSelectedOption),a=s(e=>e.setIsChangeSelectedOption),c=e((e,r,s,o)=>{if(!o&&i){let t=new CustomEvent("set-selected-option",{bubbles:!0,cancelable:!0,composed:!0,detail:{optionId:e,optionValue:r,productId:s,isManualChange:!0}});window.dispatchEvent(t)}t(e,r),a(!0)},[i,t,a]),d=e((e,t,r,s)=>{if(!r&&i){let r=new CustomEvent("force-selected-option",{bubbles:!0,cancelable:!0,composed:!0,detail:{selectedOption:e,productId:t,isManualChange:s}});window.dispatchEvent(r)}u(e)},[u,i]);return r(()=>({isChangeSelectedOption:n,selectedOptions:o,setSelectedOption:c,forceSelectedOption:d}),[o,c,d])},useVariants=()=>{let e=s(e=>e.product?.variants);return n(e)},useVariant=e=>{let t=useVariants();return r(()=>t?.find(t=>t?.id===e),[e,t])},useCurrentVariant=()=>{let{selectedOptions:e}=useSelectedOption(),t=useVariants();return r(()=>a(t,e),[e,t])},useCurrentVariantInStock=()=>{let e=useCurrentVariant(),t=useProduct();return u(e,t)},useVariantOutStock=(e,t,r)=>{let{selectedOptions:s}=useSelectedOption(),o=useVariants(),i=r.optionNumber-1;if(r.position<i)return o.some(r=>{if(r){let{selectedOptions:s}=r,o=s?.some(r=>r?.name===e&&r.value===t),i=u(r);return o&&i}});let n=a(o,{...s,[e]:t});return u(n)},useCheckAvailableVariantInStock=(e,t)=>{let r=useVariants();return!!r&&r.some(r=>{if(r){let{selectedOptions:s}=r,o=s?.some(r=>r?.name===e&&r.value===t),i=u(r);return o&&i}return!1})},useProductOfferDiscount=()=>{let e=o(e=>e.productOffers),t=useProduct(),r=useCurrentVariant(),s=e?.find(e=>e?.node?.objectBaseID===t?.baseID)?.node;if(!s||!s.isEnabled)return 0;let u=s?.value;if(s&&"PERCENTAGE"===s.valueType&&u){let e=r?.price||0;u=u*e/100}return u||0};export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useHasPreSelected,useIsSyncProduct,useProduct,useProductBundleDiscount,useProductOfferDiscount,useProductProperties,useProductShopifyEditLink,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants};
2
+ import{useCallback as e,useEffect as t,useMemo as r}from"react";import{useProductStore as s}from"../contexts/ProductContext.js";import"react/jsx-runtime";import"zustand";import{usePageStore as o}from"../contexts/PageContext.js";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"swr/infinite";import"vanilla-lazyload";import"./useCartUI.js";import{convertDecimalToNumber as u}from"./useFormatMoney.js";import"./useStickyStore.js";import{checkInStock as i}from"../helpers/variant.js";import{useShopifyLink as n}from"./shop/useShopifyLink.js";import"../types/builder.js";import"../types/custom.js";import"../types/animations.js";import"react-transition-group";import"classnames";import"dayjs";import"@gem-sdk/core";import{flattenConnection as a}from"../helpers/flatten-connection.js";import"../helpers/convert.js";import{getSelectedVariant as c}from"../helpers/product.js";let useUniqProductID=()=>s(e=>e.uiqueId),useProduct=()=>s(e=>e.product),useFeaturedImageGlobal=()=>s(e=>e.featuredImageGlobal),useProductProperties=()=>s(e=>e.properties),useIsSyncProduct=()=>s(e=>e.isSyncProduct),useProductBundleDiscount=()=>{let e=s(e=>e.useProductCompareAtPrice),t=s(e=>e.setUseProductCompareAtPrice);return{useProductCompareAtPrice:e,seUseProductCompareAtPrice:t}},useProductShopifyEditLink=()=>{let e=s(e=>e.product),t=e?.baseID?.replace("gid://shopify/Product/",""),{linkEditProduct:r}=n({productId:t}),o=()=>{r&&window.open(r,"_blank")};return{linkEditProduct:r,redirectProductShopifyLink:o}},useQuantity=()=>{let o=s(e=>e.quantity),u=s(e=>e.updatePrice),i=s(e=>e.decrementQuantity),n=s(e=>e.incrementQuantity),a=s(e=>e.setQuantity),c=s(e=>e.setHasUpdatePriceFollowQuantity),d=s(e=>e.isSyncProduct),l=s(e=>e.product),p=l?.id,m=e(()=>{a(1)},[a]);return t(()=>{if(d){let e=new CustomEvent("set-product-quantity",{bubbles:!0,cancelable:!0,composed:!0,detail:{quantity:o,productId:p}});window.dispatchEvent(e)}},[o,d,p]),r(()=>({quantity:o,hasUpdatePrice:u,increment:n,decrement:i,reset:m,setQuantity:a,setUpdatePrice:c}),[i,n,o,m,a,c,u])},useHasPreSelected=()=>{let e=s(e=>e.hasPreSelected),t=s(e=>e.setHasPreSelected);return r(()=>({hasPreSelected:e,setHasPreSelected:t}),[e,t])},useSelectedOption=()=>{let t=s(e=>e.setSelectedOption),o=s(e=>e.selectedOptions),u=s(e=>e.forceSelectedOption),i=s(e=>e.isSyncProduct),n=s(e=>e.isChangeSelectedOption),a=s(e=>e.setIsChangeSelectedOption),c=e((e,r,s,o)=>{if(!o&&i){let t=new CustomEvent("set-selected-option",{bubbles:!0,cancelable:!0,composed:!0,detail:{optionId:e,optionValue:r,productId:s,isManualChange:!0}});window.dispatchEvent(t)}t(e,r),a(!0)},[i,t,a]),d=e((e,t,r,s)=>{if(!r&&i){let r=new CustomEvent("force-selected-option",{bubbles:!0,cancelable:!0,composed:!0,detail:{selectedOption:e,productId:t,isManualChange:s}});window.dispatchEvent(r)}u(e)},[u,i]);return r(()=>({isChangeSelectedOption:n,selectedOptions:o,setSelectedOption:c,forceSelectedOption:d}),[o,c,d])},useVariants=()=>{let e=s(e=>e.product?.variants);return a(e)},useVariant=e=>{let t=useVariants();return r(()=>t?.find(t=>t?.id===e),[e,t])},useCurrentVariant=()=>{let{selectedOptions:e}=useSelectedOption(),t=useVariants();return r(()=>c(t,e),[e,t])},useCurrentVariantInStock=()=>{let e=useCurrentVariant(),t=useProduct();return i(e,t)},useVariantOutStock=(e,t,r)=>{let{selectedOptions:s}=useSelectedOption(),o=useVariants(),u=r.optionNumber-1;if(r.position<u)return o.some(r=>{if(r){let{selectedOptions:s}=r,o=s?.some(r=>r?.name===e&&r.value===t),u=i(r);return o&&u}});let n=c(o,{...s,[e]:t});return i(n)},useCheckAvailableVariantInStock=(e,t)=>{let r=useVariants();return!!r&&r.some(r=>{if(r){let{selectedOptions:s}=r,o=s?.some(r=>r?.name===e&&r.value===t),u=i(r);return o&&u}return!1})},useProductOfferDiscount=()=>{let e=o(e=>e.productOffers),t=useProduct(),r=useCurrentVariant(),s=e?.find(e=>e?.node?.objectBaseID===t?.baseID)?.node;if(!s||!s.isEnabled)return 0;let i=s?.value;if(s&&"PERCENTAGE"===s.valueType&&i){let e=u(r?.price)??0;i=i*e/100}return i||0};export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useHasPreSelected,useIsSyncProduct,useProduct,useProductBundleDiscount,useProductOfferDiscount,useProductProperties,useProductShopifyEditLink,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export{default as AddOn}from"./components/AddOn.js";export{default as Render}from"./components/Render.js";export{default as RenderPreview}from"./components/RenderPreview.js";export{RenderChildren,default as RenderLiquid,WrapRenderChildren}from"./components/Render.liquid.js";export{AddonProvider,useAddon,useAddons}from"./contexts/AddonContext.js";export{BuilderComponentProvider,useBuilderComponent}from"./contexts/BuilderComponent.js";export{BuilderProvider,useBuilderStore}from"./contexts/BuilderContext.js";export{BuilderPreviewProvider,useBuilderPreviewStore}from"./contexts/BuilderPreviewContext.js";export{CartLineProvider,useCartLineStore}from"./contexts/CartLineContext.js";export{ProductListProvider,useProductListStore}from"./contexts/ProductListContext.js";export{ProductProvider,useProductStore}from"./contexts/ProductContext.js";export{SectionProvider,useSection,useSectionStore}from"./contexts/SectionContext.js";export{ShopProvider,useShopStore}from"./contexts/ShopContext.js";export{PageProvider,usePageStore}from"./contexts/PageContext.js";export{CollectionProvider,useCollectionStore}from"./contexts/CollectionContext.js";export{ModalProvider,useModalStore}from"./contexts/ModalContext.js";export{ArticleListProvider,useArticleListStore}from"./contexts/ArticleListContext.js";export{ArticleProvider,useArticleStore}from"./contexts/ArticleContext.js";export{I18nProvider,useI18nStore}from"./contexts/I18nContext.js";export{PageViewUpDocument}from"./graphql/mutations/page-view-up.generated.js";export{CollectionDetailFilterDocument}from"./graphql/queries/collection-detail-filter.generated.js";export{CollectionDocument}from"./graphql/queries/collection.generated.js";export{CollectionsDocument}from"./graphql/queries/collections.generated.js";export{PublishedThemePagesDocument}from"./graphql/queries/published-theme-pages.generated.js";export{ProductsDocument}from"./graphql/queries/products.generated.js";export{StorePropertyDocument}from"./graphql/queries/store-property.generated.js";export{PreviewThemePageDocument}from"./graphql/queries/preview-page.generated.js";export{PublishedShopMetasDocument}from"./graphql/queries/published-shop-metas.generated.js";export{ShopShopifyDocument}from"./graphql/queries/shop-shopify.generated.js";export{ArticlesDocument}from"./graphql/queries/articles.generated.js";export{BlogsDocument}from"./graphql/queries/blogs.generated.js";export{LibraryTemplateDocument}from"./graphql-app-api/queries/LibraryTemplate.generated.js";export{ThemePageDocument}from"./graphql-app-api/queries/ThemePage.generated.js";export{SaleFunnelDiscountsDocument}from"./graphql-app-api/queries/SaleFunnelDiscounts.generated.js";export{LibrarySaleFunnelDocument}from"./graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js";export{ShopLibraryPageDocument}from"./graphql-app-api/queries/ShopLibraryPage.generated.js";export{SaleFunnelOfferDocument}from"./graphql-app-api/queries/SaleFunnelOffer.generated.js";export{composeBorderCss,composeBorderResponsive,getBorderRadiusStyle,getBorderStyle,handleConvertBorderColor,handleConvertBorderStyle,handleConvertBorderWidth,handleConvertClassColor,handleConvertClassColorDynamicBtn,handleConvertInputBorderColor}from"./helpers/borders.js";export{getCarouselContainerHeight,makeContainerWidthOrHeight,makeDotGapToCarouselStyle}from"./helpers/carousel.js";export{cls}from"./helpers/cls.js";export{animations}from"./helpers/animations.js";export{filterToolbarPreview}from"./helpers/filter-toolbar-preview.js";export{flattenConnection}from"./helpers/flatten-connection.js";export{getResponsiveStateValue,getResponsiveValue,getResponsiveValueByScreen,isColumnDirectionExist}from"./helpers/get-resonsive-value.js";export{getShortName}from"./helpers/get-shortname.js";export{default as globalEvent}from"./helpers/GlobalEvent.js";export{default as isBrowser}from"./helpers/is-browser.js";export{isEmptyChildren}from"./helpers/is-empty-children.js";export{default as isSafari}from"./helpers/is-safari.js";export{normalizeBuilderData}from"./helpers/normalize-builder-data.js";export{prefetchQueries}from"./helpers/prefetch-queries.js";export{validateEmail}from"./helpers/email.js";export{loadScript}from"./helpers/load-script.js";export{composeSpacing,getSpacingVariable}from"./helpers/spacing.js";export{genVariable}from"./helpers/css-variable.js";import*as e from"./helpers/tracking/fpixel.js";import*as o from"./helpers/tracking/gtag.js";import*as t from"./helpers/tracking/tiktokpixel.js";export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment}from"./helpers/background.js";export{composeBackgroundImageCss,getBgImageSourceByDevice,getStyleBackgroundImage,getStyleBgImageSource}from"./helpers/backgroundImage.js";export{composeTextColorCss,getGlobalColorCSSProp,getGlobalColorClass,getGlobalColorResponsiveClass,getGlobalColorResponsiveStyle,getGlobalColorStateClass,getGlobalColorStateClassDynamicBtn,getGlobalColorStateResponsiveClass,getGlobalColorStateResponsiveClassDynamicBtn,getGlobalColorStateResponsiveStyle,getGlobalColorStateStyle,getGlobalColorStyle,getSingleColorVariable,isColor}from"./helpers/colors.js";export{composeAdvanceStyle,composeAdvanceStyleForPostPurchase,convertBoxShadowV1ToV2,filterAttrInStyle,getCornerStyle,removeAttrInStyle,removePaddingYInStyle,splitStyle}from"./helpers/compose-advance-style.js";export{composeClasses}from"./helpers/composeClasses.js";export{baseAssetURL,isLocalEnv}from"./helpers/convert.js";export{convertHTML}from"./helpers/covert-entities-html.js";export{composePositionLineHeight,composePostionIconList}from"./helpers/icon-list.js";export{isDefined}from"./helpers/is-defined.js";export{composeGridLayout,convertOldLayout,getLayoutClasses,gridToArrayRegex,optionLayoutStyle}from"./helpers/layout.js";export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveByScreen,makeStyleResponsiveState,makeStyleResponsiveWidth,makeStyleResponsiveWidthWithoutAuto,makeStyleState,makeWidth,removeNullUndefined}from"./helpers/make-style.js";export{convertTextAlignToJustify,getAlignmentClasses}from"./helpers/align.js";export{filterHoverVariables,filterTruthyStyles}from"./helpers/filter-styles.js";export{checkInStock}from"./helpers/variant.js";export{checkAvailableVariantInStock,getSelectedVariant,parseSelectedOption}from"./helpers/product.js";export{generateCollectionQueryKey,generateProductQueryKey,generateProductsQueryKey}from"./helpers/query.js";export{composeCornerCss,composeRadius,composeRadiusResponsive,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState}from"./helpers/radius.js";export{RenderIf,composeMemo,dataStringify,props,removeUndefinedValuesFromObject,sanitizeLiquid,styles,template}from"./helpers/render.js";export{composeShadow,composeShadowCss,getResponsiveStyleShadow,getResponsiveStyleShadowWithoutState,getStyleShadow,getStyleShadowState,parseValueWithUnit}from"./helpers/shadow.js";export{composeSize,composeSizeCss,genSizeClass,getAspectRatioGlobalSize,getFlexGrowClassByShapeGlobalSize,getGlobalSizeGap,getHeightByShapeGlobalSize,getPaddingGlobalSize,getPaddingStyleByDevice,getResponsiveStylePadding,getValueByDevice,getWidthByShapeGlobalSize,getWidthHeightGlobalSize,makeGlobalSize,makeGlobalSizeIcon,makeStyleWithDefault}from"./helpers/size.js";export{composeFallbackTypographyStyle,composeFontFamilyTypographyV2,composeTextHoverColorCss,composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass}from"./helpers/typography.js";export{useArticlesQuery,useBlogsQuery}from"./hooks/articles/useArticlesQuery.js";export{useAddToCart}from"./hooks/cart/use-add-to-cart.js";export{useCartData}from"./hooks/cart/use-cart-data.js";export{useCartDiscountCodesUpdate}from"./hooks/cart/use-cart-discount-codes-update.js";export{useCartNoteUpdate}from"./hooks/cart/use-cart-note-update.js";export{useCreateCart}from"./hooks/cart/use-create-cart.js";export{useRemoveCartItem}from"./hooks/cart/use-remove-cart-item.js";export{useUpdateCartItem}from"./hooks/cart/use-update-cart-item.js";export{useCheckoutUrl,useConnectedShopify,useCurrency,useEditorMode,useIsSampleProduct,useIsStorefrontProduct,useLocale,useMatchMutate,useMobileOnly,useMoneyFormat,usePageType,usePluginEnable,useStoreFront,useSwatches,useTimezone}from"./hooks/shop.js";export{useCollectionQuery}from"./hooks/shop/use-collection-query.js";export{useCollectionsQuery}from"./hooks/shop/use-collections-query.js";export{useProductQuery}from"./hooks/shop/use-product-query.js";export{useFetchHandle}from"./hooks/useFetchHandle.js";export{useProductsQuery,useProductsQueryAll}from"./hooks/shop/use-products-query.js";export{useCurrentDevice}from"./hooks/use-current-device.js";export{useLazyVideo}from"./hooks/use-lazy-video.js";export{default as useCartId}from"./hooks/useCartId.js";export{default as useCartLine}from"./hooks/useCartLine.js";export{default as useCartUI}from"./hooks/useCartUI.js";export{useCollection}from"./hooks/useCollection.js";export{formatMoney,shopifyPriceRounding,useFormatMoney}from"./hooks/useFormatMoney.js";export{useId}from"react";export{default as useInitialSwatchesOptions}from"./hooks/useInitialSwatchesOptions.js";export{default as useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect.js";export{default as useLoadScript}from"./hooks/useLoadScript.js";export{default as useMoney}from"./hooks/useMoney.js";export{usePrevious}from"./hooks/usePrevious.js";export{useI18n}from"./hooks/useI18n.js";export{useStickyStore}from"./hooks/useStickyStore.js";export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useHasPreSelected,useIsSyncProduct,useProduct,useProductBundleDiscount,useProductOfferDiscount,useProductProperties,useProductShopifyEditLink,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants}from"./hooks/useProduct.js";export{useShopifyLink}from"./hooks/shop/useShopifyLink.js";export{useProductList,useProductListProducts,useProductListSettings,useProductListStyles}from"./hooks/useProductList.js";export{default as useSuspenseFetch}from"./hooks/useSuspenseFetch.js";export{default as useSwatchesOptions}from"./hooks/useSwatchesOptions.js";export{useRenderMode}from"./hooks/useRenderMode.js";export{usePreviewSharePage}from"./hooks/usePreviewSharePage.js";export{RenderModeEnv}from"./types/builder.js";export{InteractionTargetEvent,InteractionTriggerEvent}from"./types/custom.js";import*as r from"./types/shop.js";import*as s from"./types/appAPI.js";export{OptionNormalStyle,OptionSpecialStyle}from"./types/global-style.js";export{AnimationDirectionType,AnimationEasingType,AnimationSetting,AnimationTriggerType,AnimationType,AnimationZoomDirectionType}from"./types/animations.js";export{calculateFirstProduct,getCollection}from"./helpers/queries/get-collection.js";export{fetchMedias,fetchVariants,getProduct}from"./helpers/queries/get-product.js";export{getProductBySlug}from"./helpers/queries/get-product-by-slug.js";export{getAppBlocks}from"./helpers/third-party/getAppBlocks.js";export{addAppBlockId}from"./helpers/third-party/addAppBlockId.js";export{useInteraction}from"./helpers/interaction/index.js";export{createStoreFrontFetcher,hasPublicStoreFrontData}from"./helpers/create-store-front-fetcher.js";export{DEVICES,EMPTY_DEVICE_VALUE}from"./constants/device.js";export{e as fpixel,o as gtag,t as tiktokpixel,r as ShopType,s as AppAPIType};
1
+ export{default as AddOn}from"./components/AddOn.js";export{default as Render}from"./components/Render.js";export{default as RenderPreview}from"./components/RenderPreview.js";export{RenderChildren,default as RenderLiquid,WrapRenderChildren}from"./components/Render.liquid.js";export{AddonProvider,useAddon,useAddons}from"./contexts/AddonContext.js";export{BuilderComponentProvider,useBuilderComponent}from"./contexts/BuilderComponent.js";export{BuilderProvider,useBuilderStore}from"./contexts/BuilderContext.js";export{BuilderPreviewProvider,useBuilderPreviewStore}from"./contexts/BuilderPreviewContext.js";export{CartLineProvider,useCartLineStore}from"./contexts/CartLineContext.js";export{ProductListProvider,useProductListStore}from"./contexts/ProductListContext.js";export{ProductProvider,useProductStore}from"./contexts/ProductContext.js";export{SectionProvider,useSection,useSectionStore}from"./contexts/SectionContext.js";export{ShopProvider,useShopStore}from"./contexts/ShopContext.js";export{PageProvider,usePageStore}from"./contexts/PageContext.js";export{CollectionProvider,useCollectionStore}from"./contexts/CollectionContext.js";export{ModalProvider,useModalStore}from"./contexts/ModalContext.js";export{ArticleListProvider,useArticleListStore}from"./contexts/ArticleListContext.js";export{ArticleProvider,useArticleStore}from"./contexts/ArticleContext.js";export{I18nProvider,useI18nStore}from"./contexts/I18nContext.js";export{PageViewUpDocument}from"./graphql/mutations/page-view-up.generated.js";export{CollectionDetailFilterDocument}from"./graphql/queries/collection-detail-filter.generated.js";export{CollectionDocument}from"./graphql/queries/collection.generated.js";export{CollectionsDocument}from"./graphql/queries/collections.generated.js";export{PublishedThemePagesDocument}from"./graphql/queries/published-theme-pages.generated.js";export{ProductsDocument}from"./graphql/queries/products.generated.js";export{StorePropertyDocument}from"./graphql/queries/store-property.generated.js";export{PreviewThemePageDocument}from"./graphql/queries/preview-page.generated.js";export{PublishedShopMetasDocument}from"./graphql/queries/published-shop-metas.generated.js";export{ShopShopifyDocument}from"./graphql/queries/shop-shopify.generated.js";export{ArticlesDocument}from"./graphql/queries/articles.generated.js";export{BlogsDocument}from"./graphql/queries/blogs.generated.js";export{ProductWithSellingPlansSelectFragment,ProductsWithSellingPlansDocument}from"./graphql/queries/products-with-selling-plans.generated.js";export{ProductVariantsWithSellingPlansDocument}from"./graphql/queries/product-variant-with-selling-plans.generated.js";export{LibraryTemplateDocument}from"./graphql-app-api/queries/LibraryTemplate.generated.js";export{ThemePageDocument}from"./graphql-app-api/queries/ThemePage.generated.js";export{SaleFunnelDiscountsDocument}from"./graphql-app-api/queries/SaleFunnelDiscounts.generated.js";export{LibrarySaleFunnelDocument}from"./graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js";export{ShopLibraryPageDocument}from"./graphql-app-api/queries/ShopLibraryPage.generated.js";export{SaleFunnelOfferDocument}from"./graphql-app-api/queries/SaleFunnelOffer.generated.js";export{ThemePageMetaDocument}from"./graphql-app-api/queries/ThemePageMeta.generated.js";export{composeBorderCss,composeBorderResponsive,getBorderRadiusStyle,getBorderStyle,handleConvertBorderColor,handleConvertBorderStyle,handleConvertBorderWidth,handleConvertClassColor,handleConvertClassColorDynamicBtn,handleConvertInputBorderColor}from"./helpers/borders.js";export{getCarouselContainerHeight,makeContainerWidthOrHeight,makeDotGapToCarouselStyle}from"./helpers/carousel.js";export{cls}from"./helpers/cls.js";export{animations}from"./helpers/animations.js";export{filterToolbarPreview}from"./helpers/filter-toolbar-preview.js";export{flattenConnection}from"./helpers/flatten-connection.js";export{getResponsiveStateValue,getResponsiveValue,getResponsiveValueByScreen,isColumnDirectionExist}from"./helpers/get-resonsive-value.js";export{getShortName}from"./helpers/get-shortname.js";export{default as globalEvent}from"./helpers/GlobalEvent.js";export{default as isBrowser}from"./helpers/is-browser.js";export{isEmptyChildren}from"./helpers/is-empty-children.js";export{default as isSafari}from"./helpers/is-safari.js";export{normalizeBuilderData}from"./helpers/normalize-builder-data.js";export{prefetchQueries}from"./helpers/prefetch-queries.js";export{validateEmail}from"./helpers/email.js";export{loadScript}from"./helpers/load-script.js";export{composeSpacing,getSpacingVariable}from"./helpers/spacing.js";export{genVariable}from"./helpers/css-variable.js";import*as e from"./helpers/tracking/fpixel.js";import*as o from"./helpers/tracking/gtag.js";import*as t from"./helpers/tracking/tiktokpixel.js";export{GRADIENT_BGR_KEY,composeBackgroundCss,getBgByDevice,getBgImageByDevice,getBgVideoByDevice,getColor,getCombinedBackgroundImage,getGradientBgrStyleByDevice,getGradientBgrStyleForButton,getGradientImageBgrStyleByDevice,getStyleBackgroundByDevice,getStyleBgColor,makeFixedBgAttachment}from"./helpers/background.js";export{composeBackgroundImageCss,getBgImageSourceByDevice,getStyleBackgroundImage,getStyleBgImageSource}from"./helpers/backgroundImage.js";export{composeTextColorCss,getGlobalColorCSSProp,getGlobalColorClass,getGlobalColorResponsiveClass,getGlobalColorResponsiveStyle,getGlobalColorStateClass,getGlobalColorStateClassDynamicBtn,getGlobalColorStateResponsiveClass,getGlobalColorStateResponsiveClassDynamicBtn,getGlobalColorStateResponsiveStyle,getGlobalColorStateStyle,getGlobalColorStyle,getSingleColorVariable,isColor}from"./helpers/colors.js";export{composeAdvanceStyle,composeAdvanceStyleForPostPurchase,convertBoxShadowV1ToV2,filterAttrInStyle,getCornerStyle,removeAttrInStyle,removePaddingYInStyle,splitStyle}from"./helpers/compose-advance-style.js";export{composeClasses}from"./helpers/composeClasses.js";export{baseAssetURL,isLocalEnv}from"./helpers/convert.js";export{convertHTML}from"./helpers/covert-entities-html.js";export{composePositionLineHeight,composePostionIconList}from"./helpers/icon-list.js";export{isDefined}from"./helpers/is-defined.js";export{composeGridLayout,convertOldLayout,getLayoutClasses,gridToArrayRegex,optionLayoutStyle}from"./helpers/layout.js";export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveState,makeStyleResponsiveWidth,makeStyleResponsiveWidthWithoutAuto,makeStyleState,makeWidth,removeNullUndefined}from"./helpers/make-style.js";export{convertTextAlignToJustify,getAlignmentClasses}from"./helpers/align.js";export{filterHoverVariables,filterTruthyStyles}from"./helpers/filter-styles.js";export{cloneDeep}from"./helpers/clone-deep.js";export{hasTranslatedLiquid}from"./helpers/liquid.js";export{checkInStock}from"./helpers/variant.js";export{checkAvailableVariantInStock,getSelectedVariant,parseSelectedOption}from"./helpers/product.js";export{generateCollectionQueryKey,generateProductQueryKey,generateProductsQueryKey}from"./helpers/query.js";export{composeCornerCss,composeRadius,composeRadiusResponsive,getCornerCSSFromGlobal,getCustomRadius,getRadiusCSSFromGlobal,getRadiusStyleActiveState}from"./helpers/radius.js";export{RenderIf,composeMemo,dataStringify,props,removeUndefinedValuesFromObject,sanitizeLiquid,styles,template}from"./helpers/render.js";export{composeShadow,composeShadowCss,getResponsiveStyleShadow,getResponsiveStyleShadowWithoutState,getStyleShadow,getStyleShadowState,parseValueWithUnit}from"./helpers/shadow.js";export{composeSize,composeSizeCss,genSizeClass,getAspectRatioGlobalSize,getFlexGrowClassByShapeGlobalSize,getGlobalSizeGap,getHeightByShapeGlobalSize,getPaddingGlobalSize,getPaddingStyleByDevice,getResponsiveStylePadding,getValueByDevice,getWidthByShapeGlobalSize,getWidthHeightGlobalSize,makeGlobalSize,makeGlobalSizeIcon,makeStyleWithDefault}from"./helpers/size.js";export{composeFallbackTypographyStyle,composeFontFamilyTypographyV2,composeTextHoverColorCss,composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass}from"./helpers/typography.js";export{useArticlesQuery,useBlogsQuery}from"./hooks/articles/useArticlesQuery.js";export{useAddToCart}from"./hooks/cart/use-add-to-cart.js";export{useCartData}from"./hooks/cart/use-cart-data.js";export{useCartDiscountCodesUpdate}from"./hooks/cart/use-cart-discount-codes-update.js";export{useCartNoteUpdate}from"./hooks/cart/use-cart-note-update.js";export{useCreateCart}from"./hooks/cart/use-create-cart.js";export{useRemoveCartItem}from"./hooks/cart/use-remove-cart-item.js";export{useUpdateCartItem}from"./hooks/cart/use-update-cart-item.js";export{useCheckoutUrl,useConnectedShopify,useCurrency,useEditorMode,useIsSampleProduct,useIsStorefrontProduct,useLocale,useMatchMutate,useMobileOnly,useMoneyFormat,usePageType,usePluginEnable,useStoreFront,useSwatches,useTimezone}from"./hooks/shop.js";export{useCollectionQuery}from"./hooks/shop/use-collection-query.js";export{useCollectionsQuery}from"./hooks/shop/use-collections-query.js";export{useProductQuery}from"./hooks/shop/use-product-query.js";export{useProductOffersQuery}from"./hooks/shop/useProductOffersQuery.js";export{useFetchHandle}from"./hooks/useFetchHandle.js";export{useProductsQuery,useProductsQueryAll}from"./hooks/shop/use-products-query.js";export{useCurrentDevice}from"./hooks/use-current-device.js";export{useLazyVideo}from"./hooks/use-lazy-video.js";export{default as useCartId}from"./hooks/useCartId.js";export{default as useCartLine}from"./hooks/useCartLine.js";export{default as useCartUI}from"./hooks/useCartUI.js";export{useCollection}from"./hooks/useCollection.js";export{convertDecimalToNumber,formatMoney,shopifyPriceRounding,useFormatMoney}from"./hooks/useFormatMoney.js";export{useId}from"react";export{default as useInitialSwatchesOptions}from"./hooks/useInitialSwatchesOptions.js";export{default as useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect.js";export{default as useLoadScript}from"./hooks/useLoadScript.js";export{default as useMoney}from"./hooks/useMoney.js";export{usePrevious}from"./hooks/usePrevious.js";export{tGlobal as t,useI18n}from"./hooks/useI18n.js";export{useStickyStore}from"./hooks/useStickyStore.js";export{useCheckAvailableVariantInStock,useCurrentVariant,useCurrentVariantInStock,useFeaturedImageGlobal,useHasPreSelected,useIsSyncProduct,useProduct,useProductBundleDiscount,useProductOfferDiscount,useProductProperties,useProductShopifyEditLink,useQuantity,useSelectedOption,useUniqProductID,useVariant,useVariantOutStock,useVariants}from"./hooks/useProduct.js";export{useShopifyLink}from"./hooks/shop/useShopifyLink.js";export{useProductList,useProductListProducts,useProductListSettings,useProductListStyles}from"./hooks/useProductList.js";export{default as useSuspenseFetch}from"./hooks/useSuspenseFetch.js";export{default as useSwatchesOptions}from"./hooks/useSwatchesOptions.js";export{useRenderMode}from"./hooks/useRenderMode.js";export{usePreviewSharePage}from"./hooks/usePreviewSharePage.js";export{RenderModeEnv}from"./types/builder.js";export{InteractionTargetEvent,InteractionTriggerEvent}from"./types/custom.js";import*as r from"./types/shop.js";import*as s from"./types/appAPI.js";export{OptionNormalStyle,OptionSpecialStyle}from"./types/global-style.js";export{AnimationDirectionType,AnimationEasingType,AnimationSetting,AnimationTriggerType,AnimationType,AnimationZoomDirectionType}from"./types/animations.js";export{calculateFirstProduct,getCollection}from"./helpers/queries/get-collection.js";export{fetchMedias,fetchVariants,getProduct}from"./helpers/queries/get-product.js";export{getProductBySlug}from"./helpers/queries/get-product-by-slug.js";export{getAppBlocks}from"./helpers/third-party/getAppBlocks.js";export{addAppBlockId}from"./helpers/third-party/addAppBlockId.js";export{useInteraction}from"./helpers/interaction/index.js";export{createStoreFrontFetcher,hasPublicStoreFrontData}from"./helpers/create-store-front-fetcher.js";export{DEVICES,EMPTY_DEVICE_VALUE}from"./constants/device.js";export{e as fpixel,o as gtag,t as tiktokpixel,r as ShopType,s as AppAPIType};