yt-uikit 0.10.46 → 0.10.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js
CHANGED
|
@@ -1003,7 +1003,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
1003
1003
|
`,Kr=s(Yr)`
|
|
1004
1004
|
font-size: 10px;
|
|
1005
1005
|
color: ${e=>e.color||"#868E96"};
|
|
1006
|
-
`,Jr=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:r,joinNowFunction:o,themeColor:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,cartComponentsCornerType:d,cartComponentsCornerRadius:p,showCartLevelAltPay:m})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:m?"0px":"10px",borderBottomRightRadius:m?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{className:"yt-cart-guest-loyalty-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(Xr,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(Kr,{className:"yt-cart-guest-loyalty-text",color:s},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",r,"% Off")," ","on all orders")),e.createElement(Gr,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:i,$ctaButtonTextColor:l,$cartComponentsCornerType:d,$cartComponentsCornerRadius:p,onClick:o},"Sign in Now"));class eo extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const to=({children:r})=>{const[o,a]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,r=e.includes("safari")&&!e.includes("chrome"),o=/android/.test(e);t?a("56px"):n?a(r?"44px":"34px"):o&&a("24px")},[]),e.createElement(eo,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},r))},no=()=>{const[r,o]=t(0);return n(()=>{const e=setTimeout(()=>{o(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${r}%`}},""))},ro=({removeDiscount:n,
|
|
1006
|
+
`,Jr=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:r,joinNowFunction:o,themeColor:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,cartComponentsCornerType:d,cartComponentsCornerRadius:p,showCartLevelAltPay:m})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:m?"0px":"10px",borderBottomRightRadius:m?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{className:"yt-cart-guest-loyalty-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(Xr,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(Kr,{className:"yt-cart-guest-loyalty-text",color:s},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",r,"% Off")," ","on all orders")),e.createElement(Gr,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:i,$ctaButtonTextColor:l,$cartComponentsCornerType:d,$cartComponentsCornerRadius:p,onClick:o},"Sign in Now"));class eo extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const to=({children:r})=>{const[o,a]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,r=e.includes("safari")&&!e.includes("chrome"),o=/android/.test(e);t?a("56px"):n?a(r?"44px":"34px"):o&&a("24px")},[]),e.createElement(eo,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},r))},no=()=>{const[r,o]=t(0);return n(()=>{const e=setTimeout(()=>{o(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${r}%`}},""))},ro=({removeDiscount:n,themeColor:r,primaryTextColor:o,secondaryTextColor:a,loyaltyDiscount:i,showCartLevelAltPay:l})=>{const c=de(nn),{cartLoading:s,setLoading:d}=sn(),[p,m]=t(!1),u=s.showLoyaltyCtaLoading,g=mn(i?.total_allocated_amount??0,c?.currency),f=c?.discount_codes?.find(e=>!0===e?.applicable)?.code;return u?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:l?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(fe,{color:"black",loading:u,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(no,null)):e.createElement("div",{className:"yt-loyalty-cta-applied-container",style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",borderRadius:"10px",padding:"12px 16px",margin:"10px 1rem",boxShadow:"0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549)",zIndex:100}},e.createElement("div",{className:"yt-cart-loyalty-applied-content",style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:r})),e.createElement("div",{className:"yt-cart-loyalty-applied-details",style:{display:"flex",flexDirection:"column",gap:"4px"}},e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"13px",fontWeight:"bold",color:o??"#000"}},fn(c,c?.currency),Number(g?.toFixed(1))??0," Off Coupon Applied!"),e.createElement("span",{className:"yt-loyalty-cta-applied-code-text",style:{fontSize:"9px",color:r??"#EF4444"}},"Code: ",f??""))),e.createElement("div",{className:"yt-cart-loyalty-applied-remove",style:{display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onClick:async()=>{d&&d(!0,!1,!1,!0);try{await n()}catch(e){}d&&d(!1,!1,!1,!1)},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1)}," ",p?e.createElement(he,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}):e.createElement(be,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}),e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"8px",color:a??"#6B7280",fontWeight:"600"}},"REMOVE")))},oo=s.span`
|
|
1007
1007
|
display: flex !important;
|
|
1008
1008
|
flex-direction: row;
|
|
1009
1009
|
align-items: center;
|
|
@@ -1037,7 +1037,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
1037
1037
|
width: 14px;
|
|
1038
1038
|
height: 14px;
|
|
1039
1039
|
}
|
|
1040
|
-
`,lo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:r,applyDiscount:o,themeColor:a,
|
|
1040
|
+
`,lo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:r,applyDiscount:o,themeColor:a,primaryTextColor:i,redemptionMinimumOrderValue:l=0,redemptionMinimumOrderValueStatus:c,coinName:s,showCartLevelAltPay:d})=>{const p=de(nn),{cartLoading:m,setLoading:u}=sn(),g=0===r||r<0,f=mn(p?.items_subtotal_price,p?.currency),y=!!c&&f<l;return m.showLoyaltyCtaLoading?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:d?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(fe,{color:"black",loading:m?.showLoyaltyCtaLoading,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(no,null)):e.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",margin:"10px 1rem",zIndex:100},className:"yt-loyalty-cta-container"},e.createElement("div",{className:"yt-cart-loyalty-apply-content",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"10px"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:a})),e.createElement("div",{className:"yt-cart-loyalty-apply-details",style:{display:"flex",flexDirection:"column"}},e.createElement(oo,{className:"yt-loyalty-cta-text",$primaryTextColor:i},0===r?"Insufficient Balance":e.createElement(e.Fragment,null,"Apply "," ",n?e.createElement("img",{src:n,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}):null,t<0?0:Number(r.toFixed(2))," ",s??"points"," ")),e.createElement("span",{className:"yt-loyalty-cta-info-text",style:{color:a??"#50D1AA",fontSize:"11px"}},0===r?"Place order to earn coins":e.createElement(e.Fragment,null,"Auto Applied on checkout")))),e.createElement(ao,{$insufficientPoints:g,$opacity:y?.2:1,onClick:async()=>{if(!(g||c&&f<l)){u&&u(!0,!1,!1,!0);try{await o()}catch(e){}u&&u(!1,!1,!1,!1)}},className:"yt-loyalty-cta-button"},e.createElement(io,{className:"yt-loyalty-cta-radio-button",$insufficientPoints:g,$opacity:y?.2:1})))},co=({value:t,handleItemQuantityDecrement:n,handleItemQuantityIncrement:r,isDev:o,themeColor:a,cartComponentsCornerType:i,cartComponentsCornerRadius:l,backgroundSubdued:c})=>e.createElement("form",{className:"yt-cart-quantity-selector-form",style:{marginBottom:"0px",width:"auto",height:"auto"}},e.createElement("div",{className:"yt-cart-quantity-selector",style:{border:"1px solid #dddddd",display:"flex",flexDirection:"row",borderRadius:"rounded"===i?`${l}px`:"8px",overflow:"hidden"}},e.createElement("button",{className:"yt-cart-quantity-decrement qty-selector-decrement-button",onClick:()=>0!==t&&n(),type:"button",style:{backgroundColor:c??bn(a,.1)}},"-"),e.createElement("input",{readOnly:!0,type:"text","aria-describedby":"helper-text-explanation",className:"yt-cart-quantity-input qty-selector-input",style:{textIndent:0,border:0,margin:0,width:"28px",minHeight:"22px !important",fontSize:"14px",padding:0,height:"auto",textAlign:"center",color:"black !important",background:"#ffffff !important"},value:t,required:!0}),e.createElement("button",{onClick:()=>r(),type:"button",id:"increment-button",className:"yt-cart-quantity-increment qty-selector-decrement-button",style:{backgroundColor:c??bn(a,.1)}},"+"))),so=le(void 0),po="yt_variant_options",mo="yt-variant-options-updated",uo=e=>e?e.trim().toLowerCase().replace(/[^a-z0-9#]+/g,""):"",go=()=>{if("undefined"==typeof window)return null;let e=null;try{e=window.localStorage.getItem(po)}catch{return null}return(e=>{if(!e)return null;try{const t=JSON.parse(e);if(Array.isArray(t))return{options:t};if(t&&Array.isArray(t.options))return{options:t.options}}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}return null})(e)},fo=(e,t)=>{if(!e||!t)return;const n=uo(t),r=(e=>{if(!e)return null;const t=e.match(/#([0-9a-f]{3,8})/i);return t?`#${t[1]}`.toLowerCase():null})(t);return e.values.find(e=>{const t=uo(e.name);if(n&&t&&t===n)return!0;if(r&&"string"==typeof e.value){if(e.value.trim().toLowerCase()===r)return!0}return!1})},yo=(e,t)=>{if(!t)return"";const n=e?.type?.toLowerCase(),r=fo(e,t);return"text"===n&&r?.value?r.value:t},xo=()=>{const[e,r]=t(null);return n(()=>{const e=()=>{const e=go();r(e)};e();const t=(e=>{if("undefined"==typeof window)return()=>{};const t=t=>{t.key&&t.key!==po||e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener(mo,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(mo,n)}})(e);return()=>{t()}},[]),e},ho=s.div`
|
|
1041
1041
|
display: flex;
|
|
1042
1042
|
flex-wrap: wrap;
|
|
1043
1043
|
align-items: center;
|
|
@@ -2433,7 +2433,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
2433
2433
|
font-weight: 400;
|
|
2434
2434
|
min-width: 14px;
|
|
2435
2435
|
line-height: 14px;
|
|
2436
|
-
`,wc=[...((vc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(vc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(vc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(vc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var vc;const Cc=new Set(wc.map(e=>e.id)),Ec=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}};var kc=e.memo(({isOpen:r,setIsOpen:a,backgroundColor:i="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:m="My Cart",emptyCartTitle:u,emptyCartDescription:g,emptyCartButtons:f,removeCartItem:y,handleIncrement:x,handleDecrement:h,addCartItem:b,isUserSignedIn:w,showBundle:v,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:N,discountApplied:B,removeDiscount:F,applyDiscount:z,checkoutFunction:$,joinNowFunction:I,guestLoyaltyPercentage:P,isDev:D,recProductsList:_,showMultiStepProgressBar:L,cartCheckpoints:R,redemptionRate:O,orderCreditType:M,orderCreditValue:H,showCartLevelAltPay:j,exploreCtaRedirectLink:q,discountAmountApplied:U,minimumCartValue:Q,discountInCheckoutButton:Z,isStickyCheckout:G,handleCheckpointCrossed:Y,customCartProgressBarCriteria:X,checkoutButtonColor:K="#252E69",ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,productRecsCtaButtonText:oe,productRecsTitleText:ae,emptyProductRecsTitleText:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:pe,themeColor:me,themeTextColor:ue,companyName:ge,gstNumber:fe,showGSTOption:ye,applyGSTToCart:xe,showMOVForProgressTiers:he,freeProduct:be,showLoyaltyCta:we=!1,freeProductAdjustedCartTotal:ve,redemptionMinimumOrderValue:Ce,redemptionMinimumOrderValueStatus:Ee,signinCTAButtonVisible:ke,cartSigninCTAMainText:Te,applyNoteToCart:Se,note:Ne,showNoteOption:Be,inlineCartOfferInfoText:Fe,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:$e,showEditOptionOnProducts:Ie,onSetLoading:Pe,showVariantSelectionDropdownInProductRecs:De,originalCartSubtotal:Ae,freebieProductsInCart:_e,showFreebieClaim:Le,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Me,productPercentageOffMapping:Ve,removeFreebieFromCart:We,postalCodeList:He,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ze,freebieFlowCheckpoints:Ge,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:st,cartTimerInMinutes:dt,cartTimerCustomText:pt,productRecsCardLayout:mt,productRecsCardListVariant:ut,imageAspectSelector:gt,cartComponentsCornerType:ft,cartComponentsCornerRadius:yt,cartOffersCarousalData:xt,gstSectionCustomizationData:ht,noteSectionTitle:bt,checkoutSectionMessage:wt,checkoutSectionMessageDisplay:vt,showVariantSelectionDropdownInProductClaim:Ct,loyaltyDiscount:Et,coinName:kt,showDiscountOnMRP:Tt,switchWidthVariant:St,prefixMessageText:Nt,suffixMessageText:Bt,successMessageText:Ft,toggleDecimal:zt,cartOffersCarouselHeight:$t,disableCheckoutButton:It,showEmptyCartRecommendations:Pt=!1,checkoutButtonBottomSpacing:Dt,applyCouponCode:At,showApplyCoupon:_t,enableConfetti:Lt,checkoutSectionMessageRedirectLink:Rt,showCheckoutButtonPaymentIcons:Ot,stealDealCheckpoints:Mt,stealDealProducts:Vt,stealDealAddToCart:Wt,showCouponOptions:Ht,rewardCoupons:jt,couponSelectionData:qt,useCartShell:Ut,showTrustedBadge:Qt,trustedBadgeData:Zt,drawerLayoutData:Gt})=>{const Yt=de(nn),Xt=de(cn),[Kt,Jt]=t(!1),en=o(0),tn=o(null),[on,sn]=t(!1),[un,gn]=t(!0),fn=dn();e.useEffect(()=>{Pe&&Pe(fn)},[Pe]);const yn=o(!!Ut&&(window.ytCartShellState?.isOpen??!1)),xn=o(null),hn=o(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&a(!1)};return r?(yn.current||(xn.current=window.history.state,hn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),yn.current=!0):(yn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(xn.current,"",hn.current??window.location.href),yn.current=!1),()=>{window.removeEventListener("popstate",e)}},[r,a]);const bn=function(e,r=!1){const[o,a]=t(r);return n(()=>{if("undefined"==typeof window||!window.matchMedia)return;const t=window.matchMedia(e),n=()=>a(t.matches);return n(),t.addEventListener?t.addEventListener("change",n):t.addListener(n),()=>{t.removeEventListener?t.removeEventListener("change",n):t.removeListener(n)}},[e]),o}("(min-width: 450px)");n(()=>{const e=document.querySelector("body");e&&(at&&it?e.classList.remove("drawer-open"):!bn&&r?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[r,at,it,bn]);const wn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{const e=Date.now();e-en.current<1500||(en.current=e,Jt(!0),tn.current&&window.clearTimeout(tn.current),tn.current=window.setTimeout(()=>Jt(!1),1500))};return window.addEventListener("yt:autoFreebieAdded",e),()=>{tn.current&&window.clearTimeout(tn.current),window.removeEventListener("yt:autoFreebieAdded",e)}},[]);const[vn,Cn]=t("normal"),[En,kn]=t("normal"),[Tn,Sn]=t("auto");n(()=>{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")?kn("400"):CSS.supports("font-weight","300")?kn("300"):CSS.supports("font-weight","200")&&kn("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",En),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)},[vn,En]);const[Nn]=se(rn),[Bn]=se(ln),[Fn]=se(an);n(()=>{gn(!("all-products"!==Xe&&("specific-tags"!==Xe||Nn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Nn.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===Fn||on&&(Ke?Nn.isPostalCodeValid&&Bn:Nn.isPostalCodeValid))))},[Nn.isPostalCodeValid,Bn,on,Xe,Ke]),se(pn);const[zn,$n]=t(!0);n(()=>{const e=String(dt??5);if(localStorage.getItem("cartTimerMinutes")!==e)return localStorage.setItem("cartTimerMinutes",e),localStorage.removeItem("cartTimerRanOnce"),localStorage.removeItem("cartTimerTimeLeft"),void $n(!0);"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const t=localStorage.getItem("cartTimerTimeLeft");t&&parseInt(t,10)<=0&&$n(!1)},[dt]);const In=()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("cartTimerTimeLeft")},Pn=new Date("2024-11-01"),Dn=Ut?document.getElementById("yt-cart-shell-content"):null,An=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(r=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,r).forEach(e=>{!n.has(e)&&Cc.has(e)&&(n.add(e),Ec(t,r,e))})}),wc.forEach(({id:e,zone:r})=>{n.has(e)||(n.add(e),Ec(t,r,e))}),t})(Gt),_n=_&&_?.filter(Boolean).length>0,Ln=_&&_?.filter(Boolean),Rn=(t,n)=>{const o=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(Tl,{key:o,themeColor:me,cartOffersCarousalData:xt,cartOffersCarouselHeight:$t,cartData:Yt}):null;case"timer":return lt&&zn&&Yt?.item_count?e.createElement(rl,{key:o,minutes:dt,customText:pt,onTimerComplete:In}):null;case"info-text":return Fe?e.createElement(Vi,{key:o,inlineCartOfferInfoText:Fe,inlineCartOfferInfoRedirectLink:ze,themeColor:me,tooltipText:$e,themeTextColor:ue}):null;case"steal-deal":return Mt&&Mt.length>0&&Vt&&Vt.length>0&&Yt?.item_count>0?e.createElement(xc,{key:o,stealDealCheckpoints:Mt,stealDealProducts:Vt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Me,addFreebieToCart:Wt??Re,freebiesInCart:Oe??[],themeColor:me,primaryTextColor:ne,secondaryTextColor:re}):null;case"recs":return(t=>{const n=bn&&ce&&!!Ln&&_n&&Yt?.item_count>0&&b,r=!bn&&pe&&!!Ln&&_n&&Yt?.item_count>0&&b;return n||r?e.createElement(e.Fragment,{key:t},n&&e.createElement(ar,{addCartItem:b,products:Ln,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:ae,themeColor:me,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,cardLayout:mt,variant:ut,cartComponentsCornerType:ft,cartComponentsCornerRadius:yt,backgroundSubdued:l,backgroundColor:i,tertiaryColor:c,tertiaryTextColor:s}),r&&e.createElement(ar,{addCartItem:b,products:Ln,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:ae,themeColor:me,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,cardLayout:mt,variant:ut,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(o);case"bundle":return Yt?.item_count>0&&v&&C?e.createElement(Qo,{key:o,bundleProducts:C}):null;case"gst":return ye&&xe&&Yt?.item_count>0?e.createElement(ba,{key:o,companyName:ge,gstNumber:fe,themeColor:me,iconColor:ht?.iconColor,showIcon:ht?.showIcon,backgroundColor:ht?.backgroundColor,textColor:ht?.textColor,title:ht?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&Re&&_e&&Oe&&_e.length>0?e.createElement(Mi,{key:o,freebieProductsInCart:_e,themeColor:me,themeTextColor:ue,primaryTextColor:ne,addFreebieToCart:Re,freebiesInCart:Oe,imageAspectSelector:gt,freebieCouponTemplates:Ze,freebieClaimData:Ye,cartCheckpoints:R,isCartDrawerOpen:r}):null;case"shipping":return je&&(He?.length??0)>0&&Ue&&Yt?.item_count>0?e.createElement("div",{key:o,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>gn(!un)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(te,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},un?e.createElement(V,null):e.createElement(W,null))),"all-products"===Xe&&un?e.createElement(ji,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):un&&(on?e.createElement(ji,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):e.createElement(qi,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,disabledDates:Pn}))):null;case"note":return Be&&Se&&Yt?.item_count>0?e.createElement(wa,{key:o,note:Ne,noteSectionTitle:bt}):null;case"gift-wrap":return nt?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(el,{key:o,themeColor:me,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,showProductImage:nt?.showProductImage,addCartItem:b,removeCartItem:y}):null;case"coupon":return Yt?.item_count>0&&Ht&&jt&&qt&&At&&!we?e.createElement(ia,{key:o,rewardCoupons:jt,couponSelectionData:qt,applyCouponCode:At,removeDiscount:F,enableConfetti:Lt,backgroundSubdued:l,themeColor:me,themeTextColor:ue,primaryTextColor:ne,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,cartComponentsCornerRadius:yt}):Yt?.item_count>0&&_t&&!Ht&&!we&&At?e.createElement(Zo,{key:o,backgroundSubdued:l,themeColor:me,themeTextColor:ue,primaryTextColor:ne,cartComponentsCornerRadius:yt,applyCouponCode:At,removeDiscount:F,enableConfetti:Lt}):null;case"loyalty":return(t=>we&&Yt?.item_count?e.createElement(e.Fragment,{key:t},w||Et?!Et&&void 0!==E&&void 0!==T&&!!z&&e.createElement(lo,{themeColor:me,applyDiscount:z,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,redemptionMinimumOrderValue:Ce,redemptionMinimumOrderValueStatus:Ee,coinName:kt,showCartLevelAltPay:j,redemptionMultiplier:N}):!!P&&!!I&&e.createElement(Jr,{cartSigninCTAMainText:Te,signinCTAButtonVisible:ke,themeColor:me,joinNowFunction:I,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,showCartLevelAltPay:j}),!!Et&&!!F&&Et&&void 0!==T&&e.createElement(ro,{themeColor:me,removeDiscount:F,loyaltyDiscount:Et,isDev:D,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,pointsToBeUsed:T,showCartLevelAltPay:j}),!!Ee&&!!Ce&&Ce>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:me??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",kt,":"," ",Ce)):null)(o);case"points-preview":return we&&j&&O&&Yt?.item_count>0?e.createElement($l,{key:o,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:ne,orderCreditType:M,orderCreditValue:H,coinName:kt,rewardMultiplier:S}):null;default:return null}},On=e.createElement(e.Fragment,null,Xt.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Xt.showLoader&&!Xt.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ne,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},m),Yt?.item_count>0&&j&&!(we&&j)&&!!H&&H>0&&e.createElement(Pl,{orderCreditType:M,orderCreditValue:H,loyaltyIcon:k,coinName:kt,themeColor:me,themeTextColor:ue,rewardMultiplier:S}),wn>0&&e.createElement(bc,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},wn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&e.createElement("div",{className:"yt-cart-close-button",style:{backgroundColor:l||"#cacaca30",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"}},e.createElement(ie,{style:{color:ne},size:28,cursor:"pointer",onClick:()=>{a(!r)}})))),Xt&&e.createElement(Fl,{$themeColor:me,show:Xt.showLoader}),Kt&&Lt&&e.createElement(zr,{particleCount:50,spread:90,origin:{y:.3}}),An.headerIds?.map((e,t)=>Rn(e,t))),L&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!R&&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?.[Tr(r)]&&("minimum_order_value"!==r||1!==e?.[Tr(r)])).some((e,i)=>Sr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(R,mn(void 0!==Ae?Ae:Yt?.items_subtotal_price,Yt.currency),void 0===Me?Yt?.item_count:Me,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Mr,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:Y,checkpoints:R,effectiveQuantityForProgressBar:void 0===Me?Yt?.item_count:Me,currentCartAmount:mn(void 0!==Ae?Ae:Yt?.items_subtotal_price,Yt.currency),themeColor:me,themeTextColor:ue,primaryTextColor:ne,secondaryTextColor:re,showMOVForProgressTiers:he,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,prefixMessageText:Nt,suffixMessageText:Bt,successMessageText:Ft,enableConfetti:Lt})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Xt?.showSkeletonLoader?e.createElement(Hr,{showLoyaltyCta:we,joinNowFunction:I,emptyCartTitle:u,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:w,exploreCtaRedirectLink:q,themeColor:me,emptyCartButtons:f,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,themeTextColor:ue,isRecProductsListValid:_n,recProductsList:Ln,addCartItem:b,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,emptyProductRecsTitleText:le,backgroundSubdued:l,showEmptyCartRecommendations:Pt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},An.scroll?.topIds?.map((e,t)=>Rn(e,t)),e.createElement(Uo,{isDev:D,themeColor:me,handleDecrement:h,handleIncrement:x,removeCartItem:y,addCartItem:b,primaryTextColor:ne,secondaryTextColor:re,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ie,productPercentageOffMapping:Ve,removeFreebieFromCart:We,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ze??[],freebieFlowCheckpoints:Ge??[],cartCheckpoints:R,freeProductAdjustedCartTotal:ve,imageAspectSelector:gt,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:i,showDiscountOnMRP:Tt,checkoutSectionMessage:wt,checkoutSectionMessageRedirectLink:Rt,showFreebieMilestone:ct,freebieMilestoneData:st,freeLabelText:Ye?.freeLabelText,customCartProgressBarCriteria:X,effectiveQuantityForProgressBar:Me,isLargeScreen:bn}),An.scroll?.bottomIds?.map((e,t)=>Rn(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Dl,{showDiscountOnMRP:Tt,cartCheckpoints:R,toggleDecimal:zt,primaryTextColor:ne,discountApplied:B,showTrustedBadge:Qt,discountAmountApplied:U})),e.createElement(to,null,An.footerIds?.map((e,t)=>Rn(e,t)),Yt&&$&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Zr,{disableCheckoutButton:!!It||Xt.cartLoading,discountApplied:B,checkoutFunction:$,checkoutButtonColor:K,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:G,discountAmountApplied:U,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:xe,showGSTOption:ye,applyNoteToCart:Se,showNoteOption:Be,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,checkoutSectionMessage:wt,checkoutSectionMessageDisplay:vt,checkoutSectionMessageRedirectLink:Rt,showDiscountOnMRP:Tt,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:R,toggleDecimal:zt,checkoutButtonBottomSpacing:Dt,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:ne,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:Qt,trustedBadgeData:Zt,isLargeScreen:bn}))))));return Ut&&Dn?A(On,Dn):e.createElement(hc,{className:"yt-cart-drawer",$isDev:D,$isOpen:r,$backgroundColor:i,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:bn,$switchWidthVariant:St},On)});Et('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const Tc=s.div`
|
|
2436
|
+
`,wc=[...((vc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(vc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(vc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(vc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var vc;const Cc=new Set(wc.map(e=>e.id)),Ec=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}};var kc=e.memo(({isOpen:r,setIsOpen:a,backgroundColor:i="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:m="My Cart",emptyCartTitle:u,emptyCartDescription:g,emptyCartButtons:f,removeCartItem:y,handleIncrement:x,handleDecrement:h,addCartItem:b,isUserSignedIn:w,showBundle:v,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:N,discountApplied:B,removeDiscount:F,applyDiscount:z,checkoutFunction:$,joinNowFunction:I,guestLoyaltyPercentage:P,isDev:D,recProductsList:_,showMultiStepProgressBar:L,cartCheckpoints:R,redemptionRate:O,orderCreditType:M,orderCreditValue:H,showCartLevelAltPay:j,exploreCtaRedirectLink:q,discountAmountApplied:U,minimumCartValue:Q,discountInCheckoutButton:Z,isStickyCheckout:G,handleCheckpointCrossed:Y,customCartProgressBarCriteria:X,checkoutButtonColor:K="#252E69",ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,productRecsCtaButtonText:oe,productRecsTitleText:ae,emptyProductRecsTitleText:le,showProductRecsOnDesktop:ce,showProductRecsOnMobile:pe,themeColor:me,themeTextColor:ue,companyName:ge,gstNumber:fe,showGSTOption:ye,applyGSTToCart:xe,showMOVForProgressTiers:he,freeProduct:be,showLoyaltyCta:we=!1,freeProductAdjustedCartTotal:ve,redemptionMinimumOrderValue:Ce,redemptionMinimumOrderValueStatus:Ee,signinCTAButtonVisible:ke,cartSigninCTAMainText:Te,applyNoteToCart:Se,note:Ne,showNoteOption:Be,inlineCartOfferInfoText:Fe,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:$e,showEditOptionOnProducts:Ie,onSetLoading:Pe,showVariantSelectionDropdownInProductRecs:De,originalCartSubtotal:Ae,freebieProductsInCart:_e,showFreebieClaim:Le,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Me,productPercentageOffMapping:Ve,removeFreebieFromCart:We,postalCodeList:He,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ze,freebieFlowCheckpoints:Ge,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:st,cartTimerInMinutes:dt,cartTimerCustomText:pt,productRecsCardLayout:mt,productRecsCardListVariant:ut,imageAspectSelector:gt,cartComponentsCornerType:ft,cartComponentsCornerRadius:yt,cartOffersCarousalData:xt,gstSectionCustomizationData:ht,noteSectionTitle:bt,checkoutSectionMessage:wt,checkoutSectionMessageDisplay:vt,showVariantSelectionDropdownInProductClaim:Ct,loyaltyDiscount:Et,coinName:kt,showDiscountOnMRP:Tt,switchWidthVariant:St,prefixMessageText:Nt,suffixMessageText:Bt,successMessageText:Ft,toggleDecimal:zt,cartOffersCarouselHeight:$t,disableCheckoutButton:It,showEmptyCartRecommendations:Pt=!1,checkoutButtonBottomSpacing:Dt,applyCouponCode:At,showApplyCoupon:_t,enableConfetti:Lt,checkoutSectionMessageRedirectLink:Rt,showCheckoutButtonPaymentIcons:Ot,stealDealCheckpoints:Mt,stealDealProducts:Vt,stealDealAddToCart:Wt,showCouponOptions:Ht,rewardCoupons:jt,couponSelectionData:qt,useCartShell:Ut,showTrustedBadge:Qt,trustedBadgeData:Zt,drawerLayoutData:Gt})=>{const Yt=de(nn),Xt=de(cn),[Kt,Jt]=t(!1),en=o(0),tn=o(null),[on,sn]=t(!1),[un,gn]=t(!0),fn=dn();e.useEffect(()=>{Pe&&Pe(fn)},[Pe]);const yn=o(!!Ut&&(window.ytCartShellState?.isOpen??!1)),xn=o(null),hn=o(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&a(!1)};return r?(yn.current||(xn.current=window.history.state,hn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),yn.current=!0):(yn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(xn.current,"",hn.current??window.location.href),yn.current=!1),()=>{window.removeEventListener("popstate",e)}},[r,a]);const bn=function(e,r=!1){const[o,a]=t(r);return n(()=>{if("undefined"==typeof window||!window.matchMedia)return;const t=window.matchMedia(e),n=()=>a(t.matches);return n(),t.addEventListener?t.addEventListener("change",n):t.addListener(n),()=>{t.removeEventListener?t.removeEventListener("change",n):t.removeListener(n)}},[e]),o}("(min-width: 450px)");n(()=>{const e=document.querySelector("body");e&&(at&&it?e.classList.remove("drawer-open"):!bn&&r?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[r,at,it,bn]);const wn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{const e=Date.now();e-en.current<1500||(en.current=e,Jt(!0),tn.current&&window.clearTimeout(tn.current),tn.current=window.setTimeout(()=>Jt(!1),1500))};return window.addEventListener("yt:autoFreebieAdded",e),()=>{tn.current&&window.clearTimeout(tn.current),window.removeEventListener("yt:autoFreebieAdded",e)}},[]);const[vn,Cn]=t("normal"),[En,kn]=t("normal"),[Tn,Sn]=t("auto");n(()=>{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")?kn("400"):CSS.supports("font-weight","300")?kn("300"):CSS.supports("font-weight","200")&&kn("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",En),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Tn)},[vn,En]);const[Nn]=se(rn),[Bn]=se(ln),[Fn]=se(an);n(()=>{gn(!("all-products"!==Xe&&("specific-tags"!==Xe||Nn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Nn.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===Fn||on&&(Ke?Nn.isPostalCodeValid&&Bn:Nn.isPostalCodeValid))))},[Nn.isPostalCodeValid,Bn,on,Xe,Ke]),se(pn);const[zn,$n]=t(!0);n(()=>{const e=String(dt??5);if(localStorage.getItem("cartTimerMinutes")!==e)return localStorage.setItem("cartTimerMinutes",e),localStorage.removeItem("cartTimerRanOnce"),localStorage.removeItem("cartTimerTimeLeft"),void $n(!0);"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const t=localStorage.getItem("cartTimerTimeLeft");t&&parseInt(t,10)<=0&&$n(!1)},[dt]);const In=()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("cartTimerTimeLeft")},Pn=new Date("2024-11-01"),Dn=Ut?document.getElementById("yt-cart-shell-content"):null,An=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(r=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,r).forEach(e=>{!n.has(e)&&Cc.has(e)&&(n.add(e),Ec(t,r,e))})}),wc.forEach(({id:e,zone:r})=>{n.has(e)||(n.add(e),Ec(t,r,e))}),t})(Gt),_n=_&&_?.filter(Boolean).length>0,Ln=_&&_?.filter(Boolean),Rn=(t,n)=>{const o=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(Tl,{key:o,themeColor:me,cartOffersCarousalData:xt,cartOffersCarouselHeight:$t,cartData:Yt}):null;case"timer":return lt&&zn&&Yt?.item_count?e.createElement(rl,{key:o,minutes:dt,customText:pt,onTimerComplete:In}):null;case"info-text":return Fe?e.createElement(Vi,{key:o,inlineCartOfferInfoText:Fe,inlineCartOfferInfoRedirectLink:ze,themeColor:me,tooltipText:$e,themeTextColor:ue}):null;case"steal-deal":return Mt&&Mt.length>0&&Vt&&Vt.length>0&&Yt?.item_count>0?e.createElement(xc,{key:o,stealDealCheckpoints:Mt,stealDealProducts:Vt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Me,addFreebieToCart:Wt??Re,freebiesInCart:Oe??[],themeColor:me,primaryTextColor:ne,secondaryTextColor:re}):null;case"recs":return(t=>{const n=bn&&ce&&!!Ln&&_n&&Yt?.item_count>0&&b,r=!bn&&pe&&!!Ln&&_n&&Yt?.item_count>0&&b;return n||r?e.createElement(e.Fragment,{key:t},n&&e.createElement(ar,{addCartItem:b,products:Ln,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:ae,themeColor:me,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,cardLayout:mt,variant:ut,cartComponentsCornerType:ft,cartComponentsCornerRadius:yt,backgroundSubdued:l,backgroundColor:i,tertiaryColor:c,tertiaryTextColor:s}),r&&e.createElement(ar,{addCartItem:b,products:Ln,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:ae,themeColor:me,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,cardLayout:mt,variant:ut,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(o);case"bundle":return Yt?.item_count>0&&v&&C?e.createElement(Qo,{key:o,bundleProducts:C}):null;case"gst":return ye&&xe&&Yt?.item_count>0?e.createElement(ba,{key:o,companyName:ge,gstNumber:fe,themeColor:me,iconColor:ht?.iconColor,showIcon:ht?.showIcon,backgroundColor:ht?.backgroundColor,textColor:ht?.textColor,title:ht?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&Re&&_e&&Oe&&_e.length>0?e.createElement(Mi,{key:o,freebieProductsInCart:_e,themeColor:me,themeTextColor:ue,primaryTextColor:ne,addFreebieToCart:Re,freebiesInCart:Oe,imageAspectSelector:gt,freebieCouponTemplates:Ze,freebieClaimData:Ye,cartCheckpoints:R,isCartDrawerOpen:r}):null;case"shipping":return je&&(He?.length??0)>0&&Ue&&Yt?.item_count>0?e.createElement("div",{key:o,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>gn(!un)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(te,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},un?e.createElement(V,null):e.createElement(W,null))),"all-products"===Xe&&un?e.createElement(ji,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):un&&(on?e.createElement(ji,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Pn}):e.createElement(qi,{postalCodeList:He,themeColor:me,themeTextColor:ue,enableSlotPicker:Ke,disabledDates:Pn}))):null;case"note":return Be&&Se&&Yt?.item_count>0?e.createElement(wa,{key:o,note:Ne,noteSectionTitle:bt}):null;case"gift-wrap":return nt?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(el,{key:o,themeColor:me,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,showProductImage:nt?.showProductImage,addCartItem:b,removeCartItem:y}):null;case"coupon":return Yt?.item_count>0&&Ht&&jt&&qt&&At&&!we?e.createElement(ia,{key:o,rewardCoupons:jt,couponSelectionData:qt,applyCouponCode:At,removeDiscount:F,enableConfetti:Lt,backgroundSubdued:l,themeColor:me,themeTextColor:ue,primaryTextColor:ne,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,cartComponentsCornerRadius:yt}):Yt?.item_count>0&&_t&&!Ht&&!we&&At?e.createElement(Zo,{key:o,backgroundSubdued:l,themeColor:me,themeTextColor:ue,primaryTextColor:ne,cartComponentsCornerRadius:yt,applyCouponCode:At,removeDiscount:F,enableConfetti:Lt}):null;case"loyalty":return(t=>we&&Yt?.item_count?e.createElement(e.Fragment,{key:t},w||Et?!Et&&void 0!==E&&void 0!==T&&!!z&&e.createElement(lo,{themeColor:me,applyDiscount:z,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,primaryTextColor:ne,redemptionMinimumOrderValue:Ce,redemptionMinimumOrderValueStatus:Ee,coinName:kt,showCartLevelAltPay:j}):!!P&&!!I&&e.createElement(Jr,{cartSigninCTAMainText:Te,signinCTAButtonVisible:ke,themeColor:me,joinNowFunction:I,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,showCartLevelAltPay:j}),!!Et&&!!F&&Et&&e.createElement(ro,{themeColor:me,removeDiscount:F,loyaltyDiscount:Et,primaryTextColor:ne,secondaryTextColor:re,showCartLevelAltPay:j}),!!Ee&&!!Ce&&Ce>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:me??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",kt,":"," ",Ce)):null)(o);case"points-preview":return we&&j&&O&&Yt?.item_count>0?e.createElement($l,{key:o,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:ne,orderCreditType:M,orderCreditValue:H,coinName:kt,rewardMultiplier:S}):null;default:return null}},On=e.createElement(e.Fragment,null,Xt.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Xt.showLoader&&!Xt.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ne,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},m),Yt?.item_count>0&&j&&!(we&&j)&&!!H&&H>0&&e.createElement(Pl,{orderCreditType:M,orderCreditValue:H,loyaltyIcon:k,coinName:kt,themeColor:me,themeTextColor:ue,rewardMultiplier:S}),wn>0&&e.createElement(bc,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},wn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&e.createElement("div",{className:"yt-cart-close-button",style:{backgroundColor:l||"#cacaca30",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"}},e.createElement(ie,{style:{color:ne},size:28,cursor:"pointer",onClick:()=>{a(!r)}})))),Xt&&e.createElement(Fl,{$themeColor:me,show:Xt.showLoader}),Kt&&Lt&&e.createElement(zr,{particleCount:50,spread:90,origin:{y:.3}}),An.headerIds?.map((e,t)=>Rn(e,t))),L&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!R&&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?.[Tr(r)]&&("minimum_order_value"!==r||1!==e?.[Tr(r)])).some((e,i)=>Sr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(R,mn(void 0!==Ae?Ae:Yt?.items_subtotal_price,Yt.currency),void 0===Me?Yt?.item_count:Me,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Mr,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:Y,checkpoints:R,effectiveQuantityForProgressBar:void 0===Me?Yt?.item_count:Me,currentCartAmount:mn(void 0!==Ae?Ae:Yt?.items_subtotal_price,Yt.currency),themeColor:me,themeTextColor:ue,primaryTextColor:ne,secondaryTextColor:re,showMOVForProgressTiers:he,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,prefixMessageText:Nt,suffixMessageText:Bt,successMessageText:Ft,enableConfetti:Lt})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Xt?.showSkeletonLoader?e.createElement(Hr,{showLoyaltyCta:we,joinNowFunction:I,emptyCartTitle:u,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:w,exploreCtaRedirectLink:q,themeColor:me,emptyCartButtons:f,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,themeTextColor:ue,isRecProductsListValid:_n,recProductsList:Ln,addCartItem:b,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:ne,secondaryTextColor:re,showVariantSelectionDropdownInProductRecs:De,emptyProductRecsTitleText:le,backgroundSubdued:l,showEmptyCartRecommendations:Pt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},An.scroll?.topIds?.map((e,t)=>Rn(e,t)),e.createElement(Uo,{isDev:D,themeColor:me,handleDecrement:h,handleIncrement:x,removeCartItem:y,addCartItem:b,primaryTextColor:ne,secondaryTextColor:re,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ie,productPercentageOffMapping:Ve,removeFreebieFromCart:We,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ze??[],freebieFlowCheckpoints:Ge??[],cartCheckpoints:R,freeProductAdjustedCartTotal:ve,imageAspectSelector:gt,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:i,showDiscountOnMRP:Tt,checkoutSectionMessage:wt,checkoutSectionMessageRedirectLink:Rt,showFreebieMilestone:ct,freebieMilestoneData:st,freeLabelText:Ye?.freeLabelText,customCartProgressBarCriteria:X,effectiveQuantityForProgressBar:Me,isLargeScreen:bn}),An.scroll?.bottomIds?.map((e,t)=>Rn(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Dl,{showDiscountOnMRP:Tt,cartCheckpoints:R,toggleDecimal:zt,primaryTextColor:ne,discountApplied:B,showTrustedBadge:Qt,discountAmountApplied:U})),e.createElement(to,null,An.footerIds?.map((e,t)=>Rn(e,t)),Yt&&$&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Zr,{disableCheckoutButton:!!It||Xt.cartLoading,discountApplied:B,checkoutFunction:$,checkoutButtonColor:K,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:G,discountAmountApplied:U,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:xe,showGSTOption:ye,applyNoteToCart:Se,showNoteOption:Be,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:yt,cartComponentsCornerType:ft,checkoutSectionMessage:wt,checkoutSectionMessageDisplay:vt,checkoutSectionMessageRedirectLink:Rt,showDiscountOnMRP:Tt,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:R,toggleDecimal:zt,checkoutButtonBottomSpacing:Dt,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:ne,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:Qt,trustedBadgeData:Zt,isLargeScreen:bn}))))));return Ut&&Dn?A(On,Dn):e.createElement(hc,{className:"yt-cart-drawer",$isDev:D,$isOpen:r,$backgroundColor:i,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:bn,$switchWidthVariant:St},On)});Et('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const Tc=s.div`
|
|
2437
2437
|
display: flex;
|
|
2438
2438
|
flex-direction: row;
|
|
2439
2439
|
height: 100%;
|
|
@@ -3116,7 +3116,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
3116
3116
|
font-size: 1em;
|
|
3117
3117
|
justify-content: center;
|
|
3118
3118
|
align-items: center;
|
|
3119
|
-
`;const Es=({options:t,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i,showOutOfStockVariants:l=!0})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const i=!a||a(t.name);return l||i?e.createElement("div",{key:t.name,onClick:()=>{i&&r(t)},style:{cursor:i?"pointer":"not-allowed"}},((t,n)=>{const r=!a||a(t.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 t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"},className:r?"":"variant-out-of-stock"}):e.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"},className:r?"":"variant-out-of-stock"},t.name);return"image"===o?e.createElement("img",{src:Tn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"},className:r?"":"variant-out-of-stock"}):e.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"},className:r?"":"variant-out-of-stock"},t.name)})(t,n?.name===t.name)):null})),ks=({product:o,isOpen:a,onClose:i,variantOptions:l,cta:c,onConfirm:s,showOutOfStockVariants:d=!0})=>{const p=r(()=>e=>e?o?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[o?.tracksInventory]),m=r(()=>{const e=o.variants.edges.find(e=>{const t=e.node;return p(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):o.options?.map(e=>e.values[0])||[]},[o,p]),[u,g]=t(m),[f,y]=t(window.innerWidth<1024);n(()=>{const e=()=>y(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&i()};return a&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[a,i]);const x=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||o.featuredMedia?.preview?.image?.url,b=Tn(h,150,85,"webp"),w=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.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 v(e).find(e=>e.name===n)||null};if(!a)return null;const E=e.createElement("div",{onClick:i,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"},e.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"}}},e.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"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:o.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},o.title))),e.createElement("div",{style:{padding:"20px"}},o.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(t,n)?.name||t.values[0])),e.createElement(Es,{options:v(t),selectedValue:C(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,g(n)})(n,e)},type:w(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const r=o.options?.length>0?n.join(" / "):n[0],a=o.variants.edges.find(e=>e.node.title===r)?.node;return!!a&&p(a)>0})(n,e),isMobile:f,showOutOfStockVariants:d}))))),e.createElement("button",{onClick:()=>{const e=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&p(e)>0;if(e?.id&&t)s(e.id),i();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=o.variants.edges.find(e=>p(e.node)>0)?.node.id;e&&(s(e),i())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.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 D.createPortal(E,document.body)},Ts=l((i,l)=>{const[c,s]=se(hs),d=r(()=>e=>{const t=i?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?i?.bundleProductsCustomQuantity??e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?i?.bundleProductsCustomQuantity??1/0:0:i?.bundleProductsCustomQuantity??1/0:0},[c?.tracksInventory,i?.customVariantsQuantity,i?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[m,u]=t(p?.[0]?.node),[g,f]=t(0),[y,x]=t("undefined"!=typeof window&&window.innerWidth<=600),[h,b]=t(1),[w,v]=t("idle"),C=o(null),E=o(null),k=o(!1),[T,S]=t(0),[N,B]=t(),F=r(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[z,$]=t(F);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;u(t),t?.title&&"Default Title"!==t.title&&$(t.title.split(" / "))}},[c,d]),n(()=>{const e=i.selectedProducts.find(e=>e.variantId===m?.id);b(e?e.quantity:0)},[h,i.selectedProducts,m]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>x(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:P,media:A,variants:_}=c,L=A.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),R=a(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,u(n),B(n?.image?.url),n.title&&"Default Title"!==n.title&&$(n.title.split(" / ")))},[p,d]),O=a(e=>{if(!i.bundleVariantOptions?.options)return"text";const t=i.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[i.bundleVariantOptions]),M=a(e=>{if(!i?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=i?.bundleVariantOptions?.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}})},[i.bundleVariantOptions]),V=a((e,t)=>{const n=[...z];n[e]=t.name,$(n);const r=c?.options?.length>0?n.join(" / "):n[0],o=c?.variants.edges.find(e=>e.node.title===r)?.node;B(o?.image?.url),o&&d(o)>0&&(k.current=!0,u(o))},[z,c,d]),W=a((e,t)=>{const n=z[t];if(!n)return null;return M(e).find(e=>e.name===n)||null},[z,M]),H=a((e,t)=>{const n=[...z];n[e]=t;const r=c?.options?.length>0?n.join(" / "):n[0],o=c?.variants.edges.find(e=>e.node.title===r)?.node;return!!o&&d(o)>0},[z,c,d]);n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(y&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[y,c]);const j=i.selectedProducts.filter(e=>e.variantId===m?.id).reduce((e,t)=>e+t.quantity,0),q=i.customVariantsQuantity?.find(e=>e.variantId===m?.id)?.quantity??i.bundleProductsCustomQuantity??1/0,U=q!==1/0&&j>=q,Q=i.hideAddToBundle||!m||d(m)<=0||U||"idle"!==w||i?.disableQuantitySelector&&1===h,Z=({className:t})=>{const n=c?.rating?.averageRating??i?.rating?.averageRating??0,r=c?.rating?.ratingCount??i?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===i.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===i.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14}),n,e.createElement(ke,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",r," reviews)"))},Y=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},L.length>0&&L.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(wt,{small:Sm(t?.url),medium:Sm(t?.url),large:Sm(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(wt,{small:Sm(N??"")||Sm(L[g]?.url),medium:Sm(N??"")||Sm(L[g]?.url),large:Sm(N??"")||Sm(L[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},L.length>1&&L.filter(e=>e?.url?.length>0).map((n,r)=>e.createElement("img",{key:r,src:Sm(n?.url),alt:n.altText||`${I} - Image ${r+1}`,onClick:()=>f(r),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===r?`2px solid ${i.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),X=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},m?.title)),e.createElement("select",{className:`${t}-select`,value:m?.id||"",onChange:R,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}},c?.variants?.edges?.map(({node:t})=>!1===i.styles?.general?.showOutOfStockVariants&&0===d(t)?null:e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t),className:0===d(t)?"variant-out-of-stock":""},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(nt,null)))),K=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,r)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},z[r]||n.values[0])),e.createElement(Es,{options:M(n),selectedValue:W(n,r),onChange:e=>{V(r,e)},type:O(n.name),isOptionAvailable:e=>H(r,e),isMobile:t,showOutOfStockVariants:!1!==i.styles?.general?.showOutOfStockVariants}))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},i?.isFreebieTier&&!i.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:i.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,m?.compareAtPrice&&parseFloat(m.compareAtPrice)>parseFloat(m?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.price))))),ee=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:i.themeColor||"#111",borderRadius:i.cornerRadius,color:i.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:Q?.5:1,cursor:Q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),m?.id&&c&&(v("check"),i.handleAddToBundle(m?.id,c,1),setTimeout(()=>{v("idle"),s(void 0)},500))},disabled:Q},i.styles.byob.addToBundleCTAText??"Add to bundle")),te=e.createElement(ws,{className:"yt-byob-modal-desktop-overlay"},e.createElement(vs,{$isSmallScreen:y,ref:l},e.createElement(Cs,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(y?"small-screen":"large-screen")},e.createElement(bs,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(Y,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Z,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===i?.styles?.byob.variantSelectorType&&e.createElement(X,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===i?.styles?.byob.variantSelectorType&&e.createElement(K,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!1}),e.createElement(ee,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:P}})))))),ne=e.createElement(ws,{className:"yt-byob-modal-mobile-overlay"},e.createElement(vs,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:y,ref:l},e.createElement(Cs,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",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:()=>{s(void 0)}},e.createElement(tt,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(Y,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Z,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:P}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,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}},"customOptions"===i?.styles?.byob.variantSelectorType?e.createElement(K,{isMobile:!0}):e.createElement(X,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!0}),e.createElement(ee,{isMobile:!0})))));return D.createPortal(y?ne:te,document.body)}),Ss=({coverImageUrl:t,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(!t&&!n)return null;const c=t||n||"",s=i(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Ns=({title:t,isOpen:n,onToggle:r,children:o})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:r,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(Ve,{className:"yt-byob-icon-minus",size:20}):e.createElement(Le,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},o)),Bs=({availableFilters:n,appliedFilters:r,toggleFilter:o,clearAllFilters:a,applyPriceFilter:i,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:m,availableProductCount:u,products:g,unavailableProductCount:f,storeCurrencyCode:y,showActions:x=!0,openSections:h,toggleSection:b})=>{const[w,v]=t(null),C=Tm(m?.general?.currencySymbol)??y??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Ns,{key:t.id,title:t.label,isOpen:!!h[t.id],onToggle:()=>b(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const a=r[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?u??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:a,onChange:()=>o(t.id,n.id),style:{width:"18px",height:"18px",accentColor:m?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>v("min"),onTouchStart:()=>v("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===w?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>v("max"),onTouchStart:()=>v("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===w?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),x&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:a,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:i,style:{flex:1,padding:"8px",background:m?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Fs=t=>{const{showFiltersDrawer:n,handleClose:r,isAnimating:o,isMobile:a}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:o?1:0,transition:"opacity 300ms ease-in-out"},onClick:r},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:a?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:o?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Bs,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),r()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},zs=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Bs,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},$s=({enableSortAndFilter:r,isMobile:o,setSearchTerm:a,searchTerm:i,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:m,availableProductCount:u,unavailableProductCount:g,maxPossiblePrice:f,storeCurrencyCode:y,sharedFiltersState:x,openSections:b,toggleSection:w,sortBy:v})=>{const[C,E]=t(!1),[k,T]=t(i),{showFilters:S,setShowFilters:N,priceMax:B,setPriceMax:F,priceMin:z,setPriceMin:$}=x,[I,P]=t(!1),D=l?.byob?.productFiltersDisplay||"drawer",A=!o&&"sidebar"===D,_="none"===D;n(()=>{s["filter.v.price"]||(F(f),$(0))},[f,s]);n(()=>{const e=setTimeout(()=>{a(k)},300);return()=>clearTimeout(e)},[k,a]),n(()=>(S&&!A?(document.body.style.overflow="hidden",P(!0)):(document.body.style.overflow="",P(!1)),()=>{document.body.style.overflow=""}),[S,A]);const L=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?z>0||B<f?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:o?"column":"row",justifyContent:"space-between",alignItems:o?"flex-end":"center",marginBottom:"20px",width:"100%",gap:o?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:r?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},r&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:o?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},o&&!C?e.createElement(Re,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:o?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(Re,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),o&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>N(!S),style:{display:_?"none":"flex",alignItems:"center",gap:o?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Oe,{className:"yt-byob-filter-toggle-icon",size:18}),!o&&"Filters",L>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},L)),r&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!o&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),o&&e.createElement(Me,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:v,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(h,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Fs,{showFiltersDrawer:S,handleClose:()=>{A?N(!1):(document.body.style.overflow="",P(!1),setTimeout(()=>{N(!1)},300))},isAnimating:I,isMobile:o,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{F(f),$(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${z}-max:${B}`],t})},priceMin:z,setPriceMin:$,priceMax:B,setPriceMax:F,maxPossiblePrice:f,styles:l,availableProductCount:u,products:m,unavailableProductCount:g,storeCurrencyCode:y,openSections:b,toggleSection:w}))},Is=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Ps=({title:t,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="string"==typeof n?{url:n,name:"Attachment"}:n,l=i?.loading,c=i?.error,s=i?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{className:"yt-personalized-form-field-content",style:{flex:1,minWidth:0}},e.createElement("div",{className:"yt-personalized-form-field-title",style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!i&&!l&&!c&&e.createElement("div",{className:"yt-personalized-form-field-hint",style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{className:"yt-personalized-form-field-loading",style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(Is,null)," Uploading ",i?.name||"image","..."),c&&e.createElement("div",{className:"yt-personalized-form-field-error",style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),s&&!l&&!c&&e.createElement("div",{className:"yt-personalized-form-field-preview",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{className:"yt-personalized-form-field-preview-image",src:i.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{className:"yt-personalized-form-field-preview-name",style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i.name))),e.createElement("div",{className:"yt-personalized-form-field-actions",style:{flexShrink:0}},c&&e.createElement("button",{type:"button",className:"yt-personalized-form-retry-button",onClick:a,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),s&&!l&&!c&&e.createElement("button",{type:"button",className:"yt-personalized-form-remove-button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!i&&!l&&e.createElement("button",{type:"button",className:"yt-personalized-form-upload-button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},Ds=({form:r,formData:a,setFormData:i,barHeight:l=0,isUploading:c,setIsUploading:s})=>{const d=o(new Map),[p,m]=t(!1),u=s??m;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");i(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),u(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{u(!1)}})(n);i(r=>({...r,[e]:{url:t,name:n.name}}))}catch{i(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{className:"yt-personalized-form",style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},r.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-personalized-form-section",style:{marginBottom:"28px"}},e.createElement("label",{className:"yt-personalized-form-section-title",style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-personalized-form-text-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement("textarea",{key:r,className:"yt-personalized-form-textarea",placeholder:t?.title,rows:3,maxLength:500,value:a[r]||"",onChange:e=>i(t=>({...t,[r]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",{className:"yt-personalized-form-image-section"},e.createElement("div",{className:"yt-personalized-form-image-hint",style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{className:"yt-personalized-form-image-fields",style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement(Ps,{key:r,title:t?.title,uploadState:a[r],onUpload:()=>g(r).click(),onRemove:()=>i(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>g(r).click()})}))))))};function As({quantity:t,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={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=t<s;return e.createElement(Tc,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const r=Math.max(0,t-1);n(r),l&&a&&l(a,1)},style:d},"-"),e.createElement(Sc,{className:"yt-byob-quantity-display"},t," ",e.createElement("span",{className:"yt-byob-quantity-added-text",style:{paddingLeft:"4px"}}," ","added")),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(r,t+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const _s=({product:o,styles:a,selectedVariant:i})=>{const[l,c]=t(!1),s=r(()=>Sm(i?.image?.url||o?.featuredMedia?.preview?.image?.url||o?.media?.edges?.[0]?.node?.image?.url)||"",[i?.image?.url,o?.featuredMedia?.preview?.image?.url,o?.media?.edges]),d=r(()=>o?.media?.edges?.map(e=>Sm(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[o?.media?.edges]),p=r(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const m=r(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:a.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&m!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:m,alt:o.title}),m!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:o.title})))},Ls=({product:r,bundle:o,handleAddToBundle:i,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:m,selecteditems:u,customVariantsQuantity:g,currentProductTier:f,showFreebieTierProductPrices:y,tierIndex:x})=>{const b=ce(hs),w=o.customizations,v=w?.byob?.variantSelectorType,[C,E]=t(!1),k=w.general?.variantTitleSuffix?r?.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(" ")}}})})(r?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=a(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;const n=k?.find(t=>t.node.id===e),a=n?.node;return a?r.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?o?.customProductsQuantity??a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?.toLowerCase()?o?.customProductsQuantity??1/0:0:o?.customProductsQuantity??1/0:0},[k,g,r.tracksInventory]),S=k?.filter(e=>!1!==w.general.showOutOfStockVariants||T(e.node.id)>0);if(!S||!S.length)return e.createElement(e.Fragment,null);const N=S?.find(e=>T(e.node.id)>0)?.node?.id;if(!N&&!w.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[B,F]=t(S?.find(e=>T(e.node.id)>0)?.node?.id||S[0]?.node?.id),[z,$]=t(0),[I,P]=t(window.innerWidth<450),[D,A]=t("normal"),_=S?.find(e=>e?.node?.id===B)?.node,L=T(B||"");n(()=>{const e=u.find(e=>e.variantId===B&&(void 0===x||e.tierIndex===x));$(e?e.quantity:0)},[u,B,x]),n(()=>{const e=()=>{P(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?A("500"):CSS.supports("font-weight","400")?A("400"):CSS.supports("font-weight","600")&&A("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if(B&&!S?.some(e=>e.node.id===B)){const e=S.find(e=>T(e.node.id)>0)?.node.id||S[0]?.node?.id;e&&F(e)}},[B,S,T]);const R=r.variants&&r.variants.edges?.length>1&&"customOptions"!==v,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,M="53933408435"===O,V="75851235630"===O,W=(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[]})(r),H=W.length>0;return e.createElement(e.Fragment,null,e.createElement(Fc,{borderRadius:w?.byob.borderRadius,borderColor:w?.byob.borderColor,shadowType:w?.byob.shadowType,backgroundColor:w?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":m%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(w?.general?.redirectToPDP)return;if(L<=0)return;const e={...r,variants:{...r.variants,edges:S},selectedVariant:_};b(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:w?.byob?.productCardDetailsAlignment||"left"}},e.createElement(zc,{className:"yt-byob-image-wrapper",onClick:e=>{if(w?.general?.redirectToPDP&&r?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${r.handle}`}},style:{cursor:w?.general?.redirectToPDP?"pointer":"default"}},e.createElement(_s,{product:r,styles:w,selectedVariant:_}),o?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:w.byob.borderRadius}},o.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement($c,{className:"yt-byob-variant-selector",isCoralHaze:M,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:B||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),F(e.target.value)}},S?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id,className:0===T(t.node.id)?"variant-out-of-stock":""},r)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(h,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===o?.customizations?.byob?.productCardCategoryVisibility&&H&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"}},W.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:I?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),W.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",W.length-2," more"))),e.createElement(Ic,{isMobile:I,showBorder:o?.showBorder??!0,style:{...!w?.byob.productsPriceVisibility&&{padding:"8px"},...w?.byob.productTitleFontSize&&{fontSize:w?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:w?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},V?String(_?.displayName).replace("- Default Title",""):r.title,_?.commonSuffix?" -"+_?.commonSuffix:""))),"Default Title"!==_?.title&&w?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:o?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},_?.title),"ratingOnly"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14})," ",r?.rating?.averageRating,e.createElement(ke,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),w?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:o?.showBorder?"0px 10px":"0 4px"}},f?.isFreebieTier&&!y?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:w.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(_?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!f?.isFreebieTier||y)&&_?.compareAtPrice&&w?.byob.compareAtPriceVisibility&&parseFloat(_.compareAtPrice)>parseFloat(_?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_.compareAtPrice)))),(L>0||L===1/0)&&e.createElement(Pc,{borderRadius:w?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===z||void 0===z)&&e.createElement(Nc,{style:{...!l&&{backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),$(1),(()=>{if(!B)return;"customOptions"===v&&S.length>1?E(!0):i(B,r,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},w?.byob.addToBundleCTAText),!o?.disableQuantitySelector&&z>0&&B&&e.createElement(Bc,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(As,{remainingQuantity:c,setQuantity:$,quantity:z,handleAddToBundle:i,variantId:B,product:r,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:L})),o?.disableQuantitySelector&&z>0&&B&&e.createElement(Nc,{style:{backgroundColor:"#747474",color:w?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Dc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Ac,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,z-1);$(t),d&&B&&d(B,x)}},e.createElement(We,{style:{color:"#fff",fontSize:"20px"}})))),L<=0&&L!==1/0&&e.createElement(Nc,{style:{backgroundColor:w.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},w?.general.outOfStockLabel||"Out of Stock")),"customOptions"===v&&C&&S.length>1&&e.createElement(ks,{product:r,isOpen:C,onClose:()=>E(!1),variantOptions:o.variantOptions,cta:{textColor:w?.general?.ctaTextColor||"#fff",backgroundColor:w?.general?.ctaBackgroundColor||"#000"},onConfirm:e=>{F(e),i(e,r,1)},showOutOfStockVariants:!1!==w.general.showOutOfStockVariants}))},Rs=({currentStep:t,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,m=!o[d].isFormStep&&o[d].minimumQuantity-(i[d]?.length??0)===0,u=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?"white":m?`${l}50`:"white",border:`2px solid ${u?"#666666":m?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-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[t]?.title)),Os=({styles:t,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"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.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 e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(t.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.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=>e.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?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:o===r?t?.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:e=>{o!==r&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},Ms=({bundle:i,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:m,handleRemoveItem:u,bundleSubtotal:g,dispatchAnalyticsEvent:f,fetchStoreDetails:y,productsPagination:x,categoryFilters:h})=>{const[b,w]=t(void 0),[v,C]=t(window.innerWidth<450),[E,k]=t(0),[T,S]=t({}),N=!!i.personalizedForm?.title&&"productTier"===i.builderTiers?.type,[B,F]=t({}),[z,$]=t(!1),I=N&&E===(i.builderTiers?.productTier?.length||0),P=E===(i.builderTiers?.productTier?.length||0)-1,D=N&&P&&!I,[A,_]=t(i?.products),[L,R]=t(!1),[O,M]=t({}),[V,W]=t(20),H=o(null),[j,q]=t(i?.products),[U,Q]=t({}),[Z,G]=t(x?.cursorData),Y=i.builderTiers?.type,X=i.customizations,K=i.builderTiers?.productTier??[],J=i.builderTiers?.offerTier??[],[ee,te]=t("All"),ne=o(null),re=o(!0);n(()=>(re.current=!0,()=>{re.current=!1}),[]);const[oe,ae]=t({}),ie=o(void 0),le=o({appliedFilters:oe,currentProductTier:E,tierType:Y}),[ce,de]=t([]),[pe,me]=t(!1),[ue,ge]=t(0),[ye,xe]=t(0),[he,be]=t({}),we=e=>{be(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{ce.length>0&&be(e=>{const t={...e};return ce.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[ce]),n(()=>{!(Object.values(oe).length>0)&&x?.cursorData&&G(x.cursorData)},[oe,x?.cursorData]);const ve=i.customStoreDetails?.fixedInventoryDetails;n(()=>{X?.byob?.productFiltersDisplay&&"none"!==X?.byob?.productFiltersDisplay&&(async()=>{const e=X?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(y?.());e?.productFilters&&de(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[X?.byob,y]);const Ce=r(()=>{if(!h)return;const e=K[E]?.tier,t="productTier"===Y?e:1,n="object"!=typeof h||Array.isArray(h)||h.id?h:h[t];if(!n)return;const r=Array.isArray(n)?n.find(e=>"filter.p.m.categories"===e.id||"categories"===e.label):n;return r&&r.values?{...r,values:[...r.values].sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:"base",numeric:!0}))}:void 0},[h,E,K]),Ee=r(()=>{const e=(Ce?.values?.map(e=>e.label)??[])?.filter(e=>"All"!==e);return e},[Ce]),ke=Ee.length>0;n(()=>{ae({})},[E,ee]);const Te=((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}))(A.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,r="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&r}),ee),Se="productTier"===Y?K.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Y?J.reduce((e,t)=>e+t.minimumQuantity,0):i.minimumQuantity,Ne=a((e,t)=>{const n=ve?.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?.toLowerCase()?1/0:0:1/0:0},[ve]),[Be,Fe]=t(3e3);n(()=>{const e=ce?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Fe(e.values[0].input.price.max)},[A,ce]);const[ze,$e]=t(""),[Ie,Pe]=t(""),De=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(Te,ze),Ae=((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}}))(De,Ie);n(()=>{(async e=>{if(!x)return;const{initialCursorData:t,cursorData:n,fetchFn:r,setCursorData:o}=x,a="productTier"===Y?K?.[E]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Y?(M(e=>({...e,[E]:U?.[E]||[]})),o(Z||{...n})):(_(j),o(Z||{1:t?.[1]})));const i=await r(e,a,null);re.current&&i&&("productTier"===Y?(M(e=>({...e,[E]:i})),_(e=>{const t=new Set(e.map(e=>e.productId)),n=i.filter(e=>!t.has(e.productId));return[...e,...n]})):_(i))})(oe)},[oe]);const[_e,Le]=se(hs),[Re,Oe]=t(!1);n(()=>{f?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i?._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder"}}),setTimeout(()=>{Oe(!0)},100)},[]);const Me=o(null);n(()=>{const e=()=>{C(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(i.coverImageUrl){const e=new Image;e.src=Sm(i.coverImageUrl)??"",e.onload=()=>{w(e.width/e.height)}}},[i.coverImageUrl]),n(()=>{Oe(!1),setTimeout(()=>Oe(!0),100)},[E]);const Ve=(e,t)=>{if("productTier"===Y){let n={...T},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=K.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}S(n);const o=K.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&k(o)}u(e,t)},We=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(i){if("productTier"!==i?.builderTiers?.type)return _(i?.products??[]),void q(i?.products??[]);if(i?.workWithoutPagination){if("productTier"===i?.builderTiers?.type){const e={};i.builderTiers.productTier?.forEach((t,n)=>{const r=t.products.map(e=>{const t=i?.products?.find(t=>t.productId===e.productId);return t?{...t,variantIds:e.variantIds?.length?e.variantIds:t.variantIds}:null}).filter(Boolean);e[n]=r}),M(e),Q(e)}}else"productTier"===i?.builderTiers?.type&&(M({0:i?.products}),Q({0:i?.products}))}},[i]),n(()=>{if("productTier"!==Y||!K[E])return;if(Se===m)return;const e=K.findIndex((e,t)=>{const n=T[t]||[];return t>=E&&n.length<e.minimumQuantity});if(-1!==e&&e!==E){k(e);const t=K[E];t?.products?.length>1&&We()}else if(-1===e&&N&&E<K.length){K.every((e,t)=>(T[t]?.length||0)>=e.minimumQuantity)&&k(K.length)}},[T,K,Y,N]),n(()=>{$e(""),te("All")},[E]),n(()=>{function e(e){if(!Me.current||!e.target)return;!Me.current.contains(e.target)&&Le(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const He=(e,t,n)=>{var r;"productTier"===Y&&(r=e,S(e=>{const t={...e},n=K.findIndex((e,n)=>{const r=t[n]||[];return n>=E&&r.length<e.minimumQuantity}),o=-1!==n?n:E;return-1!==n&&k(n),t[o]||(t[o]=[]),t[o].push(r),t}));const o=!0===K[E]?.isFreebieTier;f?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Nm(e,t,n,l,c,o,E)},je=(()=>{if(!i?.builderTiers)return i.minimumQuantity;const{type:e,offerTier:t,productTier:n}=i.builderTiers,r="offerTier"===e?t:"productTier"===e?n:null;if(!r)return i.minimumQuantity;let o=0;return r.map(e=>{o+=e.minimumQuantity}),o})(),qe=v&&i.mobileCoverImageUrl?Sm(i.mobileCoverImageUrl):Sm(i.coverImageUrl??"")||null,Ue=a(e=>{const t=X?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,r=n?.variants?.edges||[];if(ve){if(r.some(e=>ve.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>Ne(n,e.node.id)>0)},[X?.general?.showOutOfStockProducts,ve,Ne]),Qe=r(()=>{if("productTier"===Y&&K.length>0){const e=O?.[E]??[];return Ie?Ae.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Ue(t)):e.map(e=>Ae.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Ue(e))}return Ae.filter(Ue)},[Y,K,O,E,Ae,Ue,Ie]),Ze=Qe;n(()=>{if("productTier"!==Y)return;const e=K[E];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==O?.[E]?.length)return;const t=e.products[0],n=A.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const r=n.variants?.edges?.find(e=>Ne(n,e.node.id)>0)?.node;if(!r)return;const o=r.id,a=T[E]?.includes(o);if(!a&&(He(o,n,1),E<K.length-(N?0:1))){k(E+1);const e=K?.[E];e?.products?.length>1&&We()}},[Y,K,E,A,T,Ne,He]);const Ge=r(()=>Te.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>Ne(t,e.node.id)>0)}).length,[Te,Ne]),Ye=r(()=>Te.length-Ge,[Te,Ge]),Xe="bundles"==i.appName?i.pageHeader?.title:i?.title,Ke="bundles"==i.appName?i.pageHeader?.description:i?.subtitle,Je=["6a3f98997a3afbbfa4241873","6a3bbae2bd8dcb5d8fa51920","6a33aedda23f4f475eabe035","6a3cfd33bce20f2427f4bd62"].includes(i._id),et=r(()=>{if(i?.workWithoutPagination)return!1;if(!Je)return!1;if(!x)return!1;const e="productTier"===Y?K[E]?.tier:1;if(void 0===e)return!1;const t=x.cursorData?.[e];return t?t.hasNext:L},[i?.workWithoutPagination,Je,x,Y,K,E,L]);n(()=>{if(i?.workWithoutPagination)return;if(Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Y?n:1;if(e?.[r]&&!e?.[r]?.hasNext||!t)return;const o=new IntersectionObserver(async([n])=>{if(n.isIntersecting&&!L){R(!0);try{const n=await t(oe,r,e?.[r]?.cursor);if(!re.current)return;if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Y?(M(e=>({...e,[E]:[...e[E]||[],...n]})),e||Q(e=>({...e,[E]:[...e[E]||[],...n]})),_(e=>[...e,...n])):(_(e=>[...e,...n]),e||q(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e)}finally{re.current&&R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),a=ne.current;return a&&o.observe(a),()=>{a&&o.unobserve(a)}},[i?.workWithoutPagination,x,L,Y,E,K]),n(()=>{if(i?.workWithoutPagination)return;if(!Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Y?n:1;if(!t)return;const o=le.current;(o.currentProductTier!==E||o.tierType!==Y||JSON.stringify(o.appliedFilters)!==JSON.stringify(oe))&&(ie.current=void 0,le.current={appliedFilters:oe,currentProductTier:E,tierType:Y});if(!(!e?.[r]||e[r].hasNext))return void R(!1);(async()=>{const n=e?.[r]?.cursor||null;if(ie.current!==n){ie.current=n,R(!0);try{const e=await t(oe,r,n);if(!re.current)return;if(e?.length>0){const t=Object.values(oe).length>0;"productTier"===Y?(M(t=>({...t,[E]:[...t[E]||[],...e]})),t||Q(t=>({...t,[E]:[...t[E]||[],...e]})),_(t=>[...t,...e])):(_(t=>[...t,...e]),t||q(t=>[...t,...e]))}}catch(e){console.error("Fetch all products pagination error:",e)}finally{re.current&&R(!1)}}})()},[i?.workWithoutPagination,Je,x,E,oe,Y]),n(()=>{if(!Je&&!i?.workWithoutPagination)return;if(et)return;if(!H.current)return;const e=new IntersectionObserver(([e])=>{e.isIntersecting&&V<Qe.length&&W(e=>Math.min(e+20,Qe.length))},{rootMargin:"200px"});return e.observe(H.current),()=>e.disconnect()},[Je,et,V,Qe.length]),n(()=>{W(20)},[E,Qe.length,Je,i?.workWithoutPagination]);const tt=()=>{f?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:X.byob.sectionBackgroundColor,..."transparent"!==X.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},qe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...i?.coverImageVerticalMargin&&{marginBottom:i?.coverImageVerticalMargin,marginTop:i?.coverImageVerticalMargin}}},qe&&e.createElement(Ss,{coverImageUrl:qe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",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)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:X?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},Xe),e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Ke))):(Xe||Ke)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},Xe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:X?.byob?.titleBackgroundColor??"transparent"}},Xe),Ke&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"}},Ke)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Y&&K.length>0&&X?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(Rs,{currentStep:E,totalSteps:K.length+(N?1:0),tiers:N?[...K,{title:i.personalizedForm?.title||"Personalize",tier:K.length,minimumQuantity:0,products:[],isFormStep:!0}]:K,isMobile:v,primaryColor:X?.general?.primaryColor,primaryTextColorCta:X?.general?.primaryContrastColor,setCurrentProductTier:k,selectedProductsByTier:T,tierNavigation:X.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===X?.byob?.productFiltersDisplay&&!v&&!I&&e.createElement(zs,{showFiltersDrawer:pe,handleClose:()=>me(!1),isAnimating:!1,isMobile:!1,availableFilters:ce,appliedFilters:oe,toggleFilter:(e,t)=>{ae(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{ae({}),xe(0),ge(Be)},applyPriceFilter:()=>{ae(e=>{const t={...e};return t["filter.v.price"]=[`min:${ye}-max:${ue}`],t})},priceMin:ye,setPriceMin:xe,priceMax:ue,setPriceMax:ge,maxPossiblePrice:Be,styles:X,products:A,unavailableProductCount:Ye,storeCurrencyCode:i?.storeCurrencyCode,openSections:he,toggleSection:we}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!I&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement($s,{enableSortAndFilter:i?.enableSortAndFilter??!1,isMobile:v,searchTerm:ze,setSearchTerm:$e,setSortBy:Pe,styles:X,appliedFilters:oe,setAppliedFilters:ae,availableFilters:ce,products:A,availableProductCount:Ge,unavailableProductCount:Ye,maxPossiblePrice:Be,storeCurrencyCode:i?.storeCurrencyCode,sharedFiltersState:{showFilters:pe,setShowFilters:me,priceMax:ue,setPriceMax:ge,priceMin:ye,setPriceMin:xe},openSections:he,toggleSection:we}),i?.customizations?.byob?.enableProductCategories&&ke&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(Os,{styles:X,isMobile:v,categories:Ee,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:X?.byob?.listingsGap||"12px",justifyContent:pe&&"sidebar"===X?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},I&&i.personalizedForm?.title?e.createElement(Ds,{form:i.personalizedForm,formData:B,setFormData:F,isUploading:z,setIsUploading:$}):0!==Ze?.length||L||et?(Je?Qe.slice(0,V):Qe).map((t,n)=>{if("productTier"===Y){const r=(K[E]?.minimumQuantity??0)>(T[E]?.length??0),o=Ae.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return o?e.createElement(Ls,{bundle:i,idx:n,key:t?.variantIds?.[0]??t.productId,product:o?.productDetails,handleAddToBundle:He,hideAddToBundle:!r,remainingQuantity:je-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>Ve(e,E),selecteditems:l,transitionActive:Re,customVariantsQuantity:ve,currentProductTier:K[E],showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:E}):null}return e.createElement(Ls,{bundle:i,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:He,hideAddToBundle:m>=je,remainingQuantity:je-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>u(e),selecteditems:l,transitionActive:Re,customVariantsQuantity:ve,tierIndex:E})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{ae({}),xe(0),ge(Be)},style:{padding:"8px 16px",background:X?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:X?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!I&&(L||et)&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(fe,{color:X?.general?.primaryColor||"#333",size:30})),!Je&&!i?.workWithoutPagination&&e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null)),(Je||i?.workWithoutPagination)&&!et&&e.createElement("div",{ref:H,className:"yt-byob-virtualFetchAll-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(xs,{builderTiers:i?.builderTiers,showNextStep:D,handleAddToCart:async e=>{if(D)return k(E+1),void We();const t={};N&&Object.entries(B).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await s(e,t),tt()},minimumQuantity:Se,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:Ve,selectedItemsQuantity:m,percentageOff:i.percentageOff,loading:d,bundleSubtotal:g,amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:i?.dealTextColor??"#333",primaryTextColorCta:i?.primaryTextColorCta??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:z}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(xs,{showNextStep:D,handleAddToCart:async e=>{if(D)return k(E+1),void We();const t={};N&&Object.entries(B).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await s(e,t),tt()},minimumQuantity:Se,builderTiers:i?.builderTiers,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:Ve,percentageOff:i.percentageOff,selectedItemsQuantity:m??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:X.general.primaryContrastColor??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:z})))),_e&&void 0!==m&&(()=>{let t=m<i.minimumQuantity;return"productTier"==Y?t=(K[E]?.minimumQuantity??0)>(T[E]?.length??0):"offerTier"==Y&&(t=m<J.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(Ts,{handleAddToBundle:He,ref:Me,remainingQuantity:i.minimumQuantity-m,hideAddToBundle:!t,disableQuantitySelector:i?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:T,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:i?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:X?.general.primaryColor||"#000",cornerRadius:i?.customizations.byob.borderRadius,styles:i.customizations,reviewRatingType:X?.fixedBundle?.productRatingsDisplay??i?.reviewRatingType,customVariantsQuantity:ve,bundleProductsCustomQuantity:i?.customProductsQuantity,isFreebieTier:K?.[E]?.isFreebieTier,showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:i?.variantOptions})})()))},Vs=({isOpen:r,onClose:o,formConfig:a,onCheckout:i,cta:l,isMobile:c})=>{const[s,d]=t({}),[p,m]=t(!1);n(()=>{r||d({})},[r]);const u=e=>{if(p)return;const t={};Object.entries(s).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),i(e?{}:t)};if(!r)return null;const g=e.createElement("div",{className:"yt-personalized-form-modal-overlay",onClick:o,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:c?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{className:"yt-personalized-form-modal",onClick:e=>e.stopPropagation(),style:{background:"white",width:c?"100vw":"500px",maxWidth:c?"100vw":"560px",height:c?"80vh":"auto",maxHeight:c?"80vh":"90vh",borderRadius:c?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:c?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{className:"yt-personalized-form-modal-header",style:{width:"100%",padding:c?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:c?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},a.title||"Personalization",!c&&e.createElement("button",{className:"yt-personalized-form-modal-close",onClick:o,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{className:"yt-personalized-form-modal-body",style:{flex:1,overflowY:"auto",padding:c?"20px 20px":"16px 20px"}},e.createElement(Ds,{form:a,formData:s,setFormData:d,isUploading:p,setIsUploading:m})),e.createElement("div",{className:"yt-personalized-form-modal-footer",style:{padding:c?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{className:"yt-personalized-form-submit-button",onClick:()=>{u(),o()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(fe,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{className:"yt-personalized-form-skip-button",onClick:()=>{u(!0),o()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return D.createPortal(g,document.body)},Ws=({product:t,selectedVariantId:n,onVariantChange:o,styles:a,originalPrice:i,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p,reviewRatingType:m})=>{const u=r(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),r=n?.node;return r?t?.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t?.productDetails]),g=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const f=r(()=>{if(g?.title&&t?.productDetails.options){const e=g.title.split(" / ");if(e.length===t?.productDetails.options.length)return e}return t?.productDetails.options?.map(e=>e.values[0])||[]},[g,t?.productDetails.options]),y=e=>{o(e)};return s?e.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"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},a.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Sm(g?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,onClick:e=>{if(a?.general?.redirectToPDP&&t?.productDetails?.handle){e.stopPropagation();const n=window?.Shopify?.routes?.root||"/";window.location.href=`${n}products/${t?.productDetails.handle}`}},style:{cursor:a?.general?.redirectToPDP?"pointer":"default",objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:a.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>y(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.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"}},e.createElement(h,null)))))),(a.comboBundle.subProductsProductTitleVisibility||a.comboBundle.subProductsProductPriceVisibility||m)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},Tm(a.general.currencySymbol),km((Number(g?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.compareAtPrice?g.compareAtPrice:g?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.price)))))):e.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"===a.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===a.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"}},a.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Sm(g?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,onClick:e=>{if(a?.general?.redirectToPDP&&t?.productDetails?.handle){e.stopPropagation();const n=window?.Shopify?.routes?.root||"/";window.location.href=`${n}products/${t?.productDetails.handle}`}},style:{cursor:a?.general?.redirectToPDP?"pointer":"default",objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:a?.general?.imageAspectRatio||"1 / 1",height:"100px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===a.comboBundle?.infoAlignment?"flex-start":"right"===a.comboBundle?.infoAlignment?"flex-end":"center"===a.comboBundle?.infoAlignment?"flex-start":void 0}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==a.comboBundle.comboVariantTypeSelector&&t?.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&f&&e.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"}},f.length>1?f.join(" / "):f)),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},Tm(a.general.currencySymbol),km((Number(g?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.compareAtPrice?g?.compareAtPrice:g?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.price)))),t?.productDetails.variants.edges.length>1&&("dropdown"===a.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>y(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t?.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.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"}},e.createElement(h,null))):t?.productDetails.options.length>0?e.createElement(e.Fragment,null,t?.productDetails.options.map((n,r)=>e.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"}},t?.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(o=>{const i=[...f];i[r]=o;const l=t?.productDetails.options.length>0?i.join(" / "):i[r],c=t?.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0);if(!1===a?.general?.showOutOfStockVariants&&s)return null;const p=f[r]===o,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===o)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===o)?.value}},e.createElement("span",null)):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):m&&"image"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===o)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Sm(m?.values.find(e=>e.name===o)?.value||"/placeholder.svg"),alt:o,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},o)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const r=0===u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&r?null:e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>y(t?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},t?.node?.title)}))))))},Hs=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:i})=>{const l=r(()=>{if(!o.products.some(e=>e.quantity&&e.quantity>1))return o;const e=o.products.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:e}},[o]),[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[m,u]=t(!1),g=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[f,y]=t(()=>{const e={};return l.products.forEach((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>g(t?.productDetails,e?.node?.id)>0)?.node;e[n]=r?r.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e}),x=l.products?.every((e,t)=>{const n=f[t];return g(e?.productDetails,n)>0});n(()=>(a&&(window.ytComboBundle={bundle:l,addToCart:a,selectedVariants:f},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}))}),[l,a,f]);const h=(e,t)=>{y(n=>({...n,[e]:t}))},b=async e=>{const t=Object.entries(f).map(([e])=>({id:l.products[parseInt(e)].productId,title:l.products[parseInt(e)]?.productDetails?.title}));i?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:l._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(s(!0),!a)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void s(!1);const t=Object.entries(f).map(([e,t])=>{const n=l.products[parseInt(e)],r=n?.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return r?{variantId:t,price:Number(r.price)}:null}).filter(e=>null!==e),n=Object.values(f);await a(Number(E),n,Number(k),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}s(!1)},w=l.customizations,v=w?.comboBundle?.discountBadgeDisplay||"discount-on-compare",C=w?.comboBundle?.discountBadgeVisibility,{originalPrice:E,dealPrice:k,offerValue:T,totalPriceSum:S,offerPercentage:N}=r(()=>{const{price:e,compareAtPrice:t}=Object.entries(f).reduce((e,[t,n])=>{const r=l.products[parseInt(t)],o=r?.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),n=!1===C?e:"discount-on-price"===v?e:t;let r=e;l?.percentageOff?r=e*(1-l.percentageOff/100):l?.dealAmount?r=l.dealAmount:l?.amountOff&&(r=e-l.amountOff);const o=n-r,a=n>0?Math.round((n-r)/n*100):0;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:o.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:a}},[f,l.products,l.percentageOff,l.dealAmount,l.amountOff,v,C]);n(()=>{i?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:l._id,bundleType:"combo-bundle"}});const e=()=>{p(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const B=w.comboBundle?.comboCardStyle||"auto",F="vertical"===B||"auto"===B&&!d,z=w.comboBundle?.embedContentVisibility,$="bundles"==l.appName?l.pageHeader?.title:l?.title,I="bundles"==l.appName?l.pageHeader?.description:l?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:w.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===w.comboBundle?.infoAlignment?"flex-start":"right"===w.comboBundle?.infoAlignment?"flex-end":"center"===w.comboBundle?.infoAlignment?"center":void 0,textAlign:w.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},z&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:w.comboBundle?.productTitleFontSize||"28px",color:w.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},$)),z&&w?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:w.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(w.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Tm(w.general.currencySymbol,l.storeCurrencyCode),km(k)),!isNaN(Number(E))&&!isNaN(Number(k))&&Number(E)>Number(k)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:w.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Tm(w.general.currencySymbol,l.storeCurrencyCode),km(E)),Number(T)>0&&!1!==C&&(()=>{const t="percentage"===(w?.comboBundle?.discountDisplayType||"amount")?`${N}% Off`:`Save ${Tm(w.general.currencySymbol,l.storeCurrencyCode)}${km(T)}`;return e.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"}},t)})())),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:w.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),w.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,F?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(d?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},l.products.map((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===f[n])?.node;return r?e.createElement(Ws,{key:`combo-product-${n}-${t.productId}`,product:t,styles:w,originalPrice:E,dealPrice:k,totalPriceSum:S,selectedVariantId:f[n],onVariantChange:e=>h(n,e),isVertical:F,variantOptions:l.variantOptions,storeCurrencyCode:l.storeCurrencyCode,reviewRatingType:w?.comboBundle?.comboProductRatingsDisplay}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(d?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},w.comboBundle.subProductsSectionVisibility&&l.products.map((t,n)=>e.createElement(Ws,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:w,originalPrice:E,dealPrice:k,totalPriceSum:S,selectedVariantId:f[n],onVariantChange:e=>h(n,e),variantOptions:l.variantOptions,reviewRatingType:w?.comboBundle?.comboProductRatingsDisplay})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${x?"":"yt-comboBundle-bundle-cta-button-disabled"} ${d?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:x?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor,color:w.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:w.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:x?"pointer":"not-allowed",border:`1px solid ${x?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor}`,boxShadow:w.general.ctaShadowType,padding:w.general?.ctaPadding,width:w.general?.ctaWidth,margin:"0"},disabled:!x,onMouseOver:e=>{w.general.customizeHoverState&&x&&(e.currentTarget.style.backgroundColor=w.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=w.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{w.general.customizeHoverState&&x&&(e.currentTarget.style.backgroundColor=w.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=w.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{l?.personalizedForm?.title?u(!0):await b()}},c?e.createElement(fe,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,x?w.comboBundle?.ctaTitle??"Add Bundle to cart":w.general.outOfStockLabel||"Out of Stock"," "))),z&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:w.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:w.general.primaryColor+"08"}},e.createElement("p",null,I))),l?.personalizedForm?.title&&e.createElement(Vs,{isOpen:m,onClose:()=>u(!1),formConfig:l.personalizedForm,onCheckout:async e=>{await b(e),u(!1)},cta:{backgroundColor:w.general?.ctaBackgroundColor||"#121212",textColor:w.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},js=s.div`
|
|
3119
|
+
`;const Es=({options:t,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i,showOutOfStockVariants:l=!0})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const i=!a||a(t.name);return l||i?e.createElement("div",{key:t.name,onClick:()=>{i&&r(t)},style:{cursor:i?"pointer":"not-allowed"}},((t,n)=>{const r=!a||a(t.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 t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"},className:r?"":"variant-out-of-stock"}):e.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"},className:r?"":"variant-out-of-stock"},t.name);return"image"===o?e.createElement("img",{src:Tn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"},className:r?"":"variant-out-of-stock"}):e.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"},className:r?"":"variant-out-of-stock"},t.name)})(t,n?.name===t.name)):null})),ks=({product:o,isOpen:a,onClose:i,variantOptions:l,cta:c,onConfirm:s,showOutOfStockVariants:d=!0})=>{const p=r(()=>e=>e?o?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[o?.tracksInventory]),m=r(()=>{const e=o.variants.edges.find(e=>{const t=e.node;return p(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):o.options?.map(e=>e.values[0])||[]},[o,p]),[u,g]=t(m),[f,y]=t(window.innerWidth<1024);n(()=>{const e=()=>y(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&i()};return a&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[a,i]);const x=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||o.featuredMedia?.preview?.image?.url,b=Tn(h,150,85,"webp"),w=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.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 v(e).find(e=>e.name===n)||null};if(!a)return null;const E=e.createElement("div",{onClick:i,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"},e.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"}}},e.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"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:o.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},o.title))),e.createElement("div",{style:{padding:"20px"}},o.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(t,n)?.name||t.values[0])),e.createElement(Es,{options:v(t),selectedValue:C(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,g(n)})(n,e)},type:w(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const r=o.options?.length>0?n.join(" / "):n[0],a=o.variants.edges.find(e=>e.node.title===r)?.node;return!!a&&p(a)>0})(n,e),isMobile:f,showOutOfStockVariants:d}))))),e.createElement("button",{onClick:()=>{const e=o.variants.edges.find(e=>e.node.title===(o.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&p(e)>0;if(e?.id&&t)s(e.id),i();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=o.variants.edges.find(e=>p(e.node)>0)?.node.id;e&&(s(e),i())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.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 D.createPortal(E,document.body)},Ts=l((i,l)=>{const[c,s]=se(hs),d=r(()=>e=>{const t=i?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?i?.bundleProductsCustomQuantity??e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?i?.bundleProductsCustomQuantity??1/0:0:i?.bundleProductsCustomQuantity??1/0:0},[c?.tracksInventory,i?.customVariantsQuantity,i?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[m,u]=t(p?.[0]?.node),[g,f]=t(0),[y,x]=t("undefined"!=typeof window&&window.innerWidth<=600),[h,b]=t(1),[w,v]=t("idle"),C=o(null),E=o(null),k=o(!1),[T,S]=t(0),[N,B]=t(),F=r(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[z,$]=t(F);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;u(t),t?.title&&"Default Title"!==t.title&&$(t.title.split(" / "))}},[c,d]),n(()=>{const e=i.selectedProducts.find(e=>e.variantId===m?.id);b(e?e.quantity:0)},[h,i.selectedProducts,m]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>x(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:P,media:A,variants:_}=c,L=A.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),R=a(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,u(n),B(n?.image?.url),n.title&&"Default Title"!==n.title&&$(n.title.split(" / ")))},[p,d]),O=a(e=>{if(!i.bundleVariantOptions?.options)return"text";const t=i.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[i.bundleVariantOptions]),M=a(e=>{if(!i?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=i?.bundleVariantOptions?.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}})},[i.bundleVariantOptions]),V=a((e,t)=>{const n=[...z];n[e]=t.name,$(n);const r=c?.options?.length>0?n.join(" / "):n[0],o=c?.variants.edges.find(e=>e.node.title===r)?.node;B(o?.image?.url),o&&d(o)>0&&(k.current=!0,u(o))},[z,c,d]),W=a((e,t)=>{const n=z[t];if(!n)return null;return M(e).find(e=>e.name===n)||null},[z,M]),H=a((e,t)=>{const n=[...z];n[e]=t;const r=c?.options?.length>0?n.join(" / "):n[0],o=c?.variants.edges.find(e=>e.node.title===r)?.node;return!!o&&d(o)>0},[z,c,d]);n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(y&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[y,c]);const j=i.selectedProducts.filter(e=>e.variantId===m?.id).reduce((e,t)=>e+t.quantity,0),q=i.customVariantsQuantity?.find(e=>e.variantId===m?.id)?.quantity??i.bundleProductsCustomQuantity??1/0,U=q!==1/0&&j>=q,Q=i.hideAddToBundle||!m||d(m)<=0||U||"idle"!==w||i?.disableQuantitySelector&&1===h,Z=({className:t})=>{const n=c?.rating?.averageRating??i?.rating?.averageRating??0,r=c?.rating?.ratingCount??i?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===i.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===i.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14}),n,e.createElement(ke,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",r," reviews)"))},Y=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},L.length>0&&L.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(wt,{small:Sm(t?.url),medium:Sm(t?.url),large:Sm(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(wt,{small:Sm(N??"")||Sm(L[g]?.url),medium:Sm(N??"")||Sm(L[g]?.url),large:Sm(N??"")||Sm(L[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},L.length>1&&L.filter(e=>e?.url?.length>0).map((n,r)=>e.createElement("img",{key:r,src:Sm(n?.url),alt:n.altText||`${I} - Image ${r+1}`,onClick:()=>f(r),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===r?`2px solid ${i.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),X=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},m?.title)),e.createElement("select",{className:`${t}-select`,value:m?.id||"",onChange:R,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}},c?.variants?.edges?.map(({node:t})=>!1===i.styles?.general?.showOutOfStockVariants&&0===d(t)?null:e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t),className:0===d(t)?"variant-out-of-stock":""},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(nt,null)))),K=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,r)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},z[r]||n.values[0])),e.createElement(Es,{options:M(n),selectedValue:W(n,r),onChange:e=>{V(r,e)},type:O(n.name),isOptionAvailable:e=>H(r,e),isMobile:t,showOutOfStockVariants:!1!==i.styles?.general?.showOutOfStockVariants}))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},i?.isFreebieTier&&!i.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:i.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,m?.compareAtPrice&&parseFloat(m.compareAtPrice)>parseFloat(m?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Tm(i.styles.general.currencySymbol,i.styles.general.currencySymbol),km(m?.price))))),ee=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:i.themeColor||"#111",borderRadius:i.cornerRadius,color:i.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:Q?.5:1,cursor:Q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),m?.id&&c&&(v("check"),i.handleAddToBundle(m?.id,c,1),setTimeout(()=>{v("idle"),s(void 0)},500))},disabled:Q},i.styles.byob.addToBundleCTAText??"Add to bundle")),te=e.createElement(ws,{className:"yt-byob-modal-desktop-overlay"},e.createElement(vs,{$isSmallScreen:y,ref:l},e.createElement(Cs,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(y?"small-screen":"large-screen")},e.createElement(bs,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(Y,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Z,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===i?.styles?.byob.variantSelectorType&&e.createElement(X,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===i?.styles?.byob.variantSelectorType&&e.createElement(K,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!1}),e.createElement(ee,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:P}})))))),ne=e.createElement(ws,{className:"yt-byob-modal-mobile-overlay"},e.createElement(vs,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:y,ref:l},e.createElement(Cs,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",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:()=>{s(void 0)}},e.createElement(tt,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(Y,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===i?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Z,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:P}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,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}},"customOptions"===i?.styles?.byob.variantSelectorType?e.createElement(K,{isMobile:!0}):e.createElement(X,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!0}),e.createElement(ee,{isMobile:!0})))));return D.createPortal(y?ne:te,document.body)}),Ss=({coverImageUrl:t,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(!t&&!n)return null;const c=t||n||"",s=i(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Ns=({title:t,isOpen:n,onToggle:r,children:o})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:r,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(Ve,{className:"yt-byob-icon-minus",size:20}):e.createElement(Le,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},o)),Bs=({availableFilters:n,appliedFilters:r,toggleFilter:o,clearAllFilters:a,applyPriceFilter:i,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:m,availableProductCount:u,products:g,unavailableProductCount:f,storeCurrencyCode:y,showActions:x=!0,openSections:h,toggleSection:b})=>{const[w,v]=t(null),C=Tm(m?.general?.currencySymbol)??y??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Ns,{key:t.id,title:t.label,isOpen:!!h[t.id],onToggle:()=>b(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const a=r[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?u??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:a,onChange:()=>o(t.id,n.id),style:{width:"18px",height:"18px",accentColor:m?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>v("min"),onTouchStart:()=>v("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===w?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>v("max"),onTouchStart:()=>v("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===w?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),x&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:a,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:i,style:{flex:1,padding:"8px",background:m?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:m?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Fs=t=>{const{showFiltersDrawer:n,handleClose:r,isAnimating:o,isMobile:a}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:o?1:0,transition:"opacity 300ms ease-in-out"},onClick:r},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:a?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:o?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Bs,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),r()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},zs=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Bs,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},$s=({enableSortAndFilter:r,isMobile:o,setSearchTerm:a,searchTerm:i,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:m,availableProductCount:u,unavailableProductCount:g,maxPossiblePrice:f,storeCurrencyCode:y,sharedFiltersState:x,openSections:b,toggleSection:w,sortBy:v})=>{const[C,E]=t(!1),[k,T]=t(i),{showFilters:S,setShowFilters:N,priceMax:B,setPriceMax:F,priceMin:z,setPriceMin:$}=x,[I,P]=t(!1),D=l?.byob?.productFiltersDisplay||"drawer",A=!o&&"sidebar"===D,_="none"===D;n(()=>{s["filter.v.price"]||(F(f),$(0))},[f,s]);n(()=>{const e=setTimeout(()=>{a(k)},300);return()=>clearTimeout(e)},[k,a]),n(()=>(S&&!A?(document.body.style.overflow="hidden",P(!0)):(document.body.style.overflow="",P(!1)),()=>{document.body.style.overflow=""}),[S,A]);const L=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?z>0||B<f?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:o?"column":"row",justifyContent:"space-between",alignItems:o?"flex-end":"center",marginBottom:"20px",width:"100%",gap:o?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:r?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},r&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:o?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},o&&!C?e.createElement(Re,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:o?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(Re,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),o&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>N(!S),style:{display:_?"none":"flex",alignItems:"center",gap:o?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Oe,{className:"yt-byob-filter-toggle-icon",size:18}),!o&&"Filters",L>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},L)),r&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!o&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),o&&e.createElement(Me,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:v,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(h,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Fs,{showFiltersDrawer:S,handleClose:()=>{A?N(!1):(document.body.style.overflow="",P(!1),setTimeout(()=>{N(!1)},300))},isAnimating:I,isMobile:o,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{F(f),$(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${z}-max:${B}`],t})},priceMin:z,setPriceMin:$,priceMax:B,setPriceMax:F,maxPossiblePrice:f,styles:l,availableProductCount:u,products:m,unavailableProductCount:g,storeCurrencyCode:y,openSections:b,toggleSection:w}))},Is=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Ps=({title:t,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="string"==typeof n?{url:n,name:"Attachment"}:n,l=i?.loading,c=i?.error,s=i?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{className:"yt-personalized-form-field-content",style:{flex:1,minWidth:0}},e.createElement("div",{className:"yt-personalized-form-field-title",style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!i&&!l&&!c&&e.createElement("div",{className:"yt-personalized-form-field-hint",style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{className:"yt-personalized-form-field-loading",style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(Is,null)," Uploading ",i?.name||"image","..."),c&&e.createElement("div",{className:"yt-personalized-form-field-error",style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),s&&!l&&!c&&e.createElement("div",{className:"yt-personalized-form-field-preview",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{className:"yt-personalized-form-field-preview-image",src:i.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{className:"yt-personalized-form-field-preview-name",style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},i.name))),e.createElement("div",{className:"yt-personalized-form-field-actions",style:{flexShrink:0}},c&&e.createElement("button",{type:"button",className:"yt-personalized-form-retry-button",onClick:a,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),s&&!l&&!c&&e.createElement("button",{type:"button",className:"yt-personalized-form-remove-button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!i&&!l&&e.createElement("button",{type:"button",className:"yt-personalized-form-upload-button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},Ds=({form:r,formData:a,setFormData:i,barHeight:l=0,isUploading:c,setIsUploading:s})=>{const d=o(new Map),[p,m]=t(!1),u=s??m;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");i(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),u(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{u(!1)}})(n);i(r=>({...r,[e]:{url:t,name:n.name}}))}catch{i(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{className:"yt-personalized-form",style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},r.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-personalized-form-section",style:{marginBottom:"28px"}},e.createElement("label",{className:"yt-personalized-form-section-title",style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-personalized-form-text-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement("textarea",{key:r,className:"yt-personalized-form-textarea",placeholder:t?.title,rows:3,maxLength:500,value:a[r]||"",onChange:e=>i(t=>({...t,[r]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",{className:"yt-personalized-form-image-section"},e.createElement("div",{className:"yt-personalized-form-image-hint",style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{className:"yt-personalized-form-image-fields",style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const r=t?.title??"Field "+n;return e.createElement(Ps,{key:r,title:t?.title,uploadState:a[r],onUpload:()=>g(r).click(),onRemove:()=>i(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>g(r).click()})}))))))};function As({quantity:t,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={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=t<s;return e.createElement(Tc,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const r=Math.max(0,t-1);n(r),l&&a&&l(a,1)},style:d},"-"),e.createElement(Sc,{className:"yt-byob-quantity-display"},t," ",e.createElement("span",{className:"yt-byob-quantity-added-text",style:{paddingLeft:"4px"}}," ","added")),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(r,t+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const _s=({product:o,styles:a,selectedVariant:i})=>{const[l,c]=t(!1),s=r(()=>Sm(i?.image?.url||o?.featuredMedia?.preview?.image?.url||o?.media?.edges?.[0]?.node?.image?.url)||"",[i?.image?.url,o?.featuredMedia?.preview?.image?.url,o?.media?.edges]),d=r(()=>o?.media?.edges?.map(e=>Sm(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[o?.media?.edges]),p=r(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const m=r(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:a.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&m!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:m,alt:o.title}),m!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:o.title})))},Ls=({product:r,bundle:o,handleAddToBundle:i,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:m,selecteditems:u,customVariantsQuantity:g,currentProductTier:f,showFreebieTierProductPrices:y,tierIndex:x})=>{const b=ce(hs),w=o.customizations,v=w?.byob?.variantSelectorType,[C,E]=t(!1),k=w.general?.variantTitleSuffix?r?.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(" ")}}})})(r?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=a(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;const n=k?.find(t=>t.node.id===e),a=n?.node;return a?r.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?o?.customProductsQuantity??a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?.toLowerCase()?o?.customProductsQuantity??1/0:0:o?.customProductsQuantity??1/0:0},[k,g,r.tracksInventory]),S=k?.filter(e=>!1!==w.general.showOutOfStockVariants||T(e.node.id)>0);if(!S||!S.length)return e.createElement(e.Fragment,null);const N=S?.find(e=>T(e.node.id)>0)?.node?.id;if(!N&&!w.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[B,F]=t(S?.find(e=>T(e.node.id)>0)?.node?.id||S[0]?.node?.id),[z,$]=t(0),[I,P]=t(window.innerWidth<450),[D,A]=t("normal"),_=S?.find(e=>e?.node?.id===B)?.node,L=T(B||"");n(()=>{const e=u.find(e=>e.variantId===B&&(void 0===x||e.tierIndex===x));$(e?e.quantity:0)},[u,B,x]),n(()=>{const e=()=>{P(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?A("500"):CSS.supports("font-weight","400")?A("400"):CSS.supports("font-weight","600")&&A("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if(B&&!S?.some(e=>e.node.id===B)){const e=S.find(e=>T(e.node.id)>0)?.node.id||S[0]?.node?.id;e&&F(e)}},[B,S,T]);const R=r.variants&&r.variants.edges?.length>1&&"customOptions"!==v,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,M="53933408435"===O,V="75851235630"===O,W=(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[]})(r),H=W.length>0;return e.createElement(e.Fragment,null,e.createElement(Fc,{borderRadius:w?.byob.borderRadius,borderColor:w?.byob.borderColor,shadowType:w?.byob.shadowType,backgroundColor:w?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":m%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(w?.general?.redirectToPDP)return;if(L<=0)return;const e={...r,variants:{...r.variants,edges:S},selectedVariant:_};b(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:w?.byob?.productCardDetailsAlignment||"left"}},e.createElement(zc,{className:"yt-byob-image-wrapper",onClick:e=>{if(w?.general?.redirectToPDP&&r?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${r.handle}`}},style:{cursor:w?.general?.redirectToPDP?"pointer":"default"}},e.createElement(_s,{product:r,styles:w,selectedVariant:_}),o?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:w.byob.borderRadius}},o.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement($c,{className:"yt-byob-variant-selector",isCoralHaze:M,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:B||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),F(e.target.value)}},S?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id,className:0===T(t.node.id)?"variant-out-of-stock":""},r)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(h,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===o?.customizations?.byob?.productCardCategoryVisibility&&H&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start"}},W.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:I?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),W.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",W.length-2," more"))),e.createElement(Ic,{isMobile:I,showBorder:o?.showBorder??!0,style:{...!w?.byob.productsPriceVisibility&&{padding:"8px"},...w?.byob.productTitleFontSize&&{fontSize:w?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:w?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},V?String(_?.displayName).replace("- Default Title",""):r.title,_?.commonSuffix?" -"+_?.commonSuffix:""))),"Default Title"!==_?.title&&w?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:o?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},_?.title),"ratingOnly"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===(w?.byob?.productRatingsDisplay??o?.reviewRatingType)&&(r?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"center"===w?.byob?.productCardDetailsAlignment?"center":"right"===w?.byob?.productCardDetailsAlignment?"flex-end":"flex-start",fontSize:"14px",color:"#333"}},e.createElement($e,{color:"gold",size:14})," ",r?.rating?.averageRating,e.createElement(ke,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),w?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:o?.showBorder?"0px 10px":"0 4px"}},f?.isFreebieTier&&!y?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:w.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(_?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!f?.isFreebieTier||y)&&_?.compareAtPrice&&w?.byob.compareAtPriceVisibility&&parseFloat(_.compareAtPrice)>parseFloat(_?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Tm(w.general.currencySymbol,o?.storeCurrencyCode)??"Rs.",km(_.compareAtPrice)))),(L>0||L===1/0)&&e.createElement(Pc,{borderRadius:w?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===z||void 0===z)&&e.createElement(Nc,{style:{...!l&&{backgroundColor:w?.general.primaryColor||"#111",color:w?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),$(1),(()=>{if(!B)return;"customOptions"===v&&S.length>1?E(!0):i(B,r,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},w?.byob.addToBundleCTAText),!o?.disableQuantitySelector&&z>0&&B&&e.createElement(Bc,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(As,{remainingQuantity:c,setQuantity:$,quantity:z,handleAddToBundle:i,variantId:B,product:r,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:L})),o?.disableQuantitySelector&&z>0&&B&&e.createElement(Nc,{style:{backgroundColor:"#747474",color:w?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Dc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Ac,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,z-1);$(t),d&&B&&d(B,x)}},e.createElement(We,{style:{color:"#fff",fontSize:"20px"}})))),L<=0&&L!==1/0&&e.createElement(Nc,{style:{backgroundColor:w.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},w?.general.outOfStockLabel||"Out of Stock")),"customOptions"===v&&C&&S.length>1&&e.createElement(ks,{product:r,isOpen:C,onClose:()=>E(!1),variantOptions:o.variantOptions,cta:{textColor:w?.general?.ctaTextColor||"#fff",backgroundColor:w?.general?.ctaBackgroundColor||"#000"},onConfirm:e=>{F(e),i(e,r,1)},showOutOfStockVariants:!1!==w.general.showOutOfStockVariants}))},Rs=({currentStep:t,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,m=!o[d].isFormStep&&o[d].minimumQuantity-(i[d]?.length??0)===0,u=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?"white":m?`${l}50`:"white",border:`2px solid ${u?"#666666":m?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?"#666666":m?l:"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-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[t]?.title)),Os=({styles:t,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"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.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 e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(t.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.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=>e.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?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:o===r?t?.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:e=>{o!==r&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},Ms=({bundle:i,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:m,handleRemoveItem:u,bundleSubtotal:g,dispatchAnalyticsEvent:f,fetchStoreDetails:y,productsPagination:x,categoryFilters:h})=>{const[b,w]=t(void 0),[v,C]=t(window.innerWidth<450),[E,k]=t(0),[T,S]=t({}),N=!!i.personalizedForm?.title&&"productTier"===i.builderTiers?.type,[B,F]=t({}),[z,$]=t(!1),I=N&&E===(i.builderTiers?.productTier?.length||0),P=E===(i.builderTiers?.productTier?.length||0)-1,D=N&&P&&!I,[A,_]=t(i?.products),[L,R]=t(!1),[O,M]=t({}),[V,W]=t(20),H=o(null),[j,q]=t(i?.products),[U,Q]=t({}),[Z,G]=t(x?.cursorData),Y=i.builderTiers?.type,X=i.customizations,K=i.builderTiers?.productTier??[],J=i.builderTiers?.offerTier??[],[ee,te]=t("All"),ne=o(null),re=o(!0);n(()=>(re.current=!0,()=>{re.current=!1}),[]);const[oe,ae]=t({}),ie=o(void 0),le=o({appliedFilters:oe,currentProductTier:E,tierType:Y}),[ce,de]=t([]),[pe,me]=t(!1),[ue,ge]=t(0),[ye,xe]=t(0),[he,be]=t({}),we=e=>{be(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{ce.length>0&&be(e=>{const t={...e};return ce.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[ce]),n(()=>{!(Object.values(oe).length>0)&&x?.cursorData&&G(x.cursorData)},[oe,x?.cursorData]);const ve=i.customStoreDetails?.fixedInventoryDetails;n(()=>{X?.byob?.productFiltersDisplay&&"none"!==X?.byob?.productFiltersDisplay&&(async()=>{const e=X?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(y?.());e?.productFilters&&de(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[X?.byob,y]);const Ce=r(()=>{if(!h)return;const e=K[E]?.tier,t="productTier"===Y?e:1,n="object"!=typeof h||Array.isArray(h)||h.id?h:h[t];if(!n)return;const r=Array.isArray(n)?n.find(e=>"filter.p.m.categories"===e.id||"categories"===e.label):n;return r&&r.values?{...r,values:[...r.values].sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:"base",numeric:!0}))}:void 0},[h,E,K]),Ee=r(()=>{const e=(Ce?.values?.map(e=>e.label)??[])?.filter(e=>"All"!==e);return e},[Ce]),ke=Ee.length>0;n(()=>{ae({})},[E,ee]);const Te=((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}))(A.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,r="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&r}),ee),Se="productTier"===Y?K.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Y?J.reduce((e,t)=>e+t.minimumQuantity,0):i.minimumQuantity,Ne=a((e,t)=>{const n=ve?.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?.toLowerCase()?1/0:0:1/0:0},[ve]),[Be,Fe]=t(3e3);n(()=>{const e=ce?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Fe(e.values[0].input.price.max)},[A,ce]);const[ze,$e]=t(""),[Ie,Pe]=t(""),De=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(Te,ze),Ae=((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}}))(De,Ie);n(()=>{(async e=>{if(!x)return;const{initialCursorData:t,cursorData:n,fetchFn:r,setCursorData:o}=x,a="productTier"===Y?K?.[E]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Y?(M(e=>({...e,[E]:U?.[E]||[]})),o(Z||{...n})):(_(j),o(Z||{1:t?.[1]})));const i=await r(e,a,null);re.current&&i&&("productTier"===Y?(M(e=>({...e,[E]:i})),_(e=>{const t=new Set(e.map(e=>e.productId)),n=i.filter(e=>!t.has(e.productId));return[...e,...n]})):_(i))})(oe)},[oe]);const[_e,Le]=se(hs),[Re,Oe]=t(!1);n(()=>{f?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i?._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder"}}),setTimeout(()=>{Oe(!0)},100)},[]);const Me=o(null);n(()=>{const e=()=>{C(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(i.coverImageUrl){const e=new Image;e.src=Sm(i.coverImageUrl)??"",e.onload=()=>{w(e.width/e.height)}}},[i.coverImageUrl]),n(()=>{Oe(!1),setTimeout(()=>Oe(!0),100)},[E]);const Ve=(e,t)=>{if("productTier"===Y){let n={...T},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=K.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}S(n);const o=K.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&k(o)}u(e,t)},We=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(i){if("productTier"!==i?.builderTiers?.type)return _(i?.products??[]),void q(i?.products??[]);if(i?.workWithoutPagination){if("productTier"===i?.builderTiers?.type){const e={};i.builderTiers.productTier?.forEach((t,n)=>{const r=t.products.map(e=>{const t=i?.products?.find(t=>t.productId===e.productId);return t?{...t,variantIds:e.variantIds?.length?e.variantIds:t.variantIds}:null}).filter(Boolean);e[n]=r}),M(e),Q(e)}}else"productTier"===i?.builderTiers?.type&&(M({0:i?.products}),Q({0:i?.products}))}},[i]),n(()=>{if("productTier"!==Y||!K[E])return;if(Se===m)return;const e=K.findIndex((e,t)=>{const n=T[t]||[];return t>=E&&n.length<e.minimumQuantity});if(-1!==e&&e!==E){k(e);const t=K[E];t?.products?.length>1&&We()}else if(-1===e&&N&&E<K.length){K.every((e,t)=>(T[t]?.length||0)>=e.minimumQuantity)&&k(K.length)}},[T,K,Y,N]),n(()=>{$e(""),te("All")},[E]),n(()=>{function e(e){if(!Me.current||!e.target)return;!Me.current.contains(e.target)&&Le(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const He=(e,t,n)=>{var r;"productTier"===Y&&(r=e,S(e=>{const t={...e},n=K.findIndex((e,n)=>{const r=t[n]||[];return n>=E&&r.length<e.minimumQuantity}),o=-1!==n?n:E;return-1!==n&&k(n),t[o]||(t[o]=[]),t[o].push(r),t}));const o=!0===K[E]?.isFreebieTier;f?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Nm(e,t,n,l,c,o,E)},je=(()=>{if(!i?.builderTiers)return i.minimumQuantity;const{type:e,offerTier:t,productTier:n}=i.builderTiers,r="offerTier"===e?t:"productTier"===e?n:null;if(!r)return i.minimumQuantity;let o=0;return r.map(e=>{o+=e.minimumQuantity}),o})(),qe=v&&i.mobileCoverImageUrl?Sm(i.mobileCoverImageUrl):Sm(i.coverImageUrl??"")||null,Ue=a(e=>{const t=X?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,r=n?.variants?.edges||[];if(ve){if(r.some(e=>ve.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>Ne(n,e.node.id)>0)},[X?.general?.showOutOfStockProducts,ve,Ne]),Qe=r(()=>{if("productTier"===Y&&K.length>0){const e=O?.[E]??[];return Ie?Ae.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Ue(t)):e.map(e=>Ae.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Ue(e))}return Ae.filter(Ue)},[Y,K,O,E,Ae,Ue,Ie]),Ze=Qe;n(()=>{if("productTier"!==Y)return;const e=K[E];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==O?.[E]?.length)return;const t=e.products[0],n=A.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const r=n.variants?.edges?.find(e=>Ne(n,e.node.id)>0)?.node;if(!r)return;const o=r.id,a=T[E]?.includes(o);if(!a&&(He(o,n,1),E<K.length-(N?0:1))){k(E+1);const e=K?.[E];e?.products?.length>1&&We()}},[Y,K,E,A,T,Ne,He]);const Ge=r(()=>Te.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>Ne(t,e.node.id)>0)}).length,[Te,Ne]),Ye=r(()=>Te.length-Ge,[Te,Ge]),Xe="bundles"==i.appName?i.pageHeader?.title:i?.title,Ke="bundles"==i.appName?i.pageHeader?.description:i?.subtitle,Je=["6a3f98997a3afbbfa4241873","6a3bbae2bd8dcb5d8fa51920","6a33aedda23f4f475eabe035","6a3cfd33bce20f2427f4bd62"].includes(i._id),et=r(()=>{if(i?.workWithoutPagination)return!1;if(!Je)return!1;if(!x)return!1;const e="productTier"===Y?K[E]?.tier:1;if(void 0===e)return!1;const t=x.cursorData?.[e];return t?t.hasNext:L},[i?.workWithoutPagination,Je,x,Y,K,E,L]);n(()=>{if(i?.workWithoutPagination)return;if(Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Y?n:1;if(e?.[r]&&!e?.[r]?.hasNext||!t)return;const o=new IntersectionObserver(async([n])=>{if(n.isIntersecting&&!L){R(!0);try{const n=await t(oe,r,e?.[r]?.cursor);if(!re.current)return;if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Y?(M(e=>({...e,[E]:[...e[E]||[],...n]})),e||Q(e=>({...e,[E]:[...e[E]||[],...n]})),_(e=>[...e,...n])):(_(e=>[...e,...n]),e||q(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e)}finally{re.current&&R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),a=ne.current;return a&&o.observe(a),()=>{a&&o.unobserve(a)}},[i?.workWithoutPagination,x,L,Y,E,K]),n(()=>{if(i?.workWithoutPagination)return;if(!Je)return;if(!x)return;const{cursorData:e,fetchFn:t}=x,n=K[E]?.tier,r="productTier"===Y?n:1;if(!t)return;const o=le.current;(o.currentProductTier!==E||o.tierType!==Y||JSON.stringify(o.appliedFilters)!==JSON.stringify(oe))&&(ie.current=void 0,le.current={appliedFilters:oe,currentProductTier:E,tierType:Y});if(!(!e?.[r]||e[r].hasNext))return void R(!1);(async()=>{const n=e?.[r]?.cursor||null;if(ie.current!==n){ie.current=n,R(!0);try{const e=await t(oe,r,n);if(!re.current)return;if(e?.length>0){const t=Object.values(oe).length>0;"productTier"===Y?(M(t=>({...t,[E]:[...t[E]||[],...e]})),t||Q(t=>({...t,[E]:[...t[E]||[],...e]})),_(t=>[...t,...e])):(_(t=>[...t,...e]),t||q(t=>[...t,...e]))}}catch(e){console.error("Fetch all products pagination error:",e)}finally{re.current&&R(!1)}}})()},[i?.workWithoutPagination,Je,x,E,oe,Y]),n(()=>{if(!Je&&!i?.workWithoutPagination)return;if(et)return;if(!H.current)return;const e=new IntersectionObserver(([e])=>{e.isIntersecting&&V<Qe.length&&W(e=>Math.min(e+20,Qe.length))},{rootMargin:"200px"});return e.observe(H.current),()=>e.disconnect()},[Je,et,V,Qe.length]),n(()=>{W(20)},[E,Qe.length,Je,i?.workWithoutPagination]);const tt=()=>{f?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"byob-page-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:X.byob.sectionBackgroundColor,..."transparent"!==X.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},qe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...i?.coverImageVerticalMargin&&{marginBottom:i?.coverImageVerticalMargin,marginTop:i?.coverImageVerticalMargin}}},qe&&e.createElement(Ss,{coverImageUrl:qe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",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)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:X?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},Xe),e.createElement("span",{style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Ke))):(Xe||Ke)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},Xe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:X?.byob?.titleFontSize??"3rem",fontWeight:"700",color:X?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:X?.byob?.titleBackgroundColor??"transparent"}},Xe),Ke&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:X?.byob?.subtitleFontSize??"1.5rem",color:X?.byob?.titleTextColor??"#000"}},Ke)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Y&&K.length>0&&X?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(Rs,{currentStep:E,totalSteps:K.length+(N?1:0),tiers:N?[...K,{title:i.personalizedForm?.title||"Personalize",tier:K.length,minimumQuantity:0,products:[],isFormStep:!0}]:K,isMobile:v,primaryColor:X?.general?.primaryColor,primaryTextColorCta:X?.general?.primaryContrastColor,setCurrentProductTier:k,selectedProductsByTier:T,tierNavigation:X.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===X?.byob?.productFiltersDisplay&&!v&&!I&&e.createElement(zs,{showFiltersDrawer:pe,handleClose:()=>me(!1),isAnimating:!1,isMobile:!1,availableFilters:ce,appliedFilters:oe,toggleFilter:(e,t)=>{ae(n=>{const r=n[e]||[],o=r.includes(t)?r.filter(e=>e!==t):[...r,t],a={...n,[e]:o.length?o:void 0};return Object.fromEntries(Object.entries(a).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{ae({}),xe(0),ge(Be)},applyPriceFilter:()=>{ae(e=>{const t={...e};return t["filter.v.price"]=[`min:${ye}-max:${ue}`],t})},priceMin:ye,setPriceMin:xe,priceMax:ue,setPriceMax:ge,maxPossiblePrice:Be,styles:X,products:A,unavailableProductCount:Ye,storeCurrencyCode:i?.storeCurrencyCode,openSections:he,toggleSection:we}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!I&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement($s,{enableSortAndFilter:i?.enableSortAndFilter??!1,isMobile:v,searchTerm:ze,setSearchTerm:$e,setSortBy:Pe,styles:X,appliedFilters:oe,setAppliedFilters:ae,availableFilters:ce,products:A,availableProductCount:Ge,unavailableProductCount:Ye,maxPossiblePrice:Be,storeCurrencyCode:i?.storeCurrencyCode,sharedFiltersState:{showFilters:pe,setShowFilters:me,priceMax:ue,setPriceMax:ge,priceMin:ye,setPriceMin:xe},openSections:he,toggleSection:we}),i?.customizations?.byob?.enableProductCategories&&ke&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(Os,{styles:X,isMobile:v,categories:Ee,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:X?.byob?.listingsGap||"12px",justifyContent:pe&&"sidebar"===X?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},I&&i.personalizedForm?.title?e.createElement(Ds,{form:i.personalizedForm,formData:B,setFormData:F,isUploading:z,setIsUploading:$}):0!==Ze?.length||L||et?(Je?Qe.slice(0,V):Qe).map((t,n)=>{if("productTier"===Y){const r=(K[E]?.minimumQuantity??0)>(T[E]?.length??0),o=Ae.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return o?e.createElement(Ls,{bundle:i,idx:n,key:t?.variantIds?.[0]??t.productId,product:o?.productDetails,handleAddToBundle:He,hideAddToBundle:!r,remainingQuantity:je-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>Ve(e,E),selecteditems:l,transitionActive:Re,customVariantsQuantity:ve,currentProductTier:K[E],showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:E}):null}return e.createElement(Ls,{bundle:i,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:He,hideAddToBundle:m>=je,remainingQuantity:je-m,themeColor:i?.dealTextColor,handleRemoveItem:e=>u(e),selecteditems:l,transitionActive:Re,customVariantsQuantity:ve,tierIndex:E})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{ae({}),xe(0),ge(Be)},style:{padding:"8px 16px",background:X?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:X?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!I&&(L||et)&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(fe,{color:X?.general?.primaryColor||"#333",size:30})),!Je&&!i?.workWithoutPagination&&e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null)),(Je||i?.workWithoutPagination)&&!et&&e.createElement("div",{ref:H,className:"yt-byob-virtualFetchAll-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(xs,{builderTiers:i?.builderTiers,showNextStep:D,handleAddToCart:async e=>{if(D)return k(E+1),void We();const t={};N&&Object.entries(B).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await s(e,t),tt()},minimumQuantity:Se,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:Ve,selectedItemsQuantity:m,percentageOff:i.percentageOff,loading:d,bundleSubtotal:g,amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:i?.dealTextColor??"#333",primaryTextColorCta:i?.primaryTextColorCta??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:z}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(xs,{showNextStep:D,handleAddToCart:async e=>{if(D)return k(E+1),void We();const t={};N&&Object.entries(B).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),await s(e,t),tt()},minimumQuantity:Se,builderTiers:i?.builderTiers,selectedProducts:l,showProductDetailsInTracker:i.showProductDetailsInTracker,loading:d,handleRemoveItem:u,handleRemoveItemProductTier:Ve,percentageOff:i.percentageOff,selectedItemsQuantity:m??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:i.amountOff,styles:i.customizations,dealAmount:i.dealAmount,discountType:i.discountType,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:X.general.primaryContrastColor??"#fff",cornerRadiusType:i?.cornerRadiusType??"",selectedProductsByTier:T,renderingOnPage:p,isUploading:z})))),_e&&void 0!==m&&(()=>{let t=m<i.minimumQuantity;return"productTier"==Y?t=(K[E]?.minimumQuantity??0)>(T[E]?.length??0):"offerTier"==Y&&(t=m<J.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(Ts,{handleAddToBundle:He,ref:Me,remainingQuantity:i.minimumQuantity-m,hideAddToBundle:!t,disableQuantitySelector:i?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:T,themeColor:X?.general.primaryColor||"#000",primaryTextColorCta:i?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:X?.general.primaryColor||"#000",cornerRadius:i?.customizations.byob.borderRadius,styles:i.customizations,reviewRatingType:X?.fixedBundle?.productRatingsDisplay??i?.reviewRatingType,customVariantsQuantity:ve,bundleProductsCustomQuantity:i?.customProductsQuantity,isFreebieTier:K?.[E]?.isFreebieTier,showFreebieTierProductPrices:i?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:i?.variantOptions})})()))},Vs=({isOpen:r,onClose:o,formConfig:a,onCheckout:i,cta:l,isMobile:c})=>{const[s,d]=t({}),[p,m]=t(!1);n(()=>{r||d({})},[r]);const u=e=>{if(p)return;const t={};Object.entries(s).forEach(([e,n])=>{const r=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[r]=n:n&&"object"==typeof n&&"url"in n&&(t[r]=n.url)}),i(e?{}:t)};if(!r)return null;const g=e.createElement("div",{className:"yt-personalized-form-modal-overlay",onClick:o,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:c?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{className:"yt-personalized-form-modal",onClick:e=>e.stopPropagation(),style:{background:"white",width:c?"100vw":"500px",maxWidth:c?"100vw":"560px",height:c?"80vh":"auto",maxHeight:c?"80vh":"90vh",borderRadius:c?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:c?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{className:"yt-personalized-form-modal-header",style:{width:"100%",padding:c?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:c?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},a.title||"Personalization",!c&&e.createElement("button",{className:"yt-personalized-form-modal-close",onClick:o,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{className:"yt-personalized-form-modal-body",style:{flex:1,overflowY:"auto",padding:c?"20px 20px":"16px 20px"}},e.createElement(Ds,{form:a,formData:s,setFormData:d,isUploading:p,setIsUploading:m})),e.createElement("div",{className:"yt-personalized-form-modal-footer",style:{padding:c?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{className:"yt-personalized-form-submit-button",onClick:()=>{u(),o()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(fe,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{className:"yt-personalized-form-skip-button",onClick:()=>{u(!0),o()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return D.createPortal(g,document.body)},Ws=({product:t,selectedVariantId:n,onVariantChange:o,styles:a,originalPrice:i,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p,reviewRatingType:m})=>{const u=r(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),r=n?.node;return r?t?.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t?.productDetails]),g=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const f=r(()=>{if(g?.title&&t?.productDetails.options){const e=g.title.split(" / ");if(e.length===t?.productDetails.options.length)return e}return t?.productDetails.options?.map(e=>e.values[0])||[]},[g,t?.productDetails.options]),y=e=>{o(e)};return s?e.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"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},a.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Sm(g?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,onClick:e=>{if(a?.general?.redirectToPDP&&t?.productDetails?.handle){e.stopPropagation();const n=window?.Shopify?.routes?.root||"/";window.location.href=`${n}products/${t?.productDetails.handle}`}},style:{cursor:a?.general?.redirectToPDP?"pointer":"default",objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:a.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>y(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.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"}},e.createElement(h,null)))))),(a.comboBundle.subProductsProductTitleVisibility||a.comboBundle.subProductsProductPriceVisibility||m)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingBlock:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},Tm(a.general.currencySymbol),km((Number(g?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.compareAtPrice?g.compareAtPrice:g?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.price)))))):e.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"===a.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===a.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"}},a.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Sm(g?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,onClick:e=>{if(a?.general?.redirectToPDP&&t?.productDetails?.handle){e.stopPropagation();const n=window?.Shopify?.routes?.root||"/";window.location.href=`${n}products/${t?.productDetails.handle}`}},style:{cursor:a?.general?.redirectToPDP?"pointer":"default",objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:a?.general?.imageAspectRatio||"1 / 1",height:"100px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===a.comboBundle?.infoAlignment?"flex-start":"right"===a.comboBundle?.infoAlignment?"flex-end":"center"===a.comboBundle?.infoAlignment?"flex-start":void 0}},a.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==a.comboBundle.comboVariantTypeSelector&&t?.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&f&&e.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"}},f.length>1?f.join(" / "):f)),"ratingOnly"===m&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===m&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-comboBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"4px",paddingBottom:"0px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"yt-comboBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),a.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},Tm(a.general.currencySymbol),km((Number(g?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==a.comboBundle.discountBadgeVisibility&&("discount-on-compare"===a.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.compareAtPrice?g?.compareAtPrice:g?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Tm(a.general.currencySymbol),km(g?.price)))),t?.productDetails.variants.edges.length>1&&("dropdown"===a.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>y(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t?.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&0===n?null:e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.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"}},e.createElement(h,null))):t?.productDetails.options.length>0?e.createElement(e.Fragment,null,t?.productDetails.options.map((n,r)=>e.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"}},t?.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(o=>{const i=[...f];i[r]=o;const l=t?.productDetails.options.length>0?i.join(" / "):i[r],c=t?.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0);if(!1===a?.general?.showOutOfStockVariants&&s)return null;const p=f[r]===o,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===o)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===o)?.value}},e.createElement("span",null)):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):m&&"image"===m?.type?e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===o)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Sm(m?.values.find(e=>e.name===o)?.value||"/placeholder.svg"),alt:o,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:o,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},o)):e.createElement("button",{key:o,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&y(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${a.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},o)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const r=0===u(t?.node?.id);return!1===a?.general?.showOutOfStockVariants&&r?null:e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>y(t?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${a.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},t?.node?.title)}))))))},Hs=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:i})=>{const l=r(()=>{const e=o.products?.filter(e=>{const t=e?.productDetails?.status?.toLowerCase();return!t||("active"===t||"unlisted"===t)})||[];if(!e.some(e=>e.quantity&&e.quantity>1))return{...o,products:e};const t=e.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:t}},[o]),[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[m,u]=t(!1),g=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[f,y]=t(()=>{const e={};return l.products.forEach((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>g(t?.productDetails,e?.node?.id)>0)?.node;e[n]=r?r.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e}),x=l.products?.every((e,t)=>{const n=f[t];return g(e?.productDetails,n)>0});n(()=>(a&&(window.ytComboBundle={bundle:l,addToCart:a,selectedVariants:f},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}))}),[l,a,f]);const h=(e,t)=>{y(n=>({...n,[e]:t}))},b=async e=>{const t=Object.entries(f).map(([e])=>({id:l.products[parseInt(e)].productId,title:l.products[parseInt(e)]?.productDetails?.title}));i?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:l._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(s(!0),!a)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void s(!1);const t=Object.entries(f).map(([e,t])=>{const n=l.products[parseInt(e)],r=n?.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return r?{variantId:t,price:Number(r.price)}:null}).filter(e=>null!==e),n=Object.values(f);await a(Number(E),n,Number(k),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}s(!1)},w=l.customizations,v=w?.comboBundle?.discountBadgeDisplay||"discount-on-compare",C=w?.comboBundle?.discountBadgeVisibility,{originalPrice:E,dealPrice:k,offerValue:T,totalPriceSum:S,offerPercentage:N}=r(()=>{const{price:e,compareAtPrice:t}=Object.entries(f).reduce((e,[t,n])=>{const r=l.products[parseInt(t)],o=r?.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),n=!1===C?e:"discount-on-price"===v?e:t;let r=e;l?.percentageOff?r=e*(1-l.percentageOff/100):l?.dealAmount?r=l.dealAmount:l?.amountOff&&(r=e-l.amountOff);const o=n-r,a=n>0?Math.round((n-r)/n*100):0;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:o.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:a}},[f,l.products,l.percentageOff,l.dealAmount,l.amountOff,v,C]);n(()=>{i?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:l._id,bundleType:"combo-bundle"}});const e=()=>{p(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const B=w.comboBundle?.comboCardStyle||"auto",F="vertical"===B||"auto"===B&&!d,z=w.comboBundle?.embedContentVisibility,$="bundles"==l.appName?l.pageHeader?.title:l?.title,I="bundles"==l.appName?l.pageHeader?.description:l?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:w.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===w.comboBundle?.infoAlignment?"flex-start":"right"===w.comboBundle?.infoAlignment?"flex-end":"center"===w.comboBundle?.infoAlignment?"center":void 0,textAlign:w.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},z&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:w.comboBundle?.productTitleFontSize||"28px",color:w.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},$)),z&&w?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:w.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(w.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Tm(w.general.currencySymbol,l.storeCurrencyCode),km(k)),!isNaN(Number(E))&&!isNaN(Number(k))&&Number(E)>Number(k)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:w.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Tm(w.general.currencySymbol,l.storeCurrencyCode),km(E)),Number(T)>0&&!1!==C&&(()=>{const t="percentage"===(w?.comboBundle?.discountDisplayType||"amount")?`${N}% Off`:`Save ${Tm(w.general.currencySymbol,l.storeCurrencyCode)}${km(T)}`;return e.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"}},t)})())),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:w.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),w.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,F?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(d?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},l.products.map((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===f[n])?.node;return r?e.createElement(Ws,{key:`combo-product-${n}-${t.productId}`,product:t,styles:w,originalPrice:E,dealPrice:k,totalPriceSum:S,selectedVariantId:f[n],onVariantChange:e=>h(n,e),isVertical:F,variantOptions:l.variantOptions,storeCurrencyCode:l.storeCurrencyCode,reviewRatingType:w?.comboBundle?.comboProductRatingsDisplay}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(d?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},w.comboBundle.subProductsSectionVisibility&&l.products.map((t,n)=>e.createElement(Ws,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:w,originalPrice:E,dealPrice:k,totalPriceSum:S,selectedVariantId:f[n],onVariantChange:e=>h(n,e),variantOptions:l.variantOptions,reviewRatingType:w?.comboBundle?.comboProductRatingsDisplay})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${x?"":"yt-comboBundle-bundle-cta-button-disabled"} ${d?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:x?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor,color:w.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:w.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:x?"pointer":"not-allowed",border:`1px solid ${x?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor}`,boxShadow:w.general.ctaShadowType,padding:w.general?.ctaPadding,width:w.general?.ctaWidth,margin:"0"},disabled:!x,onMouseOver:e=>{w.general.customizeHoverState&&x&&(e.currentTarget.style.backgroundColor=w.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=w.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{w.general.customizeHoverState&&x&&(e.currentTarget.style.backgroundColor=w.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=w.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{l?.personalizedForm?.title?u(!0):await b()}},c?e.createElement(fe,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,x?w.comboBundle?.ctaTitle??"Add Bundle to cart":w.general.outOfStockLabel||"Out of Stock"," "))),z&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:w.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:w.general.primaryColor+"08"}},e.createElement("p",null,I))),l?.personalizedForm?.title&&e.createElement(Vs,{isOpen:m,onClose:()=>u(!1),formConfig:l.personalizedForm,onCheckout:async e=>{await b(e),u(!1)},cta:{backgroundColor:w.general?.ctaBackgroundColor||"#121212",textColor:w.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},js=s.div`
|
|
3120
3120
|
max-width: 800px;
|
|
3121
3121
|
container-type: inline-size;
|
|
3122
3122
|
margin-top: ${e=>e.verticalMargin||"0px"};
|
|
@@ -3461,7 +3461,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
3461
3461
|
scrollbar-width: none;
|
|
3462
3462
|
|
|
3463
3463
|
-ms-overflow-style: none;
|
|
3464
|
-
`,bd=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function wd({bundle:i,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:s}){const d=r(()=>{if(c){const e="gid://shopify/Product/"+c,t=i.products?.some(t=>t.productId===e);return t?e:i.products?.[0]?.productId}return i.products?.[0]?.productId},[c,i.products]),p=r(()=>bd(d,i.products),[d,i.products]),m=o(null),u=o(null);o({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[g,f]=t(0),[y,x]=t(""),h=i.customizations??{},b=!1===h?.general?.showDecimalsInBundlePricing,w=r(()=>p?.productDetails?.tracksInventory??!0,[p?.productDetails?.tracksInventory]),v=a(e=>{if(!w)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[w]),C=(r(()=>p?.productDetails?.variants?.edges?.reduce((e,{node:t})=>v(t)>0?e+1:e,0),[p,v]),r(()=>bd(d,i.products)?.id,[d,i.products]));r(()=>C?bd(d,i.products):void 0,[d,i.products,C]),r(()=>i.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[i.products]),h.volumeBundle;const E=r(()=>i?.volumeTiers||[],[i?.volumeTiers]),k=E.findIndex(e=>e.isDefault),[T,S]=t(-1!==k?E[k].tier:E?.[0]?.tier||1),[N,B]=t(p?.productDetails?.variants?.edges?.find(e=>v(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||""),[F,z]=t({}),[$,I]=t(E.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>p?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[P,D]=t(!1),[A,_]=t(!1),[L,R]=t(window.innerWidth<550),[O,M]=t(null),[V,W]=t({}),[H,j]=t(null);o([]);const q=o([]),U=o(T);n(()=>{if(s?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{R(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{O&&q.current[O.index]&&q.current[O.index][O.optionIndex]&&!q.current[O.index][O.optionIndex]?.contains(e.target)&&M(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[O]),a(e=>{const t=E.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=p?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(v(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=v(e.node),r=v(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(v(n)>r&&n.availableForSale){const t=n.title.split(" / ");o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[p,E,v]);const Q=a(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=p?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=v(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[E,p,v]);n(()=>{const e={},t=p?.productDetails?.variants?.edges?.find(e=>v(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&E.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),z(e)},[p?.id,E?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),v]);const Z=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,G=a((e,t,n,r,o)=>{const a=E.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const c=l.join(" / "),s=p?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===v(s))return!1;const d={},m=F[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=s.id;else{const t=m[e]||N,r=Z(p,t);if(!r)return!1;n=r.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=Z(p,e),r=v(n);if(r!==1/0&&t>r)return!1}return!0},[E,p,$,$,F,N,v]),Y=a(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=($[r]?.[e]||p.productDetails.options.map(e=>e.values[0])).join(" / "),n=p?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=Z(p,e),r=v(n);if(r!==1/0&&t>r)return!1}return!0},[E,p,$,v]);n(()=>{f(e=>e+1)},[F]);const X=(e,t,n)=>{z(r=>({...r,[e]:{...r[e]||{},[t]:n}}))},K=a(()=>p?.productDetails?.variants?.edges?.find(e=>v(e.node)>0)?.node||p?.productDetails?.variants?.edges?.[0]?.node,[p,v]),J=a(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{U.current=T},[T]),n(()=>{H?(j(null),ee()):ee()},[T]),n(()=>{if(i){const e=K();if(e)x(e.id),B(e.id);else{const e=p?.productDetails?.variants?.edges?.[0]?.node?.id||"";x(e),B(e)}}},[i,p,K]);const ee=()=>{const e=J();if(e){const t=p?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),f(e=>e+1);else{const e=K();e&&(B(String(e.id)),n=e),f(e=>e+1)}if(n){0===v(n)?(j(null),setTimeout(()=>{j({tier:U.current,index:0,optionIndex:0,value:n.title})},0)):H&&j(null)}}};n(()=>{ee();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",ee),()=>{t=!1,window.removeEventListener("urlChange",ee),window.history.pushState=n,window.history.replaceState=r}},[J,p?.id,K,v]);const te=e=>{const t=E.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,r=0,o=0;const a=F[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=a[e]||N,i=Z(p,t);if(!i)continue;const l=Number.parseFloat(i.price);n+=i.compareAtPrice?Number.parseFloat(i.compareAtPrice):l,r+=l,o+=l}if("percentOff"===i?.discountType){o*=1-(t.discountValue??0)/100}else"amountOff"===i?.discountType&&(o-=t.discountValue??0);const l=Math.max(0,o),c=h?.volumeBundle?.discountBadgeDisplay,s=h?.volumeBundle?.discountBadgeVisibility;let d=n;"Disabled"===s?d=l:"discount-on-price"===c&&(d=r);const m=r-l,u=d-l,g=r>0?m/r*100:0,f=d>0?u/d*100:0;return{original:d,discounted:l,discountedFromPrice:l,discountedFromCompare:l,diffAmountFromPrice:m,diffAmountFromCompare:u,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(f),discountValue:t.discountValue??0}},ne=(e,t,n,r)=>{let o=Z(e,t);if(r){const a=F[r]?.[n||0]||t;o=Z(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""},re=async e=>{if(Y(T))try{D(!0);const t=E.find(e=>e.tier===T);if(!t)return;const n={},r=F[t.tier]||{};for(let e=0;e<t.minimumQuantity;e++){const t=r[e]||N;n[t]?n[t].quantity+=1:n[t]={quantity:1}}s?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"volume-bundle",selectedProducts:p?[{id:p?.productId,title:p?.productDetails?.title}]:[],selectedVariants:Object.values(r)}});const o=te(t.tier),a=Array.from({length:t.minimumQuantity},(e,t)=>r[t]||N),c=se(t)?.variantIds?.[0]?[se(t)?.variantIds?.[0]]:[];l&&await l(o.original,a,o.discounted,void 0,e,c)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{D(!1)}else console.error("Selected tier is out of stock")};function oe(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(h.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==h.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let r=1;n&&n.value&&(r=parseInt(n.value,10)||1);const o=E.find(e=>e.tier===T);if(!o)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const a=o.minimumQuantity;let i={};const l=Math.max(a,r);if(r>a){const e=y||N;if(!e)return;i[e]=l}else{const e=F[o.tier]||{};for(let t=0;t<a;t++){let n=e[t];n||(n=N),n&&(i[n]=(i[n]||0)+1)}}const c=te(o.tier),s=Object.fromEntries(Object.entries(i).map(([e,t])=>[oe(e),Math.round(t)])),d=(t,n,r="bundle-input-field")=>{const o=document.createElement("input");o.type="hidden",o.name=t,o.value=n,o.className=r,e.appendChild(o)};if(r>a){const e=y||N;e&&d("id",oe(e))}d("properties[_bundle_price]",String(c.original)),d("properties[_bundle_tier]",String(o.tier)),d("properties[_bundle_items]",JSON.stringify(s));let p=0;Object.entries(s).forEach(([e,t])=>{t>0&&(d(`items[${p}][id]`,e),d(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),o=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const r=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");r&&(r.textContent=n)};r<=a&&(H?(o(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(o(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[T,JSON.stringify(F),N,h.volumeBundle?.cardStyle,c,y,H]);const ae=r(()=>E.find(e=>e.tier===T),[E,T]),ie=r(()=>ae?te(ae.tier):null,[ae,F,N]),le=r(()=>{if(!ae||!ie)return;const e=F[ae.tier]||{},t={};for(let n=0;n<ae.minimumQuantity;n++){const r=e[n]||N;t[r]=(t[r]||0)+1}return t},[ae?.minimumQuantity,N,F,ie]),ce=r(()=>Object.entries(le??{}).map(([e,t])=>({variantId:e,quantity:t})),[le]);n(()=>{if(!ae||!ie)return;const e={tier:T,items:ae.minimumQuantity,discountedPrice:ie.discounted,originalPrice:ie.original,variants:ce,productId:p?.id??null,tierMeta:{title:ae.title,subtitle:ae.subtitle,badgeTitle:ae.badgeTitle},productData:p,tierData:ae},t=u.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(m.current&&clearTimeout(m.current),m.current=window.setTimeout(()=>{u.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:i,addToCart:l,currentTier:ae,selectedVariants:ce},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{m.current&&clearTimeout(m.current)})},[T,ae?.tier,ae?.minimumQuantity,ie?.discounted,ie?.original,p?.id,JSON.stringify(ce),JSON.stringify(V),l,i]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!N||!p)return;const e=Z(p,N);if(!e)return;const t=e.title.split(" / "),n={},r={};E.forEach(e=>{const o=e.tier-1,a={};for(let t=0;t<e.minimumQuantity;t++)a[t]=N;n[e.tier]=a,r[o]=Array(e.minimumQuantity).fill(t)}),z(e=>({...e,...n})),I(e=>({...e,...r}))},[N,p?.id,E.length]);const se=a(e=>e.freebieProductIds?.[0]&&i.freebieProducts?.length?i.freebieProducts.find(t=>t.productId===e.freebieProductIds?.[0])??null:null,[i.freebieProducts]),de=a(e=>{if(!e)return"";const t=e.productDetails?.variants?.edges??[];return t.find(t=>{const n=t.node.inventoryQuantity??0,r=t.node.inventoryPolicy?.toLowerCase();return!e.productDetails?.tracksInventory||(!t.node.inventoryItem?.tracked||(n>0||"continue"===r))})?.node?.id??t[0]?.node?.id??""},[]);if(n(()=>{const e={};E.forEach(t=>{const n=se(t);n&&(e[t.tier]=V[t.tier]||de(n))}),Object.keys(e).length>0&&W(t=>({...e,...t}))},[E,i.freebieProducts]),!l)return e.createElement(e.Fragment,null);const pe=h.volumeBundle?.cardStyle,me=h.general?.primaryColor,ue=h.general?.secondaryColor,ge=h.general.primaryContrastColor,ye=h.general.secondaryContrastColor,xe="high"===i.cornerRadiusType?"20px":"medium"===i.cornerRadiusType?"6px":"0px",he="bundles"==i.appName?i.pageHeader?.title:i?.title,be="bundles"==i.appName?i.pageHeader?.description:i?.subtitle;return n(()=>{const e=Y(T);e?j(null):e||j({tier:T,index:0,optionIndex:0,value:""})},[T,ce,Y]),e.createElement(js,{verticalMargin:h.volumeBundle?.verticalMargin,$backgroundColor:h.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},(he||be)&&e.createElement(qs,{className:"yt-bundle-header"},he&&he.trim().length>0&&e.createElement(Us,{fontSize:h.volumeBundle?.titleFontSize,$backgroundColor:h.volumeBundle?.titleBackgroundColor,textColor:h.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},he),e.createElement(Qs,{className:"yt-bundle-header-subtitle",fontSize:h.volumeBundle?.subtitleFontSize},be)),"vertical"===pe?e.createElement("div",{style:{display:"grid",gridTemplateColumns:L||4===E.length?"repeat(2, 1fr)":E.length>4?"repeat(3, 1fr)":`repeat(${E.length}, 1fr)`,justifyItems:"center",gap:L?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},E.map(t=>{const n=te(t.tier),r=n.original-n.discounted,o=T===t.tier,a=!Q(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:xe||"24px",...o?{border:`2px solid ${me}`}:{border:`1px solid ${ue}`},boxShadow:`6px 6px 0px -1px ${o?me:ue}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:a?"#f5f5f5":"white",cursor:a?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:a?.6:1},className:"yt-volume-vertical-tier-item "+(o?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":i?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(b?0:2),"data-discounted-price":n.discounted.toFixed(b?0:2),onClick:()=>!a&&S(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:o?me:ue,color:o?ge:ye,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:o?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===h.volumeBundle?.discountBadgeVisibility&&L&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(h.general.currencySymbol,i.storeCurrencyCode);let a="";if(h?.volumeBundle?.discountBadgeDisplay&&h?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=h.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===i?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return a?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(Ks,{primaryBackgroundColorCta:o?me:ue,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?ge:ye},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":i?.discountType},a)):null})(),t.imageUrl&&e.createElement("img",{src:Sm(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:xe||"24px",borderTopRightRadius:xe||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(Js,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(ed,{style:{fontSize:L?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===i.discountType&&Tm(h.general.currencySymbol,i.storeCurrencyCode),`${t.discountValue}`,"percentOff"===i.discountType&&"fi"," Off")),"Enabled"===h.volumeBundle?.discountBadgeVisibility&&!L&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(h.general.currencySymbol,i.storeCurrencyCode);let a="";if(h?.volumeBundle?.discountBadgeDisplay&&h?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=h.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===i?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return a?e.createElement(Ks,{primaryBackgroundColorCta:o?me:ue,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?ge:ye},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":i?.discountType},a):null})(),o&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:me,color:ge,padding:"2px"}},e.createElement(He,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(td,{style:{lineHeight:"normal",fontSize:L?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),Q(t.tier)?e.createElement(nd,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(b?0:2),"data-discounted-price":n.discounted.toFixed(b?0:2),"data-savings":r.toFixed(b?0:2)},(()=>{const o=h?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",l="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(b?0:2),l=e.toFixed(b?0:2)}else"tier-price"===o&&(a=n.original.toFixed(b?0:2),l=n.discounted.toFixed(b?0:2));return e.createElement(e.Fragment,null,e.createElement(rd,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},Tm(h.general.currencySymbol,i.storeCurrencyCode),km(l),"unit-price"===o?"/unit":""),r>0&&e.createElement(od,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},Tm(h.general.currencySymbol,i.storeCurrencyCode),km(a),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),o&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:me,color:ge,padding:"2px"}},e.createElement(He,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,E.map(t=>{const n=te(t.tier),r=n.original-n.discounted,o=!Q(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement(Gs,{cornerRadiusType:i?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:me??"",isSelected:T===t.tier,onClick:()=>S(t.tier),style:{borderRadius:xe,cursor:"pointer",backgroundColor:o?"#f5f5f5":"white",opacity:o?.6:1,...t?.badgeTitle&&{position:"relative",marginTop:"30px"}},className:"yt-volume-horizontal-tier-container "+(T===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":i?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(b?0:2),"data-discounted-price":n.discounted.toFixed(b?0:2)},t.badgeTitle&&e.createElement(Zs,{primaryTextColorCta:ge,primaryBackgroundColorCta:me,style:{lineHeight:"normal",position:"absolute",top:"-16.5px",left:"2%",right:"2%",marginInline:"auto"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Ys,{cornerRadiusType:i?.cornerRadiusType??"",style:{borderRadius:xe,borderBottomLeftRadius:xe,borderBottomRightRadius:xe},className:"yt-volume-horizontal-tier-header"},e.createElement(Xs,{className:"yt-volume-horizontal-tier-info"},e.createElement(sd,{"data-active":T===t.tier,accentColor:me,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(dd,{name:"tier",checked:T===t.tier,onChange:()=>!o&&S(t.tier),disabled:o,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(pd,{accentColor:me,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(Js,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(ed,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===i.discountType&&Tm(h.general.currencySymbol,i.storeCurrencyCode),`${t.discountValue}`,"percentOff"===i.discountType&&"fi"," ","Off")),"Enabled"===h.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(h.general.currencySymbol,i.storeCurrencyCode);let o="";if(h?.volumeBundle?.discountBadgeDisplay&&h?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=h.volumeBundle;"discount-on-compare"===e&&(o="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(o="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(o="percentOff"===i?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return o?e.createElement(Ks,{primaryBackgroundColorCta:me,isSelected:T===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":i?.discountType},o):null})()),e.createElement(td,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),Q(t.tier)?e.createElement(nd,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(b?0:2),"data-discounted-price":n.discounted.toFixed(b?0:2),"data-savings":r.toFixed(0)},(()=>{const o=h?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",l="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(b?0:2),l=e.toFixed(b?0:2)}else"tier-price"===o&&(a=n.original.toFixed(b?0:2),l=n.discounted.toFixed(b?0:2));return e.createElement(e.Fragment,null,r>0?e.createElement(od,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},Tm(h.general.currencySymbol,i.storeCurrencyCode),km(a),"unit-price"===o?"/unit":""):"",e.createElement(rd,{className:"yt-volume-horizontal-tier-discounted-price"},Tm(h.general.currencySymbol,i.storeCurrencyCode),km(l),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),T===t.tier&&e.createElement(ad,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,r)=>{const a=t.tier-1,l=($[a]||[])[r]||p.productDetails.options?.map(e=>e.values[0])||[],c=p?.productDetails?.options.some(e=>e.values.length>1)||1===p?.productDetails?.variants?.edges?.length&&"Default Title"!==p?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:r,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&e.createElement(md,{src:Sm(ne(p,N,r,t.tier)),onClick:e=>{if(h?.general?.redirectToPDP&&p?.productDetails?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${p.productDetails.handle}`}},alt:p?.productDetails?.title||"Product",style:{height:"64px",width:"auto",cursor:h?.general?.redirectToPDP?"pointer":"default"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===h?.volumeBundle?.variantSelectorType||"dropdown"===h?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},p?.productDetails?.options?.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=O?.tier===t.tier&&O?.index===r&&O?.optionIndex===c,m=i?.variantOptions?.options?.find(e=>e.name===n.name);let u="";return"color"===m?.type&&(u=m?.values?.find(e=>e.name===l[c])?.value||""),e.createElement(yd,{key:c,ref:e=>{q.current[r]||(q.current[r]=[]),q.current[r][c]=e},style:{zIndex:d?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:d,onClick:e=>{e.preventDefault(),e.stopPropagation()}},h?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(xd,{onClick:e=>{e.stopPropagation(),e.preventDefault(),M(d?null:{tier:t.tier,index:r,optionIndex:c})},isActive:d,disabled:o},"color"===m?.type&&u&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:u||"transparent",border:"1px solid #ddd"}}),l[c],e.createElement(Ie,{style:{display:"block"}})),d&&e.createElement(hd,{style:{zIndex:1001}},s.map((n,i)=>{const s=[...l];s[c]=n;const d=G(t.tier,r,l,c,n),u=!d||o;if(!1===h?.general?.showOutOfStockVariants&&!d)return null;p.productDetails.variants.edges.find(({node:e})=>e.title===s.join(" / "));const g=e=>{if(e.preventDefault(),e.stopPropagation(),I(e=>{const t={...e},n=[...t[a]||[]];return n[r]=s,t[a]=n,t}),u){j({tier:T,index:r,optionIndex:c,value:n}),M(null);const e=s.join(" / "),o=p.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||N;return void X(t.tier,r,o)}const o=s.join(" / "),i=p.productDetails.variants.edges.find(e=>e.node.title===o)?.node.id||N;X(t.tier,r,i),M(null)},f=m?.values.find(e=>e.name===n);return"image"===m?.type&&f?.value?e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},e.createElement(gd,{src:f.value,alt:n}),n):"color"===m?.type&&f?.value?e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},e.createElement(fd,{style:{backgroundColor:f.value}}),n):e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},n)})))})),"swatches"===h?.volumeBundle?.variantSelectorType&&e.createElement(id,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},p?.productDetails?.options.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=i.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},h?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const i=l[c]===n,s=G(t.tier,r,l,c,n),m=!s||o;if(!1===h?.general?.showOutOfStockVariants&&!s)return null;const u=d?.values.find(e=>e.name===n),g=e=>{if(e.preventDefault(),e.stopPropagation(),m)return;const o=[...l];o[c]=n,I(e=>{const t={...e},n=[...t[a]||[]];return n[r]=o,t[a]=n,t});const i=o.join(" / "),s=p.productDetails.variants.edges.find(e=>e.node.title===i)?.node.id||N;X(t.tier,r,s)},f={opacity:m?.5:1,cursor:m?"not-allowed":"pointer"};return"color"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:g,style:{...f,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:i?`1px solid ${h.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button"+(i?" yt-volume-horizontal-tier-variant-color-button--selected":""),disabled:m},e.createElement("div",{style:{width:i?"24px":"20px",height:i?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:g,style:{...f,border:i?`1px solid ${h.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:i?"#F7F7F7":"transparent",padding:"0px",width:i?"20px":"18px",height:i?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button"+(i?" yt-volume-horizontal-tier-variant-image-button--selected":""),disabled:m},e.createElement("img",{src:u.value,alt:n,style:{width:i?"26px":"24px",height:i?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ld,{key:n,isSelected:i,onClick:g,style:{...f,padding:"4px 8px",border:i?`1px solid ${h.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:i?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default"+(i?" yt-volume-horizontal-tier-variant-button-default--selected":""),disabled:m},n)})))})))})),H&&H.tier===t.tier&&e.createElement("div",{style:{color:me,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${me}1A`,padding:"12px",borderBottomLeftRadius:xe,borderBottomRightRadius:xe}},"There aren’t enough items in our stock for select option, please select smaller bundle."),T===t.tier&&se(t)&&(()=>{if("horizontal"===h?.volumeBundle?.cardStyle)return null;const n=se(t),r=V[t.tier],o=n.productDetails.variants.edges.find(e=>e.node.id===r)?.node||n.productDetails.variants.edges[0]?.node,a=h?.volumeBundle?.freebieDisplayType;return"compact"===a?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:ue||"#928d8d",borderBottomLeftRadius:xe,borderBottomRightRadius:xe},className:"yt-volume-tier-freebie-detailed-section"},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:500},className:"yt-volume-tier-freebie-detailed-product-details"},e.createElement("strong",null,"+ FREE")," ",n.productDetails.title," worth"," ",km(o?.price)),e.createElement("span",{className:"yt-volume-tier-freebie-detailed-gift-icon",style:{color:"#fff",fontSize:"16px"}},e.createElement(je,{fill:"white"}))):e.createElement("div",{className:"yt-volume-freebie-compact-section",style:{padding:"12px 16px",borderTop:"1px solid #f0f0f0",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",gap:"12px",borderBottomLeftRadius:xe,borderBottomRightRadius:xe,paddingBottom:"20px"}},e.createElement("div",{style:{position:"relative",width:"56px",height:"56px",flexShrink:0},className:"yt-volume-freebie-compact-product-image"},e.createElement(md,{src:Sm(o?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,onClick:e=>{if(h?.general?.redirectToPDP&&n?.productDetails?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.productDetails.handle}`}},style:{cursor:h?.general?.redirectToPDP?"pointer":"default",height:"64px",width:"auto",objectFit:"cover",borderRadius:"6px"}})),e.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px"},className:"yt-volume-freebie-compact-product-details"},e.createElement("span",{style:{background:"#1a1a1a",color:"#fff",fontSize:"10px",fontWeight:600,padding:"2px 7px",borderRadius:"4px",display:"inline-block",width:"fit-content"}},"+ FREE"),e.createElement("span",{style:{fontSize:"14px",fontWeight:500}},n.productDetails.title),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},o?.title)))})()))})),(()=>{if(!E.some(e=>se(e)))return null;const t=E.find(e=>e.tier===T),n=t?se(t):null,r=E.find(e=>se(e)),o=r?.title||`Pack of ${r?.minimumQuantity}`,a=n&&"detailed"===h?.volumeBundle?.freebieDisplayType;let l=null;if(a){const e=V[t.tier];l=n.productDetails.variants.edges.find(t=>t.node.id===e)?.node||n.productDetails.variants.edges[0]?.node}return e.createElement("div",{style:{marginTop:"16px",marginBottom:i?.showCta?"16px":"0px",padding:a?"8px":"10px 12px",backgroundColor:`${me}20`,border:"1px dashed #333",borderRadius:"8px",display:"flex",alignItems:"center",gap:"12px"},className:"yt-volume-freebie-status-banner"},a?e.createElement("div",{style:{display:"flex",gap:"12px",width:"100%",alignItems:"center"},className:"yt-volume-freebie-detailed-banner-container"},e.createElement("div",{style:{position:"relative",width:"60px",height:"60px",flexShrink:0,backgroundColor:"#eee",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image-container"},e.createElement("img",{src:Sm(l?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image"}),e.createElement("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",backgroundColor:"#fff",border:"1px solid #333",borderRadius:"4px",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2},className:"yt-volume-freebie-detailed-banner-gift-overlay"},e.createElement(je,{color:"#333",size:12}))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},className:"yt-volume-freebie-detailed-banner-text-container"},e.createElement("div",{style:{backgroundColor:"#333",color:"#fff",fontSize:"9px",fontWeight:"600",padding:"2px 6px",borderRadius:"4px",width:"fit-content"},className:"yt-volume-freebie-detailed-banner-pill"},"+ FREE — included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"),e.createElement("span",{style:{fontSize:"14px",fontWeight:"bold",color:"#111",lineHeight:"1.2",marginTop:"2px"},className:"yt-volume-freebie-detailed-banner-title"},n.productDetails.title),l?.title&&"Default Title"!==l.title&&e.createElement("span",{style:{fontSize:"12px",color:"#666",lineHeight:"1"},className:"yt-volume-freebie-detailed-banner-variant"},l.title))):e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:me||"#ff4d94",borderRadius:"4px",width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},className:"yt-volume-freebie-compact-banner-icon"},e.createElement(qe,{color:"#fff",size:16})),e.createElement("div",{style:{fontSize:"14px",color:"#111",lineHeight:"1.3"},className:"yt-volume-freebie-compact-banner-text"},n?e.createElement(e.Fragment,null,e.createElement("strong",null,"Free ",n.productDetails.title)," ","— included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"):e.createElement("span",{style:{fontWeight:500}},"Select ",e.createElement("strong",null,o)," to unlock a free gift."))))})(),i?.showCta&&"shopify_atc_button"!==h.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(cd,{bgColor:Y(T)?h.general?.ctaBackgroundColor:"#ccc",textColor:Y(T)?h.general?.ctaTextColor:"#666",border:`1px solid ${Y(T)?h.general?.ctaBorderColor||"#121212":"#999"}`,shadow:h.general.ctaShadowType,padding:h.general?.ctaPadding,width:h.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Y(T)&&h.general?.customizeHoverState,backgroundColor:h.general?.ctaHoverBackgroundColor,textColor:h.general?.ctaHoverTextColor},onClick:async()=>{i?.personalizedForm?.title?_(!0):await re()},borderRadius:h.general.ctaBorderRadius??"",disabled:P||!Y(T),className:"yt-volume-add-to-cart-button"},Y(T)?e.createElement(e.Fragment,null,P?e.createElement(fe,{color:"white",loading:P,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,h.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=te(T);return e.createElement(e.Fragment,null,Tm(h.general.currencySymbol,i.storeCurrencyCode),km(t.discounted.toFixed(b?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Tm(h.general.currencySymbol,i.storeCurrencyCode),km(t?.original.toFixed(b?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))),i?.personalizedForm?.title&&e.createElement(Vs,{isOpen:A,onClose:()=>_(!1),formConfig:i.personalizedForm,onCheckout:async e=>{await re(e),_(!1)},cta:{backgroundColor:h.general?.ctaBackgroundColor||"#121212",textColor:h.general?.ctaTextColor||"#FFFFFF"},isMobile:L}))}const vd=s.div`
|
|
3464
|
+
`,bd=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function wd({bundle:i,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:s}){const d=r(()=>{if(!i)return i;const e=i.products?.filter(e=>{const t=e?.productDetails?.status?.toLowerCase();return!t||("active"===t||"unlisted"===t)})||[],t=i.freebieProducts?.filter(e=>{const t=(e?.productDetails?.status||e?.status)?.toLowerCase();return!t||("active"===t||"unlisted"===t)});return{...i,products:e,...t?{freebieProducts:t}:{}}},[i]),p=r(()=>{if(c){const e="gid://shopify/Product/"+c,t=d.products?.some(t=>t.productId===e);return t?e:d.products?.[0]?.productId}return d.products?.[0]?.productId},[c,d.products]),m=r(()=>bd(p,d.products),[p,d.products]),u=o(null),g=o(null);o({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[f,y]=t(0),[x,h]=t(""),b=d.customizations??{},w=!1===b?.general?.showDecimalsInBundlePricing,v=r(()=>m?.productDetails?.tracksInventory??!0,[m?.productDetails?.tracksInventory]),C=a(e=>{if(!v)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[v]),E=(r(()=>m?.productDetails?.variants?.edges?.reduce((e,{node:t})=>C(t)>0?e+1:e,0),[m,C]),r(()=>bd(p,d.products)?.id,[p,d.products]));r(()=>E?bd(p,d.products):void 0,[p,d.products,E]),r(()=>d.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[d.products]),b.volumeBundle;const k=r(()=>d?.volumeTiers||[],[d?.volumeTiers]),T=k.findIndex(e=>e.isDefault),[S,N]=t(-1!==T?k[T].tier:k?.[0]?.tier||1),[B,F]=t(m?.productDetails?.variants?.edges?.find(e=>C(e?.node)>0)?.node?.id||m?.productDetails?.variants?.edges?.[0]?.node?.id||""),[z,$]=t({}),[I,P]=t(k.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>m?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[D,A]=t(!1),[_,L]=t(!1),[R,O]=t(window.innerWidth<550),[M,V]=t(null),[W,H]=t({}),[j,q]=t(null);o([]);const U=o([]),Q=o(S);n(()=>{if(s?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:d._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{O(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{M&&U.current[M.index]&&U.current[M.index][M.optionIndex]&&!U.current[M.index][M.optionIndex]?.contains(e.target)&&V(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[M]),a(e=>{const t=k.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=m?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(C(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=C(e.node),r=C(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(C(n)>r&&n.availableForSale){const t=n.title.split(" / ");o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[m,k,C]);const Z=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=m?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=C(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[k,m,C]);n(()=>{const e={},t=m?.productDetails?.variants?.edges?.find(e=>C(e?.node)>0)?.node?.id||m?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&k.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),$(e)},[m?.id,k?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),C]);const G=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,Y=a((e,t,n,r,o)=>{const a=k.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const c=l.join(" / "),s=m?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===C(s))return!1;const d={},p=z[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=s.id;else{const t=p[e]||B,r=G(m,t);if(!r)return!1;n=r.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=G(m,e),r=C(n);if(r!==1/0&&t>r)return!1}return!0},[k,m,I,I,z,B,C]),X=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=(I[r]?.[e]||m.productDetails.options.map(e=>e.values[0])).join(" / "),n=m?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=G(m,e),r=C(n);if(r!==1/0&&t>r)return!1}return!0},[k,m,I,C]);n(()=>{y(e=>e+1)},[z]);const K=(e,t,n)=>{$(r=>({...r,[e]:{...r[e]||{},[t]:n}}))},J=a(()=>m?.productDetails?.variants?.edges?.find(e=>C(e.node)>0)?.node||m?.productDetails?.variants?.edges?.[0]?.node,[m,C]),ee=a(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{Q.current=S},[S]),n(()=>{j?(q(null),te()):te()},[S]),n(()=>{if(d){const e=J();if(e)h(e.id),F(e.id);else{const e=m?.productDetails?.variants?.edges?.[0]?.node?.id||"";h(e),F(e)}}},[d,m,J]);const te=()=>{const e=ee();if(e){const t=m?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)F(String(n.id)),y(e=>e+1);else{const e=J();e&&(F(String(e.id)),n=e),y(e=>e+1)}if(n){0===C(n)?(q(null),setTimeout(()=>{q({tier:Q.current,index:0,optionIndex:0,value:n.title})},0)):j&&q(null)}}};n(()=>{te();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",te),()=>{t=!1,window.removeEventListener("urlChange",te),window.history.pushState=n,window.history.replaceState=r}},[ee,m?.id,J,C]);const ne=e=>{const t=k.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,r=0,o=0;const a=z[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=a[e]||B,i=G(m,t);if(!i)continue;const l=Number.parseFloat(i.price);n+=i.compareAtPrice?Number.parseFloat(i.compareAtPrice):l,r+=l,o+=l}if("percentOff"===d?.discountType){o*=1-(t.discountValue??0)/100}else"amountOff"===d?.discountType&&(o-=t.discountValue??0);const i=Math.max(0,o),l=b?.volumeBundle?.discountBadgeDisplay,c=b?.volumeBundle?.discountBadgeVisibility;let s=n;"Disabled"===c?s=i:"discount-on-price"===l&&(s=r);const p=r-i,u=s-i,g=r>0?p/r*100:0,f=s>0?u/s*100:0;return{original:s,discounted:i,discountedFromPrice:i,discountedFromCompare:i,diffAmountFromPrice:p,diffAmountFromCompare:u,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(f),discountValue:t.discountValue??0}},re=(e,t,n,r)=>{let o=G(e,t);if(r){const a=z[r]?.[n||0]||t;o=G(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""},oe=async e=>{if(X(S))try{A(!0);const t=k.find(e=>e.tier===S);if(!t)return;const n={},r=z[t.tier]||{};for(let e=0;e<t.minimumQuantity;e++){const t=r[e]||B;n[t]?n[t].quantity+=1:n[t]={quantity:1}}s?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:d._id,bundleType:"volume-bundle",selectedProducts:m?[{id:m?.productId,title:m?.productDetails?.title}]:[],selectedVariants:Object.values(r)}});const o=ne(t.tier),a=Array.from({length:t.minimumQuantity},(e,t)=>r[t]||B),i=de(t)?.variantIds?.[0]?[de(t)?.variantIds?.[0]]:[];l&&await l(o.original,a,o.discounted,void 0,e,i)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{A(!1)}else console.error("Selected tier is out of stock")};function ae(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(b.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let r=1;n&&n.value&&(r=parseInt(n.value,10)||1);const o=k.find(e=>e.tier===S);if(!o)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const a=o.minimumQuantity;let i={};const l=Math.max(a,r);if(r>a){const e=x||B;if(!e)return;i[e]=l}else{const e=z[o.tier]||{};for(let t=0;t<a;t++){let n=e[t];n||(n=B),n&&(i[n]=(i[n]||0)+1)}}const c=ne(o.tier),s=Object.fromEntries(Object.entries(i).map(([e,t])=>[ae(e),Math.round(t)])),d=(t,n,r="bundle-input-field")=>{const o=document.createElement("input");o.type="hidden",o.name=t,o.value=n,o.className=r,e.appendChild(o)};if(r>a){const e=x||B;e&&d("id",ae(e))}d("properties[_bundle_price]",String(c.original)),d("properties[_bundle_tier]",String(o.tier)),d("properties[_bundle_items]",JSON.stringify(s));let p=0;Object.entries(s).forEach(([e,t])=>{t>0&&(d(`items[${p}][id]`,e),d(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),o=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const r=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");r&&(r.textContent=n)};r<=a&&(j?(o(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(o(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[S,JSON.stringify(z),B,b.volumeBundle?.cardStyle,c,x,j]);const ie=r(()=>k.find(e=>e.tier===S),[k,S]),le=r(()=>ie?ne(ie.tier):null,[ie,z,B]),ce=r(()=>{if(!ie||!le)return;const e=z[ie.tier]||{},t={};for(let n=0;n<ie.minimumQuantity;n++){const r=e[n]||B;t[r]=(t[r]||0)+1}return t},[ie?.minimumQuantity,B,z,le]),se=r(()=>Object.entries(ce??{}).map(([e,t])=>({variantId:e,quantity:t})),[ce]);n(()=>{if(!ie||!le)return;const e={tier:S,items:ie.minimumQuantity,discountedPrice:le.discounted,originalPrice:le.original,variants:se,productId:m?.id??null,tierMeta:{title:ie.title,subtitle:ie.subtitle,badgeTitle:ie.badgeTitle},productData:m,tierData:ie},t=g.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{g.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:d,addToCart:l,currentTier:ie,selectedVariants:se},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{u.current&&clearTimeout(u.current)})},[S,ie?.tier,ie?.minimumQuantity,le?.discounted,le?.original,m?.id,JSON.stringify(se),JSON.stringify(W),l,d]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!B||!m)return;const e=G(m,B);if(!e)return;const t=e.title.split(" / "),n={},r={};k.forEach(e=>{const o=e.tier-1,a={};for(let t=0;t<e.minimumQuantity;t++)a[t]=B;n[e.tier]=a,r[o]=Array(e.minimumQuantity).fill(t)}),$(e=>({...e,...n})),P(e=>({...e,...r}))},[B,m?.id,k.length]);const de=a(e=>e.freebieProductIds?.[0]&&d.freebieProducts?.length?d.freebieProducts.find(t=>t.productId===e.freebieProductIds?.[0])??null:null,[d.freebieProducts]),pe=a(e=>{if(!e)return"";const t=e.productDetails?.variants?.edges??[];return t.find(t=>{const n=t.node.inventoryQuantity??0,r=t.node.inventoryPolicy?.toLowerCase();return!e.productDetails?.tracksInventory||(!t.node.inventoryItem?.tracked||(n>0||"continue"===r))})?.node?.id??t[0]?.node?.id??""},[]);if(n(()=>{const e={};k.forEach(t=>{const n=de(t);n&&(e[t.tier]=W[t.tier]||pe(n))}),Object.keys(e).length>0&&H(t=>({...e,...t}))},[k,d.freebieProducts]),!l)return e.createElement(e.Fragment,null);const me=b.volumeBundle?.cardStyle,ue=b.general?.primaryColor,ge=b.general?.secondaryColor,ye=b.general.primaryContrastColor,xe=b.general.secondaryContrastColor,he="high"===d.cornerRadiusType?"20px":"medium"===d.cornerRadiusType?"6px":"0px",be="bundles"==d.appName?d.pageHeader?.title:d?.title,we="bundles"==d.appName?d.pageHeader?.description:d?.subtitle;return n(()=>{const e=X(S);e?q(null):e||q({tier:S,index:0,optionIndex:0,value:""})},[S,se,X]),e.createElement(js,{verticalMargin:b.volumeBundle?.verticalMargin,$backgroundColor:b.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},(be||we)&&e.createElement(qs,{className:"yt-bundle-header"},be&&be.trim().length>0&&e.createElement(Us,{fontSize:b.volumeBundle?.titleFontSize,$backgroundColor:b.volumeBundle?.titleBackgroundColor,textColor:b.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},be),e.createElement(Qs,{className:"yt-bundle-header-subtitle",fontSize:b.volumeBundle?.subtitleFontSize},we)),"vertical"===me?e.createElement("div",{style:{display:"grid",gridTemplateColumns:R||4===k.length?"repeat(2, 1fr)":k.length>4?"repeat(3, 1fr)":`repeat(${k.length}, 1fr)`,justifyItems:"center",gap:R?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},k.map(t=>{const n=ne(t.tier),r=n.original-n.discounted,o=S===t.tier,a=!Z(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:he||"24px",...o?{border:`2px solid ${ue}`}:{border:`1px solid ${ge}`},boxShadow:`6px 6px 0px -1px ${o?ue:ge}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:a?"#f5f5f5":"white",cursor:a?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:a?.6:1},className:"yt-volume-vertical-tier-item "+(o?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(w?0:2),"data-discounted-price":n.discounted.toFixed(w?0:2),onClick:()=>!a&&N(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:o?ue:ge,color:o?ye:xe,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:o?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===b.volumeBundle?.discountBadgeVisibility&&R&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(b.general.currencySymbol,d.storeCurrencyCode);let a="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return a?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(Ks,{primaryBackgroundColorCta:o?ue:ge,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?ye:xe},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a)):null})(),t.imageUrl&&e.createElement("img",{src:Sm(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:he||"24px",borderTopRightRadius:he||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(Js,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(ed,{style:{fontSize:R?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Tm(b.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&!R&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(b.general.currencySymbol,d.storeCurrencyCode);let a="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(a="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(a="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(a="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return a?e.createElement(Ks,{primaryBackgroundColorCta:o?ue:ge,isSelected:o,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:o?ye:xe},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},a):null})(),o&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ue,color:ye,padding:"2px"}},e.createElement(He,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(td,{style:{lineHeight:"normal",fontSize:R?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),Z(t.tier)?e.createElement(nd,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(w?0:2),"data-discounted-price":n.discounted.toFixed(w?0:2),"data-savings":r.toFixed(w?0:2)},(()=>{const o=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(w?0:2),i=e.toFixed(w?0:2)}else"tier-price"===o&&(a=n.original.toFixed(w?0:2),i=n.discounted.toFixed(w?0:2));return e.createElement(e.Fragment,null,e.createElement(rd,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},Tm(b.general.currencySymbol,d.storeCurrencyCode),km(i),"unit-price"===o?"/unit":""),r>0&&e.createElement(od,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},Tm(b.general.currencySymbol,d.storeCurrencyCode),km(a),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),o&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ue,color:ye,padding:"2px"}},e.createElement(He,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,k.map(t=>{const n=ne(t.tier),r=n.original-n.discounted,o=!Z(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement(Gs,{cornerRadiusType:d?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ue??"",isSelected:S===t.tier,onClick:()=>N(t.tier),style:{borderRadius:he,cursor:"pointer",backgroundColor:o?"#f5f5f5":"white",opacity:o?.6:1,...t?.badgeTitle&&{position:"relative",marginTop:"30px"}},className:"yt-volume-horizontal-tier-container "+(S===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(w?0:2),"data-discounted-price":n.discounted.toFixed(w?0:2)},t.badgeTitle&&e.createElement(Zs,{primaryTextColorCta:ye,primaryBackgroundColorCta:ue,style:{lineHeight:"normal",position:"absolute",top:"-16.5px",left:"2%",right:"2%",marginInline:"auto"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Ys,{cornerRadiusType:d?.cornerRadiusType??"",style:{borderRadius:he,borderBottomLeftRadius:he,borderBottomRightRadius:he},className:"yt-volume-horizontal-tier-header"},e.createElement(Xs,{className:"yt-volume-horizontal-tier-info"},e.createElement(sd,{"data-active":S===t.tier,accentColor:ue,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(dd,{name:"tier",checked:S===t.tier,onChange:()=>!o&&N(t.tier),disabled:o,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(pd,{accentColor:ue,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(Js,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(ed,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Pack of ",t.minimumQuantity,", Get"," ","amountOff"===d.discountType&&Tm(b.general.currencySymbol,d.storeCurrencyCode),`${t.discountValue}`,"percentOff"===d.discountType&&"fi"," ","Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const r=Tm(b.general.currencySymbol,d.storeCurrencyCode);let o="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(o="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${r}${km(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(o="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${r}${km(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(o="percentOff"===d?.discountType?`${n.discountValue}% Off`:`Save ${r}${km(n.discountValue)}`);return o?e.createElement(Ks,{primaryBackgroundColorCta:ue,isSelected:S===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":d?.discountType},o):null})()),e.createElement(td,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),Z(t.tier)?e.createElement(nd,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(w?0:2),"data-discounted-price":n.discounted.toFixed(w?0:2),"data-savings":r.toFixed(0)},(()=>{const o=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===o)return;let a="",i="";if("unit-price"===o){const e=n.discounted/t.minimumQuantity;a=(n.original/t.minimumQuantity).toFixed(w?0:2),i=e.toFixed(w?0:2)}else"tier-price"===o&&(a=n.original.toFixed(w?0:2),i=n.discounted.toFixed(w?0:2));return e.createElement(e.Fragment,null,r>0?e.createElement(od,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},Tm(b.general.currencySymbol,d.storeCurrencyCode),km(a),"unit-price"===o?"/unit":""):"",e.createElement(rd,{className:"yt-volume-horizontal-tier-discounted-price"},Tm(b.general.currencySymbol,d.storeCurrencyCode),km(i),"unit-price"===o?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),S===t.tier&&e.createElement(ad,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:m.productDetails.variants.edges.length>1||1===m.productDetails.variants.edges.length&&"Default Title"!==m.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:m.productDetails.variants.edges.length>1||1===m.productDetails.variants.edges.length&&"Default Title"!==m.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,r)=>{const a=t.tier-1,i=(I[a]||[])[r]||m.productDetails.options?.map(e=>e.values[0])||[],l=m?.productDetails?.options.some(e=>e.values.length>1)||1===m?.productDetails?.variants?.edges?.length&&"Default Title"!==m?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:r,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},l&&e.createElement(md,{src:Sm(re(m,B,r,t.tier)),onClick:e=>{if(b?.general?.redirectToPDP&&m?.productDetails?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${m.productDetails.handle}`}},alt:m?.productDetails?.title||"Product",style:{height:"64px",width:"auto",cursor:b?.general?.redirectToPDP?"pointer":"default"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===b?.volumeBundle?.variantSelectorType||"dropdown"===b?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},m?.productDetails?.options?.map((n,l)=>{const c=n.values.filter(e=>m.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[l]===e));if(0===c.length||1===c.length&&"Default Title"===c[0])return null;const s=M?.tier===t.tier&&M?.index===r&&M?.optionIndex===l,p=d?.variantOptions?.options?.find(e=>e.name===n.name);let u="";return"color"===p?.type&&(u=p?.values?.find(e=>e.name===i[l])?.value||""),e.createElement(yd,{key:l,ref:e=>{U.current[r]||(U.current[r]=[]),U.current[r][l]=e},style:{zIndex:s?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:s,onClick:e=>{e.preventDefault(),e.stopPropagation()}},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(xd,{onClick:e=>{e.stopPropagation(),e.preventDefault(),V(s?null:{tier:t.tier,index:r,optionIndex:l})},isActive:s,disabled:o},"color"===p?.type&&u&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:u||"transparent",border:"1px solid #ddd"}}),i[l],e.createElement(Ie,{style:{display:"block"}})),s&&e.createElement(hd,{style:{zIndex:1001}},c.map((n,c)=>{const s=[...i];s[l]=n;const d=Y(t.tier,r,i,l,n),u=!d||o;if(!1===b?.general?.showOutOfStockVariants&&!d)return null;m.productDetails.variants.edges.find(({node:e})=>e.title===s.join(" / "));const g=e=>{if(e.preventDefault(),e.stopPropagation(),P(e=>{const t={...e},n=[...t[a]||[]];return n[r]=s,t[a]=n,t}),u){q({tier:S,index:r,optionIndex:l,value:n}),V(null);const e=s.join(" / "),o=m.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||B;return void K(t.tier,r,o)}const o=s.join(" / "),i=m.productDetails.variants.edges.find(e=>e.node.title===o)?.node.id||B;K(t.tier,r,i),V(null)},f=p?.values.find(e=>e.name===n);return"image"===p?.type&&f?.value?e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},e.createElement(gd,{src:f.value,alt:n}),n):"color"===p?.type&&f?.value?e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},e.createElement(fd,{style:{backgroundColor:f.value}}),n):e.createElement(ud,{key:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(e)},style:{cursor:"pointer"}},n)})))})),"swatches"===b?.volumeBundle?.variantSelectorType&&e.createElement(id,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},m?.productDetails?.options.map((n,l)=>{const c=n.values.filter(e=>m.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[l]===e));if(0===c.length||1===c.length&&"Default Title"===c[0])return null;const s=d.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},c.map(n=>{const c=i[l]===n,d=Y(t.tier,r,i,l,n),p=!d||o;if(!1===b?.general?.showOutOfStockVariants&&!d)return null;const u=s?.values.find(e=>e.name===n),g=e=>{if(e.preventDefault(),e.stopPropagation(),p)return;const o=[...i];o[l]=n,P(e=>{const t={...e},n=[...t[a]||[]];return n[r]=o,t[a]=n,t});const c=o.join(" / "),s=m.productDetails.variants.edges.find(e=>e.node.title===c)?.node.id||B;K(t.tier,r,s)},f={opacity:p?.5:1,cursor:p?"not-allowed":"pointer"};return"color"===s?.type&&u?.value?e.createElement("button",{key:n,onClick:g,style:{...f,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:c?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button"+(c?" yt-volume-horizontal-tier-variant-color-button--selected":""),disabled:p},e.createElement("div",{style:{width:c?"24px":"20px",height:c?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===s?.type&&u?.value?e.createElement("button",{key:n,onClick:g,style:{...f,border:c?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:c?"#F7F7F7":"transparent",padding:"0px",width:c?"20px":"18px",height:c?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button"+(c?" yt-volume-horizontal-tier-variant-image-button--selected":""),disabled:p},e.createElement("img",{src:u.value,alt:n,style:{width:c?"26px":"24px",height:c?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ld,{key:n,isSelected:c,onClick:g,style:{...f,padding:"4px 8px",border:c?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:c?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default"+(c?" yt-volume-horizontal-tier-variant-button-default--selected":""),disabled:p},n)})))})))})),j&&j.tier===t.tier&&e.createElement("div",{style:{color:ue,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ue}1A`,padding:"12px",borderBottomLeftRadius:he,borderBottomRightRadius:he}},"There aren’t enough items in our stock for select option, please select smaller bundle."),S===t.tier&&de(t)&&(()=>{if("horizontal"===b?.volumeBundle?.cardStyle)return null;const n=de(t),r=W[t.tier],o=n.productDetails.variants.edges.find(e=>e.node.id===r)?.node||n.productDetails.variants.edges[0]?.node,a=b?.volumeBundle?.freebieDisplayType;return"compact"===a?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:ge||"#928d8d",borderBottomLeftRadius:he,borderBottomRightRadius:he},className:"yt-volume-tier-freebie-detailed-section"},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:500},className:"yt-volume-tier-freebie-detailed-product-details"},e.createElement("strong",null,"+ FREE")," ",n.productDetails.title," worth"," ",km(o?.price)),e.createElement("span",{className:"yt-volume-tier-freebie-detailed-gift-icon",style:{color:"#fff",fontSize:"16px"}},e.createElement(je,{fill:"white"}))):e.createElement("div",{className:"yt-volume-freebie-compact-section",style:{padding:"12px 16px",borderTop:"1px solid #f0f0f0",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",gap:"12px",borderBottomLeftRadius:he,borderBottomRightRadius:he,paddingBottom:"20px"}},e.createElement("div",{style:{position:"relative",width:"56px",height:"56px",flexShrink:0},className:"yt-volume-freebie-compact-product-image"},e.createElement(md,{src:Sm(o?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,onClick:e=>{if(b?.general?.redirectToPDP&&n?.productDetails?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.productDetails.handle}`}},style:{cursor:b?.general?.redirectToPDP?"pointer":"default",height:"64px",width:"auto",objectFit:"cover",borderRadius:"6px"}})),e.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px"},className:"yt-volume-freebie-compact-product-details"},e.createElement("span",{style:{background:"#1a1a1a",color:"#fff",fontSize:"10px",fontWeight:600,padding:"2px 7px",borderRadius:"4px",display:"inline-block",width:"fit-content"}},"+ FREE"),e.createElement("span",{style:{fontSize:"14px",fontWeight:500}},n.productDetails.title),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},o?.title)))})()))})),(()=>{if(!k.some(e=>de(e)))return null;const t=k.find(e=>e.tier===S),n=t?de(t):null,r=k.find(e=>de(e)),o=r?.title||`Pack of ${r?.minimumQuantity}`,a=n&&"detailed"===b?.volumeBundle?.freebieDisplayType;let i=null;if(a){const e=W[t.tier];i=n.productDetails.variants.edges.find(t=>t.node.id===e)?.node||n.productDetails.variants.edges[0]?.node}return e.createElement("div",{style:{marginTop:"16px",marginBottom:d?.showCta?"16px":"0px",padding:a?"8px":"10px 12px",backgroundColor:`${ue}20`,border:"1px dashed #333",borderRadius:"8px",display:"flex",alignItems:"center",gap:"12px"},className:"yt-volume-freebie-status-banner"},a?e.createElement("div",{style:{display:"flex",gap:"12px",width:"100%",alignItems:"center"},className:"yt-volume-freebie-detailed-banner-container"},e.createElement("div",{style:{position:"relative",width:"60px",height:"60px",flexShrink:0,backgroundColor:"#eee",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image-container"},e.createElement("img",{src:Sm(i?.image?.url||n.productDetails.featuredMedia.preview.image.url),alt:n.productDetails.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"},className:"yt-volume-freebie-detailed-banner-image"}),e.createElement("div",{style:{position:"absolute",bottom:"-4px",right:"-4px",backgroundColor:"#fff",border:"1px solid #333",borderRadius:"4px",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2},className:"yt-volume-freebie-detailed-banner-gift-overlay"},e.createElement(je,{color:"#333",size:12}))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},className:"yt-volume-freebie-detailed-banner-text-container"},e.createElement("div",{style:{backgroundColor:"#333",color:"#fff",fontSize:"9px",fontWeight:"600",padding:"2px 6px",borderRadius:"4px",width:"fit-content"},className:"yt-volume-freebie-detailed-banner-pill"},"+ FREE — included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"),e.createElement("span",{style:{fontSize:"14px",fontWeight:"bold",color:"#111",lineHeight:"1.2",marginTop:"2px"},className:"yt-volume-freebie-detailed-banner-title"},n.productDetails.title),i?.title&&"Default Title"!==i.title&&e.createElement("span",{style:{fontSize:"12px",color:"#666",lineHeight:"1"},className:"yt-volume-freebie-detailed-banner-variant"},i.title))):e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:ue||"#ff4d94",borderRadius:"4px",width:"24px",height:"24px",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},className:"yt-volume-freebie-compact-banner-icon"},e.createElement(qe,{color:"#fff",size:16})),e.createElement("div",{style:{fontSize:"14px",color:"#111",lineHeight:"1.3"},className:"yt-volume-freebie-compact-banner-text"},n?e.createElement(e.Fragment,null,e.createElement("strong",null,"Free ",n.productDetails.title)," ","— included in"," ",t?.title||`Pack of ${t?.minimumQuantity}`,"!"):e.createElement("span",{style:{fontWeight:500}},"Select ",e.createElement("strong",null,o)," to unlock a free gift."))))})(),d?.showCta&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(cd,{bgColor:X(S)?b.general?.ctaBackgroundColor:"#ccc",textColor:X(S)?b.general?.ctaTextColor:"#666",border:`1px solid ${X(S)?b.general?.ctaBorderColor||"#121212":"#999"}`,shadow:b.general.ctaShadowType,padding:b.general?.ctaPadding,width:b.general?.ctaWidth,hoverProperties:{customizeHoverState:!!X(S)&&b.general?.customizeHoverState,backgroundColor:b.general?.ctaHoverBackgroundColor,textColor:b.general?.ctaHoverTextColor},onClick:async()=>{d?.personalizedForm?.title?L(!0):await oe()},borderRadius:b.general.ctaBorderRadius??"",disabled:D||!X(S),className:"yt-volume-add-to-cart-button"},X(S)?e.createElement(e.Fragment,null,D?e.createElement(fe,{color:"white",loading:D,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,b.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=ne(S);return e.createElement(e.Fragment,null,Tm(b.general.currencySymbol,d.storeCurrencyCode),km(t.discounted.toFixed(w?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Tm(b.general.currencySymbol,d.storeCurrencyCode),km(t?.original.toFixed(w?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))),d?.personalizedForm?.title&&e.createElement(Vs,{isOpen:_,onClose:()=>L(!1),formConfig:d.personalizedForm,onCheckout:async e=>{await oe(e),L(!1)},cta:{backgroundColor:b.general?.ctaBackgroundColor||"#121212",textColor:b.general?.ctaTextColor||"#FFFFFF"},isMobile:R}))}const vd=s.div`
|
|
3465
3465
|
container-type: inline-size;
|
|
3466
3466
|
border-radius: ${e=>e.borderRadius?e.borderRadius:"8px"};
|
|
3467
3467
|
max-width: 800px;
|
|
@@ -3985,7 +3985,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
3985
3985
|
font-size: 11px;
|
|
3986
3986
|
padding: 4px 8px;
|
|
3987
3987
|
}
|
|
3988
|
-
`,Jd=({bundle:a,addToCartFunction:i,dispatchAnalyticsEvent:l})=>{const[c,s]=t({}),[d,p]=t(!1),[m,u]=t(!1),[g,f]=t(0),[y,x]=t(0),[h,b]=t(""),[w,v]=t([]),[C,E]=t({}),[k,T]=t(!1),[S,N]=t(window.innerWidth<450),B=a.builderTiers?.productTier||[],F=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),z=a.customizations,$=z?.comboBundle?.discountBadgeDisplay||"discount-on-compare",I=z?.comboBundle?.discountBadgeVisibility??!0,{originalPrice:P,dealPrice:D,offerValue:_,offerPercentage:L}=r(()=>{const e=[];let t=0;Object.values(c).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,r=0;for(const{productId:t,variantId:o}of e){const e=a.products.find(e=>e.productId===t);if(!e)continue;const i=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===o)?.node;if(!i)continue;const l=Number.parseFloat(i?.price||"0"),c=Number.parseFloat(i?.compareAtPrice||"0");n+=l,r+=c>0?c:l}let o=n;(t===B.length||a?.dealAmount)&&(a?.percentageOff?o=n*(1-a.percentageOff/100):a?.dealAmount?o=a.dealAmount:a?.amountOff&&a.amountOff<n&&(o=n-a.amountOff));const i=!1===I?n:"discount-on-price"===$?n:r||n,l=i-o,s=i>0?Math.round((i-o)/i*100):0;return{originalPrice:i.toFixed(2),dealPrice:o.toFixed(2),offerValue:l.toFixed(2),offerPercentage:s}},[a,c,B.length]);n(()=>{f(B.length-Object.keys(c).length)},[c]),n(()=>{const e={};let t=!1;B.forEach((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o?.variantIds?.[0]||O(o?.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}}),t&&s(t=>({...t,...e}))},[B]),n(()=>{if(null===y||0===B.length)return;const e=B[y].products.map(e=>e.productId),t=new Map;a.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==h.trim()){const e=h.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}v(n)},[h,a.products,y,B]);const R=e=>{const t=a.products.find(t=>t.productId===e);return t?.productDetails},O=e=>{const t=a.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>F(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},M=(e,t)=>{if(null==y)return;const n=t||O(e),r=a.products.find(t=>t.productId===e);if(r){if(0===F(r.productDetails,n))return void console.log("Cannot select out of stock variant")}s(t=>({...t,[y]:{productId:e,variantId:n}})),p(!1),b("")},V=e=>{s(t=>{const n={...t};return delete n[e],n}),E({})},W=e=>{const t=B[e];if(t.isFixed)return;x(e),p(!0),b("");const n=t.products.map(e=>e.productId),r=a.products.filter(e=>n.includes(e.productId)),o=new Map;r.forEach(e=>{o.has(e.productId)||o.set(e.productId,e)}),v(Array.from(o.values()))},H=async e=>{const t=Object.values(c).map(e=>{const t=a.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"mixandmatch-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:t}}),T(!0);try{if(g>0)return console.log("Please select all products"),void T(!1);const t=Object.values(c).map(e=>e.variantId),n=Object.values(c).map(e=>{const t=a.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await i(t.length,t,Number(D),n,e)}catch(e){console.log("Add to cart error:",e)}finally{T(!1)}};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a._id,bundleType:"mixandmatch-bundle"}});const e=()=>{N(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const j=S,q="bundles"===a.appName?a.pageHeader?.title:a?.title,U="bundles"===a.appName?a.pageHeader?.description:a?.subtitle;return e.createElement(e.Fragment,null,e.createElement(vd,{className:"yt-mixMatch-bundle-container",verticalMargin:z.comboBundle.verticalMargin,borderRadius:"20px"},z.comboBundle.embedContentVisibility&&e.createElement(Cd,{className:"yt-mixMatch-bundle-header"},z.comboBundle?.embedContentVisibility&&z.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-mixMatch-title-wrapper",style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:z.comboBundle.infoAlignment||"left"}},e.createElement("h2",{className:"yt-mixMatch-bundle-title",style:{fontSize:"28px",color:z.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},q)),z.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(D)>1&&e.createElement(e.Fragment,null,e.createElement(Ed,{className:"yt-mixMatch-price-container",infoAlignment:z.comboBundle.infoAlignment},e.createElement(kd,{className:"yt-mixMatch-current-price"},Tm(z.general.currencySymbol,a.storeCurrencyCode),km(D)),!1!==I&&Number(D)<Number(P)&&e.createElement(Td,{className:"yt-mixMatch-original-price",style:{minWidth:"fit-content"}},Tm(z.general.currencySymbol,a.storeCurrencyCode)," ",km(P)),Number(_)>0&&!1!==I&&e.createElement(Sd,{className:"yt-mixMatch-savings-badge",style:{minWidth:"fit-content",backgroundColor:"#D3122A",color:"white",padding:"3px 8px",borderRadius:"20px",fontSize:"13px",fontWeight:"500"}},"percentage"===z?.comboBundle?.discountDisplayType?`${L}% Off`:`Save ${Tm(z.general.currencySymbol,a.storeCurrencyCode)}${km(_)}`)),e.createElement(Nd,{className:"yt-mixMatch-tax-info",style:{textAlign:z.comboBundle.infoAlignment||"left",fontSize:z.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(Bd,{className:"yt-mixMatch-products-grid",gridSize:B.length,isHorizontal:j},B.map((t,r)=>{const a=(e=>!!c[e]&&!!c[e].productId)(r),{product:i,variantId:l}=(e=>{const t=c?.[e];return t?{product:R(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(r),s=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(i,l):null,d=t.isFixed,p=o(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),a&&i?e.createElement(Fd,{className:"yt-mixMatch-product-box",key:`tier-${r}`,onClick:()=>!d&&W(r),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:j,infoAlignment:z.comboBundle.infoAlignment},!d&&e.createElement(Ad,{className:"yt-mixMatch-remove-button-icon",onClick:e=>{e.stopPropagation(),V(r)}},"×"),e.createElement($d,{className:"yt-mixMatch-product-image",src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,onClick:e=>{if(z?.general?.redirectToPDP&&i?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${i.handle}`}},style:{cursor:z?.general?.redirectToPDP?"pointer":"default",aspectRatio:z?.general.imageAspectRatio||"1/1"},isHorizontal:j}),e.createElement(Id,{className:"yt-mixMatch-product-info",style:{color:"#1e1e1e",textAlign:"center",...j&&"right"===z.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...j&&"left"===z.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!j&&"left"===z.comboBundle.infoAlignment&&{padding:"0 10px"},...j&&"center"===z.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:j},e.createElement(Dd,{className:"yt-mixMatch-product-variant",style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,i?.title," - ",s?.title)))):e.createElement(zd,{className:"yt-mixMatch-empty-product-box",key:`tier-${r}`,onClick:()=>!d&&W(r),isHorizontal:j,infoAlignment:z.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?e.createElement("div",{className:"yt-mixMatch-fixed-product-placeholder",style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{className:"yt-mixMatch-fixed-product-label",style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{className:"yt-mixMatch-fixed-product-title",style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${r+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-mixMatch-empty-icon-wrapper",style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(_d,{className:"yt-mixMatch-plus-icon"},"+")),e.createElement(Pd,{className:"yt-mixMatch-select-text",style:{fontSize:"15px",fontWeight:"600",color:z.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:j,infoAlignment:z.comboBundle.infoAlignment},e.createElement("p",{className:"yt-mixMatch-select-text-label",style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${r+1}`))))})),e.createElement(Ld,{className:"yt-mixMatch-add-to-cart-button",hoverProperties:{customizeHoverState:z.general.customizeHoverState,backgroundColor:z.general.ctaHoverBackgroundColor,textColor:z.general.ctaHoverTextColor},borderRadius:z.general.ctaBorderRadius,primaryBgColor:z.general.ctaBackgroundColor,onClick:async()=>{0===g&&a?.personalizedForm?.title?u(!0):await H()},textColor:z.general.ctaTextColor,borderColor:z.general.ctaBorderColor},0===g?k?e.createElement(fe,{color:"white",loading:k,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,z.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${g} more item(s)`),z.comboBundle?.embedContentVisibility&&z.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-mixMatch-description-wrapper",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-mixMatch-description-heading",style:{fontSize:"16px",color:z.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:z.general.primaryColor+"20",textAlign:z.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{className:"yt-mixMatch-description-body",style:{fontSize:z.comboBundle.productDescriptionFontSize||"16px",color:z.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:z.general.primaryColor+"08",textAlign:z.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:U}}))),d&&A(e.createElement(Rd,{className:"yt-mixMatch-modal-overlay",onClick:()=>p(!1)},e.createElement(Od,{className:"yt-mixMatch-modal-content",onClick:e=>e.stopPropagation()},e.createElement(Md,{className:"yt-mixMatch-search-container",style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{className:"yt-mixMatch-search-row",style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Vd,{className:"yt-mixMatch-search-input",placeholder:"Search",value:h,onChange:e=>{b(e.target.value)}}),e.createElement(Wd,{className:"yt-mixMatch-cancel-button",onClick:()=>p(!1)},"Cancel")),e.createElement("div",{className:"yt-mixMatch-search-divider",style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{className:"yt-mixMatch-product-list-wrapper",style:{marginBottom:S?"20px":"5px",flex:1,minHeight:0,overflow:"scroll",scrollbarWidth:"none"}},e.createElement(Hd,{className:"yt-mixMatch-product-list",style:{height:"auto",flex:"unset"}},w?.length>0?w?.map(t=>{const n=t?.productDetails;if(!n)return null;const r=(e=>{if(null==y)return!1;const t=c?.[y];return!!t&&t.productId===e})(t.productId),o=O(t.productId);let i=o||"";return i=r&&null!==y?c?.[y]?.variantId||i:C[t.productId]||o,e.createElement(jd,{className:"mixAndMatch-product-item",primaryBgColor:z.general.primaryColor||"#1e1e1e",key:n.id,isSelected:r,onClick:()=>{M(t.productId,i)}},e.createElement(qd,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Ud,{className:"mixAndMatch-vendor-info"},e.createElement(Qd,{className:"mixAndMatch-vendor-name"},n.title),"ratingOnly"===z?.comboBundle?.mixAndMatchProductRatingsDisplay&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"mixAndMatch-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"2px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===z?.comboBundle?.mixAndMatchProductRatingsDisplay&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"mixAndMatch-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"2px",paddingBottom:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"mixAndMatch-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),e.createElement(Xd,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:o})=>{const a=0===F(n,o.id);return!1===z?.general?.showOutOfStockVariants&&a?null:e.createElement(Kd,{className:"mixAndMatch-variant-button "+(i===o.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:z.general?.primaryColor,disabled:!!r||a,key:o.id,isSelected:i===o.id,tierHasProductId:!!r,onClick:e=>{var n,r;e.stopPropagation(),a||(n=t.productId,r=o.id,E(e=>({...e,[n]:r})))},style:{opacity:a?.5:1,cursor:a?"not-allowed":"pointer"}},o.title)}))),e.createElement(Zd,{className:"yt-mixMatch-add-to-bundle",cornerRadiusType:a?.cornerRadiusType??"",primaryBgColor:z.general?.primaryColor||"#1e1e1e",onClick:()=>r?V(y||0):M(t.productId,i)},r?e.createElement(Gd,null,"Added"):" + Add"))}):e.createElement(Yd,{className:"yt-mixMatch-no-results-message"},'No products found matching "',h,'"'))))),document.body),a?.personalizedForm?.title&&e.createElement(Vs,{isOpen:m,onClose:()=>u(!1),formConfig:a.personalizedForm,onCheckout:async e=>{await H(e),u(!1)},cta:{backgroundColor:z.general?.ctaBackgroundColor||"#121212",textColor:z.general?.ctaTextColor||"#FFFFFF"},isMobile:S}))},ep=s.div`
|
|
3988
|
+
`,Jd=({bundle:a,addToCartFunction:i,dispatchAnalyticsEvent:l})=>{const c=r(()=>{if(!a)return a;const e=a.products?.filter(e=>{const t=e?.productDetails?.status?.toLowerCase();return!t||("active"===t||"unlisted"===t)})||[];return{...a,products:e}},[a]),[s,d]=t({}),[p,m]=t(!1),[u,g]=t(!1),[f,y]=t(0),[x,h]=t(0),[b,w]=t(""),[v,C]=t([]),[E,k]=t({}),[T,S]=t(!1),[N,B]=t(window.innerWidth<450),F=c.builderTiers?.productTier||[],z=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),$=c.customizations,I=$?.comboBundle?.discountBadgeDisplay||"discount-on-compare",P=$?.comboBundle?.discountBadgeVisibility??!0,{originalPrice:D,dealPrice:_,offerValue:L,offerPercentage:R}=r(()=>{const e=[];let t=0;Object.values(s).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,r=0;for(const{productId:t,variantId:o}of e){const e=c.products.find(e=>e.productId===t);if(!e)continue;const a=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===o)?.node;if(!a)continue;const i=Number.parseFloat(a?.price||"0"),l=Number.parseFloat(a?.compareAtPrice||"0");n+=i,r+=l>0?l:i}let o=n;(t===F.length||c?.dealAmount)&&(c?.percentageOff?o=n*(1-c.percentageOff/100):c?.dealAmount?o=c.dealAmount:c?.amountOff&&c.amountOff<n&&(o=n-c.amountOff));const a=!1===P?n:"discount-on-price"===I?n:r||n,i=a-o,l=a>0?Math.round((a-o)/a*100):0;return{originalPrice:a.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2),offerPercentage:l}},[c,s,F.length]);n(()=>{y(F.length-Object.keys(s).length)},[s]),n(()=>{const e={};let t=!1;F.forEach((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o?.variantIds?.[0]||M(o?.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}}),t&&d(t=>({...t,...e}))},[F]),n(()=>{if(null===x||0===F.length)return;const e=F[x].products.map(e=>e.productId),t=new Map;c.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==b.trim()){const e=b.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}C(n)},[b,c.products,x,F]);const O=e=>{const t=c.products.find(t=>t.productId===e);return t?.productDetails},M=e=>{const t=c.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>z(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},V=(e,t)=>{if(null==x)return;const n=t||M(e),r=c.products.find(t=>t.productId===e);if(r){if(0===z(r.productDetails,n))return void console.log("Cannot select out of stock variant")}d(t=>({...t,[x]:{productId:e,variantId:n}})),m(!1),w("")},W=e=>{d(t=>{const n={...t};return delete n[e],n}),k({})},H=e=>{const t=F[e];if(t.isFixed)return;h(e),m(!0),w("");const n=t.products.map(e=>e.productId),r=c.products.filter(e=>n.includes(e.productId)),o=new Map;r.forEach(e=>{o.has(e.productId)||o.set(e.productId,e)}),C(Array.from(o.values()))},j=async e=>{const t=Object.values(s).map(e=>{const t=c.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:c._id,bundleType:"mixandmatch-bundle",byobBundleType:c.builderTiers?.type??"builder",selectedProducts:t}}),S(!0);try{if(f>0)return console.log("Please select all products"),void S(!1);const t=Object.values(s).map(e=>e.variantId),n=Object.values(s).map(e=>{const t=c.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await i(t.length,t,Number(_),n,e)}catch(e){console.log("Add to cart error:",e)}finally{S(!1)}};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:c._id,bundleType:"mixandmatch-bundle"}});const e=()=>{B(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const q=N,U="bundles"===c.appName?c.pageHeader?.title:c?.title,Q="bundles"===c.appName?c.pageHeader?.description:c?.subtitle;return e.createElement(e.Fragment,null,e.createElement(vd,{className:"yt-mixMatch-bundle-container",verticalMargin:$.comboBundle.verticalMargin,borderRadius:"20px"},$.comboBundle.embedContentVisibility&&e.createElement(Cd,{className:"yt-mixMatch-bundle-header"},$.comboBundle?.embedContentVisibility&&$.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-mixMatch-title-wrapper",style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:$.comboBundle.infoAlignment||"left"}},e.createElement("h2",{className:"yt-mixMatch-bundle-title",style:{fontSize:"28px",color:$.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},U)),$.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(_)>1&&e.createElement(e.Fragment,null,e.createElement(Ed,{className:"yt-mixMatch-price-container",infoAlignment:$.comboBundle.infoAlignment},e.createElement(kd,{className:"yt-mixMatch-current-price"},Tm($.general.currencySymbol,c.storeCurrencyCode),km(_)),!1!==P&&Number(_)<Number(D)&&e.createElement(Td,{className:"yt-mixMatch-original-price",style:{minWidth:"fit-content"}},Tm($.general.currencySymbol,c.storeCurrencyCode)," ",km(D)),Number(L)>0&&!1!==P&&e.createElement(Sd,{className:"yt-mixMatch-savings-badge",style:{minWidth:"fit-content",backgroundColor:"#D3122A",color:"white",padding:"3px 8px",borderRadius:"20px",fontSize:"13px",fontWeight:"500"}},"percentage"===$?.comboBundle?.discountDisplayType?`${R}% Off`:`Save ${Tm($.general.currencySymbol,c.storeCurrencyCode)}${km(L)}`)),e.createElement(Nd,{className:"yt-mixMatch-tax-info",style:{textAlign:$.comboBundle.infoAlignment||"left",fontSize:$.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(Bd,{className:"yt-mixMatch-products-grid",gridSize:F.length,isHorizontal:q},F.map((t,r)=>{const a=(e=>!!s[e]&&!!s[e].productId)(r),{product:i,variantId:l}=(e=>{const t=s?.[e];return t?{product:O(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(r),c=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(i,l):null,d=t.isFixed,p=o(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")},[c?.displayName,c?.title]),a&&i?e.createElement(Fd,{className:"yt-mixMatch-product-box",key:`tier-${r}`,onClick:()=>!d&&H(r),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:q,infoAlignment:$.comboBundle.infoAlignment},!d&&e.createElement(Ad,{className:"yt-mixMatch-remove-button-icon",onClick:e=>{e.stopPropagation(),W(r)}},"×"),e.createElement($d,{className:"yt-mixMatch-product-image",src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,onClick:e=>{if($?.general?.redirectToPDP&&i?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${i.handle}`}},style:{cursor:$?.general?.redirectToPDP?"pointer":"default",aspectRatio:$?.general.imageAspectRatio||"1/1"},isHorizontal:q}),e.createElement(Id,{className:"yt-mixMatch-product-info",style:{color:"#1e1e1e",textAlign:"center",...q&&"right"===$.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...q&&"left"===$.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!q&&"left"===$.comboBundle.infoAlignment&&{padding:"0 10px"},...q&&"center"===$.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:q},e.createElement(Dd,{className:"yt-mixMatch-product-variant",style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,i?.title," - ",c?.title)))):e.createElement(zd,{className:"yt-mixMatch-empty-product-box",key:`tier-${r}`,onClick:()=>!d&&H(r),isHorizontal:q,infoAlignment:$.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?e.createElement("div",{className:"yt-mixMatch-fixed-product-placeholder",style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{className:"yt-mixMatch-fixed-product-label",style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{className:"yt-mixMatch-fixed-product-title",style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${r+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-mixMatch-empty-icon-wrapper",style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(_d,{className:"yt-mixMatch-plus-icon"},"+")),e.createElement(Pd,{className:"yt-mixMatch-select-text",style:{fontSize:"15px",fontWeight:"600",color:$.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:q,infoAlignment:$.comboBundle.infoAlignment},e.createElement("p",{className:"yt-mixMatch-select-text-label",style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${r+1}`))))})),e.createElement(Ld,{className:"yt-mixMatch-add-to-cart-button",hoverProperties:{customizeHoverState:$.general.customizeHoverState,backgroundColor:$.general.ctaHoverBackgroundColor,textColor:$.general.ctaHoverTextColor},borderRadius:$.general.ctaBorderRadius,primaryBgColor:$.general.ctaBackgroundColor,onClick:async()=>{0===f&&c?.personalizedForm?.title?g(!0):await j()},textColor:$.general.ctaTextColor,borderColor:$.general.ctaBorderColor},0===f?T?e.createElement(fe,{color:"white",loading:T,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,$.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${f} more item(s)`),$.comboBundle?.embedContentVisibility&&$.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-mixMatch-description-wrapper",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-mixMatch-description-heading",style:{fontSize:"16px",color:$.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:$.general.primaryColor+"20",textAlign:$.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{className:"yt-mixMatch-description-body",style:{fontSize:$.comboBundle.productDescriptionFontSize||"16px",color:$.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:$.general.primaryColor+"08",textAlign:$.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:Q}}))),p&&A(e.createElement(Rd,{className:"yt-mixMatch-modal-overlay",onClick:()=>m(!1)},e.createElement(Od,{className:"yt-mixMatch-modal-content",onClick:e=>e.stopPropagation()},e.createElement(Md,{className:"yt-mixMatch-search-container",style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{className:"yt-mixMatch-search-row",style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Vd,{className:"yt-mixMatch-search-input",placeholder:"Search",value:b,onChange:e=>{w(e.target.value)}}),e.createElement(Wd,{className:"yt-mixMatch-cancel-button",onClick:()=>m(!1)},"Cancel")),e.createElement("div",{className:"yt-mixMatch-search-divider",style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{className:"yt-mixMatch-product-list-wrapper",style:{marginBottom:N?"20px":"5px",flex:1,minHeight:0,overflow:"scroll",scrollbarWidth:"none"}},e.createElement(Hd,{className:"yt-mixMatch-product-list",style:{height:"auto",flex:"unset"}},v?.length>0?v?.map(t=>{const n=t?.productDetails;if(!n)return null;const r=(e=>{if(null==x)return!1;const t=s?.[x];return!!t&&t.productId===e})(t.productId),o=M(t.productId);let a=o||"";return a=r&&null!==x?s?.[x]?.variantId||a:E[t.productId]||o,e.createElement(jd,{className:"mixAndMatch-product-item",primaryBgColor:$.general.primaryColor||"#1e1e1e",key:n.id,isSelected:r,onClick:()=>{V(t.productId,a)}},e.createElement(qd,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Ud,{className:"mixAndMatch-vendor-info"},e.createElement(Qd,{className:"mixAndMatch-vendor-name"},n.title),"ratingOnly"===$?.comboBundle?.mixAndMatchProductRatingsDisplay&&(t?.productDetails.rating?.averageRating??0)>0&&e.createElement("div",{className:"mixAndMatch-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"2px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},t?.productDetails?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===$?.comboBundle?.mixAndMatchProductRatingsDisplay&&(t?.productDetails?.rating?.averageRating??0)>0&&e.createElement("div",{className:"mixAndMatch-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"12px",color:"#3f3f3f",paddingTop:"2px",paddingBottom:"6px",lineHeight:"normal",fontWeight:"500"}},e.createElement($e,{color:"gold",size:14})," ",t?.productDetails?.rating?.averageRating,e.createElement(ke,{className:"mixAndMatch-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",t?.productDetails?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),e.createElement(Xd,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:o})=>{const i=0===z(n,o.id);return!1===$?.general?.showOutOfStockVariants&&i?null:e.createElement(Kd,{className:"mixAndMatch-variant-button "+(a===o.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:$.general?.primaryColor,disabled:!!r||i,key:o.id,isSelected:a===o.id,tierHasProductId:!!r,onClick:e=>{var n,r;e.stopPropagation(),i||(n=t.productId,r=o.id,k(e=>({...e,[n]:r})))},style:{opacity:i?.5:1,cursor:i?"not-allowed":"pointer"}},o.title)}))),e.createElement(Zd,{className:"yt-mixMatch-add-to-bundle",cornerRadiusType:c?.cornerRadiusType??"",primaryBgColor:$.general?.primaryColor||"#1e1e1e",onClick:()=>r?W(x||0):V(t.productId,a)},r?e.createElement(Gd,null,"Added"):" + Add"))}):e.createElement(Yd,{className:"yt-mixMatch-no-results-message"},'No products found matching "',b,'"'))))),document.body),c?.personalizedForm?.title&&e.createElement(Vs,{isOpen:u,onClose:()=>g(!1),formConfig:c.personalizedForm,onCheckout:async e=>{await j(e),g(!1)},cta:{backgroundColor:$.general?.ctaBackgroundColor||"#121212",textColor:$.general?.ctaTextColor||"#FFFFFF"},isMobile:N}))},ep=s.div`
|
|
3989
3989
|
border-radius: 8px;
|
|
3990
3990
|
container-type: inline-size;
|
|
3991
3991
|
`,tp=s.div`
|
|
@@ -4640,7 +4640,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as a
|
|
|
4640
4640
|
}
|
|
4641
4641
|
`,om=s.span`
|
|
4642
4642
|
font-size: 12px;
|
|
4643
|
-
`,am=({productsWithIndices:o,isOpen:a,onClose:i,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:m,showOutOfStockVariants:u=!0})=>{const g=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[f,y]=t({}),[x,h]=t({});n(()=>{const e={},t={};o?.forEach(({product:n,index:r})=>{let o,a=[];if(n.productId===p&&m){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(m))?.node;e&&g(n.productDetails,e.id)>0&&(a=e.title.split(" / "),o=e)}if(!a.length){const e=n.productDetails.variants.edges.find(e=>g(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(a=e.title.split(" / "),o=e):a=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[r]=a,o&&(t[r]={node:o},s(r,o.id))}),y(e),h(t)},[o,p,m,s,g]),n(()=>{if(!p||!m)return;const e=o?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,r=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(m))?.node;if(r&&g(t.productDetails,r.id)>0){const e=r.title.split(" / ");y(t=>({...t,[n]:e})),h(e=>({...e,[n]:{node:r}})),s(n,r.id)}},[m,p,o,s,g]);const b=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&g(r.productDetails,i.id)>0},w=(e,t,n)=>{const{product:r}=o?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!r?.productDetails)return;if(!b(e,n,t,r))return;const a={...f};a[e][n]=t,y(a);const i=r?.productDetails?.variants?.edges?.find(t=>t.node.title===a[e].join(" / "))?.node;i&&(s(e,i.id),h(t=>({...t,[e]:{node:i}})))};if(!a)return null;const v=e.createElement(jp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:i},e.createElement(qp,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Up,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),o?.map(({product:t,index:n},r)=>e.createElement(e.Fragment,null,e.createElement(Zp,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Gp,{className:"yt-fixedBundle-variant-modal_thumbnail",src:x[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Yp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Xp,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(Jp,{className:"yt-fixedBundle-variant-modal_selected-value"},f[n]?.join(" / "))),t.productDetails.options.map((r,o)=>{const a=c&&c?.options?.find(e=>e.name===r.name),i=r.values.filter(e=>!!t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[o]===e)&&!(!1===u&&!b(n,o,e,t)));return 0===i.length||1===i.length&&"Default Title"===i[0]?e.createElement(e.Fragment,null):a&&"color"===a?.type?e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,a.values.find(e=>e.name===r)?.value?e.createElement(tm,{className:"yt-fixedBundle-variant-modal_color-swatch",key:i,color:a.values.find(e=>e.name===r)?.value||r,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},e.createElement("span",null)):e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},r))})):a&&"image"===a?.type?e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,a?.values.find(e=>e.name===r)?.value?e.createElement(rm,{className:"yt-fixedBundle-variant-modal_image-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)},src:a.values.find(e=>e.name===r)?.value}):e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},r))})):e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},"text"===a?.type&&a.values.find(e=>e.name===r)?.value||r)}))}))),r<o.length-1&&e.createElement(Kp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Qp,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return D.createPortal(v,document.body)},im=(e,t=64)=>{if(!e)return"/placeholder.svg";try{const n=new URL(e);return n.searchParams.set("width",String(t)),n.toString()}catch{return e}},lm=({options:r,selectedValue:a,onChange:i,type:l="text"})=>{const[c,s]=t(!1),d=o(null);n(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(Op,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Mp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name,style:{display:"block"}}):null;return e.createElement(Ip,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(Pp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(Dp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},a&&("color"===l||"image"===l)&&p(a),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},a&&a.name)),e.createElement(Ap,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(_p,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},r?.map(t=>e.createElement(Lp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(a?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:a?.name===t.name,onClick:()=>{t.disabled||(i(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(Rp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},cm=({product:r,variantOptions:o,selectedVariants:a,onVariantChange:i,variantId:l,primaryProductId:c,variantType:s="dropdown",accentColor:d="#000000",showOutOfStockVariants:p=!0})=>{const m=(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?.toLocaleLowerCase()?1/0:0:1/0:0},u=(e,t,n)=>{const r=[...g||[]];r[e]=t;const o=r.join(" / "),a=n.variants.edges.find(e=>e.node.title===o)?.node;return!!a&&m(n,a.id)>0},[g,f]=t(a||[]);n(()=>{a&&a.length>0&&f(a)},[a]),n(()=>{if(l&&r.variants.edges.some(e=>e.node.id.includes(l))){const e=r.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");f(t)}}},[l,r]);const y=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},x=(e,t)=>{const n=g[t];if(!n)return null;return h(e,t).find(e=>e.name===n)||null},h=(e,t)=>{const n=o?.options?.find(t=>t.name===e.name);return e.values.filter(e=>r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const o=n?.values?.find(t=>t.name===e),a=!u(t,e,r);return{name:e,value:o?.value||e,disabled:a}}).filter(e=>p||!e.disabled)},b=(e,t)=>e.values.filter(e=>!!r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)&&!(!p&&!u(t,e,r)));return"swatches"===s||"auto"===s?e.createElement(e.Fragment,null,r.options.map((t,n)=>{const a=o?.options?.find(e=>e.name===t.name);return e.createElement("div",{key:t.name,className:"yt-fixedBundle-product-option-group-horizontal",style:{...t?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},r.options.length>1&&b(t,n)?.length>1&&e.createElement("label",{className:"yt-fixedBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},t.name,":"),b(t,n)?.length>1&&e.createElement("div",{className:"yt-fixedBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},b(t,n).map(t=>{const o=[...g];o[n]=t;const l=r.options.length>0?o.join(" / "):o[n],c=r.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?m(r,c.id):0),p=g[n]===t;if("color"===a?.type){const n=a.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-color${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${d}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},n?e.createElement("div",{className:"yt-fixedBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:n}},e.createElement("span",null)):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}if("image"===a?.type){const n=a.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-image${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${d}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},n?e.createElement("img",{className:"yt-fixedBundle-product-option-image",src:im(n),alt:t,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-text${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},"text"===a?.type&&a.values.find(e=>e.name===t)?.value||t)})))})):e.createElement(Vp,{className:"yt-fixedBundle-variant-selector-horizontal_container"},r.options.map((t,n)=>{const o=h(t,n);return 0===o.length||1===o.length&&"Default Title"===o[0].name?null:e.createElement(Wp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(lm,{options:o,selectedValue:x(t,n),onChange:e=>{((e,t)=>{const n=[...g];n[e]=t.name,f(n);const o=r.variants.edges.find(t=>t.node.title===(r.options?.length>0?n.join(" / "):n[e]))?.node.id;i(o||"")})(n,e)},type:y(t.name)}))}))},sm=({qty:t,min:n=1,max:r=1/0,accentColor:o="#121212",onChange:a,borderRadius:i,isMobile:l})=>e.createElement("div",{className:"yt-fixedBundle-qty-selector",style:{display:"inline-flex",alignItems:"center",gap:0,border:`1px solid ${o}`,borderRadius:i??"6px",overflow:"hidden",userSelect:"none"}},e.createElement("button",{type:"button",className:"yt-fixedBundle-qty-btn yt-fixedBundle-qty-btn--minus",onClick:e=>{e.preventDefault(),e.stopPropagation(),t>n&&a(t-1)},disabled:t<=n,style:{width:l?"24px":"28px",height:l?"24px":"28px",display:"flex",alignItems:"center",justifyContent:"center",background:t<=n?"#f0f0f0":o,color:t<=n?"#999":"#fff",border:"none",cursor:t<=n?"not-allowed":"pointer",fontSize:l?"14px":"16px",lineHeight:"normal",transition:"background 0.15s",flexShrink:0},"aria-label":"Decrease quantity"},"-"),e.createElement("span",{className:"yt-fixedBundle-qty-count",style:{minWidth:l?"26px":"32px",textAlign:"center",fontSize:"13px",fontWeight:600,color:"#121212",padding:"0 4px",background:"#fff",lineHeight:l?"24px":"28px",height:l?"24px":"28px",display:"inline-block"}},t),e.createElement("button",{type:"button",className:"yt-fixedBundle-qty-btn yt-fixedBundle-qty-btn--plus",onClick:e=>{e.preventDefault(),e.stopPropagation(),t<r&&a(t+1)},disabled:t>=r,style:{width:l?"24px":"28px",height:l?"24px":"28px",display:"flex",alignItems:"center",justifyContent:"center",background:t>=r?"#f0f0f0":o,color:t>=r?"#999":"#fff",border:"none",cursor:t>=r?"not-allowed":"pointer",fontSize:l?"14px":"16px",lineHeight:"normal",transition:"background 0.15s",flexShrink:0},"aria-label":"Increase quantity"},"+")),dm=({product:o,selectedVariantId:i,isChecked:l,canCustomize:c,styles:s,onVariantChange:d,onCheckChange:p,isMobile:m,isHorizontal:u,index:g,variantOptions:f,productsLength:y,handleOpenVariantModal:x,storeCurrencyCode:h,primaryProductId:b,variantId:w,checkedProducts:v,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T,reviewRatingType:S,qty:N,onQtyChange:B,disableQuantitySelector:F})=>{const z="23e4dd-58.myshopify.com"!==window.Shopify?.shop,$=e=>{const t="string"==typeof e?parseFloat(e):e;return z?t.toFixed(2):Math.round(t).toString()},I=r(()=>e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?o?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[o]),[P,D]=t(o?.variants?.edges.find(e=>I(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node),A=r(()=>P?.title?.split(" / ")||[],[P]),_=o?.id===b;n(()=>{if(o.id===b){const e=o?.variants?.edges?.find(e=>e?.node?.id?.includes(i))?.node;e&&I(e.id)>0&&(D(e),d(e.id))}else{const e=o?.variants?.edges?.find(e=>e?.node?.id===i)?.node||o?.variants?.edges?.find(e=>I(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node;D(e)}},[o,b,i,w,d,I]);const L=a(e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[o,d]),R=s?.fixedBundle?.discountBadgeDisplay,O=parseFloat(P?.price??"0"),M=v?.size===k,V=((e,t,n,r,o,a)=>{if(0===r||!n)return e;if(r!==o)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(a<=0)return e;const t=e/a*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/a);default:return e}})(O,E,C??0,v?.size,k,T),W=M?V:parseFloat(P?.price??"0"),H="discount-on-compare"===R?parseFloat(P?.compareAtPrice||P?.price||"0"):parseFloat(P?.price??"0"),j=s?.fixedBundle?.compareAtPriceVisibility&&H>W,q=$(W*N),U=$(H*N),Q="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,Z=P?.image?.url||o.featuredMedia?.preview?.image?.url,G=I(P?.id??""),X=0===G,K=e.createElement(sm,{qty:N,min:1,max:G===1/0?999:G,accentColor:s?.general?.ctaBackgroundColor,onChange:B,borderRadius:s?.fixedBundle?.borderRadius,isMobile:m}),J=e=>{if(s?.general?.redirectToPDP&&o?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${o.handle}`}};return e.createElement(e.Fragment,null,u?e.createElement("div",{className:`${o.id===b?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"}${X?" yt-fixedBundle-product-card--out-of-stock":""}`,style:{display:"flex",alignItems:"center",gap:"10px"}},c&&e.createElement("div",{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},e.createElement("input",{type:"checkbox",style:{display:"none"},className:"yt-fixedBundle-product-card_checkbox-hidden",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:_}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(Y,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(op,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}80`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${s.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}80`}[s.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(ap,{className:"yt-fixedBundle-product-card-horizontal_image",src:Sm(Z),alt:o.title,onClick:J,style:{cursor:s?.general?.redirectToPDP?"pointer":"default",borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general?.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(ip,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(lp,{className:"yt-fixedBundle-product-card-horizontal_title"},o.title),"ratingOnly"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingBottom:"4px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},o?.rating?.averageRating," ",e.createElement("span",null," rating"))),"ratingAndReviewCount"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingBottom:"4px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(ke,{className:"yt-fixedBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),s.fixedBundle.productsPriceVisibility&&e.createElement(cp,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(sp,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Tm(s.general.currencySymbol)," ",km(q)),j&&H>W&&e.createElement(dp,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Tm(s.general.currencySymbol),km(U))),e.createElement(cm,{product:o,variantOptions:f,selectedVariants:A,onVariantChange:L,variantId:w,primaryProductId:b,variantType:s?.fixedBundle?.variantSelectorType,accentColor:s?.general?.ctaBackgroundColor,showOutOfStockVariants:!1!==s?.general?.showOutOfStockVariants}),m&&!F&&e.createElement("div",{style:{marginTop:"10px"},className:"yt-fixedBundle-qty-selector-wrapper-horizontal"},K)),!m&&!F&&e.createElement("div",{style:{marginRight:"20px"},className:"yt-fixedBundle-qty-selector-wrapper-horizontal"},K))):e.createElement(e.Fragment,null,e.createElement(bp,{className:`${o.id===b?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"}${X?" yt-fixedBundle-product-card--out-of-stock":""}`,productsLength:y,style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}50`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${s.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}50`}[s.fixedBundle.shadowType]||"none",...(c||!F&&!m)&&{position:"relative"},...Q&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.fixedBundle?.cardBackgroundColor},!m&&!F&&e.createElement("div",{style:{position:"absolute",left:"5px",top:"5px",zIndex:"10"},className:"yt-fixedBundle-qty-selector-wrapper-vertical"},K),c&&e.createElement(Hp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:Q,showQtySelector:!F},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:_}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(Y,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(wp,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",onClick:J,style:{cursor:s?.general?.redirectToPDP?"pointer":"default",aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(vp,{className:"yt-fixedBundle-product-card_image--vertical",src:Sm(Z),style:{aspectRatio:s.general.imageAspectRatio},alt:o.title}),o.variants.edges.length>1&&e.createElement(Cp,{onClick:x,as:"button",className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Ep,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(kp,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(Tp,{className:"yt-fixedBundle-product-card_count-badge"},o.variants.edges.length,"+"))),e.createElement(Sp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Np,{className:"yt-fixedBundle-product-card-vertical_title"},o.title),"ratingOnly"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingTop:"4px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},o?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingTop:"4px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(ke,{className:"yt-fixedBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),s.fixedBundle.productsPriceVisibility&&e.createElement(Fp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(Bp,{className:"yt-fixedBundle-product-card-vertical_price--new"},Tm(s.general.currencySymbol),km(q)),s.fixedBundle.compareAtPriceVisibility&&j&&H>W&&e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--old"},Tm(s.general.currencySymbol),km(U))),m&&!F&&e.createElement("div",{style:{marginTop:"6px"},className:"yt-fixedBundle-qty-selector-wrapper-vertical"},K))),(y<=3||!m)&&g<y-1&&e.createElement(zp,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement($p,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},pm=({bundle:o,addToCartFunction:i,dispatchAnalyticsEvent:l})=>{const c=r(()=>{if(!o.products.some(e=>e.quantity&&e.quantity>1))return o;const e=o.products.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:e}},[o]),[s,d]=t(!1),[p,m]=t(window.innerWidth<786),[u,g]=t(null),[f,y]=t(!1),[x,h]=t(!1),b="undefined"!=typeof window?window.location.href:null,w=c?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=w?.productId,C=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[E,k]=t(Object.fromEntries(c?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>C(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),[T,S]=t(Object.fromEntries(c?.products?.map((e,t)=>[t.toString(),1]))),N=a((e,t)=>{S(n=>({...n,[e.toString()]:t}))},[]),B="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),F=B?c?.showIndividualProductSelector??!0:c?.showIndividualProductSelector??!1,[z,$]=t(new Set(c.products.reduce((e,t,n)=>(!(t?.productId===v)&&F||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:c._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");g(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&v&&k(e=>{const t={...e};return c?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,c?.products]),n(()=>{const e=()=>{m(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const I=a((e,t)=>{k(n=>({...n,[e.toString()]:t}))},[]),P=(e,t)=>{const n=c.products[t].productId;B&&n===v||$(n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r})},D=r(()=>(e,t)=>C(e.productDetails,t)>0,[C]),A=r(()=>c.products.some((e,t)=>z.has(t)&&e.productDetails.variants.edges.length>1),[c.products,z]),_="23e4dd-58.myshopify.com"!==window.Shopify?.shop,L=e=>{const t="string"==typeof e?parseFloat(e):e;return _?t.toFixed(2):Math.round(t).toString()},R=r(()=>{let e=0;return c.products.forEach((t,n)=>{if(z.has(n)){const r=E[n.toString()],o=t.productDetails.variants.edges.find(e=>e.node.id===r)?.node;o&&(e+=parseFloat(o.price??"0"))}}),e},[c.products,z,E]),{originalPrice:O,dealPrice:M,offerValue:V,totalCompareAtPrice:W,totalPrice:H}=r(()=>{const{price:e,compareAtPrice:t}=c.products.reduce((e,t,n)=>{if(!z.has(n))return e;const r=E[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=T[n.toString()]??1,i=parseFloat(o?.price??"0")*a,l=parseFloat(o?.compareAtPrice||o?.price||"0")*a;return e.price+=i,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=c?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price";let r=e;if(z.size===c.products.length)if(c?.percentageOff)r=e*(1-c.percentageOff/100);else if(c?.dealAmount){const e=Array.from(z).reduce((e,t)=>e+(T[t.toString()]??1),0),t=e/z.size;r=c.dealAmount*t}else c?.amountOff&&(r=e-c.amountOff);const o=c?.customizations?.fixedBundle?.discountBadgeVisibility,a=!1===o?r:"discount-on-compare"===n?t:e,i=a-r;return{originalPrice:L(a),dealPrice:L(r),offerValue:L(i),totalPrice:e,totalCompareAtPrice:t}},[c.products,E,z,T,c.percentageOff,c.dealAmount,c.amountOff,c?.customizations?.fixedBundle?.discountBadgeDisplay,c?.customizations?.fixedBundle?.discountBadgeVisibility]),j=r(()=>c.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>z.has(e)),[c.products,z]),q=j.every(({product:e,index:t})=>D(e,E[t.toString()])),U=async e=>{d(!0),y(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:c._id,bundleType:"fixed-bundle",selectedProducts:j?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(E).flatMap(([e,t])=>{const n=parseInt(e);if(isNaN(n)||!z.has(n))return[];const r=T[e]??1;return Array(r).fill(t)}).filter(Boolean);i&&await i(Number(O),t,Number(M),void 0,e)}catch(e){console.error("Error adding to cart:",e)}d(!1)},Q=async e=>{if(q){if(e&&(e.preventDefault(),e.stopPropagation()),c?.personalizedForm?.title)return y(!1),void h(!0);await U()}};if(!i)return e.createElement(e.Fragment,null);const Z=c.customizations,G=Z.fixedBundle?.cardLayoutStyle||"auto",Y="horizontal"===G||"auto"===G&&p,X="bundles"==c.appName?c.pageHeader?.title:c?.title,K="bundles"==c.appName?c.pageHeader?.description:c?.subtitle;return e.createElement(ep,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:Z.fixedBundle.sectionBackgroundColor,..."transparent"!==Z.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},X&&e.createElement(tp,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:Z.fixedBundle?.titleBackgroundColor||"none",color:Z.fixedBundle?.titleTextColor||"black",textAlign:Z.fixedBundle.infoAlignment??"center",fontSize:Z.fixedBundle?.titleFontSize,..."transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"===Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},X),K&&e.createElement(np,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:Z.fixedBundle?.subtitleFontSize,textAlign:Z.fixedBundle.infoAlignment??"center",..."left"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"===Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},K),Y?e.createElement(rp,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},c?.products?.map((t,n,r)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(dm,{isChecked:z.has(n),product:t.productDetails,selectedVariantId:E[n.toString()]||"",canCustomize:c?.canCustomizeFixedBundle||!1,styles:Z,onVariantChange:e=>I(n,e),onCheckChange:e=>{P(e,n)},isMobile:p,index:n,isHorizontal:Y,variantOptions:c.variantOptions,productsLength:c.products.length,storeCurrencyCode:c.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:c.discountType??"none",checkedProducts:z,bundleProductsCount:c.products.length,bundleDiscountValue:c.percentageOff||c.amountOff||c.dealAmount,totalSelectedOriginal:R,reviewRatingType:Z?.fixedBundle?.productRatingsDisplay??c?.reviewRatingType,qty:T[n.toString()]??1,onQtyChange:e=>N(n,e),disableQuantitySelector:!["falah-devstore.myshopify.com","swashaa.myshopify.com","plush-ind.myshopify.com"].includes(window?.Shopify?.shop??"")||(c?.disableQuantitySelector??!0)}),n<r.length-1&&e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"},className:"yt-fixedBundle-plus-icon-container"},e.createElement("span",{style:{padding:p?"1px":"2px",background:"#0000000D",..."none"!==Z?.fixedBundle?.shadowType&&{marginTop:"2px"},display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},className:"yt-fixedBundle-plus-icon-wrapper"},e.createElement(Le,{color:"black",style:{height:p?"16px":"24px",width:p?"16px":"24px",color:"black",lineHeight:"nomal"},className:"yt-fixedBundle-plus-icon-svg"})))))):e.createElement(xp,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(hp,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===Z.fixedBundle.infoAlignment?"flex-start":"right"===Z.fixedBundle.infoAlignment?"flex-end":"center"}},c?.products?.map((t,n)=>e.createElement(dm,{key:`${t.productId}-${n}`,isChecked:z.has(n),product:t.productDetails,selectedVariantId:E[n.toString()]||"",canCustomize:c?.canCustomizeFixedBundle||!1,styles:Z,onVariantChange:e=>{I(n,e)},onCheckChange:e=>P(e,n),isMobile:p,index:n,isHorizontal:Y,productsLength:c.products.length,storeCurrencyCode:c.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:c.discountType??"none",checkedProducts:z,bundleProductsCount:c.products.length,bundleDiscountValue:c.percentageOff||c.amountOff||c.dealAmount,totalSelectedOriginal:R,reviewRatingType:Z?.fixedBundle.productRatingsDisplay??c?.reviewRatingType,qty:T[n.toString()]??1,onQtyChange:e=>N(n,e),handleOpenVariantModal:()=>y(!0),disableQuantitySelector:!["falah-devstore.myshopify.com","swashaa.myshopify.com","plush-ind.myshopify.com"].includes(window?.Shopify?.shop??"")||(c?.disableQuantitySelector??!0)})),A&&e.createElement(am,{productsWithIndices:j,isOpen:f,onClose:()=>y(!1),variantOptions:c.variantOptions,cta:{textColor:Z.general.ctaTextColor,backgroundColor:Z.general.ctaBackgroundColor},onVariantChange:I,handleAddToCart:Q,primaryProductId:v,variantId:u||void 0,showOutOfStockVariants:!1!==Z?.general?.showOutOfStockVariants}))),e.createElement(pp,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===Z.fixedBundle.infoAlignment?"flex-start":"right"===Z.fixedBundle.infoAlignment?"flex-end":"center"}},Number(O)>0&&Number(V)>0&&Z.fixedBundle.compareAtPriceVisibility&&e.createElement(mp,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(gp,{className:"yt-fixedBundle-summary_price"},Tm(Z.general.currencySymbol,c?.storeCurrencyCode),km(O))),0!==z.size&&e.createElement(up,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(gp,{className:"yt-fixedBundle-summary_price"},Tm(Z.general.currencySymbol,c?.storeCurrencyCode),km(M))," ",Number(V)>0&&(()=>{let t="";if("percentage"===(Z?.fixedBundle?.discountDisplayType||"amount")){const e="discount-on-compare"===(Z?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?W:H,n=e>0?Math.round(Number(V)/e*100):0;t=n>0?`${n}% Off`:""}else t=`Save: ${Tm(Z.general.currencySymbol,c?.storeCurrencyCode)}${km(V)}`;return t?e.createElement(fp,{className:"yt-fixedBundle-summary_save-tag"},t):null})())),e.createElement(yp,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),Y||!A?Q(e):y(!0)},disabled:z.size<1||s||!q,style:{backgroundColor:Z.general?.ctaBackgroundColor||"#121212",color:Z.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${Z.general?.ctaBackgroundColor||"#121212"}`,boxShadow:Z.general.ctaShadowType,paddingTop:Z.general?.ctaPadding,paddingBottom:Z.general?.ctaPadding,borderRadius:Z.general.ctaBorderRadius,width:Z.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{Z.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=Z.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=Z.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{Z.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=Z.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=Z.general?.ctaTextColor||"#FFFFFF")}},s?e.createElement(fe,{color:"white",loading:s,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):q?e.createElement(e.Fragment,null,Z.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),c?.personalizedForm?.title&&e.createElement(Vs,{isOpen:x,onClose:()=>h(!1),formConfig:c.personalizedForm,onCheckout:async e=>{await U(e),h(!1)},cta:{backgroundColor:Z.general?.ctaBackgroundColor||"#121212",textColor:Z.general?.ctaTextColor||"#FFFFFF"},isMobile:p}))},mm=()=>window?.ShopifyAnalytics?.meta?.currency||window?.Shopify?.currency?.active||"USD",um=({product:r,tierIdx:o,isOpen:a,onClose:i,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:m=!1})=>{const[u,g]=t(0),[f,y]=t(r.variants[0]?.id.toString()||""),[x,h]=t(!0),b=r.variants.find(e=>e.id.toString()===f)||r.variants[0],w=r.images.filter(Boolean),v=(e=>{try{const t=new Intl.NumberFormat(void 0,{style:"currency",currency:e}).resolvedOptions().maximumFractionDigits??2;return Math.pow(10,t)}catch{return 100}})(mm()),C=(()=>{const e=mm();return me(e)??e})(),E=()=>{w.length<=1||(g(e=>0===e?w.length-1:e-1),h(!0))},k=()=>{w.length<=1||(g(e=>e===w.length-1?0:e+1),h(!0))};if(n(()=>(a&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[a]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=Sm(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!a)return null;const T=w.length>1,S=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:i},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:i,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px",background:"#f5f5f5"}},w.length>0&&e.createElement(e.Fragment,null,x&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),x&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:d?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:Sm(w[u]||r.images[0]),alt:r.title,onLoad:()=>h(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:x?0:1,transition:"opacity 0.3s"}}),T&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:E,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(X,{size:24})),e.createElement("button",{onClick:k,disabled:u===w.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===w.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===w.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===w.length-1?.5:1}},e.createElement(O,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},m&&b?.name||r.title),!m&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>{y(e.target.value),h(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},C,(b.price/v).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},C,(b.compare_at_price/v).toLocaleString()):null),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:b.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock")),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),N=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:i},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:i,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},w.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},x&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:w[u]||r.images[0],alt:r.title,onLoad:()=>h(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:x?0:1,transition:"opacity 0.3s"}}),T&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:E,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(X,{size:20})),e.createElement("button",{onClick:k,disabled:u===w.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===w.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===w.length-1?.5:1,cursor:u===w.length-1?"not-allowed":"pointer"}},e.createElement(O,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},r.title),!m&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>{y(e.target.value),h(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},C,(b.price/v).toLocaleString(),b.compare_at_price?b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},C,(b.compare_at_price/v).toLocaleString()):null),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&b.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?N:S,document.body)},gm=({styles:t,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)||0}, ${parseInt(n.substring(2,4),16)||0}, ${parseInt(n.substring(4,6),16)||0}, ${t})`};return"tabs"===t?.categoryFilterOnPage?e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-collection-bundle-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,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(c,.07):"transparent",borderBottom:a?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=c)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>{const a=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?a:"#e0e0e0"}`,borderRadius:l,backgroundColor:o===r?a:"white",color:o===r?"white":"#333",cursor:"pointer"}},r.charAt(0).toUpperCase()+r.slice(1))})))},fm=e=>{if(e.metafields&&e.metafields.yourtoken_bundles_app&&e.metafields.yourtoken_bundles_app.categories){const t=e.metafields.yourtoken_bundles_app.categories;if(Array.isArray(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch(e){console.error("Failed to parse categories:",e)}}return[]},ym=()=>window?.ShopifyAnalytics?.meta?.currency||window?.Shopify?.currency?.active||"USD",xm=e=>{try{const t=new Intl.NumberFormat(void 0,{style:"currency",currency:e}).resolvedOptions().maximumFractionDigits??2;return Math.pow(10,t)}catch{return 100}},hm=()=>{const e=ym();return me(e)??e},bm=({config:r,bundleAddToCartLoading:i,addCustomBundleToCart:l,dispatchAnalyticsEvent:c})=>{const[s,d]=t(1),[p,m]=t("All"),[u,g]=t([]),[f,y]=t(null),[x,h]=t({}),[b,w]=t(!1),[v,C]=t(window.innerWidth<640),[E,k]=t({}),T=o(null),S=o(new Map),[N,B]=t(160),[F,z]=t(""),[$,I]=t(""),[P,D]=t(!1),[A,_]=t("none"),L=v?8:20,{customizations:R}=r,O=r.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),M=!!r.config.form,W=O.length+(M?1:0),H=R.hideSelectedProducts,j=R.allowMultipleQty,q=R.hideOutOfStockProducts,U=r.config.splitVariants??!1,Q=o(new Set),Z=a((e,t=p,n=$,r=A)=>{const o=O[e-1]?.products||[];let a="All"===t?o:o.filter(e=>fm(e).includes(t));if(n.trim()){const e=n.toLowerCase();a=a.filter(t=>t.title.toLowerCase().includes(e))}return q&&(a=a.filter(e=>e.available)),"none"!==r&&(a=[...a].sort((e,t)=>{if("asc"===r||"desc"===r){const n=e.price||e.price_min||0,o=t.price||t.price_min||0;return"asc"===r?n-o:o-n}{const n=(e.title||"").toLowerCase(),o=(t.title||"").toLowerCase();return"alpha-asc"===r?n.localeCompare(o):o.localeCompare(n)}})),a},[O,p,$,A,q]),Y=a(e=>{const t=Z(e).length;k(n=>{const r=n[e]||0,o=Math.min(r+8,t);return o<=r?n:{...n,[e]:o}})},[8,Z]);n(()=>{c?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r?.id,bundleType:"collection-bundle"}})},[]),n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===s&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[Y,s]),n(()=>{m("All"),z(""),I(""),D(!1),_("none")},[s]),n(()=>{const e=setTimeout(()=>{I(F)},300);return()=>clearTimeout(e)},[F]),n(()=>{if(M&&s===W)return;const e=s-1;if(!O[e])return;if(Q.current.has(e))return;const t=Z(s);if(1!==t.length)return;const n=t[0],r=n.variants.filter(e=>e.available);if(1!==r.length)return;const o=r[0],a=le(e),i=se[e];if(a!==1/0&&i>=a)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===o.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),g(t=>[...t,{productId:n.id.toString(),variantId:o.id.toString(),price:o.price,quantity:1,tierIndex:e}]),s<W)){const e=setTimeout(()=>{d(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[s]),n(()=>{if(M&&s===W)return;const e=s,t=Z(e).length;k(n=>{const r=n[`${e}_category`]!==p;return 0===(n[e]||0)||r?{...n,[e]:Math.min(L,t),[`${e}_category`]:p}:n})},[s,L,p,Z]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>C(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=a(e=>{B(e+10)},[]),ee=xm(ym()),te=u.reduce((e,t)=>e+t.quantity,0),ne=u.reduce((e,t)=>e+t.price*t.quantity,0)/ee,re=u.reduce((e,t)=>{const n=O.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/ee,oe=e=>{for(let t=0;t<O.length;t++)if(O[t].products.some(t=>t.id.toString()===e))return t+1;return M?W:O.length},ae=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},ie=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),a=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());g(n=>{const i=`${e.id}-${o}-${t}`,l=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(l)return n.filter(e=>e!==l);const s=se[t],d=le(t);return d!==1/0&&s>=d?n:(c?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:r?.id,bundleType:"collection-bundle",addedProduct:{id:e.id,title:e.title},tierIndex:t}}),[...n,{productId:e.id.toString(),variantId:o,price:a,quantity:1,tierIndex:t}])})},le=e=>{const t=O[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ce=(e,t)=>{const n=le(t);if(n===1/0)return!0;const r=se[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||r<n},se=O.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),de=(e,t,n)=>{const r=le(n);if(r===1/0)return!0;return se[n]<r},pe=(e,t,n)=>{g(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},me=async()=>{if(s!==W||!u.length)return;const e={};M&&Object.entries(x).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)}),c?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r?.id,bundleType:"collection-bundle",selectedProducts:u.map(e=>({id:e.productId,variantId:e.variantId,quantity:e.quantity,tierIndex:e.tierIndex}))}});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},ue=M&&s===W,ge=(ue?null:O[s-1])?le(s-1):0,fe=O.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:se[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},R.headerImage&&!R.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:R.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),R.showTierSteps&&e.createElement("div",{style:{paddingTop:R.headerImage&&!R.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(wm,{totalSteps:W,isFormStep:ue,currentStep:s,getStepTitle:e=>M&&e===W?"Customize Gift Details":O[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:r?.config?.form?.title,hasForm:M,onStepClick:e=>{d(e),window.scrollTo(0,0)}})),Array.from({length:W},(e,t)=>t+1).map(t=>{const n=M&&t===W,o=n?[]:(e=>O[e-1]?.products||[])(t);let a=[];if(!n&&R.enableProductCategories){const e=new Set;o.forEach(t=>fm(t).forEach(t=>e.add(t))),a=Array.from(e).sort()}const l=n?[]:Z(t),c=t-1,C=l.slice(0,E[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(s===t?"yt-collection-bundle-step-content-active":""),style:{display:s===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&r.config.form?e.createElement(Ds,{form:r.config.form,formData:x,setFormData:h,barHeight:N,isUploading:b,setIsUploading:w}):e.createElement(e.Fragment,null,R.enableProductCategories&&a.length>0&&e.createElement(gm,{styles:R,isMobile:v,categories:a,activeCategory:p,onCategoryChange:m}),(R.enableSearch||R.enableSort)&&e.createElement("div",{className:"yt-collection-bundle-controls",style:{display:"flex",alignItems:"center",justifyContent:v?"flex-end":"space-between",gap:"12px",padding:"0 16px",marginBottom:"16px",flexWrap:"nowrap",height:"45px"}},v?e.createElement(e.Fragment,null,P?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:F,onChange:e=>z(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:R.borderRadius||"8px",border:`1px solid ${R.bundleBorder||"#878787"}`,background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none"}}),e.createElement("button",{onClick:()=>{D(!1),z(""),I("")},style:{background:"none",border:"none",color:"#888",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"}},e.createElement(G,null))):e.createElement("div",{style:{display:"flex",gap:"20px",alignItems:"center"}},R.enableSearch&&e.createElement("button",{onClick:()=>D(!0),style:{background:"none",border:"none",color:"#333",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center"},className:"yt-collection-bundle-search-btn-mobile"},e.createElement(K,null)),R.enableSort&&e.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"},className:"yt-collection-bundle-sort-selecter-mobile-wrapper"},e.createElement("select",{value:A,onChange:e=>_(e.target.value),style:{position:"absolute",opacity:0,width:"100%",height:"100%",cursor:"pointer",left:0,top:0,zIndex:1},className:"yt-collection-bundle-sort-selecter-mobile"},e.createElement("option",{value:"none"},"Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{fontSize:"20px",color:"#333",pointerEvents:"none",display:"flex",alignItems:"center"}},e.createElement(J,null))))):e.createElement(e.Fragment,null,R.enableSort&&e.createElement("div",{style:{position:"relative",flex:"0 1 200px",marginLeft:"12px",padding:"10px 16px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",display:"flex",flexDirection:"row",alignItems:"center",gap:"6px"},className:"yt-collection-bundle-sort-wrapper"},e.createElement("span",{style:{fontWeight:"500",minWidth:"fit-content",fontSize:"14px"}},"Sort By"),e.createElement("select",{value:A,onChange:e=>_(e.target.value),style:{width:"100%",color:"#333",fontSize:"14px",outline:"none",cursor:"pointer",appearance:"none",boxSizing:"border-box",lineHeight:"normal",border:"none",fontFamily:"inherit"},className:"yt-collection-bundle-sort-selector"},e.createElement("option",{value:"none"}," Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888",pointerEvents:"none"}},e.createElement(V,null))),R.enableSearch&&e.createElement("div",{style:{position:"relative",flex:"0 1 300px"},className:"yt-collection-bundle-search-wrapper"},e.createElement("input",{type:"text",placeholder:"Search products...",value:F,onChange:e=>z(e.target.value),style:{width:"100%",padding:"10px 16px",paddingRight:"40px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none",boxSizing:"border-box",lineHeight:"normal"},className:"yt-collection-bundle-search-input"}),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},e.createElement(K,null))))),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:v?"grid":"flex",gridTemplateColumns:v?"repeat(2,1fr)":"",flexWrap:v?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${N}px`}},0===l.length&&""!==$.trim()?e.createElement("div",{style:{padding:"60px 20px",textAlign:"center",width:"100%",gridColumn:"1 / -1"}},e.createElement("div",{style:{fontSize:"18px",color:"#333",marginBottom:"8px",fontWeight:600}},'No results found for "',F,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{z(""),I(""),D(!1)},style:{background:R.atcBg||"#000",color:R.atcText||"#fff",padding:"12px 32px",borderRadius:R.borderRadius||"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,transition:"opacity 0.2s"},onMouseEnter:e=>e.currentTarget.style.opacity="0.8",onMouseLeave:e=>e.currentTarget.style.opacity="1"},"Clear Search")):U?C.flatMap(t=>t.variants.filter(e=>!q||e.available).map(n=>e.createElement(vm,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:c,customizations:R,isMobile:v,hoveredCard:f,setHoveredCard:y,selectedProducts:u,handleAddToBundle:ie,canAddProduct:ce,allowMultipleQty:j,handleVariantChange:ae,canIncrement:de,setSelectedProducts:g,splitVariants:!0}))):C.map(t=>e.createElement(vm,{key:t.id,product:t,tierIdx:c,customizations:R,isMobile:v,hoveredCard:f,setHoveredCard:y,selectedProducts:u,handleAddToBundle:ie,canAddProduct:ce,allowMultipleQty:j,handleVariantChange:ae,canIncrement:de,setSelectedProducts:g,splitVariants:!1})),s===t&&(E[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),s===t&&e.createElement(Cm,{config:r,selectedProducts:u,selectedByTier:fe,totalItems:te,totalPrice:ne,totalCompareAtPrice:re,currentStep:s,totalSteps:W,currentTierMax:ge,tierSelectedCounts:se,isMobile:v,bundleAddToCartLoading:i,isUploading:b,hoveredCard:f,setHoveredCard:y,hideSelectedProducts:H,getProductStep:oe,setCurrentStep:d,handleRemoveItem:pe,handleCheckout:me,hasForm:M,onHeightChange:X}))}))},wm=({totalSteps:t,isFormStep:r,currentStep:o,getStepTitle:a,isMobile:i,formTitle:l,hasForm:c,onStepClick:s})=>{const d=e.useRef(null);return n(()=>{if(!i||!d.current)return;const e=d.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[o,i]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:i?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:i?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:d,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:i?"flex-start":"center",gap:i?"1rem":"2rem",minWidth:i?100*t+"px":"auto",paddingInline:i?"calc(50% - 60px)":"0",scrollPaddingInline:i?"calc(50% - 60px)":"0",scrollBehavior:"smooth",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:t},(e,t)=>t+1).map(n=>e.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(o===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:i?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:o===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(o===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:o===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},a(n))))),l&&c&&r&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:i?"14px":"16px",marginBottom:i?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},vm=({product:n,tierIdx:r,customizations:o,isMobile:a,hoveredCard:i,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:m,canIncrement:u,setSelectedProducts:g,splitVariants:f=!1})=>{const[y,x]=t(!1),h=f?null:document.querySelector(`[data-product-id="${n.id}"]`),b=f?n.variants[0].id.toString():h?.dataset.selectedVariant??n.variants[0].id.toString(),w=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=xm(ym()),C=hm(),E=f?`${n.id}-${w.id}`:n.id,k=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===r),T=i===E,S=c.filter(e=>e.productId===n.id.toString()&&e.variantId===w.id.toString()&&e.tierIndex===r).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:E,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":w.id,"data-current-price":w.price,style:{display:"flex",flexDirection:"column",border:o?.productCardBorder||"1px solid #ddd",background:o?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:a?0:"250px",maxWidth:a?"none":"250px",borderRadius:o?.borderRadius||"8px",boxShadow:"spread"===o?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===o?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:a?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:o?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>x(!0),onMouseEnter:()=>l(E),onMouseLeave:()=>l(null)},e.createElement("img",{src:Sm(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),onClick:e=>{if(o?.general?.redirectToPDP&&n?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.handle}`}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:T?0:1,transform:T?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:Sm(n.images[1]||n.images[0]),onClick:e=>{if(o?.general?.redirectToPDP&&n?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.handle}`}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:T?1:0,transform:"scale(1.05)"},alt:n.title}),!f&&n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>m(n,e.target.value),defaultValue:w.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},o.productCardCategoryVisibility&&fm(n).length>0&&e.createElement("div",{className:"yt-collection-bundle-product-categories-wrapper",style:{paddingBottom:"8px"}},e.createElement("div",{className:"yt-collection-bundle-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},fm(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:a?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),fm(n).length>2&&e.createElement("span",{className:"yt-collection-bundle-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",fm(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:a?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:f?0:1}},n.title),f&&"Default Title"!==w.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:a?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},w.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:a?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},C,(w.price/v).toLocaleString()),w.compare_at_price&&0!==w.compare_at_price&&w.compare_at_price>w.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},C,(w.compare_at_price/v).toLocaleString()):null)),p&&S>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:w.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:a?"6px":"12px",fontSize:a?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o&&o.quantity>1?e.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?e.filter(e=>e!==o):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},S),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:w.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:a?"6px":"12px",fontSize:a?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{w.available&&u(n,w.id.toString(),r)&&g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:w.id.toString(),price:w.price,quantity:1,tierIndex:r}]})},disabled:!w.available||!u(n,w.id.toString(),r)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(k?"yt-collection-bundle-add-btn-added":""),style:{background:k?"#28a745":d(n,r)&&w.available?o?.atcBg||"#007bff":"#ccc",color:o?.atcText||"#fff",border:"none",padding:a?"6px":"12px",fontSize:a?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:w.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(f)w.available&&d(n,r)&&g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.filter(e=>e!==o):[...e,{productId:n.id.toString(),variantId:w.id.toString(),price:w.price,quantity:1,tierIndex:r}]});else{if(!w.available||!d(n,r))return;s(n,r)}},disabled:!w.available||!d(n,r)},k?"Added":w.available?"ADD TO BOX":"Out of Stock")),y&&e.createElement(um,{product:n,tierIdx:r,isOpen:y,onClose:()=>x(!1),onAddToBundle:(e,t)=>{s(e,t),x(!1)},canAdd:d(n,r),isSelected:k,customizations:o,isMobile:a,splitVariants:f}))},Cm=r=>{const{config:a,selectedProducts:i,selectedByTier:l,totalItems:c,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:m,currentTierMax:u,tierSelectedCounts:g,isMobile:f,bundleAddToCartLoading:y,isUploading:x,hoveredCard:h,setHoveredCard:b,getProductStep:w,setCurrentStep:v,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=r,{customizations:S}=a,[N,B]=t(!1),F=o(null),z=o(null),$=xm(ym()),I=hm(),{totalOriginal:P,hasSavings:D,formattedSavings:A,totalAfterDiscount:_}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:r})=>{const o=r?.discountData;let a=0;e.forEach(e=>{const t=(e.price||0)/$,n=e.quantity||1;a+=t*n}),t+=a;let i=a;if("mov_percentage"===o?.type&&o.tiers?.length){const e=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>a>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;i=a*(1-t)}}n+=i});const r=Math.round(t-n),o=r>0;return{savings:r,totalOriginal:t,totalAfterDiscount:n,hasSavings:o,formattedSavings:o?`${I}${r.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),L=l.filter(({count:e})=>e>0).map(({tier:e,items:t})=>{const n=t.reduce((e,t)=>{if(!t)return e;return e+(t.price||0)*(t.quantity||1)},0)/$;return((e,t,n)=>{const r=e.discountData;if(!r||!r.tiers?.length)return null;const o=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),a=[];if("mov_percentage"===r.type){if("number"!=typeof n)return null;const e=o.filter(e=>n>=e.minimumQuantity).pop();e&&a.push(`${e.discountValue}% OFF`);const t=o.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;a.push(`Add ${I}${e} more to get ${t.discountValue}% OFF`)}return a.length?a.join(" + "):null}const i=o.filter(e=>t>=e.minimumQuantity);if(i.length>0){const e=i.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(r.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`${I}${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ${I}${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&a.push(t)}const l=o.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(r.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`${I}${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ${I}${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return a.length?a.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=u!==1/0&&g[p-1]===u-2&&u>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[u,g,p]),n(()=>{if(F.current&&T){const e=F.current.offsetHeight;T(e)}},[f,T,i]),n(()=>{const e=Math.max(...l.map(({tier:e,items:t})=>{if("mov_percentage"!==e?.discountData?.type)return 0;const n=t.reduce((e,t)=>e+(t.price||0)*(t.quantity||1),0)/100,r=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return r?.discountValue??0}));if(e<(z.current??0)&&(z.current=e),e>(z.current??0)){z.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;Te({particleCount:100,spread:70,origin:{x:r,y:o},zIndex:9999})}},[l]),e.createElement("div",{ref:F,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"sticky",bottom:"10px",left:"0",right:"0",marginInline:"auto",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},L.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},L.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},N&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},u," item",u>1?"s":"")))),i.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,r)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,r)=>{const o=a.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!o)return null;const i=w(t.productId),l=p===i;return e.createElement("div",{key:r,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&v(i)},e.createElement("img",{src:Sm(o.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<r.length-1&&r[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(Q,null)))))),f?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||a?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:i.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},I,(_??s).toLocaleString()),D?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,P.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",A)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(a?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>v(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===m&&0===c||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===m&&0===c||x?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===m?E:()=>v(p+1),disabled:p===m&&0===c||y||x},y?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(Is,null)):p===m?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(a?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===h&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>v(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:i.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},I,(_??s).toLocaleString()),D?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,P.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",A)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,d.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===m&&0===c||x?"yt-collection-bundle-next-btn-disabled":""),"data-gokwik-processed":"true",style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===m&&0===c||x?.6:1,...-2===h&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===m?E:()=>v(p+1),disabled:p===m&&0===c||y||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},y?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(Is,null)):p===m?"Checkout":"Next")))},Em=window?.Shopify?.currency||{rate:1,active:window?.ShopifyAnalytics?.meta?.currency||"INR"},km=e=>{if(!e)return;const t=navigator.language||"en-US";return new Intl.NumberFormat(t).format(Number(e))},Tm=(e,t)=>e||(me(Em.active)||Em.active),Sm=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},Nm=(e,t,n,r,o,a,i)=>{const l=r.findIndex(t=>t.variantId===e&&(void 0===i||t.tierIndex===i));o(0===n?e=>e.filter((e,t)=>t!==l):-1===l?r=>[...r,{product:t,variantId:e,quantity:n,isFree:a,tierIndex:i}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:a,tierIndex:i}:e))},Bm=({bundle:t,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:m,fetchStoreDetails:u,productsPagination:g,categoryFilters:f})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Ms,{bundleAddToCartLoading:l,bundle:t,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:m,fetchStoreDetails:u,productsPagination:g,categoryFilters:f}):"combo"===t.type?e.createElement(Hs,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:m}):"mixAndMatch"===t.type?e.createElement(Jd,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:m}):"collection"===t.type?e.createElement(bm,{config:t,addCustomBundleToCart:o,bundleAddToCartLoading:l,dispatchAnalyticsEvent:m}):e.createElement(wd,{bundle:t,currentProductId:n,addToCartFunction:r,dispatchAnalyticsEvent:m}):e.createElement(pm,{addToCartFunction:r,bundle:t,dispatchAnalyticsEvent:m}),Fm=s.div`
|
|
4643
|
+
`,am=({productsWithIndices:o,isOpen:a,onClose:i,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:m,showOutOfStockVariants:u=!0})=>{const g=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[f,y]=t({}),[x,h]=t({});n(()=>{const e={},t={};o?.forEach(({product:n,index:r})=>{let o,a=[];if(n.productId===p&&m){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(m))?.node;e&&g(n.productDetails,e.id)>0&&(a=e.title.split(" / "),o=e)}if(!a.length){const e=n.productDetails.variants.edges.find(e=>g(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(a=e.title.split(" / "),o=e):a=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[r]=a,o&&(t[r]={node:o},s(r,o.id))}),y(e),h(t)},[o,p,m,s,g]),n(()=>{if(!p||!m)return;const e=o?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,r=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(m))?.node;if(r&&g(t.productDetails,r.id)>0){const e=r.title.split(" / ");y(t=>({...t,[n]:e})),h(e=>({...e,[n]:{node:r}})),s(n,r.id)}},[m,p,o,s,g]);const b=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&g(r.productDetails,i.id)>0},w=(e,t,n)=>{const{product:r}=o?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!r?.productDetails)return;if(!b(e,n,t,r))return;const a={...f};a[e][n]=t,y(a);const i=r?.productDetails?.variants?.edges?.find(t=>t.node.title===a[e].join(" / "))?.node;i&&(s(e,i.id),h(t=>({...t,[e]:{node:i}})))};if(!a)return null;const v=e.createElement(jp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:i},e.createElement(qp,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Up,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),o?.map(({product:t,index:n},r)=>e.createElement(e.Fragment,null,e.createElement(Zp,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Gp,{className:"yt-fixedBundle-variant-modal_thumbnail",src:x[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Yp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Xp,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(Jp,{className:"yt-fixedBundle-variant-modal_selected-value"},f[n]?.join(" / "))),t.productDetails.options.map((r,o)=>{const a=c&&c?.options?.find(e=>e.name===r.name),i=r.values.filter(e=>!!t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[o]===e)&&!(!1===u&&!b(n,o,e,t)));return 0===i.length||1===i.length&&"Default Title"===i[0]?e.createElement(e.Fragment,null):a&&"color"===a?.type?e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,a.values.find(e=>e.name===r)?.value?e.createElement(tm,{className:"yt-fixedBundle-variant-modal_color-swatch",key:i,color:a.values.find(e=>e.name===r)?.value||r,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},e.createElement("span",null)):e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},r))})):a&&"image"===a?.type?e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,a?.values.find(e=>e.name===r)?.value?e.createElement(rm,{className:"yt-fixedBundle-variant-modal_image-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)},src:a.values.find(e=>e.name===r)?.value}):e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},r))})):e.createElement(em,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(om,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),i.map((r,i)=>{const l=!b(n,o,r,t);return e.createElement(nm,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:f[n]?.[o]==r,disabled:l,onClick:()=>{w(n,r,o)}},"text"===a?.type&&a.values.find(e=>e.name===r)?.value||r)}))}))),r<o.length-1&&e.createElement(Kp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Qp,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return D.createPortal(v,document.body)},im=(e,t=64)=>{if(!e)return"/placeholder.svg";try{const n=new URL(e);return n.searchParams.set("width",String(t)),n.toString()}catch{return e}},lm=({options:r,selectedValue:a,onChange:i,type:l="text"})=>{const[c,s]=t(!1),d=o(null);n(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(Op,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Mp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name,style:{display:"block"}}):null;return e.createElement(Ip,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(Pp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(Dp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},a&&("color"===l||"image"===l)&&p(a),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},a&&a.name)),e.createElement(Ap,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(_p,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},r?.map(t=>e.createElement(Lp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(a?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:a?.name===t.name,onClick:()=>{t.disabled||(i(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(Rp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},cm=({product:r,variantOptions:o,selectedVariants:a,onVariantChange:i,variantId:l,primaryProductId:c,variantType:s="dropdown",accentColor:d="#000000",showOutOfStockVariants:p=!0})=>{const m=(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?.toLocaleLowerCase()?1/0:0:1/0:0},u=(e,t,n)=>{const r=[...g||[]];r[e]=t;const o=r.join(" / "),a=n.variants.edges.find(e=>e.node.title===o)?.node;return!!a&&m(n,a.id)>0},[g,f]=t(a||[]);n(()=>{a&&a.length>0&&f(a)},[a]),n(()=>{if(l&&r.variants.edges.some(e=>e.node.id.includes(l))){const e=r.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");f(t)}}},[l,r]);const y=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},x=(e,t)=>{const n=g[t];if(!n)return null;return h(e,t).find(e=>e.name===n)||null},h=(e,t)=>{const n=o?.options?.find(t=>t.name===e.name);return e.values.filter(e=>r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const o=n?.values?.find(t=>t.name===e),a=!u(t,e,r);return{name:e,value:o?.value||e,disabled:a}}).filter(e=>p||!e.disabled)},b=(e,t)=>e.values.filter(e=>!!r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)&&!(!p&&!u(t,e,r)));return"swatches"===s||"auto"===s?e.createElement(e.Fragment,null,r.options.map((t,n)=>{const a=o?.options?.find(e=>e.name===t.name);return e.createElement("div",{key:t.name,className:"yt-fixedBundle-product-option-group-horizontal",style:{...t?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},r.options.length>1&&b(t,n)?.length>1&&e.createElement("label",{className:"yt-fixedBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},t.name,":"),b(t,n)?.length>1&&e.createElement("div",{className:"yt-fixedBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},b(t,n).map(t=>{const o=[...g];o[n]=t;const l=r.options.length>0?o.join(" / "):o[n],c=r.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?m(r,c.id):0),p=g[n]===t;if("color"===a?.type){const n=a.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-color${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${d}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},n?e.createElement("div",{className:"yt-fixedBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:n}},e.createElement("span",null)):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}if("image"===a?.type){const n=a.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-image${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${d}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},n?e.createElement("img",{className:"yt-fixedBundle-product-option-image",src:im(n),alt:t,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-text${p?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&i(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},"text"===a?.type&&a.values.find(e=>e.name===t)?.value||t)})))})):e.createElement(Vp,{className:"yt-fixedBundle-variant-selector-horizontal_container"},r.options.map((t,n)=>{const o=h(t,n);return 0===o.length||1===o.length&&"Default Title"===o[0].name?null:e.createElement(Wp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(lm,{options:o,selectedValue:x(t,n),onChange:e=>{((e,t)=>{const n=[...g];n[e]=t.name,f(n);const o=r.variants.edges.find(t=>t.node.title===(r.options?.length>0?n.join(" / "):n[e]))?.node.id;i(o||"")})(n,e)},type:y(t.name)}))}))},sm=({qty:t,min:n=1,max:r=1/0,accentColor:o="#121212",onChange:a,borderRadius:i,isMobile:l})=>e.createElement("div",{className:"yt-fixedBundle-qty-selector",style:{display:"inline-flex",alignItems:"center",gap:0,border:`1px solid ${o}`,borderRadius:i??"6px",overflow:"hidden",userSelect:"none"}},e.createElement("button",{type:"button",className:"yt-fixedBundle-qty-btn yt-fixedBundle-qty-btn--minus",onClick:e=>{e.preventDefault(),e.stopPropagation(),t>n&&a(t-1)},disabled:t<=n,style:{width:l?"24px":"28px",height:l?"24px":"28px",display:"flex",alignItems:"center",justifyContent:"center",background:t<=n?"#f0f0f0":o,color:t<=n?"#999":"#fff",border:"none",cursor:t<=n?"not-allowed":"pointer",fontSize:l?"14px":"16px",lineHeight:"normal",transition:"background 0.15s",flexShrink:0},"aria-label":"Decrease quantity"},"-"),e.createElement("span",{className:"yt-fixedBundle-qty-count",style:{minWidth:l?"26px":"32px",textAlign:"center",fontSize:"13px",fontWeight:600,color:"#121212",padding:"0 4px",background:"#fff",lineHeight:l?"24px":"28px",height:l?"24px":"28px",display:"inline-block"}},t),e.createElement("button",{type:"button",className:"yt-fixedBundle-qty-btn yt-fixedBundle-qty-btn--plus",onClick:e=>{e.preventDefault(),e.stopPropagation(),t<r&&a(t+1)},disabled:t>=r,style:{width:l?"24px":"28px",height:l?"24px":"28px",display:"flex",alignItems:"center",justifyContent:"center",background:t>=r?"#f0f0f0":o,color:t>=r?"#999":"#fff",border:"none",cursor:t>=r?"not-allowed":"pointer",fontSize:l?"14px":"16px",lineHeight:"normal",transition:"background 0.15s",flexShrink:0},"aria-label":"Increase quantity"},"+")),dm=({product:o,selectedVariantId:i,isChecked:l,canCustomize:c,styles:s,onVariantChange:d,onCheckChange:p,isMobile:m,isHorizontal:u,index:g,variantOptions:f,productsLength:y,handleOpenVariantModal:x,storeCurrencyCode:h,primaryProductId:b,variantId:w,checkedProducts:v,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T,reviewRatingType:S,qty:N,onQtyChange:B,disableQuantitySelector:F})=>{const z="23e4dd-58.myshopify.com"!==window.Shopify?.shop,$=e=>{const t="string"==typeof e?parseFloat(e):e;return z?t.toFixed(2):Math.round(t).toString()},I=r(()=>e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?o?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[o]),[P,D]=t(o?.variants?.edges.find(e=>I(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node),A=r(()=>P?.title?.split(" / ")||[],[P]),_=o?.id===b;n(()=>{if(o.id===b){const e=o?.variants?.edges?.find(e=>e?.node?.id?.includes(i))?.node;e&&I(e.id)>0&&(D(e),d(e.id))}else{const e=o?.variants?.edges?.find(e=>e?.node?.id===i)?.node||o?.variants?.edges?.find(e=>I(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node;D(e)}},[o,b,i,w,d,I]);const L=a(e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[o,d]),R=s?.fixedBundle?.discountBadgeDisplay,O=parseFloat(P?.price??"0"),M=v?.size===k,V=((e,t,n,r,o,a)=>{if(0===r||!n)return e;if(r!==o)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(a<=0)return e;const t=e/a*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/a);default:return e}})(O,E,C??0,v?.size,k,T),W=M?V:parseFloat(P?.price??"0"),H="discount-on-compare"===R?parseFloat(P?.compareAtPrice||P?.price||"0"):parseFloat(P?.price??"0"),j=s?.fixedBundle?.compareAtPriceVisibility&&H>W,q=$(W*N),U=$(H*N),Q="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,Z=P?.image?.url||o.featuredMedia?.preview?.image?.url,G=I(P?.id??""),X=0===G,K=e.createElement(sm,{qty:N,min:1,max:G===1/0?999:G,accentColor:s?.general?.ctaBackgroundColor,onChange:B,borderRadius:s?.fixedBundle?.borderRadius,isMobile:m}),J=e=>{if(s?.general?.redirectToPDP&&o?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${o.handle}`}};return e.createElement(e.Fragment,null,u?e.createElement("div",{className:`${o.id===b?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"}${X?" yt-fixedBundle-product-card--out-of-stock":""}`,style:{display:"flex",alignItems:"center",gap:"10px"}},c&&e.createElement("div",{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},e.createElement("input",{type:"checkbox",style:{display:"none"},className:"yt-fixedBundle-product-card_checkbox-hidden",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:_}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(Y,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(op,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}80`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${s.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}80`}[s.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(ap,{className:"yt-fixedBundle-product-card-horizontal_image",src:Sm(Z),alt:o.title,onClick:J,style:{cursor:s?.general?.redirectToPDP?"pointer":"default",borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general?.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(ip,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(lp,{className:"yt-fixedBundle-product-card-horizontal_title"},o.title),"ratingOnly"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingBottom:"4px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},o?.rating?.averageRating," ",e.createElement("span",null," rating"))),"ratingAndReviewCount"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingBottom:"4px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(ke,{className:"yt-fixedBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews")," ",")"),s.fixedBundle.productsPriceVisibility&&e.createElement(cp,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(sp,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Tm(s.general.currencySymbol)," ",km(q)),j&&H>W&&e.createElement(dp,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Tm(s.general.currencySymbol),km(U))),e.createElement(cm,{product:o,variantOptions:f,selectedVariants:A,onVariantChange:L,variantId:w,primaryProductId:b,variantType:s?.fixedBundle?.variantSelectorType,accentColor:s?.general?.ctaBackgroundColor,showOutOfStockVariants:!1!==s?.general?.showOutOfStockVariants}),m&&!F&&e.createElement("div",{style:{marginTop:"10px"},className:"yt-fixedBundle-qty-selector-wrapper-horizontal"},K)),!m&&!F&&e.createElement("div",{style:{marginRight:"20px"},className:"yt-fixedBundle-qty-selector-wrapper-horizontal"},K))):e.createElement(e.Fragment,null,e.createElement(bp,{className:`${o.id===b?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"}${X?" yt-fixedBundle-product-card--out-of-stock":""}`,productsLength:y,style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}50`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${s.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}50`}[s.fixedBundle.shadowType]||"none",...(c||!F&&!m)&&{position:"relative"},...Q&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.fixedBundle?.cardBackgroundColor},!m&&!F&&e.createElement("div",{style:{position:"absolute",left:"5px",top:"5px",zIndex:"10"},className:"yt-fixedBundle-qty-selector-wrapper-vertical"},K),c&&e.createElement(Hp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:Q,showQtySelector:!F},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:_}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(Y,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(wp,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",onClick:J,style:{cursor:s?.general?.redirectToPDP?"pointer":"default",aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(vp,{className:"yt-fixedBundle-product-card_image--vertical",src:Sm(Z),style:{aspectRatio:s.general.imageAspectRatio},alt:o.title}),o.variants.edges.length>1&&e.createElement(Cp,{onClick:x,as:"button",className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Ep,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(kp,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(Tp,{className:"yt-fixedBundle-product-card_count-badge"},o.variants.edges.length,"+"))),e.createElement(Sp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Np,{className:"yt-fixedBundle-product-card-vertical_title"},o.title),"ratingOnly"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingTop:"4px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6,lineHeight:"normal"}},o?.rating?.averageRating," ",e.createElement("span",null,"rating"))),"ratingAndReviewCount"===S&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-fixedBundle-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333",paddingTop:"4px",paddingBottom:"6px",lineHeight:"normal"}},e.createElement($e,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(ke,{className:"yt-fixedBundle-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," ",e.createElement("span",{style:{marginLeft:"2px"}},"reviews"),")"),s.fixedBundle.productsPriceVisibility&&e.createElement(Fp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(Bp,{className:"yt-fixedBundle-product-card-vertical_price--new"},Tm(s.general.currencySymbol),km(q)),s.fixedBundle.compareAtPriceVisibility&&j&&H>W&&e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--old"},Tm(s.general.currencySymbol),km(U))),m&&!F&&e.createElement("div",{style:{marginTop:"6px"},className:"yt-fixedBundle-qty-selector-wrapper-vertical"},K))),(y<=3||!m)&&g<y-1&&e.createElement(zp,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement($p,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},pm=({bundle:o,addToCartFunction:i,dispatchAnalyticsEvent:l})=>{const c=r(()=>{const e=o.products?.filter(e=>{const t=e?.productDetails?.status?.toLowerCase();return!t||("active"===t||"unlisted"===t)})||[];if(!e.some(e=>e.quantity&&e.quantity>1))return{...o,products:e};const t=e.reduce((e,t)=>{const n=t.quantity||1;for(let r=0;r<n;r++)e.push(t);return e},[]);return{...o,products:t}},[o]),[s,d]=t(!1),[p,m]=t(window.innerWidth<786),[u,g]=t(null),[f,y]=t(!1),[x,h]=t(!1),b="undefined"!=typeof window?window.location.href:null,w=c?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=w?.productId,C=r(()=>(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?.toLowerCase()?1/0:0:1/0:0},[]),[E,k]=t(Object.fromEntries(c?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>C(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),[T,S]=t(Object.fromEntries(c?.products?.map((e,t)=>[t.toString(),1]))),N=a((e,t)=>{S(n=>({...n,[e.toString()]:t}))},[]),B="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),F=B?c?.showIndividualProductSelector??!0:c?.showIndividualProductSelector??!1,[z,$]=t(new Set(c.products.reduce((e,t,n)=>(!(t?.productId===v)&&F||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:c._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");g(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&v&&k(e=>{const t={...e};return c?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,c?.products]),n(()=>{const e=()=>{m(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const I=a((e,t)=>{k(n=>({...n,[e.toString()]:t}))},[]),P=(e,t)=>{const n=c.products[t].productId;B&&n===v||$(n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r})},D=r(()=>(e,t)=>C(e.productDetails,t)>0,[C]),A=r(()=>c.products.some((e,t)=>z.has(t)&&e.productDetails.variants.edges.length>1),[c.products,z]),_="23e4dd-58.myshopify.com"!==window.Shopify?.shop,L=e=>{const t="string"==typeof e?parseFloat(e):e;return _?t.toFixed(2):Math.round(t).toString()},R=r(()=>{let e=0;return c.products.forEach((t,n)=>{if(z.has(n)){const r=E[n.toString()],o=t.productDetails.variants.edges.find(e=>e.node.id===r)?.node;o&&(e+=parseFloat(o.price??"0"))}}),e},[c.products,z,E]),{originalPrice:O,dealPrice:M,offerValue:V,totalCompareAtPrice:W,totalPrice:H}=r(()=>{const{price:e,compareAtPrice:t}=c.products.reduce((e,t,n)=>{if(!z.has(n))return e;const r=E[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=T[n.toString()]??1,i=parseFloat(o?.price??"0")*a,l=parseFloat(o?.compareAtPrice||o?.price||"0")*a;return e.price+=i,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=c?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price";let r=e;if(z.size===c.products.length)if(c?.percentageOff)r=e*(1-c.percentageOff/100);else if(c?.dealAmount){const e=Array.from(z).reduce((e,t)=>e+(T[t.toString()]??1),0),t=e/z.size;r=c.dealAmount*t}else c?.amountOff&&(r=e-c.amountOff);const o=c?.customizations?.fixedBundle?.discountBadgeVisibility,a=!1===o?r:"discount-on-compare"===n?t:e,i=a-r;return{originalPrice:L(a),dealPrice:L(r),offerValue:L(i),totalPrice:e,totalCompareAtPrice:t}},[c.products,E,z,T,c.percentageOff,c.dealAmount,c.amountOff,c?.customizations?.fixedBundle?.discountBadgeDisplay,c?.customizations?.fixedBundle?.discountBadgeVisibility]),j=r(()=>c.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>z.has(e)),[c.products,z]),q=j.every(({product:e,index:t})=>D(e,E[t.toString()])),U=async e=>{d(!0),y(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:c._id,bundleType:"fixed-bundle",selectedProducts:j?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(E).flatMap(([e,t])=>{const n=parseInt(e);if(isNaN(n)||!z.has(n))return[];const r=T[e]??1;return Array(r).fill(t)}).filter(Boolean);i&&await i(Number(O),t,Number(M),void 0,e)}catch(e){console.error("Error adding to cart:",e)}d(!1)},Q=async e=>{if(q){if(e&&(e.preventDefault(),e.stopPropagation()),c?.personalizedForm?.title)return y(!1),void h(!0);await U()}};if(!i)return e.createElement(e.Fragment,null);const Z=c.customizations,G=Z.fixedBundle?.cardLayoutStyle||"auto",Y="horizontal"===G||"auto"===G&&p,X="bundles"==c.appName?c.pageHeader?.title:c?.title,K="bundles"==c.appName?c.pageHeader?.description:c?.subtitle;return e.createElement(ep,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:Z.fixedBundle.sectionBackgroundColor,..."transparent"!==Z.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},X&&e.createElement(tp,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:Z.fixedBundle?.titleBackgroundColor||"none",color:Z.fixedBundle?.titleTextColor||"black",textAlign:Z.fixedBundle.infoAlignment??"center",fontSize:Z.fixedBundle?.titleFontSize,..."transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"===Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},X),K&&e.createElement(np,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:Z.fixedBundle?.subtitleFontSize,textAlign:Z.fixedBundle.infoAlignment??"center",..."left"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===Z.fixedBundle.infoAlignment&&"transparent"!==Z.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===Z.fixedBundle.infoAlignment&&"transparent"===Z.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},K),Y?e.createElement(rp,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},c?.products?.map((t,n,r)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(dm,{isChecked:z.has(n),product:t.productDetails,selectedVariantId:E[n.toString()]||"",canCustomize:c?.canCustomizeFixedBundle||!1,styles:Z,onVariantChange:e=>I(n,e),onCheckChange:e=>{P(e,n)},isMobile:p,index:n,isHorizontal:Y,variantOptions:c.variantOptions,productsLength:c.products.length,storeCurrencyCode:c.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:c.discountType??"none",checkedProducts:z,bundleProductsCount:c.products.length,bundleDiscountValue:c.percentageOff||c.amountOff||c.dealAmount,totalSelectedOriginal:R,reviewRatingType:Z?.fixedBundle?.productRatingsDisplay??c?.reviewRatingType,qty:T[n.toString()]??1,onQtyChange:e=>N(n,e),disableQuantitySelector:!["falah-devstore.myshopify.com","swashaa.myshopify.com","plush-ind.myshopify.com"].includes(window?.Shopify?.shop??"")||(c?.disableQuantitySelector??!0)}),n<r.length-1&&e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"},className:"yt-fixedBundle-plus-icon-container"},e.createElement("span",{style:{padding:p?"1px":"2px",background:"#0000000D",..."none"!==Z?.fixedBundle?.shadowType&&{marginTop:"2px"},display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},className:"yt-fixedBundle-plus-icon-wrapper"},e.createElement(Le,{color:"black",style:{height:p?"16px":"24px",width:p?"16px":"24px",color:"black",lineHeight:"nomal"},className:"yt-fixedBundle-plus-icon-svg"})))))):e.createElement(xp,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(hp,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===Z.fixedBundle.infoAlignment?"flex-start":"right"===Z.fixedBundle.infoAlignment?"flex-end":"center"}},c?.products?.map((t,n)=>e.createElement(dm,{key:`${t.productId}-${n}`,isChecked:z.has(n),product:t.productDetails,selectedVariantId:E[n.toString()]||"",canCustomize:c?.canCustomizeFixedBundle||!1,styles:Z,onVariantChange:e=>{I(n,e)},onCheckChange:e=>P(e,n),isMobile:p,index:n,isHorizontal:Y,productsLength:c.products.length,storeCurrencyCode:c.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:c.discountType??"none",checkedProducts:z,bundleProductsCount:c.products.length,bundleDiscountValue:c.percentageOff||c.amountOff||c.dealAmount,totalSelectedOriginal:R,reviewRatingType:Z?.fixedBundle.productRatingsDisplay??c?.reviewRatingType,qty:T[n.toString()]??1,onQtyChange:e=>N(n,e),handleOpenVariantModal:()=>y(!0),disableQuantitySelector:!["falah-devstore.myshopify.com","swashaa.myshopify.com","plush-ind.myshopify.com"].includes(window?.Shopify?.shop??"")||(c?.disableQuantitySelector??!0)})),A&&e.createElement(am,{productsWithIndices:j,isOpen:f,onClose:()=>y(!1),variantOptions:c.variantOptions,cta:{textColor:Z.general.ctaTextColor,backgroundColor:Z.general.ctaBackgroundColor},onVariantChange:I,handleAddToCart:Q,primaryProductId:v,variantId:u||void 0,showOutOfStockVariants:!1!==Z?.general?.showOutOfStockVariants}))),e.createElement(pp,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===Z.fixedBundle.infoAlignment?"flex-start":"right"===Z.fixedBundle.infoAlignment?"flex-end":"center"}},Number(O)>0&&Number(V)>0&&Z.fixedBundle.compareAtPriceVisibility&&e.createElement(mp,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(gp,{className:"yt-fixedBundle-summary_price"},Tm(Z.general.currencySymbol,c?.storeCurrencyCode),km(O))),0!==z.size&&e.createElement(up,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(gp,{className:"yt-fixedBundle-summary_price"},Tm(Z.general.currencySymbol,c?.storeCurrencyCode),km(M))," ",Number(V)>0&&(()=>{let t="";if("percentage"===(Z?.fixedBundle?.discountDisplayType||"amount")){const e="discount-on-compare"===(Z?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?W:H,n=e>0?Math.round(Number(V)/e*100):0;t=n>0?`${n}% Off`:""}else t=`Save: ${Tm(Z.general.currencySymbol,c?.storeCurrencyCode)}${km(V)}`;return t?e.createElement(fp,{className:"yt-fixedBundle-summary_save-tag"},t):null})())),e.createElement(yp,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),Y||!A?Q(e):y(!0)},disabled:z.size<1||s||!q,style:{backgroundColor:Z.general?.ctaBackgroundColor||"#121212",color:Z.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${Z.general?.ctaBackgroundColor||"#121212"}`,boxShadow:Z.general.ctaShadowType,paddingTop:Z.general?.ctaPadding,paddingBottom:Z.general?.ctaPadding,borderRadius:Z.general.ctaBorderRadius,width:Z.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{Z.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=Z.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=Z.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{Z.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=Z.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=Z.general?.ctaTextColor||"#FFFFFF")}},s?e.createElement(fe,{color:"white",loading:s,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):q?e.createElement(e.Fragment,null,Z.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),c?.personalizedForm?.title&&e.createElement(Vs,{isOpen:x,onClose:()=>h(!1),formConfig:c.personalizedForm,onCheckout:async e=>{await U(e),h(!1)},cta:{backgroundColor:Z.general?.ctaBackgroundColor||"#121212",textColor:Z.general?.ctaTextColor||"#FFFFFF"},isMobile:p}))},mm=()=>window?.ShopifyAnalytics?.meta?.currency||window?.Shopify?.currency?.active||"USD",um=({product:r,tierIdx:o,isOpen:a,onClose:i,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:m=!1})=>{const[u,g]=t(0),[f,y]=t(r.variants[0]?.id.toString()||""),[x,h]=t(!0),b=r.variants.find(e=>e.id.toString()===f)||r.variants[0],w=r.images.filter(Boolean),v=(e=>{try{const t=new Intl.NumberFormat(void 0,{style:"currency",currency:e}).resolvedOptions().maximumFractionDigits??2;return Math.pow(10,t)}catch{return 100}})(mm()),C=(()=>{const e=mm();return me(e)??e})(),E=()=>{w.length<=1||(g(e=>0===e?w.length-1:e-1),h(!0))},k=()=>{w.length<=1||(g(e=>e===w.length-1?0:e+1),h(!0))};if(n(()=>(a&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[a]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=Sm(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!a)return null;const T=w.length>1,S=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:i},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:i,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px",background:"#f5f5f5"}},w.length>0&&e.createElement(e.Fragment,null,x&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),x&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:d?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:Sm(w[u]||r.images[0]),alt:r.title,onLoad:()=>h(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:x?0:1,transition:"opacity 0.3s"}}),T&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:E,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(X,{size:24})),e.createElement("button",{onClick:k,disabled:u===w.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===w.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===w.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===w.length-1?.5:1}},e.createElement(O,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},m&&b?.name||r.title),!m&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>{y(e.target.value),h(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},C,(b.price/v).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},C,(b.compare_at_price/v).toLocaleString()):null),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:b.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock")),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),N=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:i},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:i,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},w.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},x&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:w[u]||r.images[0],alt:r.title,onLoad:()=>h(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:x?0:1,transition:"opacity 0.3s"}}),T&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:E,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(X,{size:20})),e.createElement("button",{onClick:k,disabled:u===w.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===w.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===w.length-1?.5:1,cursor:u===w.length-1?"not-allowed":"pointer"}},e.createElement(O,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},r.title),!m&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>{y(e.target.value),h(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},C,(b.price/v).toLocaleString(),b.compare_at_price?b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},C,(b.compare_at_price/v).toLocaleString()):null),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&b.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?N:S,document.body)},gm=({styles:t,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)||0}, ${parseInt(n.substring(2,4),16)||0}, ${parseInt(n.substring(4,6),16)||0}, ${t})`};return"tabs"===t?.categoryFilterOnPage?e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-collection-bundle-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,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(c,.07):"transparent",borderBottom:a?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{a||(e.currentTarget.style.color=c)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>{const a=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:r,onClick:()=>i(r),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?a:"#e0e0e0"}`,borderRadius:l,backgroundColor:o===r?a:"white",color:o===r?"white":"#333",cursor:"pointer"}},r.charAt(0).toUpperCase()+r.slice(1))})))},fm=e=>{if(e.metafields&&e.metafields.yourtoken_bundles_app&&e.metafields.yourtoken_bundles_app.categories){const t=e.metafields.yourtoken_bundles_app.categories;if(Array.isArray(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch(e){console.error("Failed to parse categories:",e)}}return[]},ym=()=>window?.ShopifyAnalytics?.meta?.currency||window?.Shopify?.currency?.active||"USD",xm=e=>{try{const t=new Intl.NumberFormat(void 0,{style:"currency",currency:e}).resolvedOptions().maximumFractionDigits??2;return Math.pow(10,t)}catch{return 100}},hm=()=>{const e=ym();return me(e)??e},bm=({config:r,bundleAddToCartLoading:i,addCustomBundleToCart:l,dispatchAnalyticsEvent:c})=>{const[s,d]=t(1),[p,m]=t("All"),[u,g]=t([]),[f,y]=t(null),[x,h]=t({}),[b,w]=t(!1),[v,C]=t(window.innerWidth<640),[E,k]=t({}),T=o(null),S=o(new Map),[N,B]=t(160),[F,z]=t(""),[$,I]=t(""),[P,D]=t(!1),[A,_]=t("none"),L=v?8:20,{customizations:R}=r,O=r.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),M=!!r.config.form,W=O.length+(M?1:0),H=R.hideSelectedProducts,j=R.allowMultipleQty,q=R.hideOutOfStockProducts,U=r.config.splitVariants??!1,Q=o(new Set),Z=a((e,t=p,n=$,r=A)=>{const o=O[e-1]?.products||[];let a="All"===t?o:o.filter(e=>fm(e).includes(t));if(n.trim()){const e=n.toLowerCase();a=a.filter(t=>t.title.toLowerCase().includes(e))}return q&&(a=a.filter(e=>e.available)),"none"!==r&&(a=[...a].sort((e,t)=>{if("asc"===r||"desc"===r){const n=e.price||e.price_min||0,o=t.price||t.price_min||0;return"asc"===r?n-o:o-n}{const n=(e.title||"").toLowerCase(),o=(t.title||"").toLowerCase();return"alpha-asc"===r?n.localeCompare(o):o.localeCompare(n)}})),a},[O,p,$,A,q]),Y=a(e=>{const t=Z(e).length;k(n=>{const r=n[e]||0,o=Math.min(r+8,t);return o<=r?n:{...n,[e]:o}})},[8,Z]);n(()=>{c?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r?.id,bundleType:"collection-bundle"}})},[]),n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===s&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[Y,s]),n(()=>{m("All"),z(""),I(""),D(!1),_("none")},[s]),n(()=>{const e=setTimeout(()=>{I(F)},300);return()=>clearTimeout(e)},[F]),n(()=>{if(M&&s===W)return;const e=s-1;if(!O[e])return;if(Q.current.has(e))return;const t=Z(s);if(1!==t.length)return;const n=t[0],r=n.variants.filter(e=>e.available);if(1!==r.length)return;const o=r[0],a=le(e),i=se[e];if(a!==1/0&&i>=a)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===o.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),g(t=>[...t,{productId:n.id.toString(),variantId:o.id.toString(),price:o.price,quantity:1,tierIndex:e}]),s<W)){const e=setTimeout(()=>{d(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[s]),n(()=>{if(M&&s===W)return;const e=s,t=Z(e).length;k(n=>{const r=n[`${e}_category`]!==p;return 0===(n[e]||0)||r?{...n,[e]:Math.min(L,t),[`${e}_category`]:p}:n})},[s,L,p,Z]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>C(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=a(e=>{B(e+10)},[]),ee=xm(ym()),te=u.reduce((e,t)=>e+t.quantity,0),ne=u.reduce((e,t)=>e+t.price*t.quantity,0)/ee,re=u.reduce((e,t)=>{const n=O.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/ee,oe=e=>{for(let t=0;t<O.length;t++)if(O[t].products.some(t=>t.id.toString()===e))return t+1;return M?W:O.length},ae=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},ie=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),a=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());g(n=>{const i=`${e.id}-${o}-${t}`,l=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(l)return n.filter(e=>e!==l);const s=se[t],d=le(t);return d!==1/0&&s>=d?n:(c?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:r?.id,bundleType:"collection-bundle",addedProduct:{id:e.id,title:e.title},tierIndex:t}}),[...n,{productId:e.id.toString(),variantId:o,price:a,quantity:1,tierIndex:t}])})},le=e=>{const t=O[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ce=(e,t)=>{const n=le(t);if(n===1/0)return!0;const r=se[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||r<n},se=O.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),de=(e,t,n)=>{const r=le(n);if(r===1/0)return!0;return se[n]<r},pe=(e,t,n)=>{g(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},me=async()=>{if(s!==W||!u.length)return;const e={};M&&Object.entries(x).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)}),c?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r?.id,bundleType:"collection-bundle",selectedProducts:u.map(e=>({id:e.productId,variantId:e.variantId,quantity:e.quantity,tierIndex:e.tierIndex}))}});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},ue=M&&s===W,ge=(ue?null:O[s-1])?le(s-1):0,fe=O.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:se[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},R.headerImage&&!R.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:R.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),R.showTierSteps&&e.createElement("div",{style:{paddingTop:R.headerImage&&!R.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(wm,{totalSteps:W,isFormStep:ue,currentStep:s,getStepTitle:e=>M&&e===W?"Customize Gift Details":O[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:r?.config?.form?.title,hasForm:M,onStepClick:e=>{d(e),window.scrollTo(0,0)}})),Array.from({length:W},(e,t)=>t+1).map(t=>{const n=M&&t===W,o=n?[]:(e=>O[e-1]?.products||[])(t);let a=[];if(!n&&R.enableProductCategories){const e=new Set;o.forEach(t=>fm(t).forEach(t=>e.add(t))),a=Array.from(e).sort()}const l=n?[]:Z(t),c=t-1,C=l.slice(0,E[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(s===t?"yt-collection-bundle-step-content-active":""),style:{display:s===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&r.config.form?e.createElement(Ds,{form:r.config.form,formData:x,setFormData:h,barHeight:N,isUploading:b,setIsUploading:w}):e.createElement(e.Fragment,null,R.enableProductCategories&&a.length>0&&e.createElement(gm,{styles:R,isMobile:v,categories:a,activeCategory:p,onCategoryChange:m}),(R.enableSearch||R.enableSort)&&e.createElement("div",{className:"yt-collection-bundle-controls",style:{display:"flex",alignItems:"center",justifyContent:v?"flex-end":"space-between",gap:"12px",padding:"0 16px",marginBottom:"16px",flexWrap:"nowrap",height:"45px"}},v?e.createElement(e.Fragment,null,P?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:F,onChange:e=>z(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:R.borderRadius||"8px",border:`1px solid ${R.bundleBorder||"#878787"}`,background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none"}}),e.createElement("button",{onClick:()=>{D(!1),z(""),I("")},style:{background:"none",border:"none",color:"#888",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"}},e.createElement(G,null))):e.createElement("div",{style:{display:"flex",gap:"20px",alignItems:"center"}},R.enableSearch&&e.createElement("button",{onClick:()=>D(!0),style:{background:"none",border:"none",color:"#333",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center"},className:"yt-collection-bundle-search-btn-mobile"},e.createElement(K,null)),R.enableSort&&e.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"},className:"yt-collection-bundle-sort-selecter-mobile-wrapper"},e.createElement("select",{value:A,onChange:e=>_(e.target.value),style:{position:"absolute",opacity:0,width:"100%",height:"100%",cursor:"pointer",left:0,top:0,zIndex:1},className:"yt-collection-bundle-sort-selecter-mobile"},e.createElement("option",{value:"none"},"Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{fontSize:"20px",color:"#333",pointerEvents:"none",display:"flex",alignItems:"center"}},e.createElement(J,null))))):e.createElement(e.Fragment,null,R.enableSort&&e.createElement("div",{style:{position:"relative",flex:"0 1 200px",marginLeft:"12px",padding:"10px 16px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",display:"flex",flexDirection:"row",alignItems:"center",gap:"6px"},className:"yt-collection-bundle-sort-wrapper"},e.createElement("span",{style:{fontWeight:"500",minWidth:"fit-content",fontSize:"14px"}},"Sort By"),e.createElement("select",{value:A,onChange:e=>_(e.target.value),style:{width:"100%",color:"#333",fontSize:"14px",outline:"none",cursor:"pointer",appearance:"none",boxSizing:"border-box",lineHeight:"normal",border:"none",fontFamily:"inherit"},className:"yt-collection-bundle-sort-selector"},e.createElement("option",{value:"none"}," Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888",pointerEvents:"none"}},e.createElement(V,null))),R.enableSearch&&e.createElement("div",{style:{position:"relative",flex:"0 1 300px"},className:"yt-collection-bundle-search-wrapper"},e.createElement("input",{type:"text",placeholder:"Search products...",value:F,onChange:e=>z(e.target.value),style:{width:"100%",padding:"10px 16px",paddingRight:"40px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none",boxSizing:"border-box",lineHeight:"normal"},className:"yt-collection-bundle-search-input"}),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},e.createElement(K,null))))),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:v?"grid":"flex",gridTemplateColumns:v?"repeat(2,1fr)":"",flexWrap:v?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${N}px`}},0===l.length&&""!==$.trim()?e.createElement("div",{style:{padding:"60px 20px",textAlign:"center",width:"100%",gridColumn:"1 / -1"}},e.createElement("div",{style:{fontSize:"18px",color:"#333",marginBottom:"8px",fontWeight:600}},'No results found for "',F,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{z(""),I(""),D(!1)},style:{background:R.atcBg||"#000",color:R.atcText||"#fff",padding:"12px 32px",borderRadius:R.borderRadius||"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,transition:"opacity 0.2s"},onMouseEnter:e=>e.currentTarget.style.opacity="0.8",onMouseLeave:e=>e.currentTarget.style.opacity="1"},"Clear Search")):U?C.flatMap(t=>t.variants.filter(e=>!q||e.available).map(n=>e.createElement(vm,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:c,customizations:R,isMobile:v,hoveredCard:f,setHoveredCard:y,selectedProducts:u,handleAddToBundle:ie,canAddProduct:ce,allowMultipleQty:j,handleVariantChange:ae,canIncrement:de,setSelectedProducts:g,splitVariants:!0}))):C.map(t=>e.createElement(vm,{key:t.id,product:t,tierIdx:c,customizations:R,isMobile:v,hoveredCard:f,setHoveredCard:y,selectedProducts:u,handleAddToBundle:ie,canAddProduct:ce,allowMultipleQty:j,handleVariantChange:ae,canIncrement:de,setSelectedProducts:g,splitVariants:!1})),s===t&&(E[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),s===t&&e.createElement(Cm,{config:r,selectedProducts:u,selectedByTier:fe,totalItems:te,totalPrice:ne,totalCompareAtPrice:re,currentStep:s,totalSteps:W,currentTierMax:ge,tierSelectedCounts:se,isMobile:v,bundleAddToCartLoading:i,isUploading:b,hoveredCard:f,setHoveredCard:y,hideSelectedProducts:H,getProductStep:oe,setCurrentStep:d,handleRemoveItem:pe,handleCheckout:me,hasForm:M,onHeightChange:X}))}))},wm=({totalSteps:t,isFormStep:r,currentStep:o,getStepTitle:a,isMobile:i,formTitle:l,hasForm:c,onStepClick:s})=>{const d=e.useRef(null);return n(()=>{if(!i||!d.current)return;const e=d.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[o,i]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:i?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:i?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:d,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:i?"flex-start":"center",gap:i?"1rem":"2rem",minWidth:i?100*t+"px":"auto",paddingInline:i?"calc(50% - 60px)":"0",scrollPaddingInline:i?"calc(50% - 60px)":"0",scrollBehavior:"smooth",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:t},(e,t)=>t+1).map(n=>e.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(o===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:i?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:o===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(o===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:o===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},a(n))))),l&&c&&r&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:i?"14px":"16px",marginBottom:i?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},vm=({product:n,tierIdx:r,customizations:o,isMobile:a,hoveredCard:i,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:m,canIncrement:u,setSelectedProducts:g,splitVariants:f=!1})=>{const[y,x]=t(!1),h=f?null:document.querySelector(`[data-product-id="${n.id}"]`),b=f?n.variants[0].id.toString():h?.dataset.selectedVariant??n.variants[0].id.toString(),w=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=xm(ym()),C=hm(),E=f?`${n.id}-${w.id}`:n.id,k=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===r),T=i===E,S=c.filter(e=>e.productId===n.id.toString()&&e.variantId===w.id.toString()&&e.tierIndex===r).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:E,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":w.id,"data-current-price":w.price,style:{display:"flex",flexDirection:"column",border:o?.productCardBorder||"1px solid #ddd",background:o?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:a?0:"250px",maxWidth:a?"none":"250px",borderRadius:o?.borderRadius||"8px",boxShadow:"spread"===o?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===o?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:a?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:o?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>x(!0),onMouseEnter:()=>l(E),onMouseLeave:()=>l(null)},e.createElement("img",{src:Sm(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),onClick:e=>{if(o?.general?.redirectToPDP&&n?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.handle}`}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:T?0:1,transform:T?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:Sm(n.images[1]||n.images[0]),onClick:e=>{if(o?.general?.redirectToPDP&&n?.handle){e.stopPropagation();const t=window?.Shopify?.routes?.root||"/";window.location.href=`${t}products/${n.handle}`}},style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:T?1:0,transform:"scale(1.05)"},alt:n.title}),!f&&n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>m(n,e.target.value),defaultValue:w.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},o.productCardCategoryVisibility&&fm(n).length>0&&e.createElement("div",{className:"yt-collection-bundle-product-categories-wrapper",style:{paddingBottom:"8px"}},e.createElement("div",{className:"yt-collection-bundle-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},fm(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:a?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),fm(n).length>2&&e.createElement("span",{className:"yt-collection-bundle-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",fm(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:a?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:f?0:1}},n.title),f&&"Default Title"!==w.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:a?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},w.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:a?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},C,(w.price/v).toLocaleString()),w.compare_at_price&&0!==w.compare_at_price&&w.compare_at_price>w.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},C,(w.compare_at_price/v).toLocaleString()):null)),p&&S>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:w.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:a?"6px":"12px",fontSize:a?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o&&o.quantity>1?e.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?e.filter(e=>e!==o):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},S),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:w.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:a?"6px":"12px",fontSize:a?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{w.available&&u(n,w.id.toString(),r)&&g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:w.id.toString(),price:w.price,quantity:1,tierIndex:r}]})},disabled:!w.available||!u(n,w.id.toString(),r)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(k?"yt-collection-bundle-add-btn-added":""),style:{background:k?"#28a745":d(n,r)&&w.available?o?.atcBg||"#007bff":"#ccc",color:o?.atcText||"#fff",border:"none",padding:a?"6px":"12px",fontSize:a?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:w.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(f)w.available&&d(n,r)&&g(e=>{const t=`${n.id}-${w.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.filter(e=>e!==o):[...e,{productId:n.id.toString(),variantId:w.id.toString(),price:w.price,quantity:1,tierIndex:r}]});else{if(!w.available||!d(n,r))return;s(n,r)}},disabled:!w.available||!d(n,r)},k?"Added":w.available?"ADD TO BOX":"Out of Stock")),y&&e.createElement(um,{product:n,tierIdx:r,isOpen:y,onClose:()=>x(!1),onAddToBundle:(e,t)=>{s(e,t),x(!1)},canAdd:d(n,r),isSelected:k,customizations:o,isMobile:a,splitVariants:f}))},Cm=r=>{const{config:a,selectedProducts:i,selectedByTier:l,totalItems:c,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:m,currentTierMax:u,tierSelectedCounts:g,isMobile:f,bundleAddToCartLoading:y,isUploading:x,hoveredCard:h,setHoveredCard:b,getProductStep:w,setCurrentStep:v,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=r,{customizations:S}=a,[N,B]=t(!1),F=o(null),z=o(null),$=xm(ym()),I=hm(),{totalOriginal:P,hasSavings:D,formattedSavings:A,totalAfterDiscount:_}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:r})=>{const o=r?.discountData;let a=0;e.forEach(e=>{const t=(e.price||0)/$,n=e.quantity||1;a+=t*n}),t+=a;let i=a;if("mov_percentage"===o?.type&&o.tiers?.length){const e=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>a>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;i=a*(1-t)}}n+=i});const r=Math.round(t-n),o=r>0;return{savings:r,totalOriginal:t,totalAfterDiscount:n,hasSavings:o,formattedSavings:o?`${I}${r.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),L=l.filter(({count:e})=>e>0).map(({tier:e,items:t})=>{const n=t.reduce((e,t)=>{if(!t)return e;return e+(t.price||0)*(t.quantity||1)},0)/$;return((e,t,n)=>{const r=e.discountData;if(!r||!r.tiers?.length)return null;const o=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),a=[];if("mov_percentage"===r.type){if("number"!=typeof n)return null;const e=o.filter(e=>n>=e.minimumQuantity).pop();e&&a.push(`${e.discountValue}% OFF`);const t=o.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;a.push(`Add ${I}${e} more to get ${t.discountValue}% OFF`)}return a.length?a.join(" + "):null}const i=o.filter(e=>t>=e.minimumQuantity);if(i.length>0){const e=i.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(r.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`${I}${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ${I}${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&a.push(t)}const l=o.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(r.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`${I}${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ${I}${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return a.length?a.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=u!==1/0&&g[p-1]===u-2&&u>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[u,g,p]),n(()=>{if(F.current&&T){const e=F.current.offsetHeight;T(e)}},[f,T,i]),n(()=>{const e=Math.max(...l.map(({tier:e,items:t})=>{if("mov_percentage"!==e?.discountData?.type)return 0;const n=t.reduce((e,t)=>e+(t.price||0)*(t.quantity||1),0)/100,r=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return r?.discountValue??0}));if(e<(z.current??0)&&(z.current=e),e>(z.current??0)){z.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;Te({particleCount:100,spread:70,origin:{x:r,y:o},zIndex:9999})}},[l]),e.createElement("div",{ref:F,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"sticky",bottom:"10px",left:"0",right:"0",marginInline:"auto",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},L.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},L.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},N&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},u," item",u>1?"s":"")))),i.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,r)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,r)=>{const o=a.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!o)return null;const i=w(t.productId),l=p===i;return e.createElement("div",{key:r,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&v(i)},e.createElement("img",{src:Sm(o.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<r.length-1&&r[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(Q,null)))))),f?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||a?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:i.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},I,(_??s).toLocaleString()),D?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,P.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",A)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(a?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>v(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===m&&0===c||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===m&&0===c||x?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===m?E:()=>v(p+1),disabled:p===m&&0===c||y||x},y?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(Is,null)):p===m?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(a?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===h&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>v(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:i.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},I,(_??s).toLocaleString()),D?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,P.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",A)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},I,d.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===m&&0===c||x?"yt-collection-bundle-next-btn-disabled":""),"data-gokwik-processed":"true",style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===m&&0===c||x?.6:1,...-2===h&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===m?E:()=>v(p+1),disabled:p===m&&0===c||y||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},y?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(Is,null)):p===m?"Checkout":"Next")))},Em=window?.Shopify?.currency||{rate:1,active:window?.ShopifyAnalytics?.meta?.currency||"INR"},km=e=>{if(!e)return;const t=navigator.language||"en-US";return new Intl.NumberFormat(t).format(Number(e))},Tm=(e,t)=>e||(me(Em.active)||Em.active),Sm=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},Nm=(e,t,n,r,o,a,i)=>{const l=r.findIndex(t=>t.variantId===e&&(void 0===i||t.tierIndex===i));o(0===n?e=>e.filter((e,t)=>t!==l):-1===l?r=>[...r,{product:t,variantId:e,quantity:n,isFree:a,tierIndex:i}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:a,tierIndex:i}:e))},Bm=({bundle:t,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:m,fetchStoreDetails:u,productsPagination:g,categoryFilters:f})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Ms,{bundleAddToCartLoading:l,bundle:t,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:m,fetchStoreDetails:u,productsPagination:g,categoryFilters:f}):"combo"===t.type?e.createElement(Hs,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:m}):"mixAndMatch"===t.type?e.createElement(Jd,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:m}):"collection"===t.type?e.createElement(bm,{config:t,addCustomBundleToCart:o,bundleAddToCartLoading:l,dispatchAnalyticsEvent:m}):e.createElement(wd,{bundle:t,currentProductId:n,addToCartFunction:r,dispatchAnalyticsEvent:m}):e.createElement(pm,{addToCartFunction:r,bundle:t,dispatchAnalyticsEvent:m}),Fm=s.div`
|
|
4644
4644
|
position: relative;
|
|
4645
4645
|
`,zm=s.button`
|
|
4646
4646
|
border: 1px solid #ccc;
|