@lime-bundles/widget 3.2.0 → 3.2.2

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 Ee=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var jt=Object.prototype.hasOwnProperty;var Qt=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Kt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zt(t))!jt.call(e,n)&&n!==r&&Ee(e,n,{get:()=>t[n],enumerable:!(o=Wt(t,n))||o.enumerable});return e};var Gt=e=>Kt(Ee({},"__esModule",{value:!0}),e);var Fn={};Qt(Fn,{LimeBundleElement:()=>me,trackInputMode:()=>Se});var Yt=Object.defineProperty,tt=(e,t)=>{for(var r in t)Yt(e,r,{get:t[r],enumerable:!0})},je=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},Xt="2025-10";function Me(e){let t=e.apiVersion??Xt,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 fetch(r,{method:"POST",headers:i,body:JSON.stringify({query:o,variables:n}),signal:a?.signal});if(!l.ok)throw new je([{message:`Storefront API error: ${l.status} ${l.statusText}`}]);let d=await l.json();if(d.errors?.length)throw new je(d.errors);return d.data}}}var rt=`#graphql
1
+ "use strict";var LimeBundles=(()=>{var Me=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Qt=Object.prototype.hasOwnProperty;var Kt=(e,t)=>{for(var r in t)Me(e,r,{get:t[r],enumerable:!0})},Gt=(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=>Gt(Me({},"__esModule",{value:!0}),e);var Vn={};Kt(Vn,{LimeBundleElement:()=>fe,trackInputMode:()=>Le});var Xt=Object.defineProperty,ot=(e,t)=>{for(var r in t)Xt(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"}},Jt="2025-10";function De(e){let t=e.apiVersion??Jt,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 fetch(r,{method:"POST",headers:i,body:JSON.stringify({query:o,variables:n}),signal:a?.signal});if(!l.ok)throw new Ge([{message:`Storefront API error: ${l.status} ${l.statusText}`}]);let d=await l.json();if(d.errors?.length)throw new Ge(d.errors);return d.data}}}var it=`#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
- `,nt=`#graphql
100
+ `,at=`#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
- `,ot=`#graphql
108
+ `,lt=`#graphql
109
109
  query BundlesForProduct($handle: String!) {
110
110
  product(handle: $handle) {
111
111
  id
@@ -215,49 +215,49 @@
215
215
  }
216
216
  }
217
217
  }
218
- `,it=`#graphql
218
+ `,dt=`#graphql
219
219
  mutation CartCreate($input: CartInput!) {
220
220
  cartCreate(input: $input) {
221
221
  cart { id checkoutUrl }
222
222
  userErrors { field message }
223
223
  }
224
224
  }
225
- `,at=`#graphql
225
+ `,st=`#graphql
226
226
  mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
227
227
  cartLinesAdd(cartId: $cartId, lines: $lines) {
228
228
  cart { id checkoutUrl }
229
229
  userErrors { field message }
230
230
  }
231
231
  }
232
- `,lt={min:1,max:99},ie=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Y={header:{textColor:"#FFFFFF",headerStyle:"gradient",gradientStart:"#C62828",gradientEnd:"#AD1457",saveBadgeBgColor:"#FFFFFF",saveBadgeTextColor:"#AD1457",saveBadgeBorderColor:"#FFFFFF",saveBadgeBorderWidth:0,saveBadgeBorderRadius:8,countdownBgColor:"#FFF0F3",countdownTextColor:"#C62828"},layout:{backgroundColor:"#FFFFFF",borderColor:"#E5E5E5",borderWidth:1,borderRadius:12},productList:{textColor:"#1A1A1A",imageBorderWidth:0,imageBorderColor:"#E5E5E5",imageBorderRadius:8,thumbnailRatio:"square",variantBorderWidth:1,variantBorderColor:"#E5E5E5",variantBorderRadius:8,showPrice:!0,showCompareAtPrice:!0,showCountBubble:!0,countBubbleBgColor:"#1A1A1A",countBubbleTextColor:"#FFFFFF"},pricing:{showSaveBadge:!0,showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#1A1A1A",buttonTextColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},savingsBar:{visible:!0,bgColor:"#EDFBF1",textColor:"#2DB554",borderWidth:0,borderColor:"#2DB554",borderRadius:8},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},outOfStockBehavior:"show_greyed_out",showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FFFFFF",pickerTextColor:"#1A1A1A",pickerBorderWidth:0,pickerBorderColor:"#E5E5E5",pickerBorderRadius:16,pickerSearchBorderWidth:1,pickerSearchBorderColor:"#E5E5E5",pickerSearchBorderRadius:8,pickerProductBorderWidth:0,pickerProductBorderColor:"#E5E5E5",pickerProductBorderRadius:8,pickerThumbnailRatio:"square",pickerShowCountBubble:!0,pickerCountBubbleBgColor:"#1A1A1A",pickerCountBubbleTextColor:"#FFFFFF",pickerAddBgColor:"#1A1A1A",pickerAddLabelColor:"#FFFFFF",pickerAddBorderWidth:0,pickerAddBorderColor:"#1A1A1A",pickerAddBorderRadius:8,pickerVariantBorderWidth:1,pickerVariantBorderColor:"#1A1A1A",pickerVariantBorderRadius:8,pickerQtyStepperBorderWidth:1,pickerQtyStepperBorderColor:"#1A1A1A",pickerQtyStepperBorderRadius:8,tierBorderColor:"#E5E5E5",tierBorderWidth:1,tierBorderRadius:12,tierSelectedBorderColor:"#1A1A1A",tierSelectedBorderWidth:2,defaultTier:"first"};function Jt(e){if(!e||typeof e!="object")return Y;let t=e;return{...Y,...t,defaultTier:Zt(t.defaultTier),header:{...Y.header,...t.header??{}},layout:{...Y.layout,...t.layout??{}},productList:{...Y.productList,...t.productList??{}},pricing:{...Y.pricing,...t.pricing??{}},cta:{...Y.cta,...t.cta??{}},savingsBar:{...Y.savingsBar,...t.savingsBar??{}},countdown:{...Y.countdown,...t.countdown??{}},popularBadge:{...Y.popularBadge,...t.popularBadge??{}}}}function Zt(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:Y.defaultTier}function er(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 tr={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"},rr=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 dt(e,t){let r=er(t);for(let[a,i]of Object.entries(tr)){let l=r[a];if(l==null)continue;let d=rr.has(a)?`${l}px`:String(l);e.style.setProperty(i,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",Qe(t.productList.variantBorderColor)),e.style.setProperty("--lb-picker-variant-chevron",Qe(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=Ke(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=Ke(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 Qe(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 Ke(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 nr=new Set(["fixed","mix_match","volume"]),or=new Set(["active"]);function Ie(e,t){try{return ir(e,t)}catch(r){if(r instanceof ie)return null;throw r}}function ir(e,t){let r=new Map(t.map(C=>[C.key,C])),o=r.get("title")?.value??"Bundle",n=r.get("bundle_type")?.value,a=r.get("status")?.value;if(!n||!nr.has(n))throw new ie(`Invalid or missing bundle_type: ${n??"null"}`,"invalid_type");let i=n;if(!a||!or.has(a))throw new ie(`Bundle is not active: status=${a??"null"}`,"inactive");let l=a,d=r.get("starts_at")?.value??null,u=r.get("ends_at")?.value??null,p=new Date;if(d){let C=new Date(d);if(Number.isNaN(C.getTime()))throw new ie(`Invalid starts_at: ${d}`,"invalid_type");if(C>p)throw new ie(`Bundle not yet started: starts_at=${d}`,"not_started")}if(u){let C=new Date(u);if(Number.isNaN(C.getTime()))throw new ie(`Invalid ends_at: ${u}`,"invalid_type");if(C<p)throw new ie(`Bundle has expired: ends_at=${u}`,"expired")}let c=ar(r),y=lr(r),m=dr(r),g={id:e,title:o,description:r.get("description")?.value||null,status:l,products:c,discountConfig:y,widgetConfig:m,startsAt:d,endsAt:u,discountLabel:r.get("discount_label")?.value??null,selectedVariantIds:sr(r),productQuantities:Ge(r,"product_quantities"),variantQuantities:Ge(r,"variant_quantities"),abTestId:r.get("ab_test_id")?.value??null,abVariantB:ur(r)};switch(i){case"fixed":return{...g,bundleType:"fixed"};case"volume":return{...g,bundleType:"volume",volumeTiers:pr(r)};case"mix_match":return{...g,bundleType:"mix_match",minQuantity:br(r,"min_quantity",{min:1}),maxQuantity:null,productRules:cr(r)}}}function ar(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 lr(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 dr(e){return Jt(de(e,"widget_config"))}function sr(e){let t=de(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 Ge(e,t){let r=de(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 cr(e){let t=de(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),d=typeof i=="number"?i:Number(i);if(!Number.isFinite(l)||!Number.isFinite(d))continue;let u=Math.max(1,Math.min(99,Math.floor(l))),p=Math.max(u,Math.min(99,Math.floor(d)));r[o]={min:u,max:p}}return r}function ur(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 d=parseFloat(i);Number.isFinite(d)&&(r.discountConfig={discountType:a,discountValue:d,allowStacking:e.get("allow_stacking")?.value==="true"})}let l=de(e,"ab_volume_tiers");return Array.isArray(l)&&(r.volumeTiers=l.filter(d=>typeof d=="object"&&d!==null).map(st)),Object.keys(r).length===0?null:r}function pr(e){let t=de(e,"volume_tiers");return Array.isArray(t)?t.filter(r=>typeof r=="object"&&r!==null).map(st):[]}function st(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 de(e,t){let r=e.get(t)?.value;if(!r)return null;try{return JSON.parse(r)}catch{return null}}function br(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 fe(e,t,r){let o=e.variantQuantities[r];return o!==void 0?o:e.productQuantities[t]??1}function ct(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 ut(e,t){await ht(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 pt(e,t){await ht(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function bt(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 ht(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 hr=!1;function mr(){return typeof document<"u"}function gr(){if(!mr())return!1;if(hr)return!0;if(typeof window>"u")return!1;let e=window.Shopify;try{return e?.customerPrivacy?.analyticsProcessingAllowed?.()===!0}catch{return!1}}var Ye="lb_session",fr=720*60*60,vr=720*60*60;function mt(e){return`__Host-_lb_ab_${e}`}async function gt(e,t){if(typeof document>"u")return null;let r=xr(t);if(r&&r.testId===e)return{variant:r.variant,testId:e,persisted:!0};if(!gr())return{variant:"A",testId:e,persisted:!1};let o=yr(),n=Cr(o,e);return wr(t,e,n),{variant:n,testId:e,persisted:!0}}function xr(e){if(typeof document>"u")return null;let r=`${mt(e)}=`,n=document.cookie.split(";").map(d=>d.trim()).find(d=>d.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 wr(e,t,r){if(typeof document>"u")return;let o=mt(e),n=`${r}|${t}|${Date.now()}`;document.cookie=`${o}=${n}; Path=/; Max-Age=${vr}; SameSite=Lax; Secure`}function yr(){if(typeof document>"u")return Xe();let t=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${Ye}=`))?.split("=")[1];if(t)return t;let r=Xe();return document.cookie=`${Ye}=${r}; path=/; max-age=${fr}; SameSite=Lax; Secure`,r}function Xe(){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 Cr(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 Je=1e4,kr=[[/@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"]],_r=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function Re(e){if(e.length>Je)return{ok:!1,error:`CSS exceeds ${Je.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 kr)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&&!_r.test(n))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Br="lb-custom-css-";function ft(e,t){if(typeof document>"u"||!t)return!1;let r=Re(t);if(!r.ok||!r.css.trim())return!1;let o=Br+Sr(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 Sr(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 Tr(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 Ar={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 ae(e,t,r){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let o=parseFloat(e.amount);if(!Number.isFinite(o))return null;let n=Ar[t.referenceUnit]??"";if(!n)return null;let a=e.currencyCode||r||"USD",i=Tr(o,a),l=t.referenceValue,d=l===1?n:`${l}${n}`;return`${i}/${d}`}function z(e){if(e==null)return 0;let t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.round(t*100):0}function F(e,t){try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e/100)}catch{return`${t} ${(e/100).toFixed(2)}`}}function vt(e,t){return Math.max(0,e-Math.floor(e*t/100))}function De(e,t=e.productQuantities,r=e.widgetConfig.pricing.showSaveBadge){let{discountType:o,discountValue:n}=e.discountConfig,a=[],i=0,l=0;for(let c of e.products){let y=c.variants.nodes.find(w=>w.availableForSale)??c.variants.nodes[0];if(!y)continue;let m=z(y.price.amount),g=t[c.id]??1,C=m*g,L=y.compareAtPrice?z(y.compareAtPrice.amount):null;if(a.push({unitCents:m,qty:g,lineCents:C,compareCents:L}),i+=C,o==="percentage"){let w=vt(m,n);l+=w*g}else l+=C}o==="fixed_amount"&&(l=Math.max(0,i-Math.round(n*100)));let d=Math.max(0,i-l),u=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=`-${F(Math.round(n*100),u)}`)),{rows:a,totalCents:i,saleCents:l,savingsCents:d,headerBadge:p,currency:u}}function ve(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 ne(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 xt(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={};tt(Fe,{computePosition:()=>Lr,emptyTypeAheadState:()=>Dr,handleKey:()=>Ir,pushTypeAheadChar:()=>Fr});var Er=4;function Lr({trigger:e,viewportHeight:t,desiredHeight:r,margin:o=Er,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),d=Math.max(0,e.top-i-o),u=r<=l?"down":d>l?"up":"down",c=Math.min(r,u==="down"?l:d),y=u==="down"?e.bottom+o:e.top-o-c;return{placement:u,maxHeight:c,offsetTop:y,offsetLeft:e.left,width:e.width}}var Le={type:"passthrough",preventDefault:!1};function Pe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Ze(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Pr(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 Mr(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 et(e){return e.length===1&&e!==" "&&/\S/.test(e)}function Ir(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return Le;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:Pe(i),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:a>=0&&!i[a]?.disabled?a:Ze(i),preventDefault:!0};default:return et(r)?{type:"open",activeIndex:a>=0&&!i[a]?.disabled?a:Pe(i),preventDefault:!0}:Le}switch(r){case"ArrowDown":return{type:"move-active",activeIndex:Pr(i,n),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Mr(i,n),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Pe(i),preventDefault:!0};case"End":return{type:"move-active",activeIndex:Ze(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 et(r)?{type:"type-ahead",char:r,preventDefault:!1}:Le}}var Rr=500;function Dr(){return{buffer:"",lastTime:0}}function Fr(e,t,r,o,n=Rr){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 d=0;d<o.length;d++){let u=o[d];if(!u.disabled&&u.label.toLowerCase().startsWith(i))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var Vr={};tt(Vr,{findVariantByOptions:()=>qr,isOptionValueAvailable:()=>Or,toPickerVariant:()=>Nr});function qr(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 Or(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 Nr(e){return{id:e.id,optionValues:e.selectedOptions.map(t=>t.value),available:e.availableForSale}}function X(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null?!0:e.quantityAvailable>=t:!1}function se(e,t,r,o){return!o||e.quantityAvailable==null||e.quantityAvailable<t?!1:e.quantityAvailable<=r}function Ve(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:Hr,emptyTypeAheadState:Ur,handleKey:$r,pushTypeAheadChar:Wr}=Fe,zr=32,jr=8,Qr=8,Q=[];function we(e){let t=e.composedPath();for(let r=Q.length-1;r>=0;r--){let o=Q[r];!t.includes(o.shell)&&!t.includes(o.listbox)&&o.close()}}function wt(){for(let e=Q.length-1;e>=0;e--)Q[e].close()}var ye=!1;function Kr(){ye||(document.addEventListener("pointerdown",we,!0),window.addEventListener("scroll",we,!0),window.addEventListener("resize",wt),ye=!0)}function Gr(){!ye||Q.length>0||(document.removeEventListener("pointerdown",we,!0),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",wt),ye=!1)}function xe(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 Yr(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Xr(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 Jr=["lb-bundle-variant-select","lb-mix-match__variant-select"],Zr=Jr.map(e=>`select.${e}:not(.lb-dropdown-state)`).join(", ");function en(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 d=`${a}-listbox`;l.setAttribute("aria-controls",d),n&&l.setAttribute("aria-label",n);let u=r.createElement("span");u.className="lb-dropdown-trigger-value";let p=r.createElement("span");p.className="lb-dropdown-chevron",p.setAttribute("aria-hidden","true"),l.appendChild(u),l.appendChild(p);let c=r.createElement("ul");c.id=d,c.className="lb-dropdown-listbox",c.setAttribute("role","listbox"),n&&c.setAttribute("aria-label",n),c.hidden=!0,i.appendChild(l),e.parentNode?.insertBefore(i,e.nextSibling);let y=e.closest("[data-modal-overlay]");y?(y.appendChild(c),c.setAttribute("data-lb-dropdown-portal","")):i.appendChild(c);let m=!1,g=-1,C=Ur(),L=[],w;function E(){let v=xe(e),h=e.selectedIndex;for(u.textContent=h>=0&&v[h]?v[h].label:"";c.firstChild;)c.removeChild(c.firstChild);L=[];for(let x=0;x<v.length;x++){let D=r.createElement("li");D.id=`${a}-opt-${x}`,D.className="lb-dropdown-option",D.setAttribute("role","option"),D.setAttribute("aria-selected",x===h?"true":"false"),v[x].disabled&&D.setAttribute("aria-disabled","true"),D.setAttribute("data-value",e.options[x].value),D.setAttribute("data-index",String(x)),D.textContent=v[x].label,c.appendChild(D),L.push(D)}}function B(v){if(g>=0&&L[g]&&L[g].classList.remove("is-active"),g=v,v>=0&&L[v]){let h=L[v];h.classList.add("is-active"),l.setAttribute("aria-activedescendant",h.id);let x=h.offsetTop,D=x+h.offsetHeight,oe=c.scrollTop,G=oe+c.clientHeight;x<oe?c.scrollTop=x:D>G&&(c.scrollTop=D-c.clientHeight)}else l.setAttribute("aria-activedescendant","")}function I(){let v=l.getBoundingClientRect();if(v.width===0)return!1;let x=Math.min(L.length||1,Qr)*zr+jr,D=c.hasAttribute("data-lb-dropdown-portal")?null:Xr(l),oe=D?(()=>{let J=D.getBoundingClientRect();return{top:J.top,bottom:J.bottom}})():void 0,G=Hr({trigger:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},viewportHeight:window.innerHeight,desiredHeight:x,clip:oe});return c.setAttribute("data-placement",G.placement),c.style.maxHeight=`${G.maxHeight}px`,c.hasAttribute("data-lb-dropdown-portal")&&(c.style.top=`${G.offsetTop}px`,c.style.left=`${G.offsetLeft}px`,c.style.width=`${G.width}px`),!0}function f(){if(m)return;for(let x=Q.length-1;x>=0;x--)Q[x]!==w&&Q[x].close();m=!0,c.hidden=!1,l.setAttribute("aria-expanded","true"),I()||requestAnimationFrame(()=>I());let v=xe(e),h=e.selectedIndex;h>=0&&v[h]&&!v[h].disabled?B(h):B(Yr(v)),Q.push(w),Q.length===1&&Kr()}function P(v){if(!m)return;m=!1,c.hidden=!0,l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant",""),g>=0&&L[g]&&L[g].classList.remove("is-active"),g=-1;let h=Q.indexOf(w);h>=0&&Q.splice(h,1),Q.length===0&&Gr(),v&&l.focus()}function A(v){let h=e.options[v];if(!(!h||h.disabled)){if(e.value!==h.value){e.value=h.value;let x=new Event("change",{bubbles:!0});e.dispatchEvent(x)}E(),P(!0)}}function R(v){switch(v.type){case"open":f(),v.activeIndex>=0&&B(v.activeIndex);return;case"close":P(v.restoreFocus);return;case"move-active":B(v.activeIndex);return;case"commit":A(v.index);return;case"type-ahead":{let h=xe(e),x=Wr(C,v.char,Date.now(),h);C=x.newState,x.matchedIndex!==null&&(m||f(),B(x.matchedIndex));return}case"passthrough":return;default:{let h=v}}}function q(v){let h=xe(e),x=$r({key:v.key,ctrlKey:v.ctrlKey,metaKey:v.metaKey,altKey:v.altKey,shiftKey:v.shiftKey},{isOpen:m,activeIndex:g,selectedIndex:e.selectedIndex,options:h});x.preventDefault&&v.preventDefault(),R(x)}function b(v){v.preventDefault(),m?P(!1):f()}function k(v){let h=v.target;for(;h&&h!==c;){if(h.classList?.contains("lb-dropdown-option")){let x=parseInt(h.getAttribute("data-index")??"",10);if(!Number.isNaN(x)){A(x);return}}h=h.parentElement}}function S(v){let h=v.target;for(;h&&h!==c;){if(h.classList?.contains("lb-dropdown-option")){if(h.getAttribute("aria-disabled")==="true")return;let x=parseInt(h.getAttribute("data-index")??"",10);!Number.isNaN(x)&&x!==g&&B(x);return}h=h.parentElement}}function T(){setTimeout(()=>{if(!m)return;let v=o.activeElement??r.activeElement;i.contains(v)||P(!1)},0)}function _(){E()}let M=new MutationObserver(()=>{E()});M.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});let O=v=>v.preventDefault();l.addEventListener("click",b),l.addEventListener("keydown",q),i.addEventListener("focusout",T),c.addEventListener("mousedown",O),c.addEventListener("click",k),c.addEventListener("mousemove",S),e.addEventListener("change",_);function ee(){m&&P(!1),M.disconnect(),l.removeEventListener("click",b),l.removeEventListener("keydown",q),i.removeEventListener("focusout",T),c.removeEventListener("mousedown",O),c.removeEventListener("click",k),c.removeEventListener("mousemove",S),e.removeEventListener("change",_),i.parentNode&&i.parentNode.removeChild(i),c.parentNode&&c.parentNode.removeChild(c),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),delete t.__lbDropdownInstance}return w={shell:i,listbox:c,select:e,close:()=>P(!1),destroy:ee},t.__lbDropdownInstance=w,E(),w}function Ce(e){let t=e.querySelectorAll(Zr),r=[];return t.forEach(o=>{let n=en(o);n&&r.push(n)}),r}function ke(e){e.querySelectorAll("select.lb-dropdown-state").forEach(r=>{let o=r.__lbDropdownInstance;o&&o.destroy()})}function ce(e){let t=tn(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 d(){let p=r-Date.now();if(p<=0){o.style.display="none",u();return}i.textContent=xt(p)}function u(){l!==null&&(clearInterval(l),l=null)}return d(),l=setInterval(d,1e3),{el:o,stop:u}}function tn(e){let t=Date.parse(e);return Number.isFinite(t)?t:null}function ue(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 qe(e,t){let r=e.querySelector("[data-cta-label]");r&&(r.textContent=t)}function s(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 rn=`
232
+ `,ct={min:1,max:99},ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},J={header:{textColor:"#FFFFFF",headerStyle:"gradient",gradientStart:"#C62828",gradientEnd:"#AD1457",saveBadgeBgColor:"#FFFFFF",saveBadgeTextColor:"#AD1457",saveBadgeBorderColor:"#FFFFFF",saveBadgeBorderWidth:0,saveBadgeBorderRadius:8,countdownBgColor:"#FFF0F3",countdownTextColor:"#C62828"},layout:{backgroundColor:"#FFFFFF",borderColor:"#E5E5E5",borderWidth:1,borderRadius:12},productList:{textColor:"#1A1A1A",imageBorderWidth:0,imageBorderColor:"#E5E5E5",imageBorderRadius:8,thumbnailRatio:"square",variantBorderWidth:1,variantBorderColor:"#E5E5E5",variantBorderRadius:8,showPrice:!0,showCompareAtPrice:!0,showCountBubble:!0,countBubbleBgColor:"#1A1A1A",countBubbleTextColor:"#FFFFFF"},pricing:{showSaveBadge:!0,showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#1A1A1A",buttonTextColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},savingsBar:{visible:!0,bgColor:"#EDFBF1",textColor:"#2DB554",borderWidth:0,borderColor:"#2DB554",borderRadius:8},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A",borderRadius:12},outOfStockBehavior:"show_greyed_out",showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FFFFFF",pickerTextColor:"#1A1A1A",pickerBorderWidth:0,pickerBorderColor:"#E5E5E5",pickerBorderRadius:16,pickerSearchBorderWidth:1,pickerSearchBorderColor:"#E5E5E5",pickerSearchBorderRadius:8,pickerProductBorderWidth:0,pickerProductBorderColor:"#E5E5E5",pickerProductBorderRadius:8,pickerThumbnailRatio:"square",pickerShowCountBubble:!0,pickerCountBubbleBgColor:"#1A1A1A",pickerCountBubbleTextColor:"#FFFFFF",pickerAddBgColor:"#1A1A1A",pickerAddLabelColor:"#FFFFFF",pickerAddBorderWidth:0,pickerAddBorderColor:"#1A1A1A",pickerAddBorderRadius:8,pickerVariantBorderWidth:1,pickerVariantBorderColor:"#1A1A1A",pickerVariantBorderRadius:8,pickerQtyStepperBorderWidth:1,pickerQtyStepperBorderColor:"#1A1A1A",pickerQtyStepperBorderRadius:8,tierBorderColor:"#E5E5E5",tierBorderWidth:1,tierBorderRadius:12,tierSelectedBorderColor:"#1A1A1A",tierSelectedBorderWidth:2,defaultTier:"first"};function Zt(e){if(!e||typeof e!="object")return J;let t=e;return{...J,...t,defaultTier:er(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 er(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:J.defaultTier}function tr(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 rr={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"},nr=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 ut(e,t){let r=tr(t);for(let[a,i]of Object.entries(rr)){let l=r[a];if(l==null)continue;let d=nr.has(a)?`${l}px`:String(l);e.style.setProperty(i,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 or=new Set(["fixed","mix_match","volume"]),ir=new Set(["active"]);function Fe(e,t){try{return ar(e,t)}catch(r){if(r instanceof ae)return null;throw r}}function ar(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||!or.has(n))throw new ae(`Invalid or missing bundle_type: ${n??"null"}`,"invalid_type");let i=n;if(!a||!ir.has(a))throw new ae(`Bundle is not active: status=${a??"null"}`,"inactive");let l=a,d=r.get("starts_at")?.value??null,c=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(c){let k=new Date(c);if(Number.isNaN(k.getTime()))throw new ae(`Invalid ends_at: ${c}`,"invalid_type");if(k<p)throw new ae(`Bundle has expired: ends_at=${c}`,"expired")}let u=lr(r),C=dr(r),m=sr(r),g={id:e,title:o,description:r.get("description")?.value||null,status:l,products:u,discountConfig:C,widgetConfig:m,startsAt:d,endsAt:c,discountLabel:r.get("discount_label")?.value??null,selectedVariantIds:cr(r),productQuantities:Je(r,"product_quantities"),variantQuantities:Je(r,"variant_quantities"),abTestId:r.get("ab_test_id")?.value??null,abVariantB:pr(r)};switch(i){case"fixed":return{...g,bundleType:"fixed"};case"volume":return{...g,bundleType:"volume",volumeTiers:br(r)};case"mix_match":return{...g,bundleType:"mix_match",minQuantity:hr(r,"min_quantity",{min:1}),maxQuantity:null,productRules:ur(r)}}}function lr(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 dr(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 sr(e){return Zt(ce(e,"widget_config"))}function cr(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 ur(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),d=typeof i=="number"?i:Number(i);if(!Number.isFinite(l)||!Number.isFinite(d))continue;let c=Math.max(1,Math.min(99,Math.floor(l))),p=Math.max(c,Math.min(99,Math.floor(d)));r[o]={min:c,max:p}}return r}function pr(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 d=parseFloat(i);Number.isFinite(d)&&(r.discountConfig={discountType:a,discountValue:d,allowStacking:e.get("allow_stacking")?.value==="true"})}let l=ce(e,"ab_volume_tiers");return Array.isArray(l)&&(r.volumeTiers=l.filter(d=>typeof d=="object"&&d!==null).map(pt)),Object.keys(r).length===0?null:r}function br(e){let t=ce(e,"volume_tiers");return Array.isArray(t)?t.filter(r=>typeof r=="object"&&r!==null).map(pt):[]}function pt(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 hr(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 ye(e,t,r){let o=e.variantQuantities[r];return o!==void 0?o:e.productQuantities[t]??1}function bt(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 ht(e,t){await ft(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 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(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 mr=!1;function gr(){return typeof document<"u"}function fr(){if(!gr())return!1;if(mr)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",vr=720*60*60,xr=720*60*60;function vt(e){return`__Host-_lb_ab_${e}`}async function xt(e,t){if(typeof document>"u")return null;let r=wr(t);if(r&&r.testId===e)return{variant:r.variant,testId:e,persisted:!0};if(!fr())return{variant:"A",testId:e,persisted:!1};let o=Cr(),n=kr(o,e);return yr(t,e,n),{variant:n,testId:e,persisted:!0}}function wr(e){if(typeof document>"u")return null;let r=`${vt(e)}=`,n=document.cookie.split(";").map(d=>d.trim()).find(d=>d.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 yr(e,t,r){if(typeof document>"u")return;let o=vt(e),n=`${r}|${t}|${Date.now()}`;document.cookie=`${o}=${n}; Path=/; Max-Age=${xr}; SameSite=Lax; Secure`}function Cr(){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=${vr}; 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 kr(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,_r=[[/@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"]],Br=/^(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,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 _r)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&&!Br.test(n))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Sr="lb-custom-css-";function wt(e,t){if(typeof document>"u"||!t)return!1;let r=Ve(t);if(!r.ok||!r.css.trim())return!1;let o=Sr+Ar(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 Ar(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 Er(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 Tr={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=Tr[t.referenceUnit]??"";if(!n)return null;let a=e.currencyCode||r||"USD",i=Er(o,a),l=t.referenceValue,d=l===1?n:`${l}${n}`;return`${i}/${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 yt(e,t){return Math.max(0,e-Math.floor(e*t/100))}function qe(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,T=C.compareAtPrice?j(C.compareAtPrice.amount):null;if(a.push({unitCents:m,qty:g,lineCents:k,compareCents:T}),i+=k,o==="percentage"){let x=yt(m,n);l+=x*g}else l+=k}o==="fixed_amount"&&(l=Math.max(0,i-Math.round(n*100)));let d=Math.max(0,i-l),c=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),c)}`)),{rows:a,totalCents:i,saleCents:l,savingsCents:d,headerBadge:p,currency:c}}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),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 Oe={};ot(Oe,{computePosition:()=>Pr,emptyTypeAheadState:()=>Fr,handleKey:()=>Rr,pushTypeAheadChar:()=>Vr});var Lr=4;function Pr({trigger:e,viewportHeight:t,desiredHeight:r,margin:o=Lr,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),d=Math.max(0,e.top-i-o),c=r<=l?"down":d>l?"up":"down",u=Math.min(r,c==="down"?l:d),C=c==="down"?e.bottom+o:e.top-o-u;return{placement:c,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 Mr(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 Ir(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 Rr(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:Mr(i,n),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Ir(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 Dr=500;function Fr(){return{buffer:"",lastTime:0}}function Vr(e,t,r,o,n=Dr){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 d=0;d<o.length;d++){let c=o[d];if(!c.disabled&&c.label.toLowerCase().startsWith(i))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var qr={};ot(qr,{findVariantByOptions:()=>Or,isOptionValueAvailable:()=>Nr,toPickerVariant:()=>Hr});function Or(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 Nr(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 Hr(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:Ur,emptyTypeAheadState:$r,handleKey:Wr,pushTypeAheadChar:zr}=Oe,jr=32,Qr=8,Kr=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 kt(){for(let e=K.length-1;e>=0;e--)K[e].close()}var Be=!1;function Gr(){Be||(document.addEventListener("pointerdown",_e,!0),window.addEventListener("scroll",_e,!0),window.addEventListener("resize",kt),Be=!0)}function Yr(){!Be||K.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 Xr(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Jr(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 Zr=["lb-bundle-variant-select","lb-mix-match__variant-select"],en=Zr.map(e=>`select.${e}:not(.lb-dropdown-state)`).join(", ");function tn(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 d=`${a}-listbox`;l.setAttribute("aria-controls",d),n&&l.setAttribute("aria-label",n);let c=r.createElement("span");c.className="lb-dropdown-trigger-value";let p=r.createElement("span");p.className="lb-dropdown-chevron",p.setAttribute("aria-hidden","true"),l.appendChild(c),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,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=$r(),T=[],x;function A(){l.disabled=e.disabled;let v=ke(e),b=e.selectedIndex;for(c.textContent=b>=0&&v[b]?v[b].label:"";u.firstChild;)u.removeChild(u.firstChild);T=[];for(let y=0;y<v.length;y++){let R=r.createElement("li");R.id=`${a}-opt-${y}`,R.className="lb-dropdown-option",R.setAttribute("role","option"),R.setAttribute("aria-selected",y===b?"true":"false"),v[y].disabled&&R.setAttribute("aria-disabled","true"),R.setAttribute("data-value",e.options[y].value),R.setAttribute("data-index",String(y)),R.textContent=v[y].label,u.appendChild(R),T.push(R)}}function _(v){if(g>=0&&T[g]&&T[g].classList.remove("is-active"),g=v,v>=0&&T[v]){let b=T[v];b.classList.add("is-active"),l.setAttribute("aria-activedescendant",b.id);let y=b.offsetTop,R=y+b.offsetHeight,ne=u.scrollTop,Y=ne+u.clientHeight;y<ne?u.scrollTop=y:R>Y&&(u.scrollTop=R-u.clientHeight)}else l.setAttribute("aria-activedescendant","")}function q(){let v=l.getBoundingClientRect();if(v.width===0)return!1;let y=Math.min(T.length||1,Kr)*jr+Qr,R=Jr(l),ne=R?(()=>{let ee=R.getBoundingClientRect();return{top:ee.top,bottom:ee.bottom}})():void 0,Y=Ur({trigger:{top:v.top,bottom:v.bottom,left:v.left,width:v.width},viewportHeight:window.innerHeight,desiredHeight:y,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 y=K.length-1;y>=0;y--)K[y]!==x&&K[y].close();m=!0,u.hidden=!1,l.setAttribute("aria-expanded","true"),q()||requestAnimationFrame(()=>q());let v=ke(e),b=e.selectedIndex;b>=0&&v[b]&&!v[b].disabled?_(b):_(Xr(v)),K.push(x),K.length===1&&Gr()}function M(v){if(!m)return;m=!1,u.hidden=!0,l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant",""),g>=0&&T[g]&&T[g].classList.remove("is-active"),g=-1;let b=K.indexOf(x);b>=0&&K.splice(b,1),K.length===0&&Yr(),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 y=new Event("change",{bubbles:!0});e.dispatchEvent(y)}A(),M(!0)}}function w(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),y=zr(k,v.char,Date.now(),b);k=y.newState,y.matchedIndex!==null&&(m||h(),_(y.matchedIndex));return}case"passthrough":return;default:{let b=v}}}function B(v){let b=ke(e),y=Wr({key:v.key,ctrlKey:v.ctrlKey,metaKey:v.metaKey,altKey:v.altKey,shiftKey:v.shiftKey},{isOpen:m,activeIndex:g,selectedIndex:e.selectedIndex,options:b});y.preventDefault&&v.preventDefault(),w(y)}function f(v){v.preventDefault(),m?M(!1):h()}function F(v){let b=v.target;for(;b&&b!==u;){if(b.classList?.contains("lb-dropdown-option")){let y=parseInt(b.getAttribute("data-index")??"",10);if(!Number.isNaN(y)){L(y);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 y=parseInt(b.getAttribute("data-index")??"",10);!Number.isNaN(y)&&y!==g&&_(y);return}b=b.parentElement}}function E(){setTimeout(()=>{if(!m)return;let v=o.activeElement??r.activeElement;i.contains(v)||M(!1)},0)}function S(){A()}let I=new MutationObserver(()=>{A()});I.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});let O=v=>v.preventDefault();l.addEventListener("click",f),l.addEventListener("keydown",B),i.addEventListener("focusout",E),u.addEventListener("mousedown",O),u.addEventListener("click",F),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",E),u.removeEventListener("mousedown",O),u.removeEventListener("click",F),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,A(),x}function Se(e){let t=e.querySelectorAll(en),r=[];return t.forEach(o=>{let n=tn(o);n&&r.push(n)}),r}function Ae(e){e.querySelectorAll("select.lb-dropdown-state").forEach(r=>{let o=r.__lbDropdownInstance;o&&o.destroy()})}function pe(e){let t=rn(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 d(){let p=r-Date.now();if(p<=0){o.style.display="none",c();return}i.textContent=Ct(p)}function c(){l!==null&&(clearInterval(l),l=null)}return d(),l=setInterval(d,1e3),{el:o,stop:c}}function rn(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 s(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 nn=`
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 yt(e,t,r,o){let n=t.widgetConfig,a=(w,E)=>fe(t,w,E),i=[],l=0;if(t.products.forEach((w,E)=>{let B=nn(t,w,E);B.qty!==0&&(B.isOos&&(l++,n.outOfStockBehavior==="hide")||i.push(B))}),i.length===0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",u=s("div","lb-fixed",{"data-discount-type":t.discountConfig.discountType,"data-discount-value":String(t.discountConfig.discountValue)}),p=on(t,d);if(u.appendChild(p.el),n.countdown.showCountdown&&t.endsAt){let w=ce(t.endsAt);w&&(u.appendChild(w.el),o?.(w.stop))}let c=s("div","lb-fixed__products"),y=[];i.forEach(w=>{let E=ln(w,d,a,{enabled:n.showLowStockBadge,threshold:n.lowStockThreshold},()=>{L()});y.push(E),c.appendChild(E.el)}),u.appendChild(c),u.appendChild(s("div","lb-bundle-divider"));let m=dn(t);u.appendChild(m.el);let g=n.savingsBar.visible?sn():null;g&&u.appendChild(g.el);let C=cn(t,l,()=>{let w=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}]}));w.length!==0&&r(w)});u.appendChild(C),u.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),u.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(u),Ce(u),o?.(()=>ke(u)),L();function L(){let w=i.reduce((I,f)=>{if(!f.selected)return I;let P=z(f.selected.price.amount);return I+P*f.qty},0),E=un(w,t.discountConfig,i),B=Math.max(0,w-E);m.update({totalCents:w,saleCents:E,savingsCents:B,currency:d}),g&&g.update({savingsCents:B,currency:d}),p.refresh(an(t,w,E,d))}}function nn(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=>X(p,fe(e,t.id,p.id)))??null,i=n,l=!a,d=a??n[0]??null,u=d?fe(e,t.id,d.id):1;return{product:t,eligibleVariants:i,selected:d,qty:u,isOos:l}}function on(e,t){let r=e.widgetConfig,o=s("div","lb-bundle-header"),n=s("div","lb-bundle-header__content"),a=s("h3","lb-bundle-title");if(a.textContent=e.title,n.appendChild(a),e.description){let d=s("p","lb-bundle-subtitle");d.textContent=e.description,n.appendChild(d)}o.appendChild(n);let i=s("span","lb-bundle-header__badge",{"data-header-badge":""});o.appendChild(i);let l=De(e,e.productQuantities,r.pricing.showSaveBadge);return l.headerBadge?i.textContent=l.headerBadge:i.style.display="none",{el:o,refresh(d){if(!r.pricing.showSaveBadge){i.style.display="none";return}d?(i.textContent=d,i.style.display=""):i.style.display="none"}}}function an(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?`-${F(Math.round(a.discountValue*100),o)}`:`-${F(n,o)}`}function ln(e,t,r,o,n){let a=s("div",e.isOos?"lb-bundle-product-row lb-bundle-product-row--oos":"lb-bundle-product-row",{"data-product-id":e.product.id.replace(/^.*\//,""),...e.isOos?{"aria-disabled":"true"}:{}}),i=s("div","lb-bundle-thumbnail",{"data-thumbnail":""}),l=e.selected?.image??e.product.featuredImage??null,d=null;l?(d=document.createElement("img"),d.src=ne(l.url,{width:U,height:U,crop:"center"}),d.alt=l.altText??e.product.title,d.width=U,d.height=U,d.loading="lazy",i.appendChild(d)):i.insertAdjacentHTML("beforeend",rn);let u=null;e.isOos||(u=s("span","lb-bundle-qty-badge",{"data-qty-badge":""}),u.textContent=String(e.qty),i.appendChild(u)),a.appendChild(i);let p=s("div","lb-bundle-product-info"),c=document.createElement("a");if(c.className="lb-bundle-product-name",c.href=`/products/${e.product.handle}`,c.textContent=e.product.title,p.appendChild(c),e.isOos){let y=s("span","lb-bundle-oos-label");y.textContent="Out of stock",p.appendChild(y)}else if(e.selected){if(e.eligibleVariants.length===1&&e.product.variants.nodes.length>1){let B=s("span","lb-bundle-variant-badge");B.textContent=e.eligibleVariants[0].title,p.appendChild(B)}let m=s("span","lb-bundle-product-prices"),g=s("span","lb-bundle-product-compare-price",{"data-product-compare-price":""}),C=s("span","lb-bundle-product-price",{"data-product-price":""});m.appendChild(g),m.appendChild(C),p.appendChild(m);let L=s("span","lb-bundle-product-unit-price",{"data-product-unit-price":""});L.setAttribute("hidden",""),p.appendChild(L);let w=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});w.setAttribute("hidden",""),p.appendChild(w);let E=B=>{let I=z(B.price.amount);if(C.textContent=F(I,t),B.compareAtPrice){let R=z(B.compareAtPrice.amount);R>I?(g.textContent=F(R,t),g.removeAttribute("hidden")):g.setAttribute("hidden","")}else g.setAttribute("hidden","");let f=ae(B.unitPrice,B.unitPriceMeasurement,t);f?(L.textContent=f,L.removeAttribute("hidden")):L.setAttribute("hidden","");let P=B.image??e.product.featuredImage;d&&P&&(d.src=ne(P.url,{width:U,height:U,crop:"center"}),d.alt=P.altText??e.product.title);let A=r(e.product.id,B.id);se(B,A,o.threshold,o.enabled)?(w.textContent=`Only ${B.quantityAvailable} left`,w.removeAttribute("hidden")):w.setAttribute("hidden","")};if(E(e.selected),e.eligibleVariants.length>1){let B=e.eligibleVariants[0].selectedOptions.map(S=>S.name),I=e.product.id.replace(/^.*\//,""),f=[],P=S=>e.eligibleVariants.find(T=>T.selectedOptions.every((_,M)=>_.value===S[M])&&T.selectedOptions.length===S.length)??null,A=S=>{S.selectedOptions.forEach((T,_)=>{let M=f[_];M&&M.value!==T.value&&(M.value=T.value)})},R=(S,T,_)=>e.eligibleVariants.some(M=>!X(M,r(e.product.id,M.id))||M.selectedOptions[S]?.value!==T?!1:M.selectedOptions.every((O,ee)=>ee===S||O.value===_[ee])),q=S=>{f.forEach((T,_)=>{Array.from(T.options).forEach(M=>{M.disabled=!R(_,M.value,S)})})},b=()=>{let S=f.map(_=>_.value),T=P(S);if(!T){e.selected&&(A(e.selected),q(e.selected.selectedOptions.map(_=>_.value)));return}e.selected=T,e.qty=r(e.product.id,T.id),u&&(u.textContent=String(e.qty)),E(T),q(T.selectedOptions.map(_=>_.value)),n()},k=s("div","lb-bundle-variant-option-groups");B.forEach((S,T)=>{let _=s("div","lb-bundle-variant-option-group"),M=s("span","lb-bundle-variant-option-label");M.textContent=S,_.appendChild(M);let O=document.createElement("select");O.className="lb-bundle-variant-select",O.setAttribute("data-variant-option",""),O.setAttribute("data-option-position",String(T+1)),O.name=`lb-variant-${I}-${T+1}`,O.setAttribute("aria-label",S);let ee=new Set;e.eligibleVariants.forEach(v=>{let h=v.selectedOptions[T]?.value;if(!h||ee.has(h))return;ee.add(h);let x=document.createElement("option");x.value=h,x.textContent=h,e.selected?.selectedOptions[T]?.value===h&&(x.selected=!0),O.appendChild(x)}),O.addEventListener("change",b),f.push(O),_.appendChild(O),k.appendChild(_)}),p.appendChild(k),e.selected&&q(e.selected.selectedOptions.map(S=>S.value))}}return a.appendChild(p),{el:a,state:e}}function dn(e){let t=s("div","lb-bundle-pricing"),r=s("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=s("span","lb-bundle-pricing__prices"),n=s("span","lb-bundle-compare-price",{"data-compare-price":""});n.style.display="none",o.appendChild(n);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});return o.appendChild(a),t.appendChild(o),{el:t,update({totalCents:i,saleCents:l,savingsCents:d,currency:u}){a.textContent=F(l,u),e.widgetConfig.pricing.showCompareAtPrice&&d>0?(n.textContent=F(i,u),n.style.display=""):n.style.display="none"}}}function sn(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""}),t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=s("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=F(o,n)}}}function cn(e,t,r){let o=t>0?`${t} item${t===1?"":"s"} out of stock`:e.widgetConfig.cta.ctaText||"Add to cart",n=ue(o);return t>0?n.disabled=!0:n.addEventListener("click",()=>{n.disabled||r()}),n}function un(e,t,r){if(t.discountType==="percentage"){let o=0;for(let n of r){if(!n.selected)continue;let a=z(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 kt=`
237
+ </svg>`;function _t(e,t,r,o){let n=t.widgetConfig,a=(x,A)=>ye(t,x,A),i=[],l=0;if(t.products.forEach((x,A)=>{let _=on(t,x,A);_.qty!==0&&(_.isOos&&(l++,n.outOfStockBehavior==="hide")||i.push(_))}),i.length===0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",c=s("div","lb-fixed",{"data-discount-type":t.discountConfig.discountType,"data-discount-value":String(t.discountConfig.discountValue)}),p=an(t,d);if(c.appendChild(p.el),n.countdown.showCountdown&&t.endsAt){let x=pe(t.endsAt);x&&(c.appendChild(x.el),o?.(x.stop))}let u=s("div","lb-fixed__products"),C=[];i.forEach(x=>{let A=dn(x,d,a,{enabled:n.showLowStockBadge,threshold:n.lowStockThreshold},()=>{T()});C.push(A),u.appendChild(A.el)}),c.appendChild(u),c.appendChild(s("div","lb-bundle-divider"));let m=sn(t);c.appendChild(m.el);let g=n.savingsBar.visible?cn():null;g&&c.appendChild(g.el);let k=un(t,l,()=>{let x=i.filter(A=>A.selected).map(A=>({merchandiseId:A.selected.id,quantity:A.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}));x.length!==0&&r(x)});c.appendChild(k),c.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),c.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(c),Se(c),o?.(()=>Ae(c)),T();function T(){let x=i.reduce((q,h)=>{if(!h.selected)return q;let M=j(h.selected.price.amount);return q+M*h.qty},0),A=pn(x,t.discountConfig,i),_=Math.max(0,x-A);m.update({totalCents:x,saleCents:A,savingsCents:_,currency:d}),g&&g.update({savingsCents:_,currency:d}),p.refresh(ln(t,x,A,d))}}function on(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,ye(e,t.id,p.id)))??null,i=n,l=!a,d=a??n[0]??null,c=d?ye(e,t.id,d.id):1;return{product:t,eligibleVariants:i,selected:d,qty:c,isOos:l}}function an(e,t){let r=e.widgetConfig,o=s("div","lb-bundle-header"),n=s("div","lb-bundle-header__content"),a=s("h3","lb-bundle-title");if(a.textContent=e.title,n.appendChild(a),e.description){let d=s("p","lb-bundle-subtitle");d.textContent=e.description,n.appendChild(d)}o.appendChild(n);let i=s("span","lb-bundle-header__badge",{"data-header-badge":""});o.appendChild(i);let l=qe(e,e.productQuantities,r.pricing.showSaveBadge);return l.headerBadge?i.textContent=l.headerBadge:i.style.display="none",{el:o,refresh(d){if(!r.pricing.showSaveBadge){i.style.display="none";return}d?(i.textContent=d,i.style.display=""):i.style.display="none"}}}function ln(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 dn(e,t,r,o,n){let a=s("div",e.isOos?"lb-bundle-product-row lb-bundle-product-row--oos":"lb-bundle-product-row",{"data-product-id":e.product.id.replace(/^.*\//,""),...e.isOos?{"aria-disabled":"true"}:{}}),i=s("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",i.appendChild(d)):i.insertAdjacentHTML("beforeend",nn);let c=null;e.isOos||(c=s("span","lb-bundle-qty-badge",{"data-qty-badge":""}),c.textContent=String(e.qty),i.appendChild(c)),a.appendChild(i);let p=s("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=s("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 _=s("span","lb-bundle-variant-badge");_.textContent=e.eligibleVariants[0].title,p.appendChild(_)}let m=s("span","lb-bundle-product-prices"),g=s("span","lb-bundle-product-compare-price",{"data-product-compare-price":""}),k=s("span","lb-bundle-product-price",{"data-product-price":""});m.appendChild(g),m.appendChild(k),p.appendChild(m);let T=s("span","lb-bundle-product-unit-price",{"data-product-unit-price":""});T.setAttribute("hidden",""),p.appendChild(T);let x=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});x.setAttribute("hidden",""),p.appendChild(x);let A=_=>{let q=j(_.price.amount);if(k.textContent=D(q,t),_.compareAtPrice){let w=j(_.compareAtPrice.amount);w>q?(g.textContent=D(w,t),g.removeAttribute("hidden")):g.setAttribute("hidden","")}else g.setAttribute("hidden","");let h=le(_.unitPrice,_.unitPriceMeasurement,t);h?(T.textContent=h,T.removeAttribute("hidden")):T.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(A(e.selected),e.eligibleVariants.length>1){let _=e.eligibleVariants[0].selectedOptions.map(P=>P.name),q=e.product.id.replace(/^.*\//,""),h=[],M=P=>e.eligibleVariants.find(E=>E.selectedOptions.every((S,I)=>S.value===P[I])&&E.selectedOptions.length===P.length)??null,L=P=>{P.selectedOptions.forEach((E,S)=>{let I=h[S];I&&I.value!==E.value&&(I.value=E.value)})},w=(P,E,S)=>e.eligibleVariants.some(I=>!Z(I,r(e.product.id,I.id))||I.selectedOptions[P]?.value!==E?!1:I.selectedOptions.every((O,te)=>te===P||O.value===S[te])),B=P=>{h.forEach((E,S)=>{Array.from(E.options).forEach(I=>{I.disabled=!w(S,I.value,P)})})},f=()=>{let P=h.map(S=>S.value),E=M(P);if(!E){e.selected&&(L(e.selected),B(e.selected.selectedOptions.map(S=>S.value)));return}e.selected=E,e.qty=r(e.product.id,E.id),c&&(c.textContent=String(e.qty)),A(E),B(E.selectedOptions.map(S=>S.value)),n()},F=s("div","lb-bundle-variant-option-groups");_.forEach((P,E)=>{let S=s("div","lb-bundle-variant-option-group"),I=s("span","lb-bundle-variant-option-label");I.textContent=P,S.appendChild(I);let O=document.createElement("select");O.className="lb-bundle-variant-select",O.setAttribute("data-variant-option",""),O.setAttribute("data-option-position",String(E+1)),O.name=`lb-variant-${q}-${E+1}`,O.setAttribute("aria-label",P);let te=new Set;e.eligibleVariants.forEach(v=>{let b=v.selectedOptions[E]?.value;if(!b||te.has(b))return;te.add(b);let y=document.createElement("option");y.value=b,y.textContent=b,e.selected?.selectedOptions[E]?.value===b&&(y.selected=!0),O.appendChild(y)}),O.addEventListener("change",f),h.push(O),S.appendChild(O),F.appendChild(S)}),p.appendChild(F),e.selected&&B(e.selected.selectedOptions.map(P=>P.value))}}return a.appendChild(p),{el:a,state:e}}function sn(e){let t=s("div","lb-bundle-pricing"),r=s("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=s("span","lb-bundle-pricing__prices"),n=s("span","lb-bundle-compare-price",{"data-compare-price":""});n.style.display="none",o.appendChild(n);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});return o.appendChild(a),t.appendChild(o),{el:t,update({totalCents:i,saleCents:l,savingsCents:d,currency:c}){a.textContent=D(l,c),e.widgetConfig.pricing.showCompareAtPrice&&d>0?(n.textContent=D(i,c),n.style.display=""):n.style.display="none"}}}function cn(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""}),t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=s("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 un(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 pn(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 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>
241
241
  <circle cx="10" cy="12" r="2"></circle>
242
- </svg>`,pn=`
242
+ </svg>`,bn=`
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>`,_t=`
246
+ </svg>`,At=`
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"/>
250
- </svg>`,bn=`
250
+ </svg>`,hn=`
251
251
  <svg width="16" height="16" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
252
252
  <path d="M14.348 5.652a.5.5 0 0 0-.707 0L10 9.293 6.36 5.652a.5.5 0 1 0-.708.707L9.293 10l-3.641 3.641a.5.5 0 0 0 .708.707L10 10.707l3.641 3.641a.5.5 0 0 0 .707-.707L10.707 10l3.641-3.641a.5.5 0 0 0 0-.707z"/>
253
- </svg>`,hn=`
253
+ </svg>`,mn=`
254
254
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
255
255
  <line x1="3" y1="7" x2="11" y2="7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
256
- </svg>`,mn=`
256
+ </svg>`,gn=`
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 Ne(e,t){return e.productRules[t]??lt}function Oe(e,t,r){let o=0;for(let n of e)n.productId===t&&n.variantId===r&&(o+=n.quantity);return o}function Bt(e,t,r,o){let n=t.widgetConfig,a=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",i=t.minQuantity??1,l=n.mixMatchShowQuantitySelector!==!1,d=Bn(t,n.outOfStockBehavior);if(d.filter(b=>!b.isOos).length<i)return;let p=[],c=s("div","lb-mix-match",{"data-required-quantity":String(i)}),y=fn(t);if(c.appendChild(y),n.countdown.showCountdown&&t.endsAt){let b=ce(t.endsAt);b&&(c.appendChild(b.el),o?.(b.stop))}let m=vn(i);c.appendChild(m.el);let g=s("div","lb-mix-match__slots",{"data-selection-slots":""});c.appendChild(g),c.appendChild(s("div","lb-bundle-divider"));let C=yn(n.pricing.showCompareAtPrice);c.appendChild(C.el);let L=n.savingsBar.visible?Cn():null;L&&c.appendChild(L.el);let w=s("div","lb-mix-match__price-placeholder",{"data-price-placeholder":""}),E=s("span","lb-mix-match__price-placeholder-text");E.textContent=`Select ${i} items to see price`,w.appendChild(E),c.appendChild(w);let B=kn(t,d,a,{showSearch:n.showSearch,showQtySelector:l,selections:p,onAdd:(b,k,S)=>f(b,k,S),isComplete:()=>p.length>=i});c.appendChild(B.el);let I=ue(`Select ${i} items to unlock`);I.disabled=!0,I.addEventListener("click",()=>{I.disabled||r(gn(p,t))}),c.appendChild(I),c.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),c.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(c),o?.(()=>ke(c)),A();function f(b,k,S){if(p.length>=i)return;let T=Ne(t,b.id),_=Ve(k,T.max,Oe(p,b.id,k.id));if(_<T.min)return;let M=Math.max(T.min,Math.min(S,_));p.push({productId:b.id,productTitle:b.title,variantId:k.id,variantTitle:k.title,imageUrl:k.image?.url??b.featuredImage?.url??null,priceCents:z(k.price.amount),compareCents:k.compareAtPrice?z(k.compareAtPrice.amount):null,unitPriceLabel:ae(k.unitPrice,k.unitPriceMeasurement,a),quantity:M}),A()}function P(b){b<0||b>=p.length||(p.splice(b,1),A())}function A(){R(),m.update(p.length),C.update(p,t,a),L&&L.update(p,t,a),w.style.display=p.length===0?"":"none",B.refreshCounts(),q()}function R(){g.innerHTML="";let b=Math.max(i,p.length);for(let k=0;k<b;k++){let S=p[k];S?g.appendChild(wn(S,k,a,()=>P(k))):g.appendChild(xn(k,()=>B.open()))}}function q(){let b=p.length;b<i?(I.disabled=!0,qe(I,`Select ${i-b} more to unlock`)):(I.disabled=!1,qe(I,n.cta.ctaText||"Add to cart"))}}function gn(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 fn(e){let t=e.widgetConfig,r=s("div","lb-bundle-header"),o=s("div","lb-bundle-header__content"),n=s("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=`-${F(Math.round(i*100),e.products[0]?.priceRange.minVariantPrice.currencyCode??"USD")}`),l){let d=s("span","lb-bundle-header__badge");d.textContent=l,r.appendChild(d)}}return r}function vn(e){let t=s("div","lb-mix-match__progress"),r=s("div","lb-mix-match__progress-labels"),o=s("span","lb-mix-match__progress-count",{"data-progress-count":""});o.textContent=`0 of ${e} selected`,r.appendChild(o);let n=s("span","lb-mix-match__progress-remaining",{"data-progress-remaining":""});n.textContent=`${e} more to go`,r.appendChild(n),t.appendChild(r);let a=s("div","lb-mix-match__progress-track",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)}),i=s("div","lb-mix-match__progress-fill",{"data-progress-fill":""});i.style.width="0%",a.appendChild(i),t.appendChild(a);function l(d){let u=Math.min(100,d/e*100);o.textContent=`${d} of ${e} selected`,d>=e?n.textContent="Complete":n.textContent=`${e-d} more to go`,i.style.width=`${u}%`,a.setAttribute("aria-valuenow",String(Math.min(d,e)))}return{el:t,update:l}}function xn(e,t){let r=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--empty",{"data-slot":String(e+1),tabindex:"0",role:"button","aria-label":"Add a product to the bundle"}),o=s("div","lb-mix-match__empty-thumb");o.innerHTML=pn,r.appendChild(o);let n=s("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 wn(e,t,r,o){let n=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--filled",{"data-slot":String(t+1)}),a=s("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.imageUrl){let g=document.createElement("img");g.src=ne(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",kt);let i=s("span","lb-bundle-qty-badge");i.textContent=`\xD7${e.quantity}`,a.appendChild(i),n.appendChild(a);let l=s("div","lb-mix-match__filled-info"),d=s("span","lb-mix-match__filled-title");if(d.textContent=e.productTitle,l.appendChild(d),e.variantTitle&&e.variantTitle!=="Default Title"){let g=s("span","lb-mix-match__filled-variant");g.textContent=e.variantTitle,l.appendChild(g)}let u=e.priceCents*e.quantity,p=e.compareCents!==null?e.compareCents*e.quantity:null,c=s("span","lb-mix-match__filled-price");if(p!==null&&p>u){let g=s("span","lb-mix-match__filled-compare");g.textContent=F(p,r),c.appendChild(g)}let y=document.createElement("span");if(y.textContent=F(u,r),c.appendChild(y),l.appendChild(c),e.unitPriceLabel){let g=s("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=_t,m.addEventListener("click",g=>{g.stopPropagation(),o()}),n.appendChild(m),n}function yn(e){let t=s("div","lb-bundle-pricing",{"data-pricing-section":""});t.style.display="none";let r=s("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=s("span","lb-bundle-pricing__prices"),n=s("span","lb-bundle-compare-price",{"data-compare-price":""});e&&o.appendChild(n);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});o.appendChild(a),t.appendChild(o);function i(l,d,u){if(l.length===0){t.style.display="none";return}t.style.display="";let p=l.reduce((y,m)=>y+m.priceCents*m.quantity,0),c=ve(p,d.discountConfig);e&&p>c?(n.textContent=F(p,u),n.style.display=""):n.style.display="none",a.textContent=F(c,u)}return{el:t,update:i}}function Cn(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});e.style.display="none";let t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=s("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,c)=>p+c.priceCents*c.quantity,0),d=ve(l,a.discountConfig),u=Math.max(0,l-d);if(u<=0){e.style.display="none";return}e.style.display="",r.textContent=F(u,i)}return{el:e,update:o}}function kn(e,t,r,o){let n=s("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.id});n.style.display="none";let a=s("div","lb-mix-match__modal",{role:"dialog","aria-modal":"true","aria-labelledby":`lb-modal-title-${Ct(e.id)}`,tabindex:"-1"}),i=s("div","lb-mix-match__modal-header"),l=s("h4","lb-mix-match__modal-title",{id:`lb-modal-title-${Ct(e.id)}`});l.textContent="Pick an item",i.appendChild(l);let d=document.createElement("button");d.type="button",d.className="lb-mix-match__modal-close",d.setAttribute("data-modal-close",""),d.setAttribute("aria-label","Close"),d.innerHTML=_t,d.addEventListener("click",A),i.appendChild(d),a.appendChild(i);let u=null,p=null;if(o.showSearch){let b=s("div","lb-mix-match__modal-search");u=document.createElement("input"),u.type="text",u.className="lb-mix-match__modal-search-input",u.setAttribute("data-modal-search",""),u.setAttribute("role","searchbox"),u.setAttribute("aria-label","Search products"),u.setAttribute("placeholder","Search products"),u.autocomplete="off",u.addEventListener("input",()=>E()),b.appendChild(u),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=bn,p.addEventListener("click",()=>{u&&(u.value="",E(),u.focus())}),b.appendChild(p),a.appendChild(b)}let c=s("div","lb-mix-match__modal-list",{"data-modal-list":""});a.appendChild(c);let y=s("div","lb-mix-match__modal-empty",{"data-modal-empty":""});y.style.display="none";let m=document.createElement("p");m.textContent="No products match your search.",y.appendChild(m),a.appendChild(y);let g=s("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"});a.appendChild(g),n.appendChild(a);let C=!1,L=[];function w(){C||(C=!0,c.innerHTML="",t.forEach(b=>{let k=Ne(e,b.product.id),S=b.variants,T=b.variants.find(V=>X(V,k.min))??b.firstAvailableVariant??b.variants[0];if(!T)return;let _=T,M=s("div",b.isOos?"lb-mix-match__modal-product lb-mix-match__modal-product--sold-out":"lb-mix-match__modal-product",{"data-product-id":b.product.id.replace(/^.*\//,"")}),O=s("div","lb-mix-match__modal-product-thumb"),v=(b.variants.find(V=>X(V,k.min))??b.variants[0]??null)?.image??b.product.featuredImage??null,h=null;v?(h=document.createElement("img"),h.src=ne(v.url,{width:U,height:U,crop:"center"}),h.alt=v.altText??b.product.title,h.width=U,h.height=U,h.loading="lazy",O.appendChild(h)):O.insertAdjacentHTML("beforeend",kt);let x=s("span","lb-bundle-qty-badge");x.hidden=!0,O.appendChild(x),M.appendChild(O);let D=s("div","lb-mix-match__modal-product-info"),oe=s("p","lb-mix-match__modal-product-title");oe.textContent=b.product.title,D.appendChild(oe);let G=s("p","lb-mix-match__modal-product-price");G.textContent=F(z(_.price.amount),r),D.appendChild(G);let J=s("p","lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price"),Ue=ae(_.unitPrice,_.unitPriceMeasurement,r);Ue?J.textContent=Ue:J.hidden=!0,D.appendChild(J);let pe=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});pe.hidden=!0,D.appendChild(pe);let $e=V=>{se(V,k.min,e.widgetConfig.lowStockThreshold,e.widgetConfig.showLowStockBadge)?(pe.textContent=`Only ${V.quantityAvailable} left`,pe.hidden=!1):pe.hidden=!0};$e(_);let We=()=>{let V=Oe(o.selections,b.product.id,_.id),K=Ve(_,k.max,V),re=Math.max(k.min,K);return{min:k.min,max:re,cap:K}},te=null;if(!b.isOos&&o.showQtySelector){let V=s("div","lb-bundle-variant-option-group lb-mix-match__qty-stepper-group"),K=s("span","lb-bundle-variant-option-label");K.textContent="Quantity",V.appendChild(K),te=_n({initial:k.min,getBounds:()=>{let{min:re,max:Te}=We();return{min:re,max:Te}}}),V.appendChild(te.el),D.appendChild(V)}let be={el:M,product:b.product,variant:T,refreshFromSelections:()=>{}};if(S.length>1){let V=S[0].selectedOptions.map($=>$.name),K=b.product.id.replace(/^.*\//,""),re=[],Te=$=>S.find(N=>N.selectedOptions.length===$.length&&N.selectedOptions.every((j,H)=>j.value===$[H]))??null,Nt=$=>{$.selectedOptions.forEach((N,j)=>{let H=re[j];H&&H.value!==N.value&&(H.value=N.value)})},Ht=($,N,j)=>S.some(H=>!X(H,k.min)||H.selectedOptions[$]?.value!==N?!1:H.selectedOptions.every((W,he)=>he===$||W.value===j[he])),Ae=$=>{re.forEach((N,j)=>{Array.from(N.options).forEach(H=>{H.disabled=!Ht(j,H.value,$)})})},Ut=()=>{let $=re.map(W=>W.value),N=Te($);if(!N){Nt(_),Ae(_.selectedOptions.map(W=>W.value));return}_=N,be.variant=N,G.textContent=F(z(_.price.amount),r);let j=ae(_.unitPrice,_.unitPriceMeasurement,r);j?(J.textContent=j,J.hidden=!1):(J.textContent="",J.hidden=!0);let H=_.image??b.product.featuredImage;h&&H&&(h.src=ne(H.url,{width:U,height:U,crop:"center"}),h.alt=H.altText??b.product.title),Ae(N.selectedOptions.map(W=>W.value)),$e(_),be.refreshFromSelections()},ze=s("div","lb-bundle-variant-option-groups");V.forEach(($,N)=>{let j=s("div","lb-bundle-variant-option-group"),H=s("span","lb-bundle-variant-option-label");H.textContent=$,j.appendChild(H);let W=document.createElement("select");W.className="lb-mix-match__variant-select",W.setAttribute("data-variant-option",""),W.setAttribute("data-option-position",String(N+1)),W.name=`lb-variant-${K}-${N+1}`,W.setAttribute("aria-label",$);let he=new Set;S.forEach($t=>{let le=$t.selectedOptions[N]?.value;if(!le||he.has(le))return;he.add(le);let ge=document.createElement("option");ge.value=le,ge.textContent=le,T.selectedOptions[N]?.value===le&&(ge.selected=!0),W.appendChild(ge)}),W.addEventListener("change",Ut),re.push(W),j.appendChild(W),ze.appendChild(j)}),D.appendChild(ze),Ae(T.selectedOptions.map($=>$.value))}else if(S.length===1&&T.title!=="Default Title"){let V=s("span","lb-mix-match__filled-variant");V.textContent=T.title,D.appendChild(V)}if(b.isOos){let V=s("span","lb-mix-match__modal-sold-out-label");V.textContent="Sold out",D.appendChild(V)}M.appendChild(D);let Z=null,Ot=()=>{if(!Z)return;let{cap:V}=We(),K=Oe(o.selections,b.product.id,_.id);K>0?(x.textContent=String(K),x.hidden=!1):x.hidden=!0,Z.disabled=o.isComplete()||V<k.min};if(!b.isOos){let V=s("div","lb-mix-match__modal-product-actions");Z=document.createElement("button"),Z.type="button",Z.className="lb-mix-match__modal-add",Z.textContent="Add",Z.addEventListener("click",()=>{if(!Z||Z.disabled||o.isComplete())return;let K=te?te.value():k.min;o.onAdd(b.product,_,K),te&&te.reset(k.min),A()}),V.appendChild(Z),M.appendChild(V)}be.refreshFromSelections=()=>{te&&te.refresh(),Ot()},be.refreshFromSelections(),L.push(be),c.appendChild(M)}),Ce(c),q())}function E(){if(!u)return;let b=u.value.trim().toLowerCase();p&&(p.style.display=b?"":"none");let k=0;L.forEach(S=>{let T=!b||S.product.title.toLowerCase().includes(b);S.el.style.display=T?"":"none",T&&k++}),y.style.display=k===0&&b?"":"none"}let B=null;function I(b){if(b.key==="Escape"){b.preventDefault(),A();return}b.key==="Tab"&&Sn(b,a)}let f=!1;function P(){f||o.isComplete()||(f=!0,w(),B=n.getRootNode().activeElement,n.style.display="",n.classList.add("lb-mix-match__modal-overlay--open"),a.focus(),document.addEventListener("keydown",I),n.addEventListener("click",R))}function A(){f&&(f=!1,n.classList.remove("lb-mix-match__modal-overlay--open"),n.style.display="none",document.removeEventListener("keydown",I),n.removeEventListener("click",R),B instanceof HTMLElement&&B.focus())}function R(b){b.target===n&&A()}function q(){L.forEach(b=>b.refreshFromSelections())}return{el:n,open:P,close:A,refreshCounts:q}}function _n(e){let t=s("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=hn,t.appendChild(r);let o=s("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=mn,t.appendChild(n);let a=i(e.initial,e.getBounds());function i(d,u){return Math.max(u.min,Math.min(u.max,d))}function l(){let d=e.getBounds();a=i(a,d),o.textContent=String(a),r.disabled=a<=d.min,n.disabled=a>=d.max}return r.addEventListener("click",()=>{let d=e.getBounds();a=i(a-1,d),l()}),n.addEventListener("click",()=>{let d=e.getBounds();a=i(a+1,d),l()}),l(),{el:t,value:()=>a,reset(d){a=i(d,e.getBounds()),l()},refresh:l}}function Bn(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=Ne(e,n.id),i=n.variants.nodes.filter(d=>X(d,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 Sn(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 Ct(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Et(e,t,r,o){let n=t.widgetConfig,a=t.products[0],i=t.volumeTiers[0]?.minQuantity??1,l=a?.variants.nodes.find(f=>X(f,i));if(!l&&n.outOfStockBehavior==="hide")return;let d=l?z(l.price.amount):0,u=l?.price.currencyCode??"USD",p=t.discountConfig.discountType,c=t.volumeTiers.map((f,P)=>{let A;if(p==="fixed_amount"){let R=Math.round((f.amount??0)*100);A=Math.max(0,d-R)}else{let R=f.percentage??0,q=Math.floor(d*R/100);A=Math.max(0,d-q)}return{tier:f,index:P,qty:f.minQuantity,pricePerUnitCents:A,basePricePerUnitCents:d}}),y=Ln(c),m=n.defaultTier==="best_value"?y:0;typeof n.defaultTier=="number"&&(m=At(n.defaultTier,0,c.length-1));let g=n.popularBadge.tierIndex!==void 0?At(n.popularBadge.tierIndex,0,c.length-1):y,C=s("div","lb-volume");if(C.appendChild(Tn(t,c,m,u,p)),n.countdown.showCountdown&&t.endsAt){let f=ce(t.endsAt);f&&(C.appendChild(f.el),o?.(f.stop))}let L=s("div","lb-volume__tiers",{role:"radiogroup","aria-label":"Quantity tiers","data-tier-group":""});c.forEach(f=>{let P=An(f,f.index===m,u,n.popularBadge.visible&&f.index===g?n.popularBadge.text:null,n.pricing.showComparePrice,n.pricing.showPerUnitPrice);P.addEventListener("click",()=>I(f.index)),P.addEventListener("keydown",A=>{if(A.key==="Enter"||A.key===" "){A.preventDefault(),I(f.index);return}if(A.key==="ArrowDown"||A.key==="ArrowRight"||A.key==="ArrowUp"||A.key==="ArrowLeft"){A.preventDefault();let R=A.key==="ArrowDown"||A.key==="ArrowRight"?1:-1,q=(f.index+R+c.length)%c.length;I(q),L.children[q]?.focus()}}),L.appendChild(P)}),C.appendChild(L),C.appendChild(s("div","lb-bundle-divider"));let w=St(c,m,u,n.pricing.showItemCount,n.pricing.showCompareAtPrice);C.appendChild(w);let E=n.savingsBar.visible?Tt(c,m,u):null;E&&C.appendChild(E);let B=En(t,()=>{if(!l)return;let f=c[m];f&&r([{merchandiseId:l.id,quantity:f.qty,attributes:[{key:"_lime_bundle_gid",value:t.id},{key:"_lime_bundle_type",value:t.bundleType}]}])});if(l&&se(l,i,n.lowStockThreshold,n.showLowStockBadge)){let f=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});f.textContent=`Only ${l.quantityAvailable} left`,C.appendChild(f)}C.appendChild(B),C.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),C.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(C);function I(f){if(f===m||f<0||f>=c.length)return;m=f,Array.from(L.children).forEach((R,q)=>{R.setAttribute("aria-checked",String(q===f)),R.tabIndex=q===f?0:-1});let P=St(c,f,u,n.pricing.showItemCount,n.pricing.showCompareAtPrice);if(w.replaceWith(P),w=P,E){let R=Tt(c,f,u);E.replaceWith(R),E=R}let A=C.querySelector("[data-header-badge]");if(A){let R=Lt(c[f],u,p);R?(A.textContent=R,A.style.display=""):A.style.display="none"}}}function Tn(e,t,r,o,n){let a=e.widgetConfig,i=s("div","lb-bundle-header"),l=s("div","lb-bundle-header__content"),d=s("h3","lb-bundle-title");if(d.textContent=e.title,l.appendChild(d),i.appendChild(l),a.pricing.showSaveBadge){let u=Lt(t[r],o,n);if(u){let p=s("span","lb-bundle-header__badge",{"data-header-badge":""});p.textContent=u,i.appendChild(p)}}return i}function An(e,t,r,o,n,a){let i=s("div","lb-volume__tier",{role:"radio","aria-checked":String(t),tabindex:t?"0":"-1","data-tier-index":String(e.index),"data-tier-qty":String(e.qty)}),l=s("span","lb-volume__radio");l.appendChild(s("span","lb-volume__radio-dot")),i.appendChild(l);let d=s("span","lb-volume__tier-grid"),u=s("span","lb-volume__tier-label");u.textContent=`Buy ${e.qty}`,d.appendChild(u);let p=s("span","lb-volume__tier-price");if(n&&e.pricePerUnitCents<e.basePricePerUnitCents){let y=s("span","lb-volume__tier-compare");y.textContent=F(e.basePricePerUnitCents,r),p.appendChild(y)}if(a){let y=document.createElement("span");y.setAttribute("data-tier-price-each",""),y.textContent=F(e.pricePerUnitCents,r),p.appendChild(y);let m=s("span","lb-volume__tier-unit");m.textContent=" each",p.appendChild(m)}d.appendChild(p),i.appendChild(d);let c=s("span","lb-volume__tier-badge");return o?c.textContent=o:c.style.display="none",i.appendChild(c),i}function St(e,t,r,o,n){let a=e[t],i=a?a.pricePerUnitCents*a.qty:0,l=a?a.basePricePerUnitCents*a.qty:0,d=Math.max(0,l-i),u=s("div","lb-bundle-pricing"),p=s("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)}u.appendChild(p);let c=s("span","lb-bundle-pricing__prices");if(n&&d>0){let m=s("span","lb-bundle-compare-price",{"data-compare-price":""});m.textContent=F(l,r),c.appendChild(m)}let y=s("span","lb-bundle-sale-price",{"data-total-price":""});return y.textContent=F(i,r),c.appendChild(y),u.appendChild(c),u}function Tt(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=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});i<=0&&(l.style.display="none");let d=document.createElement("span");d.textContent="You save",l.appendChild(d);let u=s("span","",{"data-savings-amount":""});return u.textContent=F(i,r),l.appendChild(u),l}function En(e,t){let r=e.products[0],o=e.volumeTiers[0]?.minQuantity??1,n=r?.variants.nodes.some(l=>X(l,o)),a=n?e.widgetConfig.cta.ctaText||"Add to cart":"Sold out",i=ue(a);return n||(i.disabled=!0),i.addEventListener("click",()=>{i.disabled||t()}),i}function Lt(e,t,r){if(!e)return null;let{tier:o}=e;if(r==="fixed_amount"){let n=o.amount??0;return n>0?`-${F(Math.round(n*100),t)}`:null}if(r==="percentage"){let n=o.percentage??0;return n>0?`-${Math.round(n)}%`:null}return null}function Ln(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 At(e,t,r){return Math.max(t,Math.min(r,e))}var Pn=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),_e=new Set,Be=!1;function Pt(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let r of _e)r.classList.add(e),r.classList.remove(t)}function Mt(e){Pn.has(e.key)&&Pt("using-keyboard")}function It(){Pt("using-mouse")}function Mn(){Be||(Be=!0,document.addEventListener("keydown",Mt,!0),document.addEventListener("pointerdown",It,!0))}function In(){Be&&(Be=!1,document.removeEventListener("keydown",Mt,!0),document.removeEventListener("pointerdown",It,!0))}function Se(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),_e.add(e),Mn(),()=>{_e.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),_e.size===0&&In()}}var He=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
260
+ </svg>`;function $e(e,t){return e.productRules[t]??ct}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 Et(e,t,r,o){let n=t.widgetConfig,a=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",i=t.minQuantity??1,l=n.mixMatchShowQuantitySelector!==!1,d=Sn(t,n.outOfStockBehavior);if(d.filter(w=>!w.isOos).length<i)return;let p=[],u=s("div","lb-mix-match",{"data-required-quantity":String(i)}),C=vn(t);if(u.appendChild(C),n.countdown.showCountdown&&t.endsAt){let w=pe(t.endsAt);w&&(u.appendChild(w.el),o?.(w.stop))}let m=xn(i);u.appendChild(m.el);let g=s("div","lb-mix-match__slots",{"data-selection-slots":""});u.appendChild(g),u.appendChild(s("div","lb-bundle-divider"));let k=Cn(n.pricing.showCompareAtPrice);u.appendChild(k.el);let T=n.savingsBar.visible?kn():null;T&&u.appendChild(T.el);let x=be(`Select ${i} items to unlock`);x.disabled=!0,x.addEventListener("click",()=>{x.disabled||r(fn(p,t))});let A=_n(t,d,a,{showSearch:n.showSearch,showQtySelector:l,selections:p,onAdd:(w,B,f)=>_(w,B,f),isComplete:()=>p.length>=i,getFocusAfterAdd:()=>g.querySelector(".lb-mix-match__slot--empty")??x});u.appendChild(A.el),u.appendChild(x),u.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),u.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(u),o?.(()=>Ae(u)),h();function _(w,B,f){if(p.length>=i)return;let F=$e(t,w.id),P=Ne(B,F.max,Ue(p,w.id,B.id));if(P<F.min)return;let E=Math.max(F.min,Math.min(f,P));p.push({productId:w.id,productTitle:w.title,variantId:B.id,variantTitle:B.title,imageUrl:B.image?.url??w.featuredImage?.url??null,priceCents:j(B.price.amount),compareCents:B.compareAtPrice?j(B.compareAtPrice.amount):null,unitPriceLabel:le(B.unitPrice,B.unitPriceMeasurement,a),quantity:E}),h()}function q(w){w<0||w>=p.length||(p.splice(w,1),h())}function h(){M(),m.update(p.length),k.update(p,t,a),T&&T.update(p,t,a),A.refreshCounts(),L()}function M(){g.innerHTML="";let w=Math.max(i,p.length);for(let B=0;B<w;B++){let f=p[B];f?g.appendChild(yn(f,B,a,()=>q(B))):g.appendChild(wn(B,()=>A.open()))}}function L(){let w=p.length;w<i?(x.disabled=!0,He(x,`Select ${i-w} more to unlock`)):(x.disabled=!1,He(x,n.cta.ctaText||"Add to cart"))}}function fn(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 vn(e){let t=e.widgetConfig,r=s("div","lb-bundle-header"),o=s("div","lb-bundle-header__content"),n=s("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 d=s("span","lb-bundle-header__badge");d.textContent=l,r.appendChild(d)}}return r}function xn(e){let t=s("div","lb-mix-match__progress"),r=s("div","lb-mix-match__progress-labels"),o=s("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"});o.textContent=`0 of ${e} selected`,r.appendChild(o);let n=s("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=s("div","lb-mix-match__progress-track",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)}),i=s("div","lb-mix-match__progress-fill",{"data-progress-fill":""});i.style.width="0%",a.appendChild(i),t.appendChild(a);function l(d){let c=Math.min(100,d/e*100);o.textContent=`${d} of ${e} selected`,d>=e?n.textContent="Complete":n.textContent=`${e-d} more to go`,i.style.width=`${c}%`,a.setAttribute("aria-valuenow",String(Math.min(d,e)))}return{el:t,update:l}}function wn(e,t){let r=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--empty",{"data-slot":String(e+1),tabindex:"0",role:"button","aria-label":"Add a product to the bundle"}),o=s("div","lb-mix-match__empty-thumb");o.innerHTML=bn,r.appendChild(o);let n=s("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 yn(e,t,r,o){let n=s("div","lb-bundle-product-row lb-mix-match__slot lb-mix-match__slot--filled",{"data-slot":String(t+1)}),a=s("div","lb-bundle-thumbnail",{"data-thumbnail":""});if(e.imageUrl){let 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",St);let i=s("span","lb-bundle-qty-badge");i.textContent=`\xD7${e.quantity}`,a.appendChild(i),n.appendChild(a);let l=s("div","lb-mix-match__filled-info"),d=s("span","lb-mix-match__filled-title");if(d.textContent=e.productTitle,l.appendChild(d),e.variantTitle&&e.variantTitle!=="Default Title"){let g=s("span","lb-mix-match__filled-variant");g.textContent=e.variantTitle,l.appendChild(g)}let c=e.priceCents*e.quantity,p=e.compareCents!==null?e.compareCents*e.quantity:null,u=s("span","lb-mix-match__filled-price");if(p!==null&&p>c){let g=s("span","lb-mix-match__filled-compare");g.textContent=D(p,r),u.appendChild(g)}let C=document.createElement("span");if(C.textContent=D(c,r),u.appendChild(C),l.appendChild(u),e.unitPriceLabel){let g=s("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 Cn(e){let t=s("div","lb-bundle-pricing",{"data-pricing-section":""});t.style.display="none";let r=s("span","lb-bundle-pricing__label");r.textContent="Bundle price",t.appendChild(r);let o=s("span","lb-bundle-pricing__prices"),n=s("span","lb-bundle-compare-price",{"data-compare-price":""});e&&o.appendChild(n);let a=s("span","lb-bundle-sale-price",{"data-sale-price":""});o.appendChild(a),t.appendChild(o);function i(l,d,c){if(l.length===0){t.style.display="none";return}t.style.display="";let p=l.reduce((C,m)=>C+m.priceCents*m.quantity,0),u=Ce(p,d.discountConfig);e&&p>u?(n.textContent=D(p,c),n.style.display=""):n.style.display="none",a.textContent=D(u,c)}return{el:t,update:i}}function kn(){let e=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});e.style.display="none";let t=document.createElement("span");t.textContent="You save",e.appendChild(t);let r=s("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),d=Ce(l,a.discountConfig),c=Math.max(0,l-d);if(c<=0){e.style.display="none";return}e.style.display="",r.textContent=D(c,i)}return{el:e,update:o}}function _n(e,t,r,o){let n=s("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.id});n.style.display="none";let a=s("div","lb-mix-match__modal",{role:"dialog","aria-modal":"true","aria-labelledby":`lb-modal-title-${Bt(e.id)}`,tabindex:"-1"}),i=s("div","lb-mix-match__modal-header"),l=s("h4","lb-mix-match__modal-title",{id:`lb-modal-title-${Bt(e.id)}`});l.textContent="Pick an item",i.appendChild(l);let d=document.createElement("button");d.type="button",d.className="lb-mix-match__modal-close",d.setAttribute("data-modal-close",""),d.setAttribute("aria-label","Close"),d.innerHTML=At,d.addEventListener("click",L),i.appendChild(d),a.appendChild(i);let c=null,p=null;if(o.showSearch){let f=s("div","lb-mix-match__modal-search");c=document.createElement("input"),c.type="text",c.className="lb-mix-match__modal-search-input",c.setAttribute("data-modal-search",""),c.setAttribute("role","searchbox"),c.setAttribute("aria-label","Search products"),c.setAttribute("placeholder","Search products"),c.autocomplete="off",c.addEventListener("input",()=>A()),f.appendChild(c),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=hn,p.addEventListener("click",()=>{c&&(c.value="",A(),c.focus())}),f.appendChild(p),a.appendChild(f)}let u=s("div","lb-mix-match__modal-list",{"data-modal-list":""});a.appendChild(u);let C=s("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=s("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"});a.appendChild(g),n.appendChild(a);let k=!1,T=[];function x(){k||(k=!0,u.innerHTML="",t.forEach(f=>{let F=$e(e,f.product.id),P=f.variants,E=f.variants.find(V=>Z(V,F.min))??f.firstAvailableVariant??f.variants[0];if(!E)return;let S=E,I=s("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(/^.*\//,"")}),O=s("div","lb-mix-match__modal-product-thumb"),v=(f.variants.find(V=>Z(V,F.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",O.appendChild(b)):O.insertAdjacentHTML("beforeend",St);let y=s("span","lb-bundle-qty-badge");y.hidden=!0,O.appendChild(y),I.appendChild(O);let R=s("div","lb-mix-match__modal-product-info"),ne=s("p","lb-mix-match__modal-product-title");ne.textContent=f.product.title,R.appendChild(ne);let Y=s("p","lb-mix-match__modal-product-price");Y.textContent=D(j(S.price.amount),r),R.appendChild(Y);let ee=s("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=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});he.hidden=!0,R.appendChild(he);let je=V=>{ue(V,F.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,F.max,V),oe=Math.max(F.min,X);return{min:F.min,max:oe,cap:X}},G=null,ve=null;!f.isOos&&o.showQtySelector&&(ve=s("div","lb-bundle-variant-option-group lb-mix-match__qty-stepper-group"),G=Bn({initial:F.min,getBounds:()=>{let{min:V,max:X}=Qe();return{min:V,max:X}}}),ve.appendChild(G.el));let me={el:I,product:f.product,variant:E,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,F.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()},Ke=s("div","lb-bundle-variant-option-groups");V.forEach(($,N)=>{let Q=s("div","lb-bundle-variant-option-group"),H=s("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 we=document.createElement("option");we.value=se,we.textContent=se,E.selectedOptions[N]?.value===se&&(we.selected=!0),z.appendChild(we)}),z.addEventListener("change",$t),de.push(z),Q.appendChild(z),Ke.appendChild(Q)}),R.appendChild(Ke),Pe(E.selectedOptions.map($=>$.value))}else if(P.length===1&&E.title!=="Default Title"){let V=s("span","lb-mix-match__filled-variant");V.textContent=E.title,R.appendChild(V)}if(f.isOos){let V=s("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}),G&&G.setExternallyDisabled(!0);return}let{cap:V}=Qe(),X=Ue(o.selections,f.product.id,S.id);X>0?(y.textContent=String(X),y.hidden=!1):y.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<F.min);let xe=W.disabled;de.forEach(ie=>{ie.disabled=xe}),G&&G.setExternallyDisabled(xe)};if(!f.isOos){let V=s("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=G?G.value():F.min;o.onAdd(f.product,S,X),G&&G.reset(F.min);let oe=o.getFocusAfterAdd();oe&&(_=oe),L()}),V.appendChild(W),R.appendChild(V)}me.refreshFromSelections=()=>{G&&G.refresh(),Ut()},me.refreshFromSelections(),T.push(me),u.appendChild(I)}),Se(u),B())}function A(){if(!c)return;let f=c.value.trim().toLowerCase();p&&(p.style.display=f?"":"none");let F=0;T.forEach(P=>{let E=!f||P.product.title.toLowerCase().includes(f);P.el.style.display=E?"":"none",E&&F++}),C.style.display=F===0&&f?"":"none"}let _=null;function q(f){if(f.key==="Escape"){f.preventDefault(),L();return}f.key==="Tab"&&An(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",q),n.addEventListener("click",w))}function L(){h&&(h=!1,n.classList.remove("lb-mix-match__modal-overlay--open"),n.style.display="none",document.removeEventListener("keydown",q),n.removeEventListener("click",w),_ instanceof HTMLElement&&_.focus())}function w(f){f.target===n&&L()}function B(){T.forEach(f=>f.refreshFromSelections())}return{el:n,open:M,close:L,refreshCounts:B}}function Bn(e){let t=s("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=mn,t.appendChild(r);let o=s("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=gn,t.appendChild(n);let a=l(e.initial,e.getBounds()),i=!1;function l(c,p){return Math.max(p.min,Math.min(p.max,c))}function d(){let c=e.getBounds();a=l(a,c),o.textContent=String(a),r.disabled=i||a<=c.min,n.disabled=i||a>=c.max}return r.addEventListener("click",()=>{let c=e.getBounds();a=l(a-1,c),d()}),n.addEventListener("click",()=>{let c=e.getBounds();a=l(a+1,c),d()}),d(),{el:t,value:()=>a,reset(c){a=l(c,e.getBounds()),d()},refresh:d,setExternallyDisabled(c){i=c,d()}}}function Sn(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(d=>Z(d,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 An(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 Bt(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Mt(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 d=l?j(l.price.amount):0,c=l?.price.currencyCode??"USD",p=t.discountConfig.discountType,u=t.volumeTiers.map((h,M)=>{let L;if(p==="fixed_amount"){let w=Math.round((h.amount??0)*100);L=Math.max(0,d-w)}else{let w=h.percentage??0,B=Math.floor(d*w/100);L=Math.max(0,d-B)}return{tier:h,index:M,qty:h.minQuantity,pricePerUnitCents:L,basePricePerUnitCents:d}}),C=Pn(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=s("div","lb-volume");if(k.appendChild(En(t,u,m,c,p)),n.countdown.showCountdown&&t.endsAt){let h=pe(t.endsAt);h&&(k.appendChild(h.el),o?.(h.stop))}let T=s("div","lb-volume__tiers",{role:"radiogroup","aria-label":"Quantity tiers","data-tier-group":""});u.forEach(h=>{let M=Tn(h,h.index===m,c,n.popularBadge.visible&&h.index===g?n.popularBadge.text:null,n.pricing.showComparePrice,n.pricing.showPerUnitPrice);M.addEventListener("click",()=>q(h.index)),M.addEventListener("keydown",L=>{if(L.key==="Enter"||L.key===" "){L.preventDefault(),q(h.index);return}if(L.key==="ArrowDown"||L.key==="ArrowRight"||L.key==="ArrowUp"||L.key==="ArrowLeft"){L.preventDefault();let w=L.key==="ArrowDown"||L.key==="ArrowRight"?1:-1,B=(h.index+w+u.length)%u.length;q(B),T.children[B]?.focus()}}),T.appendChild(M)}),k.appendChild(T),k.appendChild(s("div","lb-bundle-divider"));let x=Tt(u,m,c,n.pricing.showItemCount,n.pricing.showCompareAtPrice);k.appendChild(x);let A=n.savingsBar.visible?Lt(u,m,c):null;A&&k.appendChild(A);let _=Ln(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=s("span","lb-bundle-low-stock-badge",{"data-low-stock-badge":""});h.textContent=`Only ${l.quantityAvailable} left`,k.appendChild(h)}k.appendChild(_),k.appendChild(s("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),k.appendChild(s("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),e.appendChild(k);function q(h){if(h===m||h<0||h>=u.length)return;m=h,Array.from(T.children).forEach((w,B)=>{w.setAttribute("aria-checked",String(B===h)),w.tabIndex=B===h?0:-1});let M=Tt(u,h,c,n.pricing.showItemCount,n.pricing.showCompareAtPrice);if(x.replaceWith(M),x=M,A){let w=Lt(u,h,c);A.replaceWith(w),A=w}let L=k.querySelector("[data-header-badge]");if(L){let w=It(u[h],c,p);w?(L.textContent=w,L.style.display=""):L.style.display="none"}}}function En(e,t,r,o,n){let a=e.widgetConfig,i=s("div","lb-bundle-header"),l=s("div","lb-bundle-header__content"),d=s("h3","lb-bundle-title");if(d.textContent=e.title,l.appendChild(d),i.appendChild(l),a.pricing.showSaveBadge){let c=It(t[r],o,n);if(c){let p=s("span","lb-bundle-header__badge",{"data-header-badge":""});p.textContent=c,i.appendChild(p)}}return i}function Tn(e,t,r,o,n,a){let i=s("div","lb-volume__tier",{role:"radio","aria-checked":String(t),tabindex:t?"0":"-1","data-tier-index":String(e.index),"data-tier-qty":String(e.qty)}),l=s("span","lb-volume__radio");l.appendChild(s("span","lb-volume__radio-dot")),i.appendChild(l);let d=s("span","lb-volume__tier-grid"),c=s("span","lb-volume__tier-label");c.textContent=`Buy ${e.qty}`,d.appendChild(c);let p=s("span","lb-volume__tier-price");if(n&&e.pricePerUnitCents<e.basePricePerUnitCents){let C=s("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=s("span","lb-volume__tier-unit");m.textContent=" each",p.appendChild(m)}d.appendChild(p),i.appendChild(d);let u=s("span","lb-volume__tier-badge");return o?u.textContent=o:u.style.display="none",i.appendChild(u),i}function Tt(e,t,r,o,n){let a=e[t],i=a?a.pricePerUnitCents*a.qty:0,l=a?a.basePricePerUnitCents*a.qty:0,d=Math.max(0,l-i),c=s("div","lb-bundle-pricing"),p=s("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)}c.appendChild(p);let u=s("span","lb-bundle-pricing__prices");if(n&&d>0){let m=s("span","lb-bundle-compare-price",{"data-compare-price":""});m.textContent=D(l,r),u.appendChild(m)}let C=s("span","lb-bundle-sale-price",{"data-total-price":""});return C.textContent=D(i,r),u.appendChild(C),c.appendChild(u),c}function Lt(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=s("div","lb-bundle-savings-bar",{"data-savings-bar":""});i<=0&&(l.style.display="none");let d=document.createElement("span");d.textContent="You save",l.appendChild(d);let c=s("span","",{"data-savings-amount":""});return c.textContent=D(i,r),l.appendChild(c),l}function Ln(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 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 Pn(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 Pt(e,t,r){return Math.max(t,Math.min(r,e))}var Mn=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),Ee=new Set,Te=!1;function Rt(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let r of Ee)r.classList.add(e),r.classList.remove(t)}function Dt(e){Mn.has(e.key)&&Rt("using-keyboard")}function Ft(){Rt("using-mouse")}function In(){Te||(Te=!0,document.addEventListener("keydown",Dt,!0),document.addEventListener("pointerdown",Ft,!0))}function Rn(){Te&&(Te=!1,document.removeEventListener("keydown",Dt,!0),document.removeEventListener("pointerdown",Ft,!0))}function Le(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),Ee.add(e),In(),()=>{Ee.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),Ee.size===0&&Rn()}}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 * {
@@ -485,6 +485,13 @@
485
485
  text-decoration: underline;
486
486
  }
487
487
 
488
+ a.lb-bundle-product-name:focus-visible {
489
+ outline: 2px solid var(--lb-primary-color);
490
+ outline-offset: 0;
491
+ box-shadow: none;
492
+ border-radius: 2px;
493
+ }
494
+
488
495
  .lb-bundle-product-price {
489
496
  /* --lb-product-price-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
490
497
  display: var(--lb-product-price-display, block);
@@ -558,7 +565,7 @@
558
565
  .lb-bundle-variant-option-groups {
559
566
  display: flex;
560
567
  flex-direction: column;
561
- gap: 12px;
568
+ gap: 8px;
562
569
  margin-top: 8px;
563
570
  }
564
571
 
@@ -580,7 +587,23 @@
580
587
  }
581
588
 
582
589
  .lb-mix-match__modal-product-info .lb-bundle-variant-option-groups {
583
- margin-top: 4px;
590
+ margin-top: 8px;
591
+ }
592
+
593
+ /* Desktop: lay variant option groups in a wrapping row inside the modal
594
+ (Size + Color side-by-side). Mobile keeps the column stack from the
595
+ base rule above. The 768px breakpoint mirrors bundle-mix-match.css. */
596
+ @media (min-width: 768px) {
597
+ .lb-mix-match__modal-product-info .lb-bundle-variant-option-groups {
598
+ flex-direction: row;
599
+ flex-wrap: wrap;
600
+ }
601
+ /* Direct children only \u2014 the qty-stepper-group is also a
602
+ .lb-bundle-variant-option-group but lives in the actions wrapper
603
+ and must keep its natural width. */
604
+ .lb-mix-match__modal-product-info .lb-bundle-variant-option-groups > .lb-bundle-variant-option-group {
605
+ flex: 1;
606
+ }
584
607
  }
585
608
 
586
609
  /* Focus-ring suppression for mouse users. A small JS helper \u2014 see
@@ -842,7 +865,7 @@
842
865
  .lb-ab-pending {
843
866
  visibility: hidden;
844
867
  }
845
- `,Rt=`/* Lime Bundles \u2014 Fixed bundle styles */
868
+ `,Vt=`/* Lime Bundles \u2014 Fixed bundle styles */
846
869
 
847
870
  .lb-fixed__products {
848
871
  display: flex;
@@ -916,8 +939,9 @@
916
939
  .lb-bundle-variant-select:focus-visible {
917
940
  outline: 2px solid var(--lb-primary-color);
918
941
  outline-offset: 2px;
942
+ box-shadow: none;
919
943
  }
920
- `,Dt=`/* Lime Bundles \u2014 Mix & Match styles */
944
+ `,qt=`/* Lime Bundles \u2014 Mix & Match styles */
921
945
 
922
946
  /* === Slot list ============================================================
923
947
  Caps the height of the slot stack so long bundles don't push the CTA off
@@ -992,7 +1016,8 @@
992
1016
 
993
1017
  .lb-mix-match__slot--empty:focus-visible {
994
1018
  outline: 2px solid var(--lb-primary-color);
995
- outline-offset: 2px;
1019
+ outline-offset: -2px;
1020
+ box-shadow: none;
996
1021
  border-radius: 8px;
997
1022
  }
998
1023
 
@@ -1059,6 +1084,13 @@
1059
1084
  text-decoration: underline;
1060
1085
  }
1061
1086
 
1087
+ .lb-mix-match__slot--filled a.lb-mix-match__filled-title:focus-visible {
1088
+ outline: 2px solid var(--lb-primary-color);
1089
+ outline-offset: 2px;
1090
+ box-shadow: none;
1091
+ border-radius: 2px;
1092
+ }
1093
+
1062
1094
  /* .lb-mix-match__filled-variant \u2014 styled jointly with
1063
1095
  .lb-bundle-variant-badge above to keep the variant text consistent
1064
1096
  across mix-match and fixed bundle widgets. */
@@ -1104,18 +1136,8 @@
1104
1136
 
1105
1137
  .lb-mix-match__slot-remove:focus-visible {
1106
1138
  outline: 2px solid var(--lb-primary-color);
1107
- outline-offset: 2px;
1108
- }
1109
-
1110
- /* Price placeholder */
1111
- .lb-mix-match__price-placeholder {
1112
- padding: 4px 0 16px;
1113
- text-align: center;
1114
- }
1115
-
1116
- .lb-mix-match__price-placeholder-text {
1117
- font-size: 16px;
1118
- color: var(--lb-text);
1139
+ outline-offset: -2px;
1140
+ box-shadow: none;
1119
1141
  }
1120
1142
 
1121
1143
  /* === Modal Overlay === */
@@ -1146,7 +1168,7 @@
1146
1168
  border: var(--lb-picker-border-width) solid var(--lb-picker-border-color);
1147
1169
  box-sizing: border-box;
1148
1170
  width: 100%;
1149
- max-width: 480px;
1171
+ max-width: 520px;
1150
1172
  max-height: 70vh;
1151
1173
  display: flex;
1152
1174
  flex-direction: column;
@@ -1195,7 +1217,8 @@
1195
1217
 
1196
1218
  .lb-mix-match__modal-close:focus-visible {
1197
1219
  outline: 2px solid var(--lb-primary-color);
1198
- outline-offset: 2px;
1220
+ outline-offset: 0;
1221
+ box-shadow: none;
1199
1222
  }
1200
1223
 
1201
1224
  /* === Modal Search === */
@@ -1223,9 +1246,10 @@
1223
1246
  color: color-mix(in srgb, var(--lb-picker-text) 50%, transparent);
1224
1247
  }
1225
1248
 
1226
- .lb-mix-match__modal-search-input:focus {
1227
- outline: none;
1228
- box-shadow: 0 0 0 1px var(--lb-primary-color);
1249
+ .lb-mix-match__modal-search-input:focus-visible {
1250
+ outline: 2px solid var(--lb-primary-color);
1251
+ outline-offset: 2px;
1252
+ box-shadow: none;
1229
1253
  }
1230
1254
 
1231
1255
  .lb-mix-match__modal-search-clear {
@@ -1256,10 +1280,12 @@
1256
1280
  }
1257
1281
 
1258
1282
  .lb-mix-match__modal-product {
1259
- display: flex;
1260
- align-items: center;
1261
- gap: 20px;
1262
- padding: 12px 0;
1283
+ display: grid;
1284
+ grid-template-columns: auto 1fr;
1285
+ align-items: start;
1286
+ column-gap: 20px;
1287
+ padding-top: 20px;
1288
+ padding-bottom: 16px;
1263
1289
  border-bottom: 1px solid color-mix(in srgb, var(--lb-picker-text) 7%, transparent);
1264
1290
  }
1265
1291
 
@@ -1356,6 +1382,7 @@
1356
1382
  .lb-mix-match__variant-select:focus-visible {
1357
1383
  outline: 2px solid var(--lb-primary-color);
1358
1384
  outline-offset: 2px;
1385
+ box-shadow: none;
1359
1386
  }
1360
1387
 
1361
1388
  /* Per-pick quantity stepper inside the picker modal product row.
@@ -1372,10 +1399,11 @@
1372
1399
  group from the unit-price / low-stock-badge above; the stepper itself
1373
1400
  has no top margin so the group can be repositioned without coupling. */
1374
1401
  .lb-mix-match__qty-stepper-group {
1375
- margin-top: 8px;
1376
- /* Group is a flex column; without an explicit width it stretches to
1377
- fill the info column so the \u2212/value/+ cells get pulled apart. Pin
1378
- to fit-content so the wrapper hugs the stepper's natural width. */
1402
+ /* Override the base .lb-bundle-variant-option-group column flex so the
1403
+ stepper child stretches on the cross-axis (vertical) \u2014 this is what
1404
+ lets the group track the Add button's height in the action row
1405
+ without pinning a fixed pixel value. */
1406
+ flex-direction: row;
1379
1407
  width: fit-content;
1380
1408
  }
1381
1409
 
@@ -1383,7 +1411,6 @@
1383
1411
  display: inline-flex;
1384
1412
  align-items: stretch;
1385
1413
  flex-shrink: 0;
1386
- height: 32px;
1387
1414
  border: var(--lb-picker-qty-stepper-border-width) solid var(--lb-picker-qty-stepper-border-color);
1388
1415
  border-radius: var(--lb-picker-qty-stepper-radius);
1389
1416
  background-color: var(--lb-picker-bg);
@@ -1410,13 +1437,10 @@
1410
1437
  justify-content: center;
1411
1438
  }
1412
1439
 
1413
- .lb-mix-match__qty-stepper-button:hover:not(:disabled) {
1414
- background: color-mix(in srgb, var(--lb-picker-text) 6%, transparent);
1415
- }
1416
-
1417
1440
  .lb-mix-match__qty-stepper-button:focus-visible {
1418
1441
  outline: 2px solid var(--lb-primary-color);
1419
1442
  outline-offset: -2px;
1443
+ box-shadow: none;
1420
1444
  }
1421
1445
 
1422
1446
  .lb-mix-match__qty-stepper-button:disabled {
@@ -1437,8 +1461,24 @@
1437
1461
  box-sizing: border-box;
1438
1462
  }
1439
1463
 
1464
+ /* Action row \u2014 qty stepper (left) + Add button (right). Sits at the
1465
+ bottom of the info column with a 12px top margin so it visually
1466
+ separates from the variant pickers / price block above. When the
1467
+ stepper is hidden, Add fills the row via flex: 1 below.
1468
+ align-items: stretch so the stepper-group tracks the Add button's
1469
+ height (driven by font size + button padding) without a pinned px. */
1470
+ .lb-mix-match__modal-product-actions {
1471
+ display: flex;
1472
+ flex-wrap: wrap;
1473
+ align-items: stretch;
1474
+ row-gap: 12px;
1475
+ column-gap: 8px;
1476
+ margin-top: 12px;
1477
+ }
1478
+
1440
1479
  .lb-mix-match__modal-add {
1441
- padding: 8px 20px;
1480
+ flex: 1;
1481
+ padding: 10px 20px;
1442
1482
  background: var(--lb-picker-add-bg);
1443
1483
  color: var(--lb-picker-add-label);
1444
1484
  border: var(--lb-picker-add-border-width) solid var(--lb-picker-add-border-color);
@@ -1447,8 +1487,6 @@
1447
1487
  font-size: 12px;
1448
1488
  font-weight: 600;
1449
1489
  cursor: pointer;
1450
- white-space: nowrap;
1451
- flex-shrink: 0;
1452
1490
  }
1453
1491
 
1454
1492
  .lb-mix-match__modal-add:hover {
@@ -1458,6 +1496,7 @@
1458
1496
  .lb-mix-match__modal-add:focus-visible {
1459
1497
  outline: 2px solid var(--lb-primary-color);
1460
1498
  outline-offset: 2px;
1499
+ box-shadow: none;
1461
1500
  }
1462
1501
 
1463
1502
  .lb-mix-match__modal-add:disabled {
@@ -1471,6 +1510,14 @@
1471
1510
  opacity: 0.5;
1472
1511
  }
1473
1512
 
1513
+ /* Already in a slot \u2014 prevents shoppers from filling multiple slots
1514
+ with the same product (which wouldn't qualify the discount: it
1515
+ counts distinct products, not slot occupancy). The thumb keeps
1516
+ its qty badge so the shopper sees what's already in the bundle. */
1517
+ .lb-mix-match__modal-product--in-bundle {
1518
+ opacity: 0.5;
1519
+ }
1520
+
1474
1521
  .lb-mix-match__modal-product--sold-out .lb-mix-match__modal-sold-out-label {
1475
1522
  font-size: 12px;
1476
1523
  color: inherit;
@@ -1526,7 +1573,7 @@
1526
1573
  transition: none;
1527
1574
  }
1528
1575
  }
1529
- `,Ft=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
1576
+ `,Ot=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
1530
1577
 
1531
1578
  .lb-volume__tiers {
1532
1579
  display: flex;
@@ -1566,12 +1613,14 @@
1566
1613
  border-color: var(--lb-tier-selected-border-color);
1567
1614
  }
1568
1615
 
1569
- /* Suppress the UA default focus outline so a freshly-clicked selected
1570
- tier doesn't briefly show the 1px focus ring on top of (or in place of)
1571
- the custom selected-state outline below. Keyboard focus is still
1572
- indicated by the :focus-visible rule. */
1616
+ /* Suppress the UA default focus outline + Dawn's focus shadow so a
1617
+ freshly-clicked selected tier doesn't briefly show the 1px focus ring
1618
+ or shadow on top of (or in place of) the custom selected-state
1619
+ outline below. Keyboard focus is still indicated by the
1620
+ :focus-visible rule. */
1573
1621
  .lb-volume__tier:focus {
1574
1622
  outline: none;
1623
+ box-shadow: none;
1575
1624
  }
1576
1625
 
1577
1626
  /* Keyboard focus indicator \u2014 explicitly excludes the selected tier so
@@ -1579,7 +1628,8 @@
1579
1628
  outline property when both states apply at once. */
1580
1629
  .lb-volume__tier:focus-visible:not([aria-checked="true"]) {
1581
1630
  outline: 2px solid var(--lb-primary-color);
1582
- outline-offset: 2px;
1631
+ outline-offset: -2px;
1632
+ box-shadow: none;
1583
1633
  }
1584
1634
 
1585
1635
  .lb-volume__tier[aria-checked="true"] {
@@ -1663,7 +1713,7 @@
1663
1713
  }
1664
1714
 
1665
1715
 
1666
- `,Vt=`/**
1716
+ `,Nt=`/**
1667
1717
  * Lime Bundles \u2014 Custom variant-picker dropdown styling.
1668
1718
  *
1669
1719
  * Reuses existing CSS variables: no new merchant-configurable surface.
@@ -1726,6 +1776,7 @@
1726
1776
  .lb-dropdown-trigger:focus-visible {
1727
1777
  outline: 2px solid var(--lb-primary-color);
1728
1778
  outline-offset: 2px;
1779
+ box-shadow: none;
1729
1780
  }
1730
1781
 
1731
1782
  .lb-dropdown-trigger[aria-expanded="true"] {
@@ -1915,7 +1966,7 @@
1915
1966
  [data-modal-overlay] > .lb-dropdown-listbox::-webkit-scrollbar-thumb {
1916
1967
  background: color-mix(in srgb, var(--lb-picker-text) 15%, transparent);
1917
1968
  }
1918
- `,qt=`/* 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) */
1919
1970
 
1920
1971
  .lb-bundle-widget--loading {
1921
1972
  display: block;
@@ -2011,10 +2062,10 @@
2011
2062
  animation: none;
2012
2063
  }
2013
2064
  }
2014
- `;var Rn=e=>`lb_cart_id:${e}`;function Dn(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 me=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","app-url","analytics","locale"];shadow;bundles=[];abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.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"}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=Me({shopDomain:this.shopDomain,accessToken:this.storefrontToken});try{let o,n=!1;if(this.bundleGid)n=!0,o=this.fetchSingleBundle(r,t.signal);else{let l=Dn(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(nt,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){ft(this.shopDomain,i.shop.metafield.value);let l=Re(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 gt(r.abTestId,r.id))?.variant==="B")return ct(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(rt,{id:this.bundleGid},{signal:r});if(!o.metaobject){this.bundles=[];return}let n=Ie(o.metaobject.id,o.metaobject.fields);this.bundles=n?[n]:[]}async fetchProductBundles(t,r,o){let n=await t.query(ot,{handle:o},{signal:r});if(!n.product){this.bundles=[];return}let a=n.product.metafield?.references?.nodes??[],i=[];for(let l of a){let d=Ie(l.id,l.fields);d&&i.push(d)}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=Me({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),o=window.localStorage,n=Rn(this.shopDomain),a=o?.getItem(n)??null;try{let i=null;if(a){let d=(await r.query(at,{cartId:a,lines:t})).cartLinesAdd;d?.userErrors?.length?o?.removeItem(n):d?.cart&&(i=d.cart.checkoutUrl)}if(!i){let d=(await r.query(it,{input:{lines:t}})).cartCreate;d?.cart&&(o?.setItem(n,d.cart.id),i=d.cart.checkoutUrl)}i?window.location.assign(i):this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:"Cart creation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}catch(i){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:i instanceof Error?i.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}reportAddToCartEvent(t,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=r.reduce((a,i)=>a+i.quantity,0),n=r.reduce((a,i)=>{let d=t.products.find(p=>p.variants.nodes.some(c=>c.id===i.merchandiseId))?.variants.nodes.find(p=>p.id===i.merchandiseId),u=d?parseFloat(d.price.amount):0;return a+u*i.quantity},0);pt({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=[He,Rt,Dt,Ft,Vt].join(`
2015
- `),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),dt(n,o.widgetConfig),this.renderCleanups.push(Se(n));let a=l=>this.handleAddToCart(o,l),i=l=>this.renderCleanups.push(l);switch(o.bundleType){case"fixed":yt(n,o,a,i);break;case"mix_match":Bt(n,o,a,i);break;case"volume":Et(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=bt(r,()=>{ut({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(o)}renderLoading(){this.shadow.innerHTML=`
2016
- <style>${He}</style>
2017
- <style>${qt}</style>
2065
+ `;var Dn=e=>`lb_cart_id:${e}`;function Fn(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"];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"}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});try{let o,n=!1;if(this.bundleGid)n=!0,o=this.fetchSingleBundle(r,t.signal);else{let l=Fn(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(at,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){wt(this.shopDomain,i.shop.metafield.value);let l=Ve(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 xt(r.abTestId,r.id))?.variant==="B")return bt(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(it,{id:this.bundleGid},{signal:r});if(!o.metaobject){this.bundles=[];return}let n=Fe(o.metaobject.id,o.metaobject.fields);this.bundles=n?[n]:[]}async fetchProductBundles(t,r,o){let n=await t.query(lt,{handle:o},{signal:r});if(!n.product){this.bundles=[];return}let a=n.product.metafield?.references?.nodes??[],i=[];for(let l of a){let d=Fe(l.id,l.fields);d&&i.push(d)}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=Dn(this.shopDomain),a=o?.getItem(n)??null;try{let i=null;if(a){let d=(await r.query(st,{cartId:a,lines:t})).cartLinesAdd;d?.userErrors?.length?o?.removeItem(n):d?.cart&&(i=d.cart.checkoutUrl)}if(!i){let d=(await r.query(dt,{input:{lines:t}})).cartCreate;d?.cart&&(o?.setItem(n,d.cart.id),i=d.cart.checkoutUrl)}i?window.location.assign(i):this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:"Cart creation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}catch(i){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:i instanceof Error?i.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}reportAddToCartEvent(t,r){if(!this.analyticsEnabled||!this.appUrl)return;let o=r.reduce((a,i)=>a+i.quantity,0),n=r.reduce((a,i)=>{let d=t.products.find(p=>p.variants.nodes.some(u=>u.id===i.merchandiseId))?.variants.nodes.find(p=>p.id===i.merchandiseId),c=d?parseFloat(d.price.amount):0;return a+c*i.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,qt,Ot,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),ut(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":_t(n,o,a,i);break;case"mix_match":Et(n,o,a,i);break;case"volume":Mt(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=gt(r,()=>{ht({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(o)}renderLoading(){this.shadow.innerHTML=`
2067
+ <style>${We}</style>
2068
+ <style>${Ht}</style>
2018
2069
  <div class="lb-bundle-widget lb-bundle-widget--loading" aria-busy="true" aria-label="Loading bundle">
2019
2070
  <div class="lb-skeleton lb-skeleton--title"></div>
2020
2071
  <div class="lb-skeleton--products">
@@ -2048,5 +2099,5 @@
2048
2099
  <div class="lb-skeleton lb-skeleton--cta"></div>
2049
2100
  </div>
2050
2101
  </div>
2051
- `}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",me);return Gt(Fn);})();
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(Vn);})();
2052
2103
  //# sourceMappingURL=lime-bundle.global.js.map