@lime-bundles/widget 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +235 -86
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +217 -62
- package/dist/lime-bundle.global.js +34 -20
- package/dist/lime-bundle.global.js.map +1 -1
- package/docs/css-variables.md +7 -1
- package/docs/hydrogen.md +29 -4
- package/docs/react-nextjs.md +24 -4
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var LimeBundles=(()=>{var
|
|
1
|
+
"use strict";var LimeBundles=(()=>{var mt=Object.defineProperty;var wr=Object.getOwnPropertyDescriptor;var _r=Object.getOwnPropertyNames;var Cr=Object.prototype.hasOwnProperty;var kr=(e,t)=>{for(var n in t)mt(e,n,{get:t[n],enumerable:!0})},Sr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _r(t))!Cr.call(e,o)&&o!==n&&mt(e,o,{get:()=>t[o],enumerable:!(r=wr(t,o))||r.enumerable});return e};var Tr=e=>Sr(mt({},"__esModule",{value:!0}),e);var Go={};kr(Go,{LimeBundleElement:()=>Re,trackInputMode:()=>pt});var Er=Object.defineProperty,jt=(e,t)=>{for(var n in t)Er(e,n,{get:t[n],enumerable:!0})},qt=class extends Error{constructor(e){super(e.map(t=>t.message).join("; ")),this.errors=e,this.name="StorefrontApiError"}},Ir="2025-10";async function Mr(e){if(e)return typeof e=="function"?await e():e}function $t(e){return!!(e.country||e.language||e.buyer)}function ft(e){let t=e.apiVersion??Ir,n=`https://${e.shopDomain}/api/${t}/graphql.json`;return{async query(r,o,i){let a={"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e.accessToken};e.buyerIp&&(a["Shopify-Storefront-Buyer-IP"]=e.buyerIp);let l=await Mr(e.buyer),d={...o??{}};e.country&&(d.country=e.country),e.language&&(d.language=e.language),l&&(d.buyer=l);let s=await fetch(n,{method:"POST",headers:a,body:JSON.stringify({query:r,variables:d}),signal:i?.signal});if(!s.ok)throw new qt([{message:`Storefront API error: ${s.status} ${s.statusText}`}]);let c=await s.json();if(c.errors?.length)throw new qt(c.errors);return c.data}}}function Gt(e){return e.replace(/query\s+(\w+)\s*(?:\(([^)]*)\))?\s*\{/,(t,n,r)=>{let o=(r||"").trim(),i="$country: CountryCode, $language: LanguageCode, $buyer: BuyerInput",a=o?`${o}, ${i}`:i;return`query ${n}(${a}) @inContext(country: $country, language: $language, buyer: $buyer) {`})}var Kt=`#graphql
|
|
2
2
|
query BundleMetaobject($id: ID!) {
|
|
3
3
|
metaobject(id: $id) {
|
|
4
4
|
id
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`,Yt=`#graphql
|
|
104
104
|
query ShopSettings {
|
|
105
105
|
shop {
|
|
106
106
|
customCss: metafield(namespace: "$app", key: "custom_css") {
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
`,
|
|
114
|
+
`,Jt=`#graphql
|
|
115
115
|
query BundlesForProduct($handle: String!) {
|
|
116
116
|
product(handle: $handle) {
|
|
117
117
|
id
|
|
@@ -224,21 +224,21 @@
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
227
|
+
`,Xt=`#graphql
|
|
228
228
|
mutation CartCreate($input: CartInput!) {
|
|
229
229
|
cartCreate(input: $input) {
|
|
230
230
|
cart { id checkoutUrl }
|
|
231
231
|
userErrors { field message }
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
`,
|
|
234
|
+
`,Zt=`#graphql
|
|
235
235
|
mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
|
|
236
236
|
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
237
237
|
cart { id checkoutUrl }
|
|
238
238
|
userErrors { field message }
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
`;var ut="show_greyed_out";function $t(e){return e==="hide"?"hide":ut}var oe=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},It={none:0,subtle:6,rounded:12,round:18},re={header:{countdownBgColor:"#B4DC7F47",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:"subtle"},productList:{textColor:"#555555",thumbnailRatio:"square",showPrice:!0,showCompareAtPrice:!0},pricing:{showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#B4DC7F",buttonTextColor:"#555555",borderWidth:0,borderColor:"#B4DC7F"},savingsBar:{visible:!0},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A"},showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowTypeFilters:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:1,pickerBorderColor:"#E5E5E5",pickerBorderRadius:"subtle",pickerThumbnailRatio:"square",pickerAddBgColor:"#B4DC7F",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#B4DC7F",defaultTier:"first"};function fr(e){if(!e||typeof e!="object")return re;let t=e;return{...re,...t,defaultTier:gr(t.defaultTier),pickerBorderRadius:Mt(t.pickerBorderRadius),header:{...re.header,...t.header??{}},layout:{...re.layout,...t.layout??{},borderRadius:Mt(t.layout?.borderRadius)},productList:{...re.productList,...t.productList??{}},pricing:{...re.pricing,...t.pricing??{}},cta:{...re.cta,...t.cta??{}},savingsBar:{...re.savingsBar,...t.savingsBar??{}},countdown:{...re.countdown,...t.countdown??{}},popularBadge:{...re.popularBadge,...t.popularBadge??{}}}}function gr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:re.defaultTier}function Mt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:re.layout.borderRadius}function xr(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,borderRadius:It[e.layout.borderRadius],countdownBgColor:e.header.countdownBgColor,countdownTextColor:e.header.countdownTextColor,thumbnailRatio:e.productList.thumbnailRatio,showProductPrice:e.productList.showPrice,showProductCompareAtPrice:e.productList.showCompareAtPrice,showCountdown:e.countdown.showCountdown,ctaText:e.cta.ctaText,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,showSearch:e.showSearch,mixMatchShowTypeFilters:e.mixMatchShowTypeFilters,pickerBgColor:e.pickerBgColor,pickerTextColor:e.pickerTextColor,pickerBorderWidth:e.pickerBorderWidth,pickerBorderColor:e.pickerBorderColor,pickerBorderRadius:It[e.pickerBorderRadius],pickerThumbnailRatio:e.pickerThumbnailRatio,pickerAddBgColor:e.pickerAddBgColor,pickerAddLabelColor:e.pickerAddLabelColor,pickerAddBorderWidth:e.pickerAddBorderWidth,pickerAddBorderColor:e.pickerAddBorderColor,defaultTier:e.defaultTier,...e.popularBadge.tierIndex!==void 0&&{mostPopularTierIndex:e.popularBadge.tierIndex}}}var vr={primaryColor:"--lb-primary-color",backgroundColor:"--lb-bg",textColor:"--lb-text",borderColor:"--lb-border",borderWidth:"--lb-border-width",buttonTextColor:"--lb-btn-text",borderRadius:"--lb-radius",countdownBgColor:"--lb-countdown-bg",countdownTextColor:"--lb-countdown-text",ctaBorderWidth:"--lb-cta-border-width",ctaBorderColor:"--lb-cta-border-color",popularBadgeBgColor:"--lb-popular-badge-bg",popularBadgeTextColor:"--lb-popular-badge-text",popularBadgeBorderWidth:"--lb-popular-badge-border-width",popularBadgeBorderColor:"--lb-popular-badge-border-color",pickerBgColor:"--lb-picker-bg",pickerTextColor:"--lb-picker-text",pickerBorderWidth:"--lb-picker-border-width",pickerBorderColor:"--lb-picker-border-color",pickerBorderRadius:"--lb-picker-radius",pickerAddBgColor:"--lb-picker-add-bg",pickerAddLabelColor:"--lb-picker-add-label",pickerAddBorderWidth:"--lb-picker-add-border-width",pickerAddBorderColor:"--lb-picker-add-border-color"},yr=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function Gt(e,t){let n=xr(t);for(let[i,a]of Object.entries(vr)){let l=n[i];if(l==null)continue;let d=yr.has(i)?`${l}px`:String(l);e.style.setProperty(a,d)}e.style.setProperty("--lb-product-price-display",t.productList.showPrice?"block":"none"),e.style.setProperty("--lb-product-compare-display",t.productList.showCompareAtPrice?"inline":"none"),e.style.setProperty("--lb-variant-chevron",Lt(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",Lt(t.pickerBorderColor));let r=Pt(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",r.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",r.imgFit),e.style.setProperty("--lb-thumbnail-img-height",r.imgHeight);let o=Pt(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",o.imgHeight)}function Lt(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 Pt(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 wr=new Set(["fixed","mix_match","volume","bogo","multi_step"]),_r=new Set(["active"]);function pt(e,t){try{return Cr(e,t)}catch(n){if(n instanceof oe)return null;throw n}}function Cr(e,t){let n=new Map(t.map(k=>[k.key,k])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!wr.has(o))throw new oe(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!_r.has(i))throw new oe(`Bundle is not active: status=${i??"null"}`,"inactive");let l=i,d=n.get("starts_at")?.value??null,s=n.get("ends_at")?.value??null,c=new Date;if(d){let k=new Date(d);if(Number.isNaN(k.getTime()))throw new oe(`Invalid starts_at: ${d}`,"invalid_type");if(k>c)throw new oe(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let k=new Date(s);if(Number.isNaN(k.getTime()))throw new oe(`Invalid ends_at: ${s}`,"invalid_type");if(k<c)throw new oe(`Bundle has expired: ends_at=${s}`,"expired")}let u=Er(n),m=Ar(n),f=Ir(n),h={id:e,title:r,description:n.get("description")?.value||null,status:l,products:u,discountConfig:m,widgetConfig:f,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:Mr(n),productQuantities:Bt(n,"product_quantities"),variantQuantities:Bt(n,"variant_quantities"),marketVisibility:Lr(n),marketIds:Pr(n)};switch(a){case"fixed":return{...h,bundleType:"fixed"};case"volume":return{...h,bundleType:"volume",volumeTiers:Br(n)};case"mix_match":return{...h,bundleType:"mix_match",minQuantity:Nr(n,"min_quantity",{min:1}),maxQuantity:null,productRules:qt(n)};case"bogo":return{...h,bundleType:"bogo",...Tr(n)};case"multi_step":return{...h,bundleType:"multi_step",steps:kr(n),productRules:qt(n),collectionProductIds:Sr(n)}}}function kr(e){let t=fe(e,"steps");if(!Array.isArray(t))throw new oe("Invalid or missing steps","invalid_type");let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string"):[],r=[];for(let o of t){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o;if(typeof i.name!="string")continue;let a=typeof i.minQuantity=="number"?i.minQuantity:Number(i.minQuantity),l=Number.isFinite(a)&&a>=1?Math.floor(a):1,d=null;typeof i.maxQuantity=="number"&&Number.isFinite(i.maxQuantity)&&(d=Math.max(l,Math.floor(i.maxQuantity))),r.push({name:i.name,minQuantity:l,maxQuantity:d,productIds:n(i.productIds),collectionIds:n(i.collectionIds)})}if(r.length===0)throw new oe("multi_step bundle has no valid steps","invalid_type");return r}function Sr(e){let t={},n=e.get("collection");if(!n?.references?.nodes)return t;for(let r of n.references.nodes)!("products"in r)||!r.products?.nodes||(t[r.id]=r.products.nodes.map(o=>o.id));return t}function Tr(e){let t=fe(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new oe("Invalid or missing bogo_config","invalid_type");let n=t,r=typeof n.buyProductId=="string"?n.buyProductId:"",o=typeof n.getProductId=="string"?n.getProductId:"";if(!r||!o)throw new oe("bogo_config is missing buy/get product ids","invalid_type");let i=a=>{let l=typeof a=="number"?a:Number(a);return!Number.isFinite(l)||l<1?1:Math.min(99,Math.floor(l))};return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity)}}function Er(e){let t=[],n=e.get("products");if(n?.reference&&"variants"in n.reference&&t.push(n.reference),n?.references?.nodes)for(let o of n.references.nodes)"variants"in o?t.push(o):"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);let r=e.get("collection");if(r?.references?.nodes)for(let o of r.references.nodes)"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);return t}function Ar(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 Ir(e){return fr(fe(e,"widget_config"))}function Mr(e){let t=fe(e,"selected_variant_ids");if(!Array.isArray(t))return null;let n=[];for(let r of t)Array.isArray(r)?n.push(r.filter(o=>typeof o=="string")):n.push([]);return n}function Bt(e,t){let n=fe(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){let a=typeof i=="number"?i:Number(i);Number.isFinite(a)&&a>=0&&a<=99&&(r[o]=Math.floor(a))}return r}function qt(e){let t=fe(e,"product_rules");if(!t||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(!o||typeof o!="object"||Array.isArray(o))continue;let{min:i,max:a,required:l}=o,d=typeof i=="number"?i:Number(i),s=typeof a=="number"?a:Number(a);if(!Number.isFinite(d)||!Number.isFinite(s))continue;let c=Math.max(1,Math.min(99,Math.floor(d))),u=Math.max(c,Math.min(99,Math.floor(s)));n[r]=l===!0?{min:c,max:u,required:!0}:{min:c,max:u}}return n}function Lr(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function Pr(e){let t=e.get("markets")?.value;if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}function Br(e){let t=fe(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(qr):[]}function qr(e){let t=Number(e.minQuantity??0),n={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(n.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(n.amount=e.amount),n}function fe(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Nr(e,t,n={}){let r=e.get(t)?.value;if(!r)return null;let o=parseInt(r,10);return isNaN(o)||n.min!==void 0&&o<n.min?null:o}function Nt(e){return e.split("/").pop()??e}function Kt(e,t){if(e.marketVisibility!=="specific")return!0;if(!t)return!1;let n=Nt(t);return e.marketIds.some(r=>Nt(r)===n)}function mt(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function Yt(e,t){let n=e.steps[t];if(!n)return[];let r=new Set(n.productIds),o=new Set;for(let l of n.collectionIds)for(let d of e.collectionProductIds[l]??[])o.add(d);let i=new Set,a=[];for(let l of e.products)i.has(l.id)||!r.has(l.id)&&!o.has(l.id)||(i.add(l.id),a.push(l));return a}async function Jt(e,t){await en(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function Xt(e,t){await en(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function Zt(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let n=new IntersectionObserver(r=>{for(let o of r)o.isIntersecting&&(t(),n.unobserve(o.target))},{threshold:.5});return n.observe(e),()=>n.disconnect()}async function en(e,t){let n=`${e.appUrl}/api/analytics`,r=JSON.stringify(t);try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r})).ok||(await new Promise(i=>setTimeout(i,2e3)),await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(n,r)}catch{}}}var Rt=1e4,Rr=[[/@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"]],Or=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function bt(e){if(e.length>Rt)return{ok:!1,error:`CSS exceeds ${Rt.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,(o,i)=>{let a=parseInt(i,16);return a<0||a>1114111?"\uFFFD":String.fromCodePoint(a)}),t=t.replace(/\\\r?\n/g,""),t=t.replace(/\\([^\n\r\f0-9a-fA-F])/g,"$1")}catch{return{ok:!1,error:"CSS contains invalid unicode escape sequences"}}t=t.replace(/</g,"").replace(/>/g,"");for(let[o,i]of Rr)if(o.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${i}`};let n=/url\s*\(\s*([\s\S]*?)\s*\)/gi,r;for(;(r=n.exec(t))!==null;){let o=r[1].trim();if((o.startsWith("'")||o.startsWith('"'))&&(o=o.slice(1)),(o.endsWith("'")||o.endsWith('"'))&&(o=o.slice(0,-1)),o=o.trim(),o&&!Or.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Hr="lb-custom-css-";function tn(e,t){if(typeof document>"u"||!t)return!1;let n=bt(t);if(!n.ok||!n.css.trim())return!1;let r=Hr+Dr(e),o=document.getElementById(r);return o||(o=document.createElement("style"),o.id=r,o.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(o)),o.textContent!==n.css&&(o.textContent=n.css),!0}function Dr(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function Fr(e,t){let n=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(n)}catch{return`${t} ${n.toFixed(2)}`}}function Re(e,t,n){return t==="percentage"?Math.max(0,e*(1-n/100)):Math.max(0,e-n)}var Vr={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 nn(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=Vr[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=Fr(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}var ge={};Dt(ge,{computePosition:()=>zr,emptyTypeAheadState:()=>Gr,firstEnabled:()=>Ne,handleKey:()=>jr,pushTypeAheadChar:()=>Kr});var Ur=4;function zr({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=Ur,clip:o}){let i=o?Math.min(t,o.bottom):t,a=o?Math.max(0,o.top):0,l=Math.max(0,i-e.bottom-r),d=Math.max(0,e.top-a-r),s=n<=l?"down":d>l?"up":"down",u=Math.min(n,s==="down"?l:d),m=s==="down"?e.bottom+r:e.top-r-u;return{placement:s,maxHeight:u,offsetTop:m,offsetLeft:e.left,width:e.width}}var dt={type:"passthrough",preventDefault:!1};function Ne(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Ot(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Qr(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r].disabled)return r}return t}function Wr(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r].disabled)return r}return t}function Ht(e){return e.length===1&&e!==" "&&/\S/.test(e)}function jr(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return dt;let{key:n}=e,{isOpen:r,activeIndex:o,selectedIndex:i,options:a}=t;if(!r)switch(n){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Ne(a),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Ot(a),preventDefault:!0};default:return Ht(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Ne(a),preventDefault:!0}:dt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:Qr(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:Wr(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:Ne(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:Ot(a),preventDefault:!0};case"Enter":case" ":return o>=0&&!a[o]?.disabled?{type:"commit",index:o,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 Ht(n)?{type:"type-ahead",char:n,preventDefault:!1}:dt}}var $r=500;function Gr(){return{buffer:"",lastTime:0}}function Kr(e,t,n,r,o=$r){if(t.length!==1)return{newState:e,matchedIndex:null};let a=(n-e.lastTime>o?"":e.buffer)+t.toLowerCase(),l={buffer:a,lastTime:n};for(let d=0;d<r.length;d++){let s=r[d];if(!s.disabled&&s.label.toLowerCase().startsWith(a))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var Yr={};Dt(Yr,{findVariantByOptions:()=>Jr,isOptionValueAvailable:()=>Xr,toPickerVariant:()=>Zr});function Jr(e,t){if(e.length===0)return null;for(let n of e){if(n.optionValues.length!==t.length)continue;let r=!0;for(let o=0;o<n.optionValues.length;o++)if(n.optionValues[o]!==t[o]){r=!1;break}if(r)return n}return null}function Xr(e,t,n,r){for(let o of e){if(!o.available||o.optionValues[t]!==n)continue;let i=!0;for(let a=0;a<o.optionValues.length;a++)if(a!==t&&o.optionValues[a]!==r[a]){i=!1;break}if(i)return!0}return!1}function Zr(e){return{id:e.id,optionValues:e.selectedOptions.map(t=>t.value),available:e.availableForSale}}function rn(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null?!0:e.quantityAvailable>=t:!1}function on(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function Oe(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function eo(e,t,n){return{id:on(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:rn(e,t),price:Oe(e.price?.amount),compareAtPrice:Oe(e.compareAtPrice?.amount),unitPrice:nn(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null}}function ye(e,t,n){let r=n.allowedVariantIds,o=e.variants.nodes.filter(s=>!r||r.length===0||r.includes(s.id)),i=e.priceRange.minVariantPrice.currencyCode,a=mt(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let c=mt(n.quantities,e.id,s.id),u=eo(s,c,i);return c!==a&&(u.quantity=c),u}),d=l.find(s=>s.available)??l[0];return{productId:on(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function He(e){return e.products.map((t,n)=>ye(t,e.id,{quantities:{productQuantities:e.productQuantities,variantQuantities:e.variantQuantities},allowedVariantIds:e.selectedVariantIds?.[n]??null}))}function G(e,t){for(let n=0;n<e.variants.length;n++)if(String(e.variants[n].id)===String(t))return e.variants[n];return e.variants[0]}function an(e,t){if(!e.variants||!t)return null;for(let n=0;n<e.variants.length;n++){let r=e.variants[n];if(!r.options||r.options.length!==t.length)continue;let o=!0;for(let i=0;i<r.options.length;i++)if(r.options[i]!==t[i]){o=!1;break}if(o)return r}return null}function ln(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o];if(i.available===!1||!i.options||i.options[t]!==n)continue;let a=!0;for(let l=0;l<i.options.length;l++)if(l!==t&&i.options[l]!==r[l]){a=!1;break}if(a)return!0}return!1}function sn(e){let t=[];for(let n=0;n<e.length;n++){let r=G(e[n],e[n].selectedVariantId),o=r.quantity||e[n].quantity||1;t.push({variantId:Number(e[n].selectedVariantId),quantity:o,priceCents:(r.price||0)*o})}return t}function to(e,t,n){let r=0,o=0;for(let i=0;i<e.length;i++){let a=G(e[i],e[i].selectedVariantId),l=a.quantity||e[i].quantity||1,d=a.price*l;if(r+=d,t==="percentage"){let s=Math.floor(a.price*n/100);o+=(a.price-s)*l}else o+=d}if(t==="fixed_amount"&&(o=Math.max(0,r-Math.round(n*100))),t==="flat_price"){let i=Math.round(n*100);o=i<r?i:r}return{totalPrice:r,salePrice:o,savings:r-o}}function ht(e,t,n){let r=e.classList?.contains("lb-fixed")?e:e.querySelector(".lb-fixed");if(!r)return;let{totalPrice:o,salePrice:i,savings:a}=to(t,r.getAttribute("data-discount-type")||"",parseFloat(r.getAttribute("data-discount-value")??"")||0),l=e.querySelector("[data-sale-price]"),d=e.querySelector("[data-compare-price]"),s=e.querySelector("[data-savings-bar]"),c=e.querySelector("[data-savings-amount]"),u=e.querySelector("[data-savings-percent]");if(l&&(l.textContent=n(i)),d&&(a>0?(d.textContent=n(o),d.style.display=""):d.style.display="none"),s)if(a>0){if(c&&(c.textContent=n(a)),u){let m=o>0?Math.round(a*100/o):0;u.textContent="("+m+"%)"}s.style.display=""}else s.style.display="none"}function ie(e){return t=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(t/100)}catch{return e+" "+(t/100).toFixed(2)}}}var no="_lime_bundle_gid",ro="_lime_bundle_type";function ae(e,t){return[{key:no,value:e},{key:ro,value:t}]}function De(e,t,n){let r=e.querySelectorAll("[data-variant-option]");if(!r.length)return;function o(s){return parseInt(s.getAttribute("data-option-position")??"",10)}function i(){let s=[];for(let c=0;c<r.length;c++){let u=o(r[c]);!u||u<1||(s[u-1]=r[c].value)}return s}function a(s){if(!(!s||!s.options))for(let c=0;c<r.length;c++){let u=o(r[c]);if(!u||u<1)continue;let m=s.options[u-1];r[c].value!==m&&(r[c].value=m)}}function l(s,c){for(let u=0;u<r.length;u++){let m=r[u],f=o(m);if(!f||f<1)continue;let h=m.options;for(let k=0;k<h.length;k++)h[k].disabled=!ln(s.variants,f-1,h[k].value,c)}}let d=t();if(d){let s=G(d,d.selectedVariantId);s&&s.options&&l(d,s.options)}for(let s=0;s<r.length;s++)r[s].addEventListener("change",c=>{c.stopPropagation();let u=t();if(!u)return;let m=an(u,i());if(!m){let f=G(u,u.selectedVariantId);a(f),f&&f.options&&l(u,f.options);return}u.selectedVariantId=m.id,l(u,m.options),n(m,u)})}function Fe(e,t,n){if(!t.variants.length)return;let r=e.querySelector(".lb-bundle-variant-badge");r&&!r.textContent&&(r.textContent=n.title);let o=e.querySelector(".lb-bundle-variant-option-groups");o&&!o.children.length&&oo(o,t,n)}function oo(e,t,n){let r=t.optionNames||[];for(let o=0;o<r.length;o++){let i=document.createElement("div");i.className="lb-bundle-variant-option-group";let a=document.createElement("span");a.className="lb-bundle-variant-option-label",a.textContent=r[o],i.appendChild(a);let l=document.createElement("select");l.className="lb-bundle-variant-select",l.setAttribute("data-variant-option",""),l.setAttribute("data-option-position",String(o+1)),l.setAttribute("data-product-id",String(t.productId)),l.name="lb-variant-"+t.productId+"-"+(o+1),l.setAttribute("aria-label",r[o]);let d=Object.create(null);for(let s of t.variants){let c=s.options&&s.options[o];if(!c||d[c])continue;d[c]=!0;let u=document.createElement("option");u.value=c,u.textContent=c,n.options&&n.options[o]===c&&(u.selected=!0),l.appendChild(u)}i.appendChild(l),e.appendChild(i)}}var ft=new WeakMap;function Ve(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!ft.has(e)){let a=n||(o?o.src:null);a&&ft.set(e,a)}let i=t.image||ft.get(e)||null;if(i)if(o)o.src=i,o.srcset="";else{let a=document.createElement("img");a.src=i,a.loading="lazy",a.alt="",r.textContent="",r.appendChild(a)}}function io(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function gt(e,t,n,r){if(!t)return;Ve(e,t,n.featuredImage),io(e,t.quantity||n.quantity||1);let o=e.querySelector("[data-product-price]");o&&t.price!=null&&(o.textContent=r(t.price));let i=e.querySelector("[data-product-compare-price]");if(i){let l=t.compareAtPrice;l&&l>t.price?(i.textContent=r(l),i.hidden=!1):(i.textContent="",i.hidden=!0)}let a=e.querySelector("[data-product-unit-price]");a&&(t.unitPrice?(a.textContent=t.unitPrice,a.hidden=!1):(a.textContent="",a.hidden=!0))}function q(e,t,n){let r=document.createElement(e);r.className=t;for(let o in n)r.setAttribute(o,n[o]);return r}function Ue(e,t,n){let r=e.variants.length,o=q("div","lb-bundle-product-row");n.isOos&&(o.classList.add("lb-bundle-product-row--oos"),o.setAttribute("aria-disabled","true")),o.setAttribute("data-product-id",String(e.productId)),n.bogoRole&&o.setAttribute("data-bogo-role",n.bogoRole),o.appendChild(q("div","lb-bundle-thumbnail",{"data-thumbnail":""}));let i=q("div","lb-bundle-product-info"),a=document.createElement(n.href?"a":"span");if(a.className="lb-bundle-product-name",n.href&&(a.href=n.href),a.textContent=e.title??"",i.appendChild(a),n.isOos){let d=q("span","lb-bundle-oos-label");return d.textContent=t.outOfStock||"Out of stock",i.appendChild(d),o.appendChild(i),o}r===1&&e.variants[0]?.title!=="Default Title"&&i.appendChild(q("span","lb-bundle-variant-badge"));let l=q("span","lb-bundle-product-prices");if(l.appendChild(q("span","lb-bundle-product-compare-price",{"data-product-compare-price":"",hidden:""})),l.appendChild(q("span","lb-bundle-product-price",{"data-product-price":""})),n.inlineQuantity!=null){let d=q("span","lb-bundle-qty-inline",{"data-qty-inline":""});d.textContent="\xD7"+n.inlineQuantity,l.appendChild(d)}if(i.appendChild(l),i.appendChild(q("span","lb-bundle-product-unit-price",{"data-product-unit-price":""})),r>1&&i.appendChild(q("div","lb-bundle-variant-option-groups",{style:"--lb-row-option-count: "+(e.optionNames.length||1)})),o.appendChild(i),n.inlineQuantity==null&&o.appendChild(q("span","lb-bundle-qty-chip",{"data-qty-inline":""})),n.badgeText){let d=q("span","lb-bogo__badge");d.textContent=n.badgeText,o.appendChild(d)}return o}function le(e,t){let n=q("div",e),r=q("div","lb-bundle-header"),o=q("h3","lb-bundle-title");if(o.textContent=t.title,r.appendChild(o),t.subtitle){let m=q("p","lb-bundle-subtitle");m.textContent=t.subtitle,r.appendChild(m)}if(n.appendChild(r),t.endsAt){let m=q("div","lb-bundle-countdown",{"data-countdown":""}),f=q("span","lb-bundle-countdown-label");f.textContent=t.countdownLabel??"Ends in",m.appendChild(f),m.appendChild(q("span","lb-bundle-countdown-timer",{"data-countdown-timer":""})),n.appendChild(m)}let i=q("div",e+"__products lb-edge-fade");n.appendChild(i),n.appendChild(q("div","lb-bundle-divider"));let a=q("div","lb-bundle-summary"),l=q("div","lb-bundle-summary__text"),d=q("span","lb-bundle-summary__label");if(d.textContent=t.summaryLabel??"Bundle price",l.appendChild(d),t.withItemCount&&d.appendChild(q("span","",{"data-item-count":""})),t.showSavingsBar){let m=q("p","lb-bundle-savings-line",{"data-savings-bar":"",style:"display:none"});m.appendChild(document.createTextNode("Save ")),m.appendChild(q("span","",{"data-savings-amount":""})),m.appendChild(document.createTextNode(" ")),m.appendChild(q("span","",{"data-savings-percent":""})),l.appendChild(m)}a.appendChild(l);let s=q("span","lb-bundle-summary__prices");t.showComparePrice&&s.appendChild(q("span","lb-bundle-compare-price",{"data-compare-price":""})),s.appendChild(q("span","lb-bundle-sale-price",{[t.totalPriceSlot?"data-total-price":"data-sale-price"]:""})),a.appendChild(s),n.appendChild(a);let c=q("button","lb-bundle-cta",{type:"button","data-add-bundle":""}),u=q("span","lb-cta-label",{"data-cta-label":""});return u.textContent=t.ctaText,c.appendChild(u),n.appendChild(c),n.appendChild(q("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),n.appendChild(q("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),{root:n,products:i,cta:c}}function dn(e,t){let n=q("div","lb-volume__tiers lb-edge-fade",{role:"radiogroup","aria-label":t,"data-tier-group":""});return e.forEach((r,o)=>{let i=q("div","lb-volume__tier",{role:"radio","aria-checked":r.selected?"true":"false",tabindex:r.selected?"0":"-1","data-tier-index":String(o),"data-tier-qty":String(r.quantity),"data-tier-pct":String(r.percent),"data-tier-amt":String(r.amountCents)}),a=q("span","lb-volume__radio");a.appendChild(q("span","lb-volume__radio-dot")),i.appendChild(a);let l=q("span","lb-volume__tier-info"),d=q("span","lb-volume__tier-label");d.textContent=r.label,l.appendChild(d);let s=q("span","lb-volume__tier-price");if(s.appendChild(q("span","lb-volume__tier-compare")),s.appendChild(q("span","",{"data-tier-price-each":""})),l.appendChild(s),i.appendChild(l),r.badgeLabel||r.savingsLabel){let c=q("span","lb-volume__tier-right");if(r.badgeLabel){let u=q("span","lb-volume__tier-badge");u.textContent=r.badgeLabel,c.appendChild(u)}if(r.savingsLabel){let u=q("span","lb-volume__tier-savings");u.textContent=r.savingsLabel,c.appendChild(u)}i.appendChild(c)}n.appendChild(i)}),n}function ze(e){let t=q("div","lb-mix-match__progress",{"data-progress":""}),n=q("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)});for(let o=0;o<e;o++)n.appendChild(q("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));t.appendChild(n);let r=q("div","lb-mix-match__progress-labels");return r.appendChild(q("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"})),r.appendChild(q("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"})),t.appendChild(r),t}function we(e){return e<10?"0"+e:String(e)}function se(e){e._lbCountdownInterval&&(clearInterval(e._lbCountdownInterval),e._lbCountdownInterval=null);let t=e.querySelector("[data-countdown]");if(!t)return;let n=e.closest(".lb-bundle-widget"),r=n&&n.getAttribute("data-ends-at");if(!r){t.style.display="none";return}let o=new Date(r).getTime();if(isNaN(o)){t.style.display="none";return}let i=t.querySelector("[data-countdown-timer]");if(!i)return;let a;function l(){let d=o-Date.now();if(d<=0){n&&(n.style.display="none"),a&&clearInterval(a);return}let s=Math.floor(d/864e5),c=Math.floor(d%864e5/36e5),u=Math.floor(d%36e5/6e4),m=Math.floor(d%6e4/1e3);i.textContent=s>0?s+"d "+we(c)+"h "+we(u)+"m "+we(m)+"s":we(c)+"h "+we(u)+"m "+we(m)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}var de={locale:"en",addItem:"Add",addedItem:"Added",removeItem:"Remove",swapItem:"Swap",required:"Required",soldOut:"Sold out",outOfStock:"Out of stock",itemsOutOfStock:"__COUNT__ items out of stock",quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle price",save:"Save",complete:"Complete",ofSelected:"__COUNT__ of __TOTAL__ added",moreToGo:"__COUNT__ more to go",nProductsShown:"__COUNT__ products shown",bundleComplete:"Your bundle is complete",chooseMoreUnlock:"Choose __COUNT__ more to unlock __PCT__% off",chooseMoreComplete:"Choose __COUNT__ more to complete your bundle",stepOf:"Step __STEP__ of __TOTAL__",stepsCompleted:"__COUNT__ of __TOTAL__ steps completed",each:" each",buyQty:"Buy __COUNT__",needsSpots:{one:"Needs __COUNT__ spot",other:"Needs __COUNT__ spots"}};function cn(e){let t=e.ownerDocument,n=t&&t.defaultView;if(!n)return null;let r=e.parentElement;for(;r&&r!==t.body;){let o=n.getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden")return r;r=r.parentElement}return null}var ee=[],Qe=!1;function ao(e,t){if(e.composedPath){let r=e.composedPath();for(let o=0;o<r.length;o++)if(r[o]===t.shell||r[o]===t.listbox)return!0;return!1}let n=e.target;return t.shell.contains(n)||t.listbox.contains(n)}function We(e){for(let t=ee.length-1;t>=0;t--)ao(e,ee[t])||ee[t].close()}function un(){for(let e=ee.length-1;e>=0;e--)ee[e].close()}function lo(){Qe||(document.addEventListener("pointerdown",We,!0),window.addEventListener("resize",un),window.addEventListener("scroll",We,!0),Qe=!0)}function so(){Qe&&(document.removeEventListener("pointerdown",We,!0),window.removeEventListener("resize",un),window.removeEventListener("scroll",We,!0),Qe=!1)}function pn(e){ee.push(e),ee.length===1&&lo()}function mn(e){let t=ee.indexOf(e);t>=0&&ee.splice(t,1),ee.length===0&&so()}function bn(e){for(let t=ee.length-1;t>=0;t--)ee[t]!==e&&ee[t].close()}var co=32,uo=8,po=8,xt=new WeakMap;function hn(e){return xt.get(e)}function fn(e){if(e.classList.contains("lb-dropdown-state"))return null;let t=document,n=e.getAttribute("aria-label")||"",r="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 o=t.createElement("div");o.className="lb-dropdown",o.setAttribute("data-lb-dropdown","");let i=t.createElement("button");i.type="button",i.className="lb-dropdown-trigger",i.setAttribute("role","combobox"),i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");let a=r+"-listbox";i.setAttribute("aria-controls",a),n&&i.setAttribute("aria-label",n);let l=t.createElement("span");l.className="lb-dropdown-trigger-value";let d=t.createElement("span");d.className="lb-dropdown-chevron",d.setAttribute("aria-hidden","true"),i.appendChild(l),i.appendChild(d);let s=t.createElement("ul");s.id=a,s.className="lb-dropdown-listbox",s.setAttribute("role","listbox"),n&&s.setAttribute("aria-label",n),s.hidden=!0,o.appendChild(i),e.parentNode?.insertBefore(o,e.nextSibling);let c=e.closest("[data-modal-overlay]");c?(c.appendChild(s),s.setAttribute("data-lb-dropdown-portal","")):o.appendChild(s);let u=!1,m=-1,f=ge.emptyTypeAheadState(),h=[];function k(){let B=[];for(let C=0;C<e.options.length;C++){let x=e.options[C];B.push({disabled:x.disabled,label:x.textContent||x.value})}return B}function L(){i.disabled=e.disabled;let B=k(),C=e.selectedIndex;for(l.textContent=C>=0&&B[C]?B[C].label:"";s.firstChild;)s.removeChild(s.firstChild);h=[];for(let x=0;x<B.length;x++){let A=t.createElement("li");A.id=r+"-opt-"+x,A.className="lb-dropdown-option",A.setAttribute("role","option"),A.setAttribute("aria-selected",x===C?"true":"false"),B[x].disabled&&A.setAttribute("aria-disabled","true"),A.setAttribute("data-value",e.options[x].value),A.setAttribute("data-index",String(x)),A.textContent=B[x].label,s.appendChild(A),h.push(A)}}function b(B){if(m>=0&&h[m]&&h[m].classList.remove("is-active"),m=B,B<0||!h[B]){i.setAttribute("aria-activedescendant","");return}let C=h[B];C.classList.add("is-active"),i.setAttribute("aria-activedescendant",C.id);let x=C.offsetTop,A=x+C.offsetHeight,v=s.scrollTop,I=v+s.clientHeight;x<v?s.scrollTop=x:A>I&&(s.scrollTop=A-s.clientHeight)}function N(){let B=i.getBoundingClientRect();if(B.width===0)return!1;let x=Math.min(h.length||1,po)*co+uo,A=cn(i),v=A?{top:A.getBoundingClientRect().top,bottom:A.getBoundingClientRect().bottom}:void 0,I=ge.computePosition({trigger:{top:B.top,bottom:B.bottom,left:B.left,width:B.width},viewportHeight:window.innerHeight,desiredHeight:x,clip:v});return s.setAttribute("data-placement",I.placement),s.style.maxHeight=I.maxHeight+"px",s.hasAttribute("data-lb-dropdown-portal")&&(s.style.top=I.offsetTop+"px",s.style.left=I.offsetLeft+"px",s.style.width=I.width+"px"),!0}function O(){if(u)return;bn(j),u=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),N()||requestAnimationFrame(()=>{N()});let B=k(),C=e.selectedIndex;C>=0&&B[C]&&!B[C].disabled?b(C):b(ge.firstEnabled(B)),pn(j)}function T(B){u&&(u=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),m>=0&&h[m]&&h[m].classList.remove("is-active"),m=-1,mn(j),B&&i.focus())}function p(B){let C=e.options[B];!C||C.disabled||(e.value!==C.value&&(e.value=C.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),L(),T(!0))}function w(B){let C=k(),x=ge.handleKey({key:B.key,ctrlKey:B.ctrlKey,metaKey:B.metaKey,altKey:B.altKey,shiftKey:B.shiftKey},{isOpen:u,activeIndex:m,selectedIndex:e.selectedIndex,options:C});switch(x.preventDefault&&B.preventDefault(),x.type){case"open":O(),x.activeIndex>=0&&b(x.activeIndex);break;case"close":T(x.restoreFocus);break;case"move-active":b(x.activeIndex);break;case"commit":p(x.index);break;case"type-ahead":{let A=ge.pushTypeAheadChar(f,x.char,Date.now(),C);f=A.newState,A.matchedIndex!==null&&(u||O(),b(A.matchedIndex));break}}}function E(B){B.preventDefault(),u?T(!1):O()}function g(B){let C=B.target;for(;C&&C!==s;){if(C.classList&&C.classList.contains("lb-dropdown-option")){let x=parseInt(C.getAttribute("data-index")??"",10);return isNaN(x)?null:x}C=C.parentNode}return null}function U(B){let C=g(B);C!==null&&p(C)}function F(B){let C=B.target;for(;C&&C!==s;){if(C.classList&&C.classList.contains("lb-dropdown-option")){if(C.getAttribute("aria-disabled")==="true")return;let x=parseInt(C.getAttribute("data-index")??"",10);!isNaN(x)&&x!==m&&b(x);return}C=C.parentNode}}function D(){setTimeout(()=>{u&&(o.contains(document.activeElement)||T(!1))},0)}function Z(){L()}let J=new MutationObserver(()=>{L()});J.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function ne(B){B.preventDefault()}i.addEventListener("click",E),i.addEventListener("keydown",w),o.addEventListener("focusout",D),s.addEventListener("mousedown",ne),s.addEventListener("click",U),s.addEventListener("mousemove",F),e.addEventListener("change",Z);function W(){u&&T(!1),J.disconnect(),i.removeEventListener("click",E),i.removeEventListener("keydown",w),o.removeEventListener("focusout",D),s.removeEventListener("mousedown",ne),s.removeEventListener("click",U),s.removeEventListener("mousemove",F),e.removeEventListener("change",Z),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),xt.delete(e)}let j={shell:o,listbox:s,select:e,close:()=>T(!1),destroy:W};return xt.set(e,j),L(),j}var mo="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function gn(e){let n=(e??document).querySelectorAll(mo);for(let r=0;r<n.length;r++)fn(n[r])}function xn(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)hn(n[r])?.destroy()}function be(e){return gn(e),()=>xn(e)}function vn(e,t,n,r,o){let i=t.widgetConfig,a=He(t);if(!a.length)return;let l=a.filter(m=>!m.variants.some(f=>f.available));if(n==="hide"&&l.length>0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",s=ie(d),c=de,u=le("lb-fixed",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||c.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});u.root.setAttribute("data-discount-type",t.discountConfig.discountType),u.root.setAttribute("data-discount-value",String(t.discountConfig.discountValue));for(let m of a){let f=!m.variants.some(L=>L.available),h=Ue(m,c,{isOos:f,href:m.url});if(u.products.appendChild(h),f)continue;let k=G(m,m.selectedVariantId);Fe(h,m,k),gt(h,k,m,s),De(h,()=>m,(L,b)=>{gt(h,L,b,s),ht(u.root,a,s)})}if(l.length>0){u.cta.disabled=!0;let m=u.cta.querySelector("[data-cta-label]");m&&(m.textContent=(c.itemsOutOfStock||"__COUNT__ items out of stock").split("__COUNT__").join(String(l.length)))}else u.cta.addEventListener("click",()=>{r(sn(a).map(m=>({merchandiseId:"gid://shopify/ProductVariant/"+m.variantId,quantity:m.quantity,attributes:ae(t.id,t.bundleType)})))});e.appendChild(u.root),se(u.root),ht(u.root,a,s),o?.(be(u.root))}function K(e,t){let n=e;for(let r in t)n=n.split("__"+r+"__").join(String(t[r]));return n}function je(e,t){let n=t.needsSpots;if(!n)return"Needs "+e+" spots";let r=new Intl.PluralRules(t.locale||"en").select(e);return K(n[r]||n.other||"__COUNT__",{COUNT:e})}function $e(e,t,n){return K(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function yn(e,t){return e>0?K(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function wn(e,t,n,r){if(e<=0)return r.bundleComplete||"Your bundle is complete";let o=t==="percentage"&&n?Math.round(n):0;return o>0?K(r.chooseMoreUnlock||"Choose __COUNT__ more to unlock __PCT__% off",{COUNT:e,PCT:o}):K(r.chooseMoreComplete||"Choose __COUNT__ more to complete your bundle",{COUNT:e})}var bo={min:1,max:99};function Y(e,t){let n=t["gid://shopify/Product/"+e];return!n||typeof n.min!="number"||typeof n.max!="number"?bo:n}function Ge(e,t){return Y(e,t).min}function te(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].quantity||1;return t}function ue(e,t){for(let n=0;n<e.length;n++)if(e[n]&&e[n].variantId===t)return n;return-1}function _n(e,t){let n=ue(e,t);return n===-1?0:e[n].quantity||0}function Cn(e,t){return e.min<=t}function kn(e,t,n,r=0,o=0){let i=Math.min(e.max-o,r+t);return typeof n=="number"?Math.min(i,n):i}var Sn=[120,180,240],vt=[480,600,768,1024],Tn="60px",En="(max-width: 767px) 45vw, 228px";function _e(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function Ee(e,t){return e?t.map(n=>_e(e,n)+" "+n+"w").join(", "):""}function Ke(e,t){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Ce(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase():""}var An=600;function Ye(e,t,n){let{t:r,rulesMap:o,capacity:i,formatMoney:a}=n,l=Y(e.id,o),d=document.createElement("div");d.className="lb-mix-match__modal-product",e.available||(d.className+=" lb-mix-match__modal-product--sold-out"),d.setAttribute("data-product-item",""),d.setAttribute("data-title",Ce(e.title)),d.setAttribute("data-type",e.type||"");let s=!1,c=!1,u=document.createElement("div");u.className="lb-mix-match__modal-product-thumb";let m=document.createElement("span");m.className="lb-mix-match__modal-added-badge",m.textContent=r.addedItem||"Added",m.hidden=!0,u.appendChild(m);let f=e.variants.find(v=>v.available)??null,h=f&&f.image||e.featuredImage;if(h){let v=document.createElement("img");v.src=_e(h,An),v.srcset=Ee(h,vt),v.sizes=En,v.alt=e.title,v.loading="lazy",u.appendChild(v)}d.appendChild(u);let k=document.createElement("div");k.className="lb-mix-match__modal-product-info";let L=document.createElement("p");if(L.className="lb-mix-match__modal-product-title",e.url){let v=document.createElement("a");v.href=e.url,v.target="_blank",v.rel="noopener noreferrer",v.textContent=e.title,L.appendChild(v)}else L.textContent=e.title;k.appendChild(L);let b=f??(e.variants.length>0?e.variants[0]:null),N=b?l.min:1,O=document.createElement("p");O.className="lb-mix-match__modal-product-price",O.setAttribute("data-row-price","");let T=document.createElement("span");T.setAttribute("data-row-price-sale",""),b&&(T.textContent=a(b.price*N)),O.appendChild(T);let p=document.createElement("s");p.className="lb-mix-match__modal-product-compare",p.setAttribute("data-row-compare",""),O.appendChild(p),k.appendChild(O);function w(v,I,z){let _=I&&I.compareAtPrice?I.compareAtPrice*z:0,y=I?I.price*z:0;_>y?(v.textContent=a(_),v.hidden=!1):(v.textContent="",v.hidden=!0)}w(p,b,N);let E=document.createElement("p");E.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",E.setAttribute("data-row-unit-price","");let g=b?b.unitPrice:null;g?E.textContent=g:E.hidden=!0,k.appendChild(E);let U=null,F=null,D=l.min,Z=l.max,J=null,ne=null;if(e.available&&n.showQtySelector){U=document.createElement("div"),U.className="lb-bundle-variant-option-group lb-mix-match__qty-stepper-group";let v=document.createElement("div");v.className="lb-mix-match__qty-stepper",v.setAttribute("role","group"),v.setAttribute("aria-label",r.quantity||"Quantity");let I=document.createElement("button");I.type="button",I.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",I.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),I.textContent="\u2212",F=document.createElement("span"),F.className="lb-mix-match__qty-stepper-value",F.setAttribute("data-row-qty",""),F.setAttribute("aria-live","polite"),F.textContent=String(l.min);let z=document.createElement("button");z.type="button",z.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",z.setAttribute("aria-label",r.increaseQuantity||"Increase quantity"),z.textContent="+",v.appendChild(I),v.appendChild(F),v.appendChild(z),U.appendChild(v);let _=F;J=()=>{_.textContent=String(D),_.setAttribute("data-qty",String(D)),I.disabled=c||D<=l.min,z.disabled=c||D>=Z},ne=(P,M=0)=>{let S=P?P.id:null,R=S===null?0:i.ownQty(S),H=S===null?0:i.productUnitsElsewhere(e.id,S),V=S===null?0:i.swapUnits(e.id,S),$=P?P.inventoryQuantity:null,X=Math.max(0,M-R),pe=typeof $=="number"?Math.max(0,$-X):void 0;Z=V>0?typeof pe=="number"?Math.min(V,pe):V:kn(l,i.remainingSpots(),pe,R,H),Z<l.min?D=l.min:(D>Z&&(D=Z),D<l.min&&(D=l.min)),J()};let y=()=>{b&&i.commitQty(b.id,D)&&n.onCommittedQtyChanged()};I.addEventListener("click",()=>{D>l.min&&(D-=1),J(),y()}),z.addEventListener("click",()=>{D<Z&&(D+=1),J(),y()}),b?ne(b):J()}let W=e.variants.slice(),j=[];if(W.length>1){let v=e.optionNames||[];b=W.find(S=>S.available!==!1)??W[0];let I=()=>{let S=j.map(R=>R.value);for(let R of W)if(!(!R.options||R.options.length!==S.length)&&R.options.every((H,V)=>H===S[V]))return R;return null},z=S=>{if(!(!S||!S.options))for(let R=0;R<j.length&&R<S.options.length;R++)j[R].value!==S.options[R]&&(j[R].value=S.options[R])},_=(S,R,H)=>{for(let V of W){if(V.available===!1||!V.options||V.options[S]!==R)continue;let $=!0;for(let X=0;X<V.options.length;X++)if(X!==S&&V.options[X]!==H[X]){$=!1;break}if($)return!0}return!1},y=S=>{for(let R=0;R<j.length;R++){let H=j[R];for(let V=0;V<H.options.length;V++)H.options[V].disabled=!_(R,H.options[V].value,S)}},P=()=>{let S=I();if(!S){z(b),b?.options&&y(b.options);return}b=S,d.setAttribute("data-selected-variant-id",String(S.id));let R=l.min;T.textContent=a(S.price*R),w(p,S,R),S.unitPrice?(E.textContent=S.unitPrice,E.hidden=!1):(E.textContent="",E.hidden=!0);let H=u.querySelector("img"),V=S.image||e.featuredImage;H&&V&&(H.src=_e(V,An),H.srcset=Ee(V,vt)),ne?.(S,i.variantUnitsElsewhere(S.id)),S.options&&y(S.options),A()},M=document.createElement("div");M.className="lb-bundle-variant-option-groups";for(let S=0;S<v.length;S++){let R=v[S],H=document.createElement("div");H.className="lb-bundle-variant-option-group";let V=document.createElement("span");V.className="lb-bundle-variant-option-label",V.textContent=R,H.appendChild(V);let $=document.createElement("select");$.className="lb-mix-match__variant-select",$.setAttribute("data-variant-option",""),$.setAttribute("data-option-position",String(S+1)),$.name="lb-variant-"+e.id+"-"+(S+1),$.setAttribute("aria-label",R);let X=Object.create(null),pe=b?.options?.[S];for(let Te of W){let ce=Te.options&&Te.options[S];if(!ce||X[ce])continue;X[ce]=!0;let me=document.createElement("option");me.value=ce,me.textContent=ce,ce===pe&&(me.selected=!0),$.appendChild(me)}$.addEventListener("change",P),j.push($),H.appendChild($),M.appendChild(H)}k.appendChild(M),b&&(d.setAttribute("data-selected-variant-id",String(b.id)),b.options&&y(b.options))}else if(W.length===1&&W[0].title!=="Default Title"){let v=document.createElement("span");v.className="lb-mix-match__filled-variant",v.textContent=W[0].title,k.appendChild(v)}let B=null;e.available&&(B=document.createElement("span"),B.className="lb-mix-match__modal-needs-spots",B.hidden=!0,k.appendChild(B));let C=null;if(e.available){let v=document.createElement("div");v.className="lb-mix-match__modal-product-actions",U&&v.appendChild(U),C=document.createElement("button"),C.type="button",C.className="lb-mix-match__modal-add",C.textContent=r.addItem||"Add",C.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),C.setAttribute("data-add-product",String(t)),v.appendChild(C),k.appendChild(v)}else{let v=document.createElement("span");v.className="lb-mix-match__modal-sold-out-label",v.textContent=r.soldOut||"Sold out",d.setAttribute("aria-disabled","true"),k.appendChild(v)}d.appendChild(k);let x=b?b.id:null;function A(){if(!b)return;let v=b,I=v.inventoryQuantity,z=typeof I=="number"?i.variantUnitsElsewhere(v.id):0,_=i.isInBundle(v.id);if(ne){let R=i.ownQty(v.id);R>0?D=R:x!==v.id&&(D=l.min),x=v.id,ne(v,z)}let P=i.swapUnits(e.id,v.id)>=l.min,M=i.remainingSpots(),S=!_&&!P&&!Cn(l,M);if(B&&(S&&M>0?(B.textContent=je(l.min,r),B.hidden=!1):B.hidden=!0),C)if(_)C.disabled=!1,i.canRemove(v.id)?(C.textContent=r.removeItem||"Remove",C.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),C.classList.remove("lb-mix-match__modal-add--required")):(C.disabled=!0,C.textContent=r.required||"Required",C.setAttribute("aria-label",e.title+" is required and cannot be removed"),C.classList.add("lb-mix-match__modal-add--required")),C.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),m.hidden=!1;else{let R=r.swapItem||"Swap",H=P?R:r.addItem||"Add";C.textContent=H,C.setAttribute("aria-label",H+" "+e.title),C.classList.remove("lb-mix-match__modal-add--added"),C.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),m.hidden=!0;let V=typeof I=="number"?Math.max(0,I-z)<l.min:!1;if(P)C.disabled=V;else{let $=l.max-i.productUnitsElsewhere(e.id,v.id)<l.min;C.disabled=V||$||S||i.isFull()}}s=!e.available,c=!e.available||!_&&!!C?.disabled,J?.();for(let R of j)R.disabled=s}return{el:d,refresh:A}}var ho='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function Je(e){let t=e.querySelectorAll(ho),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var yt=0,Ae=0;function Xe(){if(Ae++,Ae>1)return;yt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+yt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function Ze(){if(Ae<=0||(Ae--,Ae>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,yt)}var Ie="__all__",fo=300,go=200;function In(e){let{container:t,data:n,t:r,eligibleProducts:o,items:i}=e,a=t.querySelector("[data-modal-overlay]");a&&e.portalTarget&&e.portalTarget.appendChild(a);let l=x=>a?a.querySelector(x):null,d=l('[role="dialog"]'),s=l("[data-modal-search]"),c=l("[data-modal-search-clear]"),u=l("[data-modal-list]"),m=l("[data-modal-empty]"),f=l("[data-modal-live]"),h=l("[data-modal-close]"),k=l("[data-modal-done]"),L=l("[data-modal-footer-count]"),b=l("[data-modal-subtitle]"),N=l("[data-modal-filters]"),O=n.showTypeFilters!==!1,T=Ie,p=!1,w=!1,E=!1,g=[];function U(){for(let x of g)x.refresh()}function F(){let x=Math.min(te(i),e.requiredQty),A=Math.max(0,e.requiredQty-x);L&&(L.textContent=$e(x,e.requiredQty,r)),b&&(b.textContent=wn(A,n.discountType,n.discountValue,r))}function D(){U(),F()}function Z(){if(u){e.dropdown?.unbindAll(u),u.innerHTML="",g=[];for(let x=0;x<o.length;x++){let A=Ye(o[x],x,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),D()}});g.push(A),u.appendChild(A.el)}e.dropdown?.bindAll(u),u.addEventListener("click",J)}}function J(x){let A=x.target.closest("[data-add-product]");if(!A||A.disabled)return;let v=parseInt(A.getAttribute("data-add-product")??"",10),I=o[v];if(!I)return;let z=A.closest(".lb-mix-match__modal-product"),_=z&&z.getAttribute("data-selected-variant-id"),y=(_?I.variants.find(H=>H.id===parseInt(_,10)):null)??null;if(y||(y=I.variants.find(H=>H.available)??null),!y)return;if(e.isInBundle(y.id)){e.removeVariant(y.id),D();return}let P=z?.querySelector("[data-row-qty]"),M=P?Math.max(1,parseInt(P.getAttribute("data-qty")||P.textContent||"",10)||1):Ge(I.id,e.rulesMap),S={productId:I.id,variantId:y.id,title:I.title,url:I.url||null,variantTitle:y.title,featuredImage:y.image||I.featuredImage||null,price:y.price,compareAtPrice:y.compareAtPrice||null,unitPrice:y.unitPrice||null,quantity:M},R=e.swapUnitsFor(I.id,y.id);if(R>0){e.swapVariant(S,Math.min(M,R)),D();return}e.atCapacity()||(e.addSelection(S),D())}function ne(){if(!N||!O)return;let x=[],A=Object.create(null);for(let v of o){let I=(v.type||"").trim();I&&!A[I]&&(A[I]=!0,x.push(I))}if(x.length<2){N.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}N.innerHTML="";for(let v of[Ie,...x]){let I=document.createElement("button");I.type="button",I.className="lb-mix-match__filter",I.setAttribute("data-filter",v),I.setAttribute("aria-pressed",v===T?"true":"false"),v===T&&I.classList.add("lb-mix-match__filter--active"),I.textContent=v===Ie?r.allTypes||"All":v,I.addEventListener("click",()=>{T=v,W(),j(s?s.value:"")}),N.appendChild(I)}}function W(){if(!N)return;let x=N.querySelectorAll("[data-filter]");for(let A=0;A<x.length;A++){let v=x[A].getAttribute("data-filter")===T;x[A].classList.toggle("lb-mix-match__filter--active",v),x[A].setAttribute("aria-pressed",v?"true":"false")}}function j(x){if(!u)return;let A=Ce(x),v=u.querySelectorAll("[data-product-item]"),I=0;for(let z=0;z<v.length;z++){let _=v[z].getAttribute("data-title")??"",y=v[z].getAttribute("data-type")||"",P=(!A||_.indexOf(A)!==-1)&&(T===Ie||y===T);v[z].classList.toggle("lb-hidden",!P),P&&I++}m&&(m.style.display=I===0&&A.length>0?"":"none"),c&&(c.style.display=x.length>0?"":"none"),f&&(f.textContent=K(r.nProductsShown||"__COUNT__ products shown",{COUNT:I}))}if(s){let x=Ke(()=>j(s.value),go);s.addEventListener("input",x)}c&&c.addEventListener("click",()=>{s&&(s.value="",j(""),s.focus())});function B(){!a||E||(E=!0,p||(Z(),p=!0),w||(ne(),w=!0),D(),T=Ie,W(),s&&(s.value=""),j(s?s.value:""),a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),Xe(),setTimeout(()=>{s?s.focus():d?.focus()},50))}function C(){if(!a||!E)return;E=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),Ze(),setTimeout(()=>{E||(a.style.display="none")},fo);let x=e.fallbackFocus;x&&typeof x.focus=="function"&&setTimeout(()=>x.focus(),0)}if(h?.addEventListener("click",C),k?.addEventListener("click",C),a){let x=null;a.addEventListener("mousedown",A=>{x=A.target}),a.addEventListener("mouseup",A=>{A.target===a&&x===a&&C(),x=null})}return document.addEventListener("keydown",x=>{if(E){if(x.key==="Escape"){x.preventDefault(),C();return}if(x.key==="Tab"&&d){let A=Je(d);if(A.length===0){x.preventDefault();return}let v=A[0],I=A[A.length-1];x.shiftKey&&document.activeElement===v?(x.preventDefault(),I.focus()):!x.shiftKey&&document.activeElement===I&&(x.preventDefault(),v.focus())}}}),{open:B,close:C,isOpen:()=>E,refresh:D,overlay:a}}function Mn(e,t){return Math.max(0,t-te(e))}function wt(e,t){return te(e)>=t}function Ln(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].variantId===t&&(n+=e[r].quantity||0);return n}function et(e,t,n){let r=0;for(let o=0;o<e.length;o++){let i=e[o];i&&i.productId===t&&i.variantId!==n&&(r+=i.quantity||0)}return r}function ke(e,t,n){let r=Y(t.productId,n);if(!r.required)return!0;let o=0;for(let i=0;i<e.length;i++){let a=e[i];a!==t&&a.productId===t.productId&&(o+=a.quantity||1)}return o>=r.min}function _t(e,t,n,r){let o=Y(t,r);return!o.required||o.max!==o.min||ue(e,n)!==-1?0:et(e,t,n)}function xo(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","16"),t.setAttribute("height","16"),t.setAttribute("viewBox","0 0 20 20"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["5","5","15","15"],["15","5","5","15"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function tt(e,t,n,r,o,i){let a=document.createElement("div");a.className="lb-mix-match__slot lb-mix-match__slot--filled";let l=document.createElement("div");if(l.className="lb-bundle-thumbnail",e.featuredImage){let h=document.createElement("img");h.src=_e(e.featuredImage,240),h.srcset=Ee(e.featuredImage,Sn),h.sizes=Tn,h.alt=e.title,h.loading="lazy",l.appendChild(h)}a.appendChild(l);let d=document.createElement("div");d.className="lb-mix-match__filled-info";let s=document.createElement("button");if(s.type="button",s.className="lb-mix-match__filled-title",s.textContent=e.title,s.setAttribute("aria-label",(t.editSelection||"Edit selection")+": "+e.title),d.appendChild(s),e.variantTitle&&e.variantTitle!=="Default Title"){let h=document.createElement("span");h.className="lb-mix-match__filled-variant",h.textContent=e.variantTitle,d.appendChild(h)}let c=document.createElement("span");c.className="lb-mix-match__filled-price";let u=e.compareAtPrice||0;if(u>e.price){let h=document.createElement("s");h.className="lb-mix-match__filled-compare",h.textContent=n(u),c.appendChild(h)}let m=document.createElement("span");m.className="lb-bundle-product-price",m.textContent=n(e.price),c.appendChild(m);let f=document.createElement("span");if(f.className="lb-bundle-qty-inline",f.textContent="\xD7"+(e.quantity||1),c.appendChild(f),d.appendChild(c),e.unitPrice){let h=document.createElement("span");h.className="lb-bundle-product-unit-price",h.textContent=e.unitPrice,d.appendChild(h)}if(a.appendChild(d),r){let h=document.createElement("button");h.type="button",h.className="lb-mix-match__slot-remove",h.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),h.appendChild(xo()),h.addEventListener("click",k=>{k.stopPropagation(),o()}),a.appendChild(h)}else{let h=document.createElement("span");h.className="lb-mix-match__slot-required",h.textContent=t.required||"Required",a.appendChild(h)}return a.addEventListener("click",i),a}function Pn(e,t,n,r,o){let i=r.translations||{},a=e.querySelector("[data-selection-slots]");if(a){a.innerHTML="";for(let s=0;s<t.length;s++){let c=s;a.appendChild(tt(t[c],i,o.formatMoney,ke(t,t[c],o.rulesMap),()=>o.onRemove(c),o.onEdit))}}let l=e.querySelector("[data-add-product-trigger]");l&&(l.style.display=te(t)>=n?"none":"");let d=e.querySelector("[data-add-bundle]");if(d){d.disabled=te(t)<n;let s=d.querySelector("[data-cta-label]");s&&(s.textContent=d.getAttribute("data-cta-text")||i.addToCart||"Add to cart")}}function Bn(e,t,n,r,o,i){let a=e.querySelector("[data-pricing-section]");if(te(t)<n){a&&(a.style.display="none");return}a&&(a.style.display="");let l=0;for(let d=0;d<t.length;d++)l+=t[d].price*(t[d].quantity||1);l>0&&r.discountType&&i(e,o(l,r.discountType,r.discountValue??0),l)}function qn(e,t,n,r,o){let i=Math.min(te(n),r),a=Math.max(0,r-i),l=[e];t&&l.push(t);for(let d of l){let s=d.querySelectorAll("[data-progress-segment]");for(let f=0;f<s.length;f++)s[f].classList.toggle("lb-mix-match__progress-segment--filled",f<i);let c=d.querySelector("[data-progress-count]");c&&(c.textContent=$e(i,r,o));let u=d.querySelector("[data-progress-remaining]");u&&(u.textContent=yn(a,o));let m=d.querySelector(".lb-mix-match__progress-segments");m&&m.setAttribute("aria-valuenow",String(i))}}function nt(e){return(t,n,r)=>{let o=t.querySelector("[data-sale-price]"),i=t.querySelector("[data-compare-price]"),a=t.querySelector("[data-savings-bar]"),l=t.querySelector("[data-savings-amount]"),d=t.querySelector("[data-savings-percent]"),s=r-n;if(o&&(o.textContent=e(n)),i&&(s>0?(i.textContent=e(r),i.style.display=""):i.style.display="none"),a)if(s>0){if(l&&(l.textContent=e(s)),d){let c=r>0?Math.round(s*100/r):0;d.textContent="("+c+"%)"}a.style.display=""}else a.style.display="none"}}function Nn(e,t,n,r){let o=c=>c.variants.find(u=>u.available)??null,i=(c,u,m)=>({productId:c.id,variantId:u.id,title:c.title,url:c.url||null,variantTitle:u.title,featuredImage:c.featuredImage||null,price:u.price,compareAtPrice:u.compareAtPrice||null,unitPrice:u.unitPrice||null,quantity:m}),a=[];for(let c of e){let u=Y(c.id,t);if(!u.required||!c.available||!c.variants)continue;let m=o(c);m&&a.push(i(c,m,Math.max(1,u.min)))}if(a.length||!r?.enabled)return a;let l=c=>c.available&&Y(c.id,t).min<=n,d=(r.currentProductId!=null?e.find(c=>c.id===r.currentProductId&&l(c)):null)??e.find(l);if(!d)return[];let s=o(d);return s?[i(d,s,Y(d.id,t).min)]:[]}function Rn(e){let t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("viewBox","0 0 20 20"),n.setAttribute("fill","none");for(let[r,o,i,a]of e){let l=document.createElementNS(t,"line");l.setAttribute("x1",r),l.setAttribute("y1",o),l.setAttribute("x2",i),l.setAttribute("y2",a),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","2"),l.setAttribute("stroke-linecap","round"),n.appendChild(l)}return n}function Q(e,t,n={}){let r=document.createElement(e);t&&(r.className=t);for(let o in n)r.setAttribute(o,n[o]);return r}function rt(e){let t="lb-modal-title-"+e.domId,n=Q("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),r=Q("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),o=Q("div","lb-mix-match__modal-header"),i=Q("div","lb-mix-match__modal-header-top"),a=Q("div","lb-mix-match__modal-heading"),l=Q("h4","lb-mix-match__modal-title",{id:t});e.wizard&&l.setAttribute("tabindex","-1"),l.textContent="Add to your bundle",a.appendChild(l),a.appendChild(Q("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),i.appendChild(a);let d=Q("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":"Close"});d.appendChild(Rn([["5","5","15","15"],["15","5","5","15"]])),i.appendChild(d),o.appendChild(i);let s=Q("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),c=Q("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)c.setAttribute("data-modal-step-segments","");else for(let k=0;k<(e.segmentCount??0);k++)c.appendChild(Q("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(s.appendChild(c),o.appendChild(s),r.appendChild(o),e.showSearch){let k=Q("div","lb-mix-match__modal-search"),L=Q("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":"Search products",placeholder:"Search products",autocomplete:"off"});k.appendChild(L);let b=Q("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":"Clear search",style:"display: none;"});b.appendChild(Rn([["5","5","15","15"],["15","5","5","15"]])),k.appendChild(b),r.appendChild(k)}e.showTypeFilters&&r.appendChild(Q("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),r.appendChild(Q("div","lb-mix-match__modal-list",{"data-modal-list":""}));let u=Q("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),m=document.createElement("p");m.textContent="No products match your search",u.appendChild(m),r.appendChild(u),r.appendChild(Q("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let f=Q("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let k=Q("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});k.textContent="Back",f.appendChild(k)}if(f.appendChild(Q("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let k=Q("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});k.textContent="Next",f.appendChild(k)}let h=Q("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return h.textContent="Done",f.appendChild(h),r.appendChild(f),n.appendChild(r),n}function On(e,t,n,r,o){let i=t.widgetConfig,a=de,l=t.minQuantity||1,d=t.productRules??{},c=He(t).map(p=>({id:Number(p.productId),title:p.title??"",url:p.url??null,type:"",featuredImage:p.featuredImage??null,available:p.variants.some(w=>w.available),optionNames:p.optionNames,variants:p.variants.map(w=>({id:Number(w.id),title:w.title,options:w.options,available:w.available,price:w.price,compareAtPrice:w.compareAtPrice,unitPrice:w.unitPrice,image:w.image,inventoryQuantity:null}))}));if(!c.length)return;let u=c.filter(p=>p.available).length;if(n==="hide"&&u===0)return;let m=ie(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),f=le("lb-mix-match",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||a.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});f.root.setAttribute("data-required-quantity",String(l)),f.products.before(ze(l));let h=document.createElement("div");h.className="lb-mix-match__slots lb-edge-fade",h.setAttribute("data-selection-slots",""),f.products.replaceWith(h);let k=document.createElement("button");k.type="button",k.className="lb-mix-match__add-product",k.setAttribute("data-add-product-trigger",""),k.textContent=(a.addItem,"Add a product"),h.after(k);let L=rt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:!0,showTypeFilters:!1,segmentCount:l,wizard:!1});f.root.appendChild(L);let b=Nn(c,d,l),N={remainingSpots:()=>Mn(b,l),ownQty:p=>_n(b,p),variantUnitsElsewhere:p=>Ln(b,p),productUnitsElsewhere:(p,w)=>et(b,p,w),swapUnits:(p,w)=>_t(b,p,w,d),isInBundle:p=>ue(b,p)!==-1,canRemove:p=>{let w=ue(b,p);return w!==-1&&ke(b,b[w],d)},isFull:()=>wt(b,l),commitQty:(p,w)=>{let E=ue(b,p);return E===-1||b[E].quantity===w?!1:(b[E].quantity=w,!0)}};function O(){Pn(f.root,b,l,t,{formatMoney:m,rulesMap:d,onRemove:p=>{ke(b,b[p],d)&&(b.splice(p,1),O(),T.isOpen()&&T.refresh())},onEdit:()=>T.open()}),Bn(f.root,b,l,t,(p,w,E)=>Re(p,w,E),nt(m)),qn(f.root,T.overlay,b,l,a)}let T=In({container:f.root,data:{translations:a,discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},t:a,rulesMap:d,eligibleProducts:c,requiredQty:l,showQtySelector:!0,items:b,formatMoney:m,rowCapacity:N,dropdown:void 0,portalTarget:null,fallbackFocus:k,onSelectionChanged:O,addSelection:p=>{if(te(b)+(p.quantity||1)>l)return;let w=Y(p.productId,d).max-et(b,p.productId,p.variantId);(p.quantity||1)>w||(b.push(p),O())},removeVariant:p=>{let w=ue(b,p);w===-1||!ke(b,b[w],d)||(b.splice(w,1),O())},swapVariant:(p,w)=>{let E=0;for(let g=b.length-1;g>=0&&E<w;g--){let U=b[g];if(U.productId!==p.productId||U.variantId===p.variantId)continue;let F=Math.min(U.quantity||1,w-E);F>=(U.quantity||1)?b.splice(g,1):U.quantity=(U.quantity||1)-F,E+=F}E>0&&(p.quantity=E,b.push(p),O())},swapUnitsFor:(p,w)=>_t(b,p,w,d),isInBundle:p=>ue(b,p)!==-1,atCapacity:()=>wt(b,l)});k.addEventListener("click",()=>{T.isOpen()||T.open()}),f.cta.addEventListener("click",()=>{te(b)<l||r(b.map(p=>({merchandiseId:"gid://shopify/ProductVariant/"+p.variantId,quantity:p.quantity||1,attributes:ae(t.id,t.bundleType)})))}),e.appendChild(f.root),se(f.root),O(),o?.(be(f.root))}function vo(e,t,n){if(t==="fixed_amount"){let o=parseInt(n.getAttribute("data-tier-amt")??"",10)||0;return Math.max(0,e-o)}let r=parseInt(n.getAttribute("data-tier-pct")??"",10)||0;return Math.max(0,e-Math.floor(e*r/100))}function yo(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=vo(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function wo(e,t){if(!t.itemCount)return null;let n=new Intl.PluralRules(t.locale||"en").select(e);return" ("+(t.itemCount[n]||t.itemCount.other||"__COUNT__").split("__COUNT__").join(String(e))+")"}function Hn(e,t,n,r,o,i,a){for(let b=0;b<t.length;b++)t[b].setAttribute("aria-checked",b===o?"true":"false"),t[b].setAttribute("tabindex",b===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:c}=yo(n,r,t[o]),u=e.querySelector("[data-item-count]");if(u){let b=wo(l,i);b!==null&&(u.textContent=b)}let m=e.querySelector("[data-total-price]");m&&(m.textContent=a(d));let f=e.querySelector("[data-compare-price]");f&&(c>0?(f.textContent=a(s),f.style.display=""):f.style.display="none");let h=e.querySelector("[data-savings-bar]"),k=e.querySelector("[data-savings-amount]"),L=e.querySelector("[data-savings-percent]");if(h)if(c>0){if(k&&(k.textContent=a(c)),L){let b=s>0?Math.round(c*100/s):0;L.textContent="("+b+"%)"}h.style.display=""}else h.style.display="none"}function Dn(e,t,n,r){let o=t.widgetConfig,i=t.products[0];if(!i)return;let a=i.variants.nodes,l=a.find(p=>p.availableForSale)??a[0];if(!l)return;let d=a.some(p=>p.availableForSale);if(n==="hide"&&!d)return;let s=Oe(l.price.amount),c=t.discountConfig.discountType,u=ie(i.priceRange.minVariantPrice.currencyCode),m=de,f=o.popularBadge?.visible?Math.floor((t.volumeTiers.length-1)/2):-1,h=0,k=t.volumeTiers.map((p,w)=>{let E=c==="fixed_amount"?0:Math.round(p.percentage??0),g=c==="fixed_amount"?Math.round((p.amount??0)*100):0,U=c==="fixed_amount"?Math.max(0,s-g):Math.max(0,s-Math.floor(s*E/100)),F=s>0?Math.round((s-U)*100/s):0;return{quantity:p.minQuantity,percent:E,amountCents:g,label:K(m.buyQty||"Buy __COUNT__",{COUNT:p.minQuantity}),savingsLabel:F>0?"Save "+F+"%":null,badgeLabel:w===f?o.popularBadge?.text||"Most popular":null,selected:w===h}});if(!k.length)return;let L=le("lb-volume",{title:t.title,subtitle:t.description,summaryLabel:"Total",withItemCount:!0,totalPriceSlot:!0,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||m.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt}),b=dn(k,"Select quantity");L.products.replaceWith(b);let N=b.querySelectorAll("[data-tier-index]"),O=h,T=()=>Hn(L.root,N,s,c,O,m,u);if(b.addEventListener("click",p=>{let w=p.target.closest("[data-tier-index]");w&&(O=parseInt(w.getAttribute("data-tier-index")??"",10)||0,T())}),b.addEventListener("keydown",p=>{p.key==="ArrowDown"||p.key==="ArrowRight"?(p.preventDefault(),O=Math.min(O+1,N.length-1),T(),N[O].focus()):(p.key==="ArrowUp"||p.key==="ArrowLeft")&&(p.preventDefault(),O=Math.max(O-1,0),T(),N[O].focus())}),d)L.cta.addEventListener("click",()=>{let p=parseInt(N[O].getAttribute("data-tier-qty")??"",10);r([{merchandiseId:l.id,quantity:p,attributes:ae(t.id,t.bundleType)}])});else{L.cta.disabled=!0;let p=L.cta.querySelector("[data-cta-label]");p&&(p.textContent=m.outOfStock||"Out of stock")}e.appendChild(L.root),se(L.root),T()}function ot(e,t){return e-Math.floor(e*t/100)}function _o(e,t,n,r){let o=G(e[0],e[0].selectedVariantId),i=G(e[1],e[1].selectedVariantId),a=o.price*n+i.price*r,l=o.price*n+ot(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function Ct(e,t,n,r,o){let i=e.querySelector("[data-product-price]"),a=e.querySelector("[data-product-compare-price]");if(i){if(r&&n>0){i.textContent=o(ot(t.price,n)),a&&(a.textContent=o(t.price),a.hidden=!1);return}if(i.textContent=o(t.price),a){let l=t.compareAtPrice;l&&l>t.price?(a.textContent=o(l),a.hidden=!1):(a.textContent="",a.hidden=!0)}}}function kt(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=_o(t,n,r,o),s=e.querySelector("[data-sale-price]"),c=e.querySelector("[data-compare-price]"),u=e.querySelector("[data-savings-bar]"),m=e.querySelector("[data-savings-amount]"),f=e.querySelector("[data-savings-percent]");if(s&&(s.textContent=i(l)),c&&(d>0?(c.textContent=i(a),c.style.display=""):c.style.display="none"),u)if(d>0){if(m&&(m.textContent=i(d)),f){let h=a>0?Math.round(d*100/a):0;f.textContent="("+h+"%)"}u.style.display=""}else u.style.display="none"}function Fn(e,t,n,r){let o=G(e[0],e[0].selectedVariantId),i=G(e[1],e[1].selectedVariantId),a={variantId:Number(e[0].selectedVariantId),quantity:n,priceCents:(o.price||0)*n},l=ot(i.price||0,t)*r;return String(e[0].selectedVariantId)===String(e[1].selectedVariantId)?[{variantId:a.variantId,quantity:n+r,priceCents:(a.priceCents??0)+l}]:[a,{variantId:Number(e[1].selectedVariantId),quantity:r,priceCents:l}]}function Vn(e,t,n,r,o){let i=t.widgetConfig,a=t.products.find(N=>N.id===t.buyProductId),l=t.products.find(N=>N.id===t.getProductId);if(!a||!l)return;let d=t.buyQuantity,s=t.getQuantity,c=t.discountConfig.discountValue,u={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},m=[{...ye(a,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[0]??null}),role:"buy"},{...ye(l,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[1]??null}),role:"get"}],f=m.filter(N=>!N.variants.some(O=>O.available)).length;if(n==="hide"&&f>0)return;let h=ie(a.priceRange.minVariantPrice.currencyCode),k=de,L=le("lb-bogo",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||k.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});L.root.setAttribute("data-discount-value",String(c)),L.root.setAttribute("data-buy-qty",String(d)),L.root.setAttribute("data-get-qty",String(s));let b=c>=100?"Free":c+"% off";if(m.forEach((N,O)=>{let T=O===1,p=!N.variants.some(g=>g.available),w=Ue(N,k,{isOos:p,href:N.url,bogoRole:N.role,inlineQuantity:T?s:d,badgeText:T&&!p?b:null});if(L.products.appendChild(w),p)return;let E=G(N,N.selectedVariantId);Fe(w,N,E),Ve(w,E,N.featuredImage),Ct(w,E,c,T,h),De(w,()=>N,g=>{Ve(w,g,N.featuredImage),Ct(w,g,c,T,h),kt(L.root,m,c,d,s,h)})}),f>0){L.cta.disabled=!0;let N=L.cta.querySelector("[data-cta-label]");N&&(N.textContent=(k.itemsOutOfStock||"__COUNT__ items out of stock").split("__COUNT__").join(String(f)))}else L.cta.addEventListener("click",()=>{r(Fn(m,c,d,s).map(N=>({merchandiseId:"gid://shopify/ProductVariant/"+N.variantId,quantity:N.quantity,attributes:ae(t.id,t.bundleType)})))});e.appendChild(L.root),se(L.root),kt(L.root,m,c,d,s,h),o?.(be(L.root))}function St(e,t,n){return K(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function Me(e,t,n){return K(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Un(e,t,n){return K(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function zn(e,t){return e>0?K(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function he(e,t){let n=0;for(let r=0;r<e[t].length;r++)n+=e[t][r].quantity||1;return n}function xe(e,t,n){return he(e,n)>=(t[n].minQuantity||1)}function Se(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-he(e,n))}function Le(e,t){for(let n=0;n<t.length;n++)if(!xe(e,t,n))return!1;return!0}function Pe(e,t,n){let r=Y(t.productId,n);if(!r.required)return!0;let o=0;for(let i of e)for(let a of i)a!==t&&a.productId===t.productId&&(o+=a.quantity||1);return o>=r.min}function Tt(e,t,n,r,o){let i=Y(n,o);if(!i.required||i.max!==i.min||ve(e,t,r)!==-1)return 0;let a=0;for(let l of e[t])l.productId===n&&l.variantId!==r&&(a+=l.quantity||1);return a}function ve(e,t,n){for(let r=0;r<e[t].length;r++)if(e[t][r].variantId===n)return r;return-1}function Qn(e){let{container:t,steps:n,selections:r,t:o}=e;for(let i=0;i<n.length;i++){let a=n[i].minQuantity||1,l=t.querySelector('[data-step-count="'+i+'"]');l&&(l.textContent=Me(Math.min(he(r,i),a),a,o),l.classList.toggle("lb-multi-step__group-count--met",xe(r,n,i)));let d=t.querySelector('[data-step-slots="'+i+'"]');if(d){d.innerHTML="";for(let s=0;s<r[i].length;s++){let c=i,u=s,m=r[c][u];d.appendChild(tt(m,o,e.formatMoney,Pe(r,m,e.rulesMap),()=>e.onRemove(c,u),()=>e.onEdit(c)))}}}for(let i=0;i<n.length;i++){let a=t.querySelector('[data-step-trigger="'+i+'"]');a&&(a.style.display=Se(r,n,i)===0?"none":"")}}function Wn(e,t,n,r){let{container:o,steps:i,selections:a}=e,l=o.querySelector("[data-pricing-section]");if(!Le(a,i)){l&&(l.style.display="none");return}l&&(l.style.display="");let d=0;for(let s of a)for(let c of s)d+=c.price*(c.quantity||1);d>0&&t.discountType&&r(o,n(d,t.discountType,t.discountValue??0),d)}function jn(e){let{container:t,steps:n,selections:r,t:o}=e,i=0;for(let u=0;u<n.length;u++)xe(r,n,u)&&(i+=1);let a=n.length-i,l=t.querySelectorAll("[data-progress] [data-progress-segment]");for(let u=0;u<l.length;u++)l[u].classList.toggle("lb-mix-match__progress-segment--filled",u<i);let d=t.querySelector("[data-progress-count]");d&&(d.textContent=Un(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=zn(a,o));let c=t.querySelector(".lb-mix-match__progress-segments");c&&c.setAttribute("aria-valuenow",String(i))}function $n(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Le(e.selections,e.steps);let n=t.querySelector("[data-cta-label]");n&&(n.textContent=t.getAttribute("data-cta-text")||e.t.addToCart||"Add to cart")}function Gn(e){let t=Object.create(null),n=[];for(let r of e)for(let o of r){let i=o.quantity||1,a=String(o.variantId);t[a]?(t[a].quantity+=i,t[a].priceCents=(t[a].priceCents??0)+(o.price||0)*i):(t[a]={variantId:o.variantId,quantity:i,priceCents:(o.price||0)*i},n.push(a))}return n.map(r=>t[r])}var Be="__all__",Co=300,ko=200;function Kn(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-modal-overlay]");i&&e.portalTarget&&e.portalTarget.appendChild(i);let a=_=>i?i.querySelector(_):null,l=a('[role="dialog"]'),d=a(".lb-mix-match__modal-title"),s=a("[data-modal-search]"),c=a("[data-modal-search-clear]"),u=a("[data-modal-list]"),m=a("[data-modal-empty]"),f=a("[data-modal-live]"),h=a("[data-modal-close]"),k=a("[data-modal-back]"),L=a("[data-modal-next]"),b=a("[data-modal-done]"),N=a("[data-modal-footer-count]"),O=a("[data-modal-subtitle]"),T=a("[data-modal-step-segments]"),p=a("[data-modal-filters]"),w=Be,E=!1,g=0,U=[],F=_=>n[_].eligibleProducts||[],D={remainingSpots:()=>Se(r,n,g),ownQty:_=>{let y=ve(r,g,_);return y===-1?0:r[g][y].quantity||0},variantUnitsElsewhere:_=>{let y=0;for(let P of r)for(let M of P)M.variantId===_&&(y+=M.quantity||0);return y},productUnitsElsewhere:(_,y)=>{let P=0;for(let M=0;M<r.length;M++)for(let S of r[M])S.productId===_&&(M===g&&S.variantId===y||(P+=S.quantity||0));return P},swapUnits:(_,y)=>Tt(r,g,_,y,e.rulesMap),isInBundle:_=>ve(r,g,_)!==-1,canRemove:_=>{let y=ve(r,g,_);return y!==-1&&e.canRemove(r[g][y])},isFull:()=>Se(r,n,g)===0,commitQty:(_,y)=>{let P=ve(r,g,_);return P===-1||r[g][P].quantity===y?!1:(r[g][P].quantity=y,!0)}};function Z(_){if(!T)return;let y=n[_].minQuantity||1;T.innerHTML="",T.setAttribute("aria-valuemax",String(y));for(let P=0;P<y;P++){let M=document.createElement("span");M.className="lb-mix-match__progress-segment",M.setAttribute("data-progress-segment",""),T.appendChild(M)}J()}function J(){if(!T)return;let _=n[g].minQuantity||1,y=Math.min(he(r,g),_),P=T.querySelectorAll("[data-progress-segment]");for(let M=0;M<P.length;M++)P[M].classList.toggle("lb-mix-match__progress-segment--filled",M<y);T.setAttribute("aria-valuenow",String(y))}function ne(){let _=n[g].minQuantity||1,y=Math.min(he(r,g),_);N&&(N.textContent=Me(y,_,o)),O&&(O.textContent=St(g,n.length,o)+" \xB7 "+(n[g].name||""));let P=xe(r,n,g),M=g===n.length-1;k&&(k.style.display=g>0?"":"none"),L&&(L.style.display=M?"none":"",L.disabled=!P),b&&(b.style.display=M?"":"none",b.disabled=!P),J()}function W(){for(let _ of U)_.refresh();ne()}function j(_){if(!u)return;e.dropdown?.unbindAll(u),u.innerHTML="",U=[];let y=F(_);for(let P=0;P<y.length;P++){let M=Ye(y[P],P,{t:o,rulesMap:e.rulesMap,capacity:D,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),W()}});U.push(M),u.appendChild(M.el)}e.dropdown?.bindAll(u)}function B(_){let y=_.target.closest("[data-add-product]");if(!y||y.disabled)return;let M=F(g)[parseInt(y.getAttribute("data-add-product")??"",10)];if(!M)return;let S=y.closest(".lb-mix-match__modal-product"),R=S&&S.getAttribute("data-selected-variant-id"),H=(R?M.variants.find(me=>me.id===parseInt(R,10)):null)??null;if(H||(H=M.variants.find(me=>me.available)??null),!H)return;let V=ve(r,g,H.id);if(V!==-1){if(!e.canRemove(r[g][V]))return;r[g].splice(V,1),e.onSelectionChanged(),W();return}let $=S?.querySelector("[data-row-qty]"),X=$?Math.max(1,parseInt($.getAttribute("data-qty")||$.textContent||"",10)||1):Ge(M.id,e.rulesMap),pe={productId:M.id,variantId:H.id,title:M.title,url:M.url||null,variantTitle:H.title,featuredImage:H.image||M.featuredImage||null,price:H.price,compareAtPrice:H.compareAtPrice||null,unitPrice:H.unitPrice||null,quantity:X},Te=Tt(r,g,M.id,H.id,e.rulesMap);if(Te>0){e.swapVariant(g,pe,Math.min(X,Te)),W();return}let ce=Se(r,n,g);ce!==1/0&&X>ce||(r[g].push(pe),e.onSelectionChanged(),W())}u&&u.addEventListener("click",B);function C(_){if(!p||!e.showTypeFilters)return;let y=[],P=Object.create(null);for(let M of F(_)){let S=(M.type||"").trim();S&&!P[S]&&(P[S]=!0,y.push(S))}if(y.length<2){p.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}p.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),p.innerHTML="";for(let M of[Be,...y]){let S=document.createElement("button");S.type="button",S.className="lb-mix-match__filter",S.setAttribute("data-filter",M),S.setAttribute("aria-pressed",M===w?"true":"false"),M===w&&S.classList.add("lb-mix-match__filter--active"),S.textContent=M===Be?o.allTypes||"All":M,S.addEventListener("click",()=>{w=M,x(),A(s?s.value:"")}),p.appendChild(S)}}function x(){if(!p)return;let _=p.querySelectorAll("[data-filter]");for(let y=0;y<_.length;y++){let P=_[y].getAttribute("data-filter")===w;_[y].classList.toggle("lb-mix-match__filter--active",P),_[y].setAttribute("aria-pressed",P?"true":"false")}}function A(_){if(!u)return;let y=Ce(_),P=u.querySelectorAll("[data-product-item]"),M=0;for(let S=0;S<P.length;S++){let R=P[S].getAttribute("data-title")??"",H=P[S].getAttribute("data-type")||"",V=(!y||R.indexOf(y)!==-1)&&(w===Be||H===w);P[S].classList.toggle("lb-hidden",!V),V&&M++}m&&(m.style.display=M===0&&y.length>0?"":"none"),c&&(c.style.display=_.length>0?"":"none"),f&&(f.textContent=K(o.nProductsShown||"__COUNT__ products shown",{COUNT:M}))}if(s){let _=Ke(()=>A(s.value),ko);s.addEventListener("input",_)}c&&c.addEventListener("click",()=>{s&&(s.value="",A(""),s.focus())});function v(_,y={}){if(g=Math.max(0,Math.min(n.length-1,_)),j(g),C(g),w=Be,x(),s&&(s.value=""),A(""),Z(g),W(),f){let P=n[g].minQuantity||1;f.textContent=St(g,n.length,o)+". "+(n[g].name||"")+". "+Me(Math.min(he(r,g),P),P,o)}!y.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function I(_){!i||E||(E=!0,v(typeof _=="number"?_:0,{skipFocus:!0}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),Xe(),setTimeout(()=>{s?s.focus():l?.focus()},50))}function z(){if(!i||!E)return;E=!1,i.classList.remove("lb-mix-match__modal-overlay--open"),Ze(),setTimeout(()=>{E||(i.style.display="none")},Co);let _=t.querySelector('[data-step-trigger="'+g+'"]'),y=_&&_.offsetParent!==null?_:e.ctaButton;y&&typeof y.focus=="function"&&setTimeout(()=>y.focus(),0)}if(h?.addEventListener("click",z),b?.addEventListener("click",z),k?.addEventListener("click",()=>{g>0&&v(g-1)}),L?.addEventListener("click",()=>{g<n.length-1&&xe(r,n,g)&&v(g+1)}),i){let _=null;i.addEventListener("mousedown",y=>{_=y.target}),i.addEventListener("mouseup",y=>{y.target===i&&_===i&&z(),_=null})}return document.addEventListener("keydown",_=>{if(E){if(_.key==="Escape"){_.preventDefault(),z();return}if(_.key==="Tab"&&l){let y=Je(l);if(y.length===0){_.preventDefault();return}let P=y[0],M=y[y.length-1];_.shiftKey&&document.activeElement===P?(_.preventDefault(),M.focus()):!_.shiftKey&&document.activeElement===M&&(_.preventDefault(),P.focus())}}}),{open:I,close:z,isOpen:()=>E,refresh:W}}function Yn(e,t,n,r,o){let i=t.widgetConfig,a=de,l=t.productRules??{},d=t.steps??[];if(!d.length)return;let s={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},c=d.map((T,p)=>Yt(t,p).map(w=>{let E=ye(w,t.id,{quantities:s,allowedVariantIds:null});return{id:Number(E.productId),title:E.title??"",url:E.url??null,type:w.productType??"",featuredImage:E.featuredImage??null,available:E.variants.some(g=>g.available),optionNames:E.optionNames,variants:E.variants.map(g=>({id:Number(g.id),title:g.title,options:g.options,available:g.available,price:g.price,compareAtPrice:g.compareAtPrice,unitPrice:g.unitPrice,image:g.image,inventoryQuantity:null}))}})),u=c.some(T=>T.some(p=>p.available));if(n==="hide"&&!u)return;let m=ie(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),f=le("lb-multi-step",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||a.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});f.products.before(ze(d.length));let h=document.createElement("div");h.className="lb-multi-step__groups",d.forEach((T,p)=>{let w=document.createElement("div");w.className="lb-multi-step__group",w.setAttribute("data-step-group",String(p));let E=document.createElement("div");E.className="lb-multi-step__group-heading";let g=document.createElement("span");g.className="lb-multi-step__group-name",g.textContent=T.name,E.appendChild(g);let U=document.createElement("span");U.className="lb-multi-step__group-count",U.setAttribute("data-step-count",String(p)),E.appendChild(U),w.appendChild(E);let F=document.createElement("div");F.className="lb-mix-match__slots lb-edge-fade",F.setAttribute("data-step-slots",String(p)),w.appendChild(F);let D=document.createElement("button");D.type="button",D.className="lb-mix-match__add-product",D.setAttribute("data-step-trigger",String(p)),D.textContent="Add a product",w.appendChild(D),h.appendChild(w)}),f.products.replaceWith(h);let k=rt({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:!0,showTypeFilters:!0,segmentCount:null,wizard:!0});f.root.appendChild(k);let L=d.map(()=>[]),b={container:f.root,steps:d.map((T,p)=>({name:T.name,minQuantity:T.minQuantity,maxQuantity:T.maxQuantity,eligibleProducts:c[p]})),selections:L,t:a,rulesMap:l,formatMoney:m,onRemove:(T,p)=>{let w=L[T][p];!w||!Pe(L,w,l)||(L[T].splice(p,1),N(),O.isOpen()&&O.refresh())},onEdit:T=>O.open(T)};function N(){Qn(b),Wn(b,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(T,p,w)=>Re(T,p,w),nt(m)),jn(b),$n(b)}let O=Kn({container:f.root,steps:b.steps,selections:L,t:a,rulesMap:l,showQtySelector:!0,showTypeFilters:!0,formatMoney:m,dropdown:void 0,portalTarget:null,ctaButton:f.cta,onSelectionChanged:N,swapVariant:(T,p,w)=>{let E=0,g=L[T];for(let U=g.length-1;U>=0&&E<w;U--){let F=g[U];if(F.productId!==p.productId||F.variantId===p.variantId)continue;let D=Math.min(F.quantity||1,w-E);D>=(F.quantity||1)?g.splice(U,1):F.quantity=(F.quantity||1)-D,E+=D}E>0&&(p.quantity=E,g.push(p),N())},canRemove:T=>Pe(L,T,l)});f.root.querySelectorAll("[data-step-trigger]").forEach(T=>{T.addEventListener("click",()=>{O.isOpen()||O.open(parseInt(T.getAttribute("data-step-trigger")??"",10)||0)})}),f.cta.addEventListener("click",()=>{Le(L,b.steps)&&r(Gn(L).map(T=>({merchandiseId:"gid://shopify/ProductVariant/"+T.variantId,quantity:T.quantity,attributes:ae(t.id,t.bundleType)})))}),e.appendChild(f.root),se(f.root),N(),o?.(be(f.root))}var So=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),it=new Set,at=!1;function Jn(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of it)n.classList.add(e),n.classList.remove(t)}function Xn(e){So.has(e.key)&&Jn("using-keyboard")}function Zn(){Jn("using-mouse")}function To(){at||(at=!0,document.addEventListener("keydown",Xn,!0),document.addEventListener("pointerdown",Zn,!0))}function Eo(){at&&(at=!1,document.removeEventListener("keydown",Xn,!0),document.removeEventListener("pointerdown",Zn,!0))}function lt(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),it.add(e),To(),()=>{it.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),it.size===0&&Eo()}}var Et=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
|
|
241
|
+
`;var gt="show_greyed_out";function en(e){return e==="hide"?"hide":gt}var ae=class extends Error{constructor(e,t){super(e),this.reason=t,this.name="BundleParseError"}},Rt={none:0,subtle:6,rounded:12,round:18},ie={header:{countdownBgColor:"#B4DC7F47",countdownTextColor:"#555555"},layout:{backgroundColor:"#FCFCFC",borderColor:"#E5E5E5",borderWidth:1,borderRadius:"subtle"},productList:{textColor:"#555555",thumbnailRatio:"square",showPrice:!0,showCompareAtPrice:!0,showUnitPrice:!0,showQuantity:!0},pricing:{showComparePrice:!0,showPerUnitPrice:!0,showItemCount:!0,showCompareAtPrice:!0},cta:{ctaText:"Add to cart",primaryColor:"#B4DC7F",buttonTextColor:"#555555",borderWidth:0,borderColor:"#B4DC7F"},savingsBar:{visible:!0},countdown:{showCountdown:!0},popularBadge:{visible:!0,text:"Most Popular",bgColor:"#1A1A1A",textColor:"#FFFFFF",borderWidth:0,borderColor:"#1A1A1A"},showLowStockBadge:!0,lowStockThreshold:10,lowStockBgColor:"#FEF3C7",lowStockTextColor:"#92400E",showSearch:!0,mixMatchShowTypeFilters:!0,mixMatchShowQuantitySelector:!0,pickerBgColor:"#FCFCFC",pickerTextColor:"#555555",pickerBorderWidth:1,pickerBorderColor:"#E5E5E5",pickerBorderRadius:"subtle",pickerThumbnailRatio:"square",pickerAddBgColor:"#B4DC7F",pickerAddLabelColor:"#555555",pickerAddBorderWidth:0,pickerAddBorderColor:"#B4DC7F",defaultTier:"first"};function Ar(e){if(!e||typeof e!="object")return ie;let t=e;return{...ie,...t,defaultTier:Lr(t.defaultTier),pickerBorderRadius:Nt(t.pickerBorderRadius),header:{...ie.header,...t.header??{}},layout:{...ie.layout,...t.layout??{},borderRadius:Nt(t.layout?.borderRadius)},productList:{...ie.productList,...t.productList??{}},pricing:{...ie.pricing,...t.pricing??{}},cta:{...ie.cta,...t.cta??{}},savingsBar:{...ie.savingsBar,...t.savingsBar??{}},countdown:{...ie.countdown,...t.countdown??{}},popularBadge:{...ie.popularBadge,...t.popularBadge??{}}}}function Lr(e){return e==="first"||e==="best_value"||typeof e=="number"&&Number.isInteger(e)&&e>=0?e:ie.defaultTier}function Nt(e){return e==="none"||e==="subtle"||e==="rounded"||e==="round"?e:ie.layout.borderRadius}function Pr(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,borderRadius:Rt[e.layout.borderRadius],countdownBgColor:e.header.countdownBgColor,countdownTextColor:e.header.countdownTextColor,thumbnailRatio:e.productList.thumbnailRatio,showProductPrice:e.productList.showPrice,showProductCompareAtPrice:e.productList.showCompareAtPrice,showProductUnitPrice:e.productList.showUnitPrice,showProductQuantity:e.productList.showQuantity,showCountdown:e.countdown.showCountdown,ctaText:e.cta.ctaText,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,showSearch:e.showSearch,mixMatchShowTypeFilters:e.mixMatchShowTypeFilters,pickerBgColor:e.pickerBgColor,pickerTextColor:e.pickerTextColor,pickerBorderWidth:e.pickerBorderWidth,pickerBorderColor:e.pickerBorderColor,pickerBorderRadius:Rt[e.pickerBorderRadius],pickerThumbnailRatio:e.pickerThumbnailRatio,pickerAddBgColor:e.pickerAddBgColor,pickerAddLabelColor:e.pickerAddLabelColor,pickerAddBorderWidth:e.pickerAddBorderWidth,pickerAddBorderColor:e.pickerAddBorderColor,defaultTier:e.defaultTier,...e.popularBadge.tierIndex!==void 0&&{mostPopularTierIndex:e.popularBadge.tierIndex}}}var Br={primaryColor:"--lb-primary-color",backgroundColor:"--lb-bg",textColor:"--lb-text",borderColor:"--lb-border",borderWidth:"--lb-border-width",buttonTextColor:"--lb-btn-text",borderRadius:"--lb-radius",countdownBgColor:"--lb-countdown-bg",countdownTextColor:"--lb-countdown-text",ctaBorderWidth:"--lb-cta-border-width",ctaBorderColor:"--lb-cta-border-color",popularBadgeBgColor:"--lb-popular-badge-bg",popularBadgeTextColor:"--lb-popular-badge-text",popularBadgeBorderWidth:"--lb-popular-badge-border-width",popularBadgeBorderColor:"--lb-popular-badge-border-color",pickerBgColor:"--lb-picker-bg",pickerTextColor:"--lb-picker-text",pickerBorderWidth:"--lb-picker-border-width",pickerBorderColor:"--lb-picker-border-color",pickerBorderRadius:"--lb-picker-radius",pickerAddBgColor:"--lb-picker-add-bg",pickerAddLabelColor:"--lb-picker-add-label",pickerAddBorderWidth:"--lb-picker-add-border-width",pickerAddBorderColor:"--lb-picker-add-border-color"},qr=new Set(["borderRadius","borderWidth","ctaBorderWidth","popularBadgeBorderWidth","pickerBorderWidth","pickerBorderRadius","pickerAddBorderWidth"]);function tn(e,t){let n=Pr(t);for(let[i,a]of Object.entries(Br)){let l=n[i];if(l==null)continue;let d=qr.has(i)?`${l}px`:String(l);e.style.setProperty(a,d)}e.style.setProperty("--lb-product-price-display",t.productList.showPrice?"block":"none"),e.style.setProperty("--lb-product-compare-display",t.productList.showCompareAtPrice?"inline":"none"),e.style.setProperty("--lb-product-unit-price-display",t.productList.showUnitPrice?"block":"none"),e.style.setProperty("--lb-product-qty-chip-display",t.productList.showQuantity?"inline-flex":"none"),e.style.setProperty("--lb-product-qty-inline-display",t.productList.showQuantity?"inline":"none"),e.style.setProperty("--lb-variant-chevron",Ot(t.layout.borderColor)),e.style.setProperty("--lb-picker-variant-chevron",Ot(t.pickerBorderColor));let r=Ht(t.productList.thumbnailRatio);e.style.setProperty("--lb-thumbnail-aspect-ratio",r.aspectRatio),e.style.setProperty("--lb-thumbnail-img-fit",r.imgFit),e.style.setProperty("--lb-thumbnail-img-height",r.imgHeight);let o=Ht(t.pickerThumbnailRatio);e.style.setProperty("--lb-picker-thumbnail-aspect-ratio",o.aspectRatio),e.style.setProperty("--lb-picker-thumbnail-img-fit",o.imgFit),e.style.setProperty("--lb-picker-thumbnail-img-height",o.imgHeight)}function Ot(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 Ht(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 Rr=new Set(["fixed","mix_match","volume","bogo","multi_step"]),Nr=new Set(["active"]);function xt(e,t){try{return Or(e,t)}catch(n){if(n instanceof ae)return null;throw n}}function Or(e,t){let n=new Map(t.map(_=>[_.key,_])),r=n.get("title")?.value??"Bundle",o=n.get("bundle_type")?.value,i=n.get("status")?.value;if(!o||!Rr.has(o))throw new ae(`Invalid or missing bundle_type: ${o??"null"}`,"invalid_type");let a=o;if(!i||!Nr.has(i))throw new ae(`Bundle is not active: status=${i??"null"}`,"inactive");let l=i,d=n.get("starts_at")?.value??null,s=n.get("ends_at")?.value??null,c=new Date;if(d){let _=new Date(d);if(Number.isNaN(_.getTime()))throw new ae(`Invalid starts_at: ${d}`,"invalid_type");if(_>c)throw new ae(`Bundle not yet started: starts_at=${d}`,"not_started")}if(s){let _=new Date(s);if(Number.isNaN(_.getTime()))throw new ae(`Invalid ends_at: ${s}`,"invalid_type");if(_<c)throw new ae(`Bundle has expired: ends_at=${s}`,"expired")}let u=Vr(n),p=Ur(n),x=zr(n),b={id:e,title:r,description:n.get("description")?.value||null,status:l,products:u,discountConfig:p,widgetConfig:x,startsAt:d,endsAt:s,discountLabel:n.get("discount_label")?.value??null,selectedVariantIds:Qr(n),productQuantities:Dt(n,"product_quantities"),variantQuantities:Dt(n,"variant_quantities"),marketVisibility:Wr(n),marketIds:jr(n),abTestId:n.get("ab_test_id")?.value||null,abWeight:$r(n)};switch(a){case"fixed":return{...b,bundleType:"fixed"};case"volume":return{...b,bundleType:"volume",volumeTiers:Gr(n)};case"mix_match":return{...b,bundleType:"mix_match",minQuantity:Yr(n,"min_quantity",{min:1}),maxQuantity:null,productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules")};case"bogo":return{...b,bundleType:"bogo",...Fr(n)};case"multi_step":return{...b,bundleType:"multi_step",steps:Hr(n),productRules:Oe(n,"product_rules"),variantRules:Oe(n,"variant_rules"),collectionProductIds:Dr(n)}}}function Hr(e){let t=xe(e,"steps");if(!Array.isArray(t))throw new ae("Invalid or missing steps","invalid_type");let n=o=>Array.isArray(o)?o.filter(i=>typeof i=="string"):[],r=[];for(let o of t){if(!o||typeof o!="object"||Array.isArray(o))continue;let i=o;if(typeof i.name!="string")continue;let a=typeof i.minQuantity=="number"?i.minQuantity:Number(i.minQuantity),l=Number.isFinite(a)&&a>=1?Math.floor(a):1,d=null;typeof i.maxQuantity=="number"&&Number.isFinite(i.maxQuantity)&&(d=Math.max(l,Math.floor(i.maxQuantity))),r.push({name:i.name,minQuantity:l,maxQuantity:d,productIds:n(i.productIds),collectionIds:n(i.collectionIds)})}if(r.length===0)throw new ae("multi_step bundle has no valid steps","invalid_type");return r}function Dr(e){let t={},n=e.get("collection");if(!n?.references?.nodes)return t;for(let r of n.references.nodes)!("products"in r)||!r.products?.nodes||(t[r.id]=r.products.nodes.map(o=>o.id));return t}function Fr(e){let t=xe(e,"bogo_config");if(!t||typeof t!="object"||Array.isArray(t))throw new ae("Invalid or missing bogo_config","invalid_type");let n=t,r=typeof n.buyProductId=="string"?n.buyProductId:"",o=typeof n.getProductId=="string"?n.getProductId:"";if(!r||!o)throw new ae("bogo_config is missing buy/get product ids","invalid_type");let i=a=>{let l=typeof a=="number"?a:Number(a);return!Number.isFinite(l)||l<1?1:Math.min(99,Math.floor(l))};return{buyProductId:r,getProductId:o,buyQuantity:i(n.buyQuantity),getQuantity:i(n.getQuantity)}}function Vr(e){let t=[],n=e.get("products");if(n?.reference&&"variants"in n.reference&&t.push(n.reference),n?.references?.nodes)for(let o of n.references.nodes)"variants"in o?t.push(o):"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);let r=e.get("collection");if(r?.references?.nodes)for(let o of r.references.nodes)"products"in o&&o.products?.nodes&&t.push(...o.products.nodes);return t}function Ur(e){return{discountType:e.get("discount_type")?.value??"percentage",discountValue:parseFloat(e.get("discount_value")?.value??"0"),allowStacking:e.get("allow_stacking")?.value==="true"}}function zr(e){return Ar(xe(e,"widget_config"))}function Qr(e){let t=xe(e,"selected_variant_ids");if(!Array.isArray(t))return null;let n=[];for(let r of t)Array.isArray(r)?n.push(r.filter(o=>typeof o=="string")):n.push([]);return n}function Dt(e,t){let n=xe(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){let a=typeof i=="number"?i:Number(i);Number.isFinite(a)&&a>=0&&a<=99&&(r[o]=Math.floor(a))}return r}function Oe(e,t){let n=xe(e,t);if(!n||typeof n!="object"||Array.isArray(n))return{};let r={};for(let[o,i]of Object.entries(n)){if(!i||typeof i!="object"||Array.isArray(i))continue;let{min:a,max:l,required:d}=i,s=typeof a=="number"?a:Number(a),c=typeof l=="number"?l:Number(l);if(!Number.isFinite(s)||!Number.isFinite(c))continue;let u=Math.max(1,Math.min(99,Math.floor(s))),p=Math.max(u,Math.min(99,Math.floor(c)));r[o]=d===!0?{min:u,max:p,required:!0}:{min:u,max:p}}return r}function Wr(e){return e.get("market_visibility")?.value==="specific"?"specific":"all"}function jr(e){let t=e.get("markets")?.value;if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}function $r(e){let t=e.get("ab_weight")?.value;if(!t)return 0;let n=Number.parseInt(t,10);return Number.isNaN(n)?0:Math.min(100,Math.max(0,n))}function Gr(e){let t=xe(e,"volume_tiers");return Array.isArray(t)?t.filter(n=>typeof n=="object"&&n!==null).map(Kr):[]}function Kr(e){let t=Number(e.minQuantity??0),n={minQuantity:Number.isFinite(t)&&t>=0?t:0};return typeof e.percentage=="number"&&Number.isFinite(e.percentage)&&(n.percentage=e.percentage),typeof e.amount=="number"&&Number.isFinite(e.amount)&&(n.amount=e.amount),n}function xe(e,t){let n=e.get(t)?.value;if(!n)return null;try{return JSON.parse(n)}catch{return null}}function Yr(e,t,n={}){let r=e.get(t)?.value;if(!r)return null;let o=parseInt(r,10);return isNaN(o)||n.min!==void 0&&o<n.min?null:o}function nn(e,t){let n=0,r=0;for(let o=0;o<e.length;o++){let i=t==="fixed_amount"?e[o].amount??0:e[o].percentage??0;i>n&&(n=i,r=o)}return r}function rn(e,t,n){return t<=0?0:e==="best_value"?Math.min(n,t-1):Math.max(0,Math.min(Math.floor(typeof e=="number"?e:0),t-1))}function on(e,t,n){return t?typeof e=="number"&&Number.isFinite(e)?Math.floor(e):n:-1}function Ft(e){return e.split("/").pop()??e}function an(e,t){if(e.marketVisibility!=="specific")return!0;if(!t)return!1;let n=Ft(t);return e.marketIds.some(r=>Ft(r)===n)}function vt(e,t,n){let r=e.variantQuantities[n];return r!==void 0?r:e.productQuantities[t]??1}function ln(e,t){let n=e.steps[t];if(!n)return[];let r=new Set(n.productIds),o=new Set;for(let l of n.collectionIds)for(let d of e.collectionProductIds[l]??[])o.add(d);let i=new Set,a=[];for(let l of e.products)i.has(l.id)||!r.has(l.id)&&!o.has(l.id)||(i.add(l.id),a.push(l));return a}async function sn(e,t){await un(e,{shopDomain:e.shopDomain,eventType:"bundle_impression",bundleGid:t.bundleGid,bundleType:t.bundleType,productId:t.productId,occurredAt:new Date().toISOString()})}async function dn(e,t){await un(e,{shopDomain:e.shopDomain,eventType:"bundle_add_to_cart",...t,occurredAt:new Date().toISOString()})}function cn(e,t){if(typeof IntersectionObserver>"u")return t(),()=>{};let n=new IntersectionObserver(r=>{for(let o of r)o.isIntersecting&&(t(),n.unobserve(o.target))},{threshold:.5});return n.observe(e),()=>n.disconnect()}async function un(e,t){let n=`${e.appUrl}/api/analytics`,r=JSON.stringify(t);try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r})).ok||(await new Promise(i=>setTimeout(i,2e3)),await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:r}))}catch{try{typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(n,r)}catch{}}}var Vt=1e4,Jr=[[/@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"]],Xr=/^(https:|\/[^/]|\.\/|\.\.\/|#)/;function yt(e){if(e.length>Vt)return{ok:!1,error:`CSS exceeds ${Vt.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,(o,i)=>{let a=parseInt(i,16);return a<0||a>1114111?"\uFFFD":String.fromCodePoint(a)}),t=t.replace(/\\\r?\n/g,""),t=t.replace(/\\([^\n\r\f0-9a-fA-F])/g,"$1")}catch{return{ok:!1,error:"CSS contains invalid unicode escape sequences"}}t=t.replace(/</g,"").replace(/>/g,"");for(let[o,i]of Jr)if(o.test(t))return{ok:!1,error:`CSS contains blocked pattern: ${i}`};let n=/url\s*\(\s*([\s\S]*?)\s*\)/gi,r;for(;(r=n.exec(t))!==null;){let o=r[1].trim();if((o.startsWith("'")||o.startsWith('"'))&&(o=o.slice(1)),(o.endsWith("'")||o.endsWith('"'))&&(o=o.slice(0,-1)),o=o.trim(),o&&!Xr.test(o))return{ok:!1,error:"CSS url() values must use https:// or relative paths"}}return{ok:!0,css:t}}var Zr="lb-custom-css-";function pn(e,t){if(typeof document>"u"||!t)return!1;let n=yt(t);if(!n.ok||!n.css.trim())return!1;let r=Zr+eo(e),o=document.getElementById(r);return o||(o=document.createElement("style"),o.id=r,o.setAttribute("data-lime-bundles","custom-css"),document.head.appendChild(o)),o.textContent!==n.css&&(o.textContent=n.css),!0}function eo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function to(e,t){let n=typeof e=="string"?parseFloat(e):e;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(n)}catch{return`${t} ${n.toFixed(2)}`}}function De(e,t,n){return t==="percentage"?Math.max(0,e*(1-n/100)):Math.max(0,e-n)}var no={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 mn(e,t,n){if(!e||!t||t.referenceUnit==="UNKNOWN")return null;let r=parseFloat(e.amount);if(!Number.isFinite(r))return null;let o=no[t.referenceUnit]??"";if(!o)return null;let i=e.currencyCode||n||"USD",a=to(r,i),l=t.referenceValue,d=l===1?o:`${l}${o}`;return`${a}/${d}`}var ve={};jt(ve,{computePosition:()=>oo,emptyTypeAheadState:()=>co,firstEnabled:()=>He,handleKey:()=>lo,pushTypeAheadChar:()=>uo});var ro=4;function oo({trigger:e,viewportHeight:t,desiredHeight:n,margin:r=ro,clip:o}){let i=o?Math.min(t,o.bottom):t,a=o?Math.max(0,o.top):0,l=Math.max(0,i-e.bottom-r),d=Math.max(0,e.top-a-r),s=n<=l?"down":d>l?"up":"down",u=Math.min(n,s==="down"?l:d),p=s==="down"?e.bottom+r:e.top-r-u;return{placement:s,maxHeight:u,offsetTop:p,offsetLeft:e.left,width:e.width}}var bt={type:"passthrough",preventDefault:!1};function He(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Ut(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function io(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r].disabled)return r}return t}function ao(e,t){if(e.length===0)return-1;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r].disabled)return r}return t}function zt(e){return e.length===1&&e!==" "&&/\S/.test(e)}function lo(e,t){if(e.ctrlKey||e.metaKey||e.altKey)return bt;let{key:n}=e,{isOpen:r,activeIndex:o,selectedIndex:i,options:a}=t;if(!r)switch(n){case"Enter":case" ":case"ArrowDown":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:He(a),preventDefault:!0};case"ArrowUp":return{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:Ut(a),preventDefault:!0};default:return zt(n)?{type:"open",activeIndex:i>=0&&!a[i]?.disabled?i:He(a),preventDefault:!0}:bt}switch(n){case"ArrowDown":return{type:"move-active",activeIndex:io(a,o),preventDefault:!0};case"ArrowUp":return{type:"move-active",activeIndex:ao(a,o),preventDefault:!0};case"Home":return{type:"move-active",activeIndex:He(a),preventDefault:!0};case"End":return{type:"move-active",activeIndex:Ut(a),preventDefault:!0};case"Enter":case" ":return o>=0&&!a[o]?.disabled?{type:"commit",index:o,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 zt(n)?{type:"type-ahead",char:n,preventDefault:!1}:bt}}var so=500;function co(){return{buffer:"",lastTime:0}}function uo(e,t,n,r,o=so){if(t.length!==1)return{newState:e,matchedIndex:null};let a=(n-e.lastTime>o?"":e.buffer)+t.toLowerCase(),l={buffer:a,lastTime:n};for(let d=0;d<r.length;d++){let s=r[d];if(!s.disabled&&s.label.toLowerCase().startsWith(a))return{newState:l,matchedIndex:d}}return{newState:l,matchedIndex:null}}var po={};jt(po,{findVariantByOptions:()=>mo,isOptionValueAvailable:()=>bo,toPickerVariant:()=>ho});function mo(e,t){if(e.length===0)return null;for(let n of e){if(n.optionValues.length!==t.length)continue;let r=!0;for(let o=0;o<n.optionValues.length;o++)if(n.optionValues[o]!==t[o]){r=!1;break}if(r)return n}return null}function bo(e,t,n,r){for(let o of e){if(!o.available||o.optionValues[t]!==n)continue;let i=!0;for(let a=0;a<o.optionValues.length;a++)if(a!==t&&o.optionValues[a]!==r[a]){i=!1;break}if(i)return!0}return!1}function ho(e){return{id:e.id,optionValues:e.selectedOptions.map(t=>t.value),available:e.availableForSale}}var Qt="_lb_v",ht=null;function fo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t>>>=0;return t>>>0}function bn(){try{let e=window.localStorage.getItem(Qt);if(e)return e;let t=Wt();return window.localStorage.setItem(Qt,t),t}catch{return ht||(ht=Wt()),ht}}function Wt(){return Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10)}function go(e,t,n){let r=e.slice().sort((a,l)=>a.id<l.id?-1:a.id>l.id?1:0),o=fo(t+":"+n)%100,i=0;for(let a of r)if(i+=Math.max(0,a.abWeight),o<i)return a;return r[r.length-1]}function hn(e,t){let n=new Map;for(let o of e){if(!o.abTestId)continue;let i=n.get(o.abTestId);i?i.push(o):n.set(o.abTestId,[o])}if(n.size===0)return e.slice();let r=new Map;return n.forEach((o,i)=>{if(o.length===1){r.set(i,o[0]);return}r.set(i,go(o,t,i))}),e.filter(o=>!o.abTestId||r.get(o.abTestId)===o)}function xo(e){return e.availableForSale&&!e.currentlyNotInStock&&e.quantityAvailable!=null&&e.quantityAvailable<=0}function fn(e,t){return e.availableForSale?e.currentlyNotInStock||e.quantityAvailable==null||xo(e)?!0:e.quantityAvailable>=t:!1}function gn(e){let t=e.slice(e.lastIndexOf("/")+1),n=Number(t);return Number.isFinite(n)&&t!==""?n:e}function Fe(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?Math.round(t*100):0}function vo(e,t,n){return{id:gn(e.id),title:e.title,options:(e.selectedOptions??[]).map(r=>r.value),available:fn(e,t),price:Fe(e.price?.amount),compareAtPrice:Fe(e.compareAtPrice?.amount),unitPrice:mn(e.unitPrice,e.unitPriceMeasurement,n),image:e.image?.url??null}}function _e(e,t,n){let r=n.allowedVariantIds,o=e.variants.nodes.filter(s=>!r||r.length===0||r.includes(s.id)),i=e.priceRange.minVariantPrice.currencyCode,a=vt(n.quantities,e.id,o[0]?.id??""),l=o.map(s=>{let c=vt(n.quantities,e.id,s.id),u=vo(s,c,i);return c!==a&&(u.quantity=c),u}),d=l.find(s=>s.available)??l[0];return{productId:gn(e.id),title:e.title,url:e.handle?"/products/"+e.handle:null,featuredImage:e.featuredImage?.url??null,quantity:a,selectedVariantId:d?d.id:"",optionNames:(o[0]?.selectedOptions??[]).map(s=>s.name),variants:l}}function Ve(e){return e.products.map((t,n)=>_e(t,e.id,{quantities:{productQuantities:e.productQuantities,variantQuantities:e.variantQuantities},allowedVariantIds:e.selectedVariantIds?.[n]??null}))}function Y(e,t){for(let n=0;n<e.variants.length;n++)if(String(e.variants[n].id)===String(t))return e.variants[n];return e.variants[0]}function xn(e,t){if(!e.variants||!t)return null;for(let n=0;n<e.variants.length;n++){let r=e.variants[n];if(!r.options||r.options.length!==t.length)continue;let o=!0;for(let i=0;i<r.options.length;i++)if(r.options[i]!==t[i]){o=!1;break}if(o)return r}return null}function vn(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o];if(i.available===!1||!i.options||i.options[t]!==n)continue;let a=!0;for(let l=0;l<i.options.length;l++)if(l!==t&&i.options[l]!==r[l]){a=!1;break}if(a)return!0}return!1}function yn(e){let t=[];for(let n=0;n<e.length;n++){let r=Y(e[n],e[n].selectedVariantId),o=r.quantity||e[n].quantity||1;t.push({variantId:Number(e[n].selectedVariantId),quantity:o,priceCents:(r.price||0)*o})}return t}function yo(e,t,n){let r=0,o=0;for(let i=0;i<e.length;i++){let a=Y(e[i],e[i].selectedVariantId),l=a.quantity||e[i].quantity||1,d=a.price*l;if(r+=d,t==="percentage"){let s=Math.floor(a.price*n/100);o+=(a.price-s)*l}else o+=d}if(t==="fixed_amount"&&(o=Math.max(0,r-Math.round(n*100))),t==="flat_price"){let i=Math.round(n*100);o=i<r?i:r}return{totalPrice:r,salePrice:o,savings:r-o}}function wt(e,t,n){let r=e.classList?.contains("lb-fixed")?e:e.querySelector(".lb-fixed");if(!r)return;let{totalPrice:o,salePrice:i,savings:a}=yo(t,r.getAttribute("data-discount-type")||"",parseFloat(r.getAttribute("data-discount-value")??"")||0),l=e.querySelector("[data-sale-price]"),d=e.querySelector("[data-compare-price]"),s=e.querySelector("[data-savings-bar]"),c=e.querySelector("[data-savings-amount]"),u=e.querySelector("[data-savings-percent]");if(l&&(l.textContent=n(i)),d&&(a>0?(d.textContent=n(o),d.style.display=""):d.style.display="none"),s)if(a>0){if(c&&(c.textContent=n(a)),u){let p=o>0?Math.round(a*100/o):0;u.textContent="("+p+"%)"}s.style.display=""}else s.style.display="none"}function le(e){return t=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(t/100)}catch{return e+" "+(t/100).toFixed(2)}}}var wo="_lime_bundle_gid",_o="_lime_bundle_type";function se(e,t){return[{key:wo,value:e},{key:_o,value:t}]}function Ue(e,t,n){let r=e.querySelectorAll("[data-variant-option]");if(!r.length)return;function o(s){return parseInt(s.getAttribute("data-option-position")??"",10)}function i(){let s=[];for(let c=0;c<r.length;c++){let u=o(r[c]);!u||u<1||(s[u-1]=r[c].value)}return s}function a(s){if(!(!s||!s.options))for(let c=0;c<r.length;c++){let u=o(r[c]);if(!u||u<1)continue;let p=s.options[u-1];r[c].value!==p&&(r[c].value=p)}}function l(s,c){for(let u=0;u<r.length;u++){let p=r[u],x=o(p);if(!x||x<1)continue;let b=p.options;for(let _=0;_<b.length;_++)b[_].disabled=!vn(s.variants,x-1,b[_].value,c)}}let d=t();if(d){let s=Y(d,d.selectedVariantId);s&&s.options&&l(d,s.options)}for(let s=0;s<r.length;s++)r[s].addEventListener("change",c=>{c.stopPropagation();let u=t();if(!u)return;let p=xn(u,i());if(!p){let x=Y(u,u.selectedVariantId);a(x),x&&x.options&&l(u,x.options);return}u.selectedVariantId=p.id,l(u,p.options),n(p,u)})}function ze(e,t,n){if(!t.variants.length)return;let r=e.querySelector(".lb-bundle-variant-badge");r&&!r.textContent&&(r.textContent=n.title);let o=e.querySelector(".lb-bundle-variant-option-groups");o&&!o.children.length&&Co(o,t,n)}function Co(e,t,n){let r=t.optionNames||[];for(let o=0;o<r.length;o++){let i=document.createElement("div");i.className="lb-bundle-variant-option-group";let a=document.createElement("span");a.className="lb-bundle-variant-option-label",a.textContent=r[o],i.appendChild(a);let l=document.createElement("select");l.className="lb-bundle-variant-select",l.setAttribute("data-variant-option",""),l.setAttribute("data-option-position",String(o+1)),l.setAttribute("data-product-id",String(t.productId)),l.name="lb-variant-"+t.productId+"-"+(o+1),l.setAttribute("aria-label",r[o]);let d=Object.create(null);for(let s of t.variants){let c=s.options&&s.options[o];if(!c||d[c])continue;d[c]=!0;let u=document.createElement("option");u.value=c,u.textContent=c,n.options&&n.options[o]===c&&(u.selected=!0),l.appendChild(u)}i.appendChild(l),e.appendChild(i)}}var _t=new WeakMap;function Qe(e,t,n){let r=e.querySelector("[data-thumbnail]");if(!r)return;let o=r.querySelector("img");if(!_t.has(e)){let a=n||(o?o.src:null);a&&_t.set(e,a)}let i=t.image||_t.get(e)||null;if(i)if(o)o.src=i,o.srcset="";else{let a=document.createElement("img");a.src=i,a.loading="lazy",a.alt="",r.textContent="",r.appendChild(a)}}function ko(e,t){let n=e.querySelector("[data-qty-inline]");n&&(n.textContent="\xD7"+t)}function Ct(e,t,n,r){if(!t)return;Qe(e,t,n.featuredImage),ko(e,t.quantity||n.quantity||1);let o=e.querySelector("[data-product-price]");o&&t.price!=null&&(o.textContent=r(t.price));let i=e.querySelector("[data-product-compare-price]");if(i){let l=t.compareAtPrice;l&&l>t.price?(i.textContent=r(l),i.hidden=!1):(i.textContent="",i.hidden=!0)}let a=e.querySelector("[data-product-unit-price]");a&&(t.unitPrice?(a.textContent=t.unitPrice,a.hidden=!1):(a.textContent="",a.hidden=!0))}function R(e,t,n){let r=document.createElement(e);r.className=t;for(let o in n)r.setAttribute(o,n[o]);return r}function We(e,t,n){let r=e.variants.length,o=R("div","lb-bundle-product-row");n.isOos&&(o.classList.add("lb-bundle-product-row--oos"),o.setAttribute("aria-disabled","true")),o.setAttribute("data-product-id",String(e.productId)),n.bogoRole&&o.setAttribute("data-bogo-role",n.bogoRole),o.appendChild(R("div","lb-bundle-thumbnail",{"data-thumbnail":""}));let i=R("div","lb-bundle-product-info"),a=document.createElement(n.href?"a":"span");if(a.className="lb-bundle-product-name",n.href&&(a.href=n.href),a.textContent=e.title??"",i.appendChild(a),n.isOos){let d=R("span","lb-bundle-oos-label");return d.textContent=t.outOfStock||"Out of stock",i.appendChild(d),o.appendChild(i),o}r===1&&e.variants[0]?.title!=="Default Title"&&i.appendChild(R("span","lb-bundle-variant-badge"));let l=R("span","lb-bundle-product-prices");if(l.appendChild(R("span","lb-bundle-product-compare-price",{"data-product-compare-price":"",hidden:""})),l.appendChild(R("span","lb-bundle-product-price",{"data-product-price":""})),n.inlineQuantity!=null){let d=R("span","lb-bundle-qty-inline",{"data-qty-inline":""});d.textContent="\xD7"+n.inlineQuantity,l.appendChild(d)}if(i.appendChild(l),i.appendChild(R("span","lb-bundle-product-unit-price",{"data-product-unit-price":""})),r>1&&i.appendChild(R("div","lb-bundle-variant-option-groups",{style:"--lb-row-option-count: "+(e.optionNames.length||1)})),o.appendChild(i),n.inlineQuantity==null&&o.appendChild(R("span","lb-bundle-qty-chip",{"data-qty-inline":""})),n.badgeText){let d=R("span","lb-bogo__badge");d.textContent=n.badgeText,o.appendChild(d)}return o}function de(e,t){let n=R("div",e),r=R("div","lb-bundle-header"),o=R("h3","lb-bundle-title");if(o.textContent=t.title,r.appendChild(o),t.subtitle){let p=R("p","lb-bundle-subtitle");p.textContent=t.subtitle,r.appendChild(p)}if(n.appendChild(r),t.endsAt){let p=R("div","lb-bundle-countdown",{"data-countdown":""}),x=R("span","lb-bundle-countdown-label");x.textContent=t.countdownLabel??"Limited time offer",p.appendChild(x),p.appendChild(R("span","lb-bundle-countdown-timer",{"data-countdown-timer":""})),n.appendChild(p)}let i=R("div",e+"__products lb-edge-fade");n.appendChild(i),n.appendChild(R("div","lb-bundle-divider"));let a=R("div","lb-bundle-summary",{"data-pricing-section":""}),l=R("div","lb-bundle-summary__text"),d=R("span","lb-bundle-summary__label");if(d.textContent=t.summaryLabel??"Bundle total",l.appendChild(d),t.withItemCount&&d.appendChild(R("span","",{"data-item-count":""})),t.showSavingsBar){let p=R("p","lb-bundle-savings-line",{"data-savings-bar":"",style:"display:none"});p.appendChild(document.createTextNode("Save ")),p.appendChild(R("span","",{"data-savings-amount":""})),p.appendChild(document.createTextNode(" ")),p.appendChild(R("span","",{"data-savings-percent":""})),l.appendChild(p)}a.appendChild(l);let s=R("span","lb-bundle-summary__prices");t.showComparePrice&&s.appendChild(R("span","lb-bundle-compare-price",{"data-compare-price":""})),s.appendChild(R("span","lb-bundle-sale-price",{[t.totalPriceSlot?"data-total-price":"data-sale-price"]:""})),a.appendChild(s),n.appendChild(a);let c=R("button","lb-bundle-cta",{"data-cta-text":t.ctaText,type:"button","data-add-bundle":""}),u=R("span","lb-cta-label",{"data-cta-label":""});return u.textContent=t.ctaText,c.appendChild(u),n.appendChild(c),n.appendChild(R("p","lb-bundle-error",{"data-error":"","aria-live":"polite"})),n.appendChild(R("span","lb-visually-hidden",{"data-status":"","aria-live":"polite"})),{root:n,products:i,cta:c}}function wn(e,t,n={}){let r=n.showCompare!==!1,o=n.showPriceEach!==!1,i=R("div","lb-volume__tiers lb-edge-fade",{role:"radiogroup","aria-label":t,"data-tier-group":""});return e.forEach((a,l)=>{let d=R("div","lb-volume__tier",{role:"radio","aria-checked":a.selected?"true":"false",tabindex:a.selected?"0":"-1","data-tier-index":String(l),"data-tier-qty":String(a.quantity),"data-tier-pct":String(a.percent),"data-tier-amt":String(a.amountCents)}),s=R("span","lb-volume__radio");s.appendChild(R("span","lb-volume__radio-dot")),d.appendChild(s);let c=R("span","lb-volume__tier-info"),u=R("span","lb-volume__tier-label");u.textContent=a.label,c.appendChild(u);let p=R("span","lb-volume__tier-price");if(r&&(a.percent>0||a.amountCents>0)&&p.appendChild(R("span","lb-volume__tier-compare")),o&&(p.appendChild(R("span","",{"data-tier-price-each":""})),n.unitLabel)){let x=R("span","lb-volume__tier-unit");x.textContent=n.unitLabel,p.appendChild(x)}if(c.appendChild(p),d.appendChild(c),a.badgeLabel||a.savingsLabel){let x=R("span","lb-volume__tier-right");if(a.badgeLabel){let b=R("span","lb-volume__tier-badge");b.textContent=a.badgeLabel,x.appendChild(b)}if(a.savingsLabel){let b=R("span","lb-volume__tier-savings");b.textContent=a.savingsLabel,x.appendChild(b)}d.appendChild(x)}i.appendChild(d)}),i}function je(e){let t=R("div","lb-mix-match__progress",{"data-progress":""}),n=R("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e)});for(let o=0;o<e;o++)n.appendChild(R("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));t.appendChild(n);let r=R("div","lb-mix-match__progress-labels");return r.appendChild(R("span","lb-mix-match__progress-count",{"data-progress-count":"","aria-live":"polite"})),r.appendChild(R("span","lb-mix-match__progress-remaining",{"data-progress-remaining":"","aria-live":"polite"})),t.appendChild(r),t}function Ce(e){return e<10?"0"+e:String(e)}function ce(e){e._lbCountdownInterval&&(clearInterval(e._lbCountdownInterval),e._lbCountdownInterval=null);let t=e.querySelector("[data-countdown]");if(!t)return;let n=e.closest(".lb-bundle-widget"),r=n&&n.getAttribute("data-ends-at");if(!r){t.style.display="none";return}let o=new Date(r).getTime();if(isNaN(o)){t.style.display="none";return}let i=t.querySelector("[data-countdown-timer]");if(!i)return;let a;function l(){let d=o-Date.now();if(d<=0){n&&(n.style.display="none"),a&&clearInterval(a);return}let s=Math.floor(d/864e5),c=Math.floor(d%864e5/36e5),u=Math.floor(d%36e5/6e4),p=Math.floor(d%6e4/1e3);i.textContent=s>0?s+"d "+Ce(c)+"h "+Ce(u)+"m "+Ce(p)+"s":Ce(c)+"h "+Ce(u)+"m "+Ce(p)+"s"}l(),o-Date.now()>0&&(a=setInterval(l,1e3),e._lbCountdownInterval=a)}var ue={locale:"en",addItem:"Add",addedItem:"Added",removeItem:"Remove",swapItem:"Swap",required:"Required",soldOut:"Sold out",outOfStock:"Out of stock",itemsOutOfStock:{one:"__COUNT__ item out of stock",other:"__COUNT__ items out of stock"},quantity:"Quantity",increaseQuantity:"Increase quantity",decreaseQuantity:"Decrease quantity",allTypes:"All",editSelection:"Edit selection",addToCart:"Add to cart",bundlePrice:"Bundle price",save:"Save",complete:"Complete",ofSelected:"__COUNT__ of __TOTAL__ added",moreToGo:"__COUNT__ more to go",nProductsShown:"__COUNT__ products shown",bundleComplete:"Your bundle is complete",chooseMoreUnlock:"Choose __COUNT__ more to unlock __PCT__% off",chooseMoreComplete:"Choose __COUNT__ more to complete your bundle",stepOf:"Step __STEP__ of __TOTAL__",stepsCompleted:"__COUNT__ of __TOTAL__ steps completed",each:" each",buyQty:"Buy __COUNT__",itemCount:{one:"__COUNT__ item",other:"__COUNT__ items"},needsSpots:{one:"Needs __COUNT__ spot",other:"Needs __COUNT__ spots"}};function $e(e,t){let n=e.itemsOutOfStock,r;if(n&&typeof n=="object"){let o=new Intl.PluralRules(e.locale||"en").select(t);r=n[o]||n.other}else r=n;return(r||"__COUNT__ items out of stock").split("__COUNT__").join(String(t))}function _n(e){let t=e.ownerDocument,n=t&&t.defaultView;if(!n)return null;let r=e.parentElement;for(;r&&r!==t.body;){let o=n.getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden")return r;r=r.parentElement}return null}var re=[],Ge=!1;function So(e,t){if(e.composedPath){let r=e.composedPath();for(let o=0;o<r.length;o++)if(r[o]===t.shell||r[o]===t.listbox)return!0;return!1}let n=e.target;return t.shell.contains(n)||t.listbox.contains(n)}function Ke(e){for(let t=re.length-1;t>=0;t--)So(e,re[t])||re[t].close()}function Cn(){for(let e=re.length-1;e>=0;e--)re[e].close()}function To(){Ge||(document.addEventListener("pointerdown",Ke,!0),window.addEventListener("resize",Cn),window.addEventListener("scroll",Ke,!0),Ge=!0)}function Eo(){Ge&&(document.removeEventListener("pointerdown",Ke,!0),window.removeEventListener("resize",Cn),window.removeEventListener("scroll",Ke,!0),Ge=!1)}function kn(e){re.push(e),re.length===1&&To()}function Sn(e){let t=re.indexOf(e);t>=0&&re.splice(t,1),re.length===0&&Eo()}function Tn(e){for(let t=re.length-1;t>=0;t--)re[t]!==e&&re[t].close()}var Io=32,Mo=8,Ao=8,kt=new WeakMap;function En(e){return kt.get(e)}function In(e){if(e.classList.contains("lb-dropdown-state"))return null;let t=document,n=e.getAttribute("aria-label")||"",r="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 o=t.createElement("div");o.className="lb-dropdown",o.setAttribute("data-lb-dropdown","");let i=t.createElement("button");i.type="button",i.className="lb-dropdown-trigger",i.setAttribute("role","combobox"),i.setAttribute("aria-haspopup","listbox"),i.setAttribute("aria-expanded","false");let a=r+"-listbox";i.setAttribute("aria-controls",a),n&&i.setAttribute("aria-label",n);let l=t.createElement("span");l.className="lb-dropdown-trigger-value";let d=t.createElement("span");d.className="lb-dropdown-chevron",d.setAttribute("aria-hidden","true"),i.appendChild(l),i.appendChild(d);let s=t.createElement("ul");s.id=a,s.className="lb-dropdown-listbox",s.setAttribute("role","listbox"),n&&s.setAttribute("aria-label",n),s.hidden=!0,o.appendChild(i),e.parentNode?.insertBefore(o,e.nextSibling);let c=e.closest("[data-modal-overlay]");c?(c.appendChild(s),s.setAttribute("data-lb-dropdown-portal","")):o.appendChild(s);let u=!1,p=-1,x=ve.emptyTypeAheadState(),b=[];function _(){let P=[];for(let E=0;E<e.options.length;E++){let h=e.options[E];P.push({disabled:h.disabled,label:h.textContent||h.value})}return P}function I(){i.disabled=e.disabled;let P=_(),E=e.selectedIndex;for(l.textContent=E>=0&&P[E]?P[E].label:"";s.firstChild;)s.removeChild(s.firstChild);b=[];for(let h=0;h<P.length;h++){let M=t.createElement("li");M.id=r+"-opt-"+h,M.className="lb-dropdown-option",M.setAttribute("role","option"),M.setAttribute("aria-selected",h===E?"true":"false"),P[h].disabled&&M.setAttribute("aria-disabled","true"),M.setAttribute("data-value",e.options[h].value),M.setAttribute("data-index",String(h)),M.textContent=P[h].label,s.appendChild(M),b.push(M)}}function w(P){if(p>=0&&b[p]&&b[p].classList.remove("is-active"),p=P,P<0||!b[P]){i.setAttribute("aria-activedescendant","");return}let E=b[P];E.classList.add("is-active"),i.setAttribute("aria-activedescendant",E.id);let h=E.offsetTop,M=h+E.offsetHeight,V=s.scrollTop,g=V+s.clientHeight;h<V?s.scrollTop=h:M>g&&(s.scrollTop=M-s.clientHeight)}function A(){let P=i.getBoundingClientRect();if(P.width===0)return!1;let h=Math.min(b.length||1,Ao)*Io+Mo,M=_n(i),V=M?{top:M.getBoundingClientRect().top,bottom:M.getBoundingClientRect().bottom}:void 0,g=ve.computePosition({trigger:{top:P.top,bottom:P.bottom,left:P.left,width:P.width},viewportHeight:window.innerHeight,desiredHeight:h,clip:V});return s.setAttribute("data-placement",g.placement),s.style.maxHeight=g.maxHeight+"px",s.hasAttribute("data-lb-dropdown-portal")&&(s.style.top=g.offsetTop+"px",s.style.left=g.offsetLeft+"px",s.style.width=g.width+"px"),!0}function S(){if(u)return;Tn($),u=!0,s.hidden=!1,i.setAttribute("aria-expanded","true"),A()||requestAnimationFrame(()=>{A()});let P=_(),E=e.selectedIndex;E>=0&&P[E]&&!P[E].disabled?w(E):w(ve.firstEnabled(P)),kn($)}function k(P){u&&(u=!1,s.hidden=!0,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-activedescendant",""),p>=0&&b[p]&&b[p].classList.remove("is-active"),p=-1,Sn($),P&&i.focus())}function q(P){let E=e.options[P];!E||E.disabled||(e.value!==E.value&&(e.value=E.value,e.dispatchEvent(new Event("change",{bubbles:!0}))),I(),k(!0))}function C(P){let E=_(),h=ve.handleKey({key:P.key,ctrlKey:P.ctrlKey,metaKey:P.metaKey,altKey:P.altKey,shiftKey:P.shiftKey},{isOpen:u,activeIndex:p,selectedIndex:e.selectedIndex,options:E});switch(h.preventDefault&&P.preventDefault(),h.type){case"open":S(),h.activeIndex>=0&&w(h.activeIndex);break;case"close":k(h.restoreFocus);break;case"move-active":w(h.activeIndex);break;case"commit":q(h.index);break;case"type-ahead":{let M=ve.pushTypeAheadChar(x,h.char,Date.now(),E);x=M.newState,M.matchedIndex!==null&&(u||S(),w(M.matchedIndex));break}}}function f(P){P.preventDefault(),u?k(!1):S()}function m(P){let E=P.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){let h=parseInt(E.getAttribute("data-index")??"",10);return isNaN(h)?null:h}E=E.parentNode}return null}function O(P){let E=m(P);E!==null&&q(E)}function U(P){let E=P.target;for(;E&&E!==s;){if(E.classList&&E.classList.contains("lb-dropdown-option")){if(E.getAttribute("aria-disabled")==="true")return;let h=parseInt(E.getAttribute("data-index")??"",10);!isNaN(h)&&h!==p&&w(h);return}E=E.parentNode}}function D(){setTimeout(()=>{u&&(o.contains(document.activeElement)||k(!1))},0)}function W(){I()}let te=new MutationObserver(()=>{I()});te.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value","selected"]});function ne(P){P.preventDefault()}i.addEventListener("click",f),i.addEventListener("keydown",C),o.addEventListener("focusout",D),s.addEventListener("mousedown",ne),s.addEventListener("click",O),s.addEventListener("mousemove",U),e.addEventListener("change",W);function K(){u&&k(!1),te.disconnect(),i.removeEventListener("click",f),i.removeEventListener("keydown",C),o.removeEventListener("focusout",D),s.removeEventListener("mousedown",ne),s.removeEventListener("click",O),s.removeEventListener("mousemove",U),e.removeEventListener("change",W),o.parentNode?.removeChild(o),s.parentNode?.removeChild(s),e.classList.remove("lb-dropdown-state"),e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex"),kt.delete(e)}let $={shell:o,listbox:s,select:e,close:()=>k(!1),destroy:K};return kt.set(e,$),I(),$}var Lo="select.lb-bundle-variant-select:not(.lb-dropdown-state), select.lb-mix-match__variant-select:not(.lb-dropdown-state)";function Mn(e){let n=(e??document).querySelectorAll(Lo);for(let r=0;r<n.length;r++)In(n[r])}function An(e){let n=(e??document).querySelectorAll("select.lb-dropdown-state");for(let r=0;r<n.length;r++)En(n[r])?.destroy()}function he(e){return Mn(e),()=>An(e)}function Ln(e,t,n,r,o){let i=t.widgetConfig,a=Ve(t);if(!a.length)return;let l=a.filter(p=>!p.variants.some(x=>x.available));if(n==="hide"&&l.length>0)return;let d=t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD",s=le(d),c=ue,u=de("lb-fixed",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||c.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});u.root.setAttribute("data-discount-type",t.discountConfig.discountType),u.root.setAttribute("data-discount-value",String(t.discountConfig.discountValue));for(let p of a){let x=!p.variants.some(I=>I.available),b=We(p,c,{isOos:x,href:p.url});if(u.products.appendChild(b),x)continue;let _=Y(p,p.selectedVariantId);ze(b,p,_),Ct(b,_,p,s),Ue(b,()=>p,(I,w)=>{Ct(b,I,w,s),wt(u.root,a,s)})}if(l.length>0){u.cta.disabled=!0;let p=u.cta.querySelector("[data-cta-label]");p&&(p.textContent=$e(c,l.length))}else u.cta.addEventListener("click",()=>{r(yn(a).map(p=>({merchandiseId:"gid://shopify/ProductVariant/"+p.variantId,quantity:p.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(u.root),ce(u.root),wt(u.root,a,s),o?.(he(u.root))}function J(e,t){let n=e;for(let r in t)n=n.split("__"+r+"__").join(String(t[r]));return n}function Ye(e,t){let n=t.needsSpots;if(!n)return"Needs "+e+" spots";let r=new Intl.PluralRules(t.locale||"en").select(e);return J(n[r]||n.other||"__COUNT__",{COUNT:e})}function Je(e,t,n){return J(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function Pn(e,t){return e>0?J(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function Bn(e,t,n,r){if(e<=0)return r.bundleComplete||"Your bundle is complete";let o=t==="percentage"&&n?Math.round(n):0;return o>0?J(r.chooseMoreUnlock||"Choose __COUNT__ more to unlock __PCT__% off",{COUNT:e,PCT:o}):J(r.chooseMoreComplete||"Choose __COUNT__ more to complete your bundle",{COUNT:e})}var Po={min:1,max:99};function X(e,t,n){if(n!=null){let o=t["gid://shopify/ProductVariant/"+n];if(o&&typeof o.min=="number"&&typeof o.max=="number")return o}let r=t["gid://shopify/Product/"+e];return!r||typeof r.min!="number"||typeof r.max!="number"?Po:r}function pe(e,t){if(e==null)return;let n=t["gid://shopify/ProductVariant/"+e];if(!(!n||typeof n.min!="number"||typeof n.max!="number"))return n}function Xe(e,t){let n=e??{};if(!t)return n;let r=Object.keys(t);if(r.length===0)return n;let o={...n};for(let i of r)o[i]=t[i];return o}function Ze(e,t,n){return X(e,t,n).min}function oe(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].quantity||1;return t}function me(e,t){for(let n=0;n<e.length;n++)if(e[n]&&e[n].variantId===t)return n;return-1}function qn(e,t){let n=me(e,t);return n===-1?0:e[n].quantity||0}function Rn(e,t){return e.min<=t}function Nn(e,t,n,r=0,o=0,i){let a=Math.min(e.max-o,r+t);return typeof i=="number"&&(a=Math.min(a,i)),typeof n=="number"?Math.min(a,n):a}var On=[120,180,240],St=[480,600,768,1024],Hn="60px",Dn="(max-width: 767px) 45vw, 228px";function ke(e,t){return e&&(/[?&]width=\d+/.test(e)?e.replace(/([?&])width=\d+/,"$1width="+t):e+(e.indexOf("?")===-1?"?":"&")+"width="+t)}function Ie(e,t){return e?t.map(n=>ke(e,n)+" "+n+"w").join(", "):""}function et(e,t){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Se(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase():""}var Fn=600;function tt(e,t,n){let{t:r,rulesMap:o,capacity:i,formatMoney:a}=n,l=X(e.id,o),d=document.createElement("div");d.className="lb-mix-match__modal-product",e.available||(d.className+=" lb-mix-match__modal-product--sold-out"),d.setAttribute("data-product-item",""),d.setAttribute("data-title",Se(e.title)),d.setAttribute("data-type",e.type||"");let s=!1,c=!1,u=document.createElement("div");u.className="lb-mix-match__modal-product-thumb";let p=document.createElement("span");p.className="lb-mix-match__modal-added-badge",p.textContent=r.addedItem||"Added",p.hidden=!0,u.appendChild(p);let x=e.variants.find(g=>g.available)??null,b=x&&x.image||e.featuredImage;if(b){let g=document.createElement("img");g.src=ke(b,Fn),g.srcset=Ie(b,St),g.sizes=Dn,g.alt=e.title,g.loading="lazy",u.appendChild(g)}d.appendChild(u);let _=document.createElement("div");_.className="lb-mix-match__modal-product-info";let I=document.createElement("p");if(I.className="lb-mix-match__modal-product-title",e.url){let g=document.createElement("a");g.href=e.url,g.target="_blank",g.rel="noopener noreferrer",g.textContent=e.title,I.appendChild(g)}else I.textContent=e.title;_.appendChild(I);let w=x??(e.variants.length>0?e.variants[0]:null),A=g=>X(e.id,o,g?g.id:null),S=w?A(w).min:1,k=document.createElement("p");k.className="lb-mix-match__modal-product-price",k.setAttribute("data-row-price","");let q=document.createElement("span");q.setAttribute("data-row-price-sale",""),w&&(q.textContent=a(w.price*S)),k.appendChild(q);let C=document.createElement("s");C.className="lb-mix-match__modal-product-compare",C.setAttribute("data-row-compare",""),k.appendChild(C),_.appendChild(k);function f(g,F,y){let v=F&&F.compareAtPrice?F.compareAtPrice*y:0,L=F?F.price*y:0;v>L?(g.textContent=a(v),g.hidden=!1):(g.textContent="",g.hidden=!0)}f(C,w,S);let m=document.createElement("p");m.className="lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price",m.setAttribute("data-row-unit-price","");let O=w?w.unitPrice:null;O?m.textContent=O:m.hidden=!0,_.appendChild(m);let U=null,D=null,W=A(w).min,te=A(w).max,ne=null,K=null;if(e.available&&n.showQtySelector){U=document.createElement("div"),U.className="lb-bundle-variant-option-group lb-mix-match__qty-stepper-group";let g=document.createElement("div");g.className="lb-mix-match__qty-stepper",g.setAttribute("role","group"),g.setAttribute("aria-label",r.quantity||"Quantity");let F=document.createElement("button");F.type="button",F.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--minus",F.setAttribute("aria-label",r.decreaseQuantity||"Decrease quantity"),F.textContent="\u2212",D=document.createElement("span"),D.className="lb-mix-match__qty-stepper-value",D.setAttribute("data-row-qty",""),D.setAttribute("aria-live","polite"),D.textContent=String(A(w).min);let y=document.createElement("button");y.type="button",y.className="lb-mix-match__qty-stepper-button lb-mix-match__qty-stepper-button--plus",y.setAttribute("aria-label",r.increaseQuantity||"Increase quantity"),y.textContent="+",g.appendChild(F),g.appendChild(D),g.appendChild(y),U.appendChild(g);let v=D;ne=()=>{v.textContent=String(W),v.setAttribute("data-qty",String(W)),F.disabled=c||W<=A(w).min,y.disabled=c||W>=te},K=(T,H=0)=>{let B=T?T.id:null,N=B===null?0:i.ownQty(B),z=B===null?0:i.productUnitsElsewhere(e.id,B),Q=B===null?0:i.swapUnits(e.id,B),G=T?T.inventoryQuantity:null,Z=Math.max(0,H-N),be=typeof G=="number"?Math.max(0,G-Z):void 0,ge=pe(B,o)?.max,ee=A(T).min;te=Q>0?typeof be=="number"?Math.min(Q,be):Q:Nn(l,i.remainingSpots(),be,N,z,ge),te<ee?W=ee:(W>te&&(W=te),W<ee&&(W=ee)),ne()};let L=()=>{w&&i.commitQty(w.id,W)&&n.onCommittedQtyChanged()};F.addEventListener("click",()=>{W>A(w).min&&(W-=1),ne(),L()}),y.addEventListener("click",()=>{W<te&&(W+=1),ne(),L()}),w?K(w):ne()}let $=e.variants.slice(),P=[];if($.length>1){let g=e.optionNames||[];w=$.find(B=>B.available!==!1)??$[0];let F=()=>{let B=P.map(N=>N.value);for(let N of $)if(!(!N.options||N.options.length!==B.length)&&N.options.every((z,Q)=>z===B[Q]))return N;return null},y=B=>{if(!(!B||!B.options))for(let N=0;N<P.length&&N<B.options.length;N++)P[N].value!==B.options[N]&&(P[N].value=B.options[N])},v=(B,N,z)=>{for(let Q of $){if(Q.available===!1||!Q.options||Q.options[B]!==N)continue;let G=!0;for(let Z=0;Z<Q.options.length;Z++)if(Z!==B&&Q.options[Z]!==z[Z]){G=!1;break}if(G)return!0}return!1},L=B=>{for(let N=0;N<P.length;N++){let z=P[N];for(let Q=0;Q<z.options.length;Q++)z.options[Q].disabled=!v(N,z.options[Q].value,B)}},T=()=>{let B=F();if(!B){y(w),w?.options&&L(w.options);return}w=B,d.setAttribute("data-selected-variant-id",String(B.id));let N=A(B).min;q.textContent=a(B.price*N),f(C,B,N),B.unitPrice?(m.textContent=B.unitPrice,m.hidden=!1):(m.textContent="",m.hidden=!0);let z=u.querySelector("img"),Q=B.image||e.featuredImage;z&&Q&&(z.src=ke(Q,Fn),z.srcset=Ie(Q,St)),K?.(B,i.variantUnitsElsewhere(B.id)),B.options&&L(B.options),V()},H=document.createElement("div");H.className="lb-bundle-variant-option-groups";for(let B=0;B<g.length;B++){let N=g[B],z=document.createElement("div");z.className="lb-bundle-variant-option-group";let Q=document.createElement("span");Q.className="lb-bundle-variant-option-label",Q.textContent=N,z.appendChild(Q);let G=document.createElement("select");G.className="lb-mix-match__variant-select",G.setAttribute("data-variant-option",""),G.setAttribute("data-option-position",String(B+1)),G.name="lb-variant-"+e.id+"-"+(B+1),G.setAttribute("aria-label",N);let Z=Object.create(null),be=w?.options?.[B];for(let ge of $){let ee=ge.options&&ge.options[B];if(!ee||Z[ee])continue;Z[ee]=!0;let Ne=document.createElement("option");Ne.value=ee,Ne.textContent=ee,ee===be&&(Ne.selected=!0),G.appendChild(Ne)}G.addEventListener("change",T),P.push(G),z.appendChild(G),H.appendChild(z)}_.appendChild(H),w&&(d.setAttribute("data-selected-variant-id",String(w.id)),w.options&&L(w.options))}else if($.length===1&&$[0].title!=="Default Title"){let g=document.createElement("span");g.className="lb-mix-match__filled-variant",g.textContent=$[0].title,_.appendChild(g)}let E=null;e.available&&(E=document.createElement("span"),E.className="lb-mix-match__modal-needs-spots",E.hidden=!0,_.appendChild(E));let h=null;if(e.available){let g=document.createElement("div");g.className="lb-mix-match__modal-product-actions",U&&g.appendChild(U),h=document.createElement("button"),h.type="button",h.className="lb-mix-match__modal-add",h.textContent=r.addItem||"Add",h.setAttribute("aria-label",(r.addItem||"Add")+" "+e.title),h.setAttribute("data-add-product",String(t)),g.appendChild(h),_.appendChild(g)}else{let g=document.createElement("span");g.className="lb-mix-match__modal-sold-out-label",g.textContent=r.soldOut||"Sold out",d.setAttribute("aria-disabled","true"),_.appendChild(g)}d.appendChild(_);let M=w?w.id:null;function V(){if(!w)return;let g=w,F=g.inventoryQuantity,y=typeof F=="number"?i.variantUnitsElsewhere(g.id):0,v=i.isInBundle(g.id);if(K){let z=i.ownQty(g.id);z>0?W=z:M!==g.id&&(W=A(g).min),M=g.id,K(g,y)}let L=i.swapUnits(e.id,g.id),T=A(g),H=L>=T.min,B=i.remainingSpots(),N=!v&&!H&&!Rn(T,B);if(E&&(N&&B>0?(E.textContent=Ye(T.min,r),E.hidden=!1):E.hidden=!0),h)if(v)h.disabled=!1,i.canRemove(g.id)?(h.textContent=r.removeItem||"Remove",h.setAttribute("aria-label",(r.removeItem||"Remove")+" "+e.title),h.classList.remove("lb-mix-match__modal-add--required")):(h.disabled=!0,h.textContent=r.required||"Required",h.setAttribute("aria-label",e.title+" is required and cannot be removed"),h.classList.add("lb-mix-match__modal-add--required")),h.classList.add("lb-mix-match__modal-add--added"),d.classList.add("lb-mix-match__modal-product--in-bundle"),p.hidden=!1;else{let z=r.swapItem||"Swap",Q=H?z:r.addItem||"Add";h.textContent=Q,h.setAttribute("aria-label",Q+" "+e.title),h.classList.remove("lb-mix-match__modal-add--added"),h.classList.remove("lb-mix-match__modal-add--required"),d.classList.remove("lb-mix-match__modal-product--in-bundle"),p.hidden=!0;let G=typeof F=="number"?Math.max(0,F-y)<T.min:!1;if(H)h.disabled=G;else{let Z=l.max-i.productUnitsElsewhere(e.id,g.id)<T.min;h.disabled=G||Z||N||i.isFull()}}s=!e.available,c=!e.available||!v&&!!h?.disabled,ne?.();for(let z of P)z.disabled=s}return{el:d,refresh:V}}var Bo='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function nt(e){let t=e.querySelectorAll(Bo),n=[];for(let r=0;r<t.length;r++)t[r].offsetParent!==null&&n.push(t[r]);return n}var Tt=0,Me=0;function rt(){if(Me++,Me>1)return;Tt=window.pageYOffset||document.documentElement.scrollTop;let e=document.body;e.style.position="fixed",e.style.top="-"+Tt+"px",e.style.left="0",e.style.right="0",e.style.overflow="hidden"}function ot(){if(Me<=0||(Me--,Me>0))return;let e=document.body;e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.overflow="",window.scrollTo(0,Tt)}var Ae="__all__",qo=300,Ro=200;function Vn(e){let{container:t,data:n,t:r,eligibleProducts:o,items:i}=e,a=t.querySelector("[data-modal-overlay]");a&&e.portalTarget&&e.portalTarget.appendChild(a);let l=h=>a?a.querySelector(h):null,d=l('[role="dialog"]'),s=l("[data-modal-search]"),c=l("[data-modal-search-clear]"),u=l("[data-modal-list]"),p=l("[data-modal-empty]"),x=l("[data-modal-live]"),b=l("[data-modal-close]"),_=l("[data-modal-done]"),I=l("[data-modal-footer-count]"),w=l("[data-modal-subtitle]"),A=l("[data-modal-filters]"),S=n.showTypeFilters!==!1,k=Ae,q=!1,C=!1,f=!1,m=[];function O(){for(let h of m)h.refresh()}function U(){let h=Math.min(oe(i),e.requiredQty),M=Math.max(0,e.requiredQty-h);I&&(I.textContent=Je(h,e.requiredQty,r)),w&&(w.textContent=Bn(M,n.discountType,n.discountValue,r))}function D(){O(),U()}function W(){if(u){e.dropdown?.unbindAll(u),u.innerHTML="",m=[];for(let h=0;h<o.length;h++){let M=tt(o[h],h,{t:r,rulesMap:e.rulesMap,showQtySelector:e.showQtySelector,capacity:e.rowCapacity,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),D()}});m.push(M),u.appendChild(M.el)}e.dropdown?.bindAll(u),u.addEventListener("click",te)}}function te(h){let M=h.target.closest("[data-add-product]");if(!M||M.disabled)return;let V=parseInt(M.getAttribute("data-add-product")??"",10),g=o[V];if(!g)return;let F=M.closest(".lb-mix-match__modal-product"),y=F&&F.getAttribute("data-selected-variant-id"),v=(y?g.variants.find(N=>N.id===parseInt(y,10)):null)??null;if(v||(v=g.variants.find(N=>N.available)??null),!v)return;if(e.isInBundle(v.id)){e.removeVariant(v.id),D();return}let L=F?.querySelector("[data-row-qty]"),T=L?Math.max(1,parseInt(L.getAttribute("data-qty")||L.textContent||"",10)||1):Ze(g.id,e.rulesMap,v.id),H={productId:g.id,variantId:v.id,title:g.title,url:g.url||null,variantTitle:v.title,featuredImage:v.image||g.featuredImage||null,price:v.price,compareAtPrice:v.compareAtPrice||null,unitPrice:v.unitPrice||null,quantity:T},B=e.swapUnitsFor(g.id,v.id);if(B>0){e.swapVariant(H,Math.min(T,B)),D();return}e.atCapacity()||(e.addSelection(H),D())}function ne(){if(!A||!S)return;let h=[],M=Object.create(null);for(let V of o){let g=(V.type||"").trim();g&&!M[g]&&(M[g]=!0,h.push(g))}if(h.length<2){A.style.display="none",d?.classList.add("lb-mix-match__modal--filters-hidden");return}A.innerHTML="";for(let V of[Ae,...h]){let g=document.createElement("button");g.type="button",g.className="lb-mix-match__filter",g.setAttribute("data-filter",V),g.setAttribute("aria-pressed",V===k?"true":"false"),V===k&&g.classList.add("lb-mix-match__filter--active"),g.textContent=V===Ae?r.allTypes||"All":V,g.addEventListener("click",()=>{k=V,K(),$(s?s.value:"")}),A.appendChild(g)}}function K(){if(!A)return;let h=A.querySelectorAll("[data-filter]");for(let M=0;M<h.length;M++){let V=h[M].getAttribute("data-filter")===k;h[M].classList.toggle("lb-mix-match__filter--active",V),h[M].setAttribute("aria-pressed",V?"true":"false")}}function $(h){if(!u)return;let M=Se(h),V=u.querySelectorAll("[data-product-item]"),g=0;for(let F=0;F<V.length;F++){let y=V[F].getAttribute("data-title")??"",v=V[F].getAttribute("data-type")||"",L=(!M||y.indexOf(M)!==-1)&&(k===Ae||v===k);V[F].classList.toggle("lb-hidden",!L),L&&g++}p&&(p.style.display=g===0&&M.length>0?"":"none"),c&&(c.style.display=h.length>0?"":"none"),x&&(x.textContent=J(r.nProductsShown||"__COUNT__ products shown",{COUNT:g}))}if(s){let h=et(()=>$(s.value),Ro);s.addEventListener("input",h)}c&&c.addEventListener("click",()=>{s&&(s.value="",$(""),s.focus())});function P(){!a||f||(f=!0,q||(W(),q=!0),C||(ne(),C=!0),D(),k=Ae,K(),s&&(s.value=""),$(s?s.value:""),a.style.display="",a.offsetHeight,a.classList.add("lb-mix-match__modal-overlay--open"),rt(),setTimeout(()=>{s?s.focus():d?.focus()},50))}function E(){if(!a||!f)return;f=!1,a.classList.remove("lb-mix-match__modal-overlay--open"),ot(),setTimeout(()=>{f||(a.style.display="none")},qo);let h=e.fallbackFocus;h&&typeof h.focus=="function"&&setTimeout(()=>h.focus(),0)}if(b?.addEventListener("click",E),_?.addEventListener("click",E),a){let h=null;a.addEventListener("mousedown",M=>{h=M.target}),a.addEventListener("mouseup",M=>{M.target===a&&h===a&&E(),h=null})}return document.addEventListener("keydown",h=>{if(f){if(h.key==="Escape"){h.preventDefault(),E();return}if(h.key==="Tab"&&d){let M=nt(d);if(M.length===0){h.preventDefault();return}let V=M[0],g=M[M.length-1];h.shiftKey&&document.activeElement===V?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),V.focus())}}}),{open:P,close:E,isOpen:()=>f,refresh:D,overlay:a}}function Un(e,t){return Math.max(0,t-oe(e))}function Et(e,t){return oe(e)>=t}function zn(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].variantId===t&&(n+=e[r].quantity||0);return n}function it(e,t,n){let r=0;for(let o=0;o<e.length;o++){let i=e[o];i&&i.productId===t&&i.variantId!==n&&(r+=i.quantity||0)}return r}function Te(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=X(t.productId,n);if(!r.required)return!0;let o=0;for(let i=0;i<e.length;i++){let a=e[i];a!==t&&a.productId===t.productId&&(o+=a.quantity||1)}return o>=r.min}function It(e,t,n,r){let o=X(t,r);return!o.required||o.max!==o.min||me(e,n)!==-1?0:it(e,t,n)}function No(){let e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");t.setAttribute("width","16"),t.setAttribute("height","16"),t.setAttribute("viewBox","0 0 20 20"),t.setAttribute("fill","none");for(let[n,r,o,i]of[["5","5","15","15"],["15","5","5","15"]]){let a=document.createElementNS(e,"line");a.setAttribute("x1",n),a.setAttribute("y1",r),a.setAttribute("x2",o),a.setAttribute("y2",i),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke-linecap","round"),t.appendChild(a)}return t}function at(e,t,n,r,o,i){let a=document.createElement("div");a.className="lb-mix-match__slot lb-mix-match__slot--filled";let l=document.createElement("div");if(l.className="lb-bundle-thumbnail",e.featuredImage){let b=document.createElement("img");b.src=ke(e.featuredImage,240),b.srcset=Ie(e.featuredImage,On),b.sizes=Hn,b.alt=e.title,b.loading="lazy",l.appendChild(b)}a.appendChild(l);let d=document.createElement("div");d.className="lb-mix-match__filled-info";let s=document.createElement("button");if(s.type="button",s.className="lb-mix-match__filled-title",s.textContent=e.title,s.setAttribute("aria-label",(t.editSelection||"Edit selection")+": "+e.title),d.appendChild(s),e.variantTitle&&e.variantTitle!=="Default Title"){let b=document.createElement("span");b.className="lb-mix-match__filled-variant",b.textContent=e.variantTitle,d.appendChild(b)}let c=document.createElement("span");c.className="lb-mix-match__filled-price";let u=e.compareAtPrice||0;if(u>e.price){let b=document.createElement("s");b.className="lb-mix-match__filled-compare",b.textContent=n(u),c.appendChild(b)}let p=document.createElement("span");p.className="lb-bundle-product-price",p.textContent=n(e.price),c.appendChild(p);let x=document.createElement("span");if(x.className="lb-bundle-qty-inline",x.textContent="\xD7"+(e.quantity||1),c.appendChild(x),d.appendChild(c),e.unitPrice){let b=document.createElement("span");b.className="lb-bundle-product-unit-price",b.textContent=e.unitPrice,d.appendChild(b)}if(a.appendChild(d),r){let b=document.createElement("button");b.type="button",b.className="lb-mix-match__slot-remove",b.setAttribute("aria-label",(t.removeItem||"Remove")+" "+e.title),b.appendChild(No()),b.addEventListener("click",_=>{_.stopPropagation(),o()}),a.appendChild(b)}else{let b=document.createElement("span");b.className="lb-mix-match__slot-required",b.textContent=t.required||"Required",a.appendChild(b)}return a.addEventListener("click",i),a}function Qn(e,t,n,r,o){let i=r.translations||{},a=e.querySelector("[data-selection-slots]");if(a){a.innerHTML="";for(let s=0;s<t.length;s++){let c=s;a.appendChild(at(t[c],i,o.formatMoney,Te(t,t[c],o.rulesMap),()=>o.onRemove(c),o.onEdit))}}let l=e.querySelector("[data-add-product-trigger]");l&&(l.style.display=oe(t)>=n?"none":"");let d=e.querySelector("[data-add-bundle]");if(d){d.disabled=oe(t)<n;let s=d.querySelector("[data-cta-label]");s&&(s.textContent=d.getAttribute("data-cta-text")||i.addToCart||"Add to cart")}}function Wn(e,t,n,r,o,i){let a=e.querySelector("[data-pricing-section]");if(oe(t)<n){a&&(a.style.display="none");return}a&&(a.style.display="");let l=0;for(let d=0;d<t.length;d++)l+=t[d].price*(t[d].quantity||1);l>0&&r.discountType&&i(e,o(l,r.discountType,r.discountValue??0),l)}function jn(e,t,n,r,o){let i=Math.min(oe(n),r),a=Math.max(0,r-i),l=[e];t&&l.push(t);for(let d of l){let s=d.querySelectorAll("[data-progress-segment]");for(let x=0;x<s.length;x++)s[x].classList.toggle("lb-mix-match__progress-segment--filled",x<i);let c=d.querySelector("[data-progress-count]");c&&(c.textContent=Je(i,r,o));let u=d.querySelector("[data-progress-remaining]");u&&(u.textContent=Pn(a,o));let p=d.querySelector(".lb-mix-match__progress-segments");p&&p.setAttribute("aria-valuenow",String(i))}}function lt(e){return(t,n,r)=>{let o=t.querySelector("[data-sale-price]"),i=t.querySelector("[data-compare-price]"),a=t.querySelector("[data-savings-bar]"),l=t.querySelector("[data-savings-amount]"),d=t.querySelector("[data-savings-percent]"),s=r-n;if(o&&(o.textContent=e(n)),i&&(s>0?(i.textContent=e(r),i.style.display=""):i.style.display="none"),a)if(s>0){if(l&&(l.textContent=e(s)),d){let c=r>0?Math.round(s*100/r):0;d.textContent="("+c+"%)"}a.style.display=""}else a.style.display="none"}}function $n(e,t,n,r){let o=c=>c.variants.find(u=>u.available)??null,i=(c,u,p)=>({productId:c.id,variantId:u.id,title:c.title,url:c.url||null,variantTitle:u.title,featuredImage:c.featuredImage||null,price:u.price,compareAtPrice:u.compareAtPrice||null,unitPrice:u.unitPrice||null,quantity:p}),a=[];for(let c of e){if(!c.available||!c.variants)continue;let u=!1;for(let b of c.variants){let _=pe(b.id,t);!_?.required||!b.available||(a.push(i(c,b,Math.max(1,_.min))),u=!0)}if(u)continue;let p=X(c.id,t);if(!p.required)continue;let x=o(c);x&&a.push(i(c,x,Math.max(1,p.min)))}if(a.length||!r?.enabled)return a;let l=c=>c.available&&X(c.id,t).min<=n,d=(r.currentProductId!=null?e.find(c=>c.id===r.currentProductId&&l(c)):null)??e.find(l);if(!d)return[];let s=o(d);return s?[i(d,s,X(d.id,t).min)]:[]}function Gn(e){let t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("width","20"),n.setAttribute("height","20"),n.setAttribute("viewBox","0 0 20 20"),n.setAttribute("fill","none");for(let[r,o,i,a]of e){let l=document.createElementNS(t,"line");l.setAttribute("x1",r),l.setAttribute("y1",o),l.setAttribute("x2",i),l.setAttribute("y2",a),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","2"),l.setAttribute("stroke-linecap","round"),n.appendChild(l)}return n}function j(e,t,n={}){let r=document.createElement(e);t&&(r.className=t);for(let o in n)r.setAttribute(o,n[o]);return r}function st(e){let t="lb-modal-title-"+e.domId,n=j("div","lb-mix-match__modal-overlay",{"data-modal-overlay":"","data-bundle-gid":e.bundleGid,style:"display: none;"}),r=j("div","lb-mix-match__modal"+(e.showTypeFilters?"":" lb-mix-match__modal--filters-hidden"),{role:"dialog","aria-modal":"true","aria-labelledby":t,tabindex:"-1"}),o=j("div","lb-mix-match__modal-header"),i=j("div","lb-mix-match__modal-header-top"),a=j("div","lb-mix-match__modal-heading"),l=j("h4","lb-mix-match__modal-title",{id:t});e.wizard&&l.setAttribute("tabindex","-1"),l.textContent="Add to your bundle",a.appendChild(l),a.appendChild(j("p","lb-mix-match__modal-subtitle",{"data-modal-subtitle":""})),i.appendChild(a);let d=j("button","lb-mix-match__modal-close",{type:"button","data-modal-close":"","aria-label":"Close"});d.appendChild(Gn([["5","5","15","15"],["15","5","5","15"]])),i.appendChild(d),o.appendChild(i);let s=j("div","lb-mix-match__progress lb-mix-match__modal-progress",{"data-progress":""}),c=j("div","lb-mix-match__progress-segments",{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":String(e.segmentCount??0)});if(e.wizard)c.setAttribute("data-modal-step-segments","");else for(let _=0;_<(e.segmentCount??0);_++)c.appendChild(j("span","lb-mix-match__progress-segment",{"data-progress-segment":""}));if(s.appendChild(c),o.appendChild(s),r.appendChild(o),e.showSearch){let _=j("div","lb-mix-match__modal-search"),I=j("input","lb-mix-match__modal-search-input",{type:"text","data-modal-search":"",role:"searchbox","aria-label":"Search products",placeholder:"Search products",autocomplete:"off"});_.appendChild(I);let w=j("button","lb-mix-match__modal-search-clear",{type:"button","data-modal-search-clear":"","aria-label":"Clear search",style:"display: none;"});w.appendChild(Gn([["5","5","15","15"],["15","5","5","15"]])),_.appendChild(w),r.appendChild(_)}e.showTypeFilters&&r.appendChild(j("div","lb-mix-match__filters",{"data-modal-filters":"",role:"group","aria-label":"Filter by type"})),r.appendChild(j("div","lb-mix-match__modal-list",{"data-modal-list":""}));let u=j("div","lb-mix-match__modal-empty",{"data-modal-empty":"",style:"display: none;"}),p=document.createElement("p");p.textContent="No products match your search",u.appendChild(p),r.appendChild(u),r.appendChild(j("span","lb-visually-hidden",{"data-modal-live":"","aria-live":"polite"}));let x=j("div",e.wizard?"lb-mix-match__modal-footer lb-multi-step__modal-footer":"lb-mix-match__modal-footer");if(e.wizard){let _=j("button","lb-multi-step__modal-back",{type:"button","data-modal-back":"",style:"display: none;"});_.textContent="Back",x.appendChild(_)}if(x.appendChild(j("span","lb-mix-match__modal-footer-count",{"data-modal-footer-count":"","aria-live":"polite"})),e.wizard){let _=j("button","lb-mix-match__modal-done",{type:"button","data-modal-next":"",style:"display: none;"});_.textContent="Next",x.appendChild(_)}let b=j("button","lb-mix-match__modal-done",{type:"button","data-modal-done":"",...e.wizard?{style:"display: none;"}:{}});return b.textContent="Done",x.appendChild(b),r.appendChild(x),n.appendChild(r),n}function Kn(e,t,n,r,o,i){let a=t.widgetConfig,l=ue,d=t.minQuantity||1,s=Xe(t.productRules,t.variantRules),u=Ve(t).map((f,m)=>({id:Number(f.productId),title:f.title??"",url:f.url??null,type:t.products[m]?.productType??"",featuredImage:f.featuredImage??null,available:f.variants.some(O=>O.available),optionNames:f.optionNames,variants:f.variants.map(O=>({id:Number(O.id),title:O.title,options:O.options,available:O.available,price:O.price,compareAtPrice:O.compareAtPrice,unitPrice:O.unitPrice,image:O.image,inventoryQuantity:null}))}));if(!u.length)return;let p=u.filter(f=>f.available).length;if(n==="hide"&&p===0)return;let x=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),b=de("lb-mix-match",{title:t.title,subtitle:t.description,showSavingsBar:a.savingsBar?.visible!==!1,showComparePrice:a.pricing?.showCompareAtPrice!==!1,ctaText:a.cta?.ctaText||l.addToCart||"Add to cart",endsAt:a.countdown?.showCountdown===!1?null:t.endsAt});b.root.setAttribute("data-required-quantity",String(d)),b.products.before(je(d));let _=document.createElement("div");_.className="lb-mix-match__slots lb-edge-fade",_.setAttribute("data-selection-slots",""),b.products.replaceWith(_);let I=document.createElement("button");I.type="button",I.className="lb-mix-match__add-product",I.setAttribute("data-add-product-trigger",""),I.textContent=(l.addItem,"Add a product"),_.after(I);let w=st({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:a.showSearch!==!1,showTypeFilters:a.mixMatchShowTypeFilters!==!1,segmentCount:d,wizard:!1});b.root.appendChild(w);let A=i?t.products.findIndex(f=>f.handle===i):-1,S=$n(u,s,d,{enabled:!!i,currentProductId:A!==-1?u[A]?.id??null:null}),k={remainingSpots:()=>Un(S,d),ownQty:f=>qn(S,f),variantUnitsElsewhere:f=>zn(S,f),productUnitsElsewhere:(f,m)=>it(S,f,m),swapUnits:(f,m)=>It(S,f,m,s),isInBundle:f=>me(S,f)!==-1,canRemove:f=>{let m=me(S,f);return m!==-1&&Te(S,S[m],s)},isFull:()=>Et(S,d),commitQty:(f,m)=>{let O=me(S,f);return O===-1||S[O].quantity===m?!1:(S[O].quantity=m,!0)}};function q(){Qn(b.root,S,d,t,{formatMoney:x,rulesMap:s,onRemove:f=>{Te(S,S[f],s)&&(S.splice(f,1),q(),C.isOpen()&&C.refresh())},onEdit:()=>C.open()}),Wn(b.root,S,d,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(f,m,O)=>De(f,m,O),lt(x)),jn(b.root,C.overlay,S,d,l)}let C=Vn({container:b.root,data:{translations:l,discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},t:l,rulesMap:s,eligibleProducts:u,requiredQty:d,showQtySelector:a.mixMatchShowQuantitySelector!==!1,items:S,formatMoney:x,rowCapacity:k,dropdown:void 0,portalTarget:null,fallbackFocus:I,onSelectionChanged:q,addSelection:f=>{if(oe(S)+(f.quantity||1)>d)return;let m=pe(f.variantId,s)?.max,O=X(f.productId,s).max-it(S,f.productId,f.variantId);typeof m=="number"&&(O=Math.min(O,m)),!((f.quantity||1)>O)&&(S.push(f),q())},removeVariant:f=>{let m=me(S,f);m===-1||!Te(S,S[m],s)||(S.splice(m,1),q())},swapVariant:(f,m)=>{let O=0;for(let U=S.length-1;U>=0&&O<m;U--){let D=S[U];if(D.productId!==f.productId||D.variantId===f.variantId)continue;let W=Math.min(D.quantity||1,m-O);W>=(D.quantity||1)?S.splice(U,1):D.quantity=(D.quantity||1)-W,O+=W}O>0&&(f.quantity=O,S.push(f),q())},swapUnitsFor:(f,m)=>It(S,f,m,s),isInBundle:f=>me(S,f)!==-1,atCapacity:()=>Et(S,d)});I.addEventListener("click",()=>{C.isOpen()||C.open()}),b.cta.addEventListener("click",()=>{oe(S)<d||r(S.map(f=>({merchandiseId:"gid://shopify/ProductVariant/"+f.variantId,quantity:f.quantity||1,attributes:se(t.id,t.bundleType)})))}),e.appendChild(b.root),ce(b.root),q(),o?.(he(b.root))}function Yn(e,t,n){if(t==="fixed_amount"){let o=parseInt(n.getAttribute("data-tier-amt")??"",10)||0;return Math.max(0,e-o)}let r=parseInt(n.getAttribute("data-tier-pct")??"",10)||0;return Math.max(0,e-Math.floor(e*r/100))}function Oo(e,t,n){let r=parseInt(n.getAttribute("data-tier-qty")??"",10),o=Yn(e,t,n),i=o*r,a=e*r;return{qty:r,priceEach:o,totalPrice:i,undiscountedTotal:a,totalSavings:a-i}}function Ho(e,t){if(!t.itemCount)return null;let n=new Intl.PluralRules(t.locale||"en").select(e);return" ("+(t.itemCount[n]||t.itemCount.other||"__COUNT__").split("__COUNT__").join(String(e))+")"}function Jn(e,t,n,r){for(let o=0;o<e.length;o++){let i=e[o],a=i.querySelector("[data-tier-price-each]");a&&(a.textContent=r(Yn(t,n,i)));let l=i.querySelector(".lb-volume__tier-compare");l&&(l.textContent=r(t))}}function Xn(e,t,n,r,o,i,a){for(let w=0;w<t.length;w++)t[w].setAttribute("aria-checked",w===o?"true":"false"),t[w].setAttribute("tabindex",w===o?"0":"-1");let{qty:l,totalPrice:d,undiscountedTotal:s,totalSavings:c}=Oo(n,r,t[o]),u=e.querySelector("[data-item-count]");if(u){let w=Ho(l,i);w!==null&&(u.textContent=w)}let p=e.querySelector("[data-total-price]");p&&(p.textContent=a(d));let x=e.querySelector("[data-compare-price]");x&&(c>0?(x.textContent=a(s),x.style.display=""):x.style.display="none");let b=e.querySelector("[data-savings-bar]"),_=e.querySelector("[data-savings-amount]"),I=e.querySelector("[data-savings-percent]");if(b)if(c>0){if(_&&(_.textContent=a(c)),I){let w=s>0?Math.round(c*100/s):0;I.textContent="("+w+"%)"}b.style.display=""}else b.style.display="none"}function Zn(e,t,n,r){let o=t.widgetConfig,i=t.products[0];if(!i)return;let a=i.variants.nodes,l=a.find(C=>C.availableForSale)??a[0];if(!l)return;let d=a.some(C=>C.availableForSale);if(n==="hide"&&!d)return;let s=Fe(l.price.amount),c=t.discountConfig.discountType,u=le(i.priceRange.minVariantPrice.currencyCode),p=ue,x=nn(t.volumeTiers,c),b=rn(o.defaultTier,t.volumeTiers.length,x),_=on(o.popularBadge?.tierIndex,o.popularBadge?.visible!==!1,x),I=t.volumeTiers.map((C,f)=>{let m=c==="fixed_amount"?0:Math.round(C.percentage??0),O=c==="fixed_amount"?Math.round((C.amount??0)*100):0,U=c==="fixed_amount"?Math.max(0,s-O):Math.max(0,s-Math.floor(s*m/100)),D=s>0?Math.round((s-U)*100/s):0;return{quantity:C.minQuantity,percent:m,amountCents:O,label:J(p.buyQty||"Buy __COUNT__",{COUNT:C.minQuantity}),savingsLabel:D>0?"Save "+D+"%":null,badgeLabel:f===_?o.popularBadge?.text||"Most popular":null,selected:f===b}});if(!I.length)return;let w=de("lb-volume",{title:t.title,subtitle:t.description,summaryLabel:"Total",withItemCount:o.pricing?.showItemCount!==!1,totalPriceSlot:!0,showSavingsBar:o.savingsBar?.visible!==!1,showComparePrice:o.pricing?.showCompareAtPrice!==!1,ctaText:o.cta?.ctaText||p.addToCart||"Add to cart",endsAt:o.countdown?.showCountdown===!1?null:t.endsAt}),A=wn(I,"Select quantity",{showCompare:o.pricing?.showComparePrice!==!1,showPriceEach:o.pricing?.showPerUnitPrice!==!1,unitLabel:(p.each||"each").trim()});w.products.replaceWith(A);let S=A.querySelectorAll("[data-tier-index]");Jn(S,s,c,u);let k=b,q=()=>Xn(w.root,S,s,c,k,p,u);if(A.addEventListener("click",C=>{let f=C.target.closest("[data-tier-index]");f&&(k=parseInt(f.getAttribute("data-tier-index")??"",10)||0,q())}),A.addEventListener("keydown",C=>{C.key==="ArrowDown"||C.key==="ArrowRight"?(C.preventDefault(),k=Math.min(k+1,S.length-1),q(),S[k].focus()):(C.key==="ArrowUp"||C.key==="ArrowLeft")&&(C.preventDefault(),k=Math.max(k-1,0),q(),S[k].focus())}),d)w.cta.addEventListener("click",()=>{let C=parseInt(S[k].getAttribute("data-tier-qty")??"",10);r([{merchandiseId:l.id,quantity:C,attributes:se(t.id,t.bundleType)}])});else{w.cta.disabled=!0;let C=w.cta.querySelector("[data-cta-label]");C&&(C.textContent=p.outOfStock||"Out of stock")}e.appendChild(w.root),ce(w.root),q()}function dt(e,t){return e-Math.floor(e*t/100)}function Do(e,t,n,r){let o=Y(e[0],e[0].selectedVariantId),i=Y(e[1],e[1].selectedVariantId),a=o.price*n+i.price*r,l=o.price*n+dt(i.price,t)*r;return{totalPrice:a,salePrice:l,savings:a-l}}function Mt(e,t,n,r,o){let i=e.querySelector("[data-product-price]"),a=e.querySelector("[data-product-compare-price]");if(i){if(r&&n>0){i.textContent=o(dt(t.price,n)),a&&(a.textContent=o(t.price),a.hidden=!1);return}if(i.textContent=o(t.price),a){let l=t.compareAtPrice;l&&l>t.price?(a.textContent=o(l),a.hidden=!1):(a.textContent="",a.hidden=!0)}}}function At(e,t,n,r,o,i){let{totalPrice:a,salePrice:l,savings:d}=Do(t,n,r,o),s=e.querySelector("[data-sale-price]"),c=e.querySelector("[data-compare-price]"),u=e.querySelector("[data-savings-bar]"),p=e.querySelector("[data-savings-amount]"),x=e.querySelector("[data-savings-percent]");if(s&&(s.textContent=i(l)),c&&(d>0?(c.textContent=i(a),c.style.display=""):c.style.display="none"),u)if(d>0){if(p&&(p.textContent=i(d)),x){let b=a>0?Math.round(d*100/a):0;x.textContent="("+b+"%)"}u.style.display=""}else u.style.display="none"}function er(e,t,n,r){let o=Y(e[0],e[0].selectedVariantId),i=Y(e[1],e[1].selectedVariantId),a={variantId:Number(e[0].selectedVariantId),quantity:n,priceCents:(o.price||0)*n},l=dt(i.price||0,t)*r;return String(e[0].selectedVariantId)===String(e[1].selectedVariantId)?[{variantId:a.variantId,quantity:n+r,priceCents:(a.priceCents??0)+l}]:[a,{variantId:Number(e[1].selectedVariantId),quantity:r,priceCents:l}]}function Fo(){let e=document.createElement("div");return e.className="lb-bogo__plus",e.setAttribute("aria-hidden","true"),e.innerHTML='<svg width="12" height="12" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><line x1="9" y1="3" x2="9" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><line x1="3" y1="9" x2="15" y2="9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',e}function tr(e,t,n,r,o){let i=t.widgetConfig,a=t.products.find(A=>A.id===t.buyProductId),l=t.products.find(A=>A.id===t.getProductId);if(!a||!l)return;let d=t.buyQuantity,s=t.getQuantity,c=t.discountConfig.discountValue,u={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},p=[{..._e(a,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[0]??null}),role:"buy"},{..._e(l,t.id,{quantities:u,allowedVariantIds:t.selectedVariantIds?.[1]??null}),role:"get"}],x=p.filter(A=>!A.variants.some(S=>S.available)).length;if(n==="hide"&&x>0)return;let b=le(a.priceRange.minVariantPrice.currencyCode),_=ue,I=de("lb-bogo",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||_.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});I.root.setAttribute("data-discount-value",String(c)),I.root.setAttribute("data-buy-qty",String(d)),I.root.setAttribute("data-get-qty",String(s));let w=c>=100?"Free":c+"% off";if(p.forEach((A,S)=>{let k=S===1;k&&I.products.appendChild(Fo());let q=!A.variants.some(m=>m.available),C=We(A,_,{isOos:q,href:A.url,bogoRole:A.role,inlineQuantity:k?s:d,badgeText:k&&!q?w:null});if(I.products.appendChild(C),q)return;let f=Y(A,A.selectedVariantId);ze(C,A,f),Qe(C,f,A.featuredImage),Mt(C,f,c,k,b),Ue(C,()=>A,m=>{Qe(C,m,A.featuredImage),Mt(C,m,c,k,b),At(I.root,p,c,d,s,b)})}),x>0){I.cta.disabled=!0;let A=I.cta.querySelector("[data-cta-label]");A&&(A.textContent=$e(_,x))}else I.cta.addEventListener("click",()=>{r(er(p,c,d,s).map(A=>({merchandiseId:"gid://shopify/ProductVariant/"+A.variantId,quantity:A.quantity,attributes:se(t.id,t.bundleType)})))});e.appendChild(I.root),ce(I.root),At(I.root,p,c,d,s,b),o?.(he(I.root))}function Lt(e,t,n){return J(n.stepOf||"Step __STEP__ of __TOTAL__",{STEP:e+1,TOTAL:t})}function Le(e,t,n){return J(n.ofSelected||"__COUNT__ of __TOTAL__ added",{COUNT:e,TOTAL:t})}function nr(e,t,n){return J(n.stepsCompleted||"__COUNT__ of __TOTAL__ steps completed",{COUNT:e,TOTAL:t})}function rr(e,t){return e>0?J(t.moreToGo||"__COUNT__ more to go",{COUNT:e}):t.complete||"Complete"}function fe(e,t){let n=0;for(let r=0;r<e[t].length;r++)n+=e[t][r].quantity||1;return n}function ye(e,t,n){return fe(e,n)>=(t[n].minQuantity||1)}function Ee(e,t,n){let r=t[n].maxQuantity;return r==null?1/0:Math.max(0,r-fe(e,n))}function Pe(e,t){for(let n=0;n<t.length;n++)if(!ye(e,t,n))return!1;return!0}function Be(e,t,n){if(pe(t.variantId,n)?.required)return!1;let r=X(t.productId,n);if(!r.required)return!0;let o=0;for(let i of e)for(let a of i)a!==t&&a.productId===t.productId&&(o+=a.quantity||1);return o>=r.min}function Pt(e,t,n,r,o){let i=X(n,o);if(!i.required||i.max!==i.min||we(e,t,r)!==-1)return 0;let a=0;for(let l of e[t])l.productId===n&&l.variantId!==r&&(a+=l.quantity||1);return a}function we(e,t,n){for(let r=0;r<e[t].length;r++)if(e[t][r].variantId===n)return r;return-1}function or(e){let{container:t,steps:n,selections:r,t:o}=e;for(let i=0;i<n.length;i++){let a=n[i].minQuantity||1,l=t.querySelector('[data-step-count="'+i+'"]');l&&(l.textContent=Le(Math.min(fe(r,i),a),a,o),l.classList.toggle("lb-multi-step__group-count--met",ye(r,n,i)));let d=t.querySelector('[data-step-slots="'+i+'"]');if(d){d.innerHTML="";for(let s=0;s<r[i].length;s++){let c=i,u=s,p=r[c][u];d.appendChild(at(p,o,e.formatMoney,Be(r,p,e.rulesMap),()=>e.onRemove(c,u),()=>e.onEdit(c)))}}}for(let i=0;i<n.length;i++){let a=t.querySelector('[data-step-trigger="'+i+'"]');a&&(a.style.display=Ee(r,n,i)===0?"none":"")}}function ir(e,t,n,r){let{container:o,steps:i,selections:a}=e,l=o.querySelector("[data-pricing-section]");if(!Pe(a,i)){l&&(l.style.display="none");return}l&&(l.style.display="");let d=0;for(let s of a)for(let c of s)d+=c.price*(c.quantity||1);d>0&&t.discountType&&r(o,n(d,t.discountType,t.discountValue??0),d)}function ar(e){let{container:t,steps:n,selections:r,t:o}=e,i=0;for(let u=0;u<n.length;u++)ye(r,n,u)&&(i+=1);let a=n.length-i,l=t.querySelectorAll("[data-progress] [data-progress-segment]");for(let u=0;u<l.length;u++)l[u].classList.toggle("lb-mix-match__progress-segment--filled",u<i);let d=t.querySelector("[data-progress-count]");d&&(d.textContent=nr(i,n.length,o));let s=t.querySelector("[data-progress-remaining]");s&&(s.textContent=rr(a,o));let c=t.querySelector(".lb-mix-match__progress-segments");c&&c.setAttribute("aria-valuenow",String(i))}function lr(e){let t=e.container.querySelector("[data-add-bundle]");if(!t)return;t.disabled=!Pe(e.selections,e.steps);let n=t.querySelector("[data-cta-label]");n&&(n.textContent=t.getAttribute("data-cta-text")||e.t.addToCart||"Add to cart")}function sr(e){let t=Object.create(null),n=[];for(let r of e)for(let o of r){let i=o.quantity||1,a=String(o.variantId);t[a]?(t[a].quantity+=i,t[a].priceCents=(t[a].priceCents??0)+(o.price||0)*i):(t[a]={variantId:o.variantId,quantity:i,priceCents:(o.price||0)*i},n.push(a))}return n.map(r=>t[r])}var qe="__all__",Vo=300,Uo=200;function dr(e){let{container:t,steps:n,selections:r,t:o}=e,i=t.querySelector("[data-modal-overlay]");i&&e.portalTarget&&e.portalTarget.appendChild(i);let a=y=>i?i.querySelector(y):null,l=a('[role="dialog"]'),d=a(".lb-mix-match__modal-title"),s=a("[data-modal-search]"),c=a("[data-modal-search-clear]"),u=a("[data-modal-list]"),p=a("[data-modal-empty]"),x=a("[data-modal-live]"),b=a("[data-modal-close]"),_=a("[data-modal-back]"),I=a("[data-modal-next]"),w=a("[data-modal-done]"),A=a("[data-modal-footer-count]"),S=a("[data-modal-subtitle]"),k=a("[data-modal-step-segments]"),q=a("[data-modal-filters]"),C=qe,f=!1,m=0,O=[],U=y=>n[y].eligibleProducts||[],D={remainingSpots:()=>Ee(r,n,m),ownQty:y=>{let v=we(r,m,y);return v===-1?0:r[m][v].quantity||0},variantUnitsElsewhere:y=>{let v=0;for(let L of r)for(let T of L)T.variantId===y&&(v+=T.quantity||0);return v},productUnitsElsewhere:(y,v)=>{let L=0;for(let T=0;T<r.length;T++)for(let H of r[T])H.productId===y&&(T===m&&H.variantId===v||(L+=H.quantity||0));return L},swapUnits:(y,v)=>Pt(r,m,y,v,e.rulesMap),isInBundle:y=>we(r,m,y)!==-1,canRemove:y=>{let v=we(r,m,y);return v!==-1&&e.canRemove(r[m][v])},isFull:()=>Ee(r,n,m)===0,commitQty:(y,v)=>{let L=we(r,m,y);return L===-1||r[m][L].quantity===v?!1:(r[m][L].quantity=v,!0)}};function W(y){if(!k)return;let v=n[y].minQuantity||1;k.innerHTML="",k.setAttribute("aria-valuemax",String(v));for(let L=0;L<v;L++){let T=document.createElement("span");T.className="lb-mix-match__progress-segment",T.setAttribute("data-progress-segment",""),k.appendChild(T)}te()}function te(){if(!k)return;let y=n[m].minQuantity||1,v=Math.min(fe(r,m),y),L=k.querySelectorAll("[data-progress-segment]");for(let T=0;T<L.length;T++)L[T].classList.toggle("lb-mix-match__progress-segment--filled",T<v);k.setAttribute("aria-valuenow",String(v))}function ne(){let y=n[m].minQuantity||1,v=Math.min(fe(r,m),y);A&&(A.textContent=Le(v,y,o)),S&&(S.textContent=Lt(m,n.length,o)+" \xB7 "+(n[m].name||""));let L=ye(r,n,m),T=m===n.length-1;_&&(_.style.display=m>0?"":"none"),I&&(I.style.display=T?"none":"",I.disabled=!L),w&&(w.style.display=T?"":"none",w.disabled=!L),te()}function K(){for(let y of O)y.refresh();ne()}function $(y){if(!u)return;e.dropdown?.unbindAll(u),u.innerHTML="",O=[];let v=U(y);for(let L=0;L<v.length;L++){let T=tt(v[L],L,{t:o,rulesMap:e.rulesMap,capacity:D,showQtySelector:e.showQtySelector,formatMoney:e.formatMoney,onCommittedQtyChanged:()=>{e.onSelectionChanged(),K()}});O.push(T),u.appendChild(T.el)}e.dropdown?.bindAll(u)}function P(y){let v=y.target.closest("[data-add-product]");if(!v||v.disabled)return;let T=U(m)[parseInt(v.getAttribute("data-add-product")??"",10)];if(!T)return;let H=v.closest(".lb-mix-match__modal-product"),B=H&&H.getAttribute("data-selected-variant-id"),N=(B?T.variants.find(ee=>ee.id===parseInt(B,10)):null)??null;if(N||(N=T.variants.find(ee=>ee.available)??null),!N)return;let z=we(r,m,N.id);if(z!==-1){if(!e.canRemove(r[m][z]))return;r[m].splice(z,1),e.onSelectionChanged(),K();return}let Q=H?.querySelector("[data-row-qty]"),G=Q?Math.max(1,parseInt(Q.getAttribute("data-qty")||Q.textContent||"",10)||1):Ze(T.id,e.rulesMap,N.id),Z={productId:T.id,variantId:N.id,title:T.title,url:T.url||null,variantTitle:N.title,featuredImage:N.image||T.featuredImage||null,price:N.price,compareAtPrice:N.compareAtPrice||null,unitPrice:N.unitPrice||null,quantity:G},be=Pt(r,m,T.id,N.id,e.rulesMap);if(be>0){e.swapVariant(m,Z,Math.min(G,be)),K();return}let ge=Ee(r,n,m);ge!==1/0&&G>ge||(r[m].push(Z),e.onSelectionChanged(),K())}u&&u.addEventListener("click",P);function E(y){if(!q||!e.showTypeFilters)return;let v=[],L=Object.create(null);for(let T of U(y)){let H=(T.type||"").trim();H&&!L[H]&&(L[H]=!0,v.push(H))}if(v.length<2){q.style.display="none",l?.classList.add("lb-mix-match__modal--filters-hidden");return}q.style.display="",l?.classList.remove("lb-mix-match__modal--filters-hidden"),q.innerHTML="";for(let T of[qe,...v]){let H=document.createElement("button");H.type="button",H.className="lb-mix-match__filter",H.setAttribute("data-filter",T),H.setAttribute("aria-pressed",T===C?"true":"false"),T===C&&H.classList.add("lb-mix-match__filter--active"),H.textContent=T===qe?o.allTypes||"All":T,H.addEventListener("click",()=>{C=T,h(),M(s?s.value:"")}),q.appendChild(H)}}function h(){if(!q)return;let y=q.querySelectorAll("[data-filter]");for(let v=0;v<y.length;v++){let L=y[v].getAttribute("data-filter")===C;y[v].classList.toggle("lb-mix-match__filter--active",L),y[v].setAttribute("aria-pressed",L?"true":"false")}}function M(y){if(!u)return;let v=Se(y),L=u.querySelectorAll("[data-product-item]"),T=0;for(let H=0;H<L.length;H++){let B=L[H].getAttribute("data-title")??"",N=L[H].getAttribute("data-type")||"",z=(!v||B.indexOf(v)!==-1)&&(C===qe||N===C);L[H].classList.toggle("lb-hidden",!z),z&&T++}p&&(p.style.display=T===0&&v.length>0?"":"none"),c&&(c.style.display=y.length>0?"":"none"),x&&(x.textContent=J(o.nProductsShown||"__COUNT__ products shown",{COUNT:T}))}if(s){let y=et(()=>M(s.value),Uo);s.addEventListener("input",y)}c&&c.addEventListener("click",()=>{s&&(s.value="",M(""),s.focus())});function V(y,v={}){if(m=Math.max(0,Math.min(n.length-1,y)),$(m),E(m),C=qe,h(),s&&(s.value=""),M(""),W(m),K(),x){let L=n[m].minQuantity||1;x.textContent=Lt(m,n.length,o)+". "+(n[m].name||"")+". "+Le(Math.min(fe(r,m),L),L,o)}!v.skipFocus&&d&&typeof d.focus=="function"&&d.focus()}function g(y){!i||f||(f=!0,V(typeof y=="number"?y:0,{skipFocus:!0}),i.style.display="",i.offsetHeight,i.classList.add("lb-mix-match__modal-overlay--open"),rt(),setTimeout(()=>{s?s.focus():l?.focus()},50))}function F(){if(!i||!f)return;f=!1,i.classList.remove("lb-mix-match__modal-overlay--open"),ot(),setTimeout(()=>{f||(i.style.display="none")},Vo);let y=t.querySelector('[data-step-trigger="'+m+'"]'),v=y&&y.offsetParent!==null?y:e.ctaButton;v&&typeof v.focus=="function"&&setTimeout(()=>v.focus(),0)}if(b?.addEventListener("click",F),w?.addEventListener("click",F),_?.addEventListener("click",()=>{m>0&&V(m-1)}),I?.addEventListener("click",()=>{m<n.length-1&&ye(r,n,m)&&V(m+1)}),i){let y=null;i.addEventListener("mousedown",v=>{y=v.target}),i.addEventListener("mouseup",v=>{v.target===i&&y===i&&F(),y=null})}return document.addEventListener("keydown",y=>{if(f){if(y.key==="Escape"){y.preventDefault(),F();return}if(y.key==="Tab"&&l){let v=nt(l);if(v.length===0){y.preventDefault();return}let L=v[0],T=v[v.length-1];y.shiftKey&&document.activeElement===L?(y.preventDefault(),T.focus()):!y.shiftKey&&document.activeElement===T&&(y.preventDefault(),L.focus())}}}),{open:g,close:F,isOpen:()=>f,refresh:K}}function cr(e,t,n,r,o){let i=t.widgetConfig,a=ue,l=Xe(t.productRules,t.variantRules),d=t.steps??[];if(!d.length)return;let s={productQuantities:t.productQuantities,variantQuantities:t.variantQuantities},c=d.map((k,q)=>ln(t,q).map(C=>{let f=_e(C,t.id,{quantities:s,allowedVariantIds:null});return{id:Number(f.productId),title:f.title??"",url:f.url??null,type:C.productType??"",featuredImage:f.featuredImage??null,available:f.variants.some(m=>m.available),optionNames:f.optionNames,variants:f.variants.map(m=>({id:Number(m.id),title:m.title,options:m.options,available:m.available,price:m.price,compareAtPrice:m.compareAtPrice,unitPrice:m.unitPrice,image:m.image,inventoryQuantity:null}))}})),u=c.some(k=>k.some(q=>q.available));if(n==="hide"&&!u)return;let p=le(t.products[0]?.priceRange.minVariantPrice.currencyCode??"USD"),x=de("lb-multi-step",{title:t.title,subtitle:t.description,showSavingsBar:i.savingsBar?.visible!==!1,showComparePrice:i.pricing?.showCompareAtPrice!==!1,ctaText:i.cta?.ctaText||a.addToCart||"Add to cart",endsAt:i.countdown?.showCountdown===!1?null:t.endsAt});x.products.before(je(d.length));let b=document.createElement("div");b.className="lb-multi-step__groups",d.forEach((k,q)=>{let C=document.createElement("div");C.className="lb-multi-step__group",C.setAttribute("data-step-group",String(q));let f=document.createElement("div");f.className="lb-multi-step__group-heading";let m=document.createElement("span");m.className="lb-multi-step__group-name",m.textContent=k.name,f.appendChild(m);let O=document.createElement("span");O.className="lb-multi-step__group-count",O.setAttribute("data-step-count",String(q)),f.appendChild(O),C.appendChild(f);let U=document.createElement("div");U.className="lb-mix-match__slots lb-edge-fade",U.setAttribute("data-step-slots",String(q)),C.appendChild(U);let D=document.createElement("button");D.type="button",D.className="lb-mix-match__add-product",D.setAttribute("data-step-trigger",String(q)),D.textContent="Add a product",C.appendChild(D),b.appendChild(C)}),x.products.replaceWith(b);let _=st({bundleGid:t.id,domId:t.id.replace(/\D/g,""),showSearch:i.showSearch!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,segmentCount:null,wizard:!0});x.root.appendChild(_);let I=d.map(()=>[]),w={container:x.root,steps:d.map((k,q)=>({name:k.name,minQuantity:k.minQuantity,maxQuantity:k.maxQuantity,eligibleProducts:c[q]})),selections:I,t:a,rulesMap:l,formatMoney:p,onRemove:(k,q)=>{let C=I[k][q];!C||!Be(I,C,l)||(I[k].splice(q,1),A(),S.isOpen()&&S.refresh())},onEdit:k=>S.open(k)};function A(){or(w),ir(w,{discountType:t.discountConfig.discountType,discountValue:t.discountConfig.discountValue},(k,q,C)=>De(k,q,C),lt(p)),ar(w),lr(w)}let S=dr({container:x.root,steps:w.steps,selections:I,t:a,rulesMap:l,showQtySelector:i.mixMatchShowQuantitySelector!==!1,showTypeFilters:i.mixMatchShowTypeFilters!==!1,formatMoney:p,dropdown:void 0,portalTarget:null,ctaButton:x.cta,onSelectionChanged:A,swapVariant:(k,q,C)=>{let f=0,m=I[k];for(let O=m.length-1;O>=0&&f<C;O--){let U=m[O];if(U.productId!==q.productId||U.variantId===q.variantId)continue;let D=Math.min(U.quantity||1,C-f);D>=(U.quantity||1)?m.splice(O,1):U.quantity=(U.quantity||1)-D,f+=D}f>0&&(q.quantity=f,m.push(q),A())},canRemove:k=>Be(I,k,l)});x.root.querySelectorAll("[data-step-trigger]").forEach(k=>{k.addEventListener("click",()=>{S.isOpen()||S.open(parseInt(k.getAttribute("data-step-trigger")??"",10)||0)})}),x.cta.addEventListener("click",()=>{Pe(I,w.steps)&&r(sr(I).map(k=>({merchandiseId:"gid://shopify/ProductVariant/"+k.variantId,quantity:k.quantity,attributes:se(t.id,t.bundleType)})))}),e.appendChild(x.root),ce(x.root),A(),o?.(he(x.root))}var zo=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Enter"," ","Escape"]),ct=new Set,ut=!1;function ur(e){let t=e==="using-mouse"?"using-keyboard":"using-mouse";for(let n of ct)n.classList.add(e),n.classList.remove(t)}function pr(e){zo.has(e.key)&&ur("using-keyboard")}function mr(){ur("using-mouse")}function Qo(){ut||(ut=!0,document.addEventListener("keydown",pr,!0),document.addEventListener("pointerdown",mr,!0))}function Wo(){ut&&(ut=!1,document.removeEventListener("keydown",pr,!0),document.removeEventListener("pointerdown",mr,!0))}function pt(e){return e.classList.add("using-mouse"),e.classList.remove("using-keyboard"),ct.add(e),Qo(),()=>{ct.delete(e),e.classList.remove("using-mouse"),e.classList.remove("using-keyboard"),ct.size===0&&Wo()}}var Bt=`/* Lime Bundles \u2014 shared base styles for all bundle widget types */
|
|
242
242
|
|
|
243
243
|
.lb-bundle-widget.lb-bundle-widget,
|
|
244
244
|
.lb-bundle-widget.lb-bundle-widget * {
|
|
@@ -519,7 +519,10 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
519
519
|
toggle: present in admin \u2192 shown; absent \u2192 hidden. Styled as muted
|
|
520
520
|
secondary text beneath the price row so it doesn't compete visually. */
|
|
521
521
|
.lb-bundle-product-unit-price {
|
|
522
|
-
|
|
522
|
+
/* Fallback is the "on" branch; Liquid sets 'none' when the merchant disables
|
|
523
|
+
productList.showUnitPrice. The [hidden] rule below still wins for rows
|
|
524
|
+
whose variant has no unit price at all. */
|
|
525
|
+
display: var(--lb-product-unit-price-display, block);
|
|
523
526
|
font-size: 12px;
|
|
524
527
|
line-height: 16px;
|
|
525
528
|
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
@@ -698,6 +701,10 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
698
701
|
cards). Quiet, theme-inherited; the fixed widget uses .lb-bundle-qty-chip in
|
|
699
702
|
the card's right slot instead. */
|
|
700
703
|
.lb-bundle-qty-inline {
|
|
704
|
+
/* Fallback is the "on" branch; Liquid sets 'none' when the merchant disables
|
|
705
|
+
productList.showQuantity. The fixed widget's chip carries its own var
|
|
706
|
+
because it is a flex box, not inline text. */
|
|
707
|
+
display: var(--lb-product-qty-inline-display, inline);
|
|
701
708
|
font-size: 13px;
|
|
702
709
|
font-weight: 400;
|
|
703
710
|
color: color-mix(in srgb, var(--lb-text) 55%, transparent);
|
|
@@ -930,7 +937,11 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
930
937
|
.lb-bundle-thumbnail[style*="--lb-row-thumb-ratio"] {
|
|
931
938
|
aspect-ratio: var(--lb-row-thumb-ratio);
|
|
932
939
|
}
|
|
933
|
-
|
|
940
|
+
/* This selector outranks the \`.lb-bundle-thumbnail\` rule above, so Liquid must
|
|
941
|
+
emit the inline var for the "original" ratio and nothing else. Emitting it
|
|
942
|
+
unconditionally silently replaced every merchant ratio with the image's own,
|
|
943
|
+
which looks like the setting being ignored. */
|
|
944
|
+
`,br=`/* Lime Bundles \u2014 Fixed bundle styles */
|
|
934
945
|
|
|
935
946
|
.lb-fixed__products {
|
|
936
947
|
display: flex;
|
|
@@ -978,7 +989,10 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
978
989
|
min-width: 34px;
|
|
979
990
|
height: 28px;
|
|
980
991
|
padding: 0 8px;
|
|
981
|
-
|
|
992
|
+
/* Fallback is the "on" branch; Liquid sets 'none' when the merchant disables
|
|
993
|
+
productList.showQuantity. Separate from --lb-product-qty-inline-display
|
|
994
|
+
because this chip is a flex box and the other counts are inline text. */
|
|
995
|
+
display: var(--lb-product-qty-chip-display, inline-flex);
|
|
982
996
|
align-items: center;
|
|
983
997
|
justify-content: center;
|
|
984
998
|
border-radius: var(--lb-radius-sm);
|
|
@@ -1020,7 +1034,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
1020
1034
|
outline-offset: 2px;
|
|
1021
1035
|
box-shadow: none;
|
|
1022
1036
|
}
|
|
1023
|
-
`,
|
|
1037
|
+
`,hr=`/* Lime Bundles \u2014 Mix & Match styles */
|
|
1024
1038
|
|
|
1025
1039
|
/* === Selected product list ================================================
|
|
1026
1040
|
The chosen products render as bordered cards. Capped height so long
|
|
@@ -2050,7 +2064,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2050
2064
|
transition: none;
|
|
2051
2065
|
}
|
|
2052
2066
|
}
|
|
2053
|
-
`,
|
|
2067
|
+
`,fr=`/* Lime Bundles \u2014 Volume / Quantity Breaks styles */
|
|
2054
2068
|
|
|
2055
2069
|
.lb-volume__tiers {
|
|
2056
2070
|
display: flex;
|
|
@@ -2226,7 +2240,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2226
2240
|
white-space: nowrap;
|
|
2227
2241
|
font-variant-numeric: tabular-nums;
|
|
2228
2242
|
}
|
|
2229
|
-
`,
|
|
2243
|
+
`,gr=`/* Lime Bundles \u2014 BOGO (Buy X Get Y) bundle styles */
|
|
2230
2244
|
|
|
2231
2245
|
.lb-bogo__products {
|
|
2232
2246
|
display: flex;
|
|
@@ -2299,7 +2313,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2299
2313
|
text-decoration: line-through;
|
|
2300
2314
|
opacity: 0.6;
|
|
2301
2315
|
}
|
|
2302
|
-
`,
|
|
2316
|
+
`,xr=`/**
|
|
2303
2317
|
* Lime Bundles \u2014 Multi-step bundle widget styles (wizard chrome ONLY).
|
|
2304
2318
|
*
|
|
2305
2319
|
* The multi-step widget reuses the mix & match classes wholesale \u2014
|
|
@@ -2415,7 +2429,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2415
2429
|
outline: 2px solid var(--lb-primary-color);
|
|
2416
2430
|
outline-offset: 2px;
|
|
2417
2431
|
}
|
|
2418
|
-
`,
|
|
2432
|
+
`,vr=`/**
|
|
2419
2433
|
* Lime Bundles \u2014 Custom variant-picker dropdown styling.
|
|
2420
2434
|
*
|
|
2421
2435
|
* Reuses existing CSS variables: no new merchant-configurable surface.
|
|
@@ -2678,7 +2692,7 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2678
2692
|
[data-modal-overlay] > .lb-dropdown-listbox::-webkit-scrollbar-thumb {
|
|
2679
2693
|
background: color-mix(in srgb, var(--lb-picker-text) 15%, transparent);
|
|
2680
2694
|
}
|
|
2681
|
-
`,
|
|
2695
|
+
`,yr=`/* Lime Bundles \u2014 web-component loading skeleton (not mirrored to theme assets) */
|
|
2682
2696
|
|
|
2683
2697
|
.lb-bundle-widget--loading {
|
|
2684
2698
|
display: block;
|
|
@@ -2774,10 +2788,10 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2774
2788
|
animation: none;
|
|
2775
2789
|
}
|
|
2776
2790
|
}
|
|
2777
|
-
`;var
|
|
2778
|
-
`),this.shadow.appendChild(t),this.shopCustomCss){let r=document.createElement("style");r.setAttribute("data-lime-bundles","shop-custom-css"),r.textContent=this.shopCustomCss,this.shadow.appendChild(r)}for(let r of this.bundles){let o=document.createElement("div");o.className="lb-bundle-widget",o.setAttribute("role","region"),o.setAttribute("aria-label",r.title),o.setAttribute("data-bundle-type",r.bundleType),o.setAttribute("data-bundle-gid",r.id),
|
|
2779
|
-
<style>${
|
|
2780
|
-
<style>${
|
|
2791
|
+
`;var jo=e=>`lb_cart_id:${e}`;function $o(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 Re=class extends HTMLElement{static observedAttributes=["shop-domain","storefront-token","bundle-gid","product-handle","app-url","analytics","locale","country","language","market-id"];buyer=void 0;shadow;bundles=[];currentProductHandle=null;abortController=null;impressionCleanups=[];renderCleanups=[];shopCustomCss=null;outOfStockBehavior=gt;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,n,r){n===r||!this.isConnected||(t==="bundle-gid"||t==="product-handle"||t==="shop-domain"||t==="storefront-token")&&this.shopDomain&&this.storefrontToken&&this.fetchBundle()}get shopDomain(){return this.getAttribute("shop-domain")??""}get storefrontToken(){return this.getAttribute("storefront-token")??""}get bundleGid(){return this.getAttribute("bundle-gid")??""}get productHandleAttr(){return this.getAttribute("product-handle")??""}get appUrl(){return this.getAttribute("app-url")??""}get analyticsEnabled(){return this.getAttribute("analytics")!=="false"}get country(){return this.getAttribute("country")??void 0}get language(){return this.getAttribute("language")??void 0}get marketId(){return this.getAttribute("market-id")??void 0}wrapQueryForContext(t){return $t({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer})?Gt(t):t}isMarketHidden(t){return!an(t,this.marketId)}async fetchBundle(){if(!this.shopDomain||!this.storefrontToken){this.renderError("Missing required attributes: shop-domain, storefront-token");return}this.abortController?.abort();let t=new AbortController;this.abortController=t,this.renderLoading();let n=ft({shopDomain:this.shopDomain,accessToken:this.storefrontToken,country:this.country,language:this.language,buyer:this.buyer});try{let r,o=!1;if(this.currentProductHandle=$o(this.productHandleAttr),this.bundleGid)o=!0,r=this.fetchSingleBundle(n,t.signal);else{let d=this.currentProductHandle;if(!d){this.teardownImpressions(),this.renderError("No bundle-gid or product-handle provided, and the current URL doesn't match /products/<handle>.");return}r=this.fetchProductBundles(n,t.signal,d)}let i=n.query(Yt,void 0,{signal:t.signal}).catch(()=>null);if(await r,t.signal.aborted)return;if(o&&this.bundles.length===0){this.teardownImpressions(),this.renderError("Bundle not found");return}let a=await i,l=a?.shop?.customCss?.value;if(l){pn(this.shopDomain,l);let d=yt(l);d.ok&&(this.shopCustomCss=d.css)}this.outOfStockBehavior=en(a?.shop?.outOfStockBehavior?.value),this.renderBundles()}catch(r){if(t.signal.aborted)return;this.bundles=[],this.teardownImpressions(),this.renderError(r instanceof Error?r.message:"Failed to load bundle")}}async fetchSingleBundle(t,n){let r=await t.query(this.wrapQueryForContext(Kt),{id:this.bundleGid},{signal:n});if(!r.metaobject){this.bundles=[];return}let o=xt(r.metaobject.id,r.metaobject.fields);this.bundles=o&&!this.isMarketHidden(o)?[o]:[]}async fetchProductBundles(t,n,r){let o=await t.query(this.wrapQueryForContext(Jt),{handle:r},{signal:n});if(!o.product){this.bundles=[];return}let i=o.product.metafield?.references?.nodes??[],a=[];for(let l of i){let d=xt(l.id,l.fields);d&&!this.isMarketHidden(d)&&a.push(d)}this.bundles=hn(a,bn())}handleAddToCart=async(t,n)=>{let r=new CustomEvent("lime-bundle:add-to-cart",{detail:{lines:n},bubbles:!0,composed:!0,cancelable:!0}),o=this.dispatchEvent(r);this.reportAddToCartEvent(t,n),o&&await this.defaultAddToCart(n)};async defaultAddToCart(t){if(typeof window>"u")return;let n=ft({shopDomain:this.shopDomain,accessToken:this.storefrontToken}),r=window.localStorage,o=jo(this.shopDomain),i=r?.getItem(o)??null;try{let a=null;if(i){let d=(await n.query(Zt,{cartId:i,lines:t})).cartLinesAdd;d?.userErrors?.length?r?.removeItem(o):d?.cart&&(a=d.cart.checkoutUrl)}if(!a){let d=(await n.query(Xt,{input:{lines:t}})).cartCreate;d?.cart&&(r?.setItem(o,d.cart.id),a=d.cart.checkoutUrl)}a?window.location.assign(a):this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:"Cart creation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}catch(a){this.dispatchEvent(new CustomEvent("lime-bundle:error",{detail:{message:a instanceof Error?a.message:"Cart mutation failed",code:"CART_ERROR"},bubbles:!0,composed:!0}))}}reportAddToCartEvent(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=n.reduce((i,a)=>i+a.quantity,0),o=n.reduce((i,a)=>{let d=t.products.find(c=>c.variants.nodes.some(u=>u.id===a.merchandiseId))?.variants.nodes.find(c=>c.id===a.merchandiseId),s=d?parseFloat(d.price.amount):0;return i+s*a.quantity},0);dn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType,productId:t.products[0]?.id??"",quantity:r,totalPrice:Math.round(o*100)/100})}renderBundles(){this.teardownImpressions(),this.teardownRenderers(),this.shadow.innerHTML="";let t=document.createElement("style");if(t.textContent=[Bt,br,hr,xr,fr,gr,vr].join(`
|
|
2792
|
+
`),this.shadow.appendChild(t),this.shopCustomCss){let r=document.createElement("style");r.setAttribute("data-lime-bundles","shop-custom-css"),r.textContent=this.shopCustomCss,this.shadow.appendChild(r)}for(let r of this.bundles){let o=document.createElement("div");o.className="lb-bundle-widget",o.setAttribute("role","region"),o.setAttribute("aria-label",r.title),o.setAttribute("data-bundle-type",r.bundleType),o.setAttribute("data-bundle-gid",r.id),r.endsAt&&o.setAttribute("data-ends-at",r.endsAt),tn(o,r.widgetConfig),this.renderCleanups.push(pt(o));let i=l=>this.handleAddToCart(r,l),a=l=>this.renderCleanups.push(l);switch(r.bundleType){case"fixed":Ln(o,r,this.outOfStockBehavior,i,a);break;case"mix_match":Kn(o,r,this.outOfStockBehavior,i,a,this.currentProductHandle);break;case"volume":Zn(o,r,this.outOfStockBehavior,i);break;case"bogo":tr(o,r,this.outOfStockBehavior,i,a);break;case"multi_step":cr(o,r,this.outOfStockBehavior,i,a);break}this.shadow.appendChild(o),this.setupImpressionFor(r,o)}let n=this.bundles[0];this.dispatchEvent(new CustomEvent("lime-bundle:loaded",{detail:{bundleCount:this.bundles.length,bundleTypes:this.bundles.map(r=>r.bundleType),bundleType:n?.bundleType,title:n?.title},bubbles:!0,composed:!0}))}setupImpressionFor(t,n){if(!this.analyticsEnabled||!this.appUrl)return;let r=cn(n,()=>{sn({shopDomain:this.shopDomain,appUrl:this.appUrl},{bundleGid:t.id,bundleType:t.bundleType})});this.impressionCleanups.push(r)}renderLoading(){this.shadow.innerHTML=`
|
|
2793
|
+
<style>${Bt}</style>
|
|
2794
|
+
<style>${yr}</style>
|
|
2781
2795
|
<div class="lb-bundle-widget lb-bundle-widget--loading" aria-busy="true" aria-label="Loading bundle">
|
|
2782
2796
|
<div class="lb-skeleton lb-skeleton--title"></div>
|
|
2783
2797
|
<div class="lb-skeleton--products">
|
|
@@ -2811,5 +2825,5 @@ a.lb-bundle-product-name:focus-visible {
|
|
|
2811
2825
|
<div class="lb-skeleton lb-skeleton--cta"></div>
|
|
2812
2826
|
</div>
|
|
2813
2827
|
</div>
|
|
2814
|
-
`}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",
|
|
2828
|
+
`}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",Re);return Tr(Go);})();
|
|
2815
2829
|
//# sourceMappingURL=lime-bundle.global.js.map
|