yt-uikit 0.9.28 → 0.9.29

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
@@ -4673,7 +4673,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4673
4673
  }
4674
4674
  `,Mp=c.span`
4675
4675
  font-size: 12px;
4676
- `,Vp=({productsWithIndices:r,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.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},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};r?.forEach(({product:n,index:o})=>{let r,i=[];if(n.productId===p&&u){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;e&&m(n.productDetails,e.id)>0&&(i=e.title.split(" / "),r=e)}if(!i.length){const e=n.productDetails.variants.edges.find(e=>m(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(i=e.title.split(" / "),r=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[o]=i,r&&(t[o]={node:r},s(o,r.id))}),x(e),y(t)},[r,p,u,s,m]),n(()=>{if(!p||!u)return;const e=r?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,o=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(t.productDetails,o.id)>0){const e=o.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:o}})),s(n,o.id)}},[u,p,r,s,m]);const b=(e,t,n,o)=>{const r=[...g[e]||[]];r[t]=n;const i=r.join(" / "),a=o.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(o.productDetails,a.id)>0},h=(e,t,n)=>{const{product:o}=r?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!b(e,n,t,o))return;const i={...g};i[e][n]=t,x(i);const a=o?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(s(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Sp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement($p,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Np,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),r?.map(({product:t,index:n},o)=>e.createElement(e.Fragment,null,e.createElement(zp,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Ip,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Fp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Pp,{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(Ap,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((o,r)=>{const i=c&&c?.options?.find(e=>e.name===o.name),a=o.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[r]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===o)?.value?e.createElement(Rp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===o)?.value||o,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},e.createElement("span",null)):e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):i&&"image"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===o)?.value?e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)},src:i.values.find(e=>e.name===o)?.value},e.createElement("span",null)):e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},"text"===i?.type&&i.values.find(e=>e.name===o)?.value||o)}))}))),o<r.length-1&&e.createElement(Dp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Bp,{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)},jp=(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}},Wp=({options:o,selectedValue:i,onChange:a,type:l="text"})=>{const[c,s]=t(!1),d=r(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(wp,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Cp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(gp,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(xp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(fp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(yp,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(bp,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(hp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(vp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},Hp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:s="dropdown",accentColor:d="#000000"})=>{const p=(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[u,m]=t(i||[]);n(()=>{i&&i.length>0&&m(i)},[i]),n(()=>{if(l&&o.variants.edges.some(e=>e.node.id.includes(l))){const e=o.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");m(t)}}},[l,o]);const g=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},x=(e,t)=>{const n=u[t];if(!n)return null;return f(e,t).find(e=>e.name===n)||null},f=(e,t)=>{const n=r?.options?.find(t=>t.name===e.name);return e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const r=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const o=[...u||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&p(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})},y=(e,t)=>e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e));return"swatches"===s||"auto"===s?e.createElement(e.Fragment,null,o.options.map((t,n)=>{const i=r?.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"}},o.options.length>1&&y(t,n)?.length>1&&e.createElement("label",{className:"yt-fixedBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},t.name,":"),y(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"}},y(t,n).map(t=>{const r=[...u];r[n]=t;const l=o.options.length>0?r.join(" / "):r[n],c=o.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?p(o,c.id):0),m=u[n]===t;if("color"===i?.type){const n=i.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-color${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:m&&!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:m&&!s?"26px":"24px",height:m&&!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:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}if("image"===i?.type){const n=i.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-image${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{border:m&&!s?`1px solid ${d}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:m&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:m&&!s?"26px":"24px",height:m&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},n?e.createElement("img",{className:"yt-fixedBundle-product-option-image",src:jp(n),alt:t,style:{width:m&&!s?"26px":"24px",height:m&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!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${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{padding:"4px 8px",border:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},"text"===i?.type&&i.values.find(e=>e.name===t)?.value||t)})))})):e.createElement(Ep,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=f(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(kp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(Wp,{options:r,selectedValue:x(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n);const r=o.variants.edges.find(t=>t.node.title===(o.options?.length>0?n.join(" / "):n[e]))?.node.id;a(r||"")})(n,e)},type:g(t.name)}))}))},qp=({product:r,selectedVariantId:a,isChecked:l,canCustomize:c,styles:s,onVariantChange:d,onCheckChange:p,isMobile:u,isHorizontal:m,index:g,variantOptions:x,productsLength:f,handleOpenModal:y,storeCurrencyCode:b,primaryProductId:h,variantId:v,checkedProducts:w,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T})=>{const S=o(()=>e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?r?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[r]),[$,N]=t(r?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),B=o(()=>$?.title?.split(" / ")||[],[$]),z=r?.id===h;n(()=>{if(r.id===h){const e=r?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&S(e.id)>0&&(N(e),d(e.id))}else{const e=r?.variants?.edges?.find(e=>e?.node?.id===a)?.node||r?.variants?.edges?.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node;N(e)}},[r,h,a,v,d,S]);const I=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[r,d]),F=s?.fixedBundle?.discountBadgeDisplay,P=parseFloat($?.price??"0"),D=w?.size===k,A=((e,t,n,o,r,i)=>{if(0===o||!n)return e;if(o!==r)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(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(P,E,C??0,w?.size,k,T),_=D?A:parseFloat($?.price??"0"),R="discount-on-compare"===F?parseFloat($?.compareAtPrice||$?.price||"0"):parseFloat($?.price??"0"),O=!1!==s?.fixedBundle?.discountBadgeVisibility&&(R>_&&s?.fixedBundle?.compareAtPriceVisibility||"discount-on-compare"===F&&s?.fixedBundle?.compareAtPriceVisibility),L=_.toFixed(2),M="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,V=$?.image?.url||r.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(r.id===h?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),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-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:z}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${r.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(X,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(Md,{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(Vd,{className:"yt-fixedBundle-product-card-horizontal_image",src:ou(V),alt:r.title,style:{borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(jd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(Wd,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(Hd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(qd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},nu(s.general.currencySymbol,b)," ",tu(L)),O&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-horizontal_price--old"},nu(s.general.currencySymbol,b),tu(R))),e.createElement(Hp,{product:r,variantOptions:x,selectedVariants:B,onVariantChange:I,variantId:v,primaryProductId:h,variantType:s?.fixedBundle?.variantSelectorType,accentColor:s?.general?.ctaBackgroundColor})))):e.createElement(e.Fragment,null,e.createElement(tp,{className:""+(r.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,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&&{position:"relative"},...M&&{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},c&&e.createElement(Tp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:M},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:z}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${r.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(X,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(np,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(op,{className:"yt-fixedBundle-product-card_image--vertical",src:ou(V),style:{aspectRatio:s.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(rp,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(ip,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(ap,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(lp,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(cp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(sp,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(pp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--new"},nu(s.general.currencySymbol,b),tu(L)),s.fixedBundle.compareAtPriceVisibility&&O&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-vertical_price--old"},nu(s.general.currencySymbol,b),tu(R))))),(f<=3||!u)&&g<f-1&&e.createElement(up,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(mp,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Qp=({bundle:r,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),[f,y]=t(!1),b="undefined"!=typeof window?window.location.href:null,h=r?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=h?.productId,w=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.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},[]),[C,E]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>w(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),k="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),T=r?.showIndividualProductSelector??!0,[S,$]=t(new Set(r.products.reduce((e,t,n)=>(k&&t?.productId!==v&&!T||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");m(e)},t=e=>{const t=history[e];return function(...n){const o=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),o}};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&&E(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const N=i((e,t)=>{E(n=>({...n,[e.toString()]:t}))},[]),B=(e,t)=>{const n=r.products[t].productId;k&&n===v||$(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},z=o(()=>(e,t)=>w(e.productDetails,t)>0,[w]),I=o(()=>r.products.some((e,t)=>S.has(t)&&e.productDetails.variants.edges.length>1),[r.products,S]),{originalPrice:F,dealPrice:P,offerValue:D}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!S.has(n))return e;const o=C[n.toString()];if(!o)return e;const r=t.productDetails.variants.edges?.find(e=>e.node.id===o)?.node;if(!r)return e;const i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n="discount-on-compare"===(r?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?t:e;let o=e;S.size===r.products.length&&(r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff));const i=n-o;return{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2)}},[r.products,C,S,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.fixedBundle?.discountBadgeDisplay]),A=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>S.has(e)),[r.products,S]),_=A.every(({product:e,index:t})=>z(e,C[t.toString()])),R=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(S.has(n)){const o=C[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node;r&&(e+=parseFloat(r.price??"0"))}}),e},[r.products,S,C]),O=async e=>{s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:A?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(C).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!S.has(n)?null:t}).filter(Boolean);a&&await a(Number(F),t,void 0,void 0,e)}catch(e){console.error("Error adding to cart:",e)}s(!1)},L=async e=>{if(_){if(e&&(e.preventDefault(),e.stopPropagation()),r?.personalizedForm?.title)return x(!1),void y(!0);await O()}};if(!a)return e.createElement(e.Fragment,null);const M=r.customizations,V=M.fixedBundle?.cardLayoutStyle||"auto",j="horizontal"===V||"auto"===V&&d,W="bundles"==r.appName?r.pageHeader?.title:r?.title,H="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(_d,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:M.fixedBundle.sectionBackgroundColor,..."transparent"!==M.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},W&&e.createElement(Rd,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:M.fixedBundle?.titleBackgroundColor||"none",color:M.fixedBundle?.titleTextColor||"black",textAlign:M.fixedBundle.infoAlignment??"center",fontSize:M.fixedBundle?.titleFontSize,..."transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},W),H&&e.createElement(Od,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:M.fixedBundle?.subtitleFontSize,textAlign:M.fixedBundle.infoAlignment??"center",..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},H),j?e.createElement(Ld,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n,o)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(qp,{isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>N(n,e),onCheckChange:e=>{B(e,n)},isMobile:d,index:n,isHorizontal:j,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:S,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:R}),n<o.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:d?"1px":"2px",background:"#0000000D",..."none"!==M?.fixedBundle?.shadowType&&{marginTop:"2px"},display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},className:"yt-fixedBundle-plus-icon-wrapper"},e.createElement(_e,{color:"black",style:{height:d?"16px":"24px",width:d?"16px":"24px",color:"black",lineHeight:"nomal"},className:"yt-fixedBundle-plus-icon-svg"})))))):e.createElement(Jd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(ep,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(qp,{key:`${t.productId}-${n}`,isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>{N(n,e)},onCheckChange:e=>B(e,n),isMobile:d,index:n,isHorizontal:j,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:S,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:R})),I&&e.createElement(Vp,{productsWithIndices:A,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:M.general.ctaTextColor,backgroundColor:M.general.ctaBackgroundColor},onVariantChange:N,handleAddToCart:L,primaryProductId:v,variantId:u||void 0}))),e.createElement(Ud,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},Number(F)>0&&Number(D)>0&&M.fixedBundle.compareAtPriceVisibility&&e.createElement(Yd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},nu(M.general.currencySymbol,r?.storeCurrencyCode),tu(F))),0!==S.size&&e.createElement(Gd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},nu(M.general.currencySymbol,r?.storeCurrencyCode),tu(P))," ",Number(D)>0&&e.createElement(Zd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",nu(M.general.currencySymbol,r?.storeCurrencyCode),tu(D)))),e.createElement(Kd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),j||!I?L(e):x(!0)},disabled:S.size<1||c||!_,style:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",color:M.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${M.general?.ctaBackgroundColor||"#121212"}`,boxShadow:M.general.ctaShadowType,paddingTop:M.general?.ctaPadding,paddingBottom:M.general?.ctaPadding,borderRadius:M.general.ctaBorderRadius,width:M.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=M.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=M.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(ge,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?e.createElement(e.Fragment,null,M.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),r?.personalizedForm?.title&&e.createElement(Es,{isOpen:f,onClose:()=>y(!1),formConfig:r.personalizedForm,onCheckout:async e=>{await O(e),y(!1)},cta:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",textColor:M.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},Up=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:u=!1})=>{const[m,g]=t(0),[x,f]=t(o.variants[0]?.id.toString()||""),[y,b]=t(!0),h=o.variants.find(e=>e.id.toString()===x)||o.variants[0],v=o.images.filter(Boolean),w=()=>{v.length<=1||(g(e=>0===e?v.length-1:e-1),b(!0))},C=()=>{v.length<=1||(g(e=>e===v.length-1?0:e+1),b(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=ou(h?.featured_image?.src);e?.setAttribute("src",t)}},[h]),!i)return null;const E=v.length>1,k=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:a},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:a,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"}},v.length>0&&e.createElement(e.Fragment,null,y&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),y&&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:ou(v[m]||o.images[0]),alt:o.title,onLoad:()=>b(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===m?"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===m?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===m?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:m===v.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:m===v.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1}},e.createElement(L,{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"}},u&&h?.name||o.title),!u&&o.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"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},o.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"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).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(o,r),disabled:!c||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),T=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:a},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:a,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}},v.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},y&&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:v[m]||o.images[0],alt:o.title,onLoad:()=>b(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===m?"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===m?.5:1,cursor:0===m?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:m===v.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:m===v.length-1?.5:1,cursor:m===v.length-1?"not-allowed":"pointer"}},e.createElement(L,{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}},o.title),!u&&o.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"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},o.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"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price?h.compare_at_price>h.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toLocaleString()):null),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.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(o,r),disabled:!c||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?T:k,document.body)},Yp=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(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",...o].map(o=>{const i=r===o,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(c,.07):"transparent",borderBottom:i?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=c)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.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",...o].map(o=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:r===o?i:"white",color:r===o?"white":"#333",cursor:"pointer"}},o.charAt(0).toUpperCase()+o.slice(1))})))},Gp=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[]},Xp=({config:o,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,s]=t(1),[d,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(!1),[v,w]=t(window.innerWidth<640),[C,E]=t({}),k=r(null),T=r(new Map),[S,$]=t(160),[N,B]=t(""),[z,I]=t(""),[F,P]=t(!1),[D,A]=t("none"),_=v?8:20,{customizations:R}=o,O=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),L=!!o.config.form,M=O.length+(L?1:0),j=R.hideSelectedProducts,W=R.allowMultipleQty,H=R.hideOutOfStockProducts,q=o.config.splitVariants??!1,Q=r(new Set),U=i((e,t=d,n=z,o=D)=>{const r=O[e-1]?.products||[];let i="All"===t?r:r.filter(e=>Gp(e).includes(t));if(n.trim()){const e=n.toLowerCase();i=i.filter(t=>t.title.toLowerCase().includes(e))}return H&&(i=i.filter(e=>e.available)),"none"!==o&&(i=[...i].sort((e,t)=>{if("asc"===o||"desc"===o){const n=e.price||e.price_min||0,r=t.price||t.price_min||0;return"asc"===o?n-r:r-n}{const n=(e.title||"").toLowerCase(),r=(t.title||"").toLowerCase();return"alpha-asc"===o?n.localeCompare(r):r.localeCompare(n)}})),i},[O,d,z,D,H]),Y=i(e=>{const t=U(e).length;E(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,U]);n(()=>(k.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===c&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[Y,c]),n(()=>{p("All"),B(""),I(""),P(!1),A("none")},[c]),n(()=>{const e=setTimeout(()=>{I(N)},300);return()=>clearTimeout(e)},[N]),n(()=>{if(L&&c===M)return;const e=c-1;if(!O[e])return;if(Q.current.has(e))return;const t=U(c);if(console.log("filteredProducts",t),1!==t.length)return;const n=t[0],o=n.variants.filter(e=>e.available);if(1!==o.length)return;const r=o[0],i=ie(e),a=le[e];if(i!==1/0&&a>=i)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===r.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),m(t=>[...t,{productId:n.id.toString(),variantId:r.id.toString(),price:r.price,quantity:1,tierIndex:e}]),c<M)){const e=setTimeout(()=>{s(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[c]),n(()=>{if(L&&c===M)return;const e=c,t=U(e).length;E(n=>{const o=n[`${e}_category`]!==d;return 0===(n[e]||0)||o?{...n,[e]:Math.min(_,t),[`${e}_category`]:d}:n})},[c,_,d,U]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>w(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=i(e=>{$(e+10)},[]),Z=u.reduce((e,t)=>e+t.quantity,0),ee=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,te=u.reduce((e,t)=>{const n=O.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),o=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(o?.compare_at_price??t.price)*t.quantity},0)/100,ne=e=>{for(let t=0;t<O.length;t++)if(O[t].products.some(t=>t.id.toString()===e))return t+1;return L?M:O.length},oe=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const o=document.querySelector(`[data-product-id="${e.id}"]`);o&&(o.dataset.selectedVariant=t,o.dataset.currentPrice=n.price.toString())},re=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),r=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${o}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=le[t],c=ie(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},ie=e=>{const t=O[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ae=(e,t)=>{const n=ie(t);if(n===1/0)return!0;const o=le[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},le=O.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),ce=(e,t,n)=>{const o=ie(n);if(o===1/0)return!0;return le[n]<o},se=(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},de=async()=>{if(c!==M||!u.length)return;const e={};L&&Object.entries(f).forEach(([t,n])=>{const o=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[o]=n:n&&"object"==typeof n&&"url"in n&&(e[o]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},pe=L&&c===M,ue=(pe?null:O[c-1])?ie(c-1):0,me=O.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,o=e.find(e=>`${e.productId}-${e.variantId}`===n);return o?o.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:le[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(Zp,{totalSteps:M,isFormStep:pe,currentStep:c,getStepTitle:e=>L&&e===M?"Customize Gift Details":O[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:o?.config?.form?.title,hasForm:L,onStepClick:e=>{s(e),window.scrollTo(0,0)}})),Array.from({length:M},(e,t)=>t+1).map(t=>{const n=L&&t===M,r=n?[]:(e=>O[e-1]?.products||[])(t);let i=[];if(!n&&R.enableProductCategories){const e=new Set;r.forEach(t=>Gp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const l=n?[]:U(t),w=t-1,E=l.slice(0,C[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&o.config.form?e.createElement(fs,{form:o.config.form,formData:f,setFormData:y,barHeight:S,isUploading:b,setIsUploading:h}):e.createElement(e.Fragment,null,R.enableProductCategories&&i.length>0&&e.createElement(Yp,{styles:R,isMobile:v,categories:i,activeCategory:d,onCategoryChange:p}),(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,F?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:N,onChange:e=>B(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:()=>{P(!1),B(""),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:()=>P(!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:D,onChange:e=>A(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:D,onChange:e=>A(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:N,onChange:e=>B(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:`${S}px`}},0===l.length&&""!==z.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 "',N,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{B(""),I(""),P(!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")):q?E.flatMap(t=>t.variants.filter(e=>!H||e.available).map(n=>e.createElement(Kp,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:re,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:oe,canIncrement:ce,setSelectedProducts:m,splitVariants:!0}))):E.map(t=>e.createElement(Kp,{key:t.id,product:t,tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:re,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:oe,canIncrement:ce,setSelectedProducts:m,splitVariants:!1})),c===t&&(C[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=T.current.get(t);n&&k.current?.unobserve(n),e?(T.current.set(t,e),k.current?.observe(e)):T.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),c===t&&e.createElement(Jp,{config:o,selectedProducts:u,selectedByTier:me,totalItems:Z,totalPrice:ee,totalCompareAtPrice:te,currentStep:c,totalSteps:M,currentTierMax:ue,tierSelectedCounts:le,isMobile:v,bundleAddToCartLoading:a,isUploading:b,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:j,getProductStep:ne,setCurrentStep:s,handleRemoveItem:se,handleCheckout:de,hasForm:L,onHeightChange:X}))}))},Zp=({totalSteps:t,isFormStep:o,currentStep:r,getStepTitle:i,isMobile:a,formTitle:l,hasForm:c,onStepClick:s})=>{const d=e.useRef(null);return n(()=>{if(!a||!d.current)return;const e=d.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[r,a]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:d,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:a?"flex-start":"center",gap:a?"1rem":"2rem",minWidth:a?100*t+"px":"auto",paddingInline:a?"calc(50% - 60px)":"0",scrollPaddingInline:a?"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 "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:a?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===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:r===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:r===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"}},i(n))))),l&&c&&o&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},Kp=({product:n,tierIdx:o,customizations:r,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g,splitVariants:x=!1})=>{const[f,y]=t(!1),b=x?null:document.querySelector(`[data-product-id="${n.id}"]`),h=x?n.variants[0].id.toString():b?.dataset.selectedVariant??n.variants[0].id.toString(),v=n.variants.find(e=>e.id.toString()===h)||n.variants[0],w=x?`${n.id}-${v.id}`:n.id,C=c.some(e=>e.productId===n.id.toString()&&e.variantId===h&&e.tierIndex===o),E=a===w,k=c.filter(e=>e.productId===n.id.toString()&&e.variantId===v.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:w,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":v.id,"data-current-price":v.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>y(!0),onMouseEnter:()=>l(w),onMouseLeave:()=>l(null)},e.createElement("img",{src:ou(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?0:1,transform:E?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:ou(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?1:0,transform:"scale(1.05)"},alt:n.title}),!x&&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=>u(n,e.target.value),defaultValue:v.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"}},r.productCardCategoryVisibility&&Gp(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"}},Gp(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:i?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),Gp(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"}},"+",Gp(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:i?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:x?0:1}},n.title),x&&"Default Title"!==v.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:i?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},v.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:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(v.price/100).toLocaleString()),v.compare_at_price&&0!==v.compare_at_price&&v.compare_at_price>v.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(v.compare_at_price/100).toLocaleString()):null)),p&&k>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:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r&&r.quantity>1?e.map(e=>e===r?{...e,quantity:e.quantity-1}:e):r?e.filter(e=>e!==r):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},k),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{v.available&&m(n,v.id.toString(),o)&&g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.map(e=>e===r?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:o}]})},disabled:!v.available||!m(n,v.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(C?"yt-collection-bundle-add-btn-added":""),style:{background:C?"#28a745":d(n,o)&&v.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:v.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(x)v.available&&d(n,o)&&g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.filter(e=>e!==r):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:o}]});else{if(!v.available||!d(n,o))return;s(n,o)}},disabled:!v.available||!d(n,o)},C?"Added":v.available?"ADD TO BOX":"Out of Stock")),f&&e.createElement(Up,{product:n,tierIdx:o,isOpen:f,onClose:()=>y(!1),onAddToBundle:(e,t)=>{s(e,t),y(!1)},canAdd:d(n,o),isSelected:C,customizations:r,isMobile:i,splitVariants:x}))},Jp=o=>{const{config:i,selectedProducts:a,selectedByTier:l,totalItems:c,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:g,isMobile:x,bundleAddToCartLoading:f,isUploading:y,hoveredCard:b,setHoveredCard:h,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=o,{customizations:S}=i,[$,N]=t(!1),B=r(null),z=r(null),{totalOriginal:I,hasSavings:F,formattedSavings:P,totalAfterDiscount:D}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:o})=>{const r=o?.discountData;let i=0;e.forEach(e=>{const t=(e.price||0)/100,n=e.quantity||1;i+=t*n}),t+=i;let a=i;if("mov_percentage"===r?.type&&r.tiers?.length){const e=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>i>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;a=i*(1-t)}}n+=a});const o=Math.round(t-n),r=o>0;return{savings:o,totalOriginal:t,totalAfterDiscount:n,hasSavings:r,formattedSavings:r?`₹${o.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),A=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)/100;return((e,t,n)=>{const o=e.discountData;if(!o||!o.tiers?.length)return null;const r=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===o.type){if("number"!=typeof n)return null;const e=r.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=r.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;i.push(`Add ₹${e} more to get ${t.discountValue}% OFF`)}return i.length?i.join(" + "):null}const a=r.filter(e=>t>=e.minimumQuantity);if(a.length>0){const e=a.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(o.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`₹${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ₹${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&i.push(t)}const l=r.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(o.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ₹${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&i.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return i.length?i.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=m!==1/0&&g[p-1]===m-2&&m>1;let t=null;return e?(N(!0),t=setTimeout(()=>{N(!1)},3e3)):N(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(B.current&&T){const e=B.current.offsetHeight;T(e)}},[x,T,a]),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,o=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return o?.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(),o=(n.left+n.width/2)/window.innerWidth,r=(n.top+n.height/2)/window.innerHeight;ke({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:B,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"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&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}},m," item",m>1?"s":"")))),a.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,o)=>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,o)=>{const r=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!r)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:o,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&&w(a)},e.createElement("img",{src:ou(r.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<o.length-1&&o[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(U,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.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:a.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}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.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:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"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===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"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"}},(i?.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===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.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}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",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===u&&0===c||y?"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:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next")))},eu=window?.Shopify?.currency||{rate:1,active:"INR"},tu=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*eu.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},nu=(e,t)=>t==eu.active?e:pe(eu.active)||eu.active,ou=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality",t?.toString()||"70"),o.has("width")||o.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},ru=(e,t,n,o,r,i,a)=>{const l=o.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));r(0===n?e=>e.filter((e,t)=>t!==l):-1===l?o=>[...o,{product:t,variantId:e,quantity:n,isFree:i,tierIndex:a}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:i,tierIndex:a}:e))},iu=({bundle:t,currentProductId:n,addToCartFunction:o,addCustomBundleToCart:r,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Cs,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:r,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g}):"combo"===t.type?e.createElement(Ts,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(Ad,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(Xp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(nd,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(Qp,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),au=c.div`
4676
+ `,Vp=({productsWithIndices:r,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.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},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};r?.forEach(({product:n,index:o})=>{let r,i=[];if(n.productId===p&&u){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;e&&m(n.productDetails,e.id)>0&&(i=e.title.split(" / "),r=e)}if(!i.length){const e=n.productDetails.variants.edges.find(e=>m(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(i=e.title.split(" / "),r=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[o]=i,r&&(t[o]={node:r},s(o,r.id))}),x(e),y(t)},[r,p,u,s,m]),n(()=>{if(!p||!u)return;const e=r?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,o=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(t.productDetails,o.id)>0){const e=o.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:o}})),s(n,o.id)}},[u,p,r,s,m]);const b=(e,t,n,o)=>{const r=[...g[e]||[]];r[t]=n;const i=r.join(" / "),a=o.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(o.productDetails,a.id)>0},h=(e,t,n)=>{const{product:o}=r?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!b(e,n,t,o))return;const i={...g};i[e][n]=t,x(i);const a=o?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(s(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Sp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement($p,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Np,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),r?.map(({product:t,index:n},o)=>e.createElement(e.Fragment,null,e.createElement(zp,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Ip,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Fp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Pp,{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(Ap,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((o,r)=>{const i=c&&c?.options?.find(e=>e.name===o.name),a=o.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[r]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===o)?.value?e.createElement(Rp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===o)?.value||o,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},e.createElement("span",null)):e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):i&&"image"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===o)?.value?e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)},src:i.values.find(e=>e.name===o)?.value},e.createElement("span",null)):e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(Op,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},"text"===i?.type&&i.values.find(e=>e.name===o)?.value||o)}))}))),o<r.length-1&&e.createElement(Dp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Bp,{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)},jp=(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}},Wp=({options:o,selectedValue:i,onChange:a,type:l="text"})=>{const[c,s]=t(!1),d=r(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(wp,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Cp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(gp,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(xp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(fp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(yp,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(bp,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(hp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(vp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},Hp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:s="dropdown",accentColor:d="#000000"})=>{const p=(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[u,m]=t(i||[]);n(()=>{i&&i.length>0&&m(i)},[i]),n(()=>{if(l&&o.variants.edges.some(e=>e.node.id.includes(l))){const e=o.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");m(t)}}},[l,o]);const g=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},x=(e,t)=>{const n=u[t];if(!n)return null;return f(e,t).find(e=>e.name===n)||null},f=(e,t)=>{const n=r?.options?.find(t=>t.name===e.name);return e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const r=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const o=[...u||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&p(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})},y=(e,t)=>e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e));return"swatches"===s||"auto"===s?e.createElement(e.Fragment,null,o.options.map((t,n)=>{const i=r?.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"}},o.options.length>1&&y(t,n)?.length>1&&e.createElement("label",{className:"yt-fixedBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},t.name,":"),y(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"}},y(t,n).map(t=>{const r=[...u];r[n]=t;const l=o.options.length>0?r.join(" / "):r[n],c=o.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?p(o,c.id):0),m=u[n]===t;if("color"===i?.type){const n=i.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-color${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:m&&!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:m&&!s?"26px":"24px",height:m&&!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:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},t))}if("image"===i?.type){const n=i.values.find(e=>e.name===t)?.value;return e.createElement("button",{key:t,className:`yt-fixedBundle-product-option-button-image${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{border:m&&!s?`1px solid ${d}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:m&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:m&&!s?"26px":"24px",height:m&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},n?e.createElement("img",{className:"yt-fixedBundle-product-option-image",src:jp(n),alt:t,style:{width:m&&!s?"26px":"24px",height:m&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{className:"yt-fixedBundle-product-option-text",style:{padding:"4px 8px",border:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!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${m?" yt-fixedBundle-product-option-button-selected":""}${s?" yt-fixedBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&a(c.id)},disabled:s,style:{padding:"4px 8px",border:m&&!s?`1px solid ${d}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:m&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},"text"===i?.type&&i.values.find(e=>e.name===t)?.value||t)})))})):e.createElement(Ep,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=f(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(kp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(Wp,{options:r,selectedValue:x(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n);const r=o.variants.edges.find(t=>t.node.title===(o.options?.length>0?n.join(" / "):n[e]))?.node.id;a(r||"")})(n,e)},type:g(t.name)}))}))},qp=({product:r,selectedVariantId:a,isChecked:l,canCustomize:c,styles:s,onVariantChange:d,onCheckChange:p,isMobile:u,isHorizontal:m,index:g,variantOptions:x,productsLength:f,handleOpenModal:y,storeCurrencyCode:b,primaryProductId:h,variantId:v,checkedProducts:w,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T})=>{const S="23e4dd-58.myshopify.com"!==window.Shopify?.shop,$=o(()=>e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?r?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[r]),[N,B]=t(r?.variants?.edges.find(e=>$(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),z=o(()=>N?.title?.split(" / ")||[],[N]),I=r?.id===h;n(()=>{if(r.id===h){const e=r?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&$(e.id)>0&&(B(e),d(e.id))}else{const e=r?.variants?.edges?.find(e=>e?.node?.id===a)?.node||r?.variants?.edges?.find(e=>$(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node;B(e)}},[r,h,a,v,d,$]);const F=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[r,d]),P=s?.fixedBundle?.discountBadgeDisplay,D=parseFloat(N?.price??"0"),A=w?.size===k,_=((e,t,n,o,r,i)=>{if(0===o||!n)return e;if(o!==r)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(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(D,E,C??0,w?.size,k,T),R=A?_:parseFloat(N?.price??"0"),O="discount-on-compare"===P?parseFloat(N?.compareAtPrice||N?.price||"0"):parseFloat(N?.price??"0"),L=!1!==s?.fixedBundle?.discountBadgeVisibility&&(O>R&&s?.fixedBundle?.compareAtPriceVisibility||"discount-on-compare"===P&&s?.fixedBundle?.compareAtPriceVisibility),M=(e=>{const t="string"==typeof e?parseFloat(e):e;return S?t.toFixed(2):Math.round(t).toString()})(R),V="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,j=N?.image?.url||r.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(r.id===h?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),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-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:I}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${r.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(X,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(Md,{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(Vd,{className:"yt-fixedBundle-product-card-horizontal_image",src:ou(j),alt:r.title,style:{borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(jd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(Wd,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(Hd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(qd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},nu(s.general.currencySymbol,b)," ",tu(M)),L&&O>R&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-horizontal_price--old"},nu(s.general.currencySymbol,b),tu(S?O.toFixed(2):Math.round(O).toString()))),e.createElement(Hp,{product:r,variantOptions:x,selectedVariants:z,onVariantChange:F,variantId:v,primaryProductId:h,variantType:s?.fixedBundle?.variantSelectorType,accentColor:s?.general?.ctaBackgroundColor})))):e.createElement(e.Fragment,null,e.createElement(tp,{className:""+(r.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,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&&{position:"relative"},...V&&{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},c&&e.createElement(Tp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:V},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:I}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${r.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(X,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(np,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(op,{className:"yt-fixedBundle-product-card_image--vertical",src:ou(j),style:{aspectRatio:s.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(rp,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(ip,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(ap,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(lp,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(cp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(sp,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(pp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--new"},nu(s.general.currencySymbol,b),tu(M)),s.fixedBundle.compareAtPriceVisibility&&L&&O>R&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-vertical_price--old"},nu(s.general.currencySymbol,b),tu(O))))),(f<=3||!u)&&g<f-1&&e.createElement(up,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(mp,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Qp=({bundle:r,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),[f,y]=t(!1),b="undefined"!=typeof window?window.location.href:null,h=r?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=h?.productId,w=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.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},[]),[C,E]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>w(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),k="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),T=r?.showIndividualProductSelector??!0,[S,$]=t(new Set(r.products.reduce((e,t,n)=>(k&&t?.productId!==v&&!T||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");m(e)},t=e=>{const t=history[e];return function(...n){const o=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),o}};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&&E(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const N=i((e,t)=>{E(n=>({...n,[e.toString()]:t}))},[]),B=(e,t)=>{const n=r.products[t].productId;k&&n===v||$(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},z=o(()=>(e,t)=>w(e.productDetails,t)>0,[w]),I=o(()=>r.products.some((e,t)=>S.has(t)&&e.productDetails.variants.edges.length>1),[r.products,S]),F="23e4dd-58.myshopify.com"!==window.Shopify?.shop,P=e=>{const t="string"==typeof e?parseFloat(e):e;return F?t.toFixed(2):Math.round(t).toString()},{originalPrice:D,dealPrice:A,offerValue:_}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!S.has(n))return e;const o=C[n.toString()];if(!o)return e;const r=t.productDetails.variants.edges?.find(e=>e.node.id===o)?.node;if(!r)return e;const i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n="discount-on-compare"===(r?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?t:e;let o=e;S.size===r.products.length&&(r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff));const i=n-o;return{originalPrice:P(n),dealPrice:P(o),offerValue:P(i)}},[r.products,C,S,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.fixedBundle?.discountBadgeDisplay]),R=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>S.has(e)),[r.products,S]),O=R.every(({product:e,index:t})=>z(e,C[t.toString()])),L=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(S.has(n)){const o=C[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node;r&&(e+=parseFloat(r.price??"0"))}}),e},[r.products,S,C]),M=async e=>{s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:R?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(C).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!S.has(n)?null:t}).filter(Boolean);a&&await a(Number(D),t,void 0,void 0,e)}catch(e){console.error("Error adding to cart:",e)}s(!1)},V=async e=>{if(O){if(e&&(e.preventDefault(),e.stopPropagation()),r?.personalizedForm?.title)return x(!1),void y(!0);await M()}};if(!a)return e.createElement(e.Fragment,null);const j=r.customizations,W=j.fixedBundle?.cardLayoutStyle||"auto",H="horizontal"===W||"auto"===W&&d,q="bundles"==r.appName?r.pageHeader?.title:r?.title,Q="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(_d,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:j.fixedBundle.sectionBackgroundColor,..."transparent"!==j.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},q&&e.createElement(Rd,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:j.fixedBundle?.titleBackgroundColor||"none",color:j.fixedBundle?.titleTextColor||"black",textAlign:j.fixedBundle.infoAlignment??"center",fontSize:j.fixedBundle?.titleFontSize,..."transparent"!==j.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===j.fixedBundle.infoAlignment&&"transparent"!==j.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===j.fixedBundle.infoAlignment&&"transparent"!==j.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===j.fixedBundle.infoAlignment&&"transparent"===j.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},q),Q&&e.createElement(Od,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:j.fixedBundle?.subtitleFontSize,textAlign:j.fixedBundle.infoAlignment??"center",..."left"===j.fixedBundle.infoAlignment&&"transparent"!==j.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===j.fixedBundle.infoAlignment&&"transparent"!==j.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===j.fixedBundle.infoAlignment&&"transparent"===j.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},Q),H?e.createElement(Ld,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n,o)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(qp,{isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:j,onVariantChange:e=>N(n,e),onCheckChange:e=>{B(e,n)},isMobile:d,index:n,isHorizontal:H,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:S,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:L}),n<o.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:d?"1px":"2px",background:"#0000000D",..."none"!==j?.fixedBundle?.shadowType&&{marginTop:"2px"},display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},className:"yt-fixedBundle-plus-icon-wrapper"},e.createElement(_e,{color:"black",style:{height:d?"16px":"24px",width:d?"16px":"24px",color:"black",lineHeight:"nomal"},className:"yt-fixedBundle-plus-icon-svg"})))))):e.createElement(Jd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(ep,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===j.fixedBundle.infoAlignment?"flex-start":"right"===j.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(qp,{key:`${t.productId}-${n}`,isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:j,onVariantChange:e=>{N(n,e)},onCheckChange:e=>B(e,n),isMobile:d,index:n,isHorizontal:H,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:S,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:L})),I&&e.createElement(Vp,{productsWithIndices:R,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:j.general.ctaTextColor,backgroundColor:j.general.ctaBackgroundColor},onVariantChange:N,handleAddToCart:V,primaryProductId:v,variantId:u||void 0}))),e.createElement(Ud,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===j.fixedBundle.infoAlignment?"flex-start":"right"===j.fixedBundle.infoAlignment?"flex-end":"center"}},Number(D)>0&&Number(_)>0&&j.fixedBundle.compareAtPriceVisibility&&e.createElement(Yd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},nu(j.general.currencySymbol,r?.storeCurrencyCode),tu(D))),0!==S.size&&e.createElement(Gd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},nu(j.general.currencySymbol,r?.storeCurrencyCode),tu(A))," ",Number(_)>0&&e.createElement(Zd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",nu(j.general.currencySymbol,r?.storeCurrencyCode),tu(_)))),e.createElement(Kd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),H||!I?V(e):x(!0)},disabled:S.size<1||c||!O,style:{backgroundColor:j.general?.ctaBackgroundColor||"#121212",color:j.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${j.general?.ctaBackgroundColor||"#121212"}`,boxShadow:j.general.ctaShadowType,paddingTop:j.general?.ctaPadding,paddingBottom:j.general?.ctaPadding,borderRadius:j.general.ctaBorderRadius,width:j.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{j.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=j.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=j.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{j.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=j.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=j.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(ge,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):O?e.createElement(e.Fragment,null,j.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),r?.personalizedForm?.title&&e.createElement(Es,{isOpen:f,onClose:()=>y(!1),formConfig:r.personalizedForm,onCheckout:async e=>{await M(e),y(!1)},cta:{backgroundColor:j.general?.ctaBackgroundColor||"#121212",textColor:j.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},Up=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:u=!1})=>{const[m,g]=t(0),[x,f]=t(o.variants[0]?.id.toString()||""),[y,b]=t(!0),h=o.variants.find(e=>e.id.toString()===x)||o.variants[0],v=o.images.filter(Boolean),w=()=>{v.length<=1||(g(e=>0===e?v.length-1:e-1),b(!0))},C=()=>{v.length<=1||(g(e=>e===v.length-1?0:e+1),b(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=ou(h?.featured_image?.src);e?.setAttribute("src",t)}},[h]),!i)return null;const E=v.length>1,k=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:a},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:a,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"}},v.length>0&&e.createElement(e.Fragment,null,y&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),y&&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:ou(v[m]||o.images[0]),alt:o.title,onLoad:()=>b(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===m?"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===m?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===m?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:m===v.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:m===v.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1}},e.createElement(L,{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"}},u&&h?.name||o.title),!u&&o.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"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},o.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"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).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(o,r),disabled:!c||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),T=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:a},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:a,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}},v.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},y&&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:v[m]||o.images[0],alt:o.title,onLoad:()=>b(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===m?"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===m?.5:1,cursor:0===m?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:m===v.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:m===v.length-1?.5:1,cursor:m===v.length-1?"not-allowed":"pointer"}},e.createElement(L,{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}},o.title),!u&&o.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"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},o.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"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price?h.compare_at_price>h.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toLocaleString()):null),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.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(o,r),disabled:!c||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?T:k,document.body)},Yp=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(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",...o].map(o=>{const i=r===o,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(c,.07):"transparent",borderBottom:i?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=c)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.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",...o].map(o=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:r===o?i:"white",color:r===o?"white":"#333",cursor:"pointer"}},o.charAt(0).toUpperCase()+o.slice(1))})))},Gp=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[]},Xp=({config:o,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,s]=t(1),[d,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(!1),[v,w]=t(window.innerWidth<640),[C,E]=t({}),k=r(null),T=r(new Map),[S,$]=t(160),[N,B]=t(""),[z,I]=t(""),[F,P]=t(!1),[D,A]=t("none"),_=v?8:20,{customizations:R}=o,O=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),L=!!o.config.form,M=O.length+(L?1:0),j=R.hideSelectedProducts,W=R.allowMultipleQty,H=R.hideOutOfStockProducts,q=o.config.splitVariants??!1,Q=r(new Set),U=i((e,t=d,n=z,o=D)=>{const r=O[e-1]?.products||[];let i="All"===t?r:r.filter(e=>Gp(e).includes(t));if(n.trim()){const e=n.toLowerCase();i=i.filter(t=>t.title.toLowerCase().includes(e))}return H&&(i=i.filter(e=>e.available)),"none"!==o&&(i=[...i].sort((e,t)=>{if("asc"===o||"desc"===o){const n=e.price||e.price_min||0,r=t.price||t.price_min||0;return"asc"===o?n-r:r-n}{const n=(e.title||"").toLowerCase(),r=(t.title||"").toLowerCase();return"alpha-asc"===o?n.localeCompare(r):r.localeCompare(n)}})),i},[O,d,z,D,H]),Y=i(e=>{const t=U(e).length;E(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,U]);n(()=>(k.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===c&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[Y,c]),n(()=>{p("All"),B(""),I(""),P(!1),A("none")},[c]),n(()=>{const e=setTimeout(()=>{I(N)},300);return()=>clearTimeout(e)},[N]),n(()=>{if(L&&c===M)return;const e=c-1;if(!O[e])return;if(Q.current.has(e))return;const t=U(c);if(console.log("filteredProducts",t),1!==t.length)return;const n=t[0],o=n.variants.filter(e=>e.available);if(1!==o.length)return;const r=o[0],i=ie(e),a=le[e];if(i!==1/0&&a>=i)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===r.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),m(t=>[...t,{productId:n.id.toString(),variantId:r.id.toString(),price:r.price,quantity:1,tierIndex:e}]),c<M)){const e=setTimeout(()=>{s(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[c]),n(()=>{if(L&&c===M)return;const e=c,t=U(e).length;E(n=>{const o=n[`${e}_category`]!==d;return 0===(n[e]||0)||o?{...n,[e]:Math.min(_,t),[`${e}_category`]:d}:n})},[c,_,d,U]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>w(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=i(e=>{$(e+10)},[]),Z=u.reduce((e,t)=>e+t.quantity,0),ee=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,te=u.reduce((e,t)=>{const n=O.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),o=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(o?.compare_at_price??t.price)*t.quantity},0)/100,ne=e=>{for(let t=0;t<O.length;t++)if(O[t].products.some(t=>t.id.toString()===e))return t+1;return L?M:O.length},oe=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const o=document.querySelector(`[data-product-id="${e.id}"]`);o&&(o.dataset.selectedVariant=t,o.dataset.currentPrice=n.price.toString())},re=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),r=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${o}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=le[t],c=ie(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},ie=e=>{const t=O[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ae=(e,t)=>{const n=ie(t);if(n===1/0)return!0;const o=le[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},le=O.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),ce=(e,t,n)=>{const o=ie(n);if(o===1/0)return!0;return le[n]<o},se=(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},de=async()=>{if(c!==M||!u.length)return;const e={};L&&Object.entries(f).forEach(([t,n])=>{const o=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[o]=n:n&&"object"==typeof n&&"url"in n&&(e[o]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},pe=L&&c===M,ue=(pe?null:O[c-1])?ie(c-1):0,me=O.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,o=e.find(e=>`${e.productId}-${e.variantId}`===n);return o?o.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:le[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(Zp,{totalSteps:M,isFormStep:pe,currentStep:c,getStepTitle:e=>L&&e===M?"Customize Gift Details":O[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:o?.config?.form?.title,hasForm:L,onStepClick:e=>{s(e),window.scrollTo(0,0)}})),Array.from({length:M},(e,t)=>t+1).map(t=>{const n=L&&t===M,r=n?[]:(e=>O[e-1]?.products||[])(t);let i=[];if(!n&&R.enableProductCategories){const e=new Set;r.forEach(t=>Gp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const l=n?[]:U(t),w=t-1,E=l.slice(0,C[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&o.config.form?e.createElement(fs,{form:o.config.form,formData:f,setFormData:y,barHeight:S,isUploading:b,setIsUploading:h}):e.createElement(e.Fragment,null,R.enableProductCategories&&i.length>0&&e.createElement(Yp,{styles:R,isMobile:v,categories:i,activeCategory:d,onCategoryChange:p}),(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,F?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:N,onChange:e=>B(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:()=>{P(!1),B(""),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:()=>P(!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:D,onChange:e=>A(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:D,onChange:e=>A(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:N,onChange:e=>B(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:`${S}px`}},0===l.length&&""!==z.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 "',N,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{B(""),I(""),P(!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")):q?E.flatMap(t=>t.variants.filter(e=>!H||e.available).map(n=>e.createElement(Kp,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:re,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:oe,canIncrement:ce,setSelectedProducts:m,splitVariants:!0}))):E.map(t=>e.createElement(Kp,{key:t.id,product:t,tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:re,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:oe,canIncrement:ce,setSelectedProducts:m,splitVariants:!1})),c===t&&(C[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=T.current.get(t);n&&k.current?.unobserve(n),e?(T.current.set(t,e),k.current?.observe(e)):T.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),c===t&&e.createElement(Jp,{config:o,selectedProducts:u,selectedByTier:me,totalItems:Z,totalPrice:ee,totalCompareAtPrice:te,currentStep:c,totalSteps:M,currentTierMax:ue,tierSelectedCounts:le,isMobile:v,bundleAddToCartLoading:a,isUploading:b,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:j,getProductStep:ne,setCurrentStep:s,handleRemoveItem:se,handleCheckout:de,hasForm:L,onHeightChange:X}))}))},Zp=({totalSteps:t,isFormStep:o,currentStep:r,getStepTitle:i,isMobile:a,formTitle:l,hasForm:c,onStepClick:s})=>{const d=e.useRef(null);return n(()=>{if(!a||!d.current)return;const e=d.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[r,a]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:d,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:a?"flex-start":"center",gap:a?"1rem":"2rem",minWidth:a?100*t+"px":"auto",paddingInline:a?"calc(50% - 60px)":"0",scrollPaddingInline:a?"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 "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:a?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===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:r===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:r===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"}},i(n))))),l&&c&&o&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},Kp=({product:n,tierIdx:o,customizations:r,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g,splitVariants:x=!1})=>{const[f,y]=t(!1),b=x?null:document.querySelector(`[data-product-id="${n.id}"]`),h=x?n.variants[0].id.toString():b?.dataset.selectedVariant??n.variants[0].id.toString(),v=n.variants.find(e=>e.id.toString()===h)||n.variants[0],w=x?`${n.id}-${v.id}`:n.id,C=c.some(e=>e.productId===n.id.toString()&&e.variantId===h&&e.tierIndex===o),E=a===w,k=c.filter(e=>e.productId===n.id.toString()&&e.variantId===v.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:w,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":v.id,"data-current-price":v.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>y(!0),onMouseEnter:()=>l(w),onMouseLeave:()=>l(null)},e.createElement("img",{src:ou(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?0:1,transform:E?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:ou(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?1:0,transform:"scale(1.05)"},alt:n.title}),!x&&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=>u(n,e.target.value),defaultValue:v.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"}},r.productCardCategoryVisibility&&Gp(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"}},Gp(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:i?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),Gp(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"}},"+",Gp(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:i?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:x?0:1}},n.title),x&&"Default Title"!==v.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:i?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},v.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:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(v.price/100).toLocaleString()),v.compare_at_price&&0!==v.compare_at_price&&v.compare_at_price>v.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(v.compare_at_price/100).toLocaleString()):null)),p&&k>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:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r&&r.quantity>1?e.map(e=>e===r?{...e,quantity:e.quantity-1}:e):r?e.filter(e=>e!==r):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},k),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{v.available&&m(n,v.id.toString(),o)&&g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.map(e=>e===r?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:o}]})},disabled:!v.available||!m(n,v.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(C?"yt-collection-bundle-add-btn-added":""),style:{background:C?"#28a745":d(n,o)&&v.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:v.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(x)v.available&&d(n,o)&&g(e=>{const t=`${n.id}-${v.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.filter(e=>e!==r):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:o}]});else{if(!v.available||!d(n,o))return;s(n,o)}},disabled:!v.available||!d(n,o)},C?"Added":v.available?"ADD TO BOX":"Out of Stock")),f&&e.createElement(Up,{product:n,tierIdx:o,isOpen:f,onClose:()=>y(!1),onAddToBundle:(e,t)=>{s(e,t),y(!1)},canAdd:d(n,o),isSelected:C,customizations:r,isMobile:i,splitVariants:x}))},Jp=o=>{const{config:i,selectedProducts:a,selectedByTier:l,totalItems:c,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:g,isMobile:x,bundleAddToCartLoading:f,isUploading:y,hoveredCard:b,setHoveredCard:h,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=o,{customizations:S}=i,[$,N]=t(!1),B=r(null),z=r(null),{totalOriginal:I,hasSavings:F,formattedSavings:P,totalAfterDiscount:D}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:o})=>{const r=o?.discountData;let i=0;e.forEach(e=>{const t=(e.price||0)/100,n=e.quantity||1;i+=t*n}),t+=i;let a=i;if("mov_percentage"===r?.type&&r.tiers?.length){const e=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>i>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;a=i*(1-t)}}n+=a});const o=Math.round(t-n),r=o>0;return{savings:o,totalOriginal:t,totalAfterDiscount:n,hasSavings:r,formattedSavings:r?`₹${o.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),A=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)/100;return((e,t,n)=>{const o=e.discountData;if(!o||!o.tiers?.length)return null;const r=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===o.type){if("number"!=typeof n)return null;const e=r.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=r.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;i.push(`Add ₹${e} more to get ${t.discountValue}% OFF`)}return i.length?i.join(" + "):null}const a=r.filter(e=>t>=e.minimumQuantity);if(a.length>0){const e=a.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(o.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`₹${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ₹${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&i.push(t)}const l=r.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(o.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ₹${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&i.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return i.length?i.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=m!==1/0&&g[p-1]===m-2&&m>1;let t=null;return e?(N(!0),t=setTimeout(()=>{N(!1)},3e3)):N(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(B.current&&T){const e=B.current.offsetHeight;T(e)}},[x,T,a]),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,o=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return o?.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(),o=(n.left+n.width/2)/window.innerWidth,r=(n.top+n.height/2)/window.innerHeight;ke({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:B,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"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&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}},m," item",m>1?"s":"")))),a.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,o)=>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,o)=>{const r=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!r)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:o,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&&w(a)},e.createElement("img",{src:ou(r.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<o.length-1&&o[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(U,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.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:a.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}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.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:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"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===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"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"}},(i?.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===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.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}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",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===u&&0===c||y?"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:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next")))},eu=window?.Shopify?.currency||{rate:1,active:"INR"},tu=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*eu.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},nu=(e,t)=>t==eu.active?e:pe(eu.active)||eu.active,ou=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality",t?.toString()||"70"),o.has("width")||o.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},ru=(e,t,n,o,r,i,a)=>{const l=o.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));r(0===n?e=>e.filter((e,t)=>t!==l):-1===l?o=>[...o,{product:t,variantId:e,quantity:n,isFree:i,tierIndex:a}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:i,tierIndex:a}:e))},iu=({bundle:t,currentProductId:n,addToCartFunction:o,addCustomBundleToCart:r,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Cs,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:r,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g}):"combo"===t.type?e.createElement(Ts,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(Ad,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(Xp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(nd,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(Qp,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),au=c.div`
4677
4677
  position: relative;
4678
4678
  `,lu=c.button`
4679
4679
  border: 1px solid #ccc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.9.28",
3
+ "version": "0.9.29",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",