@lime-bundles/widget 0.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -0
- package/dist/index.cjs +2722 -442
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -9
- package/dist/index.d.ts +44 -9
- package/dist/index.js +2737 -450
- package/dist/index.js.map +1 -1
- package/dist/lime-bundle.global.js +1218 -82
- package/dist/lime-bundle.global.js.map +1 -1
- package/docs/README.md +81 -0
- package/docs/css-variables.md +158 -0
- package/docs/hydrogen.md +185 -0
- package/docs/react-nextjs.md +379 -0
- package/docs/web-component.md +282 -0
- package/package.json +5 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var LimeBundles=(()=>{var
|
|
1
|
+
"use strict";var LimeBundles=(()=>{var G=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},He=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of De(t))!Ue.call(e,r)&&r!==n&&G(e,r,{get:()=>t[r],enumerable:!(o=Ve(t,r))||o.enumerable});return e};var $e=e=>He(G({},"__esModule",{value:!0}),e);var $t={};Oe($t,{LimeBundleElement:()=>q});var te=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},We="2025-10";function Q(e){let t=e.apiVersion??We,n=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(o,r,a){let i={"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e.accessToken};e.buyerIp&&(i["Shopify-Storefront-Buyer-IP"]=e.buyerIp);let l=await fetch(n,{method:"POST",headers:i,body:JSON.stringify({query:o,variables:r}),signal:a?.signal});if(!l.ok)throw new te([{message:`Storefront API error: ${l.status} ${l.statusText}`}]);let d=await l.json();if(d.errors?.length)throw new te(d.errors);return d.data}}}var de=`#graphql
|
|
2
2
|
query BundleMetaobject($id: ID!) {
|
|
3
3
|
metaobject(id: $id) {
|
|
4
4
|
id
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
`,
|
|
85
|
+
`,le=`#graphql
|
|
86
86
|
query ShopCustomCss {
|
|
87
87
|
shop {
|
|
88
88
|
metafield(namespace: "$app", key: "custom_css") {
|
|
@@ -90,88 +90,1224 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
`,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
`,se=`#graphql
|
|
94
|
+
query BundlesForProduct($handle: String!) {
|
|
95
|
+
product(handle: $handle) {
|
|
96
|
+
id
|
|
97
|
+
handle
|
|
98
|
+
title
|
|
99
|
+
metafield(namespace: "$app", key: "active_bundle_ids") {
|
|
100
|
+
references(first: 10) {
|
|
101
|
+
nodes {
|
|
102
|
+
... on Metaobject {
|
|
103
|
+
id
|
|
104
|
+
type
|
|
105
|
+
fields {
|
|
106
|
+
key
|
|
107
|
+
value
|
|
108
|
+
reference {
|
|
109
|
+
... on Product {
|
|
110
|
+
id
|
|
111
|
+
title
|
|
112
|
+
handle
|
|
113
|
+
featuredImage { url altText }
|
|
114
|
+
priceRange {
|
|
115
|
+
minVariantPrice { amount currencyCode }
|
|
116
|
+
maxVariantPrice { amount currencyCode }
|
|
117
|
+
}
|
|
118
|
+
variants(first: 100) {
|
|
119
|
+
nodes {
|
|
120
|
+
id
|
|
121
|
+
title
|
|
122
|
+
availableForSale
|
|
123
|
+
price { amount currencyCode }
|
|
124
|
+
compareAtPrice { amount currencyCode }
|
|
125
|
+
selectedOptions { name value }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
references(first: 50) {
|
|
131
|
+
nodes {
|
|
132
|
+
... on Product {
|
|
133
|
+
id
|
|
134
|
+
title
|
|
135
|
+
handle
|
|
136
|
+
featuredImage { url altText }
|
|
137
|
+
priceRange {
|
|
138
|
+
minVariantPrice { amount currencyCode }
|
|
139
|
+
maxVariantPrice { amount currencyCode }
|
|
140
|
+
}
|
|
141
|
+
variants(first: 100) {
|
|
142
|
+
nodes {
|
|
143
|
+
id
|
|
144
|
+
title
|
|
145
|
+
availableForSale
|
|
146
|
+
price { amount currencyCode }
|
|
147
|
+
compareAtPrice { amount currencyCode }
|
|
148
|
+
selectedOptions { name value }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
... on Collection {
|
|
153
|
+
id
|
|
154
|
+
title
|
|
155
|
+
handle
|
|
156
|
+
products(first: 50) {
|
|
157
|
+
nodes {
|
|
158
|
+
id
|
|
159
|
+
title
|
|
160
|
+
handle
|
|
161
|
+
featuredImage { url altText }
|
|
162
|
+
priceRange {
|
|
163
|
+
minVariantPrice { amount currencyCode }
|
|
164
|
+
maxVariantPrice { amount currencyCode }
|
|
165
|
+
}
|
|
166
|
+
variants(first: 100) {
|
|
167
|
+
nodes {
|
|
168
|
+
id
|
|
169
|
+
title
|
|
170
|
+
availableForSale
|
|
171
|
+
price { amount currencyCode }
|
|
172
|
+
compareAtPrice { amount currencyCode }
|
|
173
|
+
selectedOptions { name value }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`,ce=`#graphql
|
|
189
|
+
mutation CartCreate($input: CartInput!) {
|
|
190
|
+
cartCreate(input: $input) {
|
|
191
|
+
cart { id checkoutUrl }
|
|
192
|
+
userErrors { field message }
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
`,ue=`#graphql
|
|
196
|
+
mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
|
|
197
|
+
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
198
|
+
cart { id checkoutUrl }
|
|
199
|
+
userErrors { field message }
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
`,D=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},M={header:{textColor:"#FFFFFF",headerStyle:"gradient",gradientStart:"#C62828",gradientEnd:"#AD1457",saveBadgeBgColor:"#FFFFFF",saveBadgeTextColor:"#AD1457",saveBadgeBorderColor:"#FFFFFF",saveBadgeBorderWidth:0,saveBadgeBorderRadius:8,countdownBgColor:"#FFF0F3",countdownTextColor:"#C62828"},layout:{backgroundColor:"#FFFFFF",borderColor:"#E5E5E5",borderWidth:1,borderRadius:12},productList:{textColor:"#1A1A1A",imageBorderWidth:0,imageBorderColor:"#E5E5E5",imageBorderRadius:8,variantBorderWidth:1,variantBorderColor:"#E5E5E5",variantBorderRadius:8,showPrice:!0,showCompareAtPrice:!0,showCountBubble:!0,countBubbleBgColor:"#1A1A1A",countBubbleTextColor:"#FFFFFF"},pricing:{showSaveBadge:!0,showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#1A1A1A",buttonTextColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},savingsBar:{visible:!0,bgColor:"#EDFBF1",textColor:"#2DB554",borderWidth:0,borderColor:"#2DB554",borderRadius:8},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},outOfStockBehavior:"show_greyed_out",showSearch:!0,pickerBgColor:"#FFFFFF",pickerTextColor:"#1A1A1A",pickerBorderWidth:0,pickerBorderColor:"#E5E5E5",pickerBorderRadius:16,pickerSearchBorderWidth:1,pickerSearchBorderColor:"#E5E5E5",pickerSearchBorderRadius:8,pickerProductBorderWidth:0,pickerProductBorderColor:"#E5E5E5",pickerProductBorderRadius:8,pickerShowCountBubble:!0,pickerCountBubbleBgColor:"#1A1A1A",pickerCountBubbleTextColor:"#FFFFFF",pickerAddBgColor:"#1A1A1A",pickerAddLabelColor:"#FFFFFF",pickerAddBorderWidth:0,pickerAddBorderColor:"#1A1A1A",pickerAddBorderRadius:8,pickerVariantBorderWidth:1,pickerVariantBorderColor:"#1A1A1A",pickerVariantBorderRadius:8,tierBorderColor:"#E5E5E5",tierBorderWidth:1,tierBorderRadius:12,tierSelectedBorderColor:"#1A1A1A",tierSelectedBorderWidth:2,defaultTier:"first"};function qe(e){if(!e||typeof e!="object")return M;let t=e;return{...M,...t,defaultTier:Ne(t.defaultTier),header:{...M.header,...t.header??{}},layout:{...M.layout,...t.layout??{}},productList:{...M.productList,...t.productList??{}},pricing:{...M.pricing,...t.pricing??{}},cta:{...M.cta,...t.cta??{}},savingsBar:{...M.savingsBar,...t.savingsBar??{}},countdown:{...M.countdown,...t.countdown??{}},popularBadge:{...M.popularBadge,...t.popularBadge??{}}}}function Ne(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:M.defaultTier}function ze(e){return{primaryColor:e.cta.primaryColor,backgroundColor:e.layout.backgroundColor,textColor:e.productList.textColor,borderColor:e.layout.borderColor,borderWidth:e.layout.borderWidth,buttonTextColor:e.cta.buttonTextColor,ctaBorderWidth:e.cta.borderWidth,ctaBorderColor:e.cta.borderColor,ctaBorderRadius:e.cta.borderRadius,savingsBarBgColor:e.savingsBar.bgColor,savingsBarTextColor:e.savingsBar.textColor,savingsBarBorderWidth:e.savingsBar.borderWidth,savingsBarBorderColor:e.savingsBar.borderColor,savingsBarBorderRadius:e.savingsBar.borderRadius,borderRadius:e.layout.borderRadius,headerTextColor:e.header.textColor,saveBadgeBgColor:e.header.saveBadgeBgColor,saveBadgeTextColor:e.header.saveBadgeTextColor,saveBadgeBorderColor:e.header.saveBadgeBorderColor,saveBadgeBorderWidth:e.header.saveBadgeBorderWidth,saveBadgeBorderRadius:e.header.saveBadgeBorderRadius,countdownBgColor:e.header.countdownBgColor,countdownTextColor:e.header.countdownTextColor,headerStyle:e.header.headerStyle,headerGradientStart:e.header.gradientStart,headerGradientEnd:e.header.gradientEnd,showSaveBadge:e.pricing.showSaveBadge,imageBorderWidth:e.productList.imageBorderWidth,imageBorderColor:e.productList.imageBorderColor,imageBorderRadius:e.productList.imageBorderRadius,variantBorderWidth:e.productList.variantBorderWidth,variantBorderColor:e.productList.variantBorderColor,variantBorderRadius:e.productList.variantBorderRadius,countBubbleBgColor:e.productList.countBubbleBgColor,countBubbleTextColor:e.productList.countBubbleTextColor,showProductPrice:e.productList.showPrice,showProductCompareAtPrice:e.productList.showCompareAtPrice,showCountBubble:e.productList.showCountBubble,showCountdown:e.countdown.showCountdown,ctaText:e.cta.ctaText,outOfStockBehavior:e.outOfStockBehavior,showComparePrice:e.pricing.showComparePrice,showPerUnitPrice:e.pricing.showPerUnitPrice,showItemCount:e.pricing.showItemCount,showCompareAtPrice:e.pricing.showCompareAtPrice,showMostPopular:e.popularBadge.visible,popularBadgeText:e.popularBadge.text,popularBadgeBgColor:e.popularBadge.bgColor,popularBadgeTextColor:e.popularBadge.textColor,popularBadgeBorderWidth:e.popularBadge.borderWidth,popularBadgeBorderColor:e.popularBadge.borderColor,popularBadgeBorderRadius:e.popularBadge.borderRadius,showSearch:e.showSearch,pickerBgColor:e.pickerBgColor,pickerTextColor:e.pickerTextColor,pickerBorderWidth:e.pickerBorderWidth,pickerBorderColor:e.pickerBorderColor,pickerBorderRadius:e.pickerBorderRadius,pickerSearchBorderWidth:e.pickerSearchBorderWidth,pickerSearchBorderColor:e.pickerSearchBorderColor,pickerSearchBorderRadius:e.pickerSearchBorderRadius,pickerProductBorderWidth:e.pickerProductBorderWidth,pickerProductBorderColor:e.pickerProductBorderColor,pickerProductBorderRadius:e.pickerProductBorderRadius,pickerShowCountBubble:e.pickerShowCountBubble,pickerCountBubbleBgColor:e.pickerCountBubbleBgColor,pickerCountBubbleTextColor:e.pickerCountBubbleTextColor,pickerAddBgColor:e.pickerAddBgColor,pickerAddLabelColor:e.pickerAddLabelColor,pickerAddBorderWidth:e.pickerAddBorderWidth,pickerAddBorderColor:e.pickerAddBorderColor,pickerAddBorderRadius:e.pickerAddBorderRadius,pickerVariantBorderWidth:e.pickerVariantBorderWidth,pickerVariantBorderColor:e.pickerVariantBorderColor,pickerVariantBorderRadius:e.pickerVariantBorderRadius,tierBorderColor:e.tierBorderColor,tierBorderWidth:e.tierBorderWidth,tierBorderRadius:e.tierBorderRadius,tierSelectedBorderColor:e.tierSelectedBorderColor,tierSelectedBorderWidth:e.tierSelectedBorderWidth,defaultTier:e.defaultTier,...e.popularBadge.tierIndex!==void 0&&{mostPopularTierIndex:e.popularBadge.tierIndex}}}var je={primaryColor:"--lb-primary-color",backgroundColor:"--lb-bg",textColor:"--lb-text",imageBorderWidth:"--lb-image-border-width",imageBorderColor:"--lb-image-border-color",imageBorderRadius:"--lb-image-border-radius",variantBorderWidth:"--lb-variant-border-width",variantBorderColor:"--lb-variant-border-color",variantBorderRadius:"--lb-variant-radius",countBubbleBgColor:"--lb-qty-badge-bg",countBubbleTextColor:"--lb-qty-badge-color",borderColor:"--lb-border",borderWidth:"--lb-border-width",buttonTextColor:"--lb-btn-text",borderRadius:"--lb-radius",headerTextColor:"--lb-header-text",saveBadgeBgColor:"--lb-save-badge-bg",saveBadgeTextColor:"--lb-save-badge-text",saveBadgeBorderColor:"--lb-save-badge-border-color",saveBadgeBorderWidth:"--lb-save-badge-border-width",saveBadgeBorderRadius:"--lb-save-badge-radius",countdownBgColor:"--lb-countdown-bg",countdownTextColor:"--lb-countdown-text",ctaBorderWidth:"--lb-cta-border-width",ctaBorderColor:"--lb-cta-border-color",ctaBorderRadius:"--lb-cta-radius",savingsBarBgColor:"--lb-savings-bar-bg",savingsBarTextColor:"--lb-savings-bar-text",savingsBarBorderWidth:"--lb-savings-bar-border-width",savingsBarBorderColor:"--lb-savings-bar-border-color",savingsBarBorderRadius:"--lb-savings-bar-radius",tierBorderColor:"--lb-tier-border-color",tierBorderWidth:"--lb-tier-border-width",tierBorderRadius:"--lb-tier-radius",tierSelectedBorderColor:"--lb-tier-selected-border-color",tierSelectedBorderWidth:"--lb-tier-selected-border-width",popularBadgeBgColor:"--lb-popular-badge-bg",popularBadgeTextColor:"--lb-popular-badge-text",popularBadgeBorderWidth:"--lb-popular-badge-border-width",popularBadgeBorderColor:"--lb-popular-badge-border-color",popularBadgeBorderRadius:"--lb-popular-badge-radius",headerGradientStart:"--lb-header-start",headerGradientEnd:"--lb-header-end",pickerBgColor:"--lb-picker-bg",pickerTextColor:"--lb-picker-text",pickerBorderWidth:"--lb-picker-border-width",pickerBorderColor:"--lb-picker-border-color",pickerBorderRadius:"--lb-picker-radius",pickerSearchBorderWidth:"--lb-picker-search-border-width",pickerSearchBorderColor:"--lb-picker-search-border-color",pickerSearchBorderRadius:"--lb-picker-search-radius",pickerProductBorderWidth:"--lb-picker-product-border-width",pickerProductBorderColor:"--lb-picker-product-border-color",pickerProductBorderRadius:"--lb-picker-product-radius",pickerCountBubbleBgColor:"--lb-picker-qty-badge-bg",pickerCountBubbleTextColor:"--lb-picker-qty-badge-color",pickerAddBgColor:"--lb-picker-add-bg",pickerAddLabelColor:"--lb-picker-add-label",pickerAddBorderWidth:"--lb-picker-add-border-width",pickerAddBorderColor:"--lb-picker-add-border-color",pickerAddBorderRadius:"--lb-picker-add-radius",pickerVariantBorderWidth:"--lb-picker-variant-border-width",pickerVariantBorderColor:"--lb-picker-variant-border-color",pickerVariantBorderRadius:"--lb-picker-variant-radius"},Ge=new Set(["borderRadius","borderWidth","saveBadgeBorderWidth","saveBadgeBorderRadius","tierBorderWidth","tierBorderRadius","tierSelectedBorderWidth","savingsBarBorderWidth","savingsBarBorderRadius","ctaBorderWidth","ctaBorderRadius","popularBadgeBorderWidth","popularBadgeBorderRadius","imageBorderWidth","imageBorderRadius","variantBorderWidth","variantBorderRadius","pickerBorderWidth","pickerBorderRadius","pickerSearchBorderWidth","pickerSearchBorderRadius","pickerProductBorderWidth","pickerProductBorderRadius","pickerAddBorderWidth","pickerAddBorderRadius","pickerVariantBorderWidth","pickerVariantBorderRadius"]);function pe(e,t){let n=ze(t);for(let[o,r]of Object.entries(je)){let a=n[o];if(a==null)continue;let i=Ge.has(o)?`${a}px`:String(a);e.style.setProperty(r,i)}e.style.setProperty("--lb-product-price-display",t.productList.showPrice?"block":"none"),e.style.setProperty("--lb-product-compare-display",t.productList.showCompareAtPrice?"inline":"none"),e.style.setProperty("--lb-qty-badge-display",t.productList.showCountBubble?"flex":"none"),e.style.setProperty("--lb-picker-qty-badge-display",t.pickerShowCountBubble?"flex":"none"),t.header.headerStyle==="solid"?e.style.setProperty("--lb-header-bg",t.header.gradientStart):e.style.setProperty("--lb-header-bg",`linear-gradient(135deg, ${t.header.gradientStart}, ${t.header.gradientEnd})`)}var Qe=new Set(["fixed","mix_match","volume"]),Ye=new Set(["active"]);function Y(e,t){try{return Xe(e,t)}catch(n){if(n instanceof D)return null;throw n}}function Xe(e,t){let n=new Map(t.map(f=>[f.key,f])),o=n.get("title")?.value??"Bundle",r=n.get("bundle_type")?.value,a=n.get("status")?.value;if(!r||!Qe.has(r))throw new D(`Invalid or missing bundle_type: ${r??"null"}`,"invalid_type");let i=r;if(!a||!Ye.has(a))throw new D(`Bundle is not active: status=${a??"null"}`,"inactive");let l=a,d=n.get("starts_at")?.value??null,c=n.get("ends_at")?.value??null,u=new Date;if(d){let f=new Date(d);if(Number.isNaN(f.getTime()))throw new D(`Invalid starts_at: ${d}`,"invalid_type");if(f>u)throw new D(`Bundle not yet started: starts_at=${d}`,"not_started")}if(c){let f=new Date(c);if(Number.isNaN(f.getTime()))throw new D(`Invalid ends_at: ${c}`,"invalid_type");if(f<u)throw new D(`Bundle has expired: ends_at=${c}`,"expired")}let p=Ke(n),C=Je(n),b=Ze(n),v={id:e,title:o,description:n.get("description")?.value||null,status:l,products:p,discountConfig:C,widgetConfig:b,startsAt:d,endsAt:c,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:et(n),productQuantities:re(n,"product_quantities"),variantQuantities:re(n,"variant_quantities"),abTestId:n.get("ab_test_id")?.value??null,abVariantB:tt(n)};switch(i){case"fixed":return{...v,bundleType:"fixed"};case"volume":return{...v,bundleType:"volume",volumeTiers:rt(n)};case"mix_match":return{...v,bundleType:"mix_match",minQuantity:ne(n,"min_quantity",{min:1}),maxQuantity:ne(n,"max_quantity",{min:1})}}}function Ke(e){let t=[],n=e.get("products");if(n?.reference&&"variants"in n.reference&&t.push(n.reference),n?.references?.nodes)for(let r of n.references.nodes)"variants"in r?t.push(r):"products"in r&&r.products?.nodes&&t.push(...r.products.nodes);let o=e.get("collection");if(o?.references?.nodes)for(let r of o.references.nodes)"products"in r&&r.products?.nodes&&t.push(...r.products.nodes);return t}function Je(e){return{discountType:e.get("discount_type")?.value??"percentage",discountValue:parseFloat(e.get("discount_value")?.value??"0"),allowStacking:e.get("allow_stacking")?.value==="true"}}function Ze(e){return qe(W(e,"widget_config"))}function et(e){let t=W(e,"selected_variant_ids");if(!Array.isArray(t))return null;let n=[];for(let o of t)Array.isArray(o)?n.push(o.filter(r=>typeof r=="string")):n.push([]);return n}function re(e,t){let n=W(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let o={};for(let[r,a]of Object.entries(n)){let i=typeof a=="number"?a:Number(a);Number.isFinite(i)&&i>=0&&(o[r]=i)}return o}function tt(e){if(!e.get("ab_test_id")?.value)return null;let n={},o=e.get("ab_title")?.value;o&&(n.title=o);let r=e.get("ab_description")?.value;r&&(n.description=r);let a=e.get("ab_discount_type")?.value,i=e.get("ab_discount_value")?.value;if(a&&(a==="percentage"||a==="fixed_amount")&&i){let d=parseFloat(i);Number.isFinite(d)&&(n.discountConfig={discountType:a,discountValue:d,allowStacking:e.get("allow_stacking")?.value==="true"})}let l=W(e,"ab_volume_tiers");return Array.isArray(l)&&(n.volumeTiers=l.filter(d=>typeof d=="object"&&d!==null).map(d=>({minQuantity:Number(d.minQuantity??0),discountType:d.discountType??"percentage",discountValue:Number(d.discountValue??0),label:d.label??null}))),Object.keys(n).length===0?null:n}function rt(e){let t=W(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(n=>({minQuantity:Number(n.minQuantity??0),discountType:n.discountType??"percentage",discountValue:Number(n.discountValue??0),label:n.label??null})):[]}function W(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function ne(e,t,n={}){let o=e.get(t)?.value;if(!o)return null;let r=parseInt(o,10);return isNaN(r)||n.min!==void 0&&r<n.min?null:r}function be(e){let t=e.abVariantB;if(!t)return e;let n=t.title??e.title,o=t.description!==void 0?t.description:e.description,r=t.discountConfig??e.discountConfig;switch(e.bundleType){case"volume":return{...e,title:n,description:o,discountConfig:r,volumeTiers:t.volumeTiers??e.volumeTiers};case"mix_match":return{...e,title:n,description:o,discountConfig:r};case"fixed":return{...e,title:n,description:o,discountConfig:r}}}async function he(e,t){await fe(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,abTestId:t.abTestId,abVariant:t.abVariant,occurredAt:new Date().toISOString()})}async function me(e,t){await fe(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function ge(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let n=new IntersectionObserver(o=>{for(let r of o)r.isIntersecting&&(t(),n.unobserve(r.target))},{threshold:.5});return n.observe(e),()=>n.disconnect()}async function fe(e,t){let n=`${e.appUrl}/api/analytics`,o=JSON.stringify(t);try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:o})).ok||(await new Promise(a=>setTimeout(a,2e3)),await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:o}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(n,o)}catch{}}}var nt=!1;function ot(){if(nt)return!0;if(typeof window>"u")return!1;let e=window.Shopify;try{return e?.customerPrivacy?.analyticsProcessingAllowed?.()===!0}catch{return!1}}var oe="lb_session",it=720*60*60,at=720*60*60;function ve(e){return`__Host-_lb_ab_${e}`}async function xe(e,t,n,o){if(typeof document>"u")return null;let r=dt(o);if(r&&r.testId===n)return{variant:r.variant,testId:n,persisted:!0};if(!ot())return{variant:"A",testId:n,persisted:!1};let a=st(),i=ct(a,n);lt(o,n,i);try{fetch(`${e}/api/ab-assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopDomain:t,testId:n,sessionId:a,variant:i})}).catch(()=>{})}catch{}return{variant:i,testId:n,persisted:!0}}function dt(e){if(typeof document>"u")return null;let n=`${ve(e)}=`,r=document.cookie.split(";").map(d=>d.trim()).find(d=>d.startsWith(n));if(!r)return null;let a=r.substring(n.length),[i,l]=a.split("|");return i!=="A"&&i!=="B"||!l?null:{testId:l,variant:i}}function lt(e,t,n){if(typeof document>"u")return;let o=ve(e),r=`${n}|${t}|${Date.now()}`;document.cookie=`${o}=${r}; Path=/; Max-Age=${at}; SameSite=Lax; Secure`}function st(){if(typeof document>"u")return ie();let t=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${oe}=`))?.split("=")[1];if(t)return t;let n=ie();return document.cookie=`${oe}=${n}; path=/; max-age=${it}; SameSite=Lax; Secure`,n}function ie(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ct(e,t){let n=e+":"+t,o=2166136261;for(let r=0;r<n.length;r++)o^=n.charCodeAt(r),o=Math.imul(o,16777619);return(o>>>0)%2===0?"A":"B"}var ae=1e4,ut=[[/@import/i,"@import rules"],[/@charset/i,"@charset declarations"],[/expression\s*\(/i,"CSS expressions"],[/-moz-binding/i,"-moz-binding"],[/-webkit-binding/i,"-webkit-binding"],[/behavior\s*:/i,"behavior property"]],pt=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function X(e){if(e.length>ae)return{ok:!1,error:`CSS exceeds ${ae.toLocaleString("en-US")} character limit`};let t=e.replace(/\/\*[\s\S]*?\*\//g,"");try{t=t.replace(/\\([0-9a-fA-F]{1,6})[ \t\n\f]?/g,(r,a)=>{let i=parseInt(a,16);return i<0||i>1114111?"\uFFFD":String.fromCodePoint(i)}),t=t.replace(/\\\r?\n/g,""),t=t.replace(/\\([^\n\r\f0-9a-fA-F])/g,"$1")}catch{return{ok:!1,error:"CSS contains invalid unicode escape sequences"}}t=t.replace(/</g,"").replace(/>/g,"");for(let[r,a]of ut)if(r.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${a}`};let n=/url\s*\(\s*([\s\S]*?)\s*\)/gi,o;for(;(o=n.exec(t))!==null;){let r=o[1].trim();if((r.startsWith("'")||r.startsWith('"'))&&(r=r.slice(1)),(r.endsWith("'")||r.endsWith('"'))&&(r=r.slice(0,-1)),r=r.trim(),r&&!pt.test(r))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var bt="lb-custom-css-";function Ce(e,t){if(typeof document>"u"||!t)return!1;let n=X(t);if(!n.ok||!n.css.trim())return!1;let o=bt+ht(e),r=document.getElementById(o);return r||(r=document.createElement("style"),r.id=o,r.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(r)),r.textContent!==n.css&&(r.textContent=n.css),!0}function ht(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function R(e){if(e==null)return 0;let t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.round(t*100):0}function k(e,t){try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e/100)}catch{return`${t} ${(e/100).toFixed(2)}`}}function ye(e,t){return Math.max(0,e-Math.floor(e*t/100))}function K(e,t=e.productQuantities,n=e.widgetConfig.pricing.showSaveBadge){let{discountType:o,discountValue:r}=e.discountConfig,a=[],i=0,l=0;for(let p of e.products){let C=p.variants.nodes.find(w=>w.availableForSale)??p.variants.nodes[0];if(!C)continue;let b=R(C.price.amount),v=t[p.id]??1,f=b*v,S=C.compareAtPrice?R(C.compareAtPrice.amount):null;if(a.push({unitCents:b,qty:v,lineCents:f,compareCents:S}),i+=f,o==="percentage"){let w=ye(b,r);l+=w*v}else l+=f}o==="fixed_amount"&&(l=Math.max(0,i-Math.round(r*100)));let d=Math.max(0,i-l),c=e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",u="";return n&&d>0&&(o==="percentage"&&r>0?u=`-${Math.round(r)}%`:o==="fixed_amount"&&r>0&&(u=`-${k(Math.round(r*100),c)}`)),{rows:a,totalCents:i,saleCents:l,savingsCents:d,headerBadge:u,currency:c}}function z(e,t){if(t.discountType==="percentage"){let n=Math.floor(e*t.discountValue/100);return Math.max(0,e-n)}return Math.max(0,e-Math.round(t.discountValue*100))}var P=152;function U(e,t={}){if(!e)return"";try{let n=new URL(e);return t.width!==void 0&&n.searchParams.set("width",String(t.width)),t.height!==void 0&&n.searchParams.set("height",String(t.height)),t.crop&&n.searchParams.set("crop",t.crop),n.toString()}catch{return e}}function we(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e/1e3),n=Math.floor(t/86400),o=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),a=t%60,i=l=>String(l).padStart(2,"0");return n>0?`${n}d ${i(o)}h ${i(r)}m ${i(a)}s`:`${i(o)}h ${i(r)}m ${i(a)}s`}function O(e){let t=mt(e);if(t===null||t<=Date.now())return null;let n=t,o=document.createElement("div");o.className="lb-bundle-countdown",o.setAttribute("data-countdown","");let r=document.createElement("div");r.className="lb-bundle-countdown__label";let a=document.createElement("span");a.textContent="Ends in",r.appendChild(a),o.appendChild(r);let i=document.createElement("span");i.className="lb-bundle-countdown__timer",i.setAttribute("data-countdown-timer",""),o.appendChild(i);let l=null;function d(){let u=n-Date.now();if(u<=0){o.style.display="none",c();return}i.textContent=we(u)}function c(){l!==null&&(clearInterval(l),l=null)}return d(),l=setInterval(d,1e3),{el:o,stop:c}}function mt(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function s(e,t,n={}){let o=document.createElement(e);t&&(o.className=t);for(let[r,a]of Object.entries(n))o.setAttribute(r,a);return o}var gt=`
|
|
203
|
+
<svg class="lb-bundle-placeholder-icon" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
204
|
+
<rect x="4" y="4" width="20" height="20" rx="3"></rect>
|
|
205
|
+
<line x1="4" y1="20" x2="24" y2="20"></line>
|
|
206
|
+
<circle cx="10" cy="12" r="2"></circle>
|
|
207
|
+
</svg>`;function _e(e,t,n,o){let r=t.widgetConfig,a=(w,B)=>{let h=t.variantQuantities[B];return h!==void 0?h:t.productQuantities[w]??1},i=[],l=0;if(t.products.forEach((w,B)=>{let h=ft(t,w,B);h.qty!==0&&(h.isOos&&(l++,r.outOfStockBehavior==="hide")||i.push(h))}),i.length===0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",c=s("div","lb-fixed",{"data-discount-type":t.discountConfig.discountType,"data-discount-value":String(t.discountConfig.discountValue)}),u=vt(t,d);if(c.appendChild(u.el),r.countdown.showCountdown&&t.endsAt){let w=O(t.endsAt);w&&(c.appendChild(w.el),o?.(w.stop))}let p=s("div","lb-fixed__products"),C=[];i.forEach(w=>{let B=Ct(w,d,a,()=>{S()});C.push(B),p.appendChild(B.el)}),c.appendChild(p),c.appendChild(s("div","lb-bundle-divider"));let b=yt(t);c.appendChild(b.el);let v=r.savingsBar.visible?wt():null;v&&c.appendChild(v.el);let f=_t(t,l,()=>{let w=i.filter(B=>B.selected).map(B=>({merchandiseId:B.selected.id,quantity:B.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}));w.length!==0&&n(w)});c.appendChild(f),c.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),c.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(c),S();function S(){let w=i.reduce((_,y)=>{if(!y.selected)return _;let T=R(y.selected.price.amount);return _+T*y.qty},0),B=Bt(w,t.discountConfig,i),h=Math.max(0,w-B);b.update({totalCents:w,saleCents:B,savingsCents:h,currency:d}),v&&v.update({savingsCents:h,currency:d}),u.refresh(xt(t,w,B,d))}}function ft(e,t,n){let o=e.selectedVariantIds?.[n]??null,r=t.variants.nodes.filter(p=>p.availableForSale),a=o&&o.length>0?r.filter(p=>o.includes(p.id)):r,i=a.length===0,l=a[0]??null,d=e.productQuantities[t.id]??1,u=(l?e.variantQuantities[l.id]:void 0)??d;return{product:t,eligibleVariants:a,selected:l,qty:u,isOos:i}}function vt(e,t){let n=e.widgetConfig,o=s("div","lb-bundle-header"),r=s("div","lb-bundle-header__content"),a=s("h3","lb-bundle-title");if(a.textContent=e.title,r.appendChild(a),e.description){let d=s("p","lb-bundle-subtitle");d.textContent=e.description,r.appendChild(d)}o.appendChild(r);let i=s("span","lb-bundle-header__badge",{"data-header-badge":""});o.appendChild(i);let l=K(e,e.productQuantities,n.pricing.showSaveBadge);return l.headerBadge?i.textContent=l.headerBadge:i.style.display="none",{el:o,refresh(d){if(!n.pricing.showSaveBadge){i.style.display="none";return}d?(i.textContent=d,i.style.display=""):i.style.display="none"}}}function xt(e,t,n,o){if(!e.widgetConfig.pricing.showSaveBadge)return"";let r=t-n;if(r<=0)return"";let a=e.discountConfig;return a.discountType==="percentage"&&a.discountValue>0?`-${Math.round(a.discountValue)}%`:a.discountType==="fixed_amount"&&a.discountValue>0?`-${k(Math.round(a.discountValue*100),o)}`:`-${k(r,o)}`}function Ct(e,t,n,o){let r=s("div",e.isOos?"lb-bundle-product-row lb-bundle-product-row--oos":"lb-bundle-product-row",{"data-product-id":e.product.id.replace(/^.*\//,""),...e.isOos?{"aria-disabled":"true"}:{}}),a=s("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.product.featuredImage){let c=document.createElement("img");c.src=U(e.product.featuredImage.url,{width:P,height:P,crop:"center"}),c.alt=e.product.featuredImage.altText??e.product.title,c.width=P,c.height=P,c.loading="lazy",a.appendChild(c)}else a.insertAdjacentHTML("beforeend",gt);let i=null;e.isOos||(i=s("span","lb-bundle-qty-badge",{"data-qty-badge":""}),i.textContent=String(e.qty),a.appendChild(i)),r.appendChild(a);let l=s("div","lb-bundle-product-info"),d=document.createElement("a");if(d.className="lb-bundle-product-name",d.href=`/products/${e.product.handle}`,d.textContent=e.product.title,l.appendChild(d),e.isOos){let c=s("span","lb-bundle-oos-label");c.textContent="Out of stock",l.appendChild(c)}else if(e.selected){let c=s("span","lb-bundle-product-prices"),u=s("span","lb-bundle-product-compare-price",{"data-product-compare-price":""}),p=s("span","lb-bundle-product-price",{"data-product-price":""});c.appendChild(u),c.appendChild(p),l.appendChild(c);let C=b=>{let v=R(b.price.amount);if(p.textContent=k(v,t),b.compareAtPrice){let f=R(b.compareAtPrice.amount);f>v?(u.textContent=k(f,t),u.removeAttribute("hidden")):u.setAttribute("hidden","")}else u.setAttribute("hidden","")};if(C(e.selected),e.eligibleVariants.length>1){let b=document.createElement("select");b.className="lb-bundle-variant-select",b.setAttribute("data-variant-select",""),b.setAttribute("aria-label",`Select variant for ${e.product.title}`),e.eligibleVariants.forEach(v=>{let f=document.createElement("option");f.value=v.id,f.textContent=v.title,v.id===e.selected?.id&&(f.selected=!0),b.appendChild(f)}),b.addEventListener("change",()=>{let v=e.eligibleVariants.find(f=>f.id===b.value);v&&(e.selected=v,e.qty=n(e.product.id,v.id),i&&(i.textContent=String(e.qty)),C(v),o())}),l.appendChild(b)}else if(e.eligibleVariants.length===1&&e.product.variants.nodes.length>1){let b=s("span","lb-bundle-variant-badge");b.textContent=e.eligibleVariants[0].title,l.appendChild(b)}}return r.appendChild(l),{el:r,state:e}}function yt(e){let t=s("div","lb-bundle-pricing"),n=s("span","lb-bundle-pricing__label");n.textContent="Bundle price",t.appendChild(n);let o=s("span","lb-bundle-pricing__prices"),r=s("span","lb-bundle-compare-price",{"data-compare-price":""});r.style.display="none",o.appendChild(r);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});return o.appendChild(a),t.appendChild(o),{el:t,update({totalCents:i,saleCents:l,savingsCents:d,currency:c}){a.textContent=k(l,c),e.widgetConfig.pricing.showCompareAtPrice&&d>0?(r.textContent=k(i,c),r.style.display=""):r.style.display="none"}}}function wt(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""}),t=document.createElement("span");t.textContent="You save",e.appendChild(t);let n=s("span","",{"data-savings-amount":""});return e.appendChild(n),{el:e,update({savingsCents:o,currency:r}){if(o<=0){e.style.display="none";return}e.style.display="",n.textContent=k(o,r)}}}function _t(e,t,n){let o=document.createElement("button");return o.type="button",o.className="lb-bundle-cta",o.setAttribute("data-add-bundle",""),t>0?(o.disabled=!0,o.textContent=`${t} item${t===1?"":"s"} out of stock`):(o.textContent=e.widgetConfig.cta.ctaText||"Add to cart",o.addEventListener("click",()=>{o.disabled||n()})),o}function Bt(e,t,n){if(t.discountType==="percentage"){let o=0;for(let r of n){if(!r.selected)continue;let a=R(r.selected.price.amount),i=Math.floor(a*t.discountValue/100),l=Math.max(0,a-i);o+=l*r.qty}return o}return Math.max(0,e-Math.round(t.discountValue*100))}var ke=`
|
|
208
|
+
<svg class="lb-bundle-placeholder-icon" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
209
|
+
<rect x="4" y="4" width="20" height="20" rx="3"></rect>
|
|
210
|
+
<line x1="4" y1="20" x2="24" y2="20"></line>
|
|
211
|
+
<circle cx="10" cy="12" r="2"></circle>
|
|
212
|
+
</svg>`,Se=`
|
|
213
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
214
|
+
<line x1="9" y1="3" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
215
|
+
<line x1="3" y1="9" x2="15" y2="9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
216
|
+
</svg>`,J=`
|
|
217
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
218
|
+
<line x1="5" y1="5" x2="15" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
219
|
+
<line x1="15" y1="5" x2="5" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
220
|
+
</svg>`,kt=`
|
|
221
|
+
<svg width="16" height="16" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
222
|
+
<path d="M14.348 5.652a.5.5 0 0 0-.707 0L10 9.293 6.36 5.652a.5.5 0 1 0-.708.707L9.293 10l-3.641 3.641a.5.5 0 0 0 .708.707L10 10.707l3.641 3.641a.5.5 0 0 0 .707-.707L10.707 10l3.641-3.641a.5.5 0 0 0 0-.707z"/>
|
|
223
|
+
</svg>`;function Te(e,t,n,o){let r=t.widgetConfig,a=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",i=t.minQuantity??1,l=t.maxQuantity??i,d=Mt(t,r.outOfStockBehavior);if(d.filter(m=>!m.isOos).length<i)return;let u=[],p=s("div","lb-mix-match",{"data-required-quantity":String(i),"data-max-quantity":String(l)}),C=St(t);if(p.appendChild(C),r.countdown.showCountdown&&t.endsAt){let m=O(t.endsAt);m&&(p.appendChild(m.el),o?.(m.stop))}let b=Tt(i);p.appendChild(b.el);let v=s("div","lb-mix-match__slots",{"data-selection-slots":""});p.appendChild(v),p.appendChild(s("div","lb-bundle-divider"));let f=Pt(r.pricing.showCompareAtPrice);p.appendChild(f.el);let S=r.savingsBar.visible?Rt():null;S&&p.appendChild(S.el);let w=s("div","lb-mix-match__price-placeholder",{"data-price-placeholder":""}),B=s("span","lb-mix-match__price-placeholder-text");B.textContent=`Select ${i} items to see price`,w.appendChild(B),p.appendChild(w);let h=Lt(t,d,a,{showSearch:r.showSearch,onAdd:(m,x)=>y(m,x),onRemove:(m,x)=>T(m,x),countFor:(m,x)=>u.filter(E=>E.productId===m&&E.variantId===x).length,isOverMax:()=>u.length>=l});p.appendChild(h.el);let _=document.createElement("button");_.type="button",_.className="lb-bundle-cta",_.setAttribute("data-add-bundle",""),_.disabled=!0,_.textContent=`Select ${i} items to unlock`,_.addEventListener("click",()=>{if(_.disabled)return;let m=u.map(x=>({merchandiseId:x.variantId,quantity:1,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}));n(m)}),p.appendChild(_),p.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),p.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(p),H();function y(m,x){u.length>=l||(u.push({productId:m.id,productTitle:m.title,variantId:x.id,variantTitle:x.title,imageUrl:m.featuredImage?.url??null,priceCents:R(x.price.amount),compareCents:x.compareAtPrice?R(x.compareAtPrice.amount):null}),F())}function T(m,x){let E=u.findIndex(V=>V.productId===m&&V.variantId===x);E!==-1&&(u.splice(E,1),F())}function L(m){m<0||m>=u.length||(u.splice(m,1),F())}function F(){H(),b.update(u.length),f.update(u,t,a),S&&S.update(u,t,a),w.style.display=u.length===0?"":"none",h.refreshCounts(),g()}function H(){v.innerHTML="";let m=Math.max(i,u.length);for(let x=0;x<m;x++){let E=u[x];E?v.appendChild(Et(E,x,a,()=>L(x))):v.appendChild(At(x,()=>h.open()))}}function g(){let m=u.length;m<i?(_.disabled=!0,_.textContent=`Select ${i-m} more to unlock`):(_.disabled=!1,_.textContent=r.cta.ctaText||"Add to cart")}}function St(e){let t=e.widgetConfig,n=s("div","lb-bundle-header"),o=s("div","lb-bundle-header__content"),r=s("h3","lb-bundle-title");if(r.textContent=e.title,o.appendChild(r),n.appendChild(o),t.pricing.showSaveBadge){let{discountType:a,discountValue:i}=e.discountConfig,l=null;if(a==="percentage"&&i>0?l=`-${Math.round(i)}%`:a==="fixed_amount"&&i>0&&(l=`-${k(Math.round(i*100),e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD")}`),l){let d=s("span","lb-bundle-header__badge");d.textContent=l,n.appendChild(d)}}return n}function Tt(e){let t=s("div","lb-mix-match__progress"),n=s("div","lb-mix-match__progress-labels"),o=s("span","lb-mix-match__progress-count",{"data-progress-count":""});o.textContent=`0 of ${e} selected`,n.appendChild(o);let r=s("span","lb-mix-match__progress-remaining",{"data-progress-remaining":""});r.textContent=`${e} more to go`,n.appendChild(r),t.appendChild(n);let a=s("div","lb-mix-match__progress-track",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)}),i=s("div","lb-mix-match__progress-fill",{"data-progress-fill":""});i.style.width="0%",a.appendChild(i),t.appendChild(a);function l(d){let c=Math.min(100,d/e*100);o.textContent=`${d} of ${e} selected`,d>=e?r.textContent="Complete":r.textContent=`${e-d} more to go`,i.style.width=`${c}%`,a.setAttribute("aria-valuenow",String(Math.min(d,e)))}return{el:t,update:l}}function At(e,t){let n=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--empty",{"data-slot":String(e+1),tabindex:"0",role:"button","aria-label":"Add a product to the bundle"}),o=s("div","lb-mix-match__empty-thumb");o.innerHTML=Se,n.appendChild(o);let r=s("span","lb-mix-match__empty-text");return r.textContent="Choose an item",n.appendChild(r),n.addEventListener("click",t),n.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())}),n}function Et(e,t,n,o){let r=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--filled",{"data-slot":String(t+1)}),a=s("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.imageUrl){let p=document.createElement("img");p.src=U(e.imageUrl,{width:P,height:P,crop:"center"}),p.alt=e.productTitle,p.width=P,p.height=P,p.loading="lazy",a.appendChild(p)}else a.insertAdjacentHTML("beforeend",ke);r.appendChild(a);let i=s("div","lb-mix-match__filled-info"),l=s("span","lb-mix-match__filled-title");if(l.textContent=e.productTitle,i.appendChild(l),e.variantTitle&&e.variantTitle!=="Default Title"){let p=s("span","lb-mix-match__filled-variant");p.textContent=e.variantTitle,i.appendChild(p)}let d=s("span","lb-mix-match__filled-price");if(e.compareCents&&e.compareCents>e.priceCents){let p=s("span","lb-mix-match__filled-compare");p.textContent=k(e.compareCents,n),d.appendChild(p)}let c=document.createElement("span");c.textContent=k(e.priceCents,n),d.appendChild(c),i.appendChild(d),r.appendChild(i);let u=document.createElement("button");return u.type="button",u.className="lb-mix-match__slot-remove",u.setAttribute("aria-label",`Remove ${e.productTitle}`),u.innerHTML=J,u.addEventListener("click",p=>{p.stopPropagation(),o()}),r.appendChild(u),r}function Pt(e){let t=s("div","lb-bundle-pricing",{"data-pricing-section":""});t.style.display="none";let n=s("span","lb-bundle-pricing__label");n.textContent="Bundle price",t.appendChild(n);let o=s("span","lb-bundle-pricing__prices"),r=s("span","lb-bundle-compare-price",{"data-compare-price":""});e&&o.appendChild(r);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});o.appendChild(a),t.appendChild(o);function i(l,d,c){if(l.length===0){t.style.display="none";return}t.style.display="";let u=l.reduce((C,b)=>C+b.priceCents,0),p=z(u,d.discountConfig);e&&u>p?(r.textContent=k(u,c),r.style.display=""):r.style.display="none",a.textContent=k(p,c)}return{el:t,update:i}}function Rt(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});e.style.display="none";let t=document.createElement("span");t.textContent="You save",e.appendChild(t);let n=s("span","",{"data-savings-amount":""});e.appendChild(n);function o(r,a,i){if(r.length===0){e.style.display="none";return}let l=r.reduce((u,p)=>u+p.priceCents,0),d=z(l,a.discountConfig),c=Math.max(0,l-d);if(c<=0){e.style.display="none";return}e.style.display="",n.textContent=k(c,i)}return{el:e,update:o}}function Lt(e,t,n,o){let r=s("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.id});r.style.display="none";let a=s("div","lb-mix-match__modal",{role:"dialog","aria-modal":"true","aria-labelledby":`lb-modal-title-${Be(e.id)}`,tabindex:"-1"}),i=s("div","lb-mix-match__modal-header"),l=s("h4","lb-mix-match__modal-title",{id:`lb-modal-title-${Be(e.id)}`});l.textContent="Pick an item",i.appendChild(l);let d=document.createElement("button");d.type="button",d.className="lb-mix-match__modal-close",d.setAttribute("data-modal-close",""),d.setAttribute("aria-label","Close"),d.innerHTML=J,d.addEventListener("click",L),i.appendChild(d),a.appendChild(i);let c=null,u=null;if(o.showSearch){let g=s("div","lb-mix-match__modal-search");c=document.createElement("input"),c.type="text",c.className="lb-mix-match__modal-search-input",c.setAttribute("data-modal-search",""),c.setAttribute("role","searchbox"),c.setAttribute("aria-label","Search products"),c.setAttribute("placeholder","Search products"),c.autocomplete="off",c.addEventListener("input",()=>B()),g.appendChild(c),u=document.createElement("button"),u.type="button",u.className="lb-mix-match__modal-search-clear",u.setAttribute("data-modal-search-clear",""),u.setAttribute("aria-label","Clear search"),u.style.display="none",u.innerHTML=kt,u.addEventListener("click",()=>{c&&(c.value="",B(),c.focus())}),g.appendChild(u),a.appendChild(g)}let p=s("div","lb-mix-match__modal-list",{"data-modal-list":""});a.appendChild(p);let C=s("div","lb-mix-match__modal-empty",{"data-modal-empty":""});C.style.display="none";let b=document.createElement("p");b.textContent="No products match your search.",C.appendChild(b),a.appendChild(C);let v=s("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"});a.appendChild(v),r.appendChild(a);let f=!1,S=[];function w(){f||(f=!0,p.innerHTML="",t.forEach(g=>{let m=g.firstAvailableVariant??g.variants[0];if(!m)return;let x=s("div",g.isOos?"lb-mix-match__modal-product lb-mix-match__modal-product--sold-out":"lb-mix-match__modal-product",{"data-product-id":g.product.id.replace(/^.*\//,"")}),E=s("div","lb-mix-match__modal-product-thumb");if(g.product.featuredImage){let A=document.createElement("img");A.src=U(g.product.featuredImage.url,{width:P,height:P,crop:"center"}),A.alt=g.product.featuredImage.altText??g.product.title,A.width=P,A.height=P,A.loading="lazy",E.appendChild(A)}else E.insertAdjacentHTML("beforeend",ke);x.appendChild(E);let V=s("div","lb-mix-match__modal-product-info"),Z=s("span","lb-mix-match__modal-product-title");Z.textContent=g.product.title,V.appendChild(Z);let ee=s("span","lb-mix-match__modal-product-price");if(ee.textContent=k(R(m.price.amount),n),V.appendChild(ee),g.isOos){let A=s("span","lb-mix-match__modal-sold-out-label");A.textContent="Sold out",V.appendChild(A)}if(x.appendChild(V),g.isOos)S.push({el:x,product:g.product,variant:m,updateCount:()=>{}});else{let A=document.createElement("button");A.type="button",A.className="lb-mix-match__modal-add",A.setAttribute("aria-label",`Add ${g.product.title}`),A.innerHTML=Se;let $=s("span","lb-bundle-qty-badge");$.style.display="none",A.appendChild($),A.addEventListener("click",()=>{o.isOverMax()||o.onAdd(g.product,m)}),x.appendChild(A);let I=document.createElement("button");I.type="button",I.className="lb-mix-match__slot-remove",I.setAttribute("aria-label",`Remove one ${g.product.title}`),I.style.display="none",I.innerHTML=J,I.addEventListener("click",N=>{N.stopPropagation(),o.onRemove(g.product.id,m.id)}),x.appendChild(I),S.push({el:x,product:g.product,variant:m,updateCount:()=>{let N=o.countFor(g.product.id,m.id);N>0?($.textContent=String(N),$.style.display="",I.style.display=""):($.style.display="none",I.style.display="none")}})}p.appendChild(x)}),H())}function B(){if(!c)return;let g=c.value.trim().toLowerCase();u&&(u.style.display=g?"":"none");let m=0;S.forEach(x=>{let E=!g||x.product.title.toLowerCase().includes(g);x.el.style.display=E?"":"none",E&&m++}),C.style.display=m===0&&g?"":"none"}let h=null;function _(g){if(g.key==="Escape"){g.preventDefault(),L();return}g.key==="Tab"&&It(g,a)}let y=!1;function T(){y||o.isOverMax()||(y=!0,w(),h=r.getRootNode().activeElement,r.style.display="",r.classList.add("lb-mix-match__modal-overlay--open"),a.focus(),document.addEventListener("keydown",_),r.addEventListener("click",F))}function L(){y&&(y=!1,r.classList.remove("lb-mix-match__modal-overlay--open"),r.style.display="none",document.removeEventListener("keydown",_),r.removeEventListener("click",F),h instanceof HTMLElement&&h.focus())}function F(g){g.target===r&&L()}function H(){S.forEach(g=>g.updateCount())}return{el:r,open:T,close:L,refreshCounts:H}}function Mt(e,t){let n=[],o=new Set;for(let r of e.products){if(o.has(r.id))continue;o.add(r.id);let a=r.variants.nodes.filter(l=>l.availableForSale),i=a.length===0;i&&t==="hide"||n.push({product:r,variants:r.variants.nodes,firstAvailableVariant:a[0]??null,isOos:i})}return n}function It(e,t){let n=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(n.length===0)return;let o=n[0],r=n[n.length-1],a=t.getRootNode().activeElement;e.shiftKey&&a===o?(e.preventDefault(),r.focus()):!e.shiftKey&&a===r&&(e.preventDefault(),o.focus())}function Be(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Re(e,t,n,o){let r=t.widgetConfig,i=t.products[0]?.variants.nodes.find(h=>h.availableForSale);if(!i&&r.outOfStockBehavior==="hide")return;let l=i?R(i.price.amount):0,d=i?.price.currencyCode??"USD",c=t.volumeTiers.map((h,_)=>{let y;if(h.discountType==="fixed_amount"){let T=Math.round(h.discountValue*100);y=Math.max(0,l-T)}else{let T=Math.floor(l*h.discountValue/100);y=Math.max(0,l-T)}return{tier:h,index:_,qty:h.minQuantity,pricePerUnitCents:y,basePricePerUnitCents:l}}),u=Ut(c),p=r.defaultTier==="best_value"?u:0;typeof r.defaultTier=="number"&&(p=Pe(r.defaultTier,0,c.length-1));let C=r.popularBadge.tierIndex!==void 0?Pe(r.popularBadge.tierIndex,0,c.length-1):u,b=s("div","lb-volume");if(b.appendChild(Ft(t,c,p,d)),r.countdown.showCountdown&&t.endsAt){let h=O(t.endsAt);h&&(b.appendChild(h.el),o?.(h.stop))}let v=s("div","lb-volume__tiers",{role:"radiogroup","aria-label":"Quantity tiers","data-tier-group":""});c.forEach(h=>{let _=Vt(h,h.index===p,d,r.popularBadge.visible&&h.index===C?r.popularBadge.text:null,r.pricing.showComparePrice,r.pricing.showPerUnitPrice);_.addEventListener("click",()=>B(h.index)),_.addEventListener("keydown",y=>{if(y.key==="Enter"||y.key===" "){y.preventDefault(),B(h.index);return}if(y.key==="ArrowDown"||y.key==="ArrowRight"||y.key==="ArrowUp"||y.key==="ArrowLeft"){y.preventDefault();let T=y.key==="ArrowDown"||y.key==="ArrowRight"?1:-1,L=(h.index+T+c.length)%c.length;B(L),v.children[L]?.focus()}}),v.appendChild(_)}),b.appendChild(v),b.appendChild(s("div","lb-bundle-divider"));let f=Ae(c,p,d,r.pricing.showItemCount,r.pricing.showCompareAtPrice);b.appendChild(f);let S=r.savingsBar.visible?Ee(c,p,d):null;S&&b.appendChild(S);let w=Dt(t,()=>{if(!i)return;let h=c[p];h&&n([{merchandiseId:i.id,quantity:h.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}])});b.appendChild(w),b.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),b.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(b);function B(h){if(h===p||h<0||h>=c.length)return;p=h,Array.from(v.children).forEach((T,L)=>{T.setAttribute("aria-checked",String(L===h)),T.tabIndex=L===h?0:-1});let _=Ae(c,h,d,r.pricing.showItemCount,r.pricing.showCompareAtPrice);if(f.replaceWith(_),f=_,S){let T=Ee(c,h,d);S.replaceWith(T),S=T}let y=b.querySelector("[data-header-badge]");if(y){let T=Le(c[h],d);T?(y.textContent=T,y.style.display=""):y.style.display="none"}}}function Ft(e,t,n,o){let r=e.widgetConfig,a=s("div","lb-bundle-header"),i=s("div","lb-bundle-header__content"),l=s("h3","lb-bundle-title");if(l.textContent=e.title,i.appendChild(l),a.appendChild(i),r.pricing.showSaveBadge){let d=Le(t[n],o);if(d){let c=s("span","lb-bundle-header__badge",{"data-header-badge":""});c.textContent=d,a.appendChild(c)}}return a}function Vt(e,t,n,o,r,a){let i=s("div","lb-volume__tier",{role:"radio","aria-checked":String(t),tabindex:t?"0":"-1","data-tier-index":String(e.index),"data-tier-qty":String(e.qty)}),l=s("span","lb-volume__radio");l.appendChild(s("span","lb-volume__radio-dot")),i.appendChild(l);let d=s("span","lb-volume__tier-grid"),c=s("span","lb-volume__tier-label");c.textContent=`Buy ${e.qty}`,d.appendChild(c);let u=s("span","lb-volume__tier-price");if(r&&e.pricePerUnitCents<e.basePricePerUnitCents){let C=s("span","lb-volume__tier-compare");C.textContent=k(e.basePricePerUnitCents,n),u.appendChild(C)}if(a){let C=document.createElement("span");C.setAttribute("data-tier-price-each",""),C.textContent=k(e.pricePerUnitCents,n),u.appendChild(C);let b=s("span","lb-volume__tier-unit");b.textContent=" each",u.appendChild(b)}d.appendChild(u),i.appendChild(d);let p=s("span","lb-volume__tier-badge");return o?p.textContent=o:p.style.display="none",i.appendChild(p),i}function Ae(e,t,n,o,r){let a=e[t],i=a?a.pricePerUnitCents*a.qty:0,l=a?a.basePricePerUnitCents*a.qty:0,d=Math.max(0,l-i),c=s("div","lb-bundle-pricing"),u=s("span","lb-bundle-pricing__label",{"data-total-label":""});if(u.textContent="Total",o&&a){let b=document.createElement("span");b.setAttribute("data-item-count",""),b.textContent=` (${a.qty} item${a.qty===1?"":"s"})`,u.appendChild(b)}c.appendChild(u);let p=s("span","lb-bundle-pricing__prices");if(r&&d>0){let b=s("span","lb-bundle-compare-price",{"data-compare-price":""});b.textContent=k(l,n),p.appendChild(b)}let C=s("span","lb-bundle-sale-price",{"data-total-price":""});return C.textContent=k(i,n),p.appendChild(C),c.appendChild(p),c}function Ee(e,t,n){let o=e[t],r=o?o.pricePerUnitCents*o.qty:0,a=o?o.basePricePerUnitCents*o.qty:0,i=Math.max(0,a-r),l=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});i<=0&&(l.style.display="none");let d=document.createElement("span");d.textContent="You save",l.appendChild(d);let c=s("span","",{"data-savings-amount":""});return c.textContent=k(i,n),l.appendChild(c),l}function Dt(e,t){let o=e.products[0]?.variants.nodes.some(a=>a.availableForSale),r=document.createElement("button");return r.type="button",r.className="lb-bundle-cta",r.setAttribute("data-add-bundle",""),o||(r.disabled=!0),r.textContent=o?e.widgetConfig.cta.ctaText||"Add to cart":"Sold out",r.addEventListener("click",()=>{r.disabled||t()}),r}function Le(e,t){if(!e)return null;let{tier:n}=e;return n.discountType==="fixed_amount"&&n.discountValue>0?`-${k(Math.round(n.discountValue*100),t)}`:n.discountType==="percentage"&&n.discountValue>0?`-${Math.round(n.discountValue)}%`:null}function Ut(e){let t=0,n=0;return e.forEach((o,r)=>{let a=o.basePricePerUnitCents-o.pricePerUnitCents;a>t&&(t=a,n=r)}),n}function Pe(e,t,n){return Math.max(t,Math.min(n,e))}var j=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
|
|
224
|
+
|
|
225
|
+
.lb-bundle-widget.lb-bundle-widget,
|
|
226
|
+
.lb-bundle-widget.lb-bundle-widget * {
|
|
227
|
+
line-height: normal;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.lb-bundle-widget {
|
|
231
|
+
/* Internal CSS-only vars (not merchant-configurable). */
|
|
232
|
+
--lb-text-muted: #666666;
|
|
233
|
+
--lb-thumbnail-bg: #F0F0F0;
|
|
234
|
+
--lb-widget-pad: 20px;
|
|
235
|
+
--lb-progress-color: var(--lb-primary-color);
|
|
236
|
+
|
|
237
|
+
font-family: inherit;
|
|
238
|
+
font-size: 16px;
|
|
239
|
+
background: var(--lb-bg);
|
|
240
|
+
border: var(--lb-border-width) solid var(--lb-border);
|
|
241
|
+
border-radius: var(--lb-radius);
|
|
242
|
+
padding: var(--lb-widget-pad) var(--lb-widget-pad) 20px;
|
|
243
|
+
box-sizing: border-box;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Countdown timer bar \u2014 sits below the gradient header */
|
|
247
|
+
.lb-bundle-countdown {
|
|
248
|
+
margin: 0 calc(-1 * var(--lb-widget-pad)) 20px;
|
|
249
|
+
padding: 12px 20px;
|
|
250
|
+
background: var(--lb-countdown-bg);
|
|
251
|
+
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: space-between;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.lb-bundle-countdown__label {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 8px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.lb-bundle-countdown__label svg {
|
|
264
|
+
width: 16px;
|
|
265
|
+
height: 16px;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
color: var(--lb-countdown-text);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.lb-bundle-countdown__label span {
|
|
271
|
+
font-size: 12px;
|
|
272
|
+
font-weight: 500;
|
|
273
|
+
line-height: 1;
|
|
274
|
+
color: var(--lb-countdown-text);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.lb-bundle-countdown__timer {
|
|
278
|
+
font-family: 'SF Mono', 'Roboto Mono', ui-monospace, monospace;
|
|
279
|
+
font-size: 12px;
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
line-height: 1;
|
|
282
|
+
color: var(--lb-countdown-text);
|
|
283
|
+
letter-spacing: 0.02em;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* Hide wrapper when the inner snippet rendered nothing (product OOS / unfulfillable) */
|
|
287
|
+
.lb-bundle-widget:not(:has(.lb-fixed, .lb-mix-match, .lb-volume)) {
|
|
288
|
+
display: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Adjacent widget spacing \u2014 separates multiple bundles on the same product page */
|
|
292
|
+
.lb-bundle-widget + .lb-bundle-widget {
|
|
293
|
+
margin-top: 24px;
|
|
294
|
+
padding-top: 24px;
|
|
295
|
+
border-top: 1px solid var(--lb-border);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Header \u2014 gradient banner with title + savings badge */
|
|
299
|
+
.lb-bundle-header {
|
|
300
|
+
margin: calc(-1 * var(--lb-widget-pad)) calc(-1 * var(--lb-widget-pad)) 20px;
|
|
301
|
+
padding: 20px 20px;
|
|
302
|
+
background: var(--lb-header-bg);
|
|
303
|
+
/* Match the widget's inner border curve so there's no background gap at the top corners. */
|
|
304
|
+
border-radius: max(0px, calc(var(--lb-radius) - var(--lb-border-width))) max(0px, calc(var(--lb-radius) - var(--lb-border-width))) 0 0;
|
|
305
|
+
display: flex;
|
|
306
|
+
align-items: center;
|
|
307
|
+
justify-content: space-between;
|
|
308
|
+
gap: 16px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* When countdown follows header, remove header bottom margin */
|
|
312
|
+
.lb-bundle-header:has(+ .lb-bundle-countdown) {
|
|
313
|
+
margin-bottom: 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.lb-bundle-header__content {
|
|
317
|
+
flex: 1;
|
|
318
|
+
min-width: 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.lb-bundle-title {
|
|
322
|
+
font-size: 20px;
|
|
323
|
+
font-weight: 700;
|
|
324
|
+
line-height: 28px;
|
|
325
|
+
letter-spacing: -0.02em;
|
|
326
|
+
color: var(--lb-text);
|
|
327
|
+
margin: 0;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.lb-bundle-header .lb-bundle-title {
|
|
331
|
+
color: var(--lb-header-text);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.lb-bundle-subtitle {
|
|
335
|
+
font-size: 16px;
|
|
336
|
+
font-weight: 400;
|
|
337
|
+
line-height: 20px;
|
|
338
|
+
color: var(--lb-text-muted);
|
|
339
|
+
margin: 4px 0 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.lb-bundle-header .lb-bundle-subtitle {
|
|
343
|
+
color: var(--lb-header-text);
|
|
344
|
+
opacity: 0.85;
|
|
345
|
+
margin-top: 8px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.lb-bundle-header:has(.lb-bundle-subtitle) {
|
|
349
|
+
align-items: flex-start;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.lb-bundle-header__badge {
|
|
353
|
+
background: var(--lb-save-badge-bg);
|
|
354
|
+
color: var(--lb-save-badge-text);
|
|
355
|
+
border: var(--lb-save-badge-border-width) solid var(--lb-save-badge-border-color);
|
|
356
|
+
font-size: 16px;
|
|
357
|
+
font-weight: 700;
|
|
358
|
+
line-height: 1;
|
|
359
|
+
padding: 4px 12px;
|
|
360
|
+
border-radius: var(--lb-save-badge-radius);
|
|
361
|
+
white-space: nowrap;
|
|
362
|
+
flex-shrink: 0;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Override Dawn's \`div:empty { display: none }\` reset for decorative elements */
|
|
366
|
+
.lb-bundle-divider:empty,
|
|
367
|
+
.lb-mix-match__progress-fill:empty {
|
|
109
368
|
display: block;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
--lb-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
.lb-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.lb-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.lb-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
.lb-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.lb-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* Divider */
|
|
372
|
+
.lb-bundle-divider {
|
|
373
|
+
height: 1px;
|
|
374
|
+
background: color-mix(in srgb, var(--lb-text) 7%, transparent);
|
|
375
|
+
margin: 16px 0;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Product rows */
|
|
379
|
+
.lb-bundle-product-row {
|
|
380
|
+
display: flex;
|
|
381
|
+
gap: 12px;
|
|
382
|
+
padding: 12px 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.lb-bundle-thumbnail {
|
|
386
|
+
position: relative;
|
|
387
|
+
width: 48px;
|
|
388
|
+
height: 48px;
|
|
389
|
+
min-width: 48px;
|
|
390
|
+
background: var(--lb-thumbnail-bg);
|
|
391
|
+
border-radius: 8px;
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
display: flex;
|
|
394
|
+
align-items: center;
|
|
395
|
+
justify-content: center;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.lb-bundle-thumbnail img {
|
|
399
|
+
width: 100%;
|
|
400
|
+
height: 100%;
|
|
401
|
+
object-fit: cover;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.lb-bundle-thumbnail svg {
|
|
405
|
+
width: 28px;
|
|
406
|
+
height: 28px;
|
|
407
|
+
color: #BBBBBB;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.lb-bundle-product-info {
|
|
411
|
+
flex: 1;
|
|
412
|
+
min-width: 0;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.lb-bundle-product-name {
|
|
416
|
+
font-size: 16px;
|
|
417
|
+
font-weight: 700;
|
|
418
|
+
line-height: 20px;
|
|
419
|
+
color: var(--lb-text);
|
|
420
|
+
margin: 0;
|
|
421
|
+
text-decoration: none;
|
|
422
|
+
display: block;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.lb-bundle-product-name:hover {
|
|
426
|
+
text-decoration: underline;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.lb-bundle-product-price {
|
|
430
|
+
/* --lb-product-price-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
431
|
+
display: var(--lb-product-price-display, block);
|
|
432
|
+
font-size: 12px;
|
|
433
|
+
font-weight: 400;
|
|
434
|
+
line-height: 20px;
|
|
435
|
+
color: var(--lb-text);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.lb-bundle-product-prices {
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: baseline;
|
|
441
|
+
gap: 6px;
|
|
442
|
+
flex-wrap: wrap;
|
|
443
|
+
margin-top: 2px;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.lb-bundle-product-compare-price {
|
|
447
|
+
/* --lb-product-compare-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
448
|
+
display: var(--lb-product-compare-display, inline);
|
|
449
|
+
font-size: 12px;
|
|
450
|
+
font-weight: 400;
|
|
451
|
+
line-height: 20px;
|
|
452
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
453
|
+
text-decoration: line-through;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/* Setting \`display\` above outranks the UA [hidden] rule \u2014 restore it so rows
|
|
457
|
+
without a compare-at price don't leave a phantom flex item + gap. */
|
|
458
|
+
.lb-bundle-product-compare-price[hidden] {
|
|
459
|
+
display: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.lb-bundle-variant-badge {
|
|
463
|
+
display: inline-block;
|
|
464
|
+
border: var(--lb-variant-border-width) solid var(--lb-variant-border-color);
|
|
465
|
+
border-radius: var(--lb-variant-radius);
|
|
466
|
+
padding: 8px 12px;
|
|
467
|
+
font-size: 12px;
|
|
468
|
+
line-height: 16px;
|
|
469
|
+
color: var(--lb-text-muted);
|
|
470
|
+
margin-top: 8px;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.lb-bundle-quantity {
|
|
474
|
+
font-size: 12px;
|
|
475
|
+
line-height: 16px;
|
|
476
|
+
color: var(--lb-text-muted);
|
|
477
|
+
margin-left: 8px;
|
|
478
|
+
white-space: nowrap;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* Pricing row \u2014 label left, prices right */
|
|
482
|
+
.lb-bundle-pricing {
|
|
483
|
+
display: flex;
|
|
484
|
+
align-items: baseline;
|
|
485
|
+
justify-content: space-between;
|
|
486
|
+
padding: 4px 0 8px;
|
|
487
|
+
gap: 12px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.lb-bundle-pricing__label {
|
|
491
|
+
font-size: 16px;
|
|
492
|
+
font-weight: 400;
|
|
493
|
+
line-height: 20px;
|
|
494
|
+
color: var(--lb-text);
|
|
495
|
+
white-space: nowrap;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.lb-bundle-pricing__prices {
|
|
499
|
+
display: flex;
|
|
500
|
+
align-items: baseline;
|
|
501
|
+
gap: 8px;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.lb-bundle-sale-price {
|
|
505
|
+
font-size: 20px;
|
|
506
|
+
font-weight: 700;
|
|
507
|
+
line-height: 1;
|
|
508
|
+
letter-spacing: -0.02em;
|
|
509
|
+
color: var(--lb-text);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.lb-bundle-compare-price {
|
|
513
|
+
font-size: 16px;
|
|
514
|
+
font-weight: 400;
|
|
515
|
+
line-height: 20px;
|
|
516
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
517
|
+
text-decoration: line-through;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/* Savings bar \u2014 green banner below pricing */
|
|
521
|
+
.lb-bundle-savings-bar {
|
|
522
|
+
display: flex;
|
|
523
|
+
align-items: center;
|
|
524
|
+
justify-content: space-between;
|
|
525
|
+
background: var(--lb-savings-bar-bg);
|
|
526
|
+
color: var(--lb-savings-bar-text);
|
|
527
|
+
border: var(--lb-savings-bar-border-width) solid var(--lb-savings-bar-border-color);
|
|
528
|
+
font-size: 16px;
|
|
529
|
+
font-weight: 600;
|
|
530
|
+
line-height: 20px;
|
|
531
|
+
padding: 12px 16px;
|
|
532
|
+
border-radius: var(--lb-savings-bar-radius);
|
|
533
|
+
margin-bottom: 12px;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* Quantity badge \u2014 overlay on thumbnail top-right */
|
|
537
|
+
.lb-bundle-qty-badge.lb-bundle-qty-badge {
|
|
538
|
+
position: absolute;
|
|
539
|
+
top: -8px;
|
|
540
|
+
right: -8px;
|
|
541
|
+
/* --lb-qty-badge-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
542
|
+
display: var(--lb-qty-badge-display, flex);
|
|
543
|
+
align-items: center;
|
|
544
|
+
justify-content: center;
|
|
545
|
+
width: 24px;
|
|
546
|
+
height: 24px;
|
|
547
|
+
border-radius: 50%;
|
|
548
|
+
background: var(--lb-qty-badge-bg);
|
|
549
|
+
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
550
|
+
color: var(--lb-qty-badge-color);
|
|
551
|
+
font-size: 12px;
|
|
552
|
+
font-weight: 700;
|
|
553
|
+
line-height: 0;
|
|
554
|
+
text-align: center;
|
|
555
|
+
z-index: 1;
|
|
556
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/* Override Dawn's \`div:empty\` for savings bar when hidden */
|
|
560
|
+
.lb-bundle-savings-bar:empty {
|
|
561
|
+
display: none;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/* CTA button */
|
|
565
|
+
.lb-bundle-cta {
|
|
566
|
+
display: block;
|
|
567
|
+
width: 100%;
|
|
568
|
+
padding: 16px;
|
|
569
|
+
border: var(--lb-cta-border-width) solid var(--lb-cta-border-color);
|
|
570
|
+
border-radius: var(--lb-cta-radius);
|
|
571
|
+
font-size: 16px;
|
|
572
|
+
font-weight: 600;
|
|
573
|
+
line-height: 20px;
|
|
574
|
+
cursor: pointer;
|
|
575
|
+
text-align: center;
|
|
576
|
+
transition: opacity 0.15s ease;
|
|
577
|
+
font-family: inherit;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.lb-bundle-cta:not(:disabled) {
|
|
581
|
+
background: var(--lb-primary-color);
|
|
582
|
+
color: var(--lb-btn-text);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.lb-bundle-cta:not(:disabled):hover {
|
|
586
|
+
opacity: 0.9;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.lb-bundle-cta:disabled {
|
|
590
|
+
background: color-mix(in srgb, var(--lb-primary-color) 35%, var(--lb-bg));
|
|
591
|
+
color: color-mix(in srgb, var(--lb-btn-text) 85%, transparent);
|
|
592
|
+
cursor: not-allowed;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.lb-bundle-cta[data-loading="true"] {
|
|
596
|
+
opacity: 0.7;
|
|
597
|
+
cursor: wait;
|
|
598
|
+
pointer-events: none;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* Error message */
|
|
602
|
+
.lb-bundle-error {
|
|
603
|
+
font-size: 16px;
|
|
604
|
+
color: #D72C0D;
|
|
605
|
+
margin-top: 8px;
|
|
606
|
+
display: none;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.lb-bundle-error[data-visible="true"] {
|
|
610
|
+
display: block;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* Visually hidden \u2014 accessible to screen readers only */
|
|
614
|
+
.lb-visually-hidden {
|
|
615
|
+
position: absolute !important;
|
|
616
|
+
width: 1px !important;
|
|
617
|
+
height: 1px !important;
|
|
618
|
+
padding: 0 !important;
|
|
619
|
+
margin: -1px !important;
|
|
620
|
+
overflow: hidden !important;
|
|
621
|
+
clip-path: inset(50%) !important;
|
|
622
|
+
white-space: nowrap !important;
|
|
623
|
+
border: 0 !important;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/* Placeholder SVG icon for missing images */
|
|
627
|
+
.lb-bundle-placeholder-icon {
|
|
628
|
+
width: 28px;
|
|
629
|
+
height: 28px;
|
|
630
|
+
stroke: #BBBBBB;
|
|
631
|
+
stroke-width: 1.5;
|
|
632
|
+
fill: none;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/* Out-of-stock product row */
|
|
636
|
+
.lb-bundle-product-row--oos {
|
|
637
|
+
opacity: 0.5;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.lb-bundle-oos-label {
|
|
641
|
+
font-size: 12px;
|
|
642
|
+
font-weight: 500;
|
|
643
|
+
color: #D72C0D;
|
|
644
|
+
white-space: nowrap;
|
|
645
|
+
margin-left: auto;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/* A/B test: hide save badge until JS swaps the label (prevents flash of default) */
|
|
649
|
+
.lb-ab-pending {
|
|
650
|
+
visibility: hidden;
|
|
651
|
+
}
|
|
652
|
+
`,Me=`/* Lime Bundles \u2014 Fixed bundle styles */
|
|
653
|
+
|
|
654
|
+
.lb-fixed__products {
|
|
655
|
+
display: flex;
|
|
656
|
+
flex-direction: column;
|
|
657
|
+
gap: 0;
|
|
658
|
+
margin: 0;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/* Fixed bundles: product rows */
|
|
662
|
+
.lb-fixed .lb-bundle-product-row {
|
|
663
|
+
gap: 16px;
|
|
664
|
+
align-items: center;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/* Fixed bundles: larger thumbnails */
|
|
668
|
+
.lb-fixed .lb-bundle-thumbnail {
|
|
669
|
+
width: 60px;
|
|
670
|
+
height: 60px;
|
|
671
|
+
min-width: 60px;
|
|
672
|
+
border-radius: var(--lb-image-border-radius);
|
|
673
|
+
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
674
|
+
box-sizing: border-box;
|
|
675
|
+
overflow: visible;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.lb-fixed .lb-bundle-thumbnail img {
|
|
679
|
+
border-radius: max(0px, calc(var(--lb-image-border-radius) - var(--lb-image-border-width)));
|
|
680
|
+
border: none;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/* Variant picker select \u2014 styled to match the variant badge aesthetic */
|
|
684
|
+
.lb-bundle-variant-select {
|
|
685
|
+
margin-top: 8px;
|
|
686
|
+
display: inline-block;
|
|
687
|
+
border: var(--lb-variant-border-width) solid var(--lb-variant-border-color);
|
|
688
|
+
border-radius: var(--lb-variant-radius);
|
|
689
|
+
padding: 8px 32px 8px 12px;
|
|
690
|
+
font-size: 12px;
|
|
691
|
+
line-height: 16px;
|
|
692
|
+
color: var(--lb-text);
|
|
693
|
+
background: var(--lb-bg);
|
|
694
|
+
font-family: inherit;
|
|
695
|
+
cursor: pointer;
|
|
696
|
+
appearance: none;
|
|
697
|
+
-webkit-appearance: none;
|
|
698
|
+
background-image: var(--lb-variant-chevron);
|
|
699
|
+
background-repeat: no-repeat;
|
|
700
|
+
background-position: right 8px center;
|
|
701
|
+
background-size: 12px;
|
|
702
|
+
max-width: 100%;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.lb-bundle-variant-select:focus-visible {
|
|
706
|
+
outline: 2px solid var(--lb-primary-color);
|
|
707
|
+
outline-offset: 2px;
|
|
708
|
+
}
|
|
709
|
+
`,Ie=`/* Lime Bundles \u2014 Mix & Match styles */
|
|
710
|
+
|
|
711
|
+
/* === Progress Bar === */
|
|
712
|
+
.lb-mix-match__progress {
|
|
713
|
+
margin-bottom: 16px;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.lb-mix-match__progress-labels {
|
|
717
|
+
display: flex;
|
|
718
|
+
justify-content: space-between;
|
|
719
|
+
margin-bottom: 8px;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.lb-mix-match__progress-count {
|
|
723
|
+
font-size: 12px;
|
|
724
|
+
font-weight: 500;
|
|
725
|
+
line-height: 16px;
|
|
726
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.lb-mix-match__progress-remaining {
|
|
730
|
+
font-size: 12px;
|
|
731
|
+
font-weight: 500;
|
|
732
|
+
line-height: 16px;
|
|
733
|
+
color: var(--lb-text);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.lb-mix-match__progress-track {
|
|
737
|
+
width: 100%;
|
|
738
|
+
height: 4px;
|
|
739
|
+
background: color-mix(in srgb, var(--lb-text) 10%, transparent);
|
|
740
|
+
border-radius: 4px;
|
|
741
|
+
overflow: hidden;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.lb-mix-match__progress-fill {
|
|
745
|
+
height: 100%;
|
|
746
|
+
background: var(--lb-text);
|
|
747
|
+
border-radius: 4px;
|
|
748
|
+
transition: width 0.3s ease;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/* === Slots === */
|
|
752
|
+
.lb-mix-match__slot {
|
|
753
|
+
cursor: pointer;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.lb-mix-match .lb-bundle-product-row {
|
|
757
|
+
align-items: center;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.lb-mix-match__slot--empty:focus-visible {
|
|
761
|
+
outline: 2px solid var(--lb-primary-color);
|
|
762
|
+
outline-offset: 2px;
|
|
763
|
+
border-radius: 8px;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.lb-mix-match__slot--empty .lb-mix-match__empty-thumb {
|
|
767
|
+
width: 60px;
|
|
768
|
+
height: 60px;
|
|
769
|
+
min-width: 60px;
|
|
770
|
+
border: var(--lb-image-border-width) dashed color-mix(in srgb, var(--lb-text) 20%, transparent);
|
|
771
|
+
border-radius: var(--lb-image-border-radius);
|
|
772
|
+
box-sizing: border-box;
|
|
773
|
+
display: flex;
|
|
774
|
+
align-items: center;
|
|
775
|
+
justify-content: center;
|
|
776
|
+
color: color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
.lb-mix-match__empty-text {
|
|
780
|
+
font-size: 16px;
|
|
781
|
+
line-height: 20px;
|
|
782
|
+
color: color-mix(in srgb, var(--lb-text) 45%, transparent);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/* Filled slot */
|
|
786
|
+
.lb-mix-match__slot--filled {
|
|
787
|
+
cursor: default;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.lb-mix-match .lb-bundle-thumbnail {
|
|
791
|
+
width: 60px;
|
|
792
|
+
height: 60px;
|
|
793
|
+
min-width: 60px;
|
|
794
|
+
border-radius: var(--lb-image-border-radius);
|
|
795
|
+
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
796
|
+
box-sizing: border-box;
|
|
797
|
+
overflow: visible;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.lb-mix-match .lb-bundle-thumbnail img {
|
|
801
|
+
border-radius: max(0px, calc(var(--lb-image-border-radius) - var(--lb-image-border-width)));
|
|
802
|
+
border: none;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
.lb-mix-match__slot--filled .lb-mix-match__filled-info {
|
|
806
|
+
flex: 1;
|
|
807
|
+
min-width: 0;
|
|
808
|
+
display: flex;
|
|
809
|
+
flex-direction: column;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.lb-mix-match__slot--filled .lb-mix-match__filled-title {
|
|
813
|
+
font-size: 16px;
|
|
814
|
+
font-weight: 700;
|
|
815
|
+
line-height: 20px;
|
|
816
|
+
color: var(--lb-text);
|
|
817
|
+
text-decoration: none;
|
|
818
|
+
overflow-wrap: break-word;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.lb-mix-match__slot--filled a.lb-mix-match__filled-title:hover {
|
|
822
|
+
text-decoration: underline;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.lb-mix-match__slot--filled .lb-mix-match__filled-variant {
|
|
826
|
+
font-size: 12px;
|
|
827
|
+
line-height: 20px;
|
|
828
|
+
margin-top: 2px;
|
|
829
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.lb-mix-match__filled-price {
|
|
833
|
+
/* --lb-product-price-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
834
|
+
display: var(--lb-product-price-display, block);
|
|
835
|
+
font-size: 12px;
|
|
836
|
+
line-height: 20px;
|
|
837
|
+
margin-top: 4px;
|
|
838
|
+
color: var(--lb-text);
|
|
839
|
+
font-weight: 500;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.lb-mix-match__filled-compare {
|
|
843
|
+
/* --lb-product-compare-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
844
|
+
display: var(--lb-product-compare-display, inline);
|
|
845
|
+
font-size: 12px;
|
|
846
|
+
font-weight: 400;
|
|
847
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
848
|
+
text-decoration: line-through;
|
|
849
|
+
margin-right: 4px;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
.lb-mix-match__slot-remove {
|
|
853
|
+
min-width: 44px;
|
|
854
|
+
min-height: 44px;
|
|
855
|
+
display: flex;
|
|
856
|
+
align-items: center;
|
|
857
|
+
justify-content: center;
|
|
858
|
+
background: none;
|
|
859
|
+
border: none;
|
|
860
|
+
cursor: pointer;
|
|
861
|
+
color: var(--lb-text);
|
|
862
|
+
padding: 0;
|
|
863
|
+
margin-left: auto;
|
|
864
|
+
border-radius: 8px;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.lb-mix-match__slot-remove:hover {
|
|
868
|
+
color: var(--lb-text);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.lb-mix-match__slot-remove:focus-visible {
|
|
872
|
+
outline: 2px solid var(--lb-primary-color);
|
|
873
|
+
outline-offset: 2px;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/* Price placeholder */
|
|
877
|
+
.lb-mix-match__price-placeholder {
|
|
878
|
+
padding: 4px 0 16px;
|
|
879
|
+
text-align: center;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
.lb-mix-match__price-placeholder-text {
|
|
883
|
+
font-size: 16px;
|
|
884
|
+
color: var(--lb-text);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/* === Modal Overlay === */
|
|
888
|
+
.lb-mix-match__modal-overlay {
|
|
889
|
+
position: fixed;
|
|
890
|
+
top: 0;
|
|
891
|
+
left: 0;
|
|
892
|
+
right: 0;
|
|
893
|
+
bottom: 0;
|
|
894
|
+
background: rgba(0, 0, 0, 0.5);
|
|
895
|
+
z-index: 9999;
|
|
896
|
+
display: flex;
|
|
897
|
+
align-items: center;
|
|
898
|
+
justify-content: center;
|
|
899
|
+
opacity: 0;
|
|
900
|
+
transition: opacity 0.2s ease-out;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.lb-mix-match__modal-overlay--open {
|
|
904
|
+
opacity: 1;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/* === Modal Panel === */
|
|
908
|
+
.lb-mix-match__modal {
|
|
909
|
+
background: var(--lb-picker-bg);
|
|
910
|
+
color: var(--lb-picker-text);
|
|
911
|
+
border-radius: var(--lb-picker-radius);
|
|
912
|
+
border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
|
|
913
|
+
box-sizing: border-box;
|
|
914
|
+
width: 100%;
|
|
915
|
+
max-width: 480px;
|
|
916
|
+
max-height: 70vh;
|
|
917
|
+
display: flex;
|
|
918
|
+
flex-direction: column;
|
|
919
|
+
overflow: hidden;
|
|
920
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
|
|
921
|
+
transform: translateY(24px);
|
|
922
|
+
transition: transform 0.25s ease-out;
|
|
923
|
+
will-change: transform;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.lb-mix-match__modal-overlay--open .lb-mix-match__modal {
|
|
927
|
+
transform: translateY(0);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/* === Modal Header === */
|
|
931
|
+
.lb-mix-match__modal-header {
|
|
932
|
+
display: flex;
|
|
933
|
+
align-items: center;
|
|
934
|
+
justify-content: space-between;
|
|
935
|
+
padding: 20px 20px 12px;
|
|
936
|
+
flex-shrink: 0;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.lb-mix-match__modal-title {
|
|
940
|
+
font-size: 20px;
|
|
941
|
+
font-weight: 600;
|
|
942
|
+
line-height: 24px;
|
|
943
|
+
margin: 0;
|
|
944
|
+
color: inherit;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.lb-mix-match__modal-close {
|
|
948
|
+
min-width: 44px;
|
|
949
|
+
min-height: 44px;
|
|
950
|
+
display: flex;
|
|
951
|
+
align-items: center;
|
|
952
|
+
justify-content: center;
|
|
953
|
+
background: none;
|
|
954
|
+
border: none;
|
|
955
|
+
cursor: pointer;
|
|
956
|
+
color: var(--lb-picker-text);
|
|
957
|
+
border-radius: 8px;
|
|
958
|
+
padding: 0;
|
|
959
|
+
margin: -12px -12px -12px 0;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.lb-mix-match__modal-close:focus-visible {
|
|
963
|
+
outline: 2px solid var(--lb-primary-color);
|
|
964
|
+
outline-offset: 2px;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/* === Modal Search === */
|
|
968
|
+
.lb-mix-match__modal-search {
|
|
969
|
+
padding: 0 20px 12px;
|
|
970
|
+
position: relative;
|
|
971
|
+
flex-shrink: 0;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.lb-mix-match__modal-search-input {
|
|
975
|
+
width: 100%;
|
|
976
|
+
padding: 12px 40px 12px 16px;
|
|
977
|
+
border: var(--lb-picker-search-border-width) solid var(--lb-picker-search-border-color);
|
|
978
|
+
border-radius: var(--lb-picker-search-radius);
|
|
979
|
+
font-size: 16px;
|
|
980
|
+
line-height: 20px;
|
|
981
|
+
color: var(--lb-picker-text);
|
|
982
|
+
background: var(--lb-picker-bg);
|
|
983
|
+
box-sizing: border-box;
|
|
984
|
+
-webkit-appearance: none;
|
|
985
|
+
appearance: none;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.lb-mix-match__modal-search-input::placeholder {
|
|
989
|
+
color: color-mix(in srgb, var(--lb-picker-text) 50%, transparent);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.lb-mix-match__modal-search-input:focus {
|
|
993
|
+
outline: none;
|
|
994
|
+
box-shadow: 0 0 0 1px var(--lb-primary-color);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.lb-mix-match__modal-search-clear {
|
|
998
|
+
position: absolute;
|
|
999
|
+
right: 32px;
|
|
1000
|
+
/* Anchor to the input area only \u2014 parent has padding-bottom: 12px which would
|
|
1001
|
+
otherwise push a top:50% center down by 6px. */
|
|
1002
|
+
top: 0;
|
|
1003
|
+
bottom: 12px;
|
|
1004
|
+
min-width: 32px;
|
|
1005
|
+
min-height: 32px;
|
|
1006
|
+
display: flex;
|
|
1007
|
+
align-items: center;
|
|
1008
|
+
justify-content: center;
|
|
1009
|
+
background: none;
|
|
1010
|
+
border: none;
|
|
1011
|
+
cursor: pointer;
|
|
1012
|
+
color: var(--lb-picker-text);
|
|
1013
|
+
padding: 0;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/* === Modal Product List === */
|
|
1017
|
+
.lb-mix-match__modal-list {
|
|
1018
|
+
overflow-y: auto;
|
|
1019
|
+
flex: 1;
|
|
1020
|
+
padding: 0 20px;
|
|
1021
|
+
-webkit-overflow-scrolling: touch;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.lb-mix-match__modal-product {
|
|
1025
|
+
display: flex;
|
|
1026
|
+
align-items: center;
|
|
1027
|
+
gap: 12px;
|
|
1028
|
+
padding: 12px 0;
|
|
1029
|
+
border-bottom: 1px solid color-mix(in srgb, var(--lb-picker-text) 7%, transparent);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
.lb-mix-match__modal-product:last-child {
|
|
1033
|
+
border-bottom: none;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
.lb-mix-match__modal-product-thumb {
|
|
1037
|
+
position: relative;
|
|
1038
|
+
width: 48px;
|
|
1039
|
+
height: 48px;
|
|
1040
|
+
min-width: 48px;
|
|
1041
|
+
border-radius: var(--lb-picker-product-radius);
|
|
1042
|
+
border: var(--lb-picker-product-border-width) solid var(--lb-picker-product-border-color);
|
|
1043
|
+
box-sizing: border-box;
|
|
1044
|
+
overflow: visible;
|
|
1045
|
+
background: #F0F0F0;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/* Qty badge inside the picker modal inherits picker-product border (width + color) plus
|
|
1049
|
+
inverted picker bg/text for clear contrast against the modal \u2014 always stays round
|
|
1050
|
+
(the badge shape is independent of the thumbnail shape). */
|
|
1051
|
+
.lb-mix-match__modal-product-thumb .lb-bundle-qty-badge.lb-bundle-qty-badge {
|
|
1052
|
+
/* --lb-picker-qty-badge-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
1053
|
+
display: var(--lb-picker-qty-badge-display, flex);
|
|
1054
|
+
background: var(--lb-picker-qty-badge-bg);
|
|
1055
|
+
color: var(--lb-picker-qty-badge-color);
|
|
1056
|
+
border: var(--lb-picker-product-border-width) solid var(--lb-picker-product-border-color);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.lb-mix-match__modal-product-thumb img {
|
|
1060
|
+
width: 100%;
|
|
1061
|
+
height: 100%;
|
|
1062
|
+
object-fit: cover;
|
|
1063
|
+
border-radius: max(0px, calc(var(--lb-picker-product-radius) - var(--lb-picker-product-border-width)));
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.lb-mix-match__modal-product-info {
|
|
1067
|
+
flex: 1;
|
|
1068
|
+
min-width: 0;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.lb-mix-match__modal-product-title {
|
|
1072
|
+
font-size: 16px;
|
|
1073
|
+
font-weight: 700;
|
|
1074
|
+
line-height: 20px;
|
|
1075
|
+
color: inherit;
|
|
1076
|
+
margin: 0;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.lb-mix-match__modal-product-price {
|
|
1080
|
+
font-size: 12px;
|
|
1081
|
+
line-height: 20px;
|
|
1082
|
+
color: inherit;
|
|
1083
|
+
margin: 4px 0 0;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
.lb-mix-match__variant-select {
|
|
1087
|
+
font-size: 12px;
|
|
1088
|
+
margin: 4px 0 0;
|
|
1089
|
+
padding: 4px 24px 4px 8px;
|
|
1090
|
+
border: var(--lb-picker-variant-border-width) solid var(--lb-picker-variant-border-color);
|
|
1091
|
+
border-radius: var(--lb-picker-variant-radius);
|
|
1092
|
+
background-color: var(--lb-picker-bg);
|
|
1093
|
+
background-image: var(--lb-picker-variant-chevron);
|
|
1094
|
+
background-repeat: no-repeat;
|
|
1095
|
+
background-position: right 6px center;
|
|
1096
|
+
background-size: 12px;
|
|
1097
|
+
color: var(--lb-picker-text);
|
|
1098
|
+
font-family: inherit;
|
|
1099
|
+
min-height: 32px;
|
|
1100
|
+
cursor: pointer;
|
|
1101
|
+
max-width: 120px;
|
|
1102
|
+
appearance: none;
|
|
1103
|
+
-webkit-appearance: none;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.lb-mix-match__variant-select:focus-visible {
|
|
1107
|
+
outline: 2px solid var(--lb-primary-color);
|
|
1108
|
+
outline-offset: 2px;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
.lb-mix-match__modal-add {
|
|
1112
|
+
padding: 8px 20px;
|
|
1113
|
+
background: var(--lb-picker-add-bg);
|
|
1114
|
+
color: var(--lb-picker-add-label);
|
|
1115
|
+
border: var(--lb-picker-add-border-width) solid var(--lb-picker-add-border-color);
|
|
1116
|
+
border-radius: var(--lb-picker-add-radius);
|
|
1117
|
+
box-sizing: border-box;
|
|
1118
|
+
font-size: 12px;
|
|
1119
|
+
font-weight: 600;
|
|
1120
|
+
cursor: pointer;
|
|
1121
|
+
white-space: nowrap;
|
|
1122
|
+
flex-shrink: 0;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
.lb-mix-match__modal-add:hover {
|
|
1126
|
+
opacity: 0.9;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
.lb-mix-match__modal-add:focus-visible {
|
|
1130
|
+
outline: 2px solid var(--lb-primary-color);
|
|
1131
|
+
outline-offset: 2px;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.lb-mix-match__modal-add:disabled {
|
|
1135
|
+
background: color-mix(in srgb, var(--lb-picker-add-bg) 35%, var(--lb-picker-bg));
|
|
1136
|
+
color: color-mix(in srgb, var(--lb-picker-add-label) 85%, transparent);
|
|
1137
|
+
cursor: not-allowed;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
/* Sold out product row */
|
|
1141
|
+
.lb-mix-match__modal-product--sold-out {
|
|
1142
|
+
opacity: 0.5;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.lb-mix-match__modal-product--sold-out .lb-mix-match__modal-sold-out-label {
|
|
1146
|
+
font-size: 12px;
|
|
1147
|
+
color: inherit;
|
|
1148
|
+
font-weight: 500;
|
|
1149
|
+
white-space: nowrap;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/* === Modal Empty State === */
|
|
1153
|
+
.lb-mix-match__modal-empty {
|
|
1154
|
+
padding: 32px 20px;
|
|
1155
|
+
text-align: center;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.lb-mix-match__modal-empty p {
|
|
1159
|
+
margin: 0;
|
|
1160
|
+
font-size: 16px;
|
|
1161
|
+
color: var(--lb-picker-text);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/* Hidden utility for search filtering */
|
|
1165
|
+
.lb-hidden {
|
|
1166
|
+
display: none !important;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/* === Mobile Full-Screen Modal === */
|
|
1170
|
+
@media (max-width: 767px) {
|
|
1171
|
+
.lb-mix-match__modal-overlay {
|
|
1172
|
+
align-items: flex-end;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
.lb-mix-match__modal {
|
|
1176
|
+
max-width: 100%;
|
|
1177
|
+
max-height: 90vh;
|
|
1178
|
+
border-radius: 16px 16px 0 0;
|
|
1179
|
+
transform: translateY(100%);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
.lb-mix-match__modal-overlay--open .lb-mix-match__modal {
|
|
1183
|
+
transform: translateY(0);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/* === Reduced Motion === */
|
|
1188
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1189
|
+
.lb-mix-match__modal-overlay,
|
|
1190
|
+
.lb-mix-match__modal,
|
|
1191
|
+
.lb-mix-match__progress-fill {
|
|
1192
|
+
transition: none;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
`,Fe=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
|
|
1196
|
+
|
|
1197
|
+
.lb-volume__tiers {
|
|
1198
|
+
display: flex;
|
|
1199
|
+
flex-direction: column;
|
|
1200
|
+
gap: 12px;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
.lb-volume__tier {
|
|
1204
|
+
display: flex;
|
|
1205
|
+
align-items: center;
|
|
1206
|
+
gap: 12px;
|
|
1207
|
+
border: var(--lb-tier-border-width) solid var(--lb-tier-border-color);
|
|
1208
|
+
border-radius: var(--lb-tier-radius);
|
|
1209
|
+
padding: 12px 16px;
|
|
1210
|
+
cursor: pointer;
|
|
1211
|
+
position: relative;
|
|
1212
|
+
transition: border-color 0.15s ease;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.lb-volume__tier:hover {
|
|
1216
|
+
border-color: color-mix(in srgb, var(--lb-tier-border-color) 50%, black);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.lb-volume__tier:focus-visible {
|
|
1220
|
+
outline: 2px solid var(--lb-primary-color);
|
|
1221
|
+
outline-offset: 2px;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
.lb-volume__tier[aria-checked="true"] {
|
|
1225
|
+
border-color: var(--lb-tier-selected-border-color);
|
|
1226
|
+
outline: var(--lb-tier-selected-border-width) solid var(--lb-tier-selected-border-color);
|
|
1227
|
+
outline-offset: calc(-1 * var(--lb-tier-selected-border-width));
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
.lb-volume__radio {
|
|
1231
|
+
width: 20px;
|
|
1232
|
+
height: 20px;
|
|
1233
|
+
min-width: 20px;
|
|
1234
|
+
border: 2px solid var(--lb-text);
|
|
1235
|
+
border-radius: 50%;
|
|
1236
|
+
display: flex;
|
|
1237
|
+
align-items: center;
|
|
1238
|
+
justify-content: center;
|
|
1239
|
+
transition: border-color 0.15s ease;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
.lb-volume__tier[aria-checked="true"] .lb-volume__radio {
|
|
1243
|
+
border-color: var(--lb-text);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.lb-volume__radio-dot {
|
|
1247
|
+
width: 12px;
|
|
1248
|
+
height: 12px;
|
|
1249
|
+
border-radius: 50%;
|
|
1250
|
+
background: transparent;
|
|
1251
|
+
transition: background 0.15s ease;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
.lb-volume__tier[aria-checked="true"] .lb-volume__radio-dot {
|
|
1255
|
+
background: var(--lb-text);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/* Tier content: 2x2 grid layout */
|
|
1259
|
+
.lb-volume__tier-grid {
|
|
1260
|
+
flex: 1;
|
|
1261
|
+
display: grid;
|
|
1262
|
+
row-gap: 4px;
|
|
1263
|
+
align-items: center;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.lb-volume__tier-label {
|
|
1267
|
+
font-size: 16px;
|
|
1268
|
+
font-weight: 700;
|
|
1269
|
+
color: var(--lb-text);
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
.lb-volume__tier-badge {
|
|
1273
|
+
flex-shrink: 0;
|
|
1274
|
+
font-size: 12px;
|
|
1275
|
+
line-height: 16px;
|
|
1276
|
+
color: var(--lb-popular-badge-text);
|
|
1277
|
+
background: var(--lb-popular-badge-bg);
|
|
1278
|
+
border: var(--lb-popular-badge-border-width) solid var(--lb-popular-badge-border-color);
|
|
1279
|
+
border-radius: var(--lb-popular-badge-radius);
|
|
1280
|
+
padding: 4px 8px;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.lb-volume__tier-price {
|
|
1284
|
+
grid-column: 1 / -1;
|
|
1285
|
+
font-size: 12px;
|
|
1286
|
+
font-weight: 500;
|
|
1287
|
+
color: var(--lb-text);
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.lb-volume__tier-unit {
|
|
1291
|
+
font-size: 12px;
|
|
1292
|
+
color: var(--lb-text);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/* Compare-at (strikethrough) price */
|
|
1296
|
+
.lb-volume__tier-compare {
|
|
1297
|
+
font-size: 12px;
|
|
1298
|
+
line-height: 16px;
|
|
1299
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1300
|
+
text-decoration: line-through;
|
|
1301
|
+
margin-right: 4px;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
`;var Ot=e=>`lb_cart_id:${e}`;function Ht(e){if(e)return e.trim()||null;if(typeof document<"u"){let t=document.querySelector('meta[name="shopify:product-handle"]');if(t?.content)return t.content.trim()||null}if(typeof window<"u"){let t=window.location.pathname.match(/\/products\/([^/?#]+)/);if(t?.[1])return decodeURIComponent(t[1])}return null}var q=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","app-url","analytics","locale"];shadow;bundles=[];abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.fetchBundle()}disconnectedCallback(){this.abortController?.abort(),this.teardownImpressions(),this.teardownRenderers()}teardownImpressions(){for(let t of this.impressionCleanups)t();this.impressionCleanups=[]}teardownRenderers(){for(let t of this.renderCleanups)t();this.renderCleanups=[]}attributeChangedCallback(t,n,o){n===o||!this.isConnected||(t==="bundle-gid"||t==="product-handle"||t==="shop-domain"||t==="storefront-token")&&this.shopDomain&&this.storefrontToken&&this.fetchBundle()}get shopDomain(){return this.getAttribute("shop-domain")??""}get storefrontToken(){return this.getAttribute("storefront-token")??""}get bundleGid(){return this.getAttribute("bundle-gid")??""}get productHandleAttr(){return this.getAttribute("product-handle")??""}get appUrl(){return this.getAttribute("app-url")??""}get analyticsEnabled(){return this.getAttribute("analytics")!=="false"}async fetchBundle(){if(!this.shopDomain||!this.storefrontToken){this.renderError("Missing required attributes: shop-domain, storefront-token");return}this.abortController?.abort();let t=new AbortController;this.abortController=t,this.renderLoading();let n=Q({shopDomain:this.shopDomain,accessToken:this.storefrontToken});try{let o,r=!1;if(this.bundleGid)r=!0,o=this.fetchSingleBundle(n,t.signal);else{let l=Ht(this.productHandleAttr);if(!l){this.teardownImpressions(),this.renderError("No bundle-gid or product-handle provided, and the current URL doesn't match /products/<handle>.");return}o=this.fetchProductBundles(n,t.signal,l)}let a=n.query(le,void 0,{signal:t.signal}).catch(()=>null);if(await o,t.signal.aborted)return;if(r&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let i=await a;if(i?.shop?.metafield?.value){Ce(this.shopDomain,i.shop.metafield.value);let l=X(i.shop.metafield.value);l.ok&&(this.shopCustomCss=l.css)}await this.applyABVariants(),this.renderBundles()}catch(o){if(t.signal.aborted)return;this.bundles=[],this.teardownImpressions(),this.renderError(o instanceof Error?o.message:"Failed to load bundle")}}async applyABVariants(){if(!this.appUrl||this.bundles.length===0)return;let t=await Promise.all(this.bundles.map(async n=>{if(!n.abTestId||!n.abVariantB)return n;try{if((await xe(this.appUrl,this.shopDomain,n.abTestId,n.id))?.variant==="B")return be(n)}catch(o){console.warn(`[lime-bundle] A/B assignment failed for bundle ${n.id}; falling back to Variant A.`,o)}return n}));this.bundles=t}async fetchSingleBundle(t,n){let o=await t.query(de,{id:this.bundleGid},{signal:n});if(!o.metaobject){this.bundles=[];return}let r=Y(o.metaobject.id,o.metaobject.fields);this.bundles=r?[r]:[]}async fetchProductBundles(t,n,o){let r=await t.query(se,{handle:o},{signal:n});if(!r.product){this.bundles=[];return}let a=r.product.metafield?.references?.nodes??[],i=[];for(let l of a){let d=Y(l.id,l.fields);d&&i.push(d)}this.bundles=i}handleAddToCart=async(t,n)=>{let o=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:n},bubbles:!0,composed:!0,cancelable:!0}),r=this.dispatchEvent(o);this.reportAddToCartEvent(t,n),r&&await this.defaultAddToCart(n)};async defaultAddToCart(t){if(typeof window>"u")return;let n=Q({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),o=window.localStorage,r=Ot(this.shopDomain),a=o?.getItem(r)??null;try{let i=null;if(a){let d=(await n.query(ue,{cartId:a,lines:t})).cartLinesAdd;d?.userErrors?.length?o?.removeItem(r):d?.cart&&(i=d.cart.checkoutUrl)}if(!i){let d=(await n.query(ce,{input:{lines:t}})).cartCreate;d?.cart&&(o?.setItem(r,d.cart.id),i=d.cart.checkoutUrl)}i?window.location.assign(i):this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:"Cart creation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}catch(i){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:i instanceof Error?i.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}reportAddToCartEvent(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let o=n.reduce((a,i)=>a+i.quantity,0),r=n.reduce((a,i)=>{let d=t.products.find(u=>u.variants.nodes.some(p=>p.id===i.merchandiseId))?.variants.nodes.find(u=>u.id===i.merchandiseId),c=d?parseFloat(d.price.amount):0;return a+c*i.quantity},0);me({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:o,totalPrice:Math.round(r*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[j,Me,Ie,Fe].join(`
|
|
1306
|
+
`),this.shadow.appendChild(t),this.shopCustomCss){let o=document.createElement("style");o.setAttribute("data-lime-bundles","shop-custom-css"),o.textContent=this.shopCustomCss,this.shadow.appendChild(o)}for(let o of this.bundles){let r=document.createElement("div");r.className="lb-bundle-widget",r.setAttribute("role","region"),r.setAttribute("aria-label",o.title),r.setAttribute("data-bundle-type",o.bundleType),r.setAttribute("data-bundle-gid",o.id),pe(r,o.widgetConfig);let a=l=>this.handleAddToCart(o,l),i=l=>this.renderCleanups.push(l);switch(o.bundleType){case"fixed":_e(r,o,a,i);break;case"mix_match":Te(r,o,a,i);break;case"volume":Re(r,o,a,i);break}this.shadow.appendChild(r),this.setupImpressionFor(o,r)}let n=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(o=>o.bundleType),bundleType:n?.bundleType,title:n?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let o=ge(n,()=>{he({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(o)}renderLoading(){this.shadow.innerHTML=`
|
|
1307
|
+
<style>${j}</style>
|
|
1308
|
+
<div class="lb-bundle-widget lb-bundle-widget--loading" aria-busy="true">
|
|
173
1309
|
<div class="lb-skeleton lb-skeleton--title"></div>
|
|
174
1310
|
<div class="lb-skeleton lb-skeleton--products"></div>
|
|
175
1311
|
</div>
|
|
176
|
-
`}renderError(
|
|
1312
|
+
`}renderError(t){this.shadow.innerHTML="",this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:t,code:"LOAD_ERROR"},bubbles:!0,composed:!0}))}render(){this.shadow.innerHTML=`<style>${j}</style>`}};typeof customElements<"u"&&!customElements.get("lime-bundle")&&customElements.define("lime-bundle",q);return $e($t);})();
|
|
177
1313
|
//# sourceMappingURL=lime-bundle.global.js.map
|