yt-uikit 0.7.344-shadowdomBundle.51 → 0.7.344-shadowdomBundle.53

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.
@@ -200,7 +200,7 @@ export interface CartProps {
200
200
  cartOffersCarousalData?: CartOffersCarousalProps;
201
201
  freebieMilestoneData?: freebieMilestoneProps;
202
202
  cartOffersCarouselHeight?: number;
203
- stickyBarBuyNowFunction?: (event: any) => Promise<any>;
203
+ stickyBarBuyNowFunction?: (variantId: string, quantity: number) => Promise<void>;
204
204
  gstSectionCustomizationData?: GSTSectionCustomizationProps;
205
205
  noteSectionTitle?: string;
206
206
  checkoutSectionMessage?: string;
@@ -39,7 +39,7 @@ export type StickyAddToCartProps = {
39
39
  cartComponentsCornerType?: "rounded" | "sharp";
40
40
  cartComponentsCornerRadius?: number;
41
41
  stickyCartCustomizationData?: stickyCartCustomizationDataProps;
42
- checkoutFunction?: (event: any) => Promise<any>;
42
+ checkoutFunction?: (variantId: string, quantity: number) => Promise<void>;
43
43
  backgroundColor?: string;
44
44
  primaryTextColor?: string;
45
45
  comboBundleData?: BundlePayload;
package/dist/esm/index.js CHANGED
@@ -1900,17 +1900,18 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
1900
1900
  `,Os=({themeColor:e,themeTextColor:n,disabledDates:r=[]})=>{const[o,i]=c(!1),[d,s]=Xt(an),p=Zt(nn),u=t.useRef(null),m=d?new Date(d):null,f=Array.isArray(r)?r:[r],g=a((()=>{const e=new Date;return e.setDate(e.getDate()+1),e}),[]),h=a((e=>f.some((t=>t instanceof Date&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())))),[f]),x=a((e=>{if(!e)return!1;const t=g(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!h(n)}),[g,h]);l((()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&i(!1)};return o&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[o]),l((()=>{const e=x(m);p((t=>t.isDateValid!==e?{...t,isDateValid:e}:t))}),[m,x,p]);const y=a((({date:e,view:t})=>{if("month"===t){const t=g(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!h(n)){const e=d?new Date(d):null;return e&&n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()?"active-date":"black-date"}}return null}),[g,d,h]);return t.createElement("div",{className:"custom-date-picker"},t.createElement("div",{className:"date-display",onClick:()=>i(!o)},t.createElement("span",{style:{fontSize:"12px"}},(b=d?new Date(d):null)?b.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"/"):"Select a date"),t.createElement(M,null)),o&&t.createElement("div",{className:"calendar-container",ref:u},t.createElement(_s,{onChange:(e,t)=>{e instanceof Date&&!h(e)&&(s(e.toISOString()),i(!1));const n=x(e instanceof Date?e:null);p((e=>e.isDateValid!==n?{...e,isDateValid:n}:e))},value:d?new Date(d):null,className:"custom-calendar",minDate:g(),tileBackgroundColor:e,tileTextColor:n,tileHoverColor:En(e,.2),tileClassName:y,tileDisabled:({date:e,view:t})=>"month"===t&&h(e)})));var b},As=({title:e="Cart Item(s) available in NCR only",backgroundColor:n="#F6EFDD78",tag:r="NCR",postalCodeList:i=[110001,110002,110003,110004,110005],themeColor:d,themeTextColor:s,enableSlotPicker:p,deliveryHeaderTitle:u,deliveryAvailableText:m,deliveryNotAvailableText:f,disabledDates:g})=>{const[h,x]=c(!1),[y,b]=Xt(Lo),[v,w]=Xt(nn),[C,k]=Xt(on),E=Yt(rn),T=o(null),S=a((e=>{const t=i.includes(e);x(!t),w((e=>({...e,isPostalCodeValid:t})))}),[i,w]);return l((()=>{k("specific")}),[]),l((()=>{void 0!==y&&S(y)}),[y,S]),l((()=>{!1===p&&w((e=>e.isDateValid?e:{...e,isDateValid:!0}))}),[p,w]),t.createElement("div",null,u&&t.createElement("div",{className:"shipment-header"},t.createElement("h2",{className:"shipment-header-text"},u)),t.createElement("div",{className:"availability-check",style:{border:`2px solid ${d||"black"}`,padding:"12px",borderRadius:"8px",margin:"8px 1rem"}},t.createElement("div",{className:"availability-title"},"Check Shipment Availability"),t.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:y||"",onChange:e=>{const t=e.target.value;if(""===t)return b(void 0),x(!1),void w((e=>({...e,isPostalCodeValid:!1})));if(!/^\d+$/.test(t))return;const n=Number(t);b(n),x(!1),w((e=>({...e,isPostalCodeValid:!1}))),T.current&&clearTimeout(T.current),T.current=setTimeout((()=>{S(n)}),1e3)},onBlur:()=>{T.current&&clearTimeout(T.current),void 0!==y&&S(y)}}),h&&t.createElement("div",{className:"error-message"},f||"Cart items aren't available at your address"),v.isPostalCodeValid&&p&&t.createElement("div",{className:"slot"},t.createElement("label",{className:"slot-label"},"Select Delivery Slot"),t.createElement(Os,{themeColor:d,themeTextColor:s,disabledDates:g})),E&&t.createElement("div",{className:"success-message"},m||"Voila! Local delivery is available")))},Ms=({postalCodeList:e=[110001,110002,110003,110004,110005],themeColor:n,themeTextColor:r,enableSlotPicker:i,disabledDates:d})=>{const[s,p]=c("standard"),[u,m]=c(!1),[f,g]=Xt(Lo),[h,x]=Xt(nn),[y,b]=Xt(on),v=Yt(rn),w=o(null),C=a((t=>{const n=e.includes(t);t?(m(!n),x((e=>({...e,isPostalCodeValid:n})))):x((e=>({...e,isPostalCodeValid:!1})))}),[e,x]);return l((()=>{b("delhi-ncr"===s?"specific":"standard"),f&&C(f)}),[s]),t.createElement("div",{className:"shipment-container"},t.createElement("div",{className:"shipment-header"},t.createElement("p",{className:"shipment-header-text"},"Cart Item(s) are available for standard shipment")),t.createElement("div",{className:"shipment-option "+("standard"===s?"selected":""),onClick:()=>p("standard")},t.createElement("div",{className:"option-content"},t.createElement("div",{className:"option-text"},t.createElement("div",{className:"option-title"},"Pan India"),t.createElement("div",{className:"option-subtitle"},"7-10 days")),"standard"===s&&t.createElement(it,{className:"checkmark"}))),t.createElement("div",{className:"shipment-option "+("delhi-ncr"===s?"selected":""),onClick:()=>p("delhi-ncr")},t.createElement("div",{className:"option-content"},t.createElement("div",{className:"option-text"},t.createElement("div",{className:"option-title"},"Delhi NCR"),t.createElement("div",{className:"option-subtitle"},"Single day delivery")),"delhi-ncr"===s&&t.createElement(it,{className:"checkmark"})),"delhi-ncr"===s&&t.createElement("div",{className:"availability-check"},t.createElement("div",{className:"availability-title"},"Check Product Availability"),t.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:f,onChange:e=>{const t=e.target.value;if(""===t)return g(void 0),m(!1),void x((e=>({...e,isPostalCodeValid:!1})));if(!/^\d+$/.test(t))return;const n=Number(t);g(n),m(!1),x((e=>({...e,isPostalCodeValid:!1}))),w.current&&clearTimeout(w.current),w.current=setTimeout((()=>{C(n)}),1e3)},onBlur:()=>{w.current&&clearTimeout(w.current),C(f)}}),u&&t.createElement("div",{className:"error-message"},"Cart items aren't available on your selected pincode for quick shipment"),h.isPostalCodeValid&&i&&t.createElement("div",{className:"slot"},t.createElement("label",{className:"slot-label"},"Pick a Selivery Slot"),t.createElement(Os,{themeColor:n,themeTextColor:r,disabledDates:d})),v&&t.createElement("div",{className:"success-message"},"Voila! Local delivery is available"))))},Fs=tn("gift_wrap",!1);tn("gift_wrap_id","");const Rs=x.div`
1901
1901
  display: flex;
1902
1902
  flex-direction: column;
1903
- // margin-bottom: 20px;
1904
- margin: 16px;
1903
+ margin-left: 16px;
1904
+ margin-right: 16px;
1905
1905
  `,Ls=x.div`
1906
1906
  display: flex;
1907
1907
  justify-content: space-between;
1908
1908
  align-items: center;
1909
1909
  height: fit-content;
1910
+ margin-top: 6px;
1910
1911
  padding: 6px 12px;
1911
- border-radius: 5px;
1912
- border-width: 2px;
1913
- border-color: lightgray;
1912
+ border-radius: 5px !important;
1913
+ border-width: 2px !important;
1914
+ border-color: lightgray !important;
1914
1915
  // box-shadow: 0px 0px 2px 2px rgb(193, 193, 193);
1915
1916
  `,js=x.span`
1916
1917
  display: flex;
@@ -2235,7 +2236,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2235
2236
  font-weight: 400;
2236
2237
  min-width: 14px;
2237
2238
  line-height: 14px;
2238
- `,Bp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:B,redemptionMultiplier:$,discountApplied:z,removeDiscount:N,applyDiscount:I,rewardCoupons:D,userTotalPoints:P,checkoutFunction:_,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:M,recProductsList:F,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:Be,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Ie,onSetLoading:De,showVariantSelectionDropdownInProductRecs:Pe,originalCartSubtotal:_e,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Me,freebiesInCart:Fe,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:st,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:gt,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:Bt,brandTokenName:$t,showDiscountOnMRP:zt,switchWidthVariant:Nt,prefixMessageText:It,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:_t,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Mt=!1,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Ut=Yt(Kt),Qt=Yt(ln),[Gt,Zt]=c(!1),[Jt,en]=Xt(sn),[tn,pn]=c(!1),[un,mn]=c(!0),{setLoading:fn}=cn();t.useEffect((()=>{De&&De(fn)}),[De]);const hn=o(!1);l((()=>{const t=()=>{n(!1)};return e?(hn.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),hn.current=!0):(hn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),hn.current=!1),()=>{window.removeEventListener("popstate",t)}}),[e,n]);const[xn,yn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(xn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,at,it,xn]),l((()=>{function e(){const e=window.innerWidth;yn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const bn=Ut?.items?.reduce(((e,t)=>e+t?.quantity),0),vn=o(null);l((()=>{function e(e){vn.current&&!vn.current.contains(e.target)&&en(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{Zt(!0),window.setTimeout((()=>Zt(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[wn,Cn]=c("normal"),[kn,En]=c("normal"),[Tn,Sn]=c("auto");l((()=>{CSS.supports("font-weight","500")?Cn("500"):CSS.supports("font-weight","400")?Cn("400"):CSS.supports("font-weight","600")&&Cn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",wn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",kn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)}),[wn,kn]);const[Bn]=Xt(nn);Yt(rn);const[$n]=Xt(an),[zn]=Xt(on);l((()=>{const e=Ut?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));pn(e)}),[Ut?.items,je]);l((()=>{mn(!("all-products"!==Xe&&("specific-tags"!==Xe||Bn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Bn.isPostalCodeValid||$n||!Ke)&&("specific-tags"===Xe&&"standard"===zn||tn&&(Ke?Bn.isPostalCodeValid&&$n:Bn.isPostalCodeValid))))}),[Bn.isPostalCodeValid,$n,tn,Xe,Ke]),Xt(dn);const[Nn,In]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&In(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&In(!1)}),[]);const Dn=new Date("2024-11-01");return gn(Ut?.items_subtotal_price,Ut?.currency),t.createElement(Tp,{className:"yt-cart-drawer",$isDev:M,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:xn,$switchWidthVariant:Nt},Qt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Qt.showLoader&&!Qt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Jt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ut?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(kp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:$t,themeColor:ue,themeTextColor:me,rewardMultiplier:B}),bn>0&&t.createElement(Sp,{$backgroundSubdued:a},bn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(ht,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Qt&&t.createElement(bp,{$themeColor:ue,show:Qt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(gp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:Ut}),lt&&Nn&&Ut?.item_count?t.createElement(Gs,{minutes:ut,customText:mt,onTimerComplete:()=>{In(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(Qr,{particleCount:50,spread:90,origin:{y:.3}}),$e?t.createElement(El,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ne,themeTextColor:me}):null),R&&Ut?.items_subtotal_price>0&&Ut?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort(((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold));return a.filter((e=>0!==e?.[Rr(r)]&&("minimum_order_value"!==r||1!==e?.[Rr(r)]))).some(((e,i)=>Lr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0))}(L,gn(void 0!==_e?_e:Ut?.items_subtotal_price,Ut.currency),void 0===Re?Ut?.item_count:Re,te??"minimum_order_value",Ut?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Bo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Ut?.item_count:Re,currentCartAmount:gn(void 0!==_e?_e:Ut?.items_subtotal_price,Ut.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:It,suffixMessageText:Dt,successMessageText:Pt,enableConfetti:Vt})),Ut?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ut?.items?.length&&0===Ut?.item_count&&!1===Qt?.showSkeletonLoader?t.createElement(Po,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:F,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Mt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ni,{isDev:M,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:st,freebieMilestoneData:pt}),xn&&se&&!!F&&F?.length>0&&Ut?.item_count>0&&b&&t.createElement(br,{addCartItem:b,products:F,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,cardLayout:gt,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!xn&&pe&&!!F&&F?.length>0&&Ut?.item_count>0&&b&&t.createElement(br,{addCartItem:b,products:F,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,cardLayout:gt,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Go,null,Ut?.item_count>0&&w&&k&&t.createElement(oi,{bundleProducts:k}),he&&!!xe&&Ut?.item_count>0&&t.createElement(xi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Ut&&Ut?.item_count>0&&!!Me&&!!Oe&&!!Fe&&Oe.length>0&&t.createElement(kl,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Me,freebiesInCart:Fe,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!Ue&&Ut?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>mn(!un)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ft,null)),t.createElement("div",{className:"icon-transition"},un?t.createElement(ct,null):t.createElement(dt,null))),"all-products"===Xe&&un?t.createElement(As,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):un&&(tn?t.createElement(As,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(Ms,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),Be&&!!Te&&Ut?.item_count>0&&t.createElement(yi,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&Ut?.item_count>0&&t.createElement(qs,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Ut?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Ep,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:N,enableConfetti:Vt}),Ut?.item_count>0&&C&&I&&!Bt&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(xa,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:vn,discountAmountOff:E,userTotalPoints:P??0,applyDiscount:I,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Jt,setIsCouponSelectionOpen:en,pointsToBeUsed:S,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Ut?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||Bt?!Bt&&Ut?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!I&&t.createElement(pa,{themeColor:ue,applyDiscount:I,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:$t,showCartLevelAltPay:W,redemptionMultiplier:$}):Ut?.item_count>0&&!!A&&!!O&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Ut?.item_count>0&&!!Bt&&!!N&&ve&&Bt&&void 0!==S&&t.createElement(la,{themeColor:ue,removeDiscount:N,loyaltyDiscount:Bt,isDev:M,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:$t,showCartLevelAltPay:W}),ve&&W&&j&&T&&Ut?.item_count>0&&t.createElement(wp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:B}),ve&&Ut&&Ut.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",$t,":"," ",Ce),Ut&&_&&Ut?.item_count>0&&t.createElement("div",null,t.createElement(jo,{disableCheckoutButton:!!At||Qt.cartLoading,discountApplied:z,checkoutFunction:_,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:Be,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:_t,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},$p=x.div`
2239
+ `,Bp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:B,redemptionMultiplier:$,discountApplied:z,removeDiscount:N,applyDiscount:I,rewardCoupons:D,userTotalPoints:P,checkoutFunction:_,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:M,recProductsList:F,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:Be,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Ie,onSetLoading:De,showVariantSelectionDropdownInProductRecs:Pe,originalCartSubtotal:_e,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Me,freebiesInCart:Fe,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:st,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:gt,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:Bt,brandTokenName:$t,showDiscountOnMRP:zt,switchWidthVariant:Nt,prefixMessageText:It,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:_t,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Mt=!1,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Ut=Yt(Kt),Qt=Yt(ln),[Gt,Zt]=c(!1),[Jt,en]=Xt(sn),[tn,pn]=c(!1),[un,mn]=c(!0),{setLoading:fn}=cn();t.useEffect((()=>{De&&De(fn)}),[De]);const hn=o(!1);l((()=>{const t=()=>{n(!1)};return e?(hn.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),hn.current=!0):(hn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),hn.current=!1),()=>{window.removeEventListener("popstate",t)}}),[e,n]);const[xn,yn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(xn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,at,it,xn]),l((()=>{function e(){const e=window.innerWidth;yn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const bn=Ut?.items?.reduce(((e,t)=>e+t?.quantity),0),vn=o(null);l((()=>{function e(e){vn.current&&!vn.current.contains(e.target)&&en(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{Zt(!0),window.setTimeout((()=>Zt(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[wn,Cn]=c("normal"),[kn,En]=c("normal"),[Tn,Sn]=c("auto");l((()=>{CSS.supports("font-weight","500")?Cn("500"):CSS.supports("font-weight","400")?Cn("400"):CSS.supports("font-weight","600")&&Cn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",wn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",kn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)}),[wn,kn]);const[Bn]=Xt(nn);Yt(rn);const[$n]=Xt(an),[zn]=Xt(on);l((()=>{const e=Ut?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));pn(e)}),[Ut?.items,je]);l((()=>{mn(!("all-products"!==Xe&&("specific-tags"!==Xe||Bn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Bn.isPostalCodeValid||$n||!Ke)&&("specific-tags"===Xe&&"standard"===zn||tn&&(Ke?Bn.isPostalCodeValid&&$n:Bn.isPostalCodeValid))))}),[Bn.isPostalCodeValid,$n,tn,Xe,Ke]),Xt(dn);const[Nn,In]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&In(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&In(!1)}),[]);const Dn=new Date("2024-11-01");return gn(Ut?.items_subtotal_price,Ut?.currency),t.createElement(Tp,{className:"yt-cart-drawer",$isDev:M,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:xn,$switchWidthVariant:Nt},Qt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Qt.showLoader&&!Qt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Jt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ut?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(kp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:$t,themeColor:ue,themeTextColor:me,rewardMultiplier:B}),bn>0&&t.createElement(Sp,{$backgroundSubdued:a},bn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(ht,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Qt&&t.createElement(bp,{$themeColor:ue,show:Qt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(gp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:Ut}),lt&&Nn&&Ut?.item_count?t.createElement(Gs,{minutes:ut,customText:mt,onTimerComplete:()=>{In(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(Qr,{particleCount:50,spread:90,origin:{y:.3}}),$e?t.createElement(El,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ne,themeTextColor:me}):null),R&&Ut?.items_subtotal_price>0&&Ut?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort(((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold));return a.filter((e=>0!==e?.[Rr(r)]&&("minimum_order_value"!==r||1!==e?.[Rr(r)]))).some(((e,i)=>Lr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0))}(L,gn(void 0!==_e?_e:Ut?.items_subtotal_price,Ut.currency),void 0===Re?Ut?.item_count:Re,te??"minimum_order_value",Ut?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Bo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Ut?.item_count:Re,currentCartAmount:gn(void 0!==_e?_e:Ut?.items_subtotal_price,Ut.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:It,suffixMessageText:Dt,successMessageText:Pt,enableConfetti:Vt})),Ut?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ut?.items?.length&&0===Ut?.item_count&&!1===Qt?.showSkeletonLoader?t.createElement(Po,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:F,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Mt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ni,{isDev:M,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:st,freebieMilestoneData:pt}),xn&&se&&!!F&&F?.length>0&&Ut?.item_count>0&&b&&t.createElement(br,{addCartItem:b,products:F,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,cardLayout:gt,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!xn&&pe&&!!F&&F?.length>0&&Ut?.item_count>0&&b&&t.createElement(br,{addCartItem:b,products:F,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Pe,cardLayout:gt,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Go,null,Ut?.item_count>0&&w&&k&&t.createElement(oi,{bundleProducts:k}),he&&!!xe&&Ut?.item_count>0&&t.createElement(xi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Ut&&Ut?.item_count>0&&!!Me&&!!Oe&&!!Fe&&Oe.length>0&&t.createElement(kl,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Me,freebiesInCart:Fe,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!Ue&&Ut?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>mn(!un)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ft,null)),t.createElement("div",{className:"icon-transition"},un?t.createElement(ct,null):t.createElement(dt,null))),"all-products"===Xe&&un?t.createElement(As,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):un&&(tn?t.createElement(As,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(Ms,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),Be&&!!Te&&Ut?.item_count>0&&t.createElement(yi,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&Ut?.item_count>0&&t.createElement(qs,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Ut?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Ep,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:N,enableConfetti:Vt}),Ut?.item_count>0&&C&&I&&!Bt&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(xa,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:vn,discountAmountOff:E,userTotalPoints:P??0,applyDiscount:I,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Jt,setIsCouponSelectionOpen:en,pointsToBeUsed:S,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Ut?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||Bt?!Bt&&Ut?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!I&&t.createElement(pa,{themeColor:ue,applyDiscount:I,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:$t,showCartLevelAltPay:W,redemptionMultiplier:$}):Ut?.item_count>0&&!!A&&!!O&&t.createElement(Uo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Ut?.item_count>0&&!!Bt&&!!N&&ve&&Bt&&void 0!==S&&t.createElement(la,{themeColor:ue,removeDiscount:N,loyaltyDiscount:Bt,isDev:M,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:$t,showCartLevelAltPay:W}),ve&&W&&j&&T&&Ut?.item_count>0&&t.createElement(wp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:B}),ve&&Ut&&Ut.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",$t,":"," ",Ce),Ut&&_&&Ut?.item_count>0&&t.createElement("div",null,t.createElement(jo,{disableCheckoutButton:!!At||Qt.cartLoading,discountApplied:z,checkoutFunction:_,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:Be,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:_t,checkoutButtonBottomSpacing:Ft,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},$p=x.div`
2239
2240
  position: relative;
2240
2241
  `,zp=x.button`
2241
2242
  border: 1px solid #ccc;
@@ -2437,7 +2438,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2437
2438
  transform: scale(1.01);
2438
2439
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
2439
2440
  }
2440
- `,qp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400},Up=({showStickyCart:e,product:n,addCartItem:r,onSetLoading:i,themeColor:d,cartData:s,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:f,addToStickyCart:g,cartComponentsCornerType:h,cartComponentsCornerRadius:x,themeTextColor:y,stickyCartCustomizationData:b,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:k,comboBundleAddToCartFunction:E})=>{const[T,S]=c(""),[B,$]=c(null),[z,N]=c({}),I=Ta(),[D,P]=c(null),_=o(null);l((()=>{const e=e=>{_.current&&!_.current.contains(e.target)&&P(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const O=a((()=>k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find((e=>e?.node?.availableForSale))?.node:n?.variants?.find((e=>e?.available))),[k,n]),[A,M]=c((()=>{if(!k||"combo"!==k.type)return{};const e={};return k?.products?.forEach(((t,n)=>{const r=t?.productDetails?.variants?.edges?.find((e=>e?.node?.availableForSale))?.node;r&&(e[n]=r.id)})),e})),F=a((e=>{if(!k||"combo"!==k.type)return;const t={};k?.products?.forEach(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((t=>{const r=t?.node;return n?.productDetails?.options?.every(((t,n)=>{const o=e?.[t?.name],a=r?.title?.split(" / ")?.at(n);return!(!o||!a)&&o.trim().toLowerCase()===a.trim().toLowerCase()}))}));o?.node?.id&&(t[r]=o.node.id)})),Object.keys(t).length>0&&M((e=>({...e,...t})))}),[k]);l((()=>{const e=O();if(e){S(String(e.id)),$(e);const t={};n?.options&&Array.isArray(n.options)&&n.options.forEach(((n,r)=>{const o=`option${r+1}`;e?.[o]&&(t[n?.name]=e[o])})),N(t)}}),[n,O]);const R=a((()=>new URLSearchParams(window.location.search).get("variant")||""),[]),L=()=>{const e=R();if(e){const t=n?.variants?.find((t=>String(t?.id)===String(e)));if(t&&t?.available){S(String(t.id)),$(t);const e={};n?.options?.forEach(((n,r)=>{const o=`option${r+1}`;t?.[o]&&(e[n?.name]=t[o])})),N(e)}else{const e=O();e&&(S(String(e.id)),$(e))}}};l((()=>{L();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",L),()=>{t=!1,window.removeEventListener("urlChange",L),window.history.pushState=n,window.history.replaceState=r}}),[R,n,O,B,T]);const j=o(null),[V,W]=c(1),H=xn(s,s?.currency);l((()=>{(async()=>{try{n&&T&&$(n?.variants?.filter((e=>String(e?.id)===String(T)))[0])}catch(e){console.error("Error getting selected product variant id")}})()}),[n,T]);const{cartLoading:q}=cn(),U=o(null),[Q,G]=c(0);l((()=>{U.current&&G(U.current.offsetWidth)}),[]);const Y=n?.options?.find((e=>e?.name?.toLowerCase()?.includes("color")))?.name,Z=Y?z?.[Y]:null,X=b&&(K=b,0!==Object.keys(K).length||K.constructor!==Object)?b:qp;var K;const{showProductName:J,showPrice:ee,showVariantSelector:te,showBuyNowButton:ne,showAddToCartButton:re,desktopBarType:oe,showProductImage:ae,buyNowCtaTitle:ie,addToCartCtaTitle:le,productInfoVisibility:ce,showBarOnDesktop:de,ctaButtonFontSize:se,startsAppearingAtHeight:pe,fullyAppearsAtHeight:ue,topRibbonText:me}=X,[fe,ge]=c(0),[he,xe]=c(100),[ye,be]=c(!1);if(l((()=>{const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=pe||200,n=ue||400;if(e>t){const r=Math.min((e-t)/(n-t),1);ge(r),xe(100-100*r)}else ge(0),xe(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]),l((()=>{const e=()=>{const e=window.innerWidth<768;be(e||!1!==de)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[de]),n?.variants?.length<1)return null;const ve=n?.available??!0,we=O(),Ce=k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find((e=>e?.node?.id===A?.[0]))?.node?.price:B?.price??we?.price??n?.variants?.[0]?.price;if(0===Number(Ce))return null;if(!e||!ye)return null;if(b?.excludeProducts?.includes(n?.handle))return null;const ke=k&&"combo"===k.type?Object.values(A).length>0:B?.available??!0;return t.createElement(Mp,{className:"yt-sticky-bar-container",$opacity:fe,$translateY:he,$desktopBarType:oe||"stretch"},t.createElement(Fp,{className:"yt-sticky-bar-inner-container",$desktopBarType:oe||"stretch",$themeColor:d,$cornerType:h??"sharp",$cornerRadius:x??20,$themeTextColor:y,$productInfoVisibility:ce,$topRibbonText:me,$backgroundColor:w},ce&&t.createElement(Rp,null,ae&&t.createElement(Lp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(B,n),alt:B?.name}),t.createElement(jp,{ref:U,className:"yt-sticky-bar-product-details"},J&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${n?.title}`),Z&&t.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},Z)),n?.variants?.length>1&&te&&t.createElement(Op,{className:"yt-sticky-bar-option-container",ref:_},n?.options?.map((e=>{const r=I?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase())),o=z[e.name],a=D===e.name,i=t=>{((e,t)=>{const r={...z,[e]:t};N(r);const o=n?.variants?.find((e=>n?.options?.every(((t,n)=>{const o=r?.[t?.name],a=e?.[`option${n+1}`];return"string"==typeof o&&"string"==typeof a?o.trim().toLowerCase()===a.trim().toLowerCase():o===a}))));o&&(S(String(o.id)),$(o)),k&&"combo"===k?.type&&F(r)})(e.name,t),P(null)},l=Ea(r,o);return t.createElement("div",{key:e.name,style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement(Ap,null,e.name),t.createElement($p,null,t.createElement(zp,{onClick:()=>{P(a?null:e.name)},className:"yt-sticky-bar-dropdown-button"},"color"===r?.type&&l?.value?t.createElement(Dp,{$colorValue:l.value}):"image"===r?.type&&l?.value?t.createElement(Pp,{src:l.value}):null,o,t.createElement(_p,{size:8,$isOpen:a})),a&&t.createElement(Np,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},e.values.map((e=>{const n=Ea(r,e);return t.createElement(Ip,{className:"yt-sticky-bar-dropdown-item",key:e,onClick:()=>i(e)},"color"===r?.type&&n?.value?t.createElement(Dp,{$colorValue:n.value}):"image"===r?.type&&n?.value?t.createElement(Pp,{src:n.value}):null,e)})))))}))),ee&&t.createElement(t.Fragment,null,B?.compare_at_price&&B?.compare_at_price>B?.price?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,gn(B?.price,s?.currency)),t.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${H}`,gn(B?.compare_at_price,s?.currency)),t.createElement("span",{style:{backgroundColor:d??"black",color:y??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===h?`${x}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${H}`,gn(B?.compare_at_price-B?.price,s?.currency))):t.createElement(t.Fragment,null,t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,gn(B?.price,s?.currency)))),t.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),ve&&t.createElement(Vp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ce?"row":"column"},re&&t.createElement(Hp,{ref:j,onClick:async()=>{if(k&&"combo"===k.type){if(!E)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(A);if(0===e.length)return;const t=e.map((([,e])=>e)),n=e.map((([e,t])=>{const n=k?.products?.[Number(e)],r=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===t))?.node;return r?{variantId:t,price:Number(r?.price),compareAtPrice:Number(r?.compareAtPrice||r?.price)}:null})).filter((e=>null!==e)),r=n.reduce(((e,t)=>e+Math.max(t.compareAtPrice,t.price)),0),o=n.reduce(((e,t)=>e+t.price),0);let a=Math.min(r,o);k?.percentageOff?a=o*(1-k.percentageOff/100):k?.dealAmount?a=k.dealAmount:k?.amountOff&&(a=o-k.amountOff);const i=n.map((({variantId:e,price:t})=>({variantId:e,price:t})));await E(Number(r.toFixed(2)),t,Number(a.toFixed(2)),i)}else g&&await g(String(T)??String(n?.variants[0]?.id),V)},disabled:q.cartLoading||!ke,$bgColor:ke?m:"#d1d5db",$textColor:ke?f:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:h??"sharp",$cornerRadius:x??20,$fontSize:se,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(ta,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?le??"Add to Cart":"Out of Stock")),ne&&t.createElement(Wp,{onClick:async e=>{try{v&&await v(e)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:q.cartLoading||!ke,$bgColor:ke?d:"#d1d5db",$textColor:ke?y:"#6b7280",$cornerType:h??"sharp",$cornerRadius:x??20,$fontSize:se,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(ta,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?ie??"Buy Now":"Out of Stock")))))},Qp=x.div`
2441
+ `,qp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400},Up=({showStickyCart:e,product:n,addCartItem:r,onSetLoading:i,themeColor:d,cartData:s,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:f,addToStickyCart:g,cartComponentsCornerType:h,cartComponentsCornerRadius:x,themeTextColor:y,stickyCartCustomizationData:b,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:k,comboBundleAddToCartFunction:E})=>{const[T,S]=c(""),[B,$]=c(null),[z,N]=c({}),I=Ta(),[D,P]=c(null),_=o(null);l((()=>{const e=e=>{_.current&&!_.current.contains(e.target)&&P(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const O=a((()=>k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find((e=>e?.node?.availableForSale))?.node:n?.variants?.find((e=>e?.available))),[k,n]),[A,M]=c((()=>{if(!k||"combo"!==k.type)return{};const e={};return k?.products?.forEach(((t,n)=>{const r=t?.productDetails?.variants?.edges?.find((e=>e?.node?.availableForSale))?.node;r&&(e[n]=r.id)})),e})),F=a((e=>{if(!k||"combo"!==k.type)return;const t={};k?.products?.forEach(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((t=>{const r=t?.node;return n?.productDetails?.options?.every(((t,n)=>{const o=e?.[t?.name],a=r?.title?.split(" / ")?.at(n);return!(!o||!a)&&o.trim().toLowerCase()===a.trim().toLowerCase()}))}));o?.node?.id&&(t[r]=o.node.id)})),Object.keys(t).length>0&&M((e=>({...e,...t})))}),[k]);l((()=>{const e=O();if(e){S(String(e.id)),$(e);const t={};n?.options&&Array.isArray(n.options)&&n.options.forEach(((n,r)=>{const o=`option${r+1}`;e?.[o]&&(t[n?.name]=e[o])})),N(t)}}),[n,O]);const R=a((()=>new URLSearchParams(window.location.search).get("variant")||""),[]),L=()=>{const e=R();if(e){const t=n?.variants?.find((t=>String(t?.id)===String(e)));if(t&&t?.available){S(String(t.id)),$(t);const e={};n?.options?.forEach(((n,r)=>{const o=`option${r+1}`;t?.[o]&&(e[n?.name]=t[o])})),N(e)}else{const e=O();e&&(S(String(e.id)),$(e))}}};l((()=>{L();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",L),()=>{t=!1,window.removeEventListener("urlChange",L),window.history.pushState=n,window.history.replaceState=r}}),[R,n,O,B,T]);const j=o(null),[V,W]=c(1),H=xn(s,s?.currency);l((()=>{(async()=>{try{n&&T&&$(n?.variants?.filter((e=>String(e?.id)===String(T)))[0])}catch(e){console.error("Error getting selected product variant id")}})()}),[n,T]);const{cartLoading:q}=cn(),U=o(null),[Q,G]=c(0);l((()=>{U.current&&G(U.current.offsetWidth)}),[]);const Y=n?.options?.find((e=>e?.name?.toLowerCase()?.includes("color")))?.name,Z=Y?z?.[Y]:null,X=b&&(K=b,0!==Object.keys(K).length||K.constructor!==Object)?b:qp;var K;const{showProductName:J,showPrice:ee,showVariantSelector:te,showBuyNowButton:ne,showAddToCartButton:re,desktopBarType:oe,showProductImage:ae,buyNowCtaTitle:ie,addToCartCtaTitle:le,productInfoVisibility:ce,showBarOnDesktop:de,ctaButtonFontSize:se,startsAppearingAtHeight:pe,fullyAppearsAtHeight:ue,topRibbonText:me}=X,[fe,ge]=c(0),[he,xe]=c(100),[ye,be]=c(!1);if(l((()=>{const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=pe||200,n=ue||400;if(e>t){const r=Math.min((e-t)/(n-t),1);ge(r),xe(100-100*r)}else ge(0),xe(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]),l((()=>{const e=()=>{const e=window.innerWidth<768;be(e||!1!==de)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[de]),n?.variants?.length<1)return null;const ve=n?.available??!0,we=O(),Ce=k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find((e=>e?.node?.id===A?.[0]))?.node?.price:B?.price??we?.price??n?.variants?.[0]?.price;if(0===Number(Ce))return null;if(!e||!ye)return null;if(b?.excludeProducts?.includes(n?.handle))return null;const ke=k&&"combo"===k.type?Object.values(A).length>0:B?.available??!0;return t.createElement(Mp,{className:"yt-sticky-bar-container",$opacity:fe,$translateY:he,$desktopBarType:oe||"stretch"},t.createElement(Fp,{className:"yt-sticky-bar-inner-container",$desktopBarType:oe||"stretch",$themeColor:d,$cornerType:h??"sharp",$cornerRadius:x??20,$themeTextColor:y,$productInfoVisibility:ce,$topRibbonText:me,$backgroundColor:w},ce&&t.createElement(Rp,null,ae&&t.createElement(Lp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(B,n),alt:B?.name}),t.createElement(jp,{ref:U,className:"yt-sticky-bar-product-details"},J&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${n?.title}`),Z&&t.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},Z)),n?.variants?.length>1&&te&&t.createElement(Op,{className:"yt-sticky-bar-option-container",ref:_},n?.options?.map((e=>{const r=I?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase())),o=z[e.name],a=D===e.name,i=t=>{((e,t)=>{const r={...z,[e]:t};N(r);const o=n?.variants?.find((e=>n?.options?.every(((t,n)=>{const o=r?.[t?.name],a=e?.[`option${n+1}`];return"string"==typeof o&&"string"==typeof a?o.trim().toLowerCase()===a.trim().toLowerCase():o===a}))));o&&(S(String(o.id)),$(o)),k&&"combo"===k?.type&&F(r)})(e.name,t),P(null)},l=Ea(r,o);return t.createElement("div",{key:e.name,style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement(Ap,null,e.name),t.createElement($p,null,t.createElement(zp,{onClick:()=>{P(a?null:e.name)},className:"yt-sticky-bar-dropdown-button"},"color"===r?.type&&l?.value?t.createElement(Dp,{$colorValue:l.value}):"image"===r?.type&&l?.value?t.createElement(Pp,{src:l.value}):null,o,t.createElement(_p,{size:8,$isOpen:a})),a&&t.createElement(Np,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},e.values.map((e=>{const n=Ea(r,e);return t.createElement(Ip,{className:"yt-sticky-bar-dropdown-item",key:e,onClick:()=>i(e)},"color"===r?.type&&n?.value?t.createElement(Dp,{$colorValue:n.value}):"image"===r?.type&&n?.value?t.createElement(Pp,{src:n.value}):null,e)})))))}))),ee&&t.createElement(t.Fragment,null,B?.compare_at_price&&B?.compare_at_price>B?.price?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,gn(B?.price,s?.currency)),t.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${H}`,gn(B?.compare_at_price,s?.currency)),t.createElement("span",{style:{backgroundColor:d??"black",color:y??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===h?`${x}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${H}`,gn(B?.compare_at_price-B?.price,s?.currency))):t.createElement(t.Fragment,null,t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,gn(B?.price,s?.currency)))),t.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),ve&&t.createElement(Vp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ce?"row":"column"},re&&t.createElement(Hp,{ref:j,onClick:async()=>{if(k&&"combo"===k.type){if(!E)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(A);if(0===e.length)return;const t=e.map((([,e])=>e)),n=e.map((([e,t])=>{const n=k?.products?.[Number(e)],r=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===t))?.node;return r?{variantId:t,price:Number(r?.price),compareAtPrice:Number(r?.compareAtPrice||r?.price)}:null})).filter((e=>null!==e)),r=n.reduce(((e,t)=>e+Math.max(t.compareAtPrice,t.price)),0),o=n.reduce(((e,t)=>e+t.price),0);let a=Math.min(r,o);k?.percentageOff?a=o*(1-k.percentageOff/100):k?.dealAmount?a=k.dealAmount:k?.amountOff&&(a=o-k.amountOff);const i=n.map((({variantId:e,price:t})=>({variantId:e,price:t})));await E(Number(r.toFixed(2)),t,Number(a.toFixed(2)),i)}else g&&await g(String(T)??String(n?.variants[0]?.id),V)},disabled:q.cartLoading||!ke,$bgColor:ke?m:"#d1d5db",$textColor:ke?f:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:h??"sharp",$cornerRadius:x??20,$fontSize:se,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(ta,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?le??"Add to Cart":"Out of Stock")),ne&&t.createElement(Wp,{onClick:async()=>{try{v&&await v(String(T)??String(n?.variants[0]?.id),V)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:q.cartLoading||!ke,$bgColor:ke?d:"#d1d5db",$textColor:ke?y:"#6b7280",$cornerType:h??"sharp",$cornerRadius:x??20,$fontSize:se,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(ta,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?ie??"Buy Now":"Out of Stock")))))},Qp=x.div`
2441
2442
  width: 100%;
2442
2443
  height: 100%;
2443
2444
  display: flex;
@@ -2868,7 +2869,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2868
2869
  &:hover {
2869
2870
  border-color: ${({$themeColor:e})=>e||"#000"};
2870
2871
  }
2871
- `,gu=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h,shouldCheckInventoryQuantity:x},y)=>{const[b,v]=Xt(dn),w=Yt(Kt),C=o(null),[k,E]=c(null),[T,S]=c(!1),[B,$]=c({}),[z,N]=c(b?.variantId),[I,D]=c(b?.quantity||1),[P,_]=c(!1),O=Ta();l((()=>{b?.open?setTimeout((()=>{_(!0)}),10):_(!1)}),[b?.open]);l((()=>{(async()=>{if(!k&&r&&b?.variantId&&b?.handle){const e=await r(b.handle,b.variantId);if(e&&e.variants&&e.options){let t;const n=b.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id))&&String(e.id)===String(b.variantId)))||e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id)))):e.variants.find((e=>(!x||e.available)&&String(e.id)===String(b.variantId))),t){N(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),$(n)}else N(void 0),$({})}E(e)}})()}),[k,r,b]);const A=(e,t)=>{const n={...B,[e]:t};$(n);const r=k?.variants?.find((e=>k.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));if(r){const e=b?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;x&&!r.available||N(String(r.id))}},M=k?.variants?.find((e=>String(e.id)===String(z))),F=xn(w,w?.currency),R=i((()=>{const e={};if(!k)return e;const t=Array.isArray(b?.allowedVariantIds)&&b.allowedVariantIds.length>0;return k.options.forEach((n=>{e[n.name]=n.values.filter((e=>k.variants.filter((r=>{const o=k.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!k.options.every(((e,t)=>{if(e.name===n.name)return!0;const o=B[e.name];return!o||r[`option${t+1}`]===o}))&&(!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(r.id)))&&!(x&&!r.available))})).some((e=>!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(e.id)))&&(!x||e.available)))))})),e}),[k,B,b,x]);return k?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:b?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout((()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Qp,{ref:y,className:"yt-variant-selection-popup"},t.createElement(Yp,{ref:C,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},b?.freebieSelection&&t.createElement(Gp,null,"Unlocked Freebie"),t.createElement(Xp,null,t.createElement(Kp,null,t.createElement(Jp,null,t.createElement(eu,{src:M?.featured_image?.src??k?.featured_image,alt:M?.featured_image?.alt??k?.title})),t.createElement(tu,null,t.createElement(nu,{$themeColor:a,$primaryTextColor:h,href:`${k?.url}?variant=${M?.id}`},k?.title),t.createElement(uu,null,t.createElement(ru,null,t.createElement(ou,{$primaryTextColor:h},F,gn(M?.price,w?.currency??"INR")),null!=M?.compare_at_price&&null!=M?.price&&M.compare_at_price>M.price&&t.createElement(au,null,F,gn(M?.compare_at_price,w?.currency??"INR"))),!b?.freebieSelection&&t.createElement(ya,{value:I,handleItemQuantityIncrement:async()=>{D((e=>e+1))},handleItemQuantityDecrement:async()=>{I>1&&D((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),k?.options?.map((e=>{const n=O?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(lu,{key:e.name},t.createElement(du,null,t.createElement("span",null,"Select ",e.name),B[e.name]&&t.createElement(su,null,B[e.name])),t.createElement(pu,null,R[e.name]?.map((r=>{const o=B[e.name]===r,i=Ea(n,r);return"color"===n?.type&&i?.value?t.createElement(mu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(fu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(cu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)}))))}))),t.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:b?.productRec?async()=>{if(z&&n){S(!0);try{await n(z,I,"product-recommendation-variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!z)return;const t=!!b?.lineItemKey,r=String(z)!==String(b?.variantId);if(!t||r){S(!0);try{const t=b?.freebieSelection;t&&u&&b?.lineItemKey?await u(b.lineItemKey):await e(b?.lineItemKey||b?.variantId,"variant-selector",!0),t&&m?await m(z,b.allowedVariantIds):n&&z&&await n(z,I,"variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!z||T},T?t.createElement(ta,{color:"white",size:13}):b?.productRec?"ADD TO BAG":b?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Qp,{ref:y},t.createElement(Yp,{style:{backgroundColor:p||"white"}},t.createElement(Zp,null,t.createElement(aa,{color:a||"#868E96"}))))}));gu.displayName="DesktopVariantPopup";const hu=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h,shouldCheckInventoryQuantity:x=!1},y)=>{const[b,v]=Xt(dn),w=Yt(Kt),[C,k]=c(null),[E,T]=c(!1),[S,B]=c({}),[$,z]=c(b?.variantId),[N,I]=c(b?.quantity||1),D=o(null),P=Ta(),[_,O]=c(!1);l((()=>{b?.open?setTimeout((()=>{O(!0)}),10):O(!1)}),[b?.open]);l((()=>{(async()=>{if(!C&&r&&b?.variantId&&b?.handle)try{const e=await r(b.handle,b.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=b.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id))&&String(e.id)===String(b.variantId)))||e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id)))):e.variants.find((e=>(!x||e.available)&&String(e.id)===String(b.variantId))),t){z(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),B(n)}else z(void 0),B({})}k(e)}catch(e){}})()}),[C,r,b]),l((()=>{}),[p,e,n,r]);const A=(e,t)=>{const n={...S,[e]:t};B(n);const r=C?.variants?.find((e=>C.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));if(r){const e=b?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;x&&!r.available||z(String(r.id))}},M=C?.variants?.find((e=>String(e.id)===String($))),F=xn(w,w?.currency),R=i((()=>{const e={};if(!C)return e;const t=Array.isArray(b?.allowedVariantIds)&&b.allowedVariantIds.length>0;return C.options.forEach((n=>{e[n.name]=n.values.filter((e=>C.variants.filter((r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every(((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o}))&&(!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(r.id)))&&!(x&&!r.available))})).some((e=>!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(e.id)))&&(!x||e.available)))))})),e}),[C,S,b,x]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:b?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{O(!1),setTimeout((()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Qp,{ref:y,className:"yt-variant-selection-popup"},t.createElement(Yp,{ref:D,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},b?.freebieSelection&&t.createElement(Gp,null,"Unlocked Freebie"),t.createElement(Xp,null,t.createElement(Kp,null,t.createElement(Jp,null,t.createElement(eu,{src:M?.featured_image?.src??C?.featured_image,alt:M?.featured_image?.alt??C?.title})),t.createElement(tu,null,t.createElement(nu,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${M?.id}`},C?.title),t.createElement(uu,null,t.createElement(ru,null,t.createElement(ou,{$primaryTextColor:h},F,gn(M?.price,w?.currency??"INR")),null!=M?.compare_at_price&&null!=M?.price&&M.compare_at_price>M.price&&t.createElement(au,null,F,gn(M?.compare_at_price,w?.currency??"INR"))),!b?.freebieSelection&&t.createElement(ya,{value:N,handleItemQuantityIncrement:async()=>{I((e=>e+1))},handleItemQuantityDecrement:async()=>{N>1&&I((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),C?.options?.map((e=>{const n=P?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(lu,{key:e.name},t.createElement(du,null,t.createElement("span",null,"Select ",e.name,":"),S[e.name]&&t.createElement(su,null,S[e.name])),t.createElement(pu,null,R[e.name]?.map((r=>{const o=S[e.name]===r,i=Ea(n,r);return"color"===n?.type&&i?.value?t.createElement(mu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(fu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(cu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)}))))}))),t.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:b?.productRec?async()=>{if($&&n){T(!0);try{await n($,N,"product-recommendation-variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!$)return;const t=!!b?.lineItemKey,r=String($)!==String(b?.variantId);if(!t||r){T(!0);try{const t=b?.freebieSelection;t&&u&&b?.lineItemKey?await u(b.lineItemKey):await e(b?.lineItemKey||b?.variantId,"variant-selector",!0),t&&m?await m($,b.allowedVariantIds):n&&$&&await n($,N,"variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||E},E?t.createElement(ta,{color:"white",size:13}):b?.productRec?"ADD TO BAG":b?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Qp,{ref:y},t.createElement(Yp,{style:{backgroundColor:p||"white"}},t.createElement(Zp,null,t.createElement(aa,{color:a||"#868E96"}))))})),xu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,cartTitle:s,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:N,applyDiscount:I,discountApplied:D,rewardCoupons:P,userTotalPoints:_,checkoutFunction:O,joinNowFunction:A,guestLoyaltyPercentage:M,showToggleButton:F,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:Q,showCartLevelAltPay:G,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie,checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,primaryTextColor:se,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:Be,cartSigninCTAMainText:$e,showNoteOption:ze,applyNoteToCart:Ne,note:Ie,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:_e,showEditOptionOnProducts:Oe,getProductDetailsByVariantId:Ae,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Qe,removeFreebieFromCart:Ge,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,showStickyAddToCart:nt,stickyCartLineItem:rt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:dt,giftWrapProductDetail:st,enableCustomCartOnCartPage:pt,isCartPage:ut,progressBarFreeProductIconType:mt,addToStickyCart:ft,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:bt,cartTimerInMinutes:vt,cartTimerCustomText:wt,imageAspectSelector:Ct,cartComponentsCornerType:kt,cartComponentsCornerRadius:Et,stickyCartCustomizationData:Tt,cartOffersCarousalData:St,stickyBarBuyNowFunction:Bt,gstSectionCustomizationData:$t,noteSectionTitle:zt,checkoutSectionMessage:Nt,checkoutSectionMessageRedirectLink:It,checkoutSectionMessageDisplay:Dt,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:_t,brandTokenName:Ot,showDiscountOnMRP:At,prefixMessageText:Mt,suffixMessageText:Ft,successMessageText:Rt,toggleDecimal:Lt,cartOffersCarouselHeight:jt,disableCheckoutButton:Vt,showEmptyCartRecommendations:Wt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:qt,showPoweredByBadge:Ut=!0,applyCouponCode:Qt,showApplyCoupon:Gt,enableConfetti:Yt,showCheckoutButtonPaymentIcons:Jt=!0,shouldCheckInventoryQuantity:en,comboBundleData:tn,comboBundleAddToCartFunction:nn})=>{const rn=Zt(Kt),[on,an]=Xt(dn),[ln,cn]=Xt(cl),sn=()=>L(!R),[pn,un]=c((()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}}));l((()=>{const e=e=>{const t=e.detail;un({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)}),[]);const mn=pn.comboBundleData??tn,fn=pn.comboBundleAddToCartFunction??nn;m((()=>{v&&rn(v)}),[v]);const gn=o(null);l((()=>{function e(e){gn.current&&!gn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const[hn,xn]=c(!1);return l((()=>{const e=()=>{xn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:pt&&ut?"relative":"absolute",width:"100%",display:pt&&ut?"flex":"block",alignItems:"center",justifyContent:"center"}},F&&!(pt&&ut)&&t.createElement("button",{style:{margin:"16px"},onClick:sn},R?"Close Drawer":"Open Drawer"),R&&b&&!(pt&&ut)&&t.createElement("div",{onClick:sn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},"‎"),t.createElement(Bp,{isCartPage:ut,enableCustomCartOnCartPage:pt,isOpen:R,setIsOpen:L,backgroundColor:g,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:s,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:N,applyDiscount:I,discountApplied:D,rewardCoupons:P,userTotalPoints:_,checkoutFunction:O,joinNowFunction:A,guestLoyaltyPercentage:M,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:Q,showCartLevelAltPay:G,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie??"minimum_order_value",checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,primaryTextColor:se,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:Be,cartSigninCTAMainText:$e,applyNoteToCart:Ne,note:Ie,showNoteOption:ze,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:_e,showEditOptionOnProducts:Oe,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,cartOffersCarousalData:St,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Qe,removeFreebieFromCart:Ge,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:dt,giftWrapProductDetail:st,progressBarFreeProductIconType:mt,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:bt,cartTimerCustomText:wt,cartTimerInMinutes:vt,imageAspectSelector:Ct,cartComponentsCornerType:kt,cartComponentsCornerRadius:Et,gstSectionCustomizationData:$t,noteSectionTitle:zt,checkoutSectionMessage:Nt,checkoutSectionMessageRedirectLink:It,checkoutSectionMessageDisplay:Dt,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:_t,getProductDetailsByVariantId:Ae,brandTokenName:Ot,showDiscountOnMRP:At??!0,prefixMessageText:Mt,suffixMessageText:Ft,successMessageText:Rt,toggleDecimal:Lt,cartOffersCarouselHeight:jt,disableCheckoutButton:Vt,showEmptyCartRecommendations:Wt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:qt,showPoweredByBadge:Ut,applyCouponCode:Qt,showApplyCoupon:Gt,enableConfetti:Yt,showCheckoutButtonPaymentIcons:Jt,shouldCheckInventoryQuantity:en}),nt&&rt&&d&&t.createElement(Up,{showStickyCart:nt,stickyCartCustomizationData:Tt,product:rt,addCartItem:d,onSetLoading:Me,themeColor:he,themeTextColor:xe,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,addToStickyCart:ft,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,checkoutFunction:Bt,backgroundColor:g,primaryTextColor:se,comboBundleData:mn,comboBundleAddToCartFunction:fn}),hn&&on.open&&t.createElement(gu,{backgroundColor:g,ref:gn,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Ae,themeColor:he,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,removeFreebieFromCart:Ge,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:se,shouldCheckInventoryQuantity:en}),!hn&&on.open&&t.createElement(hu,{ref:gn,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Ae,themeColor:he,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,backgroundColor:g,removeFreebieFromCart:Ge,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:se,shouldCheckInventoryQuantity:en})))};const yu=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>t.createElement(t.Fragment,null,e.map(((a,s)=>{const p=a.minimumQuantity-(r[s]?.length??0),u=o?.filter((e=>r[s]?.includes(e.variantId)));return t.createElement("div",{className:"yt-bundleBuilderTracker-tier-product-list",style:{display:"flex",width:"100%"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",gap:"5px"}},u?.map?.((e=>{const o=e.product.variants?.edges?.find((t=>t.node.id===e.variantId)),a=r[s]?.filter((e=>e===o?.node.id)).length||0;return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-product-item",key:e.variantId,style:{borderRadius:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge",style:{borderRadius:"2px"}},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},d,th(o?.node?.price)),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>l(e.variantId,s)},t.createElement(Xa,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-item",key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-tracker-item",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,..."high"===c&&{borderRadius:"20px"},..."medium"===c&&{borderRadius:"6px"},...""===c&&{borderRadius:"0px"},height:n?"60px":"70px",width:n?"60px":"70px"}},a>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"}},a,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>l(e.variantId,s)},t.createElement(gt,{fontSize:"12px"}))))})),p>=1&&[...Array(p)].map(((e,r)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:n?"60px":"70px",height:n?"60px":"70px",borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"},key:r},t.createElement(co,{size:40,color:"#A0A0A0"})))))),s<e.length-1&&t.createElement("div",{className:"yt-bundleBuilderTracker-plus-icon-container"},t.createElement(co,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))}))),bu=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:a,showProductDetailsInTracker:i,loading:d,handleRemoveItem:s,percentageOff:p,selectedItemsQuantity:u,bundleSubtotal:m,amountOff:f,styles:g,dealAmount:h,isMobile:x=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:v,handleRemoveItemProductTier:w,selectedProductsByTier:C,storeCurrencyCode:k,shadowRoot:E})=>{const[T,S]=c(!1),[B,$]=c(0),[z,N]=c([]),[I,D]=c(0),[P,_]=c(0),[O,A]=c(!1),[M,F]=c(null),R=function(){const e=o(null);return l((()=>{const t=document.createElement("canvas");return t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n z-index: 2147483647;\n background: rgba(255,0,0,0.02); /* EXTREMELY light - just to detect */\n outline: 2px dashed rgba(255,0,0,0.15);\n ",document.body.appendChild(t),e.current=t,console.log("[confetti] canvas appended to document.body:",t),requestAnimationFrame((()=>{if(!e.current)return void console.warn("[confetti] canvasRef missing after RAF");const t=e.current.getBoundingClientRect();console.log("[confetti] canvas rect:",t.width,t.height,t)})),()=>{console.log("[confetti] removing canvas"),t.remove()}}),[]),function(t){if(!e.current)return void console.warn("[confetti] no canvasRef to draw on");const n=Ur(e.current,{resize:!0,useWorker:!1});console.log("[confetti] firing with options:",t),n(t)}}(),L=m?.price||0,j=e?.type,V=e=>{if(e<0||!z[e])return L;const t=z[e].discountValue??0;return p?L*(1-t/100):h?t:f?L-t:L};l((()=>{if(e&&"none"!==e.type)if("productTier"===j&&e.productTier){const t=e.productTier||[];N(t);let n=0;e.productTier.map((e=>{n+=e.minimumQuantity})),_(n-u)}else if(z.length)I>0&&u<z[I-1]?.minimumQuantity?(D(I-1),F(I-1)):u<z[I]?.minimumQuantity&&F(I-1),$(V(I));else{const t=e.offerTier||[];N(t),D(0),_(t[0]?.minimumQuantity-u||r-u)}else N([]),_(r-u),D(0)}),[e,r,u]),l((()=>{z.length&&"productTier"!=j?(()=>{if(!z?.length)return;let e=-1,t=null,n=0;if("offerTier"===j)for(let r=0;r<z.length&&(n+=z[r].minimumQuantity,u>=n);r++)t=r,e=r+1<z.length?r+1:r;if(D(e),F(t),null!==t){let e=z.slice(0,t+1).reduce(((e,t)=>e+t.minimumQuantity),0);A(e===u),S(!0),$(V(t))}else A(!1),S(!1),$(L);const r=e>=0&&e<z.length?z.slice(0,e+1).reduce(((e,t)=>e+t.minimumQuantity),0)-u:z[0].minimumQuantity-u;_(r)})():u===r?(S(!0),$(p?L*(1-p/100):h||(f?L-f:L)),A(!0)):(A(!1),S(!1))}),[u,z]);const W=T?Math.max(m?.compareAtPrice,m?.price):m?.compareAtPrice>m?.price?m?.compareAtPrice:null,H=T?B.toFixed(2):m?.price?.toFixed(2),q=W&&H?(W-Number(H)).toFixed(2):0,U=e&&"none"!==j&&e.offerTier?"offerTier"===j?Math.min(u/(u+P)*100,100):void 0:u/r*100,Q=o(!1);l((()=>{const e=Q.current;if(Q.current=T,!e&&T&&g.byob.enableConfetti){const e=E??document,t=("getElementById"in e?e.getElementById("checkoutButton"):null)||document.getElementById("checkoutButton");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;R?.({particleCount:100,spread:70,origin:{x:r,y:o}})}}),[T,g]),I>=0&&I<z.length&&z[I].tier;const G="number"==typeof M?z[M]?.customText:void 0,Y="string"==typeof G&&""!==G.trim();return t.createElement("div",{className:"yt-bundleBuilderTracker-container "+(x?"mobile":""),style:{justifyContent:g.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==j&&null!==M&&M>=0&&t.createElement("div",{className:"yt-bundleBuilderTracker-offer-tier-tag",style:{backgroundColor:g?.general?.primaryColor??"#000",color:g?.general?.primaryContrastColor??"#fff",top:x?100===U?"-26px":"-32px":100===U?"-29px":"0px",zIndex:10}},Y?t.createElement(t.Fragment,null,G," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy "," ",z.slice(0,M+1).reduce(((e,t)=>e+t.minimumQuantity),0)," ","at",f||h?t.createElement(t.Fragment,null," ",nh(g.general.currencySymbol,k)):""," ",th(z[M]?.discountValue),p?t.createElement(t.Fragment,null,"% "):th(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),x&&P>=1&&!O&&"offerTier"!==j?t.createElement("div",{className:"yt-bundleBuilderTracker-mobile-remaining",style:{margin:"0",height:"auto"}},"Select ",P," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==j&&t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-container"},t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-text"},"offerTier"==j&&z.length>0&&I>=0&&P>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"},className:"yt-bundleBuilderTracker-add-more-text"},"Add ",P," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",u+P," at",f||h?t.createElement(t.Fragment,null,nh(g.general.currencySymbol,k)):""," ",th(z[I]?.discountValue),p?t.createElement(t.Fragment,null,"% "):th(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""),Y?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",P," more to unlock"," ",null!==M&&(z[M+1]?.customText||z[M]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",P," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",u+P," at",f||h?t.createElement(t.Fragment,null,nh(g.general.currencySymbol,k)):""," ",th(z[I]?.discountValue),p?t.createElement(t.Fragment,null,"% "):th(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):"")))),t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-background"},t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-fill",style:{width:`${U??0}%`,backgroundColor:100===(U??0)?"#4caf50":y??g?.general.primaryColor??"black"}}," "))),g.byob.selectedProductsVisibility&&t.createElement("div",{className:"hide-tracker-scrollbar yt-bundleBuilderTracker-product-list-wrapper",style:{columnGap:"productTier"===j?"0px":"10px",maxWidth:x?"90%":"55%"}},"productTier"===j?t.createElement(yu,{tiers:z,isMobile:x,selectedProductsByTier:C??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:i,handleRemoveItemProductTier:w,cornerRadius:g.byob.borderRadius,currencySymbol:nh(g.general.currencySymbol,k)}):t.createElement(t.Fragment,null,a?.map?.((e=>{const n=e.product.variants?.edges?.find((t=>t.node.id===e.variantId));return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-item-container",style:{borderRadius:g.byob.borderRadius},key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge"},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},g.general.currencySymbol,n?.node?.price),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(Xa,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-item-wrapper",key:e.variantId,style:{marginTop:"8px",marginRight:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-item-image-box",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,height:x?"60px":"70px",width:x?"60px":"70px",borderRadius:g.byob.borderRadius}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:g.byob.borderRadius}},e.quantity,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>s(e.variantId)},t.createElement(gt,{fontSize:"12px"}))))})),P>=1&&[...Array(P)].map(((e,n)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:x?"60px":"70px",height:x?"60px":"70px",borderRadius:g.byob.borderRadius},key:n},t.createElement(co,{size:40,color:"#A0A0A0"})))))),(!x||O)&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-container",style:{width:x?"100%":"auto"}},Number(H)>0&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},t.createElement("span",{className:"yt-bundleBuilderTracker-subtotal-label"},"Subtotal"),Number(q)>0?t.createElement("span",{className:"yt-bundleBuilderTracker-save-label"},"Save:"," ",nh(g.general.currencySymbol,k),th(q)):""),t.createElement("div",{className:"yt-bundleBuilderTracker-subtotal-row"},t.createElement("span",{className:"yt-bundleBuilderTracker-total_price"},nh(g.general.currencySymbol,k),Number(H)>=0?th(Number(H).toFixed(2)):0),W&&g.byob.compareAtPriceVisibility&&Number(W)>Number(H)&&t.createElement("span",{className:"yt-bundleBuilderTracker-summary_price"},nh(g.general.currencySymbol,k),th(Number(W).toFixed(2))))),t.createElement("button",{className:"yt-bundleBuilderTracker-checkout-button",style:{cursor:O?"pointer":"auto",backgroundColor:100===(U??0)||O?g.general.ctaBackgroundColor||"black":"#f4f4f6",color:100===(U??0)||O?g.general.ctaTextColor||"#fff":"#000",border:`1.18px solid ${g.general.ctaBorderColor}`,borderRadius:g.general.ctaBorderRadius,boxShadow:O?"0px 4px 8px rgba(0, 0, 0, 0.2)":"none"},disabled:!O&&P>=1,onClick:e=>{d||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},d?t.createElement(ta,{color:"white",loading:d,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P>=1&&!O?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",P," More Item(s)"):t.createElement("div",{className:"yt-bundleBuilderTracker-checkout-text",style:{color:v??g.general.ctaTextColor}},g.byob.checkoutCTAText??"Checkout"))))},vu={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},wu={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Cu=e=>{const[n,r]=c(!1);l((()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&vu[e]?vu[e]:{},r={...wu,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...a};return t.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===a.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=a.transform||"translateY(0)"}},t.createElement(bu,{...e,isMobile:n}))},ku=Mt(void 0);function Eu(e){return Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(e)}function Tu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Su(e,t){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Su(e,t)}function Bu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$u(e);if(t){var o=$u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Eu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$u(e)}var zu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Su(e,t)}(o,h);var e,t,n,r=Bu(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&Tu(e.prototype,t),n&&Tu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Nu=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},Iu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},Du=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},Pu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},_u=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},Ou=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},Au=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var Mu=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then((function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then((function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()}))})).catch((function(t){console.error(t),console.error("Failed to download image from "+e)})))}},Fu=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,d=e.enableZoom,s=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:Mu(n)},t.createElement(Pu,null)),d&&t.createElement("a",{onClick:a},o?t.createElement(Du,null):t.createElement(Iu,null)),s&&t.createElement("a",{onClick:i},t.createElement(Au,null)),t.createElement("a",{onClick:l},t.createElement(_u,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Ru(e){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(e)}function Lu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ju(e,t){return ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ju(e,t)}function Vu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hu(e);if(t){var o=Hu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ru(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wu(e)}(this,n)}}function Wu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hu(e){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hu(e)}function qu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ju(e,t)}(a,h);var e,n,r,o=Vu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qu(Wu(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),qu(Wu(e),"handleOnLoad",(function(){e.setState({loading:!1})})),qu(Wu(e),"handleOnContextMenu",(function(t){!e.props.contextMenu&&t.preventDefault()})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(Ou,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&Lu(e.prototype,n),r&&Lu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Qu(e){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qu(e)}function Gu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yu(e,t){return Yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yu(e,t)}function Zu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ku(e);if(t){var o=Ku(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Qu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xu(e)}(this,n)}}function Xu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ku(e)}function Ju(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var em=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yu(e,t)}(a,h);var e,n,r,o=Zu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ju(Xu(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Ju(Xu(e),"handleKeyDown",(function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()})),Ju(Xu(e),"getCoordinatesIfOverImg",(function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}})),Ju(Xu(e),"handleMouseDownOrTouchStart",(function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState((function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}}))}})),Ju(Xu(e),"handleMouseMoveOrTouchMove",(function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState((function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}}))}})),Ju(Xu(e),"handleMouseUpOrTouchEnd",(function(t){e.setState({moveStart:void 0})})),Ju(Xu(e),"toggleZoom",(function(t){t.preventDefault(),e.setState((function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}}))})),Ju(Xu(e),"toggleRotate",(function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState((function(e){return{rotationDeg:e.rotationDeg+=90}})):e.setState({rotationDeg:90})})),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,d=n.showRotate,s=n.imageBackgroundColor,p=void 0===s?"black":s,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(zu,{name:"__react_modal_image__lightbox",css:Nu({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(Uu,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(Uu,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(Fu,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!d})))}}])&&Gu(e.prototype,n),r&&Gu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function tm(e){return tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tm(e)}function nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rm(e,t){return rm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rm(e,t)}function om(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=im(e);if(t){var o=im(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return am(e)}(this,n)}}function am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},im(e)}function lm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rm(e,t)}(a,h);var e,n,r,o=om(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lm(am(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),lm(am(e),"toggleModal",(function(){e.setState((function(e){return{modalOpen:!e.modalOpen}}))})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,d=e.hideZoom,s=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(em,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:d,showRotate:s,imageBackgroundColor:p}))}}],n&&nm(e.prototype,n),r&&nm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const dm=n(((e,n)=>{const[r,o]=Xt(ku),a=i((()=>e=>e?r?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?1/0:0:1/0:0),[r?.tracksInventory]),d=r?.variants.edges?.filter((e=>a(e.node)>0))||[],[s,p]=c(d?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[h,x]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null),T=e.shadowRoot??document.body;l((()=>{if(r){const e=r.variants.edges?.filter((e=>a(e.node)>0));p(r?.selectedVariant??e[0]?.node)}}),[r,a]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===s?.id));x(t?t.quantity:0)}),[h,e.selectedProducts,s]);const S=()=>{s?.id&&r&&(b("check"),e.handleAddToBundle(s?.id,r,1),setTimeout((()=>{b("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r)return null;const{title:B,descriptionHtml:$,media:z,variants:N}=r,I=z.edges.map((e=>e?.node.preview.image??e?.node.image)).filter((e=>e?.url?.length>0));l((()=>{if(r&&s?.image?.url&&Array.isArray(I)){const e=I.findIndex((e=>e?.url===s?.image?.url));-1!==e&&e!==u&&m(e)}}),[s]);const D=e=>{const t=e.target.value,n=d?.find((e=>e.node.id===t))?.node;n&&a(n)>0&&p(n)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const P=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},O=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m((e=>e<I.length-1?e+1:0)):e<-t&&m((e=>e>0?e-1:I.length-1))}C(null),E(null)};e.hideAddToBundle||a(s);const A=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content "+(f?"small-screen":"large-screen"),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement("div",{className:"yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement("button",{className:"yt-bundleProductModal-modal-close-button",onClick:e=>{e.stopPropagation(),o(void 0)},style:{backgroundColor:"white"}},t.createElement(ut,{size:"25"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:P,onTouchMove:_,onTouchEnd:O},t.createElement(cm,{small:rh(I[u]?.url),medium:rh(I[u]?.url),large:rh(I[u]?.url),hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter((e=>e?.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:rh(n?.url),alt:n.altText||`${B} - Image ${r+1}`,onClick:e=>{e.stopPropagation(),m(r)},style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},d.length>1?s?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(er,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-variant-selection",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},d.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},s?.title)),t.createElement("select",{value:s?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},d.map((({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title)))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(go,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},s?.compareAtPrice&&parseFloat(s.compareAtPrice)>parseFloat(s?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.price)))),!e.hideAddToBundle&&a(s)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{style:{width:"80%"},className:"yt-bundleProductModal-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:"idle"!==y},"Add to bundle")))),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),M=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content small-screen",style:{padding:"0px",position:"relative"},onClick:e=>e.stopPropagation(),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal"},t.createElement("button",{className:"yt-bundleProductModal-modal-phone-close-button",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:e=>{e.stopPropagation(),o(void 0)}},t.createElement(ho,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px",width:"100vw",height:"100vh",overflowY:"auto"}},t.createElement("div",{className:"yt-bundleProductModal-modal-image-section small-screen"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:P,onTouchMove:_,onTouchEnd:O},t.createElement(cm,{small:rh(I[u]?.url),medium:rh(I[u]?.url),large:rh(I[u]?.url),hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map(((e,n)=>t.createElement("span",{className:"yt-bundleProductModal-modal-image-indicator",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map(((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:rh(n?.url),alt:n.altText||`${B} - Image ${r+1}`,onClick:e=>{e.stopPropagation(),m(r)},style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section small-screen",style:{padding:"0px !important",margin:"15px 0",paddingBottom:"50px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},d.length>1?s?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-only",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(er,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important",width:"95vw"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-bundleProductModal-modal-phone-bottom-bar",style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},d.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},s?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:s?.id||"",onChange:D,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},d.map((({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title)))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(go,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},s?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.price)))),!e.hideAddToBundle&&a(s)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:"idle"!==y},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?M:A,T)})),sm=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:Nn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))}))),pm=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:d})=>{const s=i((()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0),[e?.tracksInventory]),p=i((()=>{const t=e.variants.edges.find((e=>{const t=e.node;return s(t)>0}))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]}),[e,s]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l((()=>{const e=()=>g(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const h=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0])))?.node,x=h?.image?.url||e.featuredMedia?.preview?.image?.url,y=Nn(x,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},w=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.options.find((t=>t.name===e.name));return e.values.map((e=>{const n=t?.values?.find((t=>t.name===e));return{name:e,value:n?.value||e}}))},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find((e=>e.name===n))||null};if(!n)return null;const k=t.createElement("div",{onClick:r,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title",className:"yt-bundleBuilder-variant-options-modal-backdrop"},t.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}},className:"yt-bundleBuilder-variant-options-modal-container"},t.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"},className:"yt-bundleBuilder-variant-options-modal-product-block"},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"},className:"yt-bundleBuilder-variant-options-modal-product-image"}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4},className:"yt-bundleBuilder-variant-options-modal-product-info"},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-product-title"},e.title))),t.createElement("div",{style:{padding:"20px"},className:"yt-bundleBuilder-variant-options-modal-variant-selectors"},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0},className:"yt-bundleBuilder-variant-options-modal-option"},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},className:"yt-bundleBuilder-variant-options-modal-option-label"},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-option-name"},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"},className:"yt-bundleBuilder-variant-options-modal-option-selected-value"},C(n,r)?.name||n.values[0])),t.createElement(sm,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&s(a)>0})(r,t),isMobile:f})))))),t.createElement("button",{className:"yt-bundleBuilder-variant-options-modal-confirm-button",onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0])))?.node,n=!!t&&s(t)>0;if(t?.id&&n)d(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find((e=>s(e.node)>0))?.node.id;t&&(d(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return v.createPortal(k,document.body)},um=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map((({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""})).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",d=i(c,800)||c,s=[];if(n&&n!==e){const e=l(n);e&&s.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(s.length>0?s.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):s.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&s.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},s,t.createElement("img",{src:d,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function mm({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:d}){const s={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=e<d;return t.createElement("div",{className:"yt-bundleBuilder-quantity-selector-container"},t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-minus",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:s},"-"),t.createElement("div",{className:"yt-bundleBuilder-quantity-selector_quantity"},e," added"),t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-plus",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,d);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...s,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const fm=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),d=i((()=>rh(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||""),[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),s=i((()=>e?.media?.edges?.map((e=>rh(e?.node?.preview?.image?.url??e?.node?.image?.url))).filter(Boolean)??[]),[e?.media?.edges]),p=i((()=>s?.[1]??d??""),[s,d]);l((()=>{if(d){(new Image).src=d}}),[d]);const u=i((()=>d||s?.[0]),[d,s]);return t.createElement("div",{className:"yt-bundleBuilder-image-effect",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-bundleBuilder-image-effect_wrapper",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-bundleBuilder-image-effect_main-image",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:s?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-bundleBuilder-image-effect_hover-image",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:e.title})))},gm=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:d,handleRemoveItem:s,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f})=>{const g=Zt(ku),h=n.customizations,x=h?.byob?.variantSelectorType,[y,b]=c(!1),v=h.general?.variantTitleSuffix?e?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map((e=>e.node.title)).map((e=>e.split(" ")));let n=[...t[0]];for(let e=1;e<t.length;e++){const r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map((e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}}))})(e?.variants?.edges);if(!v||!v.length)return t.createElement(t.Fragment,null);const w=a((t=>{const n=f?.find((e=>e.variantId===t))?.quantity;if(void 0!==n)return n;const r=v?.find((e=>e.node.id===t)),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0}),[v,f,e.tracksInventory]),C=v?.find((e=>w(e.node.id)>0))?.node?.id;if(!C&&!h.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[k,E]=c(v?.find((e=>w(e.node.id)>0))?.node?.id||v[0]?.node?.id),[T,S]=c(0),[B,$]=c(window.innerWidth<450),[z,N]=c("normal"),I=v?.find((e=>e?.node?.id===k))?.node,D=w(k||"");l((()=>{const e=m.find((e=>e.variantId===k));S(e?e.quantity:0)}),[T,m,k]),l((()=>{const e=()=>{$(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?N("500"):CSS.supports("font-weight","400")?N("400"):CSS.supports("font-weight","600")&&N("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",z)}),[z]),l((()=>{if(k&&!v?.some((e=>e.node.id===k))){const e=v.find((e=>w(e.node.id)>0))?.node.id||v[0]?.node?.id;e&&E(e)}}),[k,v,w]);const P=e.variants&&e.variants.edges?.length>1&&"customOptions"!==x,_="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===_,A="75851235630"===_,M=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(e),F=M.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{className:`bundle-builder-product-container ${p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"} ${"none"===h?.byob.shadowType?"shadow-none":"spread"===h?.byob.shadowType?"shadow-spread":"shadow-no-spread"}`,style:{borderRadius:h?.byob.borderRadius,border:"transparent"!==h?.byob.borderColor?`1px solid ${h?.byob.borderColor}`:"none",backgroundColor:h?.byob.cardBackgroundColor||"#fff"},onClick:()=>{if(D<=0)return;const t={...e,variants:{...e.variants,edges:v},selectedVariant:I};g(t)}},t.createElement("div",{className:"yt-bundleBuilder-product-card_image-wrapper"},t.createElement(fm,{product:e,styles:h,selectedVariant:I}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-bundleBuilder-product-card_badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:h.byob.borderRadius}},n.productCardBadgeText),P&&t.createElement("div",{className:"yt-bundleBuilder-variant-selector-container",style:{position:"relative",width:"100%"}},t.createElement("select",{className:"bundle-builder-variant-selector "+(O?"bundle-builder-variant-selector--coralHaze":""),onClick:e=>{e.preventDefault(),e.stopPropagation()},value:k||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),E(e.target.value)}},v?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{className:"yt-bundleBuilder-variant-selector_icon",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-bundleBuilder-product-card_details"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&F&&t.createElement("div",{className:"yt-bundleBuilder-product-card_category-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-bundleBuilder-product-card_category-container",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},M.slice(0,2).map(((e,n)=>t.createElement("span",{className:"yt-bundleBuilder-product-card_category",key:n,style:{fontSize:B?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),M.length>2&&t.createElement("span",{className:"yt-bundleBuilder-product-card_category-more",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",M.length-2," more"))),t.createElement("div",{className:"yt-bundleBuilder-product-card_title",style:{"--title-margin-top":B?"4px":"0px","--title-padding":n?.showBorder??1?"0 10px":"0 4px",...!1===h?.byob.productsPriceVisibility&&{"--title-padding":"8px"},...h?.byob.productTitleFontSize&&{"--title-font-size":h?.byob.productTitleFontSize}}},A?String(I?.displayName).replace("- Default Title",""):e.title,I?.commonSuffix?" -"+I?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14}),t.createElement("span",{className:"yt-bundleBuilder-product-card_rating-text",style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(er,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),h?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundleBuilder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(I?.price??"0")>0?t.createElement("span",{className:"yt-bundleBuilder-product_price--new"},nh(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",th(I?.price)):t.createElement("span",{className:"yt-bundleBuilder-product-card_price--free"},"Free"),I?.compareAtPrice&&h?.byob.compareAtPriceVisibility&&parseFloat(I.compareAtPrice)>parseFloat(I?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price yt-bundleBuilder-product-card_price--old",style:{fontSize:"14px"}},nh(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",th(I.compareAtPrice))),(D>0||!h?.general.trackInventory)&&t.createElement("div",{className:"yt-product-atc-wrapper"},(0===T||void 0===T)&&t.createElement("button",{style:{...!o&&{backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(1),(()=>{if(!k)return;"customOptions"===x&&v.length>1?b(!0):r(k,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},h?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&T>0&&k&&t.createElement("div",{className:"visible yt-bundleBuilder-quantity-selector-container--visible",style:{overflow:"hidden"}},t.createElement(mm,{remainingQuantity:i,setQuantity:S,quantity:T,handleAddToBundle:r,variantId:k,product:e,handleRemoveItem:s,hideAddToBundle:o,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&T>0&&k&&t.createElement("button",{style:{backgroundColor:h?.general?.primaryContrastColor||"#fff"},className:"yt-bundleBuilder-product-card_add-to-bundle-button--added"},t.createElement("div",{className:"yt-bundleBuilder-product-card_added-button-text"},"ADDED"),t.createElement("div",{onClick:e=>{e.stopPropagation();const t=Math.max(0,T-1);S(t),s&&k&&s(k,1)},className:"yt-bundleBuilder-product-card_remove-button"},t.createElement(po,{className:"yt-bundleBuilder-product-card_remove-icon",style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&h?.general.trackInventory&&t.createElement("div",{style:{backgroundColor:h.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled yt-bundleBuilder-product-card_add-to-bundle-button--disabled"},h?.general.outOfStockLabel||"Out of Stock")),"customOptions"===x&&y&&v.length>1&&t.createElement(pm,{product:e,isOpen:y,onClose:()=>b(!1),variantOptions:n.variantOptions,cta:{textColor:h.general.ctaTextColor,backgroundColor:h.general.primaryColor},onConfirm:t=>{E(t),r(t,e,1)}}))},hm=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:d})=>t.createElement("div",{className:"yt-bundleBuilder-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,s)=>{const p=s+1,u=o[s].minimumQuantity-(i[s]?.length??0)==0,m=s===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-bundleBuilder-stepper_step "+(m?"yt-bundleBuilder-stepper_step--active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===d?()=>{}:n(p-1)},t.createElement("div",{className:"yt-bundleBuilder-stepper_label",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-bundleBuilder-stepper_line-container",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_dot",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:s<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{className:"yt-bundleBuilder-tier_title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),xm=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,d]=c(!1),[s,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(s)}),300);return()=>clearTimeout(e)}),[s,n]),t.createElement("div",{className:"yt-byob-sort-filter-container yt-bundleBuilder-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner yt-bundleBuilder-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper yt-bundleBuilder-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(so,{className:"yt-byob-search-icon yt-bundleBuilder-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>d(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input yt-bundleBuilder-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:s,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input yt-bundleBuilder-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(so,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon yt-bundleBuilder-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>d(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper yt-bundleBuilder-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label yt-bundleBuilder-filter_label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select yt-bundleBuilder-filter_select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},ym=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===e?.byob?.categoryFilterOnPage?t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button "+(a?"yt-categoryfilter-tab-button--active":""),style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},bm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:d,renderingOnPage:s,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m,shadowRoot:f})=>{const[g,h]=c(void 0),[x,y]=c(window.innerWidth<450),[b,v]=c(0),[w,C]=c({}),k=e.builderTiers?.type,E=e.customizations,T=e.builderTiers?.productTier??[],S=e.builderTiers?.offerTier??[],[B,$]=c([]),[z,N]=c(!1),[I,D]=c("All"),[P,_]=c(0),O=o(null);l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),$(Array.from(t)),N(n)}),[e.products]);const A=((e,t)=>"All"===t?e:e.filter((e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1})))(e.products.filter((e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status)),I),M="productTier"===k?T.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===k?S.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[F,R]=c(""),[L,j]=c(""),V=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(A,F),W=((e,t)=>[...e].sort(((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}})))(V,L),H=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),d=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-d;case"price-high-to-low":return d-c;default:return 0}})))(T,W,F,L,b),[q,U]=Xt(ku),[Q,G]=c(!1),Y="productTier"===k?H:W,Z=Y.slice(0,20*(P+1));l((()=>{setTimeout((()=>{G(!0)}),100)}),[]);const X=o(null);l((()=>{const e=()=>{y(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=rh(e.coverImageUrl)??"",t.onload=()=>{h(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{G(!1),setTimeout((()=>G(!0)),100)}),[b]);const K=(e,t)=>{if("productTier"===k){let n={...w},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=T.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}C(n);const o=T.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&v(o)}u(e)};l((()=>{if("productTier"===k){const e=Object.fromEntries(T.map((e=>[e.tier,[]])));C(e)}}),[e]),l((()=>{if("productTier"!==k||!T[b])return;if(M===p)return;const e=T.findIndex(((e,t)=>{const n=w[t]||[];return t>=b&&n.length<e.minimumQuantity}));-1!==e&&e!==b&&(v(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[w,T,k]),l((()=>{R("")}),[b]),l((()=>{function e(e){if(!X.current||!e.target)return;!X.current.contains(e.target)&&U(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const J=(e,t,o)=>{var a;"productTier"===k&&(a=e,C((e=>{const t={...e},n=T.findIndex(((e,n)=>{const r=t[n]||[];return n>=b&&r.length<e.minimumQuantity}));return-1!==n&&v(n),t[n]||(t[n]=[]),t[n].push(a),t}))),oh(e,t,o,n,r)},ee=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),te=x&&e.mobileCoverImageUrl?rh(e.mobileCoverImageUrl):rh(e.coverImageUrl??"")||null,ne=e.customStoreDetails?.fixedInventoryDetails,re=a(((e,t)=>{const n=ne?.find((e=>e.variantId===t))?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find((e=>e.node.id===t)),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0}),[ne]),oe=a((e=>{const t=E?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(ne){if(r.some((e=>ne.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return r.some((e=>re(n,e.node.id)>0))}),[E?.general?.showOutOfStockProducts,ne,re]),ae="bundles"==e.appName?e.pageHeader?.title:e?.title,ie="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l((()=>{_(0)}),[F,L,I,b]);const le=a((()=>{Z.length<Y.length&&_((e=>e+1))}),[Z.length,Y.length]);return l((()=>{const e=new IntersectionObserver((([e])=>{e.isIntersecting&&le()}),{threshold:.1});return O.current&&e.observe(O.current),()=>{O.current&&e.unobserve(O.current)}}),[le]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:E.byob.sectionBackgroundColor,..."transparent"!==E.fixedBundle.sectionBackgroundColor&&{padding:"20px"},willChange:"transform",backfaceVisibility:"hidden",transform:"translateZ(0)"},id:"yt-bundleBuilder-main-container",className:"yt-bundleBuilder-main-container"},te?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}},className:"yt-bundleBuilder-header-banner"},te&&t.createElement(um,{coverImageUrl:te,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"},className:"yt-bundleBuilder-header_text-overlay"},t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.titleFontSize??"3rem",fontWeight:"700",color:E?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:E?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title yt-bundleBuilder-header_title"},ae),t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.subtitleFontSize??"1.5rem",color:E?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle yt-bundleBuilder-header_subtitle"},ie))):(ae||ie)&&t.createElement("div",{className:"yt-bundleBuilder-header-container"},ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.titleFontSize??"3rem",fontWeight:"700",color:E?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:E?.byob?.titleBackgroundColor??"transparent"},className:"yt-bundleBuilder-header_title"},ae),ie&&t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.subtitleFontSize??"1.5rem",color:E?.byob?.titleTextColor??"#000"},className:"yt-bundleBuilder-header_subtitle"},ie)),t.createElement("div",{className:"products-display yt-bundleBuilder-products-display"},"productTier"===k&&T.length>0&&E?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(hm,{currentStep:b,totalSteps:T.length,tiers:T,isMobile:x,primaryColor:E?.general?.primaryColor,primaryTextColorCta:E?.general?.primaryContrastColor,setCurrentProductTier:v,selectedProductsByTier:w,tierNavigation:E.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"},className:"yt-bundleBuilder-filters-container"},e?.enableSortAndFilter&&t.createElement(xm,{isMobile:x,searchTerm:F,setSearchTerm:R,setSortBy:j,styles:E}),e?.customizations?.byob?.enableProductCategories&&z&&t.createElement("div",null,t.createElement(ym,{styles:E,isMobile:x,categories:B,activeCategory:I,onCategoryChange:e=>{D(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display yt-bundleBuilder-product-grid"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"},className:"yt-bundleBuilder-product-grid_no-products-text"},"No products found"):"productTier"===k&&T.length>0?Z.filter((e=>oe(W.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(T[b]?.minimumQuantity??0)>(w[b]?.length??0),i=W.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(gm,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:J,hideAddToBundle:!a,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>K(e,b),selecteditems:n,transitionActive:Q,customVariantsQuantity:ne}):null})):Z.filter(oe).map(((r,o)=>t.createElement(gm,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:J,hideAddToBundle:p>=ee,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:Q,customVariantsQuantity:ne}))),Z.length<Y.length&&t.createElement("div",{ref:O,style:{height:"1px",width:"100%",display:"block"}})),!s&&t.createElement(Cu,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:M,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:K,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:d,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:w,renderingOnPage:s,shadowRoot:f})),s&&t.createElement(Cu,{handleAddToCart:i,minimumQuantity:M,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:K,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:E?.general.primaryColor||"#000",primaryTextColorCta:E.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:w,renderingOnPage:s,shadowRoot:f}),q&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==k?r=(T[b]?.minimumQuantity??0)>(w[b]?.length??0):"offerTier"==k&&(r=p<S.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(dm,{handleAddToBundle:J,ref:X,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,selectedProducts:n,themeColor:E?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:E?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",shadowRoot:f})})())},vm=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:d,storeCurrencyCode:s})=>{const p=i((()=>t=>{const n=e?.productDetails?.variants?.edges?.find((e=>e.node.id===t)),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0}),[e.productDetails]),u=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node;p(n);const m=i((()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[u,e.productDetails.options]),f=e=>{r(e)};return c?t.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:rh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map((e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)}))),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},nh(o.general.currencySymbol,s),th((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},nh(o.general.currencySymbol,s),th(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:rh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),t.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&d&&m&&t.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},nh(o.general.currencySymbol,s),th((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},nh(o.general.currencySymbol,s),th(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map((e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)}))),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find((e=>e.node.title===l))?.node,s=0===(c?p(c.id):0),u=m[r]===a,g=d&&d?.options?.find((e=>e.name===n.name));return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},g?.values.find((e=>e.name===a))?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find((e=>e.name===a))?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},g?.values.find((e=>e.name===a))?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:rh(g?.values.find((e=>e.name===a))?.value||"/placeholder.svg"),alt:a,style:{width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)})))))))},wm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,d]=c(window.innerWidth<786);l((()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))})),[e,n]);const s=i((()=>(e,t)=>{const n=e?.variants?.edges?.find((e=>e.node.id===t)),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0}),[]),[p,u]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails?.variants?.edges?.find((t=>s(e.productDetails,t?.node?.id)>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),m=e.products?.every(((e,t)=>{const n=p[t];return s(e.productDetails,n)>0})),f=(e,t)=>{u((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(p).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},nh(y.general.currencySymbol,e.storeCurrencyCode),th(h)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},nh(y.general.currencySymbol,e.storeCurrencyCode),th(g)),t.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${nh(y.general.currencySymbol,e.storeCurrencyCode)}${th(e?.amountOff)} Off`:`Save ${nh(y.general.currencySymbol,e.storeCurrencyCode)}${th(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===p[r]))?.node;return o?t.createElement(vm,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(vm,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(p);await n(Number(g),r,Number(h),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(ta,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Cm=x.div`
2872
+ `,gu=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h,shouldCheckInventoryQuantity:x},y)=>{const[b,v]=Xt(dn),w=Yt(Kt),C=o(null),[k,E]=c(null),[T,S]=c(!1),[B,$]=c({}),[z,N]=c(b?.variantId),[I,D]=c(b?.quantity||1),[P,_]=c(!1),O=Ta();l((()=>{b?.open?setTimeout((()=>{_(!0)}),10):_(!1)}),[b?.open]);l((()=>{(async()=>{if(!k&&r&&b?.variantId&&b?.handle){const e=await r(b.handle,b.variantId);if(e&&e.variants&&e.options){let t;const n=b.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id))&&String(e.id)===String(b.variantId)))||e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id)))):e.variants.find((e=>(!x||e.available)&&String(e.id)===String(b.variantId))),t){N(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),$(n)}else N(void 0),$({})}E(e)}})()}),[k,r,b]);const A=(e,t)=>{const n={...B,[e]:t};$(n);const r=k?.variants?.find((e=>k.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));if(r){const e=b?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;x&&!r.available||N(String(r.id))}},M=k?.variants?.find((e=>String(e.id)===String(z))),F=xn(w,w?.currency),R=i((()=>{const e={};if(!k)return e;const t=Array.isArray(b?.allowedVariantIds)&&b.allowedVariantIds.length>0;return k.options.forEach((n=>{e[n.name]=n.values.filter((e=>k.variants.filter((r=>{const o=k.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!k.options.every(((e,t)=>{if(e.name===n.name)return!0;const o=B[e.name];return!o||r[`option${t+1}`]===o}))&&(!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(r.id)))&&!(x&&!r.available))})).some((e=>!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(e.id)))&&(!x||e.available)))))})),e}),[k,B,b,x]);return k?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:b?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout((()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Qp,{ref:y,className:"yt-variant-selection-popup"},t.createElement(Yp,{ref:C,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},b?.freebieSelection&&t.createElement(Gp,null,"Unlocked Freebie"),t.createElement(Xp,null,t.createElement(Kp,null,t.createElement(Jp,null,t.createElement(eu,{src:M?.featured_image?.src??k?.featured_image,alt:M?.featured_image?.alt??k?.title})),t.createElement(tu,null,t.createElement(nu,{$themeColor:a,$primaryTextColor:h,href:`${k?.url}?variant=${M?.id}`},k?.title),t.createElement(uu,null,t.createElement(ru,null,t.createElement(ou,{$primaryTextColor:h},F,gn(M?.price,w?.currency??"INR")),null!=M?.compare_at_price&&null!=M?.price&&M.compare_at_price>M.price&&t.createElement(au,null,F,gn(M?.compare_at_price,w?.currency??"INR"))),!b?.freebieSelection&&t.createElement(ya,{value:I,handleItemQuantityIncrement:async()=>{D((e=>e+1))},handleItemQuantityDecrement:async()=>{I>1&&D((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),k?.options?.map((e=>{const n=O?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(lu,{key:e.name},t.createElement(du,null,t.createElement("span",null,"Select ",e.name),B[e.name]&&t.createElement(su,null,B[e.name])),t.createElement(pu,null,R[e.name]?.map((r=>{const o=B[e.name]===r,i=Ea(n,r);return"color"===n?.type&&i?.value?t.createElement(mu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(fu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(cu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)}))))}))),t.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:b?.productRec?async()=>{if(z&&n){S(!0);try{await n(z,I,"product-recommendation-variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!z)return;const t=!!b?.lineItemKey,r=String(z)!==String(b?.variantId);if(!t||r){S(!0);try{const t=b?.freebieSelection;t&&u&&b?.lineItemKey?await u(b.lineItemKey):await e(b?.lineItemKey||b?.variantId,"variant-selector",!0),t&&m?await m(z,b.allowedVariantIds):n&&z&&await n(z,I,"variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!z||T},T?t.createElement(ta,{color:"white",size:13}):b?.productRec?"ADD TO BAG":b?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Qp,{ref:y},t.createElement(Yp,{style:{backgroundColor:p||"white"}},t.createElement(Zp,null,t.createElement(aa,{color:a||"#868E96"}))))}));gu.displayName="DesktopVariantPopup";const hu=n((({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h,shouldCheckInventoryQuantity:x=!1},y)=>{const[b,v]=Xt(dn),w=Yt(Kt),[C,k]=c(null),[E,T]=c(!1),[S,B]=c({}),[$,z]=c(b?.variantId),[N,I]=c(b?.quantity||1),D=o(null),P=Ta(),[_,O]=c(!1);l((()=>{b?.open?setTimeout((()=>{O(!0)}),10):O(!1)}),[b?.open]);l((()=>{(async()=>{if(!C&&r&&b?.variantId&&b?.handle)try{const e=await r(b.handle,b.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=b.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id))&&String(e.id)===String(b.variantId)))||e.variants.find((e=>(!x||e.available)&&n.includes(String(e.id)))):e.variants.find((e=>(!x||e.available)&&String(e.id)===String(b.variantId))),t){z(String(t.id));const n={};e.options.forEach(((e,r)=>{n[e.name]=t[`option${r+1}`]})),B(n)}else z(void 0),B({})}k(e)}catch(e){}})()}),[C,r,b]),l((()=>{}),[p,e,n,r]);const A=(e,t)=>{const n={...S,[e]:t};B(n);const r=C?.variants?.find((e=>C.options.every(((t,r)=>e[`option${r+1}`]===n[t.name]))));if(r){const e=b?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;x&&!r.available||z(String(r.id))}},M=C?.variants?.find((e=>String(e.id)===String($))),F=xn(w,w?.currency),R=i((()=>{const e={};if(!C)return e;const t=Array.isArray(b?.allowedVariantIds)&&b.allowedVariantIds.length>0;return C.options.forEach((n=>{e[n.name]=n.values.filter((e=>C.variants.filter((r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every(((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o}))&&(!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(r.id)))&&!(x&&!r.available))})).some((e=>!!(!t||Array.isArray(b.allowedVariantIds)&&b.allowedVariantIds.includes(String(e.id)))&&(!x||e.available)))))})),e}),[C,S,b,x]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:b?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{O(!1),setTimeout((()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})}),300)}}),t.createElement(Qp,{ref:y,className:"yt-variant-selection-popup"},t.createElement(Yp,{ref:D,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},b?.freebieSelection&&t.createElement(Gp,null,"Unlocked Freebie"),t.createElement(Xp,null,t.createElement(Kp,null,t.createElement(Jp,null,t.createElement(eu,{src:M?.featured_image?.src??C?.featured_image,alt:M?.featured_image?.alt??C?.title})),t.createElement(tu,null,t.createElement(nu,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${M?.id}`},C?.title),t.createElement(uu,null,t.createElement(ru,null,t.createElement(ou,{$primaryTextColor:h},F,gn(M?.price,w?.currency??"INR")),null!=M?.compare_at_price&&null!=M?.price&&M.compare_at_price>M.price&&t.createElement(au,null,F,gn(M?.compare_at_price,w?.currency??"INR"))),!b?.freebieSelection&&t.createElement(ya,{value:N,handleItemQuantityIncrement:async()=>{I((e=>e+1))},handleItemQuantityDecrement:async()=>{N>1&&I((e=>e-1))},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:g})))),C?.options?.map((e=>{const n=P?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()));return t.createElement(lu,{key:e.name},t.createElement(du,null,t.createElement("span",null,"Select ",e.name,":"),S[e.name]&&t.createElement(su,null,S[e.name])),t.createElement(pu,null,R[e.name]?.map((r=>{const o=S[e.name]===r,i=Ea(n,r);return"color"===n?.type&&i?.value?t.createElement(mu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(fu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(cu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)}))))}))),t.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:b?.productRec?async()=>{if($&&n){T(!0);try{await n($,N,"product-recommendation-variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!$)return;const t=!!b?.lineItemKey,r=String($)!==String(b?.variantId);if(!t||r){T(!0);try{const t=b?.freebieSelection;t&&u&&b?.lineItemKey?await u(b.lineItemKey):await e(b?.lineItemKey||b?.variantId,"variant-selector",!0),t&&m?await m($,b.allowedVariantIds):n&&$&&await n($,N,"variant-selector",!1,b.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||E},E?t.createElement(ta,{color:"white",size:13}):b?.productRec?"ADD TO BAG":b?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Qp,{ref:y},t.createElement(Yp,{style:{backgroundColor:p||"white"}},t.createElement(Zp,null,t.createElement(aa,{color:a||"#868E96"}))))})),xu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,cartTitle:s,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:N,applyDiscount:I,discountApplied:D,rewardCoupons:P,userTotalPoints:_,checkoutFunction:O,joinNowFunction:A,guestLoyaltyPercentage:M,showToggleButton:F,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:Q,showCartLevelAltPay:G,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie,checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,primaryTextColor:se,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:Be,cartSigninCTAMainText:$e,showNoteOption:ze,applyNoteToCart:Ne,note:Ie,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:_e,showEditOptionOnProducts:Oe,getProductDetailsByVariantId:Ae,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Qe,removeFreebieFromCart:Ge,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,showStickyAddToCart:nt,stickyCartLineItem:rt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:dt,giftWrapProductDetail:st,enableCustomCartOnCartPage:pt,isCartPage:ut,progressBarFreeProductIconType:mt,addToStickyCart:ft,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:bt,cartTimerInMinutes:vt,cartTimerCustomText:wt,imageAspectSelector:Ct,cartComponentsCornerType:kt,cartComponentsCornerRadius:Et,stickyCartCustomizationData:Tt,cartOffersCarousalData:St,stickyBarBuyNowFunction:Bt,gstSectionCustomizationData:$t,noteSectionTitle:zt,checkoutSectionMessage:Nt,checkoutSectionMessageRedirectLink:It,checkoutSectionMessageDisplay:Dt,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:_t,brandTokenName:Ot,showDiscountOnMRP:At,prefixMessageText:Mt,suffixMessageText:Ft,successMessageText:Rt,toggleDecimal:Lt,cartOffersCarouselHeight:jt,disableCheckoutButton:Vt,showEmptyCartRecommendations:Wt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:qt,showPoweredByBadge:Ut=!0,applyCouponCode:Qt,showApplyCoupon:Gt,enableConfetti:Yt,showCheckoutButtonPaymentIcons:Jt=!0,shouldCheckInventoryQuantity:en,comboBundleData:tn,comboBundleAddToCartFunction:nn})=>{const rn=Zt(Kt),[on,an]=Xt(dn),[ln,cn]=Xt(cl),sn=()=>L(!R),[pn,un]=c((()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}}));l((()=>{const e=e=>{const t=e.detail;un({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)}),[]);const mn=pn.comboBundleData??tn,fn=pn.comboBundleAddToCartFunction??nn;m((()=>{v&&rn(v)}),[v]);const gn=o(null);l((()=>{function e(e){gn.current&&!gn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const[hn,xn]=c(!1);return l((()=>{const e=()=>{xn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:pt&&ut?"relative":"absolute",width:"100%",display:pt&&ut?"flex":"block",alignItems:"center",justifyContent:"center"}},F&&!(pt&&ut)&&t.createElement("button",{style:{margin:"16px"},onClick:sn},R?"Close Drawer":"Open Drawer"),R&&b&&!(pt&&ut)&&t.createElement("div",{onClick:sn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},"‎"),t.createElement(Bp,{isCartPage:ut,enableCustomCartOnCartPage:pt,isOpen:R,setIsOpen:L,backgroundColor:g,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:s,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:d,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:B,rewardMultiplier:$,redemptionMultiplier:z,removeDiscount:N,applyDiscount:I,discountApplied:D,rewardCoupons:P,userTotalPoints:_,checkoutFunction:O,joinNowFunction:A,guestLoyaltyPercentage:M,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:Q,showCartLevelAltPay:G,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie??"minimum_order_value",checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,primaryTextColor:se,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:Be,cartSigninCTAMainText:$e,applyNoteToCart:Ne,note:Ie,showNoteOption:ze,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:Pe,cartOfferTermsAndConditionsText:_e,showEditOptionOnProducts:Oe,onSetLoading:Me,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,cartOffersCarousalData:St,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Qe,removeFreebieFromCart:Ge,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:dt,giftWrapProductDetail:st,progressBarFreeProductIconType:mt,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:bt,cartTimerCustomText:wt,cartTimerInMinutes:vt,imageAspectSelector:Ct,cartComponentsCornerType:kt,cartComponentsCornerRadius:Et,gstSectionCustomizationData:$t,noteSectionTitle:zt,checkoutSectionMessage:Nt,checkoutSectionMessageRedirectLink:It,checkoutSectionMessageDisplay:Dt,showVariantSelectionDropdownInProductClaim:Pt,loyaltyDiscount:_t,getProductDetailsByVariantId:Ae,brandTokenName:Ot,showDiscountOnMRP:At??!0,prefixMessageText:Mt,suffixMessageText:Ft,successMessageText:Rt,toggleDecimal:Lt,cartOffersCarouselHeight:jt,disableCheckoutButton:Vt,showEmptyCartRecommendations:Wt,emptyProductRecsTitleText:Ht,checkoutButtonBottomSpacing:qt,showPoweredByBadge:Ut,applyCouponCode:Qt,showApplyCoupon:Gt,enableConfetti:Yt,showCheckoutButtonPaymentIcons:Jt,shouldCheckInventoryQuantity:en}),nt&&rt&&d&&t.createElement(Up,{showStickyCart:nt,stickyCartCustomizationData:Tt,product:rt,addCartItem:d,onSetLoading:Me,themeColor:he,themeTextColor:xe,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:ce,ctaButtonTextColor:de,addToStickyCart:ft,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,checkoutFunction:Bt,backgroundColor:g,primaryTextColor:se,comboBundleData:mn,comboBundleAddToCartFunction:fn}),hn&&on.open&&t.createElement(gu,{backgroundColor:g,ref:gn,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Ae,themeColor:he,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,removeFreebieFromCart:Ge,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:se,shouldCheckInventoryQuantity:en}),!hn&&on.open&&t.createElement(hu,{ref:gn,isDev:j,removeCartItem:i,addCartItem:d,getProductDetailsByVariantId:Ae,themeColor:he,cartComponentsCornerRadius:Et,cartComponentsCornerType:kt,backgroundColor:g,removeFreebieFromCart:Ge,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:se,shouldCheckInventoryQuantity:en})))};const yu=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>t.createElement(t.Fragment,null,e.map(((a,s)=>{const p=a.minimumQuantity-(r[s]?.length??0),u=o?.filter((e=>r[s]?.includes(e.variantId)));return t.createElement("div",{className:"yt-bundleBuilderTracker-tier-product-list",style:{display:"flex",width:"100%"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",gap:"5px"}},u?.map?.((e=>{const o=e.product.variants?.edges?.find((t=>t.node.id===e.variantId)),a=r[s]?.filter((e=>e===o?.node.id)).length||0;return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-product-item",key:e.variantId,style:{borderRadius:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge",style:{borderRadius:"2px"}},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},d,th(o?.node?.price)),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>l(e.variantId,s)},t.createElement(Xa,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-item",key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-product-list-tracker-item",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,..."high"===c&&{borderRadius:"20px"},..."medium"===c&&{borderRadius:"6px"},...""===c&&{borderRadius:"0px"},height:n?"60px":"70px",width:n?"60px":"70px"}},a>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"}},a,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>l(e.variantId,s)},t.createElement(gt,{fontSize:"12px"}))))})),p>=1&&[...Array(p)].map(((e,r)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:n?"60px":"70px",height:n?"60px":"70px",borderRadius:"high"===c?"20px":"medium"===c?"6px":"0px"},key:r},t.createElement(co,{size:40,color:"#A0A0A0"})))))),s<e.length-1&&t.createElement("div",{className:"yt-bundleBuilderTracker-plus-icon-container"},t.createElement(co,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))}))),bu=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:a,showProductDetailsInTracker:i,loading:d,handleRemoveItem:s,percentageOff:p,selectedItemsQuantity:u,bundleSubtotal:m,amountOff:f,styles:g,dealAmount:h,isMobile:x=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:v,handleRemoveItemProductTier:w,selectedProductsByTier:C,storeCurrencyCode:k,shadowRoot:E})=>{const[T,S]=c(!1),[B,$]=c(0),[z,N]=c([]),[I,D]=c(0),[P,_]=c(0),[O,A]=c(!1),[M,F]=c(null),R=function(){const e=o(null);return l((()=>{const t=document.createElement("canvas");return t.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n z-index: 2147483647;\n background: rgba(255,0,0,0.02); /* EXTREMELY light - just to detect */\n outline: 2px dashed rgba(255,0,0,0.15);\n ",document.body.appendChild(t),e.current=t,console.log("[confetti] canvas appended to document.body:",t),requestAnimationFrame((()=>{if(!e.current)return void console.warn("[confetti] canvasRef missing after RAF");const t=e.current.getBoundingClientRect();console.log("[confetti] canvas rect:",t.width,t.height,t)})),()=>{console.log("[confetti] removing canvas"),t.remove()}}),[]),function(t){if(!e.current)return void console.warn("[confetti] no canvasRef to draw on");const n=Ur(e.current,{resize:!0,useWorker:!1});console.log("[confetti] firing with options:",t),n(t)}}(),L=m?.price||0,j=e?.type,V=e=>{if(e<0||!z[e])return L;const t=z[e].discountValue??0;return p?L*(1-t/100):h?t:f?L-t:L};l((()=>{if(e&&"none"!==e.type)if("productTier"===j&&e.productTier){const t=e.productTier||[];N(t);let n=0;e.productTier.map((e=>{n+=e.minimumQuantity})),_(n-u)}else if(z.length)I>0&&u<z[I-1]?.minimumQuantity?(D(I-1),F(I-1)):u<z[I]?.minimumQuantity&&F(I-1),$(V(I));else{const t=e.offerTier||[];N(t),D(0),_(t[0]?.minimumQuantity-u||r-u)}else N([]),_(r-u),D(0)}),[e,r,u]),l((()=>{z.length&&"productTier"!=j?(()=>{if(!z?.length)return;let e=-1,t=null,n=0;if("offerTier"===j)for(let r=0;r<z.length&&(n+=z[r].minimumQuantity,u>=n);r++)t=r,e=r+1<z.length?r+1:r;if(D(e),F(t),null!==t){let e=z.slice(0,t+1).reduce(((e,t)=>e+t.minimumQuantity),0);A(e===u),S(!0),$(V(t))}else A(!1),S(!1),$(L);const r=e>=0&&e<z.length?z.slice(0,e+1).reduce(((e,t)=>e+t.minimumQuantity),0)-u:z[0].minimumQuantity-u;_(r)})():u===r?(S(!0),$(p?L*(1-p/100):h||(f?L-f:L)),A(!0)):(A(!1),S(!1))}),[u,z]);const W=T?Math.max(m?.compareAtPrice,m?.price):m?.compareAtPrice>m?.price?m?.compareAtPrice:null,H=T?B.toFixed(2):m?.price?.toFixed(2),q=W&&H?(W-Number(H)).toFixed(2):0,U=e&&"none"!==j&&e.offerTier?"offerTier"===j?Math.min(u/(u+P)*100,100):void 0:u/r*100,Q=o(!1);l((()=>{const e=Q.current;if(Q.current=T,!e&&T&&g.byob.enableConfetti){const e=E??document,t=("getElementById"in e?e.getElementById("checkoutButton"):null)||document.getElementById("checkoutButton");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;R?.({particleCount:100,spread:70,origin:{x:r,y:o}})}}),[T,g]),I>=0&&I<z.length&&z[I].tier;const G="number"==typeof M?z[M]?.customText:void 0,Y="string"==typeof G&&""!==G.trim();return t.createElement("div",{className:"yt-bundleBuilderTracker-container "+(x?"mobile":""),style:{justifyContent:g.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==j&&null!==M&&M>=0&&t.createElement("div",{className:"yt-bundleBuilderTracker-offer-tier-tag",style:{backgroundColor:g?.general?.primaryColor??"#000",color:g?.general?.primaryContrastColor??"#fff",top:x?100===U?"-26px":"-32px":100===U?"-29px":"0px",zIndex:10}},Y?t.createElement(t.Fragment,null,G," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy "," ",z.slice(0,M+1).reduce(((e,t)=>e+t.minimumQuantity),0)," ","at",f||h?t.createElement(t.Fragment,null," ",nh(g.general.currencySymbol,k)):""," ",th(z[M]?.discountValue),p?t.createElement(t.Fragment,null,"% "):th(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),x&&P>=1&&!O&&"offerTier"!==j?t.createElement("div",{className:"yt-bundleBuilderTracker-mobile-remaining",style:{margin:"0",height:"auto"}},"Select ",P," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==j&&t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-container"},t.createElement("div",{className:"yt-bundleBuilderTracker-tier-progress-text"},"offerTier"==j&&z.length>0&&I>=0&&P>0&&t.createElement(t.Fragment,null,Y?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",P," more to unlock"," ",null!==M&&(z[M+1]?.customText||z[M]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",P," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",u+P," at",f||h?t.createElement(t.Fragment,null,nh(g.general.currencySymbol,k)):""," ",th(z[I]?.discountValue),p?t.createElement(t.Fragment,null,"% "):th(h)?t.createElement(t.Fragment,null):"",p||f?t.createElement(t.Fragment,null," Off"):"")))),t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-background"},t.createElement("div",{className:"yt-bundleBuilderTracker-progress-bar-fill",style:{width:`${U??0}%`,backgroundColor:100===(U??0)?"#4caf50":y??g?.general.primaryColor??"black"}}," "))),g.byob.selectedProductsVisibility&&t.createElement("div",{className:"hide-tracker-scrollbar yt-bundleBuilderTracker-product-list-wrapper",style:{columnGap:"productTier"===j?"0px":"10px",maxWidth:x?"90%":"55%"}},"productTier"===j?t.createElement(yu,{tiers:z,isMobile:x,selectedProductsByTier:C??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:i,handleRemoveItemProductTier:w,cornerRadius:g.byob.borderRadius,currencySymbol:nh(g.general.currencySymbol,k)}):t.createElement(t.Fragment,null,a?.map?.((e=>{const n=e.product.variants?.edges?.find((t=>t.node.id===e.variantId));return i?t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-item-container",style:{borderRadius:g.byob.borderRadius},key:e.variantId},t.createElement("div",{className:"yt-bundleBuilderTracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-badge"},e.quantity,"x")),t.createElement("div",{className:"yt-bundleBuilderTracker-info-block"},t.createElement("span",{className:"yt-bundleBuilderTracker-product-title"},e.product.title),t.createElement("span",{className:"yt-bundleBuilderTracker-product-price"},g.general.currencySymbol,n?.node?.price),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(Xa,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-bundleBuilderTracker-item-wrapper",key:e.variantId,style:{marginTop:"8px",marginRight:"5px"}},t.createElement("div",{className:"yt-bundleBuilderTracker-item-image-box",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`,height:x?"60px":"70px",width:x?"60px":"70px",borderRadius:g.byob.borderRadius}},e?.quantity>1&&t.createElement("div",{className:"yt-bundleBuilderTracker-quantity-badge",style:{borderRadius:g.byob.borderRadius}},e.quantity,"x"),t.createElement("div",{className:"yt-bundleBuilderTracker-remove-button",onClick:()=>s(e.variantId)},t.createElement(gt,{fontSize:"12px"}))))})),P>=1&&[...Array(P)].map(((e,n)=>t.createElement("div",{className:"yt-bundleBuilderTracker-placeholder-box",style:{width:x?"60px":"70px",height:x?"60px":"70px",borderRadius:g.byob.borderRadius},key:n},t.createElement(co,{size:40,color:"#A0A0A0"})))))),(!x||O)&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-container",style:{width:x?"100%":"auto"}},Number(H)>0&&t.createElement("div",{className:"yt-bundleBuilderTracker-summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},t.createElement("span",{className:"yt-bundleBuilderTracker-subtotal-label"},"Subtotal"),Number(q)>0?t.createElement("span",{className:"yt-bundleBuilderTracker-save-label"},"Save:"," ",nh(g.general.currencySymbol,k),th(q)):""),t.createElement("div",{className:"yt-bundleBuilderTracker-subtotal-row"},t.createElement("span",{className:"yt-bundleBuilderTracker-total_price"},nh(g.general.currencySymbol,k),Number(H)>=0?th(Number(H).toFixed(2)):0),W&&g.byob.compareAtPriceVisibility&&Number(W)>Number(H)&&t.createElement("span",{className:"yt-bundleBuilderTracker-summary_price"},nh(g.general.currencySymbol,k),th(Number(W).toFixed(2))))),t.createElement("button",{className:"yt-bundleBuilderTracker-checkout-button",style:{cursor:O?"pointer":"auto",backgroundColor:100===(U??0)||O?g.general.ctaBackgroundColor||"black":"#f4f4f6",color:100===(U??0)||O?g.general.ctaTextColor||"#fff":"#000",border:`1.18px solid ${g.general.ctaBorderColor}`,borderRadius:g.general.ctaBorderRadius,boxShadow:O?"0px 4px 8px rgba(0, 0, 0, 0.2)":"none"},disabled:!O&&P>=1,onClick:e=>{d||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},d?t.createElement(ta,{color:"white",loading:d,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P>=1&&!O?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",P," More Item(s)"):t.createElement("div",{className:"yt-bundleBuilderTracker-checkout-text",style:{color:v??g.general.ctaTextColor}},g.byob.checkoutCTAText??"Checkout"))))},vu={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},wu={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Cu=e=>{const[n,r]=c(!1);l((()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&vu[e]?vu[e]:{},r={...wu,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...a};return t.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===a.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=a.transform||"translateY(0)"}},t.createElement(bu,{...e,isMobile:n}))},ku=Mt(void 0);function Eu(e){return Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(e)}function Tu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Su(e,t){return Su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Su(e,t)}function Bu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$u(e);if(t){var o=$u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Eu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$u(e)}var zu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Su(e,t)}(o,h);var e,t,n,r=Bu(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&Tu(e.prototype,t),n&&Tu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Nu=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},Iu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},Du=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},Pu=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},_u=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},Ou=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},Au=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var Mu=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then((function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then((function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()}))})).catch((function(t){console.error(t),console.error("Failed to download image from "+e)})))}},Fu=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,d=e.enableZoom,s=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:Mu(n)},t.createElement(Pu,null)),d&&t.createElement("a",{onClick:a},o?t.createElement(Du,null):t.createElement(Iu,null)),s&&t.createElement("a",{onClick:i},t.createElement(Au,null)),t.createElement("a",{onClick:l},t.createElement(_u,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Ru(e){return Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(e)}function Lu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ju(e,t){return ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ju(e,t)}function Vu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hu(e);if(t){var o=Hu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ru(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wu(e)}(this,n)}}function Wu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hu(e){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hu(e)}function qu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uu=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ju(e,t)}(a,h);var e,n,r,o=Vu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qu(Wu(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),qu(Wu(e),"handleOnLoad",(function(){e.setState({loading:!1})})),qu(Wu(e),"handleOnContextMenu",(function(t){!e.props.contextMenu&&t.preventDefault()})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(Ou,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&Lu(e.prototype,n),r&&Lu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Qu(e){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qu(e)}function Gu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yu(e,t){return Yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yu(e,t)}function Zu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ku(e);if(t){var o=Ku(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Qu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xu(e)}(this,n)}}function Xu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ku(e)}function Ju(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var em=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yu(e,t)}(a,h);var e,n,r,o=Zu(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ju(Xu(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Ju(Xu(e),"handleKeyDown",(function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()})),Ju(Xu(e),"getCoordinatesIfOverImg",(function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}})),Ju(Xu(e),"handleMouseDownOrTouchStart",(function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState((function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}}))}})),Ju(Xu(e),"handleMouseMoveOrTouchMove",(function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState((function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}}))}})),Ju(Xu(e),"handleMouseUpOrTouchEnd",(function(t){e.setState({moveStart:void 0})})),Ju(Xu(e),"toggleZoom",(function(t){t.preventDefault(),e.setState((function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}}))})),Ju(Xu(e),"toggleRotate",(function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState((function(e){return{rotationDeg:e.rotationDeg+=90}})):e.setState({rotationDeg:90})})),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,d=n.showRotate,s=n.imageBackgroundColor,p=void 0===s?"black":s,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(zu,{name:"__react_modal_image__lightbox",css:Nu({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(Uu,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(Uu,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(Fu,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!d})))}}])&&Gu(e.prototype,n),r&&Gu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function tm(e){return tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tm(e)}function nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rm(e,t){return rm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rm(e,t)}function om(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=im(e);if(t){var o=im(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return am(e)}(this,n)}}function am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},im(e)}function lm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rm(e,t)}(a,h);var e,n,r,o=om(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lm(am(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),lm(am(e),"toggleModal",(function(){e.setState((function(e){return{modalOpen:!e.modalOpen}}))})),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,d=e.hideZoom,s=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(em,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:d,showRotate:s,imageBackgroundColor:p}))}}],n&&nm(e.prototype,n),r&&nm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const dm=n(((e,n)=>{const[r,o]=Xt(ku),a=i((()=>e=>e?r?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?1/0:0:1/0:0),[r?.tracksInventory]),d=r?.variants.edges?.filter((e=>a(e.node)>0))||[],[s,p]=c(d?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[h,x]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null),T=e.shadowRoot??document.body;l((()=>{if(r){const e=r.variants.edges?.filter((e=>a(e.node)>0));p(r?.selectedVariant??e[0]?.node)}}),[r,a]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===s?.id));x(t?t.quantity:0)}),[h,e.selectedProducts,s]);const S=()=>{s?.id&&r&&(b("check"),e.handleAddToBundle(s?.id,r,1),setTimeout((()=>{b("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r)return null;const{title:B,descriptionHtml:$,media:z,variants:N}=r,I=z.edges.map((e=>e?.node.preview.image??e?.node.image)).filter((e=>e?.url?.length>0));l((()=>{if(r&&s?.image?.url&&Array.isArray(I)){const e=I.findIndex((e=>e?.url===s?.image?.url));-1!==e&&e!==u&&m(e)}}),[s]);const D=e=>{const t=e.target.value,n=d?.find((e=>e.node.id===t))?.node;n&&a(n)>0&&p(n)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const P=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},O=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m((e=>e<I.length-1?e+1:0)):e<-t&&m((e=>e>0?e-1:I.length-1))}C(null),E(null)};e.hideAddToBundle||a(s);const A=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content "+(f?"small-screen":"large-screen"),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement("div",{className:"yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement("button",{className:"yt-bundleProductModal-modal-close-button",onClick:e=>{e.stopPropagation(),o(void 0)},style:{backgroundColor:"white"}},t.createElement(ut,{size:"25"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:P,onTouchMove:_,onTouchEnd:O},t.createElement(cm,{small:rh(I[u]?.url),medium:rh(I[u]?.url),large:rh(I[u]?.url),hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter((e=>e?.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:rh(n?.url),alt:n.altText||`${B} - Image ${r+1}`,onClick:e=>{e.stopPropagation(),m(r)},style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},d.length>1?s?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(er,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-variant-selection",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},d.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},s?.title)),t.createElement("select",{value:s?.id||"",onChange:D,className:"yt-bundleProductModal-modal-select-input",style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},d.map((({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title)))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(go,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},s?.compareAtPrice&&parseFloat(s.compareAtPrice)>parseFloat(s?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.price)))),!e.hideAddToBundle&&a(s)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{style:{width:"80%"},className:"yt-bundleProductModal-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},className:"yt-bundleProductModal-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:"idle"!==y},"Add to bundle")))),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),M=t.createElement("div",{className:"yt-bundleProductModal-modal-overlay"},t.createElement("div",{className:"yt-bundleProductModal-modal-content small-screen",style:{padding:"0px",position:"relative"},onClick:e=>e.stopPropagation(),ref:n},t.createElement("div",{className:"yt-bundleProductModal-selection-modal yt-variant-selection-modal"},t.createElement("button",{className:"yt-bundleProductModal-modal-phone-close-button",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:e=>{e.stopPropagation(),o(void 0)}},t.createElement(ho,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px",width:"100vw",height:"100vh",overflowY:"auto"}},t.createElement("div",{className:"yt-bundleProductModal-modal-image-section small-screen"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:P,onTouchMove:_,onTouchEnd:O},t.createElement(cm,{small:rh(I[u]?.url),medium:rh(I[u]?.url),large:rh(I[u]?.url),hideDownload:!0,className:"yt-bundleProductModal-modal-main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map(((e,n)=>t.createElement("span",{className:"yt-bundleProductModal-modal-image-indicator",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"yt-bundleProductModal-modal-image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map(((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:rh(n?.url),alt:n.altText||`${B} - Image ${r+1}`,onClick:e=>{e.stopPropagation(),m(r)},style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"yt-bundleProductModal-modal-details-section small-screen",style:{padding:"0px !important",margin:"15px 0",paddingBottom:"50px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},d.length>1?s?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-only",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleProductModal-modal-rating-and-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(er,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-bundleProductModal-modal-separator",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important",width:"95vw"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-bundleProductModal-modal-phone-bottom-bar",style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},d.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},s?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:s?.id||"",onChange:D,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},d.map((({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title)))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(go,null)))),t.createElement("div",{className:"yt-bundleProductModal-modal-price-and-cta",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},s?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{className:"yt-bundleProductModal-modal-price",style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},nh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),th(s?.price)))),!e.hideAddToBundle&&a(s)>0&&(!e?.disableQuantitySelector||h<1)&&t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:"idle"!==y},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?M:A,T)})),sm=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:Nn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))}))),pm=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:d})=>{const s=i((()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0),[e?.tracksInventory]),p=i((()=>{const t=e.variants.edges.find((e=>{const t=e.node;return s(t)>0}))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]}),[e,s]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l((()=>{const e=()=>g(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const h=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0])))?.node,x=h?.image?.url||e.featuredMedia?.preview?.image?.url,y=Nn(x,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},w=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.options.find((t=>t.name===e.name));return e.values.map((e=>{const n=t?.values?.find((t=>t.name===e));return{name:e,value:n?.value||e}}))},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find((e=>e.name===n))||null};if(!n)return null;const k=t.createElement("div",{onClick:r,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title",className:"yt-bundleBuilder-variant-options-modal-backdrop"},t.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}},className:"yt-bundleBuilder-variant-options-modal-container"},t.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"},className:"yt-bundleBuilder-variant-options-modal-product-block"},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"},className:"yt-bundleBuilder-variant-options-modal-product-image"}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4},className:"yt-bundleBuilder-variant-options-modal-product-info"},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-product-title"},e.title))),t.createElement("div",{style:{padding:"20px"},className:"yt-bundleBuilder-variant-options-modal-variant-selectors"},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0},className:"yt-bundleBuilder-variant-options-modal-option"},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},className:"yt-bundleBuilder-variant-options-modal-option-label"},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"},className:"yt-bundleBuilder-variant-options-modal-option-name"},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"},className:"yt-bundleBuilder-variant-options-modal-option-selected-value"},C(n,r)?.name||n.values[0])),t.createElement(sm,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&s(a)>0})(r,t),isMobile:f})))))),t.createElement("button",{className:"yt-bundleBuilder-variant-options-modal-confirm-button",onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0])))?.node,n=!!t&&s(t)>0;if(t?.id&&n)d(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find((e=>s(e.node)>0))?.node.id;t&&(d(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return v.createPortal(k,document.body)},um=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map((({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""})).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",d=i(c,800)||c,s=[];if(n&&n!==e){const e=l(n);e&&s.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(s.length>0?s.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):s.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&s.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},s,t.createElement("img",{src:d,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function mm({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:d}){const s={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=e<d;return t.createElement("div",{className:"yt-bundleBuilder-quantity-selector-container"},t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-minus",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:s},"-"),t.createElement("div",{className:"yt-bundleBuilder-quantity-selector_quantity"},e," added"),t.createElement("button",{className:"yt-bundleBuilder-quantity-selector_button-plus",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,d);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...s,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const fm=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),d=i((()=>rh(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||""),[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),s=i((()=>e?.media?.edges?.map((e=>rh(e?.node?.preview?.image?.url??e?.node?.image?.url))).filter(Boolean)??[]),[e?.media?.edges]),p=i((()=>s?.[1]??d??""),[s,d]);l((()=>{if(d){(new Image).src=d}}),[d]);const u=i((()=>d||s?.[0]),[d,s]);return t.createElement("div",{className:"yt-bundleBuilder-image-effect",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-bundleBuilder-image-effect_wrapper",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-bundleBuilder-image-effect_main-image",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:s?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-bundleBuilder-image-effect_hover-image",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:e.title})))},gm=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:d,handleRemoveItem:s,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f})=>{const g=Zt(ku),h=n.customizations,x=h?.byob?.variantSelectorType,[y,b]=c(!1),v=h.general?.variantTitleSuffix?e?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map((e=>e.node.title)).map((e=>e.split(" ")));let n=[...t[0]];for(let e=1;e<t.length;e++){const r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map((e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}}))})(e?.variants?.edges);if(!v||!v.length)return t.createElement(t.Fragment,null);const w=a((t=>{const n=f?.find((e=>e.variantId===t))?.quantity;if(void 0!==n)return n;const r=v?.find((e=>e.node.id===t)),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0}),[v,f,e.tracksInventory]),C=v?.find((e=>w(e.node.id)>0))?.node?.id;if(!C&&!h.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[k,E]=c(v?.find((e=>w(e.node.id)>0))?.node?.id||v[0]?.node?.id),[T,S]=c(0),[B,$]=c(window.innerWidth<450),[z,N]=c("normal"),I=v?.find((e=>e?.node?.id===k))?.node,D=w(k||"");l((()=>{const e=m.find((e=>e.variantId===k));S(e?e.quantity:0)}),[T,m,k]),l((()=>{const e=()=>{$(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?N("500"):CSS.supports("font-weight","400")?N("400"):CSS.supports("font-weight","600")&&N("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",z)}),[z]),l((()=>{if(k&&!v?.some((e=>e.node.id===k))){const e=v.find((e=>w(e.node.id)>0))?.node.id||v[0]?.node?.id;e&&E(e)}}),[k,v,w]);const P=e.variants&&e.variants.edges?.length>1&&"customOptions"!==x,_="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===_,A="75851235630"===_,M=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(e),F=M.length>0;return t.createElement(t.Fragment,null,t.createElement("div",{className:`bundle-builder-product-container ${p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"} ${"none"===h?.byob.shadowType?"shadow-none":"spread"===h?.byob.shadowType?"shadow-spread":"shadow-no-spread"}`,style:{borderRadius:h?.byob.borderRadius,border:"transparent"!==h?.byob.borderColor?`1px solid ${h?.byob.borderColor}`:"none",backgroundColor:h?.byob.cardBackgroundColor||"#fff"},onClick:()=>{if(D<=0)return;const t={...e,variants:{...e.variants,edges:v},selectedVariant:I};g(t)}},t.createElement("div",{className:"yt-bundleBuilder-product-card_image-wrapper"},t.createElement(fm,{product:e,styles:h,selectedVariant:I}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-bundleBuilder-product-card_badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:h.byob.borderRadius}},n.productCardBadgeText),P&&t.createElement("div",{className:"yt-bundleBuilder-variant-selector-container",style:{position:"relative",width:"100%"}},t.createElement("select",{className:"bundle-builder-variant-selector "+(O?"bundle-builder-variant-selector--coralHaze":""),onClick:e=>{e.preventDefault(),e.stopPropagation()},value:k||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),E(e.target.value)}},v?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{className:"yt-bundleBuilder-variant-selector_icon",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-bundleBuilder-product-card_details"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&F&&t.createElement("div",{className:"yt-bundleBuilder-product-card_category-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-bundleBuilder-product-card_category-container",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},M.slice(0,2).map(((e,n)=>t.createElement("span",{className:"yt-bundleBuilder-product-card_category",key:n,style:{fontSize:B?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),M.length>2&&t.createElement("span",{className:"yt-bundleBuilder-product-card_category-more",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",M.length-2," more"))),t.createElement("div",{className:"yt-bundleBuilder-product-card_title",style:{"--title-margin-top":B?"4px":"0px","--title-padding":n?.showBorder??1?"0 10px":"0 4px",...!1===h?.byob.productsPriceVisibility&&{"--title-padding":"8px"},...h?.byob.productTitleFontSize&&{"--title-font-size":h?.byob.productTitleFontSize}}},A?String(I?.displayName).replace("- Default Title",""):e.title,I?.commonSuffix?" -"+I?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14}),t.createElement("span",{className:"yt-bundleBuilder-product-card_rating-text",style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-bundleBuilder-product-card_rating-review-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Kr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(er,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),h?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundleBuilder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(I?.price??"0")>0?t.createElement("span",{className:"yt-bundleBuilder-product_price--new"},nh(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",th(I?.price)):t.createElement("span",{className:"yt-bundleBuilder-product-card_price--free"},"Free"),I?.compareAtPrice&&h?.byob.compareAtPriceVisibility&&parseFloat(I.compareAtPrice)>parseFloat(I?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price yt-bundleBuilder-product-card_price--old",style:{fontSize:"14px"}},nh(h.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",th(I.compareAtPrice))),(D>0||!h?.general.trackInventory)&&t.createElement("div",{className:"yt-product-atc-wrapper"},(0===T||void 0===T)&&t.createElement("button",{style:{...!o&&{backgroundColor:h?.general.primaryColor||"#111",color:h?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(1),(()=>{if(!k)return;"customOptions"===x&&v.length>1?b(!0):r(k,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},h?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&T>0&&k&&t.createElement("div",{className:"visible yt-bundleBuilder-quantity-selector-container--visible",style:{overflow:"hidden"}},t.createElement(mm,{remainingQuantity:i,setQuantity:S,quantity:T,handleAddToBundle:r,variantId:k,product:e,handleRemoveItem:s,hideAddToBundle:o,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&T>0&&k&&t.createElement("button",{style:{backgroundColor:h?.general?.primaryContrastColor||"#fff"},className:"yt-bundleBuilder-product-card_add-to-bundle-button--added"},t.createElement("div",{className:"yt-bundleBuilder-product-card_added-button-text"},"ADDED"),t.createElement("div",{onClick:e=>{e.stopPropagation();const t=Math.max(0,T-1);S(t),s&&k&&s(k,1)},className:"yt-bundleBuilder-product-card_remove-button"},t.createElement(po,{className:"yt-bundleBuilder-product-card_remove-icon",style:{color:"#fff",fontSize:"20px"}})))),D<=0&&D!==1/0&&h?.general.trackInventory&&t.createElement("div",{style:{backgroundColor:h.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled yt-bundleBuilder-product-card_add-to-bundle-button--disabled"},h?.general.outOfStockLabel||"Out of Stock")),"customOptions"===x&&y&&v.length>1&&t.createElement(pm,{product:e,isOpen:y,onClose:()=>b(!1),variantOptions:n.variantOptions,cta:{textColor:h.general.ctaTextColor,backgroundColor:h.general.primaryColor},onConfirm:t=>{E(t),r(t,e,1)}}))},hm=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:d})=>t.createElement("div",{className:"yt-bundleBuilder-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,s)=>{const p=s+1,u=o[s].minimumQuantity-(i[s]?.length??0)==0,m=s===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-bundleBuilder-stepper_step "+(m?"yt-bundleBuilder-stepper_step--active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===d?()=>{}:n(p-1)},t.createElement("div",{className:"yt-bundleBuilder-stepper_label",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-bundleBuilder-stepper_line-container",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_dot",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{className:"yt-bundleBuilder-stepper_line",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:s<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{className:"yt-bundleBuilder-tier_title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),xm=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,d]=c(!1),[s,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(s)}),300);return()=>clearTimeout(e)}),[s,n]),t.createElement("div",{className:"yt-byob-sort-filter-container yt-bundleBuilder-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner yt-bundleBuilder-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper yt-bundleBuilder-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(so,{className:"yt-byob-search-icon yt-bundleBuilder-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>d(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input yt-bundleBuilder-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:s,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input yt-bundleBuilder-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(so,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon yt-bundleBuilder-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>d(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper yt-bundleBuilder-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label yt-bundleBuilder-filter_label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select yt-bundleBuilder-filter_select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},ym=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===e?.byob?.categoryFilterOnPage?t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button "+(a?"yt-categoryfilter-tab-button--active":""),style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},bm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:d,renderingOnPage:s,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m,shadowRoot:f})=>{const[g,h]=c(void 0),[x,y]=c(window.innerWidth<450),[b,v]=c(0),[w,C]=c({}),k=e.builderTiers?.type,E=e.customizations,T=e.builderTiers?.productTier??[],S=e.builderTiers?.offerTier??[],[B,$]=c([]),[z,N]=c(!1),[I,D]=c("All"),[P,_]=c(0),O=o(null);l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),$(Array.from(t)),N(n)}),[e.products]);const A=((e,t)=>"All"===t?e:e.filter((e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1})))(e.products.filter((e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status)),I),M="productTier"===k?T.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===k?S.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[F,R]=c(""),[L,j]=c(""),V=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(A,F),W=((e,t)=>[...e].sort(((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}})))(V,L),H=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),d=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-d;case"price-high-to-low":return d-c;default:return 0}})))(T,W,F,L,b),[q,U]=Xt(ku),[Q,G]=c(!1),Y="productTier"===k?H:W,Z=Y.slice(0,20*(P+1));l((()=>{setTimeout((()=>{G(!0)}),100)}),[]);const X=o(null);l((()=>{const e=()=>{y(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=rh(e.coverImageUrl)??"",t.onload=()=>{h(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{G(!1),setTimeout((()=>G(!0)),100)}),[b]);const K=(e,t)=>{if("productTier"===k){let n={...w},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=T.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}C(n);const o=T.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&v(o)}u(e)};l((()=>{if("productTier"===k){const e=Object.fromEntries(T.map((e=>[e.tier,[]])));C(e)}}),[e]),l((()=>{if("productTier"!==k||!T[b])return;if(M===p)return;const e=T.findIndex(((e,t)=>{const n=w[t]||[];return t>=b&&n.length<e.minimumQuantity}));-1!==e&&e!==b&&(v(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[w,T,k]),l((()=>{R("")}),[b]),l((()=>{function e(e){if(!X.current||!e.target)return;!X.current.contains(e.target)&&U(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const J=(e,t,o)=>{var a;"productTier"===k&&(a=e,C((e=>{const t={...e},n=T.findIndex(((e,n)=>{const r=t[n]||[];return n>=b&&r.length<e.minimumQuantity}));return-1!==n&&v(n),t[n]||(t[n]=[]),t[n].push(a),t}))),oh(e,t,o,n,r)},ee=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),te=x&&e.mobileCoverImageUrl?rh(e.mobileCoverImageUrl):rh(e.coverImageUrl??"")||null,ne=e.customStoreDetails?.fixedInventoryDetails,re=a(((e,t)=>{const n=ne?.find((e=>e.variantId===t))?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find((e=>e.node.id===t)),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0}),[ne]),oe=a((e=>{const t=E?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(ne){if(r.some((e=>ne.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return r.some((e=>re(n,e.node.id)>0))}),[E?.general?.showOutOfStockProducts,ne,re]),ae="bundles"==e.appName?e.pageHeader?.title:e?.title,ie="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l((()=>{_(0)}),[F,L,I,b]);const le=a((()=>{Z.length<Y.length&&_((e=>e+1))}),[Z.length,Y.length]);return l((()=>{const e=new IntersectionObserver((([e])=>{e.isIntersecting&&le()}),{threshold:.1});return O.current&&e.observe(O.current),()=>{O.current&&e.unobserve(O.current)}}),[le]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:E.byob.sectionBackgroundColor,..."transparent"!==E.fixedBundle.sectionBackgroundColor&&{padding:"20px"},willChange:"transform",backfaceVisibility:"hidden",transform:"translateZ(0)"},id:"yt-bundleBuilder-main-container",className:"yt-bundleBuilder-main-container"},te?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}},className:"yt-bundleBuilder-header-banner"},te&&t.createElement(um,{coverImageUrl:te,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"},className:"yt-bundleBuilder-header_text-overlay"},t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.titleFontSize??"3rem",fontWeight:"700",color:E?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:E?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title yt-bundleBuilder-header_title"},ae),t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.subtitleFontSize??"1.5rem",color:E?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle yt-bundleBuilder-header_subtitle"},ie))):(ae||ie)&&t.createElement("div",{className:"yt-bundleBuilder-header-container"},ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.titleFontSize??"3rem",fontWeight:"700",color:E?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:E?.byob?.titleBackgroundColor??"transparent"},className:"yt-bundleBuilder-header_title"},ae),ie&&t.createElement("span",{style:{lineHeight:"normal",fontSize:E?.byob?.subtitleFontSize??"1.5rem",color:E?.byob?.titleTextColor??"#000"},className:"yt-bundleBuilder-header_subtitle"},ie)),t.createElement("div",{className:"products-display yt-bundleBuilder-products-display"},"productTier"===k&&T.length>0&&E?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(hm,{currentStep:b,totalSteps:T.length,tiers:T,isMobile:x,primaryColor:E?.general?.primaryColor,primaryTextColorCta:E?.general?.primaryContrastColor,setCurrentProductTier:v,selectedProductsByTier:w,tierNavigation:E.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"},className:"yt-bundleBuilder-filters-container"},e?.enableSortAndFilter&&t.createElement(xm,{isMobile:x,searchTerm:F,setSearchTerm:R,setSortBy:j,styles:E}),e?.customizations?.byob?.enableProductCategories&&z&&t.createElement("div",null,t.createElement(ym,{styles:E,isMobile:x,categories:B,activeCategory:I,onCategoryChange:e=>{D(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display yt-bundleBuilder-product-grid"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"},className:"yt-bundleBuilder-product-grid_no-products-text"},"No products found"):"productTier"===k&&T.length>0?Z.filter((e=>oe(W.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(T[b]?.minimumQuantity??0)>(w[b]?.length??0),i=W.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(gm,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:J,hideAddToBundle:!a,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>K(e,b),selecteditems:n,transitionActive:Q,customVariantsQuantity:ne}):null})):Z.filter(oe).map(((r,o)=>t.createElement(gm,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:J,hideAddToBundle:p>=ee,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:Q,customVariantsQuantity:ne}))),Z.length<Y.length&&t.createElement("div",{ref:O,style:{height:"1px",width:"100%",display:"block"}})),!s&&t.createElement(Cu,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:M,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:K,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:d,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:w,renderingOnPage:s,shadowRoot:f})),s&&t.createElement(Cu,{handleAddToCart:i,minimumQuantity:M,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:K,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:E?.general.primaryColor||"#000",primaryTextColorCta:E.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:w,renderingOnPage:s,shadowRoot:f}),q&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==k?r=(T[b]?.minimumQuantity??0)>(w[b]?.length??0):"offerTier"==k&&(r=p<S.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(dm,{handleAddToBundle:J,ref:X,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,selectedProducts:n,themeColor:E?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:E?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",shadowRoot:f})})())},vm=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:d,storeCurrencyCode:s})=>{const p=i((()=>t=>{const n=e?.productDetails?.variants?.edges?.find((e=>e.node.id===t)),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0}),[e.productDetails]),u=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node;p(n);const m=i((()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[u,e.productDetails.options]),f=e=>{r(e)};return c?t.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:rh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map((e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)}))),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},nh(o.general.currencySymbol,s),th((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},nh(o.general.currencySymbol,s),th(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:rh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),t.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&d&&m&&t.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},nh(o.general.currencySymbol,s),th((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},nh(o.general.currencySymbol,s),th(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map((e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)}))),t.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find((e=>e.node.title===l))?.node,s=0===(c?p(c.id):0),u=m[r]===a,g=d&&d?.options?.find((e=>e.name===n.name));return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},g?.values.find((e=>e.name===a))?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find((e=>e.name===a))?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},g?.values.find((e=>e.name===a))?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:rh(g?.values.find((e=>e.name===a))?.value||"/placeholder.svg"),alt:a,style:{width:u&&!s?"26px":"24px",height:u&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&f(c.id)},disabled:s,style:{padding:"4px 8px",border:u&&!s?`1px solid ${o.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)})))))))},wm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,d]=c(window.innerWidth<786);l((()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))})),[e,n]);const s=i((()=>(e,t)=>{const n=e?.variants?.edges?.find((e=>e.node.id===t)),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0}),[]),[p,u]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails?.variants?.edges?.find((t=>s(e.productDetails,t?.node?.id)>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),m=e.products?.every(((e,t)=>{const n=p[t];return s(e.productDetails,n)>0})),f=(e,t)=>{u((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(p).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},nh(y.general.currencySymbol,e.storeCurrencyCode),th(h)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},nh(y.general.currencySymbol,e.storeCurrencyCode),th(g)),t.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${nh(y.general.currencySymbol,e.storeCurrencyCode)}${th(e?.amountOff)} Off`:`Save ${nh(y.general.currencySymbol,e.storeCurrencyCode)}${th(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===p[r]))?.node;return o?t.createElement(vm,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(vm,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(p);await n(Number(g),r,Number(h),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(ta,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Cm=x.div`
2872
2873
  max-width: 800px;
2873
2874
  container-type: inline-size;
2874
2875
  margin-top: ${e=>e.verticalMargin||"0px"};
@@ -200,7 +200,7 @@ export interface CartProps {
200
200
  cartOffersCarousalData?: CartOffersCarousalProps;
201
201
  freebieMilestoneData?: freebieMilestoneProps;
202
202
  cartOffersCarouselHeight?: number;
203
- stickyBarBuyNowFunction?: (event: any) => Promise<any>;
203
+ stickyBarBuyNowFunction?: (variantId: string, quantity: number) => Promise<void>;
204
204
  gstSectionCustomizationData?: GSTSectionCustomizationProps;
205
205
  noteSectionTitle?: string;
206
206
  checkoutSectionMessage?: string;
@@ -39,7 +39,7 @@ export type StickyAddToCartProps = {
39
39
  cartComponentsCornerType?: "rounded" | "sharp";
40
40
  cartComponentsCornerRadius?: number;
41
41
  stickyCartCustomizationData?: stickyCartCustomizationDataProps;
42
- checkoutFunction?: (event: any) => Promise<any>;
42
+ checkoutFunction?: (variantId: string, quantity: number) => Promise<void>;
43
43
  backgroundColor?: string;
44
44
  primaryTextColor?: string;
45
45
  comboBundleData?: BundlePayload;
package/dist/index.d.ts CHANGED
@@ -702,7 +702,7 @@ interface CartProps {
702
702
  cartOffersCarousalData?: CartOffersCarousalProps;
703
703
  freebieMilestoneData?: freebieMilestoneProps;
704
704
  cartOffersCarouselHeight?: number;
705
- stickyBarBuyNowFunction?: (event: any) => Promise<any>;
705
+ stickyBarBuyNowFunction?: (variantId: string, quantity: number) => Promise<void>;
706
706
  gstSectionCustomizationData?: GSTSectionCustomizationProps;
707
707
  noteSectionTitle?: string;
708
708
  checkoutSectionMessage?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.7.344-shadowdomBundle.51",
3
+ "version": "0.7.344-shadowdomBundle.53",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",