@lime-bundles/widget 3.3.0 → 3.4.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.
@@ -1,4 +1,4 @@
1
- "use strict";var LimeBundles=(()=>{var Me=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Yt=(e,t)=>{for(var r in t)Me(e,r,{get:t[r],enumerable:!0})},Xt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Kt(t))!Gt.call(e,n)&&n!==r&&Me(e,n,{get:()=>t[n],enumerable:!(o=Qt(t,n))||o.enumerable});return e};var Jt=e=>Xt(Me({},"__esModule",{value:!0}),e);var Un={};Yt(Un,{LimeBundleElement:()=>fe,trackInputMode:()=>Le});var Zt=Object.defineProperty,ot=(e,t)=>{for(var r in t)Zt(e,r,{get:t[r],enumerable:!0})},Ge=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},er="2025-10";async function tr(e){if(e)return typeof e=="function"?await e():e}function it(e){return!!(e.country||e.language||e.buyer)}function De(e){let t=e.apiVersion??er,r=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(o,n,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 tr(e.buyer),s={...n??{}};e.country&&(s.country=e.country),e.language&&(s.language=e.language),l&&(s.buyer=l);let d=await fetch(r,{method:"POST",headers:i,body:JSON.stringify({query:o,variables:s}),signal:a?.signal});if(!d.ok)throw new Ge([{message:`Storefront API error: ${d.status} ${d.statusText}`}]);let p=await d.json();if(p.errors?.length)throw new Ge(p.errors);return p.data}}}function at(e){return e.replace(/query\s+(\w+)\s*(?:\(([^)]*)\))?\s*\{/,(t,r,o)=>{let n=(o||"").trim(),a="$country: CountryCode, $language: LanguageCode, $buyer: BuyerInput",i=n?`${n}, ${a}`:a;return`query ${r}(${i}) @inContext(country: $country, language: $language, buyer: $buyer) {`})}var lt=`#graphql
1
+ "use strict";var LimeBundles=(()=>{var Me=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Qt=Object.prototype.hasOwnProperty;var Gt=(e,t)=>{for(var r in t)Me(e,r,{get:t[r],enumerable:!0})},Kt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of jt(t))!Qt.call(e,n)&&n!==r&&Me(e,n,{get:()=>t[n],enumerable:!(o=zt(t,n))||o.enumerable});return e};var Yt=e=>Kt(Me({},"__esModule",{value:!0}),e);var Un={};Gt(Un,{LimeBundleElement:()=>fe,trackInputMode:()=>Le});var Xt=Object.defineProperty,ot=(e,t)=>{for(var r in t)Xt(e,r,{get:t[r],enumerable:!0})},Ke=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},Jt="2025-10";async function Zt(e){if(e)return typeof e=="function"?await e():e}function it(e){return!!(e.country||e.language||e.buyer)}function De(e){let t=e.apiVersion??Jt,r=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(o,n,i){let a={"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e.accessToken};e.buyerIp&&(a["Shopify-Storefront-Buyer-IP"]=e.buyerIp);let l=await Zt(e.buyer),d={...n??{}};e.country&&(d.country=e.country),e.language&&(d.language=e.language),l&&(d.buyer=l);let s=await fetch(r,{method:"POST",headers:a,body:JSON.stringify({query:o,variables:d}),signal:i?.signal});if(!s.ok)throw new Ke([{message:`Storefront API error: ${s.status} ${s.statusText}`}]);let p=await s.json();if(p.errors?.length)throw new Ke(p.errors);return p.data}}}function at(e){return e.replace(/query\s+(\w+)\s*(?:\(([^)]*)\))?\s*\{/,(t,r,o)=>{let n=(o||"").trim(),i="$country: CountryCode, $language: LanguageCode, $buyer: BuyerInput",a=n?`${n}, ${i}`:i;return`query ${r}(${a}) @inContext(country: $country, language: $language, buyer: $buyer) {`})}var lt=`#graphql
2
2
  query BundleMetaobject($id: ID!) {
3
3
  metaobject(id: $id) {
4
4
  id
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
  }
100
- `,st=`#graphql
100
+ `,dt=`#graphql
101
101
  query ShopCustomCss {
102
102
  shop {
103
103
  metafield(namespace: "$app", key: "custom_css") {
@@ -105,7 +105,7 @@
105
105
  }
106
106
  }
107
107
  }
108
- `,dt=`#graphql
108
+ `,st=`#graphql
109
109
  query BundlesForProduct($handle: String!) {
110
110
  product(handle: $handle) {
111
111
  id
@@ -229,12 +229,12 @@
229
229
  userErrors { field message }
230
230
  }
231
231
  }
232
- `;var pt={min:1,max:99},ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},J={header:{textColor:"#555555",headerStyle:"solid",gradientStart:"#C1E67A",gradientEnd:"#B2D572",saveBadgeBgColor:"#C1E67A",saveBadgeTextColor:"#555555",saveBadgeBorderColor:"#555555",saveBadgeBorderWidth:2,saveBadgeBorderRadius:4,countdownBgColor:"#B2D57247",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:8},productList:{textColor:"#555555",imageBorderWidth:0,imageBorderColor:"#E5E5E5",imageBorderRadius:4,thumbnailRatio:"square",variantBorderWidth:1,variantBorderColor:"#E5E5E5",variantBorderRadius:4,showPrice:!0,showCompareAtPrice:!0,showCountBubble:!0,countBubbleBgColor:"#E9F1D9",countBubbleTextColor:"#555555"},pricing:{showSaveBadge:!0,showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#C1E67A",buttonTextColor:"#555555",borderWidth:0,borderColor:"#C1E67A",borderRadius:4},savingsBar:{visible:!0,bgColor:"#B2D57247",textColor:"#555555",borderWidth:0,borderColor:"#B2D57247",borderRadius:4},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},outOfStockBehavior:"show_greyed_out",showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:0,pickerBorderColor:"#E5E5E5",pickerBorderRadius:8,pickerSearchBorderWidth:1,pickerSearchBorderColor:"#E5E5E5",pickerSearchBorderRadius:8,pickerProductBorderWidth:0,pickerProductBorderColor:"#E5E5E5",pickerProductBorderRadius:8,pickerThumbnailRatio:"square",pickerShowCountBubble:!0,pickerCountBubbleBgColor:"#E9F1D9",pickerCountBubbleTextColor:"#555555",pickerAddBgColor:"#C1E67A",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#C1E67A",pickerAddBorderRadius:4,pickerVariantBorderWidth:1,pickerVariantBorderColor:"#555555",pickerVariantBorderRadius:4,pickerQtyStepperBorderWidth:1,pickerQtyStepperBorderColor:"#555555",pickerQtyStepperBorderRadius:4,tierBorderColor:"#E5E5E5",tierBorderWidth:1,tierBorderRadius:12,tierSelectedBorderColor:"#1A1A1A",tierSelectedBorderWidth:2,defaultTier:"first"};function rr(e){if(!e||typeof e!="object")return J;let t=e;return{...J,...t,defaultTier:nr(t.defaultTier),header:{...J.header,...t.header??{}},layout:{...J.layout,...t.layout??{}},productList:{...J.productList,...t.productList??{}},pricing:{...J.pricing,...t.pricing??{}},cta:{...J.cta,...t.cta??{}},savingsBar:{...J.savingsBar,...t.savingsBar??{}},countdown:{...J.countdown,...t.countdown??{}},popularBadge:{...J.popularBadge,...t.popularBadge??{}}}}function nr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:J.defaultTier}function or(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,thumbnailRatio:e.productList.thumbnailRatio,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,showLowStockBadge:e.showLowStockBadge,lowStockThreshold:e.lowStockThreshold,lowStockBgColor:e.lowStockBgColor,lowStockTextColor:e.lowStockTextColor,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,pickerThumbnailRatio:e.pickerThumbnailRatio,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,pickerQtyStepperBorderWidth:e.pickerQtyStepperBorderWidth,pickerQtyStepperBorderColor:e.pickerQtyStepperBorderColor,pickerQtyStepperBorderRadius:e.pickerQtyStepperBorderRadius,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 ir={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",pickerQtyStepperBorderWidth:"--lb-picker-qty-stepper-border-width",pickerQtyStepperBorderColor:"--lb-picker-qty-stepper-border-color",pickerQtyStepperBorderRadius:"--lb-picker-qty-stepper-radius"},ar=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","pickerQtyStepperBorderWidth","pickerQtyStepperBorderRadius"]);function bt(e,t){let r=or(t);for(let[a,i]of Object.entries(ir)){let l=r[a];if(l==null)continue;let s=ar.has(a)?`${l}px`:String(l);e.style.setProperty(i,s)}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"),e.style.setProperty("--lb-variant-chevron",Ye(t.productList.variantBorderColor)),e.style.setProperty("--lb-picker-variant-chevron",Ye(t.pickerVariantBorderColor)),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})`);let o=Xe(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-thumbnail-img-height",o.imgHeight);let n=Xe(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",n.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",n.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",n.imgHeight)}function Ye(e){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='${e.replace(/#/g,"%23")}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`}function Xe(e){switch(e){case"tall":return{aspectRatio:"3 / 4",imgFit:"cover",imgHeight:"100%"};case"wide":return{aspectRatio:"4 / 3",imgFit:"cover",imgHeight:"100%"};case"original":return{aspectRatio:"auto",imgFit:"contain",imgHeight:"auto"};default:return{aspectRatio:"1 / 1",imgFit:"cover",imgHeight:"100%"}}}var lr=new Set(["fixed","mix_match","volume"]),sr=new Set(["active"]);function Ve(e,t){try{return dr(e,t)}catch(r){if(r instanceof ae)return null;throw r}}function dr(e,t){let r=new Map(t.map(k=>[k.key,k])),o=r.get("title")?.value??"Bundle",n=r.get("bundle_type")?.value,a=r.get("status")?.value;if(!n||!lr.has(n))throw new ae(`Invalid or missing bundle_type: ${n??"null"}`,"invalid_type");let i=n;if(!a||!sr.has(a))throw new ae(`Bundle is not active: status=${a??"null"}`,"inactive");let l=a,s=r.get("starts_at")?.value??null,d=r.get("ends_at")?.value??null,p=new Date;if(s){let k=new Date(s);if(Number.isNaN(k.getTime()))throw new ae(`Invalid starts_at: ${s}`,"invalid_type");if(k>p)throw new ae(`Bundle not yet started: starts_at=${s}`,"not_started")}if(d){let k=new Date(d);if(Number.isNaN(k.getTime()))throw new ae(`Invalid ends_at: ${d}`,"invalid_type");if(k<p)throw new ae(`Bundle has expired: ends_at=${d}`,"expired")}let u=cr(r),C=ur(r),m=pr(r),g={id:e,title:o,description:r.get("description")?.value||null,status:l,products:u,discountConfig:C,widgetConfig:m,startsAt:s,endsAt:d,discountLabel:r.get("discount_label")?.value??null,selectedVariantIds:br(r),productQuantities:Je(r,"product_quantities"),variantQuantities:Je(r,"variant_quantities"),abTestId:r.get("ab_test_id")?.value??null,abVariantB:fr(r),marketVisibility:mr(r),marketIds:gr(r)};switch(i){case"fixed":return{...g,bundleType:"fixed"};case"volume":return{...g,bundleType:"volume",volumeTiers:vr(r)};case"mix_match":return{...g,bundleType:"mix_match",minQuantity:xr(r,"min_quantity",{min:1}),maxQuantity:null,productRules:hr(r)}}}function cr(e){let t=[],r=e.get("products");if(r?.reference&&"variants"in r.reference&&t.push(r.reference),r?.references?.nodes)for(let n of r.references.nodes)"variants"in n?t.push(n):"products"in n&&n.products?.nodes&&t.push(...n.products.nodes);let o=e.get("collection");if(o?.references?.nodes)for(let n of o.references.nodes)"products"in n&&n.products?.nodes&&t.push(...n.products.nodes);return t}function ur(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 pr(e){return rr(ce(e,"widget_config"))}function br(e){let t=ce(e,"selected_variant_ids");if(!Array.isArray(t))return null;let r=[];for(let o of t)Array.isArray(o)?r.push(o.filter(n=>typeof n=="string")):r.push([]);return r}function Je(e,t){let r=ce(e,t);if(!r||typeof r!="object"||Array.isArray(r))return{};let o={};for(let[n,a]of Object.entries(r)){let i=typeof a=="number"?a:Number(a);Number.isFinite(i)&&i>=0&&i<=99&&(o[n]=Math.floor(i))}return o}function hr(e){let t=ce(e,"product_rules");if(!t||typeof t!="object"||Array.isArray(t))return{};let r={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object"||Array.isArray(n))continue;let{min:a,max:i}=n,l=typeof a=="number"?a:Number(a),s=typeof i=="number"?i:Number(i);if(!Number.isFinite(l)||!Number.isFinite(s))continue;let d=Math.max(1,Math.min(99,Math.floor(l))),p=Math.max(d,Math.min(99,Math.floor(s)));r[o]={min:d,max:p}}return r}function mr(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function gr(e){let t=e.get("markets")?.value;if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.filter(o=>typeof o=="string"):[]}catch{return[]}}function fr(e){if(!e.get("ab_test_id")?.value)return null;let r={},o=e.get("ab_title")?.value;o&&(r.title=o);let n=e.get("ab_description")?.value;n&&(r.description=n);let a=e.get("ab_discount_type")?.value,i=e.get("ab_discount_value")?.value;if(a&&(a==="percentage"||a==="fixed_amount")&&i){let s=parseFloat(i);Number.isFinite(s)&&(r.discountConfig={discountType:a,discountValue:s,allowStacking:e.get("allow_stacking")?.value==="true"})}let l=ce(e,"ab_volume_tiers");return Array.isArray(l)&&(r.volumeTiers=l.filter(s=>typeof s=="object"&&s!==null).map(ht)),Object.keys(r).length===0?null:r}function vr(e){let t=ce(e,"volume_tiers");return Array.isArray(t)?t.filter(r=>typeof r=="object"&&r!==null).map(ht):[]}function ht(e){let t=Number(e.minQuantity??0),r={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(r.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(r.amount=e.amount),r}function ce(e,t){let r=e.get(t)?.value;if(!r)return null;try{return JSON.parse(r)}catch{return null}}function xr(e,t,r={}){let o=e.get(t)?.value;if(!o)return null;let n=parseInt(o,10);return isNaN(n)||r.min!==void 0&&n<r.min?null:n}function we(e,t,r){let o=e.variantQuantities[r];return o!==void 0?o:e.productQuantities[t]??1}function mt(e){let t=e.abVariantB;if(!t)return e;let r=t.title??e.title,o=t.description!==void 0?t.description:e.description,n=t.discountConfig??e.discountConfig;switch(e.bundleType){case"volume":return{...e,title:r,description:o,discountConfig:n,volumeTiers:t.volumeTiers??e.volumeTiers};case"mix_match":return{...e,title:r,description:o,discountConfig:n};case"fixed":return{...e,title:r,description:o,discountConfig:n}}}async function gt(e,t){await xt(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 ft(e,t){await xt(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function vt(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let r=new IntersectionObserver(o=>{for(let n of o)n.isIntersecting&&(t(),r.unobserve(n.target))},{threshold:.5});return r.observe(e),()=>r.disconnect()}async function xt(e,t){let r=`${e.appUrl}/api/analytics`,o=JSON.stringify(t);try{(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o})).ok||(await new Promise(a=>setTimeout(a,2e3)),await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(r,o)}catch{}}}var yr=!1;function wr(){return typeof document<"u"}function Cr(){if(!wr())return!1;if(yr)return!0;if(typeof window>"u")return!1;let e=window.Shopify;try{return e?.customerPrivacy?.analyticsProcessingAllowed?.()===!0}catch{return!1}}var Ze="lb_session",kr=720*60*60,_r=720*60*60;function yt(e){return`__Host-_lb_ab_${e}`}async function wt(e,t){if(typeof document>"u")return null;let r=Br(t);if(r&&r.testId===e)return{variant:r.variant,testId:e,persisted:!0};if(!Cr())return{variant:"A",testId:e,persisted:!1};let o=Er(),n=Tr(o,e);return Sr(t,e,n),{variant:n,testId:e,persisted:!0}}function Br(e){if(typeof document>"u")return null;let r=`${yt(e)}=`,n=document.cookie.split(";").map(s=>s.trim()).find(s=>s.startsWith(r));if(!n)return null;let a=n.substring(r.length),[i,l]=a.split("|");return i!=="A"&&i!=="B"||!l?null:{testId:l,variant:i}}function Sr(e,t,r){if(typeof document>"u")return;let o=yt(e),n=`${r}|${t}|${Date.now()}`;document.cookie=`${o}=${n}; Path=/; Max-Age=${_r}; SameSite=Lax; Secure`}function Er(){if(typeof document>"u")return et();let t=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${Ze}=`))?.split("=")[1];if(t)return t;let r=et();return document.cookie=`${Ze}=${r}; path=/; max-age=${kr}; SameSite=Lax; Secure`,r}function et(){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 Tr(e,t){let r=e+":"+t,o=2166136261;for(let n=0;n<r.length;n++)o^=r.charCodeAt(n),o=Math.imul(o,16777619);return(o>>>0)%2===0?"A":"B"}var tt=1e4,Ar=[[/@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"]],Lr=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function qe(e){if(e.length>tt)return{ok:!1,error:`CSS exceeds ${tt.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,(n,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[n,a]of Ar)if(n.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${a}`};let r=/url\s*\(\s*([\s\S]*?)\s*\)/gi,o;for(;(o=r.exec(t))!==null;){let n=o[1].trim();if((n.startsWith("'")||n.startsWith('"'))&&(n=n.slice(1)),(n.endsWith("'")||n.endsWith('"'))&&(n=n.slice(0,-1)),n=n.trim(),n&&!Lr.test(n))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Pr="lb-custom-css-";function Ct(e,t){if(typeof document>"u"||!t)return!1;let r=qe(t);if(!r.ok||!r.css.trim())return!1;let o=Pr+Mr(e),n=document.getElementById(o);return n||(n=document.createElement("style"),n.id=o,n.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(n)),n.textContent!==r.css&&(n.textContent=r.css),!0}function Mr(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function Ir(e,t){let r=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(r)}catch{return`${t} ${r.toFixed(2)}`}}var Rr={CL:"cl",CM:"cm",FLOZ:"fl oz",FT:"ft",FT2:"ft\xB2",G:"g",GAL:"gal",IN:"in",ITEM:"each",KG:"kg",L:"l",LB:"lb",M:"m",M2:"m\xB2",M3:"m\xB3",MG:"mg",ML:"ml",MM:"mm",OZ:"oz",PT:"pt",QT:"qt",UNKNOWN:"",YD:"yd"};function le(e,t,r){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let o=parseFloat(e.amount);if(!Number.isFinite(o))return null;let n=Rr[t.referenceUnit]??"";if(!n)return null;let a=e.currencyCode||r||"USD",i=Ir(o,a),l=t.referenceValue,s=l===1?n:`${l}${n}`;return`${i}/${s}`}function j(e){if(e==null)return 0;let t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.round(t*100):0}function D(e,t){try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e/100)}catch{return`${t} ${(e/100).toFixed(2)}`}}function kt(e,t){return Math.max(0,e-Math.floor(e*t/100))}function Oe(e,t=e.productQuantities,r=e.widgetConfig.pricing.showSaveBadge){let{discountType:o,discountValue:n}=e.discountConfig,a=[],i=0,l=0;for(let u of e.products){let C=u.variants.nodes.find(x=>x.availableForSale)??u.variants.nodes[0];if(!C)continue;let m=j(C.price.amount),g=t[u.id]??1,k=m*g,A=C.compareAtPrice?j(C.compareAtPrice.amount):null;if(a.push({unitCents:m,qty:g,lineCents:k,compareCents:A}),i+=k,o==="percentage"){let x=kt(m,n);l+=x*g}else l+=k}o==="fixed_amount"&&(l=Math.max(0,i-Math.round(n*100)));let s=Math.max(0,i-l),d=e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",p="";return r&&s>0&&(o==="percentage"&&n>0?p=`-${Math.round(n)}%`:o==="fixed_amount"&&n>0&&(p=`-${D(Math.round(n*100),d)}`)),{rows:a,totalCents:i,saleCents:l,savingsCents:s,headerBadge:p,currency:d}}function Ce(e,t){if(t.discountType==="percentage"){let r=Math.floor(e*t.discountValue/100);return Math.max(0,e-r)}return Math.max(0,e-Math.round(t.discountValue*100))}var U=152;function re(e,t={}){if(!e)return"";try{let r=new URL(e);return t.width!==void 0&&r.searchParams.set("width",String(t.width)),t.height!==void 0&&r.searchParams.set("height",String(t.height)),t.crop&&r.searchParams.set("crop",t.crop),r.toString()}catch{return e}}function _t(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e/1e3),r=Math.floor(t/86400),o=Math.floor(t%86400/3600),n=Math.floor(t%3600/60),a=t%60,i=l=>String(l).padStart(2,"0");return r>0?`${r}d ${i(o)}h ${i(n)}m ${i(a)}s`:`${i(o)}h ${i(n)}m ${i(a)}s`}var Fe={};ot(Fe,{computePosition:()=>Vr,emptyTypeAheadState:()=>Hr,handleKey:()=>Fr,pushTypeAheadChar:()=>Ur});var Dr=4;function Vr({trigger:e,viewportHeight:t,desiredHeight:r,margin:o=Dr,clip:n}){let a=n?Math.min(t,n.bottom):t,i=n?Math.max(0,n.top):0,l=Math.max(0,a-e.bottom-o),s=Math.max(0,e.top-i-o),d=r<=l?"down":s>l?"up":"down",u=Math.min(r,d==="down"?l:s),C=d==="down"?e.bottom+o:e.top-o-u;return{placement:d,maxHeight:u,offsetTop:C,offsetLeft:e.left,width:e.width}}var Ie={type:"passthrough",preventDefault:!1};function Re(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function rt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function qr(e,t){if(e.length===0)return-1;for(let r=1;r<=e.length;r++){let o=(t+r)%e.length;if(!e[o].disabled)return o}return t}function Or(e,t){if(e.length===0)return-1;for(let r=1;r<=e.length;r++){let o=(t-r+e.length)%e.length;if(!e[o].disabled)return o}return t}function nt(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Fr(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return Ie;let{key:r}=e,{isOpen:o,activeIndex:n,selectedIndex:a,options:i}=t;if(!o)switch(r){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:a>=0&&!i[a]?.disabled?a:Re(i),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:a>=0&&!i[a]?.disabled?a:rt(i),preventDefault:!0};default:return nt(r)?{type:"open",activeIndex:a>=0&&!i[a]?.disabled?a:Re(i),preventDefault:!0}:Ie}switch(r){case"ArrowDown":return{type:"move-active",activeIndex:qr(i,n),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Or(i,n),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Re(i),preventDefault:!0};case"End":return{type:"move-active",activeIndex:rt(i),preventDefault:!0};case"Enter":case" ":return n>=0&&!i[n]?.disabled?{type:"commit",index:n,preventDefault:!0}:{type:"passthrough",preventDefault:!0};case"Escape":return{type:"close",commit:!1,restoreFocus:!0,preventDefault:!0};case"Tab":return{type:"close",commit:!1,restoreFocus:!1,preventDefault:!1};default:return nt(r)?{type:"type-ahead",char:r,preventDefault:!1}:Ie}}var Nr=500;function Hr(){return{buffer:"",lastTime:0}}function Ur(e,t,r,o,n=Nr){if(t.length!==1)return{newState:e,matchedIndex:null};let i=(r-e.lastTime>n?"":e.buffer)+t.toLowerCase(),l={buffer:i,lastTime:r};for(let s=0;s<o.length;s++){let d=o[s];if(!d.disabled&&d.label.toLowerCase().startsWith(i))return{newState:l,matchedIndex:s}}return{newState:l,matchedIndex:null}}var $r={};ot($r,{findVariantByOptions:()=>Wr,isOptionValueAvailable:()=>zr,toPickerVariant:()=>jr});function Wr(e,t){if(e.length===0)return null;for(let r of e){if(r.optionValues.length!==t.length)continue;let o=!0;for(let n=0;n<r.optionValues.length;n++)if(r.optionValues[n]!==t[n]){o=!1;break}if(o)return r}return null}function zr(e,t,r,o){for(let n of e){if(!n.available||n.optionValues[t]!==r)continue;let a=!0;for(let i=0;i<n.optionValues.length;i++)if(i!==t&&n.optionValues[i]!==o[i]){a=!1;break}if(a)return!0}return!1}function jr(e){return{id:e.id,optionValues:e.selectedOptions.map(t=>t.value),available:e.availableForSale}}function Z(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null?!0:e.quantityAvailable>=t:!1}function ue(e,t,r,o){return!o||e.quantityAvailable==null||e.quantityAvailable<t?!1:e.quantityAvailable<=r}function Ne(e,t,r){if(!e.availableForSale)return 0;if(e.currentlyNotInStock)return Math.max(0,t-r);let o=e.quantityAvailable==null?Number.POSITIVE_INFINITY:e.quantityAvailable;return Math.max(0,Math.min(t,o)-r)}var{computePosition:Qr,emptyTypeAheadState:Kr,handleKey:Gr,pushTypeAheadChar:Yr}=Fe,Xr=32,Jr=8,Zr=8,K=[];function _e(e){let t=e.composedPath();for(let r=K.length-1;r>=0;r--){let o=K[r];!t.includes(o.shell)&&!t.includes(o.listbox)&&o.close()}}function Bt(){for(let e=K.length-1;e>=0;e--)K[e].close()}var Be=!1;function en(){Be||(document.addEventListener("pointerdown",_e,!0),window.addEventListener("scroll",_e,!0),window.addEventListener("resize",Bt),Be=!0)}function tn(){!Be||K.length>0||(document.removeEventListener("pointerdown",_e,!0),window.removeEventListener("scroll",_e,!0),window.removeEventListener("resize",Bt),Be=!1)}function ke(e){let t=[];for(let r=0;r<e.options.length;r++){let o=e.options[r];t.push({disabled:o.disabled,label:o.textContent||o.value})}return t}function rn(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function nn(e){let t=e.ownerDocument?.defaultView;if(!t)return null;let r=e.parentElement;for(;r&&r!==e.ownerDocument.body;){let n=t.getComputedStyle(r).overflowY;if(n==="auto"||n==="scroll"||n==="hidden")return r;r=r.parentElement}return null}var on=["lb-bundle-variant-select","lb-mix-match__variant-select"],an=on.map(e=>`select.${e}:not(.lb-dropdown-state)`).join(", ");function ln(e){let t=e;if(e.classList.contains("lb-dropdown-state"))return t.__lbDropdownInstance??null;let r=e.ownerDocument,o=e.getRootNode(),n=e.getAttribute("aria-label")??"",a=`lb-dd-${Math.random().toString(36).slice(2,9)}`;e.classList.add("lb-dropdown-state"),e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1");let i=r.createElement("div");i.className="lb-dropdown",i.setAttribute("data-lb-dropdown","");let l=r.createElement("button");l.type="button",l.className="lb-dropdown-trigger",l.setAttribute("role","combobox"),l.setAttribute("aria-haspopup","listbox"),l.setAttribute("aria-expanded","false");let s=`${a}-listbox`;l.setAttribute("aria-controls",s),n&&l.setAttribute("aria-label",n);let d=r.createElement("span");d.className="lb-dropdown-trigger-value";let p=r.createElement("span");p.className="lb-dropdown-chevron",p.setAttribute("aria-hidden","true"),l.appendChild(d),l.appendChild(p);let u=r.createElement("ul");u.id=s,u.className="lb-dropdown-listbox",u.setAttribute("role","listbox"),n&&u.setAttribute("aria-label",n),u.hidden=!0,i.appendChild(l),e.parentNode?.insertBefore(i,e.nextSibling);let C=e.closest("[data-modal-overlay]");C?(C.appendChild(u),u.setAttribute("data-lb-dropdown-portal","")):i.appendChild(u);let m=!1,g=-1,k=Kr(),A=[],x;function E(){l.disabled=e.disabled;let v=ke(e),b=e.selectedIndex;for(d.textContent=b>=0&&v[b]?v[b].label:"";u.firstChild;)u.removeChild(u.firstChild);A=[];for(let w=0;w<v.length;w++){let R=r.createElement("li");R.id=`${a}-opt-${w}`,R.className="lb-dropdown-option",R.setAttribute("role","option"),R.setAttribute("aria-selected",w===b?"true":"false"),v[w].disabled&&R.setAttribute("aria-disabled","true"),R.setAttribute("data-value",e.options[w].value),R.setAttribute("data-index",String(w)),R.textContent=v[w].label,u.appendChild(R),A.push(R)}}function _(v){if(g>=0&&A[g]&&A[g].classList.remove("is-active"),g=v,v>=0&&A[v]){let b=A[v];b.classList.add("is-active"),l.setAttribute("aria-activedescendant",b.id);let w=b.offsetTop,R=w+b.offsetHeight,ne=u.scrollTop,Y=ne+u.clientHeight;w<ne?u.scrollTop=w:R>Y&&(u.scrollTop=R-u.clientHeight)}else l.setAttribute("aria-activedescendant","")}function O(){let v=l.getBoundingClientRect();if(v.width===0)return!1;let w=Math.min(A.length||1,Zr)*Xr+Jr,R=nn(l),ne=R?(()=>{let ee=R.getBoundingClientRect();return{top:ee.top,bottom:ee.bottom}})():void 0,Y=Qr({trigger:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},viewportHeight:window.innerHeight,desiredHeight:w,clip:ne});return u.setAttribute("data-placement",Y.placement),u.style.maxHeight=`${Y.maxHeight}px`,u.hasAttribute("data-lb-dropdown-portal")&&(u.style.top=`${Y.offsetTop}px`,u.style.left=`${Y.offsetLeft}px`,u.style.width=`${Y.width}px`),!0}function h(){if(m)return;for(let w=K.length-1;w>=0;w--)K[w]!==x&&K[w].close();m=!0,u.hidden=!1,l.setAttribute("aria-expanded","true"),O()||requestAnimationFrame(()=>O());let v=ke(e),b=e.selectedIndex;b>=0&&v[b]&&!v[b].disabled?_(b):_(rn(v)),K.push(x),K.length===1&&en()}function M(v){if(!m)return;m=!1,u.hidden=!0,l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant",""),g>=0&&A[g]&&A[g].classList.remove("is-active"),g=-1;let b=K.indexOf(x);b>=0&&K.splice(b,1),K.length===0&&tn(),v&&l.focus()}function L(v){let b=e.options[v];if(!(!b||b.disabled)){if(e.value!==b.value){e.value=b.value;let w=new Event("change",{bubbles:!0});e.dispatchEvent(w)}E(),M(!0)}}function y(v){switch(v.type){case"open":h(),v.activeIndex>=0&&_(v.activeIndex);return;case"close":M(v.restoreFocus);return;case"move-active":_(v.activeIndex);return;case"commit":L(v.index);return;case"type-ahead":{let b=ke(e),w=Yr(k,v.char,Date.now(),b);k=w.newState,w.matchedIndex!==null&&(m||h(),_(w.matchedIndex));return}case"passthrough":return;default:{let b=v}}}function B(v){let b=ke(e),w=Gr({key:v.key,ctrlKey:v.ctrlKey,metaKey:v.metaKey,altKey:v.altKey,shiftKey:v.shiftKey},{isOpen:m,activeIndex:g,selectedIndex:e.selectedIndex,options:b});w.preventDefault&&v.preventDefault(),y(w)}function f(v){v.preventDefault(),m?M(!1):h()}function V(v){let b=v.target;for(;b&&b!==u;){if(b.classList?.contains("lb-dropdown-option")){let w=parseInt(b.getAttribute("data-index")??"",10);if(!Number.isNaN(w)){L(w);return}}b=b.parentElement}}function P(v){let b=v.target;for(;b&&b!==u;){if(b.classList?.contains("lb-dropdown-option")){if(b.getAttribute("aria-disabled")==="true")return;let w=parseInt(b.getAttribute("data-index")??"",10);!Number.isNaN(w)&&w!==g&&_(w);return}b=b.parentElement}}function T(){setTimeout(()=>{if(!m)return;let v=o.activeElement??r.activeElement;i.contains(v)||M(!1)},0)}function S(){E()}let I=new MutationObserver(()=>{E()});I.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});let F=v=>v.preventDefault();l.addEventListener("click",f),l.addEventListener("keydown",B),i.addEventListener("focusout",T),u.addEventListener("mousedown",F),u.addEventListener("click",V),u.addEventListener("mousemove",P),e.addEventListener("change",S);function te(){m&&M(!1),I.disconnect(),l.removeEventListener("click",f),l.removeEventListener("keydown",B),i.removeEventListener("focusout",T),u.removeEventListener("mousedown",F),u.removeEventListener("click",V),u.removeEventListener("mousemove",P),e.removeEventListener("change",S),i.parentNode&&i.parentNode.removeChild(i),u.parentNode&&u.parentNode.removeChild(u),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),delete t.__lbDropdownInstance}return x={shell:i,listbox:u,select:e,close:()=>M(!1),destroy:te},t.__lbDropdownInstance=x,E(),x}function Se(e){let t=e.querySelectorAll(an),r=[];return t.forEach(o=>{let n=ln(o);n&&r.push(n)}),r}function Ee(e){e.querySelectorAll("select.lb-dropdown-state").forEach(r=>{let o=r.__lbDropdownInstance;o&&o.destroy()})}function pe(e){let t=sn(e);if(t===null||t<=Date.now())return null;let r=t,o=document.createElement("div");o.className="lb-bundle-countdown",o.setAttribute("data-countdown","");let n=document.createElement("div");n.className="lb-bundle-countdown__label";let a=document.createElement("span");a.textContent="Ends in",n.appendChild(a),o.appendChild(n);let i=document.createElement("span");i.className="lb-bundle-countdown__timer",i.setAttribute("data-countdown-timer",""),o.appendChild(i);let l=null;function s(){let p=r-Date.now();if(p<=0){o.style.display="none",d();return}i.textContent=_t(p)}function d(){l!==null&&(clearInterval(l),l=null)}return s(),l=setInterval(s,1e3),{el:o,stop:d}}function sn(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function be(e){let t=document.createElement("button");t.type="button",t.className="lb-bundle-cta",t.setAttribute("data-add-bundle","");let r=document.createElement("span");r.className="lb-cta-label",r.setAttribute("data-cta-label",""),r.textContent=e,t.appendChild(r);let o=document.createElement("span");return o.className="lb-cta-spinner",o.setAttribute("data-cta-spinner",""),o.setAttribute("aria-hidden","true"),o.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 2a10 10 0 0 1 10 10" /></svg>',t.appendChild(o),t}function He(e,t){let r=e.querySelector("[data-cta-label]");r&&(r.textContent=t)}function c(e,t,r={}){let o=document.createElement(e);t&&(o.className=t);for(let[n,a]of Object.entries(r))o.setAttribute(n,a);return o}var dn=`
232
+ `;var pt={min:1,max:99},ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},J={header:{textColor:"#555555",headerStyle:"solid",gradientStart:"#C1E67A",gradientEnd:"#B2D572",saveBadgeBgColor:"#C1E67A",saveBadgeTextColor:"#555555",saveBadgeBorderColor:"#555555",saveBadgeBorderWidth:2,saveBadgeBorderRadius:4,countdownBgColor:"#B2D57247",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:8},productList:{textColor:"#555555",imageBorderWidth:0,imageBorderColor:"#E5E5E5",imageBorderRadius:4,thumbnailRatio:"square",variantBorderWidth:1,variantBorderColor:"#E5E5E5",variantBorderRadius:4,showPrice:!0,showCompareAtPrice:!0,showCountBubble:!0,countBubbleBgColor:"#E9F1D9",countBubbleTextColor:"#555555"},pricing:{showSaveBadge:!0,showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#C1E67A",buttonTextColor:"#555555",borderWidth:0,borderColor:"#C1E67A",borderRadius:4},savingsBar:{visible:!0,bgColor:"#B2D57247",textColor:"#555555",borderWidth:0,borderColor:"#B2D57247",borderRadius:4},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},outOfStockBehavior:"show_greyed_out",showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:0,pickerBorderColor:"#E5E5E5",pickerBorderRadius:8,pickerSearchBorderWidth:1,pickerSearchBorderColor:"#E5E5E5",pickerSearchBorderRadius:8,pickerProductBorderWidth:0,pickerProductBorderColor:"#E5E5E5",pickerProductBorderRadius:8,pickerThumbnailRatio:"square",pickerShowCountBubble:!0,pickerCountBubbleBgColor:"#E9F1D9",pickerCountBubbleTextColor:"#555555",pickerAddBgColor:"#C1E67A",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#C1E67A",pickerAddBorderRadius:4,pickerVariantBorderWidth:1,pickerVariantBorderColor:"#555555",pickerVariantBorderRadius:4,pickerQtyStepperBorderWidth:1,pickerQtyStepperBorderColor:"#555555",pickerQtyStepperBorderRadius:4,tierBorderColor:"#E5E5E5",tierBorderWidth:1,tierBorderRadius:12,tierSelectedBorderColor:"#1A1A1A",tierSelectedBorderWidth:2,defaultTier:"first"};function er(e){if(!e||typeof e!="object")return J;let t=e;return{...J,...t,defaultTier:tr(t.defaultTier),header:{...J.header,...t.header??{}},layout:{...J.layout,...t.layout??{}},productList:{...J.productList,...t.productList??{}},pricing:{...J.pricing,...t.pricing??{}},cta:{...J.cta,...t.cta??{}},savingsBar:{...J.savingsBar,...t.savingsBar??{}},countdown:{...J.countdown,...t.countdown??{}},popularBadge:{...J.popularBadge,...t.popularBadge??{}}}}function tr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:J.defaultTier}function rr(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,thumbnailRatio:e.productList.thumbnailRatio,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,showLowStockBadge:e.showLowStockBadge,lowStockThreshold:e.lowStockThreshold,lowStockBgColor:e.lowStockBgColor,lowStockTextColor:e.lowStockTextColor,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,pickerThumbnailRatio:e.pickerThumbnailRatio,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,pickerQtyStepperBorderWidth:e.pickerQtyStepperBorderWidth,pickerQtyStepperBorderColor:e.pickerQtyStepperBorderColor,pickerQtyStepperBorderRadius:e.pickerQtyStepperBorderRadius,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 nr={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",pickerQtyStepperBorderWidth:"--lb-picker-qty-stepper-border-width",pickerQtyStepperBorderColor:"--lb-picker-qty-stepper-border-color",pickerQtyStepperBorderRadius:"--lb-picker-qty-stepper-radius"},or=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","pickerQtyStepperBorderWidth","pickerQtyStepperBorderRadius"]);function bt(e,t){let r=rr(t);for(let[i,a]of Object.entries(nr)){let l=r[i];if(l==null)continue;let d=or.has(i)?`${l}px`:String(l);e.style.setProperty(a,d)}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"),e.style.setProperty("--lb-variant-chevron",Ye(t.productList.variantBorderColor)),e.style.setProperty("--lb-picker-variant-chevron",Ye(t.pickerVariantBorderColor)),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})`);let o=Xe(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-thumbnail-img-height",o.imgHeight);let n=Xe(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",n.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",n.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",n.imgHeight)}function Ye(e){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='${e.replace(/#/g,"%23")}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`}function Xe(e){switch(e){case"tall":return{aspectRatio:"3 / 4",imgFit:"cover",imgHeight:"100%"};case"wide":return{aspectRatio:"4 / 3",imgFit:"cover",imgHeight:"100%"};case"original":return{aspectRatio:"auto",imgFit:"contain",imgHeight:"auto"};default:return{aspectRatio:"1 / 1",imgFit:"cover",imgHeight:"100%"}}}var ir=new Set(["fixed","mix_match","volume"]),ar=new Set(["active"]);function qe(e,t){try{return lr(e,t)}catch(r){if(r instanceof ae)return null;throw r}}function lr(e,t){let r=new Map(t.map(k=>[k.key,k])),o=r.get("title")?.value??"Bundle",n=r.get("bundle_type")?.value,i=r.get("status")?.value;if(!n||!ir.has(n))throw new ae(`Invalid or missing bundle_type: ${n??"null"}`,"invalid_type");let a=n;if(!i||!ar.has(i))throw new ae(`Bundle is not active: status=${i??"null"}`,"inactive");let l=i,d=r.get("starts_at")?.value??null,s=r.get("ends_at")?.value??null,p=new Date;if(d){let k=new Date(d);if(Number.isNaN(k.getTime()))throw new ae(`Invalid starts_at: ${d}`,"invalid_type");if(k>p)throw new ae(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let k=new Date(s);if(Number.isNaN(k.getTime()))throw new ae(`Invalid ends_at: ${s}`,"invalid_type");if(k<p)throw new ae(`Bundle has expired: ends_at=${s}`,"expired")}let u=dr(r),C=sr(r),m=cr(r),g={id:e,title:o,description:r.get("description")?.value||null,status:l,products:u,discountConfig:C,widgetConfig:m,startsAt:d,endsAt:s,discountLabel:r.get("discount_label")?.value??null,selectedVariantIds:ur(r),productQuantities:Je(r,"product_quantities"),variantQuantities:Je(r,"variant_quantities"),linkGroup:mr(r),marketVisibility:br(r),marketIds:hr(r)};switch(a){case"fixed":return{...g,bundleType:"fixed"};case"volume":return{...g,bundleType:"volume",volumeTiers:gr(r)};case"mix_match":return{...g,bundleType:"mix_match",minQuantity:vr(r,"min_quantity",{min:1}),maxQuantity:null,productRules:pr(r)}}}function dr(e){let t=[],r=e.get("products");if(r?.reference&&"variants"in r.reference&&t.push(r.reference),r?.references?.nodes)for(let n of r.references.nodes)"variants"in n?t.push(n):"products"in n&&n.products?.nodes&&t.push(...n.products.nodes);let o=e.get("collection");if(o?.references?.nodes)for(let n of o.references.nodes)"products"in n&&n.products?.nodes&&t.push(...n.products.nodes);return t}function sr(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 cr(e){return er(ce(e,"widget_config"))}function ur(e){let t=ce(e,"selected_variant_ids");if(!Array.isArray(t))return null;let r=[];for(let o of t)Array.isArray(o)?r.push(o.filter(n=>typeof n=="string")):r.push([]);return r}function Je(e,t){let r=ce(e,t);if(!r||typeof r!="object"||Array.isArray(r))return{};let o={};for(let[n,i]of Object.entries(r)){let a=typeof i=="number"?i:Number(i);Number.isFinite(a)&&a>=0&&a<=99&&(o[n]=Math.floor(a))}return o}function pr(e){let t=ce(e,"product_rules");if(!t||typeof t!="object"||Array.isArray(t))return{};let r={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object"||Array.isArray(n))continue;let{min:i,max:a}=n,l=typeof i=="number"?i:Number(i),d=typeof a=="number"?a:Number(a);if(!Number.isFinite(l)||!Number.isFinite(d))continue;let s=Math.max(1,Math.min(99,Math.floor(l))),p=Math.max(s,Math.min(99,Math.floor(d)));r[o]={min:s,max:p}}return r}function br(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function hr(e){let t=e.get("markets")?.value;if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.filter(o=>typeof o=="string"):[]}catch{return[]}}function mr(e){let t=e.get("link_group_id")?.value;if(!t)return null;let r=e.get("link_group_is_primary")?.value==="true",o=null;if(r){let n=ce(e,"link_group_variants");Array.isArray(n)&&(o=n.filter(i=>typeof i=="object"&&i!==null).map(i=>{let a=typeof i.metaobjectId=="string"?i.metaobjectId:null,l=typeof i.weight=="number"&&Number.isFinite(i.weight)?Math.max(0,Math.min(100,Math.floor(i.weight))):null;return a===null||l===null?null:{metaobjectId:a,weight:l}}).filter(i=>i!==null))}return{id:t,isPrimary:r,variants:o}}function gr(e){let t=ce(e,"volume_tiers");return Array.isArray(t)?t.filter(r=>typeof r=="object"&&r!==null).map(fr):[]}function fr(e){let t=Number(e.minQuantity??0),r={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(r.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(r.amount=e.amount),r}function ce(e,t){let r=e.get(t)?.value;if(!r)return null;try{return JSON.parse(r)}catch{return null}}function vr(e,t,r={}){let o=e.get(t)?.value;if(!o)return null;let n=parseInt(o,10);return isNaN(n)||r.min!==void 0&&n<r.min?null:n}function we(e,t,r){let o=e.variantQuantities[r];return o!==void 0?o:e.productQuantities[t]??1}async function ht(e,t){await ft(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,linkGroupId:t.linkGroupId,occurredAt:new Date().toISOString()})}async function mt(e,t){await ft(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function gt(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let r=new IntersectionObserver(o=>{for(let n of o)n.isIntersecting&&(t(),r.unobserve(n.target))},{threshold:.5});return r.observe(e),()=>r.disconnect()}async function ft(e,t){let r=`${e.appUrl}/api/analytics`,o=JSON.stringify(t);try{(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o})).ok||(await new Promise(i=>setTimeout(i,2e3)),await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(r,o)}catch{}}}var xr=!1;function yr(){return typeof document<"u"}function wr(){if(!yr())return!1;if(xr)return!0;if(typeof window>"u")return!1;let e=window.Shopify;try{return e?.customerPrivacy?.analyticsProcessingAllowed?.()===!0}catch{return!1}}var Ze="lb_session",Cr=720*60*60,kr=720*60*60;function vt(e){return`__Host-_lb_ab_${e}`}async function xt(e,t,r={}){if(typeof document>"u"||t.length===0)return null;let o=new Set(t.map(l=>l.metaobjectId));if(r.forceLiveMetaobjectId&&o.has(r.forceLiveMetaobjectId))return{variantMetaobjectId:r.forceLiveMetaobjectId,persisted:!1,forcedLive:!0};let n=_r(e);if(n&&o.has(n))return{variantMetaobjectId:n,persisted:!0,forcedLive:!1};if(!wr())return null;let i=Sr(),a=Er(i,e,t);return a?(Br(e,a),{variantMetaobjectId:a,persisted:!0,forcedLive:!1}):null}function _r(e){if(typeof document>"u")return null;let r=`${vt(e)}=`,n=document.cookie.split(";").map(l=>l.trim()).find(l=>l.startsWith(r));if(!n)return null;let i=n.substring(r.length),a;try{a=decodeURIComponent(i)}catch{return null}return a.startsWith("gid://shopify/Metaobject/")?a:null}function Br(e,t){if(typeof document>"u")return;let r=vt(e),o=encodeURIComponent(t);document.cookie=`${r}=${o}; Path=/; Max-Age=${kr}; SameSite=Lax; Secure`}function Sr(){if(typeof document>"u")return et();let t=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${Ze}=`))?.split("=")[1];if(t)return t;let r=et();return document.cookie=`${Ze}=${r}; path=/; max-age=${Cr}; SameSite=Lax; Secure`,r}function et(){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 Er(e,t,r){if(r.length===0)return null;let o=Tr(`${e}:${t}`)%1e4,n=0;for(let i of r)if(!(typeof i?.metaobjectId!="string"||typeof i?.weight!="number")&&(n+=Math.max(0,i.weight)*100,o<n))return i.metaobjectId;return r[r.length-1].metaobjectId}function Tr(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}var tt=1e4,Ar=[[/@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"]],Lr=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Ve(e){if(e.length>tt)return{ok:!1,error:`CSS exceeds ${tt.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,(n,i)=>{let a=parseInt(i,16);return a<0||a>1114111?"\uFFFD":String.fromCodePoint(a)}),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[n,i]of Ar)if(n.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${i}`};let r=/url\s*\(\s*([\s\S]*?)\s*\)/gi,o;for(;(o=r.exec(t))!==null;){let n=o[1].trim();if((n.startsWith("'")||n.startsWith('"'))&&(n=n.slice(1)),(n.endsWith("'")||n.endsWith('"'))&&(n=n.slice(0,-1)),n=n.trim(),n&&!Lr.test(n))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Pr="lb-custom-css-";function yt(e,t){if(typeof document>"u"||!t)return!1;let r=Ve(t);if(!r.ok||!r.css.trim())return!1;let o=Pr+Mr(e),n=document.getElementById(o);return n||(n=document.createElement("style"),n.id=o,n.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(n)),n.textContent!==r.css&&(n.textContent=r.css),!0}function Mr(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function Ir(e,t){let r=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(r)}catch{return`${t} ${r.toFixed(2)}`}}var Rr={CL:"cl",CM:"cm",FLOZ:"fl oz",FT:"ft",FT2:"ft\xB2",G:"g",GAL:"gal",IN:"in",ITEM:"each",KG:"kg",L:"l",LB:"lb",M:"m",M2:"m\xB2",M3:"m\xB3",MG:"mg",ML:"ml",MM:"mm",OZ:"oz",PT:"pt",QT:"qt",UNKNOWN:"",YD:"yd"};function le(e,t,r){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let o=parseFloat(e.amount);if(!Number.isFinite(o))return null;let n=Rr[t.referenceUnit]??"";if(!n)return null;let i=e.currencyCode||r||"USD",a=Ir(o,i),l=t.referenceValue,d=l===1?n:`${l}${n}`;return`${a}/${d}`}function j(e){if(e==null)return 0;let t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.round(t*100):0}function D(e,t){try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e/100)}catch{return`${t} ${(e/100).toFixed(2)}`}}function wt(e,t){return Math.max(0,e-Math.floor(e*t/100))}function Oe(e,t=e.productQuantities,r=e.widgetConfig.pricing.showSaveBadge){let{discountType:o,discountValue:n}=e.discountConfig,i=[],a=0,l=0;for(let u of e.products){let C=u.variants.nodes.find(x=>x.availableForSale)??u.variants.nodes[0];if(!C)continue;let m=j(C.price.amount),g=t[u.id]??1,k=m*g,A=C.compareAtPrice?j(C.compareAtPrice.amount):null;if(i.push({unitCents:m,qty:g,lineCents:k,compareCents:A}),a+=k,o==="percentage"){let x=wt(m,n);l+=x*g}else l+=k}o==="fixed_amount"&&(l=Math.max(0,a-Math.round(n*100)));let d=Math.max(0,a-l),s=e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",p="";return r&&d>0&&(o==="percentage"&&n>0?p=`-${Math.round(n)}%`:o==="fixed_amount"&&n>0&&(p=`-${D(Math.round(n*100),s)}`)),{rows:i,totalCents:a,saleCents:l,savingsCents:d,headerBadge:p,currency:s}}function Ce(e,t){if(t.discountType==="percentage"){let r=Math.floor(e*t.discountValue/100);return Math.max(0,e-r)}return Math.max(0,e-Math.round(t.discountValue*100))}var U=152;function re(e,t={}){if(!e)return"";try{let r=new URL(e);return t.width!==void 0&&r.searchParams.set("width",String(t.width)),t.height!==void 0&&r.searchParams.set("height",String(t.height)),t.crop&&r.searchParams.set("crop",t.crop),r.toString()}catch{return e}}function Ct(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e/1e3),r=Math.floor(t/86400),o=Math.floor(t%86400/3600),n=Math.floor(t%3600/60),i=t%60,a=l=>String(l).padStart(2,"0");return r>0?`${r}d ${a(o)}h ${a(n)}m ${a(i)}s`:`${a(o)}h ${a(n)}m ${a(i)}s`}var Fe={};ot(Fe,{computePosition:()=>qr,emptyTypeAheadState:()=>Hr,handleKey:()=>Fr,pushTypeAheadChar:()=>Ur});var Dr=4;function qr({trigger:e,viewportHeight:t,desiredHeight:r,margin:o=Dr,clip:n}){let i=n?Math.min(t,n.bottom):t,a=n?Math.max(0,n.top):0,l=Math.max(0,i-e.bottom-o),d=Math.max(0,e.top-a-o),s=r<=l?"down":d>l?"up":"down",u=Math.min(r,s==="down"?l:d),C=s==="down"?e.bottom+o:e.top-o-u;return{placement:s,maxHeight:u,offsetTop:C,offsetLeft:e.left,width:e.width}}var Ie={type:"passthrough",preventDefault:!1};function Re(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function rt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Vr(e,t){if(e.length===0)return-1;for(let r=1;r<=e.length;r++){let o=(t+r)%e.length;if(!e[o].disabled)return o}return t}function Or(e,t){if(e.length===0)return-1;for(let r=1;r<=e.length;r++){let o=(t-r+e.length)%e.length;if(!e[o].disabled)return o}return t}function nt(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Fr(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return Ie;let{key:r}=e,{isOpen:o,activeIndex:n,selectedIndex:i,options:a}=t;if(!o)switch(r){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Re(a),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:rt(a),preventDefault:!0};default:return nt(r)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Re(a),preventDefault:!0}:Ie}switch(r){case"ArrowDown":return{type:"move-active",activeIndex:Vr(a,n),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Or(a,n),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Re(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:rt(a),preventDefault:!0};case"Enter":case" ":return n>=0&&!a[n]?.disabled?{type:"commit",index:n,preventDefault:!0}:{type:"passthrough",preventDefault:!0};case"Escape":return{type:"close",commit:!1,restoreFocus:!0,preventDefault:!0};case"Tab":return{type:"close",commit:!1,restoreFocus:!1,preventDefault:!1};default:return nt(r)?{type:"type-ahead",char:r,preventDefault:!1}:Ie}}var Nr=500;function Hr(){return{buffer:"",lastTime:0}}function Ur(e,t,r,o,n=Nr){if(t.length!==1)return{newState:e,matchedIndex:null};let a=(r-e.lastTime>n?"":e.buffer)+t.toLowerCase(),l={buffer:a,lastTime:r};for(let d=0;d<o.length;d++){let s=o[d];if(!s.disabled&&s.label.toLowerCase().startsWith(a))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var $r={};ot($r,{findVariantByOptions:()=>Wr,isOptionValueAvailable:()=>zr,toPickerVariant:()=>jr});function Wr(e,t){if(e.length===0)return null;for(let r of e){if(r.optionValues.length!==t.length)continue;let o=!0;for(let n=0;n<r.optionValues.length;n++)if(r.optionValues[n]!==t[n]){o=!1;break}if(o)return r}return null}function zr(e,t,r,o){for(let n of e){if(!n.available||n.optionValues[t]!==r)continue;let i=!0;for(let a=0;a<n.optionValues.length;a++)if(a!==t&&n.optionValues[a]!==o[a]){i=!1;break}if(i)return!0}return!1}function jr(e){return{id:e.id,optionValues:e.selectedOptions.map(t=>t.value),available:e.availableForSale}}function Z(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null?!0:e.quantityAvailable>=t:!1}function ue(e,t,r,o){return!o||e.quantityAvailable==null||e.quantityAvailable<t?!1:e.quantityAvailable<=r}function Ne(e,t,r){if(!e.availableForSale)return 0;if(e.currentlyNotInStock)return Math.max(0,t-r);let o=e.quantityAvailable==null?Number.POSITIVE_INFINITY:e.quantityAvailable;return Math.max(0,Math.min(t,o)-r)}var{computePosition:Qr,emptyTypeAheadState:Gr,handleKey:Kr,pushTypeAheadChar:Yr}=Fe,Xr=32,Jr=8,Zr=8,G=[];function _e(e){let t=e.composedPath();for(let r=G.length-1;r>=0;r--){let o=G[r];!t.includes(o.shell)&&!t.includes(o.listbox)&&o.close()}}function kt(){for(let e=G.length-1;e>=0;e--)G[e].close()}var Be=!1;function en(){Be||(document.addEventListener("pointerdown",_e,!0),window.addEventListener("scroll",_e,!0),window.addEventListener("resize",kt),Be=!0)}function tn(){!Be||G.length>0||(document.removeEventListener("pointerdown",_e,!0),window.removeEventListener("scroll",_e,!0),window.removeEventListener("resize",kt),Be=!1)}function ke(e){let t=[];for(let r=0;r<e.options.length;r++){let o=e.options[r];t.push({disabled:o.disabled,label:o.textContent||o.value})}return t}function rn(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function nn(e){let t=e.ownerDocument?.defaultView;if(!t)return null;let r=e.parentElement;for(;r&&r!==e.ownerDocument.body;){let n=t.getComputedStyle(r).overflowY;if(n==="auto"||n==="scroll"||n==="hidden")return r;r=r.parentElement}return null}var on=["lb-bundle-variant-select","lb-mix-match__variant-select"],an=on.map(e=>`select.${e}:not(.lb-dropdown-state)`).join(", ");function ln(e){let t=e;if(e.classList.contains("lb-dropdown-state"))return t.__lbDropdownInstance??null;let r=e.ownerDocument,o=e.getRootNode(),n=e.getAttribute("aria-label")??"",i=`lb-dd-${Math.random().toString(36).slice(2,9)}`;e.classList.add("lb-dropdown-state"),e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1");let a=r.createElement("div");a.className="lb-dropdown",a.setAttribute("data-lb-dropdown","");let l=r.createElement("button");l.type="button",l.className="lb-dropdown-trigger",l.setAttribute("role","combobox"),l.setAttribute("aria-haspopup","listbox"),l.setAttribute("aria-expanded","false");let d=`${i}-listbox`;l.setAttribute("aria-controls",d),n&&l.setAttribute("aria-label",n);let s=r.createElement("span");s.className="lb-dropdown-trigger-value";let p=r.createElement("span");p.className="lb-dropdown-chevron",p.setAttribute("aria-hidden","true"),l.appendChild(s),l.appendChild(p);let u=r.createElement("ul");u.id=d,u.className="lb-dropdown-listbox",u.setAttribute("role","listbox"),n&&u.setAttribute("aria-label",n),u.hidden=!0,a.appendChild(l),e.parentNode?.insertBefore(a,e.nextSibling);let C=e.closest("[data-modal-overlay]");C?(C.appendChild(u),u.setAttribute("data-lb-dropdown-portal","")):a.appendChild(u);let m=!1,g=-1,k=Gr(),A=[],x;function E(){l.disabled=e.disabled;let v=ke(e),b=e.selectedIndex;for(s.textContent=b>=0&&v[b]?v[b].label:"";u.firstChild;)u.removeChild(u.firstChild);A=[];for(let w=0;w<v.length;w++){let R=r.createElement("li");R.id=`${i}-opt-${w}`,R.className="lb-dropdown-option",R.setAttribute("role","option"),R.setAttribute("aria-selected",w===b?"true":"false"),v[w].disabled&&R.setAttribute("aria-disabled","true"),R.setAttribute("data-value",e.options[w].value),R.setAttribute("data-index",String(w)),R.textContent=v[w].label,u.appendChild(R),A.push(R)}}function _(v){if(g>=0&&A[g]&&A[g].classList.remove("is-active"),g=v,v>=0&&A[v]){let b=A[v];b.classList.add("is-active"),l.setAttribute("aria-activedescendant",b.id);let w=b.offsetTop,R=w+b.offsetHeight,ne=u.scrollTop,Y=ne+u.clientHeight;w<ne?u.scrollTop=w:R>Y&&(u.scrollTop=R-u.clientHeight)}else l.setAttribute("aria-activedescendant","")}function O(){let v=l.getBoundingClientRect();if(v.width===0)return!1;let w=Math.min(A.length||1,Zr)*Xr+Jr,R=nn(l),ne=R?(()=>{let ee=R.getBoundingClientRect();return{top:ee.top,bottom:ee.bottom}})():void 0,Y=Qr({trigger:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},viewportHeight:window.innerHeight,desiredHeight:w,clip:ne});return u.setAttribute("data-placement",Y.placement),u.style.maxHeight=`${Y.maxHeight}px`,u.hasAttribute("data-lb-dropdown-portal")&&(u.style.top=`${Y.offsetTop}px`,u.style.left=`${Y.offsetLeft}px`,u.style.width=`${Y.width}px`),!0}function h(){if(m)return;for(let w=G.length-1;w>=0;w--)G[w]!==x&&G[w].close();m=!0,u.hidden=!1,l.setAttribute("aria-expanded","true"),O()||requestAnimationFrame(()=>O());let v=ke(e),b=e.selectedIndex;b>=0&&v[b]&&!v[b].disabled?_(b):_(rn(v)),G.push(x),G.length===1&&en()}function M(v){if(!m)return;m=!1,u.hidden=!0,l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant",""),g>=0&&A[g]&&A[g].classList.remove("is-active"),g=-1;let b=G.indexOf(x);b>=0&&G.splice(b,1),G.length===0&&tn(),v&&l.focus()}function L(v){let b=e.options[v];if(!(!b||b.disabled)){if(e.value!==b.value){e.value=b.value;let w=new Event("change",{bubbles:!0});e.dispatchEvent(w)}E(),M(!0)}}function y(v){switch(v.type){case"open":h(),v.activeIndex>=0&&_(v.activeIndex);return;case"close":M(v.restoreFocus);return;case"move-active":_(v.activeIndex);return;case"commit":L(v.index);return;case"type-ahead":{let b=ke(e),w=Yr(k,v.char,Date.now(),b);k=w.newState,w.matchedIndex!==null&&(m||h(),_(w.matchedIndex));return}case"passthrough":return;default:{let b=v}}}function B(v){let b=ke(e),w=Kr({key:v.key,ctrlKey:v.ctrlKey,metaKey:v.metaKey,altKey:v.altKey,shiftKey:v.shiftKey},{isOpen:m,activeIndex:g,selectedIndex:e.selectedIndex,options:b});w.preventDefault&&v.preventDefault(),y(w)}function f(v){v.preventDefault(),m?M(!1):h()}function q(v){let b=v.target;for(;b&&b!==u;){if(b.classList?.contains("lb-dropdown-option")){let w=parseInt(b.getAttribute("data-index")??"",10);if(!Number.isNaN(w)){L(w);return}}b=b.parentElement}}function P(v){let b=v.target;for(;b&&b!==u;){if(b.classList?.contains("lb-dropdown-option")){if(b.getAttribute("aria-disabled")==="true")return;let w=parseInt(b.getAttribute("data-index")??"",10);!Number.isNaN(w)&&w!==g&&_(w);return}b=b.parentElement}}function T(){setTimeout(()=>{if(!m)return;let v=o.activeElement??r.activeElement;a.contains(v)||M(!1)},0)}function S(){E()}let I=new MutationObserver(()=>{E()});I.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});let F=v=>v.preventDefault();l.addEventListener("click",f),l.addEventListener("keydown",B),a.addEventListener("focusout",T),u.addEventListener("mousedown",F),u.addEventListener("click",q),u.addEventListener("mousemove",P),e.addEventListener("change",S);function te(){m&&M(!1),I.disconnect(),l.removeEventListener("click",f),l.removeEventListener("keydown",B),a.removeEventListener("focusout",T),u.removeEventListener("mousedown",F),u.removeEventListener("click",q),u.removeEventListener("mousemove",P),e.removeEventListener("change",S),a.parentNode&&a.parentNode.removeChild(a),u.parentNode&&u.parentNode.removeChild(u),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),delete t.__lbDropdownInstance}return x={shell:a,listbox:u,select:e,close:()=>M(!1),destroy:te},t.__lbDropdownInstance=x,E(),x}function Se(e){let t=e.querySelectorAll(an),r=[];return t.forEach(o=>{let n=ln(o);n&&r.push(n)}),r}function Ee(e){e.querySelectorAll("select.lb-dropdown-state").forEach(r=>{let o=r.__lbDropdownInstance;o&&o.destroy()})}function pe(e){let t=dn(e);if(t===null||t<=Date.now())return null;let r=t,o=document.createElement("div");o.className="lb-bundle-countdown",o.setAttribute("data-countdown","");let n=document.createElement("div");n.className="lb-bundle-countdown__label";let i=document.createElement("span");i.textContent="Ends in",n.appendChild(i),o.appendChild(n);let a=document.createElement("span");a.className="lb-bundle-countdown__timer",a.setAttribute("data-countdown-timer",""),o.appendChild(a);let l=null;function d(){let p=r-Date.now();if(p<=0){o.style.display="none",s();return}a.textContent=Ct(p)}function s(){l!==null&&(clearInterval(l),l=null)}return d(),l=setInterval(d,1e3),{el:o,stop:s}}function dn(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function be(e){let t=document.createElement("button");t.type="button",t.className="lb-bundle-cta",t.setAttribute("data-add-bundle","");let r=document.createElement("span");r.className="lb-cta-label",r.setAttribute("data-cta-label",""),r.textContent=e,t.appendChild(r);let o=document.createElement("span");return o.className="lb-cta-spinner",o.setAttribute("data-cta-spinner",""),o.setAttribute("aria-hidden","true"),o.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 2a10 10 0 0 1 10 10" /></svg>',t.appendChild(o),t}function He(e,t){let r=e.querySelector("[data-cta-label]");r&&(r.textContent=t)}function c(e,t,r={}){let o=document.createElement(e);t&&(o.className=t);for(let[n,i]of Object.entries(r))o.setAttribute(n,i);return o}var sn=`
233
233
  <svg class="lb-bundle-placeholder-icon" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
234
234
  <rect x="4" y="4" width="20" height="20" rx="3"></rect>
235
235
  <line x1="4" y1="20" x2="24" y2="20"></line>
236
236
  <circle cx="10" cy="12" r="2"></circle>
237
- </svg>`;function St(e,t,r,o){let n=t.widgetConfig,a=(x,E)=>we(t,x,E),i=[],l=0;if(t.products.forEach((x,E)=>{let _=cn(t,x,E);_.qty!==0&&(_.isOos&&(l++,n.outOfStockBehavior==="hide")||i.push(_))}),i.length===0)return;let s=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",d=c("div","lb-fixed",{"data-discount-type":t.discountConfig.discountType,"data-discount-value":String(t.discountConfig.discountValue)}),p=un(t,s);if(d.appendChild(p.el),n.countdown.showCountdown&&t.endsAt){let x=pe(t.endsAt);x&&(d.appendChild(x.el),o?.(x.stop))}let u=c("div","lb-fixed__products"),C=[];i.forEach(x=>{let E=bn(x,s,a,{enabled:n.showLowStockBadge,threshold:n.lowStockThreshold},()=>{A()});C.push(E),u.appendChild(E.el)}),d.appendChild(u),d.appendChild(c("div","lb-bundle-divider"));let m=hn(t);d.appendChild(m.el);let g=n.savingsBar.visible?mn():null;g&&d.appendChild(g.el);let k=gn(t,l,()=>{let x=i.filter(E=>E.selected).map(E=>({merchandiseId:E.selected.id,quantity:E.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}));x.length!==0&&r(x)});d.appendChild(k),d.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),d.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(d),Se(d),o?.(()=>Ee(d)),A();function A(){let x=i.reduce((O,h)=>{if(!h.selected)return O;let M=j(h.selected.price.amount);return O+M*h.qty},0),E=fn(x,t.discountConfig,i),_=Math.max(0,x-E);m.update({totalCents:x,saleCents:E,savingsCents:_,currency:s}),g&&g.update({savingsCents:_,currency:s}),p.refresh(pn(t,x,E,s))}}function cn(e,t,r){let o=e.selectedVariantIds?.[r]??null,n=o&&o.length>0?t.variants.nodes.filter(p=>o.includes(p.id)):t.variants.nodes,a=n.find(p=>Z(p,we(e,t.id,p.id)))??null,i=n,l=!a,s=a??n[0]??null,d=s?we(e,t.id,s.id):1;return{product:t,eligibleVariants:i,selected:s,qty:d,isOos:l}}function un(e,t){let r=e.widgetConfig,o=c("div","lb-bundle-header"),n=c("div","lb-bundle-header__content"),a=c("h3","lb-bundle-title");if(a.textContent=e.title,n.appendChild(a),e.description){let s=c("p","lb-bundle-subtitle");s.textContent=e.description,n.appendChild(s)}o.appendChild(n);let i=c("span","lb-bundle-header__badge",{"data-header-badge":""});o.appendChild(i);let l=Oe(e,e.productQuantities,r.pricing.showSaveBadge);return l.headerBadge?i.textContent=l.headerBadge:i.style.display="none",{el:o,refresh(s){if(!r.pricing.showSaveBadge){i.style.display="none";return}s?(i.textContent=s,i.style.display=""):i.style.display="none"}}}function pn(e,t,r,o){if(!e.widgetConfig.pricing.showSaveBadge)return"";let n=t-r;if(n<=0)return"";let a=e.discountConfig;return a.discountType==="percentage"&&a.discountValue>0?`-${Math.round(a.discountValue)}%`:a.discountType==="fixed_amount"&&a.discountValue>0?`-${D(Math.round(a.discountValue*100),o)}`:`-${D(n,o)}`}function bn(e,t,r,o,n){let a=c("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"}:{}}),i=c("div","lb-bundle-thumbnail",{"data-thumbnail":""}),l=e.selected?.image??e.product.featuredImage??null,s=null;l?(s=document.createElement("img"),s.src=re(l.url,{width:U,height:U,crop:"center"}),s.alt=l.altText??e.product.title,s.width=U,s.height=U,s.loading="lazy",i.appendChild(s)):i.insertAdjacentHTML("beforeend",dn);let d=null;e.isOos||(d=c("span","lb-bundle-qty-badge",{"data-qty-badge":""}),d.textContent=String(e.qty),i.appendChild(d)),a.appendChild(i);let p=c("div","lb-bundle-product-info"),u=document.createElement("a");if(u.className="lb-bundle-product-name",u.href=`/products/${e.product.handle}`,u.textContent=e.product.title,p.appendChild(u),e.isOos){let C=c("span","lb-bundle-oos-label");C.textContent="Out of stock",p.appendChild(C)}else if(e.selected){if(e.eligibleVariants.length===1&&e.product.variants.nodes.length>1){let _=c("span","lb-bundle-variant-badge");_.textContent=e.eligibleVariants[0].title,p.appendChild(_)}let m=c("span","lb-bundle-product-prices"),g=c("span","lb-bundle-product-compare-price",{"data-product-compare-price":""}),k=c("span","lb-bundle-product-price",{"data-product-price":""});m.appendChild(g),m.appendChild(k),p.appendChild(m);let A=c("span","lb-bundle-product-unit-price",{"data-product-unit-price":""});A.setAttribute("hidden",""),p.appendChild(A);let x=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});x.setAttribute("hidden",""),p.appendChild(x);let E=_=>{let O=j(_.price.amount);if(k.textContent=D(O,t),_.compareAtPrice){let y=j(_.compareAtPrice.amount);y>O?(g.textContent=D(y,t),g.removeAttribute("hidden")):g.setAttribute("hidden","")}else g.setAttribute("hidden","");let h=le(_.unitPrice,_.unitPriceMeasurement,t);h?(A.textContent=h,A.removeAttribute("hidden")):A.setAttribute("hidden","");let M=_.image??e.product.featuredImage;s&&M&&(s.src=re(M.url,{width:U,height:U,crop:"center"}),s.alt=M.altText??e.product.title);let L=r(e.product.id,_.id);ue(_,L,o.threshold,o.enabled)?(x.textContent=`Only ${_.quantityAvailable} left`,x.removeAttribute("hidden")):x.setAttribute("hidden","")};if(E(e.selected),e.eligibleVariants.length>1){let _=e.eligibleVariants[0].selectedOptions.map(P=>P.name),O=e.product.id.replace(/^.*\//,""),h=[],M=P=>e.eligibleVariants.find(T=>T.selectedOptions.every((S,I)=>S.value===P[I])&&T.selectedOptions.length===P.length)??null,L=P=>{P.selectedOptions.forEach((T,S)=>{let I=h[S];I&&I.value!==T.value&&(I.value=T.value)})},y=(P,T,S)=>e.eligibleVariants.some(I=>!Z(I,r(e.product.id,I.id))||I.selectedOptions[P]?.value!==T?!1:I.selectedOptions.every((F,te)=>te===P||F.value===S[te])),B=P=>{h.forEach((T,S)=>{Array.from(T.options).forEach(I=>{I.disabled=!y(S,I.value,P)})})},f=()=>{let P=h.map(S=>S.value),T=M(P);if(!T){e.selected&&(L(e.selected),B(e.selected.selectedOptions.map(S=>S.value)));return}e.selected=T,e.qty=r(e.product.id,T.id),d&&(d.textContent=String(e.qty)),E(T),B(T.selectedOptions.map(S=>S.value)),n()},V=c("div","lb-bundle-variant-option-groups");_.forEach((P,T)=>{let S=c("div","lb-bundle-variant-option-group"),I=c("span","lb-bundle-variant-option-label");I.textContent=P,S.appendChild(I);let F=document.createElement("select");F.className="lb-bundle-variant-select",F.setAttribute("data-variant-option",""),F.setAttribute("data-option-position",String(T+1)),F.name=`lb-variant-${O}-${T+1}`,F.setAttribute("aria-label",P);let te=new Set;e.eligibleVariants.forEach(v=>{let b=v.selectedOptions[T]?.value;if(!b||te.has(b))return;te.add(b);let w=document.createElement("option");w.value=b,w.textContent=b,e.selected?.selectedOptions[T]?.value===b&&(w.selected=!0),F.appendChild(w)}),F.addEventListener("change",f),h.push(F),S.appendChild(F),V.appendChild(S)}),p.appendChild(V),e.selected&&B(e.selected.selectedOptions.map(P=>P.value))}}return a.appendChild(p),{el:a,state:e}}function hn(e){let t=c("div","lb-bundle-pricing"),r=c("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=c("span","lb-bundle-pricing__prices"),n=c("span","lb-bundle-compare-price",{"data-compare-price":""});n.style.display="none",o.appendChild(n);let a=c("span","lb-bundle-sale-price",{"data-sale-price":""});return o.appendChild(a),t.appendChild(o),{el:t,update({totalCents:i,saleCents:l,savingsCents:s,currency:d}){a.textContent=D(l,d),e.widgetConfig.pricing.showCompareAtPrice&&s>0?(n.textContent=D(i,d),n.style.display=""):n.style.display="none"}}}function mn(){let e=c("div","lb-bundle-savings-bar",{"data-savings-bar":""}),t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=c("span","",{"data-savings-amount":""});return e.appendChild(r),{el:e,update({savingsCents:o,currency:n}){if(o<=0){e.style.display="none";return}e.style.display="",r.textContent=D(o,n)}}}function gn(e,t,r){let o=t>0?`${t} item${t===1?"":"s"} out of stock`:e.widgetConfig.cta.ctaText||"Add to cart",n=be(o);return t>0?n.disabled=!0:n.addEventListener("click",()=>{n.disabled||r()}),n}function fn(e,t,r){if(t.discountType==="percentage"){let o=0;for(let n of r){if(!n.selected)continue;let a=j(n.selected.price.amount),i=Math.floor(a*t.discountValue/100),l=Math.max(0,a-i);o+=l*n.qty}return o}return Math.max(0,e-Math.round(t.discountValue*100))}var Tt=`
237
+ </svg>`;function _t(e,t,r,o){let n=t.widgetConfig,i=(x,E)=>we(t,x,E),a=[],l=0;if(t.products.forEach((x,E)=>{let _=cn(t,x,E);_.qty!==0&&(_.isOos&&(l++,n.outOfStockBehavior==="hide")||a.push(_))}),a.length===0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",s=c("div","lb-fixed",{"data-discount-type":t.discountConfig.discountType,"data-discount-value":String(t.discountConfig.discountValue)}),p=un(t,d);if(s.appendChild(p.el),n.countdown.showCountdown&&t.endsAt){let x=pe(t.endsAt);x&&(s.appendChild(x.el),o?.(x.stop))}let u=c("div","lb-fixed__products"),C=[];a.forEach(x=>{let E=bn(x,d,i,{enabled:n.showLowStockBadge,threshold:n.lowStockThreshold},()=>{A()});C.push(E),u.appendChild(E.el)}),s.appendChild(u),s.appendChild(c("div","lb-bundle-divider"));let m=hn(t);s.appendChild(m.el);let g=n.savingsBar.visible?mn():null;g&&s.appendChild(g.el);let k=gn(t,l,()=>{let x=a.filter(E=>E.selected).map(E=>({merchandiseId:E.selected.id,quantity:E.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}));x.length!==0&&r(x)});s.appendChild(k),s.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),s.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(s),Se(s),o?.(()=>Ee(s)),A();function A(){let x=a.reduce((O,h)=>{if(!h.selected)return O;let M=j(h.selected.price.amount);return O+M*h.qty},0),E=fn(x,t.discountConfig,a),_=Math.max(0,x-E);m.update({totalCents:x,saleCents:E,savingsCents:_,currency:d}),g&&g.update({savingsCents:_,currency:d}),p.refresh(pn(t,x,E,d))}}function cn(e,t,r){let o=e.selectedVariantIds?.[r]??null,n=o&&o.length>0?t.variants.nodes.filter(p=>o.includes(p.id)):t.variants.nodes,i=n.find(p=>Z(p,we(e,t.id,p.id)))??null,a=n,l=!i,d=i??n[0]??null,s=d?we(e,t.id,d.id):1;return{product:t,eligibleVariants:a,selected:d,qty:s,isOos:l}}function un(e,t){let r=e.widgetConfig,o=c("div","lb-bundle-header"),n=c("div","lb-bundle-header__content"),i=c("h3","lb-bundle-title");if(i.textContent=e.title,n.appendChild(i),e.description){let d=c("p","lb-bundle-subtitle");d.textContent=e.description,n.appendChild(d)}o.appendChild(n);let a=c("span","lb-bundle-header__badge",{"data-header-badge":""});o.appendChild(a);let l=Oe(e,e.productQuantities,r.pricing.showSaveBadge);return l.headerBadge?a.textContent=l.headerBadge:a.style.display="none",{el:o,refresh(d){if(!r.pricing.showSaveBadge){a.style.display="none";return}d?(a.textContent=d,a.style.display=""):a.style.display="none"}}}function pn(e,t,r,o){if(!e.widgetConfig.pricing.showSaveBadge)return"";let n=t-r;if(n<=0)return"";let i=e.discountConfig;return i.discountType==="percentage"&&i.discountValue>0?`-${Math.round(i.discountValue)}%`:i.discountType==="fixed_amount"&&i.discountValue>0?`-${D(Math.round(i.discountValue*100),o)}`:`-${D(n,o)}`}function bn(e,t,r,o,n){let i=c("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=c("div","lb-bundle-thumbnail",{"data-thumbnail":""}),l=e.selected?.image??e.product.featuredImage??null,d=null;l?(d=document.createElement("img"),d.src=re(l.url,{width:U,height:U,crop:"center"}),d.alt=l.altText??e.product.title,d.width=U,d.height=U,d.loading="lazy",a.appendChild(d)):a.insertAdjacentHTML("beforeend",sn);let s=null;e.isOos||(s=c("span","lb-bundle-qty-badge",{"data-qty-badge":""}),s.textContent=String(e.qty),a.appendChild(s)),i.appendChild(a);let p=c("div","lb-bundle-product-info"),u=document.createElement("a");if(u.className="lb-bundle-product-name",u.href=`/products/${e.product.handle}`,u.textContent=e.product.title,p.appendChild(u),e.isOos){let C=c("span","lb-bundle-oos-label");C.textContent="Out of stock",p.appendChild(C)}else if(e.selected){if(e.eligibleVariants.length===1&&e.product.variants.nodes.length>1){let _=c("span","lb-bundle-variant-badge");_.textContent=e.eligibleVariants[0].title,p.appendChild(_)}let m=c("span","lb-bundle-product-prices"),g=c("span","lb-bundle-product-compare-price",{"data-product-compare-price":""}),k=c("span","lb-bundle-product-price",{"data-product-price":""});m.appendChild(g),m.appendChild(k),p.appendChild(m);let A=c("span","lb-bundle-product-unit-price",{"data-product-unit-price":""});A.setAttribute("hidden",""),p.appendChild(A);let x=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});x.setAttribute("hidden",""),p.appendChild(x);let E=_=>{let O=j(_.price.amount);if(k.textContent=D(O,t),_.compareAtPrice){let y=j(_.compareAtPrice.amount);y>O?(g.textContent=D(y,t),g.removeAttribute("hidden")):g.setAttribute("hidden","")}else g.setAttribute("hidden","");let h=le(_.unitPrice,_.unitPriceMeasurement,t);h?(A.textContent=h,A.removeAttribute("hidden")):A.setAttribute("hidden","");let M=_.image??e.product.featuredImage;d&&M&&(d.src=re(M.url,{width:U,height:U,crop:"center"}),d.alt=M.altText??e.product.title);let L=r(e.product.id,_.id);ue(_,L,o.threshold,o.enabled)?(x.textContent=`Only ${_.quantityAvailable} left`,x.removeAttribute("hidden")):x.setAttribute("hidden","")};if(E(e.selected),e.eligibleVariants.length>1){let _=e.eligibleVariants[0].selectedOptions.map(P=>P.name),O=e.product.id.replace(/^.*\//,""),h=[],M=P=>e.eligibleVariants.find(T=>T.selectedOptions.every((S,I)=>S.value===P[I])&&T.selectedOptions.length===P.length)??null,L=P=>{P.selectedOptions.forEach((T,S)=>{let I=h[S];I&&I.value!==T.value&&(I.value=T.value)})},y=(P,T,S)=>e.eligibleVariants.some(I=>!Z(I,r(e.product.id,I.id))||I.selectedOptions[P]?.value!==T?!1:I.selectedOptions.every((F,te)=>te===P||F.value===S[te])),B=P=>{h.forEach((T,S)=>{Array.from(T.options).forEach(I=>{I.disabled=!y(S,I.value,P)})})},f=()=>{let P=h.map(S=>S.value),T=M(P);if(!T){e.selected&&(L(e.selected),B(e.selected.selectedOptions.map(S=>S.value)));return}e.selected=T,e.qty=r(e.product.id,T.id),s&&(s.textContent=String(e.qty)),E(T),B(T.selectedOptions.map(S=>S.value)),n()},q=c("div","lb-bundle-variant-option-groups");_.forEach((P,T)=>{let S=c("div","lb-bundle-variant-option-group"),I=c("span","lb-bundle-variant-option-label");I.textContent=P,S.appendChild(I);let F=document.createElement("select");F.className="lb-bundle-variant-select",F.setAttribute("data-variant-option",""),F.setAttribute("data-option-position",String(T+1)),F.name=`lb-variant-${O}-${T+1}`,F.setAttribute("aria-label",P);let te=new Set;e.eligibleVariants.forEach(v=>{let b=v.selectedOptions[T]?.value;if(!b||te.has(b))return;te.add(b);let w=document.createElement("option");w.value=b,w.textContent=b,e.selected?.selectedOptions[T]?.value===b&&(w.selected=!0),F.appendChild(w)}),F.addEventListener("change",f),h.push(F),S.appendChild(F),q.appendChild(S)}),p.appendChild(q),e.selected&&B(e.selected.selectedOptions.map(P=>P.value))}}return i.appendChild(p),{el:i,state:e}}function hn(e){let t=c("div","lb-bundle-pricing"),r=c("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=c("span","lb-bundle-pricing__prices"),n=c("span","lb-bundle-compare-price",{"data-compare-price":""});n.style.display="none",o.appendChild(n);let i=c("span","lb-bundle-sale-price",{"data-sale-price":""});return o.appendChild(i),t.appendChild(o),{el:t,update({totalCents:a,saleCents:l,savingsCents:d,currency:s}){i.textContent=D(l,s),e.widgetConfig.pricing.showCompareAtPrice&&d>0?(n.textContent=D(a,s),n.style.display=""):n.style.display="none"}}}function mn(){let e=c("div","lb-bundle-savings-bar",{"data-savings-bar":""}),t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=c("span","",{"data-savings-amount":""});return e.appendChild(r),{el:e,update({savingsCents:o,currency:n}){if(o<=0){e.style.display="none";return}e.style.display="",r.textContent=D(o,n)}}}function gn(e,t,r){let o=t>0?`${t} item${t===1?"":"s"} out of stock`:e.widgetConfig.cta.ctaText||"Add to cart",n=be(o);return t>0?n.disabled=!0:n.addEventListener("click",()=>{n.disabled||r()}),n}function fn(e,t,r){if(t.discountType==="percentage"){let o=0;for(let n of r){if(!n.selected)continue;let i=j(n.selected.price.amount),a=Math.floor(i*t.discountValue/100),l=Math.max(0,i-a);o+=l*n.qty}return o}return Math.max(0,e-Math.round(t.discountValue*100))}var St=`
238
238
  <svg class="lb-bundle-placeholder-icon" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
239
239
  <rect x="4" y="4" width="20" height="20" rx="3"></rect>
240
240
  <line x1="4" y1="20" x2="24" y2="20"></line>
@@ -243,7 +243,7 @@
243
243
  <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
244
244
  <line x1="9" y1="3" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
245
245
  <line x1="3" y1="9" x2="15" y2="9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
246
- </svg>`,At=`
246
+ </svg>`,Et=`
247
247
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
248
248
  <line x1="5" y1="5" x2="15" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
249
249
  <line x1="15" y1="5" x2="5" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
@@ -257,7 +257,7 @@
257
257
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
258
258
  <line x1="7" y1="3" x2="7" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
259
259
  <line x1="3" y1="7" x2="11" y2="7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
260
- </svg>`;function $e(e,t){return e.productRules[t]??pt}function Ue(e,t,r){let o=0;for(let n of e)n.productId===t&&n.variantId===r&&(o+=n.quantity);return o}function Lt(e,t,r,o){let n=t.widgetConfig,a=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",i=t.minQuantity??1,l=n.mixMatchShowQuantitySelector!==!1,s=Pn(t,n.outOfStockBehavior);if(s.filter(y=>!y.isOos).length<i)return;let p=[],u=c("div","lb-mix-match",{"data-required-quantity":String(i)}),C=kn(t);if(u.appendChild(C),n.countdown.showCountdown&&t.endsAt){let y=pe(t.endsAt);y&&(u.appendChild(y.el),o?.(y.stop))}let m=_n(i);u.appendChild(m.el);let g=c("div","lb-mix-match__slots",{"data-selection-slots":""});u.appendChild(g),u.appendChild(c("div","lb-bundle-divider"));let k=En(n.pricing.showCompareAtPrice);u.appendChild(k.el);let A=n.savingsBar.visible?Tn():null;A&&u.appendChild(A.el);let x=be(`Select ${i} items to unlock`);x.disabled=!0,x.addEventListener("click",()=>{x.disabled||r(Cn(p,t))});let E=An(t,s,a,{showSearch:n.showSearch,showQtySelector:l,selections:p,onAdd:(y,B,f)=>_(y,B,f),isComplete:()=>p.length>=i,getFocusAfterAdd:()=>g.querySelector(".lb-mix-match__slot--empty")??x});u.appendChild(E.el),u.appendChild(x),u.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),u.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(u),o?.(()=>Ee(u)),h();function _(y,B,f){if(p.length>=i)return;let V=$e(t,y.id),P=Ne(B,V.max,Ue(p,y.id,B.id));if(P<V.min)return;let T=Math.max(V.min,Math.min(f,P));p.push({productId:y.id,productTitle:y.title,variantId:B.id,variantTitle:B.title,imageUrl:B.image?.url??y.featuredImage?.url??null,priceCents:j(B.price.amount),compareCents:B.compareAtPrice?j(B.compareAtPrice.amount):null,unitPriceLabel:le(B.unitPrice,B.unitPriceMeasurement,a),quantity:T}),h()}function O(y){y<0||y>=p.length||(p.splice(y,1),h())}function h(){M(),m.update(p.length),k.update(p,t,a),A&&A.update(p,t,a),E.refreshCounts(),L()}function M(){g.innerHTML="";let y=Math.max(i,p.length);for(let B=0;B<y;B++){let f=p[B];f?g.appendChild(Sn(f,B,a,()=>O(B))):g.appendChild(Bn(B,()=>E.open()))}}function L(){let y=p.length;y<i?(x.disabled=!0,He(x,`Select ${i-y} more to unlock`)):(x.disabled=!1,He(x,n.cta.ctaText||"Add to cart"))}}function Cn(e,t){let r=new Map;for(let o of e){let n=`${o.productId}::${o.variantId}`,a=r.get(n);a?a.quantity+=o.quantity:r.set(n,{variantId:o.variantId,quantity:o.quantity})}return Array.from(r.values()).map(o=>({merchandiseId:o.variantId,quantity:o.quantity,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}))}function kn(e){let t=e.widgetConfig,r=c("div","lb-bundle-header"),o=c("div","lb-bundle-header__content"),n=c("h3","lb-bundle-title");if(n.textContent=e.title,o.appendChild(n),r.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=`-${D(Math.round(i*100),e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD")}`),l){let s=c("span","lb-bundle-header__badge");s.textContent=l,r.appendChild(s)}}return r}function _n(e){let t=c("div","lb-mix-match__progress"),r=c("div","lb-mix-match__progress-labels"),o=c("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"});o.textContent=`0 of ${e} selected`,r.appendChild(o);let n=c("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"});n.textContent=`${e} more to go`,r.appendChild(n),t.appendChild(r);let a=c("div","lb-mix-match__progress-track",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)}),i=c("div","lb-mix-match__progress-fill",{"data-progress-fill":""});i.style.width="0%",a.appendChild(i),t.appendChild(a);function l(s){let d=Math.min(100,s/e*100);o.textContent=`${s} of ${e} selected`,s>=e?n.textContent="Complete":n.textContent=`${e-s} more to go`,i.style.width=`${d}%`,a.setAttribute("aria-valuenow",String(Math.min(s,e)))}return{el:t,update:l}}function Bn(e,t){let r=c("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=c("div","lb-mix-match__empty-thumb");o.innerHTML=vn,r.appendChild(o);let n=c("span","lb-mix-match__empty-text");return n.textContent="Choose an item",r.appendChild(n),r.addEventListener("click",t),r.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),t())}),r}function Sn(e,t,r,o){let n=c("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--filled",{"data-slot":String(t+1)}),a=c("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.imageUrl){let g=document.createElement("img");g.src=re(e.imageUrl,{width:U,height:U,crop:"center"}),g.alt=e.productTitle,g.width=U,g.height=U,g.loading="lazy",a.appendChild(g)}else a.insertAdjacentHTML("beforeend",Tt);let i=c("span","lb-bundle-qty-badge");i.textContent=`\xD7${e.quantity}`,a.appendChild(i),n.appendChild(a);let l=c("div","lb-mix-match__filled-info"),s=c("span","lb-mix-match__filled-title");if(s.textContent=e.productTitle,l.appendChild(s),e.variantTitle&&e.variantTitle!=="Default Title"){let g=c("span","lb-mix-match__filled-variant");g.textContent=e.variantTitle,l.appendChild(g)}let d=e.priceCents*e.quantity,p=e.compareCents!==null?e.compareCents*e.quantity:null,u=c("span","lb-mix-match__filled-price");if(p!==null&&p>d){let g=c("span","lb-mix-match__filled-compare");g.textContent=D(p,r),u.appendChild(g)}let C=document.createElement("span");if(C.textContent=D(d,r),u.appendChild(C),l.appendChild(u),e.unitPriceLabel){let g=c("span","lb-bundle-product-unit-price");g.textContent=e.unitPriceLabel,l.appendChild(g)}n.appendChild(l);let m=document.createElement("button");return m.type="button",m.className="lb-mix-match__slot-remove",m.setAttribute("aria-label",`Remove ${e.productTitle}`),m.innerHTML=At,m.addEventListener("click",g=>{g.stopPropagation(),o()}),n.appendChild(m),n}function En(e){let t=c("div","lb-bundle-pricing",{"data-pricing-section":""});t.style.display="none";let r=c("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=c("span","lb-bundle-pricing__prices"),n=c("span","lb-bundle-compare-price",{"data-compare-price":""});e&&o.appendChild(n);let a=c("span","lb-bundle-sale-price",{"data-sale-price":""});o.appendChild(a),t.appendChild(o);function i(l,s,d){if(l.length===0){t.style.display="none";return}t.style.display="";let p=l.reduce((C,m)=>C+m.priceCents*m.quantity,0),u=Ce(p,s.discountConfig);e&&p>u?(n.textContent=D(p,d),n.style.display=""):n.style.display="none",a.textContent=D(u,d)}return{el:t,update:i}}function Tn(){let e=c("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 r=c("span","",{"data-savings-amount":""});e.appendChild(r);function o(n,a,i){if(n.length===0){e.style.display="none";return}let l=n.reduce((p,u)=>p+u.priceCents*u.quantity,0),s=Ce(l,a.discountConfig),d=Math.max(0,l-s);if(d<=0){e.style.display="none";return}e.style.display="",r.textContent=D(d,i)}return{el:e,update:o}}function An(e,t,r,o){let n=c("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.id});n.style.display="none";let a=c("div","lb-mix-match__modal",{role:"dialog","aria-modal":"true","aria-labelledby":`lb-modal-title-${Et(e.id)}`,tabindex:"-1"}),i=c("div","lb-mix-match__modal-header"),l=c("h4","lb-mix-match__modal-title",{id:`lb-modal-title-${Et(e.id)}`});l.textContent="Pick an item",i.appendChild(l);let s=document.createElement("button");s.type="button",s.className="lb-mix-match__modal-close",s.setAttribute("data-modal-close",""),s.setAttribute("aria-label","Close"),s.innerHTML=At,s.addEventListener("click",L),i.appendChild(s),a.appendChild(i);let d=null,p=null;if(o.showSearch){let f=c("div","lb-mix-match__modal-search");d=document.createElement("input"),d.type="text",d.className="lb-mix-match__modal-search-input",d.setAttribute("data-modal-search",""),d.setAttribute("role","searchbox"),d.setAttribute("aria-label","Search products"),d.setAttribute("placeholder","Search products"),d.autocomplete="off",d.addEventListener("input",()=>E()),f.appendChild(d),p=document.createElement("button"),p.type="button",p.className="lb-mix-match__modal-search-clear",p.setAttribute("data-modal-search-clear",""),p.setAttribute("aria-label","Clear search"),p.style.display="none",p.innerHTML=xn,p.addEventListener("click",()=>{d&&(d.value="",E(),d.focus())}),f.appendChild(p),a.appendChild(f)}let u=c("div","lb-mix-match__modal-list",{"data-modal-list":""});a.appendChild(u);let C=c("div","lb-mix-match__modal-empty",{"data-modal-empty":""});C.style.display="none";let m=document.createElement("p");m.textContent="No products match your search.",C.appendChild(m),a.appendChild(C);let g=c("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"});a.appendChild(g),n.appendChild(a);let k=!1,A=[];function x(){k||(k=!0,u.innerHTML="",t.forEach(f=>{let V=$e(e,f.product.id),P=f.variants,T=f.variants.find(q=>Z(q,V.min))??f.firstAvailableVariant??f.variants[0];if(!T)return;let S=T,I=c("div",f.isOos?"lb-mix-match__modal-product lb-mix-match__modal-product--sold-out":"lb-mix-match__modal-product",{"data-product-id":f.product.id.replace(/^.*\//,"")}),F=c("div","lb-mix-match__modal-product-thumb"),v=(f.variants.find(q=>Z(q,V.min))??f.variants[0]??null)?.image??f.product.featuredImage??null,b=null;v?(b=document.createElement("img"),b.src=re(v.url,{width:U,height:U,crop:"center"}),b.alt=v.altText??f.product.title,b.width=U,b.height=U,b.loading="lazy",F.appendChild(b)):F.insertAdjacentHTML("beforeend",Tt);let w=c("span","lb-bundle-qty-badge");w.hidden=!0,F.appendChild(w),I.appendChild(F);let R=c("div","lb-mix-match__modal-product-info"),ne=c("p","lb-mix-match__modal-product-title");ne.textContent=f.product.title,R.appendChild(ne);let Y=c("p","lb-mix-match__modal-product-price");Y.textContent=D(j(S.price.amount),r),R.appendChild(Y);let ee=c("p","lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price"),ze=le(S.unitPrice,S.unitPriceMeasurement,r);ze?ee.textContent=ze:ee.hidden=!0,R.appendChild(ee);let he=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});he.hidden=!0,R.appendChild(he);let je=q=>{ue(q,V.min,e.widgetConfig.lowStockThreshold,e.widgetConfig.showLowStockBadge)?(he.textContent=`Only ${q.quantityAvailable} left`,he.hidden=!1):he.hidden=!0};je(S);let Qe=()=>{let q=Ue(o.selections,f.product.id,S.id),X=Ne(S,V.max,q),oe=Math.max(V.min,X);return{min:V.min,max:oe,cap:X}},G=null,ve=null;!f.isOos&&o.showQtySelector&&(ve=c("div","lb-bundle-variant-option-group lb-mix-match__qty-stepper-group"),G=Ln({initial:V.min,getBounds:()=>{let{min:q,max:X}=Qe();return{min:q,max:X}}}),ve.appendChild(G.el));let me={el:I,product:f.product,variant:T,refreshFromSelections:()=>{}},se=[];if(P.length>1){let q=P[0].selectedOptions.map($=>$.name),X=f.product.id.replace(/^.*\//,""),oe=$=>P.find(N=>N.selectedOptions.length===$.length&&N.selectedOptions.every((Q,H)=>Q.value===$[H]))??null,xe=$=>{$.selectedOptions.forEach((N,Q)=>{let H=se[Q];H&&H.value!==N.value&&(H.value=N.value)})},ie=($,N,Q)=>P.some(H=>!Z(H,V.min)||H.selectedOptions[$]?.value!==N?!1:H.selectedOptions.every((z,ge)=>ge===$||z.value===Q[ge])),Pe=$=>{se.forEach((N,Q)=>{Array.from(N.options).forEach(H=>{H.disabled=!ie(Q,H.value,$)})})},zt=()=>{let $=se.map(z=>z.value),N=oe($);if(!N){xe(S),Pe(S.selectedOptions.map(z=>z.value));return}S=N,me.variant=N,Y.textContent=D(j(S.price.amount),r);let Q=le(S.unitPrice,S.unitPriceMeasurement,r);Q?(ee.textContent=Q,ee.hidden=!1):(ee.textContent="",ee.hidden=!0);let H=S.image??f.product.featuredImage;b&&H&&(b.src=re(H.url,{width:U,height:U,crop:"center"}),b.alt=H.altText??f.product.title),Pe(N.selectedOptions.map(z=>z.value)),je(S),me.refreshFromSelections()},Ke=c("div","lb-bundle-variant-option-groups");q.forEach(($,N)=>{let Q=c("div","lb-bundle-variant-option-group"),H=c("span","lb-bundle-variant-option-label");H.textContent=$,Q.appendChild(H);let z=document.createElement("select");z.className="lb-mix-match__variant-select",z.setAttribute("data-variant-option",""),z.setAttribute("data-option-position",String(N+1)),z.name=`lb-variant-${X}-${N+1}`,z.setAttribute("aria-label",$);let ge=new Set;P.forEach(jt=>{let de=jt.selectedOptions[N]?.value;if(!de||ge.has(de))return;ge.add(de);let ye=document.createElement("option");ye.value=de,ye.textContent=de,T.selectedOptions[N]?.value===de&&(ye.selected=!0),z.appendChild(ye)}),z.addEventListener("change",zt),se.push(z),Q.appendChild(z),Ke.appendChild(Q)}),R.appendChild(Ke),Pe(T.selectedOptions.map($=>$.value))}else if(P.length===1&&T.title!=="Default Title"){let q=c("span","lb-mix-match__filled-variant");q.textContent=T.title,R.appendChild(q)}if(f.isOos){let q=c("span","lb-mix-match__modal-sold-out-label");q.textContent="Sold out",R.appendChild(q)}I.appendChild(R);let W=null,Wt=()=>{if(!W){se.forEach(ie=>{ie.disabled=!0}),G&&G.setExternallyDisabled(!0);return}let{cap:q}=Qe(),X=Ue(o.selections,f.product.id,S.id);X>0?(w.textContent=String(X),w.hidden=!1):w.hidden=!0,o.selections.some(ie=>ie.productId===f.product.id)?(W.disabled=!0,W.textContent="Added",W.setAttribute("aria-label",`Added ${f.product.title}`),I.classList.add("lb-mix-match__modal-product--in-bundle")):(W.textContent="Add",W.setAttribute("aria-label",`Add ${f.product.title}`),I.classList.remove("lb-mix-match__modal-product--in-bundle"),W.disabled=o.isComplete()||q<V.min);let xe=W.disabled;se.forEach(ie=>{ie.disabled=xe}),G&&G.setExternallyDisabled(xe)};if(!f.isOos){let q=c("div","lb-mix-match__modal-product-actions");ve&&q.appendChild(ve),W=document.createElement("button"),W.type="button",W.className="lb-mix-match__modal-add",W.textContent="Add",W.setAttribute("aria-label",`Add ${f.product.title}`),W.addEventListener("click",()=>{if(!W||W.disabled||o.isComplete())return;let X=G?G.value():V.min;o.onAdd(f.product,S,X),G&&G.reset(V.min);let oe=o.getFocusAfterAdd();oe&&(_=oe),L()}),q.appendChild(W),R.appendChild(q)}me.refreshFromSelections=()=>{G&&G.refresh(),Wt()},me.refreshFromSelections(),A.push(me),u.appendChild(I)}),Se(u),B())}function E(){if(!d)return;let f=d.value.trim().toLowerCase();p&&(p.style.display=f?"":"none");let V=0;A.forEach(P=>{let T=!f||P.product.title.toLowerCase().includes(f);P.el.style.display=T?"":"none",T&&V++}),C.style.display=V===0&&f?"":"none"}let _=null;function O(f){if(f.key==="Escape"){f.preventDefault(),L();return}f.key==="Tab"&&Mn(f,a)}let h=!1;function M(){h||o.isComplete()||(h=!0,x(),_=n.getRootNode().activeElement,n.style.display="",n.classList.add("lb-mix-match__modal-overlay--open"),a.focus(),document.addEventListener("keydown",O),n.addEventListener("click",y))}function L(){h&&(h=!1,n.classList.remove("lb-mix-match__modal-overlay--open"),n.style.display="none",document.removeEventListener("keydown",O),n.removeEventListener("click",y),_ instanceof HTMLElement&&_.focus())}function y(f){f.target===n&&L()}function B(){A.forEach(f=>f.refreshFromSelections())}return{el:n,open:M,close:L,refreshCounts:B}}function Ln(e){let t=c("div","lb-mix-match__qty-stepper",{role:"group","aria-label":"Quantity"}),r=document.createElement("button");r.type="button",r.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",r.setAttribute("aria-label","Decrease quantity"),r.innerHTML=yn,t.appendChild(r);let o=c("span","lb-mix-match__qty-stepper-value",{"aria-live":"polite"});t.appendChild(o);let n=document.createElement("button");n.type="button",n.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",n.setAttribute("aria-label","Increase quantity"),n.innerHTML=wn,t.appendChild(n);let a=l(e.initial,e.getBounds()),i=!1;function l(d,p){return Math.max(p.min,Math.min(p.max,d))}function s(){let d=e.getBounds();a=l(a,d),o.textContent=String(a),r.disabled=i||a<=d.min,n.disabled=i||a>=d.max}return r.addEventListener("click",()=>{let d=e.getBounds();a=l(a-1,d),s()}),n.addEventListener("click",()=>{let d=e.getBounds();a=l(a+1,d),s()}),s(),{el:t,value:()=>a,reset(d){a=l(d,e.getBounds()),s()},refresh:s,setExternallyDisabled(d){i=d,s()}}}function Pn(e,t){let r=[],o=new Set;for(let n of e.products){if(o.has(n.id))continue;o.add(n.id);let a=$e(e,n.id),i=n.variants.nodes.filter(s=>Z(s,a.min)),l=i.length===0;l&&t==="hide"||r.push({product:n,variants:n.variants.nodes,firstAvailableVariant:i[0]??null,isOos:l})}return r}function Mn(e,t){let r=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(r.length===0)return;let o=r[0],n=r[r.length-1],a=t.getRootNode().activeElement;e.shiftKey&&a===o?(e.preventDefault(),n.focus()):!e.shiftKey&&a===n&&(e.preventDefault(),o.focus())}function Et(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Rt(e,t,r,o){let n=t.widgetConfig,a=t.products[0],i=t.volumeTiers[0]?.minQuantity??1,l=a?.variants.nodes.find(h=>Z(h,i));if(!l&&n.outOfStockBehavior==="hide")return;let s=l?j(l.price.amount):0,d=l?.price.currencyCode??"USD",p=t.discountConfig.discountType,u=t.volumeTiers.map((h,M)=>{let L;if(p==="fixed_amount"){let y=Math.round((h.amount??0)*100);L=Math.max(0,s-y)}else{let y=h.percentage??0,B=Math.floor(s*y/100);L=Math.max(0,s-B)}return{tier:h,index:M,qty:h.minQuantity,pricePerUnitCents:L,basePricePerUnitCents:s}}),C=Vn(u),m=n.defaultTier==="best_value"?C:0;typeof n.defaultTier=="number"&&(m=It(n.defaultTier,0,u.length-1));let g=n.popularBadge.tierIndex!==void 0?It(n.popularBadge.tierIndex,0,u.length-1):C,k=c("div","lb-volume");if(k.appendChild(In(t,u,m,d,p)),n.countdown.showCountdown&&t.endsAt){let h=pe(t.endsAt);h&&(k.appendChild(h.el),o?.(h.stop))}let A=c("div","lb-volume__tiers",{role:"radiogroup","aria-label":"Quantity tiers","data-tier-group":""});u.forEach(h=>{let M=Rn(h,h.index===m,d,n.popularBadge.visible&&h.index===g?n.popularBadge.text:null,n.pricing.showComparePrice,n.pricing.showPerUnitPrice);M.addEventListener("click",()=>O(h.index)),M.addEventListener("keydown",L=>{if(L.key==="Enter"||L.key===" "){L.preventDefault(),O(h.index);return}if(L.key==="ArrowDown"||L.key==="ArrowRight"||L.key==="ArrowUp"||L.key==="ArrowLeft"){L.preventDefault();let y=L.key==="ArrowDown"||L.key==="ArrowRight"?1:-1,B=(h.index+y+u.length)%u.length;O(B),A.children[B]?.focus()}}),A.appendChild(M)}),k.appendChild(A),k.appendChild(c("div","lb-bundle-divider"));let x=Pt(u,m,d,n.pricing.showItemCount,n.pricing.showCompareAtPrice);k.appendChild(x);let E=n.savingsBar.visible?Mt(u,m,d):null;E&&k.appendChild(E);let _=Dn(t,()=>{if(!l)return;let h=u[m];h&&r([{merchandiseId:l.id,quantity:h.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}])});if(l&&ue(l,i,n.lowStockThreshold,n.showLowStockBadge)){let h=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});h.textContent=`Only ${l.quantityAvailable} left`,k.appendChild(h)}k.appendChild(_),k.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),k.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(k);function O(h){if(h===m||h<0||h>=u.length)return;m=h,Array.from(A.children).forEach((y,B)=>{y.setAttribute("aria-checked",String(B===h)),y.tabIndex=B===h?0:-1});let M=Pt(u,h,d,n.pricing.showItemCount,n.pricing.showCompareAtPrice);if(x.replaceWith(M),x=M,E){let y=Mt(u,h,d);E.replaceWith(y),E=y}let L=k.querySelector("[data-header-badge]");if(L){let y=Dt(u[h],d,p);y?(L.textContent=y,L.style.display=""):L.style.display="none"}}}function In(e,t,r,o,n){let a=e.widgetConfig,i=c("div","lb-bundle-header"),l=c("div","lb-bundle-header__content"),s=c("h3","lb-bundle-title");if(s.textContent=e.title,l.appendChild(s),i.appendChild(l),a.pricing.showSaveBadge){let d=Dt(t[r],o,n);if(d){let p=c("span","lb-bundle-header__badge",{"data-header-badge":""});p.textContent=d,i.appendChild(p)}}return i}function Rn(e,t,r,o,n,a){let i=c("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=c("span","lb-volume__radio");l.appendChild(c("span","lb-volume__radio-dot")),i.appendChild(l);let s=c("span","lb-volume__tier-grid"),d=c("span","lb-volume__tier-label");d.textContent=`Buy ${e.qty}`,s.appendChild(d);let p=c("span","lb-volume__tier-price");if(n&&e.pricePerUnitCents<e.basePricePerUnitCents){let C=c("span","lb-volume__tier-compare");C.textContent=D(e.basePricePerUnitCents,r),p.appendChild(C)}if(a){let C=document.createElement("span");C.setAttribute("data-tier-price-each",""),C.textContent=D(e.pricePerUnitCents,r),p.appendChild(C);let m=c("span","lb-volume__tier-unit");m.textContent=" each",p.appendChild(m)}s.appendChild(p),i.appendChild(s);let u=c("span","lb-volume__tier-badge");return o?u.textContent=o:u.style.display="none",i.appendChild(u),i}function Pt(e,t,r,o,n){let a=e[t],i=a?a.pricePerUnitCents*a.qty:0,l=a?a.basePricePerUnitCents*a.qty:0,s=Math.max(0,l-i),d=c("div","lb-bundle-pricing"),p=c("span","lb-bundle-pricing__label",{"data-total-label":""});if(p.textContent="Total",o&&a){let m=document.createElement("span");m.setAttribute("data-item-count",""),m.textContent=` (${a.qty} item${a.qty===1?"":"s"})`,p.appendChild(m)}d.appendChild(p);let u=c("span","lb-bundle-pricing__prices");if(n&&s>0){let m=c("span","lb-bundle-compare-price",{"data-compare-price":""});m.textContent=D(l,r),u.appendChild(m)}let C=c("span","lb-bundle-sale-price",{"data-total-price":""});return C.textContent=D(i,r),u.appendChild(C),d.appendChild(u),d}function Mt(e,t,r){let o=e[t],n=o?o.pricePerUnitCents*o.qty:0,a=o?o.basePricePerUnitCents*o.qty:0,i=Math.max(0,a-n),l=c("div","lb-bundle-savings-bar",{"data-savings-bar":""});i<=0&&(l.style.display="none");let s=document.createElement("span");s.textContent="You save",l.appendChild(s);let d=c("span","",{"data-savings-amount":""});return d.textContent=D(i,r),l.appendChild(d),l}function Dn(e,t){let r=e.products[0],o=e.volumeTiers[0]?.minQuantity??1,n=r?.variants.nodes.some(l=>Z(l,o)),a=n?e.widgetConfig.cta.ctaText||"Add to cart":"Sold out",i=be(a);return n||(i.disabled=!0),i.addEventListener("click",()=>{i.disabled||t()}),i}function Dt(e,t,r){if(!e)return null;let{tier:o}=e;if(r==="fixed_amount"){let n=o.amount??0;return n>0?`-${D(Math.round(n*100),t)}`:null}if(r==="percentage"){let n=o.percentage??0;return n>0?`-${Math.round(n)}%`:null}return null}function Vn(e){let t=0,r=0;return e.forEach((o,n)=>{let a=o.basePricePerUnitCents-o.pricePerUnitCents;a>t&&(t=a,r=n)}),r}function It(e,t,r){return Math.max(t,Math.min(r,e))}var qn=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),Te=new Set,Ae=!1;function Vt(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let r of Te)r.classList.add(e),r.classList.remove(t)}function qt(e){qn.has(e.key)&&Vt("using-keyboard")}function Ot(){Vt("using-mouse")}function On(){Ae||(Ae=!0,document.addEventListener("keydown",qt,!0),document.addEventListener("pointerdown",Ot,!0))}function Fn(){Ae&&(Ae=!1,document.removeEventListener("keydown",qt,!0),document.removeEventListener("pointerdown",Ot,!0))}function Le(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),Te.add(e),On(),()=>{Te.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),Te.size===0&&Fn()}}var We=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
260
+ </svg>`;function $e(e,t){return e.productRules[t]??pt}function Ue(e,t,r){let o=0;for(let n of e)n.productId===t&&n.variantId===r&&(o+=n.quantity);return o}function Tt(e,t,r,o){let n=t.widgetConfig,i=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",a=t.minQuantity??1,l=n.mixMatchShowQuantitySelector!==!1,d=Pn(t,n.outOfStockBehavior);if(d.filter(y=>!y.isOos).length<a)return;let p=[],u=c("div","lb-mix-match",{"data-required-quantity":String(a)}),C=kn(t);if(u.appendChild(C),n.countdown.showCountdown&&t.endsAt){let y=pe(t.endsAt);y&&(u.appendChild(y.el),o?.(y.stop))}let m=_n(a);u.appendChild(m.el);let g=c("div","lb-mix-match__slots",{"data-selection-slots":""});u.appendChild(g),u.appendChild(c("div","lb-bundle-divider"));let k=En(n.pricing.showCompareAtPrice);u.appendChild(k.el);let A=n.savingsBar.visible?Tn():null;A&&u.appendChild(A.el);let x=be(`Select ${a} items to unlock`);x.disabled=!0,x.addEventListener("click",()=>{x.disabled||r(Cn(p,t))});let E=An(t,d,i,{showSearch:n.showSearch,showQtySelector:l,selections:p,onAdd:(y,B,f)=>_(y,B,f),isComplete:()=>p.length>=a,getFocusAfterAdd:()=>g.querySelector(".lb-mix-match__slot--empty")??x});u.appendChild(E.el),u.appendChild(x),u.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),u.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(u),o?.(()=>Ee(u)),h();function _(y,B,f){if(p.length>=a)return;let q=$e(t,y.id),P=Ne(B,q.max,Ue(p,y.id,B.id));if(P<q.min)return;let T=Math.max(q.min,Math.min(f,P));p.push({productId:y.id,productTitle:y.title,variantId:B.id,variantTitle:B.title,imageUrl:B.image?.url??y.featuredImage?.url??null,priceCents:j(B.price.amount),compareCents:B.compareAtPrice?j(B.compareAtPrice.amount):null,unitPriceLabel:le(B.unitPrice,B.unitPriceMeasurement,i),quantity:T}),h()}function O(y){y<0||y>=p.length||(p.splice(y,1),h())}function h(){M(),m.update(p.length),k.update(p,t,i),A&&A.update(p,t,i),E.refreshCounts(),L()}function M(){g.innerHTML="";let y=Math.max(a,p.length);for(let B=0;B<y;B++){let f=p[B];f?g.appendChild(Sn(f,B,i,()=>O(B))):g.appendChild(Bn(B,()=>E.open()))}}function L(){let y=p.length;y<a?(x.disabled=!0,He(x,`Select ${a-y} more to unlock`)):(x.disabled=!1,He(x,n.cta.ctaText||"Add to cart"))}}function Cn(e,t){let r=new Map;for(let o of e){let n=`${o.productId}::${o.variantId}`,i=r.get(n);i?i.quantity+=o.quantity:r.set(n,{variantId:o.variantId,quantity:o.quantity})}return Array.from(r.values()).map(o=>({merchandiseId:o.variantId,quantity:o.quantity,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}))}function kn(e){let t=e.widgetConfig,r=c("div","lb-bundle-header"),o=c("div","lb-bundle-header__content"),n=c("h3","lb-bundle-title");if(n.textContent=e.title,o.appendChild(n),r.appendChild(o),t.pricing.showSaveBadge){let{discountType:i,discountValue:a}=e.discountConfig,l=null;if(i==="percentage"&&a>0?l=`-${Math.round(a)}%`:i==="fixed_amount"&&a>0&&(l=`-${D(Math.round(a*100),e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD")}`),l){let d=c("span","lb-bundle-header__badge");d.textContent=l,r.appendChild(d)}}return r}function _n(e){let t=c("div","lb-mix-match__progress"),r=c("div","lb-mix-match__progress-labels"),o=c("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"});o.textContent=`0 of ${e} selected`,r.appendChild(o);let n=c("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"});n.textContent=`${e} more to go`,r.appendChild(n),t.appendChild(r);let i=c("div","lb-mix-match__progress-track",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)}),a=c("div","lb-mix-match__progress-fill",{"data-progress-fill":""});a.style.width="0%",i.appendChild(a),t.appendChild(i);function l(d){let s=Math.min(100,d/e*100);o.textContent=`${d} of ${e} selected`,d>=e?n.textContent="Complete":n.textContent=`${e-d} more to go`,a.style.width=`${s}%`,i.setAttribute("aria-valuenow",String(Math.min(d,e)))}return{el:t,update:l}}function Bn(e,t){let r=c("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=c("div","lb-mix-match__empty-thumb");o.innerHTML=vn,r.appendChild(o);let n=c("span","lb-mix-match__empty-text");return n.textContent="Choose an item",r.appendChild(n),r.addEventListener("click",t),r.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t())}),r}function Sn(e,t,r,o){let n=c("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--filled",{"data-slot":String(t+1)}),i=c("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.imageUrl){let g=document.createElement("img");g.src=re(e.imageUrl,{width:U,height:U,crop:"center"}),g.alt=e.productTitle,g.width=U,g.height=U,g.loading="lazy",i.appendChild(g)}else i.insertAdjacentHTML("beforeend",St);let a=c("span","lb-bundle-qty-badge");a.textContent=`\xD7${e.quantity}`,i.appendChild(a),n.appendChild(i);let l=c("div","lb-mix-match__filled-info"),d=c("span","lb-mix-match__filled-title");if(d.textContent=e.productTitle,l.appendChild(d),e.variantTitle&&e.variantTitle!=="Default Title"){let g=c("span","lb-mix-match__filled-variant");g.textContent=e.variantTitle,l.appendChild(g)}let s=e.priceCents*e.quantity,p=e.compareCents!==null?e.compareCents*e.quantity:null,u=c("span","lb-mix-match__filled-price");if(p!==null&&p>s){let g=c("span","lb-mix-match__filled-compare");g.textContent=D(p,r),u.appendChild(g)}let C=document.createElement("span");if(C.textContent=D(s,r),u.appendChild(C),l.appendChild(u),e.unitPriceLabel){let g=c("span","lb-bundle-product-unit-price");g.textContent=e.unitPriceLabel,l.appendChild(g)}n.appendChild(l);let m=document.createElement("button");return m.type="button",m.className="lb-mix-match__slot-remove",m.setAttribute("aria-label",`Remove ${e.productTitle}`),m.innerHTML=Et,m.addEventListener("click",g=>{g.stopPropagation(),o()}),n.appendChild(m),n}function En(e){let t=c("div","lb-bundle-pricing",{"data-pricing-section":""});t.style.display="none";let r=c("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=c("span","lb-bundle-pricing__prices"),n=c("span","lb-bundle-compare-price",{"data-compare-price":""});e&&o.appendChild(n);let i=c("span","lb-bundle-sale-price",{"data-sale-price":""});o.appendChild(i),t.appendChild(o);function a(l,d,s){if(l.length===0){t.style.display="none";return}t.style.display="";let p=l.reduce((C,m)=>C+m.priceCents*m.quantity,0),u=Ce(p,d.discountConfig);e&&p>u?(n.textContent=D(p,s),n.style.display=""):n.style.display="none",i.textContent=D(u,s)}return{el:t,update:a}}function Tn(){let e=c("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 r=c("span","",{"data-savings-amount":""});e.appendChild(r);function o(n,i,a){if(n.length===0){e.style.display="none";return}let l=n.reduce((p,u)=>p+u.priceCents*u.quantity,0),d=Ce(l,i.discountConfig),s=Math.max(0,l-d);if(s<=0){e.style.display="none";return}e.style.display="",r.textContent=D(s,a)}return{el:e,update:o}}function An(e,t,r,o){let n=c("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.id});n.style.display="none";let i=c("div","lb-mix-match__modal",{role:"dialog","aria-modal":"true","aria-labelledby":`lb-modal-title-${Bt(e.id)}`,tabindex:"-1"}),a=c("div","lb-mix-match__modal-header"),l=c("h4","lb-mix-match__modal-title",{id:`lb-modal-title-${Bt(e.id)}`});l.textContent="Pick an item",a.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=Et,d.addEventListener("click",L),a.appendChild(d),i.appendChild(a);let s=null,p=null;if(o.showSearch){let f=c("div","lb-mix-match__modal-search");s=document.createElement("input"),s.type="text",s.className="lb-mix-match__modal-search-input",s.setAttribute("data-modal-search",""),s.setAttribute("role","searchbox"),s.setAttribute("aria-label","Search products"),s.setAttribute("placeholder","Search products"),s.autocomplete="off",s.addEventListener("input",()=>E()),f.appendChild(s),p=document.createElement("button"),p.type="button",p.className="lb-mix-match__modal-search-clear",p.setAttribute("data-modal-search-clear",""),p.setAttribute("aria-label","Clear search"),p.style.display="none",p.innerHTML=xn,p.addEventListener("click",()=>{s&&(s.value="",E(),s.focus())}),f.appendChild(p),i.appendChild(f)}let u=c("div","lb-mix-match__modal-list",{"data-modal-list":""});i.appendChild(u);let C=c("div","lb-mix-match__modal-empty",{"data-modal-empty":""});C.style.display="none";let m=document.createElement("p");m.textContent="No products match your search.",C.appendChild(m),i.appendChild(C);let g=c("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"});i.appendChild(g),n.appendChild(i);let k=!1,A=[];function x(){k||(k=!0,u.innerHTML="",t.forEach(f=>{let q=$e(e,f.product.id),P=f.variants,T=f.variants.find(V=>Z(V,q.min))??f.firstAvailableVariant??f.variants[0];if(!T)return;let S=T,I=c("div",f.isOos?"lb-mix-match__modal-product lb-mix-match__modal-product--sold-out":"lb-mix-match__modal-product",{"data-product-id":f.product.id.replace(/^.*\//,"")}),F=c("div","lb-mix-match__modal-product-thumb"),v=(f.variants.find(V=>Z(V,q.min))??f.variants[0]??null)?.image??f.product.featuredImage??null,b=null;v?(b=document.createElement("img"),b.src=re(v.url,{width:U,height:U,crop:"center"}),b.alt=v.altText??f.product.title,b.width=U,b.height=U,b.loading="lazy",F.appendChild(b)):F.insertAdjacentHTML("beforeend",St);let w=c("span","lb-bundle-qty-badge");w.hidden=!0,F.appendChild(w),I.appendChild(F);let R=c("div","lb-mix-match__modal-product-info"),ne=c("p","lb-mix-match__modal-product-title");ne.textContent=f.product.title,R.appendChild(ne);let Y=c("p","lb-mix-match__modal-product-price");Y.textContent=D(j(S.price.amount),r),R.appendChild(Y);let ee=c("p","lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price"),ze=le(S.unitPrice,S.unitPriceMeasurement,r);ze?ee.textContent=ze:ee.hidden=!0,R.appendChild(ee);let he=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});he.hidden=!0,R.appendChild(he);let je=V=>{ue(V,q.min,e.widgetConfig.lowStockThreshold,e.widgetConfig.showLowStockBadge)?(he.textContent=`Only ${V.quantityAvailable} left`,he.hidden=!1):he.hidden=!0};je(S);let Qe=()=>{let V=Ue(o.selections,f.product.id,S.id),X=Ne(S,q.max,V),oe=Math.max(q.min,X);return{min:q.min,max:oe,cap:X}},K=null,ve=null;!f.isOos&&o.showQtySelector&&(ve=c("div","lb-bundle-variant-option-group lb-mix-match__qty-stepper-group"),K=Ln({initial:q.min,getBounds:()=>{let{min:V,max:X}=Qe();return{min:V,max:X}}}),ve.appendChild(K.el));let me={el:I,product:f.product,variant:T,refreshFromSelections:()=>{}},de=[];if(P.length>1){let V=P[0].selectedOptions.map($=>$.name),X=f.product.id.replace(/^.*\//,""),oe=$=>P.find(N=>N.selectedOptions.length===$.length&&N.selectedOptions.every((Q,H)=>Q.value===$[H]))??null,xe=$=>{$.selectedOptions.forEach((N,Q)=>{let H=de[Q];H&&H.value!==N.value&&(H.value=N.value)})},ie=($,N,Q)=>P.some(H=>!Z(H,q.min)||H.selectedOptions[$]?.value!==N?!1:H.selectedOptions.every((z,ge)=>ge===$||z.value===Q[ge])),Pe=$=>{de.forEach((N,Q)=>{Array.from(N.options).forEach(H=>{H.disabled=!ie(Q,H.value,$)})})},$t=()=>{let $=de.map(z=>z.value),N=oe($);if(!N){xe(S),Pe(S.selectedOptions.map(z=>z.value));return}S=N,me.variant=N,Y.textContent=D(j(S.price.amount),r);let Q=le(S.unitPrice,S.unitPriceMeasurement,r);Q?(ee.textContent=Q,ee.hidden=!1):(ee.textContent="",ee.hidden=!0);let H=S.image??f.product.featuredImage;b&&H&&(b.src=re(H.url,{width:U,height:U,crop:"center"}),b.alt=H.altText??f.product.title),Pe(N.selectedOptions.map(z=>z.value)),je(S),me.refreshFromSelections()},Ge=c("div","lb-bundle-variant-option-groups");V.forEach(($,N)=>{let Q=c("div","lb-bundle-variant-option-group"),H=c("span","lb-bundle-variant-option-label");H.textContent=$,Q.appendChild(H);let z=document.createElement("select");z.className="lb-mix-match__variant-select",z.setAttribute("data-variant-option",""),z.setAttribute("data-option-position",String(N+1)),z.name=`lb-variant-${X}-${N+1}`,z.setAttribute("aria-label",$);let ge=new Set;P.forEach(Wt=>{let se=Wt.selectedOptions[N]?.value;if(!se||ge.has(se))return;ge.add(se);let ye=document.createElement("option");ye.value=se,ye.textContent=se,T.selectedOptions[N]?.value===se&&(ye.selected=!0),z.appendChild(ye)}),z.addEventListener("change",$t),de.push(z),Q.appendChild(z),Ge.appendChild(Q)}),R.appendChild(Ge),Pe(T.selectedOptions.map($=>$.value))}else if(P.length===1&&T.title!=="Default Title"){let V=c("span","lb-mix-match__filled-variant");V.textContent=T.title,R.appendChild(V)}if(f.isOos){let V=c("span","lb-mix-match__modal-sold-out-label");V.textContent="Sold out",R.appendChild(V)}I.appendChild(R);let W=null,Ut=()=>{if(!W){de.forEach(ie=>{ie.disabled=!0}),K&&K.setExternallyDisabled(!0);return}let{cap:V}=Qe(),X=Ue(o.selections,f.product.id,S.id);X>0?(w.textContent=String(X),w.hidden=!1):w.hidden=!0,o.selections.some(ie=>ie.productId===f.product.id)?(W.disabled=!0,W.textContent="Added",W.setAttribute("aria-label",`Added ${f.product.title}`),I.classList.add("lb-mix-match__modal-product--in-bundle")):(W.textContent="Add",W.setAttribute("aria-label",`Add ${f.product.title}`),I.classList.remove("lb-mix-match__modal-product--in-bundle"),W.disabled=o.isComplete()||V<q.min);let xe=W.disabled;de.forEach(ie=>{ie.disabled=xe}),K&&K.setExternallyDisabled(xe)};if(!f.isOos){let V=c("div","lb-mix-match__modal-product-actions");ve&&V.appendChild(ve),W=document.createElement("button"),W.type="button",W.className="lb-mix-match__modal-add",W.textContent="Add",W.setAttribute("aria-label",`Add ${f.product.title}`),W.addEventListener("click",()=>{if(!W||W.disabled||o.isComplete())return;let X=K?K.value():q.min;o.onAdd(f.product,S,X),K&&K.reset(q.min);let oe=o.getFocusAfterAdd();oe&&(_=oe),L()}),V.appendChild(W),R.appendChild(V)}me.refreshFromSelections=()=>{K&&K.refresh(),Ut()},me.refreshFromSelections(),A.push(me),u.appendChild(I)}),Se(u),B())}function E(){if(!s)return;let f=s.value.trim().toLowerCase();p&&(p.style.display=f?"":"none");let q=0;A.forEach(P=>{let T=!f||P.product.title.toLowerCase().includes(f);P.el.style.display=T?"":"none",T&&q++}),C.style.display=q===0&&f?"":"none"}let _=null;function O(f){if(f.key==="Escape"){f.preventDefault(),L();return}f.key==="Tab"&&Mn(f,i)}let h=!1;function M(){h||o.isComplete()||(h=!0,x(),_=n.getRootNode().activeElement,n.style.display="",n.classList.add("lb-mix-match__modal-overlay--open"),i.focus(),document.addEventListener("keydown",O),n.addEventListener("click",y))}function L(){h&&(h=!1,n.classList.remove("lb-mix-match__modal-overlay--open"),n.style.display="none",document.removeEventListener("keydown",O),n.removeEventListener("click",y),_ instanceof HTMLElement&&_.focus())}function y(f){f.target===n&&L()}function B(){A.forEach(f=>f.refreshFromSelections())}return{el:n,open:M,close:L,refreshCounts:B}}function Ln(e){let t=c("div","lb-mix-match__qty-stepper",{role:"group","aria-label":"Quantity"}),r=document.createElement("button");r.type="button",r.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",r.setAttribute("aria-label","Decrease quantity"),r.innerHTML=yn,t.appendChild(r);let o=c("span","lb-mix-match__qty-stepper-value",{"aria-live":"polite"});t.appendChild(o);let n=document.createElement("button");n.type="button",n.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",n.setAttribute("aria-label","Increase quantity"),n.innerHTML=wn,t.appendChild(n);let i=l(e.initial,e.getBounds()),a=!1;function l(s,p){return Math.max(p.min,Math.min(p.max,s))}function d(){let s=e.getBounds();i=l(i,s),o.textContent=String(i),r.disabled=a||i<=s.min,n.disabled=a||i>=s.max}return r.addEventListener("click",()=>{let s=e.getBounds();i=l(i-1,s),d()}),n.addEventListener("click",()=>{let s=e.getBounds();i=l(i+1,s),d()}),d(),{el:t,value:()=>i,reset(s){i=l(s,e.getBounds()),d()},refresh:d,setExternallyDisabled(s){a=s,d()}}}function Pn(e,t){let r=[],o=new Set;for(let n of e.products){if(o.has(n.id))continue;o.add(n.id);let i=$e(e,n.id),a=n.variants.nodes.filter(d=>Z(d,i.min)),l=a.length===0;l&&t==="hide"||r.push({product:n,variants:n.variants.nodes,firstAvailableVariant:a[0]??null,isOos:l})}return r}function Mn(e,t){let r=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(r.length===0)return;let o=r[0],n=r[r.length-1],i=t.getRootNode().activeElement;e.shiftKey&&i===o?(e.preventDefault(),n.focus()):!e.shiftKey&&i===n&&(e.preventDefault(),o.focus())}function Bt(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Mt(e,t,r,o){let n=t.widgetConfig,i=t.products[0],a=t.volumeTiers[0]?.minQuantity??1,l=i?.variants.nodes.find(h=>Z(h,a));if(!l&&n.outOfStockBehavior==="hide")return;let d=l?j(l.price.amount):0,s=l?.price.currencyCode??"USD",p=t.discountConfig.discountType,u=t.volumeTiers.map((h,M)=>{let L;if(p==="fixed_amount"){let y=Math.round((h.amount??0)*100);L=Math.max(0,d-y)}else{let y=h.percentage??0,B=Math.floor(d*y/100);L=Math.max(0,d-B)}return{tier:h,index:M,qty:h.minQuantity,pricePerUnitCents:L,basePricePerUnitCents:d}}),C=qn(u),m=n.defaultTier==="best_value"?C:0;typeof n.defaultTier=="number"&&(m=Pt(n.defaultTier,0,u.length-1));let g=n.popularBadge.tierIndex!==void 0?Pt(n.popularBadge.tierIndex,0,u.length-1):C,k=c("div","lb-volume");if(k.appendChild(In(t,u,m,s,p)),n.countdown.showCountdown&&t.endsAt){let h=pe(t.endsAt);h&&(k.appendChild(h.el),o?.(h.stop))}let A=c("div","lb-volume__tiers",{role:"radiogroup","aria-label":"Quantity tiers","data-tier-group":""});u.forEach(h=>{let M=Rn(h,h.index===m,s,n.popularBadge.visible&&h.index===g?n.popularBadge.text:null,n.pricing.showComparePrice,n.pricing.showPerUnitPrice);M.addEventListener("click",()=>O(h.index)),M.addEventListener("keydown",L=>{if(L.key==="Enter"||L.key===" "){L.preventDefault(),O(h.index);return}if(L.key==="ArrowDown"||L.key==="ArrowRight"||L.key==="ArrowUp"||L.key==="ArrowLeft"){L.preventDefault();let y=L.key==="ArrowDown"||L.key==="ArrowRight"?1:-1,B=(h.index+y+u.length)%u.length;O(B),A.children[B]?.focus()}}),A.appendChild(M)}),k.appendChild(A),k.appendChild(c("div","lb-bundle-divider"));let x=At(u,m,s,n.pricing.showItemCount,n.pricing.showCompareAtPrice);k.appendChild(x);let E=n.savingsBar.visible?Lt(u,m,s):null;E&&k.appendChild(E);let _=Dn(t,()=>{if(!l)return;let h=u[m];h&&r([{merchandiseId:l.id,quantity:h.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}])});if(l&&ue(l,a,n.lowStockThreshold,n.showLowStockBadge)){let h=c("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});h.textContent=`Only ${l.quantityAvailable} left`,k.appendChild(h)}k.appendChild(_),k.appendChild(c("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),k.appendChild(c("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(k);function O(h){if(h===m||h<0||h>=u.length)return;m=h,Array.from(A.children).forEach((y,B)=>{y.setAttribute("aria-checked",String(B===h)),y.tabIndex=B===h?0:-1});let M=At(u,h,s,n.pricing.showItemCount,n.pricing.showCompareAtPrice);if(x.replaceWith(M),x=M,E){let y=Lt(u,h,s);E.replaceWith(y),E=y}let L=k.querySelector("[data-header-badge]");if(L){let y=It(u[h],s,p);y?(L.textContent=y,L.style.display=""):L.style.display="none"}}}function In(e,t,r,o,n){let i=e.widgetConfig,a=c("div","lb-bundle-header"),l=c("div","lb-bundle-header__content"),d=c("h3","lb-bundle-title");if(d.textContent=e.title,l.appendChild(d),a.appendChild(l),i.pricing.showSaveBadge){let s=It(t[r],o,n);if(s){let p=c("span","lb-bundle-header__badge",{"data-header-badge":""});p.textContent=s,a.appendChild(p)}}return a}function Rn(e,t,r,o,n,i){let a=c("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=c("span","lb-volume__radio");l.appendChild(c("span","lb-volume__radio-dot")),a.appendChild(l);let d=c("span","lb-volume__tier-grid"),s=c("span","lb-volume__tier-label");s.textContent=`Buy ${e.qty}`,d.appendChild(s);let p=c("span","lb-volume__tier-price");if(n&&e.pricePerUnitCents<e.basePricePerUnitCents){let C=c("span","lb-volume__tier-compare");C.textContent=D(e.basePricePerUnitCents,r),p.appendChild(C)}if(i){let C=document.createElement("span");C.setAttribute("data-tier-price-each",""),C.textContent=D(e.pricePerUnitCents,r),p.appendChild(C);let m=c("span","lb-volume__tier-unit");m.textContent=" each",p.appendChild(m)}d.appendChild(p),a.appendChild(d);let u=c("span","lb-volume__tier-badge");return o?u.textContent=o:u.style.display="none",a.appendChild(u),a}function At(e,t,r,o,n){let i=e[t],a=i?i.pricePerUnitCents*i.qty:0,l=i?i.basePricePerUnitCents*i.qty:0,d=Math.max(0,l-a),s=c("div","lb-bundle-pricing"),p=c("span","lb-bundle-pricing__label",{"data-total-label":""});if(p.textContent="Total",o&&i){let m=document.createElement("span");m.setAttribute("data-item-count",""),m.textContent=` (${i.qty} item${i.qty===1?"":"s"})`,p.appendChild(m)}s.appendChild(p);let u=c("span","lb-bundle-pricing__prices");if(n&&d>0){let m=c("span","lb-bundle-compare-price",{"data-compare-price":""});m.textContent=D(l,r),u.appendChild(m)}let C=c("span","lb-bundle-sale-price",{"data-total-price":""});return C.textContent=D(a,r),u.appendChild(C),s.appendChild(u),s}function Lt(e,t,r){let o=e[t],n=o?o.pricePerUnitCents*o.qty:0,i=o?o.basePricePerUnitCents*o.qty:0,a=Math.max(0,i-n),l=c("div","lb-bundle-savings-bar",{"data-savings-bar":""});a<=0&&(l.style.display="none");let d=document.createElement("span");d.textContent="You save",l.appendChild(d);let s=c("span","",{"data-savings-amount":""});return s.textContent=D(a,r),l.appendChild(s),l}function Dn(e,t){let r=e.products[0],o=e.volumeTiers[0]?.minQuantity??1,n=r?.variants.nodes.some(l=>Z(l,o)),i=n?e.widgetConfig.cta.ctaText||"Add to cart":"Sold out",a=be(i);return n||(a.disabled=!0),a.addEventListener("click",()=>{a.disabled||t()}),a}function It(e,t,r){if(!e)return null;let{tier:o}=e;if(r==="fixed_amount"){let n=o.amount??0;return n>0?`-${D(Math.round(n*100),t)}`:null}if(r==="percentage"){let n=o.percentage??0;return n>0?`-${Math.round(n)}%`:null}return null}function qn(e){let t=0,r=0;return e.forEach((o,n)=>{let i=o.basePricePerUnitCents-o.pricePerUnitCents;i>t&&(t=i,r=n)}),r}function Pt(e,t,r){return Math.max(t,Math.min(r,e))}var Vn=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),Te=new Set,Ae=!1;function Rt(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let r of Te)r.classList.add(e),r.classList.remove(t)}function Dt(e){Vn.has(e.key)&&Rt("using-keyboard")}function qt(){Rt("using-mouse")}function On(){Ae||(Ae=!0,document.addEventListener("keydown",Dt,!0),document.addEventListener("pointerdown",qt,!0))}function Fn(){Ae&&(Ae=!1,document.removeEventListener("keydown",Dt,!0),document.removeEventListener("pointerdown",qt,!0))}function Le(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),Te.add(e),On(),()=>{Te.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),Te.size===0&&Fn()}}var We=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
261
261
 
262
262
  .lb-bundle-widget.lb-bundle-widget,
263
263
  .lb-bundle-widget.lb-bundle-widget * {
@@ -865,7 +865,7 @@ a.lb-bundle-product-name:focus-visible {
865
865
  .lb-ab-pending {
866
866
  visibility: hidden;
867
867
  }
868
- `,Ft=`/* Lime Bundles \u2014 Fixed bundle styles */
868
+ `,Vt=`/* Lime Bundles \u2014 Fixed bundle styles */
869
869
 
870
870
  .lb-fixed__products {
871
871
  display: flex;
@@ -941,7 +941,7 @@ a.lb-bundle-product-name:focus-visible {
941
941
  outline-offset: 2px;
942
942
  box-shadow: none;
943
943
  }
944
- `,Nt=`/* Lime Bundles \u2014 Mix & Match styles */
944
+ `,Ot=`/* Lime Bundles \u2014 Mix & Match styles */
945
945
 
946
946
  /* === Slot list ============================================================
947
947
  Caps the height of the slot stack so long bundles don't push the CTA off
@@ -1573,7 +1573,7 @@ a.lb-bundle-product-name:focus-visible {
1573
1573
  transition: none;
1574
1574
  }
1575
1575
  }
1576
- `,Ht=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
1576
+ `,Ft=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
1577
1577
 
1578
1578
  .lb-volume__tiers {
1579
1579
  display: flex;
@@ -1713,7 +1713,7 @@ a.lb-bundle-product-name:focus-visible {
1713
1713
  }
1714
1714
 
1715
1715
 
1716
- `,Ut=`/**
1716
+ `,Nt=`/**
1717
1717
  * Lime Bundles \u2014 Custom variant-picker dropdown styling.
1718
1718
  *
1719
1719
  * Reuses existing CSS variables: no new merchant-configurable surface.
@@ -1966,7 +1966,7 @@ a.lb-bundle-product-name:focus-visible {
1966
1966
  [data-modal-overlay] > .lb-dropdown-listbox::-webkit-scrollbar-thumb {
1967
1967
  background: color-mix(in srgb, var(--lb-picker-text) 15%, transparent);
1968
1968
  }
1969
- `,$t=`/* Lime Bundles \u2014 web-component loading skeleton (not mirrored to theme assets) */
1969
+ `,Ht=`/* Lime Bundles \u2014 web-component loading skeleton (not mirrored to theme assets) */
1970
1970
 
1971
1971
  .lb-bundle-widget--loading {
1972
1972
  display: block;
@@ -2062,10 +2062,10 @@ a.lb-bundle-product-name:focus-visible {
2062
2062
  animation: none;
2063
2063
  }
2064
2064
  }
2065
- `;var Nn=e=>`lb_cart_id:${e}`;function Hn(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 fe=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","app-url","analytics","locale","country","language","market-id"];buyer=void 0;shadow;bundles=[];abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){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,r,o){r===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"}get country(){return this.getAttribute("country")??void 0}get language(){return this.getAttribute("language")??void 0}get marketId(){return this.getAttribute("market-id")??void 0}wrapQueryForContext(t){return it({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer})?at(t):t}isMarketHidden(t){return t.marketVisibility!=="specific"?!1:this.marketId?!t.marketIds.includes(this.marketId):!0}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 r=De({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer});try{let o,n=!1;if(this.bundleGid)n=!0,o=this.fetchSingleBundle(r,t.signal);else{let l=Hn(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(r,t.signal,l)}let a=r.query(st,void 0,{signal:t.signal}).catch(()=>null);if(await o,t.signal.aborted)return;if(n&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let i=await a;if(i?.shop?.metafield?.value){Ct(this.shopDomain,i.shop.metafield.value);let l=qe(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.bundles.length===0)return;let t=await Promise.all(this.bundles.map(async r=>{if(!r.abTestId||!r.abVariantB)return r;try{if((await wt(r.abTestId,r.id))?.variant==="B")return mt(r)}catch(o){console.warn(`[lime-bundle] A/B assignment failed for bundle ${r.id}; falling back to Variant A.`,o)}return r}));this.bundles=t}async fetchSingleBundle(t,r){let o=await t.query(this.wrapQueryForContext(lt),{id:this.bundleGid},{signal:r});if(!o.metaobject){this.bundles=[];return}let n=Ve(o.metaobject.id,o.metaobject.fields);this.bundles=n&&!this.isMarketHidden(n)?[n]:[]}async fetchProductBundles(t,r,o){let n=await t.query(this.wrapQueryForContext(dt),{handle:o},{signal:r});if(!n.product){this.bundles=[];return}let a=n.product.metafield?.references?.nodes??[],i=[];for(let l of a){let s=Ve(l.id,l.fields);s&&!this.isMarketHidden(s)&&i.push(s)}this.bundles=i}handleAddToCart=async(t,r)=>{let o=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:r},bubbles:!0,composed:!0,cancelable:!0}),n=this.dispatchEvent(o);this.reportAddToCartEvent(t,r),n&&await this.defaultAddToCart(r)};async defaultAddToCart(t){if(typeof window>"u")return;let r=De({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),o=window.localStorage,n=Nn(this.shopDomain),a=o?.getItem(n)??null;try{let i=null;if(a){let s=(await r.query(ut,{cartId:a,lines:t})).cartLinesAdd;s?.userErrors?.length?o?.removeItem(n):s?.cart&&(i=s.cart.checkoutUrl)}if(!i){let s=(await r.query(ct,{input:{lines:t}})).cartCreate;s?.cart&&(o?.setItem(n,s.cart.id),i=s.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,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=r.reduce((a,i)=>a+i.quantity,0),n=r.reduce((a,i)=>{let s=t.products.find(p=>p.variants.nodes.some(u=>u.id===i.merchandiseId))?.variants.nodes.find(p=>p.id===i.merchandiseId),d=s?parseFloat(s.price.amount):0;return a+d*i.quantity},0);ft({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:o,totalPrice:Math.round(n*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[We,Ft,Nt,Ht,Ut].join(`
2066
- `),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 n=document.createElement("div");n.className="lb-bundle-widget",n.setAttribute("role","region"),n.setAttribute("aria-label",o.title),n.setAttribute("data-bundle-type",o.bundleType),n.setAttribute("data-bundle-gid",o.id),bt(n,o.widgetConfig),this.renderCleanups.push(Le(n));let a=l=>this.handleAddToCart(o,l),i=l=>this.renderCleanups.push(l);switch(o.bundleType){case"fixed":St(n,o,a,i);break;case"mix_match":Lt(n,o,a,i);break;case"volume":Rt(n,o,a,i);break}this.shadow.appendChild(n),this.setupImpressionFor(o,n)}let r=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(o=>o.bundleType),bundleType:r?.bundleType,title:r?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=vt(r,()=>{gt({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(o)}renderLoading(){this.shadow.innerHTML=`
2065
+ `;var Nn=e=>`lb_cart_id:${e}`;function Hn(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 fe=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","app-url","analytics","locale","country","language","market-id"];buyer=void 0;shadow;bundles=[];abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){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,r,o){r===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"}get country(){return this.getAttribute("country")??void 0}get language(){return this.getAttribute("language")??void 0}get marketId(){return this.getAttribute("market-id")??void 0}wrapQueryForContext(t){return it({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer})?at(t):t}isMarketHidden(t){return t.marketVisibility!=="specific"?!1:this.marketId?!t.marketIds.includes(this.marketId):!0}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 r=De({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer});try{let o,n=!1;if(this.bundleGid)n=!0,o=this.fetchSingleBundle(r,t.signal);else{let l=Hn(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(r,t.signal,l)}let i=r.query(dt,void 0,{signal:t.signal}).catch(()=>null);if(await o,t.signal.aborted)return;if(n&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let a=await i;if(a?.shop?.metafield?.value){yt(this.shopDomain,a.shop.metafield.value);let l=Ve(a.shop.metafield.value);l.ok&&(this.shopCustomCss=l.css)}await this.applyLinkGroupVariants(),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 applyLinkGroupVariants(){if(this.bundles.length===0)return;let t=new Map;for(let o of this.bundles)t.set(o.id,o);let r=await Promise.all(this.bundles.map(async o=>{let n=o.linkGroup;if(!n||!n.isPrimary||!n.variants||n.variants.length<2)return o;try{let i=await xt(n.id,n.variants);if(!i||i.variantMetaobjectId===o.id)return o;let a=t.get(i.variantMetaobjectId);return a||o}catch(i){return console.warn(`[lime-bundle] link-group assignment failed for bundle ${o.id}; falling back to primary.`,i),o}}));this.bundles=r}async fetchSingleBundle(t,r){let o=await t.query(this.wrapQueryForContext(lt),{id:this.bundleGid},{signal:r});if(!o.metaobject){this.bundles=[];return}let n=qe(o.metaobject.id,o.metaobject.fields);this.bundles=n&&!this.isMarketHidden(n)?[n]:[]}async fetchProductBundles(t,r,o){let n=await t.query(this.wrapQueryForContext(st),{handle:o},{signal:r});if(!n.product){this.bundles=[];return}let i=n.product.metafield?.references?.nodes??[],a=[];for(let l of i){let d=qe(l.id,l.fields);d&&!this.isMarketHidden(d)&&a.push(d)}this.bundles=a}handleAddToCart=async(t,r)=>{let o=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:r},bubbles:!0,composed:!0,cancelable:!0}),n=this.dispatchEvent(o);this.reportAddToCartEvent(t,r),n&&await this.defaultAddToCart(r)};async defaultAddToCart(t){if(typeof window>"u")return;let r=De({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),o=window.localStorage,n=Nn(this.shopDomain),i=o?.getItem(n)??null;try{let a=null;if(i){let d=(await r.query(ut,{cartId:i,lines:t})).cartLinesAdd;d?.userErrors?.length?o?.removeItem(n):d?.cart&&(a=d.cart.checkoutUrl)}if(!a){let d=(await r.query(ct,{input:{lines:t}})).cartCreate;d?.cart&&(o?.setItem(n,d.cart.id),a=d.cart.checkoutUrl)}a?window.location.assign(a):this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:"Cart creation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}catch(a){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:a instanceof Error?a.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}reportAddToCartEvent(t,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=r.reduce((i,a)=>i+a.quantity,0),n=r.reduce((i,a)=>{let d=t.products.find(p=>p.variants.nodes.some(u=>u.id===a.merchandiseId))?.variants.nodes.find(p=>p.id===a.merchandiseId),s=d?parseFloat(d.price.amount):0;return i+s*a.quantity},0);mt({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:o,totalPrice:Math.round(n*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[We,Vt,Ot,Ft,Nt].join(`
2066
+ `),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 n=document.createElement("div");n.className="lb-bundle-widget",n.setAttribute("role","region"),n.setAttribute("aria-label",o.title),n.setAttribute("data-bundle-type",o.bundleType),n.setAttribute("data-bundle-gid",o.id),bt(n,o.widgetConfig),this.renderCleanups.push(Le(n));let i=l=>this.handleAddToCart(o,l),a=l=>this.renderCleanups.push(l);switch(o.bundleType){case"fixed":_t(n,o,i,a);break;case"mix_match":Tt(n,o,i,a);break;case"volume":Mt(n,o,i,a);break}this.shadow.appendChild(n),this.setupImpressionFor(o,n)}let r=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(o=>o.bundleType),bundleType:r?.bundleType,title:r?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=gt(r,()=>{ht({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(o)}renderLoading(){this.shadow.innerHTML=`
2067
2067
  <style>${We}</style>
2068
- <style>${$t}</style>
2068
+ <style>${Ht}</style>
2069
2069
  <div class="lb-bundle-widget lb-bundle-widget--loading" aria-busy="true" aria-label="Loading bundle">
2070
2070
  <div class="lb-skeleton lb-skeleton--title"></div>
2071
2071
  <div class="lb-skeleton--products">
@@ -2099,5 +2099,5 @@ a.lb-bundle-product-name:focus-visible {
2099
2099
  <div class="lb-skeleton lb-skeleton--cta"></div>
2100
2100
  </div>
2101
2101
  </div>
2102
- `}renderError(t){this.shadow.innerHTML="",this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:t,code:"LOAD_ERROR"},bubbles:!0,composed:!0}))}};typeof customElements<"u"&&!customElements.get("lime-bundle")&&customElements.define("lime-bundle",fe);return Jt(Un);})();
2102
+ `}renderError(t){this.shadow.innerHTML="",this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:t,code:"LOAD_ERROR"},bubbles:!0,composed:!0}))}};typeof customElements<"u"&&!customElements.get("lime-bundle")&&customElements.define("lime-bundle",fe);return Yt(Un);})();
2103
2103
  //# sourceMappingURL=lime-bundle.global.js.map